answer
stringlengths
15
1.25M
// <API key>.h // MongoIM #import "<API key>.h" #import <UIKit/UIKit.h> #import "DFVideoDecoder.h" @interface <API key> : <API key> @property (nonatomic, strong) UIImage *cover; @property (nonatomic, strong) NSString *url; @property (nonatomic, strong) NSString *filePath; @property (nonatomic, strong) DFVideoDecoder *decorder; @end
package com.zk.web.interceptor; import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.Ordered; import org.springframework.http.HttpStatus; import org.springframework.validation.BindException; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.<API key>; import org.springframework.web.servlet.ModelAndView; public class <API key> implements <API key>, Ordered { private static final Logger LOGGER = LoggerFactory.getLogger(<API key>.class); public int getOrder() { return Integer.MIN_VALUE; } public ModelAndView resolveException(HttpServletRequest aReq, HttpServletResponse aRes, Object aHandler, Exception exception) { if (aHandler instanceof HandlerMethod) { if (exception instanceof BindException) { return null; } } LOGGER.error(StringUtils.EMPTY, exception); ModelAndView mav = new ModelAndView("common/error"); String errorMsg = exception.getMessage(); aRes.setStatus(HttpStatus.<API key>.value()); if ("XMLHttpRequest".equals(aReq.getHeader("X-Requested-With"))) { try { aRes.setContentType("application/text; charset=utf-8"); PrintWriter writer = aRes.getWriter(); aRes.setStatus(HttpServletResponse.SC_FORBIDDEN); writer.print(errorMsg); writer.flush(); writer.close(); return null; } catch (IOException e) { LOGGER.error(e.getMessage(), e); } } mav.addObject("errorMsg", errorMsg); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw, true); exception.printStackTrace(pw); mav.addObject("stackTrace", sw.getBuffer().toString()); mav.addObject("exception", exception); return mav; } }
package org.jboss.resteasy.reactive.server.vertx.test; import static org.junit.jupiter.api.Assertions.fail; import io.smallrye.common.annotation.Blocking; import io.smallrye.common.annotation.NonBlocking; import java.util.function.Supplier; import javax.enterprise.inject.spi.DeploymentException; import javax.ws.rs.Path; import org.jboss.resteasy.reactive.server.vertx.test.framework.<API key>; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; public class <API key> { @RegisterExtension static <API key> test = new <API key>() .setArchiveProducer(new Supplier<>() { @Override public JavaArchive get() { return ShrinkWrap.create(JavaArchive.class) .addClasses(Resource.class); } }).<API key>(DeploymentException.class); @Test public void test() { fail("Should never have been called"); } @Path("test") @Blocking @NonBlocking public static class Resource { @Path("hello") public String hello() { return "hello"; } } }
#ifdef __OBJC__ #import <UIKit/UIKit.h> #endif FOUNDATION_EXPORT double <API key>; FOUNDATION_EXPORT const unsigned char <API key>[];
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="zh"> <head> <!-- Generated by javadoc (1.8.0_111) on Mon Oct 22 12:02:26 CST 2018 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title> com.dtstack.jlogstash.format (hdfs 1.0.0 API)</title> <meta name="date" content="2018-10-22"> <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="\u7A0B\u5E8F\u5305 com.dtstack.jlogstash.format\u7684\u4F7F\u7528 (hdfs 1.0.0 API)"; } } catch(err) { } </script> <noscript> <div> JavaScript</div> </noscript> <div class="topNav"><a name="navbar.top"> </a> <div class="skipNav"><a href="#skip.navbar.top" title=""></a></div> <a name="navbar.top.firstrow"> </a> <ul class="navList" title=""> <li><a href="../../../../overview-summary.html"></a></li> <li><a href="package-summary.html"></a></li> <li></li> <li class="navBarCell1Rev"></li> <li><a href="package-tree.html"></a></li> <li><a href="../../../../deprecated-list.html"></a></li> <li><a href="../../../../index-all.html"></a></li> <li><a href="../../../../help-doc.html"></a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li></li> <li></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/dtstack/jlogstash/format/package-use.html" target="_top"></a></li> <li><a href="package-use.html" target="_top"></a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../allclasses-noframe.html"></a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip.navbar.top"> </a></div> <div class="header"> <h1 title=" com.dtstack.jlogstash.format" class="title"><br>com.dtstack.jlogstash.format</h1> </div> <div class="contentContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary=", "> <caption><span><a href="../../../../com/dtstack/jlogstash/format/package-summary.html">com.dtstack.jlogstash.format</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col"></th> <th class="colLast" scope="col"></th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#com.dtstack.jlogstash.format">com.dtstack.jlogstash.format</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#com.dtstack.jlogstash.format.plugin">com.dtstack.jlogstash.format.plugin</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="#com.dtstack.jlogstash.outputs">com.dtstack.jlogstash.outputs</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"><a name="com.dtstack.jlogstash.format"> </a> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary=", "> <caption><span><a href="../../../../com/dtstack/jlogstash/format/package-summary.html">com.dtstack.jlogstash.format</a><a href="../../../../com/dtstack/jlogstash/format/package-summary.html">com.dtstack.jlogstash.format</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col"></th> </tr> <tbody> <tr class="altColor"> <td class="colOne"><a href="../../../../com/dtstack/jlogstash/format/class-use/CompressEnum.html#com.dtstack.jlogstash.format">CompressEnum</a>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../com/dtstack/jlogstash/format/class-use/ModeEnum.html#com.dtstack.jlogstash.format">ModeEnum</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../com/dtstack/jlogstash/format/class-use/OutputFormat.html#com.dtstack.jlogstash.format">OutputFormat</a>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../com/dtstack/jlogstash/format/class-use/StoreEnum.html#com.dtstack.jlogstash.format">StoreEnum</a>&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"><a name="com.dtstack.jlogstash.format.plugin"> </a> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary=", "> <caption><span><a href="../../../../com/dtstack/jlogstash/format/plugin/package-summary.html">com.dtstack.jlogstash.format.plugin</a><a href="../../../../com/dtstack/jlogstash/format/package-summary.html">com.dtstack.jlogstash.format</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col"></th> </tr> <tbody> <tr class="altColor"> <td class="colOne"><a href="../../../../com/dtstack/jlogstash/format/class-use/HdfsOutputFormat.html#com.dtstack.jlogstash.format.plugin">HdfsOutputFormat</a>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../com/dtstack/jlogstash/format/class-use/OutputFormat.html#com.dtstack.jlogstash.format.plugin">OutputFormat</a>&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"><a name="com.dtstack.jlogstash.outputs"> </a> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary=", "> <caption><span><a href="../../../../com/dtstack/jlogstash/outputs/package-summary.html">com.dtstack.jlogstash.outputs</a><a href="../../../../com/dtstack/jlogstash/format/package-summary.html">com.dtstack.jlogstash.format</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col"></th> </tr> <tbody> <tr class="altColor"> <td class="colOne"><a href="../../../../com/dtstack/jlogstash/format/class-use/HdfsOutputFormat.html#com.dtstack.jlogstash.outputs">HdfsOutputFormat</a>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </div> <div class="bottomNav"><a name="navbar.bottom"> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title=""></a></div> <a name="navbar.bottom.firstrow"> </a> <ul class="navList" title=""> <li><a href="../../../../overview-summary.html"></a></li> <li><a href="package-summary.html"></a></li> <li></li> <li class="navBarCell1Rev"></li> <li><a href="package-tree.html"></a></li> <li><a href="../../../../deprecated-list.html"></a></li> <li><a href="../../../../index-all.html"></a></li> <li><a href="../../../../help-doc.html"></a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li></li> <li></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/dtstack/jlogstash/format/package-use.html" target="_top"></a></li> <li><a href="package-use.html" target="_top"></a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../allclasses-noframe.html"></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>
import eventlet import gettext import sys from staccato.common import config import staccato.openstack.common.wsgi as os_wsgi import staccato.openstack.common.pastedeploy as os_pastedeploy # Monkey patch socket and time eventlet.patcher.monkey_patch(all=False, socket=True, time=True) gettext.install('staccato', unicode=1) def fail(returncode, e): sys.stderr.write("ERROR: %s\n" % e) sys.exit(returncode) def main(): try: conf = config.get_config_object() paste_file = conf.find_file(conf.paste_deploy.config_file) wsgi_app = os_pastedeploy.paste_deploy_app(paste_file, 'staccato-api', conf) server = os_wsgi.Service(wsgi_app, conf.bind_port) server.start() server.wait() except RuntimeError as e: fail(1, e) main()
<?php exec('"' . __DIR__ . '/vendor/bin/phinx" rollback -t=0'); exec('"' . __DIR__ . '/vendor/bin/phinx" migrate'); exec('"' . __DIR__ . '/vendor/bin/phinx" seed:run'); ?>
using System; using System.Drawing; using NetTopologySuite.Geometries; namespace SharpMap { <summary> Utility class that checks Viewport min/max Zoom and constraint </summary> [Serializable] public class MapViewPortGuard { private double _minimumZoom; private double _maximumZoom; private Envelope _maximumExtents; private double _pixelAspectRatio; const double MinMinZoomValue = 2d * Double.Epsilon; <summary> Gets or sets a value indicating the minimum zoom level. </summary> public double MinimumZoom { get { return _minimumZoom; } set { if (value < MinMinZoomValue) value = MinMinZoomValue; _minimumZoom = value; } } <summary> Gets or sets a value indicating the maximum zoom level. </summary> public double MaximumZoom { get { return _maximumZoom; } set { if (value < _minimumZoom) value = _minimumZoom; _maximumZoom = value; } } <summary> Gets or sets a value indicating the maximum extents </summary> public Envelope MaximumExtents { get { return _maximumExtents ?? (_maximumExtents = new Envelope()); } set { _maximumExtents = value; } } <summary> Gets or sets the size of the Map in device units (Pixel) </summary> public Size Size { get; set; } <summary> Gets or sets the aspect-ratio of the pixel scales. A value less than 1 will make the map streach upwards, and larger than 1 will make it smaller. </summary> <exception cref="ArgumentException">Throws an argument exception when value is 0 or less.</exception> public double PixelAspectRatio { get { return _pixelAspectRatio; } set { if (value <= 0) throw new ArgumentException("Invalid Pixel Aspect Ratio"); _pixelAspectRatio = value; } } <summary> Creates an instance of this class </summary> internal MapViewPortGuard(Size size, double minZoom, double maxZoom) { Size = size; MinimumZoom = minZoom; MaximumZoom = maxZoom; PixelAspectRatio = 1d; } <summary> Gets or sets a value indicating if <see cref="Map.MaximumExtents"/> should be enforced or not. </summary> public bool <API key> { get; set; } <summary> Verifies the zoom level and center of the map </summary> <param name="zoom">The zoom level to test</param> <param name="center">The center of the map. This coordinate might change so you <b>must</b> provide a copy if you want to preserve the old value</param> <returns>The zoom level, might have changed</returns> public double VerifyZoom(double zoom, Coordinate center) { // Zoom within valid region if (zoom < _minimumZoom) zoom = _minimumZoom; else if (zoom > _maximumZoom) zoom = _maximumZoom; if (<API key>) { var arWidth = (double) Size.Width/Size.Height; if (zoom > _maximumExtents.Width) zoom = _maximumExtents.Width; if (zoom > arWidth * _maximumExtents.Height) zoom = arWidth * _maximumExtents.Height; zoom = VerifyValidViewport(zoom, center); } return zoom; } <summary> Verifies the valid viewport, makes adjustments if required </summary> <param name="zoom">The current zoom</param> <param name="center">The </param> <returns>The verified zoom level</returns> private double VerifyValidViewport(double zoom, Coordinate center) { var maxExtents = MaximumExtents ?? new Envelope(); if (maxExtents.IsNull) return zoom; var halfWidth = 0.5d * zoom; var halfHeight = halfWidth * PixelAspectRatio * ((double)Size.Height / Size.Width); var maxZoomHeight = _maximumZoom < double.MaxValue ? _maximumZoom : double.MaxValue; if (2 * halfHeight > maxZoomHeight) { halfHeight = 0.5d*maxZoomHeight; halfWidth = halfHeight / (_pixelAspectRatio * ((double)Size.Height / Size.Width)); zoom = 2 * halfWidth; } var testEnvelope = new Envelope(center.X - halfWidth, center.X + halfWidth, center.Y - halfHeight, center.Y + halfHeight); if (maxExtents.Contains(testEnvelope)) return zoom; var dx = testEnvelope.MinX < maxExtents.MinX ? maxExtents.MinX - testEnvelope.MinX : testEnvelope.MaxX > maxExtents.MaxX ? maxExtents.MaxX - testEnvelope.MaxX : 0; var dy = testEnvelope.MinY < maxExtents.MinY ? maxExtents.MinY - testEnvelope.MinY : testEnvelope.MaxY > maxExtents.MaxY ? maxExtents.MaxY - testEnvelope.MaxY : 0; center.X += dx; center.Y += dy; return zoom; } } <summary> Utility class to lock a map's viewport so it cannot be changed </summary> public class MapViewportLock { private readonly Map _map; private double _minimumZoom; private double _maximumZoom; private Envelope _maximumExtents; private bool _enforce; <summary> Creates an instance of this class </summary> <param name="map"></param> public MapViewportLock(Map map) { _map = map; } <summary> Lock the viewport of the map </summary> public void Lock() { if (IsLocked) return; // Signal the viewport as locked IsLocked = true; // store the current extent settings _minimumZoom = _map.MinimumZoom; _maximumZoom = _map.MaximumZoom; _maximumExtents = _map.MaximumExtents; _enforce = _map.<API key>; // Lock the viewport _map.MinimumZoom = _map.MaximumZoom = _map.Zoom; _map.MaximumExtents = _map.Envelope; _map.<API key> = true; } <summary> Gets a value indicating that the map's viewport is locked </summary> public bool IsLocked { get; private set; } <summary> Unlock the viewport of the map </summary> public void Unlock() { // Unlock the viewport _map.<API key> = _enforce; _map.MaximumExtents = _maximumExtents; _map.MinimumZoom = _minimumZoom; _map.MaximumZoom = _maximumZoom; // Signal the viewport as unlocked IsLocked = false; } } }
package com.noeasy.money.exception; public class UserErrorMetadata extends BaseErrorMetadata { public static final UserErrorMetadata USER_EXIST = new UserErrorMetadata(101, "User exit"); public static final UserErrorMetadata NULL_USER_BEAN = new UserErrorMetadata(102, "Userbean is null"); protected UserErrorMetadata(int pErrorCode, String pErrorMesage) { super(pErrorCode, pErrorMesage); } }
#!/usr/bin/env python # Use Netmiko to execute 'show arp' on pynet-rtr1, pynet-rtr2, and juniper-srx. from netmiko import ConnectHandler def main(): # Definition of routers rtr1 = { 'device_type': 'cisco_ios', 'ip': '50.76.53.27', 'username': 'pyclass', 'password': '88newclass', } rtr2 = { 'device_type': 'cisco_ios', 'ip': '50.76.53.27', 'username': 'pyclass', 'password': '88newclass', 'port': 8022, } srx = { 'device_type': 'juniper', 'ip': '50.76.53.27', 'username': 'pyclass', 'password': '88newclass', 'port': 9822, } # Create a list of all the routers. all_routers = [rtr1, rtr2, srx] # Loop through all the routers and show arp. for a_router in all_routers: net_connect = ConnectHandler(**a_router) output = net_connect.send_command("show arp") print "\n\n>>>>>>>>> Device {0} <<<<<<<<<".format(a_router['device_type']) print output print ">>>>>>>>> End <<<<<<<<<" if __name__ == "__main__": main()
#include "Projectile.h" // Sets default values AProjectile::AProjectile() { // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. PrimaryActorTick.bCanEverTick = true; ProjectileMovement = <API key><<API key>>(FName("Projectile Movement")); ProjectileMovement->bAutoActivate = false; } // Called when the game starts or when spawned void AProjectile::BeginPlay() { Super::BeginPlay(); } // Called every frame void AProjectile::Tick(float DeltaTime) { Super::Tick(DeltaTime); } void AProjectile::LaunchProjectile(float Speed) { ProjectileMovement-><API key>(FVector::ForwardVector * Speed); ProjectileMovement->Activate(); }
.cbp, .cbp *, .<API key> .cbp-filter-counter:after, .<API key> .cbp-filter-counter:after, .<API key> .cbp-filter-counter:after, .<API key> .cbp-filter-counter:after, .<API key>:after, .cbp-l-filters-text .cbp-filter-counter:after, .<API key>:after, .cbp-popup-wrap, .cbp-popup-wrap *, .cbp-popup-wrap:before, .cbp:after { box-sizing: border-box } .<API key>, .<API key>, .<API key>, .<API key>, .<API key>, .<API key>, .<API key>, .<API key>, .<API key> { white-space: nowrap; overflow: hidden; text-overflow: ellipsis } .<API key>, .<API key> *, .<API key>, .<API key> *, .<API key>, .<API key> *, .cbp-l-filters-big, .cbp-l-filters-big *, .<API key>, .<API key> *, .<API key>, .<API key> *, .<API key>, .<API key> *, .cbp-l-filters-list, .cbp-l-filters-list *, .cbp-l-filters-text, .cbp-l-filters-text *, .<API key>, .<API key> *, .cbp-l-filters-work, .cbp-l-filters-work *, .<API key>, .<API key> *, .<API key>, .<API key> *, .cbp-l-loadMore-text, .cbp-l-loadMore-text *, .cbp-search, .cbp-search * { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -<API key>: transparent; box-sizing: border-box } .cbp-nav, .cbp-popup-close, .cbp-popup-next, .cbp-popup-prev { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none } .cbp-lazyload:after, .<API key>:after, .<API key>:after, .cbp:after { content: ''; position: absolute; width: 34px; height: 34px; left: 0; right: 0; top: 0; bottom: 0; margin: auto; -webkit-animation: cbp-rotation .8s infinite linear; animation: cbp-rotation .8s infinite linear; border-left: 3px solid rgba(114, 144, 182, .15); border-right: 3px solid rgba(114, 144, 182, .15); border-bottom: 3px solid rgba(114, 144, 182, .15); border-top: 3px solid rgba(114, 144, 182, .8); border-radius: 100% } .<API key> .cbp-filter-item:hover .cbp-filter-counter, .<API key> .cbp-filter-item:hover .cbp-filter-counter, .<API key> .cbp-filter-item:hover .cbp-filter-counter, .cbp-l-filters-text .cbp-filter-item:hover .cbp-filter-counter { opacity: 1; -webkit-transform: translateY(-44px); transform: translateY(-44px) } .<API key> .cbp-filter-counter, .<API key> .cbp-filter-counter, .<API key> .cbp-filter-counter, .<API key> .cbp-filter-counter, .cbp-l-filters-text .cbp-filter-counter { font: 400 11px/18px "Open Sans Condensed", sans-serif; border-radius: 3px; color: #FFF; margin: 0 auto; padding: 4px 0; text-align: center; width: 34px; position: absolute; bottom: 0; left: 0; right: 0; opacity: 0; -webkit-transition: -webkit-transform .25s, opacity .25s; transition: transform .25s, opacity .25s } .<API key> .cbp-filter-counter:after, .<API key> .cbp-filter-counter:after, .<API key> .cbp-filter-counter:after, .<API key> .cbp-filter-counter:after, .cbp-l-filters-text .cbp-filter-counter:after { content: ""; position: absolute; bottom: -4px; left: 0; right: 0; margin: 0 auto; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent } .cbp-item { display: inline-block; margin: 0 10px 20px 0 } .cbp { position: relative; margin: 0 auto; z-index: 1; height: 400px } .cbp>* { visibility: hidden } .cbp-popup-ready.cbp-popup-lightbox .cbp-popup-close, .cbp-popup-ready.cbp-popup-lightbox .cbp-popup-next, .cbp-popup-ready.cbp-popup-lightbox .cbp-popup-prev, .cbp-ready>* { visibility: visible } .cbp .cbp-item { list-style-type: none; margin: 0; padding: 0; overflow: hidden } .cbp img { display: block; border: 0; width: 100%; height: auto } .cbp a, .cbp a:active, .cbp a:hover { text-decoration: none; outline: 0 } .cbp-lazyload { position: relative; background: #fff; display: block } .cbp-lazyload img { opacity: 1 } .cbp-lazyload img[data-cbp-src] { opacity: 0 } .cbp-lazyload img:not([data-cbp-src]) { -webkit-transition: opacity .7s ease-in-out; transition: opacity .7s ease-in-out } .cbp-lazyload:after { z-index: 0 } .cbp-wrapper-outer { overflow: hidden; position: relative; margin: 0 auto } .cbp-wrapper, .cbp-wrapper-helper, .cbp-wrapper-outer { list-style-type: none; padding: 0; width: 100%; height: 100%; z-index: 1 } .cbp-wrapper, .cbp-wrapper-helper { margin: 0 } .cbp-item-off, .cbp-popup-lightbox .cbp-popup-close, .cbp-popup-lightbox .cbp-popup-next, .cbp-popup-lightbox .cbp-popup-prev, .cbp-ready:after { visibility: hidden } .cbp-ready:after { display: none } .cbp-ready .cbp-item, .cbp-ready .cbp-wrapper, .cbp-ready .cbp-wrapper-helper { position: absolute; top: 0; left: 0 } .cbp-item-off { z-index: -1; pointer-events: none } .cbp-item-on2off { z-index: 0 } .cbp-item-off2on { z-index: 1 } .cbp-item-on2on { z-index: 2 } .cbp-item-wrapper { width: 100%; height: 100%; position: relative; top: 0; left: 0 } .cbp-l-inline img, .<API key> img { display: block; width: 100%; height: auto; border: 0 } .cbp-updateItems { -webkit-transition: height .5s ease-in-out!important; transition: height .5s ease-in-out!important; will-change: height } .cbp-updateItems .cbp-item { -webkit-transition: top .5s ease-in-out, left .5s ease-in-out; transition: top .5s ease-in-out, left .5s ease-in-out } .cbp-updateItems .cbp-item-loading { -webkit-animation: fadeIn .5s ease-in-out; animation: fadeIn .5s ease-in-out; -webkit-transition: none; transition: none } .cbp-removeItem { -webkit-animation: fadeOut .5s ease-in-out; animation: fadeOut .5s ease-in-out } .cbp-panel { width: 94%; max-width: 1170px; margin: 0 auto } .cbp-misc-video { position: relative; height: 0; padding-bottom: 56.25%; background: #000; text-align: center } .cbp-misc-video iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100% } @-webkit-keyframes cbp-rotation { 0% { -webkit-transform: rotate(0) } 100% { -webkit-transform: rotate(360deg) } } @keyframes cbp-rotation { 0% { transform: rotate(0) } 100% { transform: rotate(360deg) } } @-webkit-keyframes fadeOut { 0% { opacity: 1 } 100% { opacity: 0 } } @keyframes fadeOut { 0% { opacity: 1 } 100% { opacity: 0 } } .clearfix:after { content: " "; display: block; height: 0; clear: both } .cbp-l-filters-left { float: left } .cbp-l-filters-right { float: right } .cbp-caption, .<API key>, .<API key> { display: block } .<API key> { background-color: #282727 } .cbp-caption-active .cbp-caption, .cbp-caption-active .<API key>, .cbp-caption-active .<API key> { overflow: hidden; position: relative; z-index: 1 } .cbp-caption-active .<API key> { top: 0 } .cbp-caption-active .<API key> { width: 100%; position: absolute; z-index: 2; height: 100% } .cbp-l-caption-title { color: #fff; font: 400 16px/21px "Open Sans Condensed", sans-serif } .cbp-l-caption-desc { color: #aaa; font: 400 12px/16px "Open Sans Condensed", sans-serif } .cbp-l-caption-text { font: 400 14px/21px "Open Sans Condensed", sans-serif; color: #fff; letter-spacing: 3px; padding: 0 6px } .<API key>, .<API key> { background-color: #547EB1; color: #FFF; display: inline-block; font: 400 12px/30px "Open Sans Condensed", sans-serif; min-width: 90px; text-align: center; margin: 4px; padding: 0 6px } .<API key>:hover, .<API key>:hover { opacity: .9 } .cbp-caption-none .<API key> { display: none } .<API key> .cbp-l-caption-body { padding: 12px 30px } .cbp-caption-fadeIn .<API key> .cbp-l-caption-body, .cbp-caption-minimal .<API key> .cbp-l-caption-body, .<API key> .<API key> .cbp-l-caption-body, .cbp-caption-opacity .<API key> .cbp-l-caption-body, .<API key> .<API key> .cbp-l-caption-body, .<API key> .<API key> .cbp-l-caption-body, .cbp-caption-pushTop .<API key> .cbp-l-caption-body, .<API key> .<API key> .cbp-l-caption-body, .<API key> .<API key> .cbp-l-caption-body, .<API key> .<API key> .cbp-l-caption-body, .cbp-caption-zoom .<API key> .cbp-l-caption-body { padding-top: 30px } .<API key> { display: table; width: 100%; height: 100% } .<API key> .cbp-l-caption-body { display: table-cell; vertical-align: middle; text-align: center; padding: 0 } .<API key> .<API key>, .<API key> .<API key> { position: relative; -webkit-transition: -webkit-transform .25s; transition: transform .25s } .<API key> .<API key> .<API key>, .<API key> .<API key> .<API key>, .<API key> .<API key> .<API key> { -webkit-transform: translateX(-20px); transform: translateX(-20px) } .<API key> .<API key> .<API key>, .<API key> .<API key> .<API key>, .<API key> .<API key> .<API key> { -webkit-transform: translateX(20px); transform: translateX(20px) } .cbp-caption:hover .<API key> .<API key>, .cbp-caption:hover .<API key> .<API key> { -webkit-transform: translateX(0); transform: translateX(0) } @media only screen and (max-width:480px) { .cbp-l-filters-left, .cbp-l-filters-right { width: 100% } .<API key> .cbp-l-caption-body { padding: 9px 11px } .cbp-l-caption-title { font-size: 14px; line-height: 21px } .cbp-l-caption-desc { font-size: 11px; line-height: 14px } .<API key>, .<API key> { font-size: 11px; line-height: 28px; min-width: 69px; margin: 3px; padding: 0 4px } .cbp-l-caption-text { font-size: 13px; letter-spacing: 1px } .<API key> { text-align: center } } @media only screen and (max-width:374px) { .<API key> .cbp-l-caption-body { padding: 8px 10px } .cbp-l-caption-title { font-size: 13px; line-height: 20px } .cbp-l-caption-desc { font-size: 11px; line-height: 14px } .<API key>, .<API key> { font-size: 10px; line-height: 28px; min-width: 62px; margin: 1px; padding: 0 4px } } .cbp-caption-fadeIn .<API key> { opacity: 0; top: 0; background-color: rgba(0, 0, 0, .85); -webkit-transition: opacity .5s; transition: opacity .5s } .cbp-caption-fadeIn .cbp-caption:hover .<API key> { opacity: 1 } .cbp-caption-minimal .cbp-l-caption-desc, .cbp-caption-minimal .cbp-l-caption-title { position: relative; left: 0; opacity: 0; -webkit-transition: -webkit-transform .35s ease-out; transition: transform .35s ease-out } .cbp-caption-minimal .cbp-l-caption-title { -webkit-transform: translateY(-50%); transform: translateY(-50%) } .cbp-caption-minimal .cbp-l-caption-desc { -webkit-transform: translateY(70%); transform: translateY(70%) } .cbp-caption-minimal .cbp-caption:hover .cbp-l-caption-desc, .cbp-caption-minimal .cbp-caption:hover .cbp-l-caption-title { opacity: 1; -webkit-transform: translateY(0); transform: translateY(0) } .cbp-caption-minimal .<API key> { top: 0; background-color: #000; background-color: rgba(0, 0, 0, .8); opacity: 0 } .cbp-caption-minimal .cbp-caption:hover .<API key> { opacity: 1 } .<API key> .<API key> { left: -100%; top: 0; -webkit-transition: -webkit-transform .35s; transition: transform .35s } .<API key> .cbp-caption:hover .<API key> { -webkit-transform: translateX(100%); transform: translateX(100%) } .<API key> .<API key> { height: 60px; background-color: #181616; background-color: rgba(24, 22, 22, .7); -webkit-transition: -webkit-transform .25s; transition: transform .25s } .<API key> .cbp-caption:hover .<API key> { -webkit-transform: translateY(-100%); transform: translateY(-100%) } .<API key> .<API key> .<API key>, .<API key> .<API key> .<API key> { -<API key>: .35s; transition-duration: .35s } .<API key> .<API key>, .<API key> .<API key> { -webkit-transition: -webkit-transform .35s; transition: transform .35s } .<API key> .<API key> { height: 60px } .<API key> .cbp-caption:hover .<API key> { -webkit-transform: translateY(-30px); transform: translateY(-30px) } .<API key> .cbp-caption:hover .<API key> { -webkit-transform: translateY(-100%); transform: translateY(-100%) } .<API key> .<API key>, .<API key> .<API key> { -webkit-transition: -webkit-transform .25s; transition: transform .25s } .<API key> .<API key> { height: 61px; -webkit-transform: translateY(0); transform: translateY(0) } .<API key> .cbp-caption:hover .<API key> { -webkit-transform: translateY(-60px); transform: translateY(-60px) } .<API key> .cbp-caption:hover .<API key> { -webkit-transform: translateY(-61px); transform: translateY(-61px) } .<API key> .<API key> { z-index: 2; -webkit-transition: -webkit-transform .25s; transition: transform .25s } .<API key> .<API key> { bottom: 0; z-index: 1; height: 47px } .<API key> .cbp-caption:hover .<API key> { -webkit-transform: translateY(-47px); transform: translateY(-47px) } .<API key> .<API key>, .<API key> .<API key> { -webkit-transition: -webkit-transform .4s; transition: transform .4s } .<API key> .<API key> { top: 0; left: -50%; width: 50% } .<API key> .cbp-caption:hover .<API key> { -webkit-transform: translateX(25%); transform: translateX(25%) } .<API key> .cbp-caption:hover .<API key> { -webkit-transform: translateX(100%); transform: translateX(100%) } .<API key> .<API key>, .<API key> .<API key> { -webkit-transition: -webkit-transform .4s; transition: transform .4s } .<API key> .<API key> { top: -100% } .<API key> .cbp-caption:hover .<API key>, .<API key> .cbp-caption:hover .<API key> { -webkit-transform: translateY(100%); transform: translateY(100%) } .cbp-caption-pushTop .<API key>, .cbp-caption-pushTop .<API key> { -webkit-transition: -webkit-transform .4s; transition: transform .4s } .cbp-caption-pushTop .<API key> { height: 102% } .cbp-caption-pushTop .cbp-caption:hover .<API key> { -webkit-transform: translateY(-100%); transform: translateY(-100%) } .cbp-caption-pushTop .cbp-caption:hover .<API key> { -webkit-transform: translateY(-99%); transform: translateY(-99%) } .<API key> .<API key> { z-index: 2; -webkit-transition: -webkit-transform .4s; transition: transform .4s } .<API key> .<API key> { top: 0; z-index: 1 } .<API key> .cbp-caption:hover .<API key> { -webkit-transform: translateY(-100%); transform: translateY(-100%) } .<API key> .<API key> { left: 100%; top: 0; -webkit-transition: -webkit-transform .4s; transition: transform .4s } .<API key> .cbp-caption:hover .<API key> { -webkit-transform: translateX(-100%); transform: translateX(-100%) } .<API key> .<API key> { z-index: 2; -webkit-transition: -webkit-transform .4s; transition: transform .4s } .<API key> .<API key> { top: 0; z-index: 1 } .<API key> .cbp-caption:hover .<API key> { -webkit-transform: translateY(100%); transform: translateY(100%) } .cbp-caption-zoom .<API key> { -webkit-transition: -webkit-transform .35s ease-out; transition: transform .35s ease-out } .cbp-caption-zoom .cbp-caption:hover .<API key> { -webkit-transform: scale(1.25); transform: scale(1.25) } .cbp-caption-zoom .<API key> { opacity: 0; top: 0; background-color: rgba(0, 0, 0, .9); -webkit-transition: opacity .4s; transition: opacity .4s } .cbp-caption-zoom .cbp-caption:hover .<API key> { opacity: 1 } .cbp-caption-opacity .cbp-item { padding: 1px } .cbp-caption-opacity .cbp-caption, .cbp-caption-opacity .<API key>, .cbp-caption-opacity .<API key> { background-color: transparent } .cbp-caption-opacity .cbp-caption { border: 1px solid transparent } .cbp-caption-opacity .cbp-caption:hover { border-color: #EDEDED } .cbp-caption-opacity .<API key> { opacity: 1; -webkit-transition: opacity .4s; transition: opacity .4s } .cbp-caption-opacity .cbp-caption:hover .<API key> { opacity: .8 } .cbp-caption-opacity .cbp-caption:hover .<API key> { top: 0 } .cbp-caption-expand .<API key> { height: auto; background-color: transparent } .cbp-caption-expand .cbp-caption { border-bottom: 1px dotted #eaeaea } .cbp-caption-expand .<API key> { cursor: pointer; font: 500 16px/23px 'Open Sans Condensed', sans-serif; color: #474747; padding: 12px 0 11px 26px } .cbp-caption-expand .<API key> svg { position: absolute; top: 16px; left: 0 } .cbp-l-caption-body a { font: 400 14px/21px 'Open Sans Condensed', sans-serif } .cbp-caption-expand .cbp-l-caption-body { font: 400 13px/21px 'Open Sans Condensed', sans-serif; color: #888; padding: 0 0 20px 26px } .<API key> { -webkit-transition: height .4s!important; transition: height .4s!important } .<API key> .cbp-item { -webkit-transition: left .4s, top .4s!important; transition: left .4s, top .4s!important } .<API key> .<API key> { -webkit-transition: height .4s; transition: height .4s } .<API key> { margin-bottom: 30px; text-align: center; font: 400 12px/21px sans-serif; color: #DADADA } .<API key> .cbp-filter-item { color: #949494; cursor: pointer; font: 400 13px/21px 'Open Sans Condensed', sans-serif; padding: 0 12px; position: relative; overflow: visible; margin: 0 0 10px; display: inline-block; -webkit-transition: color .3s ease-in-out; transition: color .3s ease-in-out } .<API key> .cbp-filter-item:hover { color: #2D2C2C } .<API key> .cbp-filter-item:hover .cbp-filter-counter { -webkit-transform: translateY(-30px); transform: translateY(-30px) } .<API key> .cbp-filter-item.<API key> { color: #2D2C2C; cursor: default } .<API key> .cbp-filter-counter { font: 400 11px/18px 'Open Sans Condensed', sans-serif; background-color: #626161 } .<API key> .cbp-filter-counter:after { border-top: 4px solid #626161 } .<API key> { margin-bottom: 30px } .<API key> .cbp-filter-item { background-color: #fff; border: 1px solid #cdcdcd; cursor: pointer; font: 400 12px/30px 'Open Sans Condensed', sans-serif; padding: 0 13px; position: relative; overflow: visible; margin: 0 4px 10px; display: inline-block; color: #888; -webkit-transition: color .3s ease-in-out, background-color .3s ease-in-out, border .3s ease-in-out; transition: color .3s ease-in-out, background-color .3s ease-in-out, border .3s ease-in-out } .<API key> .cbp-filter-item:hover { color: #111 } .<API key> .cbp-filter-item.<API key> { background-color: #6C7A89; border: 1px solid #6C7A89; color: #fff; cursor: default } .<API key> .cbp-filter-item:first-child { margin-left: 0 } .<API key> .cbp-filter-item:last-child { margin-right: 0 } .<API key> .cbp-filter-counter { display: inline } .<API key> { margin-bottom: 30px; text-align: right } .<API key> .cbp-filter-item { background-color: transparent; color: #8B8B8B; cursor: pointer; font: 400 11px/31px "Open Sans Condensed", sans-serif; padding: 0 14px; position: relative; overflow: visible; margin: 0 3px 10px; border: 1px solid #E4E2E2; text-transform: uppercase; display: inline-block; -webkit-transition: color .3s ease-in-out, background-color .3s ease-in-out, border .3s ease-in-out; transition: color .3s ease-in-out, background-color .3s ease-in-out, border .3s ease-in-out } .<API key> .cbp-filter-item:hover { color: #2B3444 } .<API key> .cbp-filter-item.<API key> { color: #FFF; background-color: #049372; border-color: #049372; cursor: default } .<API key> .cbp-filter-item:first-child { margin-left: 0 } .<API key> .cbp-filter-item:last-child { margin-right: 0 } .<API key> .cbp-filter-counter { background-color: #049372 } .<API key> .cbp-filter-counter:after { border-top: 4px solid #049372 } .<API key> { margin-bottom: 30px } .<API key> .cbp-filter-item:hover .cbp-filter-counter:after { display: block } .<API key> .cbp-filter-item:hover .cbp-filter-counter { bottom: 44px; -ms-filter: progid: DXImageTransform.Microsoft.Alpha(Opacity=100); opacity: 1 } .<API key> .cbp-filter-counter { background-color: #545454 } .<API key> .cbp-filter-counter:after { border-top: 4px solid #545454 } @media only screen and (max-width:480px) { .<API key>, .<API key> { text-align: center } } .<API key> { margin-bottom: 30px; text-align: center } .<API key> .cbp-filter-item { background-color: #FFF; border: 1px solid #ECECEC; color: #888; cursor: pointer; font: 400 12px/32px 'Open Sans Condensed', sans-serif; margin: 0 10px 10px 0; overflow: visible; padding: 0 17px; position: relative; display: inline-block; -webkit-transition: color .3s ease-in-out, border-color .3s ease-in-out; transition: color .3s ease-in-out, border-color .3s ease-in-out } .<API key> .cbp-filter-item:hover { color: #5d5d5d } .<API key> .cbp-filter-item.<API key> { color: #3B9CB3; border-color: #8CD2E5; cursor: default } .<API key> .cbp-filter-item:first-child { margin-left: 0 } .<API key> .cbp-filter-item:last-child { margin-right: 0 } .<API key> .cbp-filter-counter { font: 400 11px/18px 'Open Sans Condensed', sans-serif; background-color: #68ABBC } .<API key> .cbp-filter-counter:after { border-top: 4px solid #68ABBC } .<API key> { margin-bottom: 40px; height: 38px; position: relative; z-index: 5 } .<API key> { width: 200px; position: absolute; right: 0; background: #4d4c4d } .<API key> { font: 400 12px/38px "Open Sans Condensed", sans-serif; margin: 0 17px; color: #FFF; cursor: default; position: relative } .<API key>:after { border-color: #fff transparent; border-style: solid; border-width: 5px 5px 0; content: ""; height: 0; position: absolute; right: 0; top: 50%; width: 0; margin-top: -1px } .<API key>.<API key> .<API key>:after { border-width: 0 5px 5px } .<API key> { display: none; list-style: none; margin: 0; padding: 0 } .<API key>>li { margin: 0; list-style: none } .<API key>.<API key> .<API key> { display: block; margin: 0 } .<API key> .cbp-filter-item { background: 0 0; color: #b3b3b3; width: 100%; text-align: left; font: 400 12px/40px "Open Sans Condensed", sans-serif; margin: 0; padding: 0 17px; cursor: pointer; border: none; border-top: 1px solid #595959 } .<API key> .cbp-filter-item:hover { color: #e6e6e6 } .<API key> .<API key> { color: #fff; cursor: default } .<API key> .cbp-filter-counter { display: inline } .<API key> { float: right; margin-top: -2px; margin-left: 20px; width: 200px } @media only screen and (max-width:480px) { .<API key> { width: 100%; margin-top: 0; margin-left: 0 } .<API key> { right: 0; left: 0; margin: 0 auto } } .cbp-l-filters-list { margin-bottom: 30px; content: ""; display: table; clear: both } .cbp-l-filters-list .cbp-filter-item { background-color: transparent; color: #585252; cursor: pointer; font: 400 12px/35px "Open Sans Condensed", sans-serif; padding: 0 18px; position: relative; overflow: visible; margin: 0 0 10px; float: left; border: 1px solid #3288C4; border-right-width: 0; -webkit-transition: left .3s ease-in-out; transition: left .3s ease-in-out } .cbp-l-filters-list .cbp-filter-item:hover { color: #000 } .cbp-l-filters-list .cbp-filter-item.<API key> { cursor: default; color: #FFF; background-color: #3288C4 } .<API key> { border-radius: 6px 0 0 6px } .<API key> { border-radius: 0 6px 6px 0; border-right-width: 1px!important } .cbp-l-filters-list .cbp-filter-counter { display: inline } @media only screen and (max-width:600px) { .cbp-l-filters-list .cbp-filter-item { margin-right: 5px; border-radius: 6px; border-right-width: 1px } } .cbp-l-filters-work { margin-bottom: 30px; text-align: center } .cbp-l-filters-work .cbp-filter-item { background-color: #FFF; color: #888; cursor: pointer; font: 600 11px/37px "Open Sans Condensed", sans-serif; margin: 0 5px 10px 0; overflow: visible; padding: 0 16px; position: relative; display: inline-block; text-transform: uppercase; -webkit-transition: color .3s ease-in-out, background-color .3s ease-in-out; transition: color .3s ease-in-out, background-color .3s ease-in-out } .cbp-l-filters-work .cbp-filter-item:hover { color: #fff; background: #607D8B } .cbp-l-filters-work .cbp-filter-item.<API key> { background-color: #607D8B; color: #fff; cursor: default } .cbp-l-filters-work .cbp-filter-item:first-child { margin-left: 0 } .cbp-l-filters-work .cbp-filter-item:last-child { margin-right: 0 } .cbp-l-filters-work .cbp-filter-counter { font: 600 11px/37px "Open Sans Condensed", sans-serif; text-align: center; display: inline-block; margin-left: 8px } .cbp-l-filters-work .cbp-filter-counter:before { content: '(' } .cbp-l-filters-work .cbp-filter-counter:after { content: ')' } .cbp-l-filters-big { margin-bottom: 30px; text-align: center } .cbp-l-filters-big .cbp-filter-item { color: #444; cursor: pointer; font: 400 15px/22px Roboto, sans-serif; margin: 0 8px 10px; padding: 10px 23px; position: relative; display: inline-block; border: 1px solid transparent; text-transform: uppercase; -webkit-transition: color .3s ease-in-out, border .3s ease-in-out; transition: color .3s ease-in-out, border .3s ease-in-out } .cbp-l-filters-big .cbp-filter-item:hover { color: #888 } .cbp-l-filters-big .cbp-filter-item.<API key> { border-color: #d5d5d5; color: #444; cursor: default } .cbp-l-filters-big .cbp-filter-item:first-child { margin-left: 0 } .cbp-l-filters-big .cbp-filter-item:last-child { margin-right: 0 } .cbp-l-filters-text { margin-bottom: 30px; text-align: center; font: 400 12px/21px Lato, sans-serif; color: #DADADA; padding: 0 15px } .cbp-l-filters-text .cbp-filter-item { color: #949494; cursor: pointer; font: 400 13px/21px Lato, sans-serif; padding: 0 12px; position: relative; overflow: visible; margin: 0 0 10px; display: inline-block; -webkit-transition: color .3s ease-in-out; transition: color .3s ease-in-out } .cbp-l-filters-text .cbp-filter-item:hover { color: #2D2C2C } .cbp-l-filters-text .cbp-filter-item:hover .cbp-filter-counter { -webkit-transform: translateY(-30px); transform: translateY(-30px) } .cbp-l-filters-text .cbp-filter-item.<API key> { color: #2D2C2C; cursor: default } .cbp-l-filters-text .cbp-filter-counter { background-color: #626161; font: 400 11px/18px Lato, sans-serif } .cbp-l-filters-text .cbp-filter-counter:after { border-top: 4px solid #626161 } .<API key> { display: inline-block; font: 400 13px/21px Lato, sans-serif; color: #949494; margin-right: 15px } @media only screen and (max-width:480px) { .<API key> { display: block; margin-bottom: 10px } .<API key> { text-align: center } } .<API key> { margin-bottom: 30px } .<API key> .cbp-filter-item { border-bottom: 3px solid transparent; cursor: pointer; font: 600 14px/21px "Open Sans Condensed", sans-serif; padding: 8px 10px; position: relative; overflow: visible; margin: 0 20px 10px 0; display: inline-block; color: #787878; -webkit-transition: color .25s ease-in-out, border-color .25s ease-in-out; transition: color .25s ease-in-out, border-color .25s ease-in-out } .<API key> .cbp-filter-item:hover { color: #111 } .<API key> .cbp-filter-item.<API key> { border-bottom-color: #666; color: #444; cursor: default } .<API key>, .<API key> { font: 400 12px/18px "Open Sans Condensed", sans-serif; color: #eee } .<API key> .cbp-filter-item:first-child { margin-left: 0 } .<API key> .cbp-filter-item:last-child { margin-right: 0 } .<API key> .cbp-filter-counter { display: inline } .<API key> { -webkit-transition: height .6s ease-in-out; transition: height .6s ease-in-out; will-change: height } .<API key> .cbp-item { -webkit-transition: -webkit-transform .6s ease-in-out; transition: transform .6s ease-in-out; -webkit-perspective: 1000px; perspective: 1000px } .<API key> .cbp-item-wrapper { -<API key>: preserve-3d; transform-style: preserve-3d } .<API key> .cbp-item-on2off .cbp-item-wrapper { -webkit-animation: quicksand-off .6s ease-out both; animation: quicksand-off .6s ease-out both } .<API key> .cbp-item-off2on .cbp-item-wrapper { -webkit-animation: quicksand-on .6s ease-out both; animation: quicksand-on .6s ease-out both } @-webkit-keyframes quicksand-off { 100% { opacity: 0; -webkit-transform: scale3d(0, 0, 0) } } @keyframes quicksand-off { 100% { opacity: 0; transform: scale3d(0, 0, 0) } } @-webkit-keyframes quicksand-on { 0% { opacity: 0; -webkit-transform: scale3d(0, 0, 0) } } @keyframes quicksand-on { 0% { opacity: 0; transform: scale3d(0, 0, 0) } } .<API key>, .<API key> { -webkit-transition: height .6s ease-in-out; transition: height .6s ease-in-out; will-change: height } .<API key> .cbp-item, .<API key> .cbp-item { -webkit-transition: -webkit-transform .6s ease-in-out; transition: transform .6s ease-in-out; -webkit-perspective: 1000px; perspective: 1000px } .<API key> .cbp-item-wrapper, .<API key> .cbp-item-wrapper { -<API key>: preserve-3d; transform-style: preserve-3d } .<API key> .cbp-item-on2off .cbp-item-wrapper, .<API key> .cbp-item-on2off .cbp-item-wrapper { -webkit-animation: fadeOut-off .6s ease-in-out both; animation: fadeOut-off .6s ease-in-out both } .<API key> .cbp-item-off2on .cbp-item-wrapper, .<API key> .cbp-item-off2on .cbp-item-wrapper { -webkit-animation: fadeOut-on .6s ease-in-out both; animation: fadeOut-on .6s ease-in-out both } @-webkit-keyframes fadeOut-off { 0% { opacity: 1 } 100%, 80% { opacity: 0 } } @keyframes fadeOut-off { 0% { opacity: 1 } 100%, 80% { opacity: 0 } } @-webkit-keyframes fadeOut-on { 0% { opacity: 0 } 100% { opacity: 1 } } @keyframes fadeOut-on { 0% { opacity: 0 } 100% { opacity: 1 } } .<API key> { -webkit-transition: height .7s ease-in-out; transition: height .7s ease-in-out; will-change: height } .<API key> .cbp-item { -webkit-transition: -webkit-transform .7s ease-in-out; transition: transform .7s ease-in-out; -webkit-perspective: 1000px; perspective: 1000px } .<API key> .cbp-item-wrapper { -<API key>: preserve-3d; transform-style: preserve-3d } .<API key> .cbp-item-on2off .cbp-item-wrapper { -webkit-animation: flipOut-out .7s both ease-in; animation: flipOut-out .7s both ease-in } .<API key> .cbp-item-off2on .cbp-item-wrapper { -webkit-animation: flipOut-in .7s ease-out both; animation: flipOut-in .7s ease-out both } @-webkit-keyframes flipOut-out { 100%, 50% { -webkit-transform: translateZ(-1000px) rotateY(-90deg); opacity: .2 } } @keyframes flipOut-out { 100%, 50% { transform: translateZ(-1000px) rotateY(-90deg); opacity: .2 } } @-webkit-keyframes flipOut-in { 0%, 50% { -webkit-transform: translateZ(-1000px) rotateY(90deg); opacity: .2 } } @keyframes flipOut-in { 0%, 50% { transform: translateZ(-1000px) rotateY(90deg); opacity: .2 } } .<API key> { -webkit-transition: height .7s ease-in-out; transition: height .7s ease-in-out; will-change: height } .<API key> .cbp-item { -webkit-transition: -webkit-transform .7s ease-in-out; transition: transform .7s ease-in-out; -webkit-perspective: 1000px; perspective: 1000px } .<API key> .cbp-item-wrapper { -<API key>: preserve-3d; transform-style: preserve-3d } .<API key> .cbp-item-on2off .cbp-item-wrapper { -webkit-animation: flipBottom-out .7s both ease-in; animation: flipBottom-out .7s both ease-in } .<API key> .cbp-item-off2on .cbp-item-wrapper { -webkit-animation: flipBottom-in .7s ease-out both; animation: flipBottom-in .7s ease-out both } @-webkit-keyframes flipBottom-out { 100%, 50% { -webkit-transform: translateZ(-1000px) rotateX(-90deg); opacity: .2 } } @keyframes flipBottom-out { 100%, 50% { transform: translateZ(-1000px) rotateX(-90deg); opacity: .2 } } @-webkit-keyframes flipBottom-in { 0%, 50% { -webkit-transform: translateZ(-1000px) rotateX(90deg); opacity: .2 } } @keyframes flipBottom-in { 0%, 50% { transform: translateZ(-1000px) rotateX(90deg); opacity: .2 } } .<API key> { -webkit-transition: height .6s ease-in-out; transition: height .6s ease-in-out; will-change: height } .<API key> .cbp-item { -webkit-transition: -webkit-transform .6s ease-in-out; transition: transform .6s ease-in-out; -webkit-perspective: 1000px; perspective: 1000px } .<API key>, .cbp-animation-skew { -webkit-transition: height .6s ease-in-out; will-change: height } .<API key> .cbp-item-wrapper { -<API key>: preserve-3d; transform-style: preserve-3d } .<API key> .cbp-item-on2off .cbp-item-wrapper { -webkit-animation: scaleSides-out .9s both; animation: scaleSides-out .9s both } .<API key> .cbp-item-off2on .cbp-item-wrapper { -webkit-animation: scaleSides-in .9s both; animation: scaleSides-in .9s both } @-webkit-keyframes scaleSides-out { 100%, 50% { -webkit-transform: scale(.6); opacity: 0 } } @keyframes scaleSides-out { 100%, 50% { transform: scale(.6); opacity: 0 } } @-webkit-keyframes scaleSides-in { 0%, 50% { -webkit-transform: scale(.6); opacity: 0 } } @keyframes scaleSides-in { 0%, 50% { transform: scale(.6); opacity: 0 } } .cbp-animation-skew { transition: height .6s ease-in-out } .cbp-animation-skew .cbp-item { -webkit-transition: -webkit-transform .6s ease-in-out; transition: transform .6s ease-in-out; -webkit-perspective: 1000px; perspective: 1000px } .cbp-animation-skew .cbp-item-wrapper { -<API key>: preserve-3d; transform-style: preserve-3d } .cbp-animation-skew .cbp-item-on2off .cbp-item-wrapper { -webkit-animation: skew-off .6s ease-out both; animation: skew-off .6s ease-out both } .cbp-animation-skew .cbp-item-off2on .cbp-item-wrapper { -webkit-animation: skew-on .6s ease-out both; animation: skew-on .6s ease-out both } @-webkit-keyframes skew-off { 100% { opacity: 0; -webkit-transform: scale3d(0, 0, 0) skew(20deg, 0) } } @keyframes skew-off { 100% { opacity: 0; transform: scale3d(0, 0, 0) skew(20deg, 0) } } @-webkit-keyframes skew-on { 0% { opacity: 0; -webkit-transform: scale3d(0, 0, 0) skew(0, 20deg) } } @keyframes skew-on { 0% { opacity: 0; transform: scale3d(0, 0, 0) skew(0, 20deg) } } .<API key> { transition: height .6s ease-in-out } .<API key>, .<API key> { -webkit-transition: height .6s ease-in-out; will-change: height; transition: height .6s ease-in-out } .<API key> .cbp-wrapper-outer { overflow: visible } .<API key> .cbp-item { -webkit-perspective: 1000px; perspective: 1000px; overflow: visible } .<API key> .cbp-item-wrapper { -<API key>: preserve-3d; transform-style: preserve-3d } .<API key> .cbp-wrapper-helper .cbp-item-wrapper { -webkit-animation: fadeOutTop-out .6s both ease-in-out; animation: fadeOutTop-out .6s both ease-in-out } .<API key> .cbp-wrapper .cbp-item-wrapper { -webkit-animation: fadeOutTop-in .6s both ease-in-out; animation: fadeOutTop-in .6s both ease-in-out } @-webkit-keyframes fadeOutTop-out { 0% { -webkit-transform: translateY(0); opacity: 1 } 100%, 50% { -webkit-transform: translateY(-30px); opacity: 0 } } @keyframes fadeOutTop-out { 0% { transform: translateY(0); opacity: 1 } 100%, 50% { transform: translateY(-30px); opacity: 0 } } @-webkit-keyframes fadeOutTop-in { 0%, 50% { -webkit-transform: translateY(-30px); opacity: 0 } 100% { -webkit-transform: translateY(0); opacity: 1 } } @keyframes fadeOutTop-in { 0%, 50% { transform: translateY(-30px); opacity: 0 } 100% { transform: translateY(0); opacity: 1 } } .<API key> .cbp-item { -webkit-perspective: 1000px; perspective: 1000px } .<API key> .cbp-item-wrapper { -<API key>: preserve-3d; transform-style: preserve-3d } .<API key> .cbp-wrapper-helper .cbp-item-wrapper { -webkit-animation: slideLeft-out .8s both ease-in-out; animation: slideLeft-out .8s both ease-in-out } .<API key> .cbp-wrapper .cbp-item-wrapper { -webkit-animation: slideLeft-in .8s both ease-in-out; animation: slideLeft-in .8s both ease-in-out } @-webkit-keyframes slideLeft-out { 0% { opacity: 1; transform: scale(1) } 25% { opacity: .75; -webkit-transform: scale(.8) } 100%, 75% { opacity: .75; -webkit-transform: scale(.8) translateX(-200%) } } @keyframes slideLeft-out { 0% { opacity: 1; transform: scale(1) } 25% { opacity: .75; transform: scale(.8) } 100%, 75% { opacity: .75; transform: scale(.8) translateX(-200%) } } @-webkit-keyframes slideLeft-in { 0%, 25% { opacity: .75; -webkit-transform: scale(.8) translateX(200%) } 75% { opacity: .75; -webkit-transform: scale(.8) } 100% { opacity: 1; -webkit-transform: scale(1) translateX(0) } } @keyframes slideLeft-in { 0%, 25% { opacity: .75; transform: scale(.8) translateX(200%) } 75% { opacity: .75; transform: scale(.8) } 100% { opacity: 1; transform: scale(1) translateX(0) } } .<API key>, .<API key> { -webkit-transition: height .6s ease-in-out; will-change: height } .<API key> .cbp-wrapper-outer { overflow: visible } .<API key> .cbp-item { -webkit-perspective: 1000px; perspective: 1000px; overflow: visible } .<API key> .cbp-item-wrapper { -<API key>: preserve-3d; transform-style: preserve-3d } .<API key> .cbp-wrapper-helper .cbp-item-wrapper { -webkit-animation: fadeOutTop-out .6s both ease; animation: fadeOutTop-out .6s both ease } .<API key> .cbp-wrapper .cbp-item-wrapper { -webkit-animation: fadeOutTop-in .6s both ease-out; animation: fadeOutTop-in .6s both ease-out } .<API key> { transition: height .6s ease-in-out } .<API key> .cbp-item { -webkit-perspective: 1000px; perspective: 1000px } .<API key> .cbp-item-wrapper { -<API key>: preserve-3d; transform-style: preserve-3d } .<API key> .cbp-wrapper-helper .cbp-item-wrapper { -<API key>: 0 50%; transform-origin: 0 50%; -webkit-animation: flip-out .6s both ease-in-out; animation: flip-out .6s both ease-in-out } .<API key> .cbp-wrapper .cbp-item-wrapper { -<API key>: 100% 50%; transform-origin: 100% 50%; -webkit-animation: flip-in .6s both ease-in-out; animation: flip-in .6s both ease-in-out } @-webkit-keyframes flip-out { 100% { opacity: 0; -webkit-transform: rotateY(90deg) } } @keyframes flip-out { 100% { opacity: 0; transform: rotateY(90deg) } } @-webkit-keyframes flip-in { 0% { opacity: 0; -webkit-transform: rotateY(-90deg) } 100% { opacity: 1; -webkit-transform: rotateY(0) } } @keyframes flip-in { 0% { opacity: 0; transform: rotateY(-90deg) } 100% { opacity: 1; transform: rotateY(0) } } .<API key> { transition: height .6s ease-in-out } .<API key>, .<API key> { -webkit-transition: height .6s ease-in-out; will-change: height; transition: height .6s ease-in-out } .<API key> .cbp-item { -webkit-perspective: 1000px; perspective: 1000px } .<API key> .cbp-item-wrapper { -<API key>: preserve-3d; transform-style: preserve-3d } .<API key> .cbp-wrapper-helper .cbp-item-wrapper { -webkit-animation: flipOut-out 1s both ease-in; animation: flipOut-out 1s both ease-in } .<API key> .cbp-wrapper .cbp-item-wrapper { -webkit-animation: flipOut-in 1s both ease-out; animation: flipOut-in 1s both ease-out } .<API key> .cbp-item { -webkit-perspective: 1000px; perspective: 1000px } .<API key> .cbp-item-wrapper { -<API key>: preserve-3d; transform-style: preserve-3d } .<API key> .cbp-wrapper-helper .cbp-item-wrapper { -webkit-animation: slideDelay-out .5s both ease-in-out; animation: slideDelay-out .5s both ease-in-out } .<API key> .cbp-wrapper .cbp-item-wrapper { -webkit-animation: slideDelay-in .5s both ease-in-out; animation: slideDelay-in .5s both ease-in-out } @-webkit-keyframes slideDelay-out { 100% { -webkit-transform: translateX(-100%) } } @keyframes slideDelay-out { 100% { transform: translateX(-100%) } } @-webkit-keyframes slideDelay-in { 0% { -webkit-transform: translateX(100%) } 100% { -webkit-transform: translateX(0) } } @keyframes slideDelay-in { 0% { transform: translateX(100%) } 100% { transform: translateX(0) } } .<API key>, .<API key> { -webkit-transition: height .6s ease-in-out; will-change: height } .<API key> .cbp-item { -webkit-perspective: 1000px; perspective: 1000px } .<API key> .cbp-item-wrapper { -<API key>: preserve-3d; transform-style: preserve-3d } .<API key> .cbp-wrapper-helper .cbp-item-wrapper { -<API key>: -50% 50%; -webkit-animation: rotateSides-out .5s both ease-in; transform-origin: -50% 50%; animation: rotateSides-out .5s both ease-in } .<API key> .cbp-wrapper .cbp-item-wrapper { -<API key>: 150% 50%; -webkit-animation: rotateSides-in .6s both ease-out; transform-origin: 150% 50%; animation: rotateSides-in .6s both ease-out } @-webkit-keyframes rotateSides-out { 100% { opacity: 0; -webkit-transform: translateZ(-500px) rotateY(90deg) } } @keyframes rotateSides-out { 100% { opacity: 0; transform: translateZ(-500px) rotateY(90deg) } } @-webkit-keyframes rotateSides-in { 0%, 40% { opacity: 0; -webkit-transform: translateZ(-500px) rotateY(-90deg) } } @keyframes rotateSides-in { 0%, 40% { opacity: 0; transform: translateZ(-500px) rotateY(-90deg) } } .<API key> { transition: height .6s ease-in-out } .<API key> .cbp-item { -webkit-perspective: 1000px; perspective: 1000px } .<API key> .cbp-item-wrapper { -<API key>: preserve-3d; transform-style: preserve-3d } .<API key> .cbp-wrapper-helper .cbp-item-wrapper { -<API key>: 100% 50%; transform-origin: 100% 50%; -webkit-animation: foldLeft-out .7s both; animation: foldLeft-out .7s both } .<API key> .cbp-wrapper .cbp-item-wrapper { -webkit-animation: foldLeft-in .7s both; animation: foldLeft-in .7s both } @-webkit-keyframes foldLeft-out { 100% { opacity: 0; -webkit-transform: translateX(-100%) rotateY(-90deg) } } @keyframes foldLeft-out { 100% { opacity: 0; transform: translateX(-100%) rotateY(-90deg) } } @-webkit-keyframes foldLeft-in { 0% { opacity: .3; -webkit-transform: translateX(100%) } } @keyframes foldLeft-in { 0% { opacity: .3; transform: translateX(100%) } } .<API key> { transition: height .6s ease-in-out } .<API key>, .<API key> { -webkit-transition: height .6s ease-in-out; will-change: height; transition: height .6s ease-in-out } .<API key> .cbp-item { -webkit-perspective: 1000px; perspective: 1000px } .<API key> .cbp-item-wrapper { -<API key>: preserve-3d; transform-style: preserve-3d } .<API key> .cbp-wrapper-helper .cbp-item-wrapper { -webkit-animation: unfold-out .8s both; animation: unfold-out .8s both } .<API key> .cbp-wrapper .cbp-item-wrapper { -<API key>: 0 50%; -webkit-animation: unfold-in .8s both; transform-origin: 0 50%; animation: unfold-in .8s both } @-webkit-keyframes unfold-out { 90% { opacity: .3 } 100% { opacity: 0; -webkit-transform: translateX(-100%) } } @keyframes unfold-out { 90% { opacity: .3 } 100% { opacity: 0; transform: translateX(-100%) } } @-webkit-keyframes unfold-in { 0% { opacity: 0; -webkit-transform: translateX(100%) rotateY(90deg) } } @keyframes unfold-in { 0% { opacity: 0; transform: translateX(100%) rotateY(90deg) } } .<API key> .cbp-item { -webkit-perspective: 1000px; perspective: 1000px } .<API key> .cbp-item-wrapper { -<API key>: preserve-3d; transform-style: preserve-3d } .<API key> .cbp-wrapper-helper .cbp-item-wrapper { -webkit-animation: scaleDown-out .7s both; animation: scaleDown-out .7s both } .<API key> .cbp-wrapper .cbp-item-wrapper { -webkit-animation: scaleDown-in .6s both; animation: scaleDown-in .6s both } @-webkit-keyframes scaleDown-out { 100% { opacity: 0; -webkit-transform: scale(.8) } } @keyframes scaleDown-out { 100% { opacity: 0; transform: scale(.8) } } @-webkit-keyframes scaleDown-in { 0% { -webkit-transform: translateX(100%) } } @keyframes scaleDown-in { 0% { transform: translateX(100%) } } .<API key>, .<API key> { -webkit-transition: height .6s ease-in-out; will-change: height } .<API key> .cbp-item { -webkit-perspective: 1000px; perspective: 1000px } .<API key> .cbp-item-wrapper { -<API key>: preserve-3d; transform-style: preserve-3d } .<API key> .cbp-wrapper-helper .cbp-item-wrapper { -webkit-animation: frontRow-out .7s both ease; animation: frontRow-out .7s both ease } .<API key> .cbp-wrapper .cbp-item-wrapper { -webkit-animation: frontRow-in .6s both ease; animation: frontRow-in .6s both ease } @-webkit-keyframes frontRow-out { 100% { -webkit-transform: translateX(-60%) scale(.8); opacity: 0 } } @keyframes frontRow-out { 100% { transform: translateX(-60%) scale(.8); opacity: 0 } } @-webkit-keyframes frontRow-in { 0% { -webkit-transform: translateX(100%) scale(.8) } 100% { opacity: 1; -webkit-transform: translateX(0) scale(1) } } @keyframes frontRow-in { 0% { transform: translateX(100%) scale(.8) } 100% { opacity: 1; transform: translateX(0) scale(1) } } .<API key> { transition: height .6s ease-in-out } .<API key> .cbp-item { -webkit-perspective: 1000px; perspective: 1000px } .<API key> .cbp-item-wrapper { -<API key>: preserve-3d; transform-style: preserve-3d } .<API key> .cbp-wrapper-helper .cbp-item-wrapper { -<API key>: 100% 50%; transform-origin: 100% 50%; -webkit-animation: rotateRoom-out .8s both ease; animation: rotateRoom-out .8s both ease } .<API key> .cbp-wrapper .cbp-item-wrapper { -<API key>: 0 50%; transform-origin: 0 50%; -webkit-animation: rotateRoom-in .8s both ease; animation: rotateRoom-in .8s both ease } @-webkit-keyframes rotateRoom-out { 90% { opacity: .3 } 100% { opacity: 0; -webkit-transform: translateX(-100%) rotateY(90deg) } } @keyframes rotateRoom-out { 90% { opacity: .3 } 100% { opacity: 0; transform: translateX(-100%) rotateY(90deg) } } @-webkit-keyframes rotateRoom-in { 0% { opacity: .3; -webkit-transform: translateX(100%) rotateY(-90deg) } } @keyframes rotateRoom-in { 0% { opacity: .3; transform: translateX(100%) rotateY(-90deg) } } .<API key> { transition: height .6s ease-in-out } .<API key>, .<API key> { -webkit-transition: height .6s ease-in-out; will-change: height; transition: height .6s ease-in-out } .<API key> .cbp-wrapper-helper { -webkit-animation: bounceBottom-out .6s both ease-in-out; animation: bounceBottom-out .6s both ease-in-out } .<API key> .cbp-wrapper { -webkit-animation: bounceBottom-in .6s both ease-in-out; animation: bounceBottom-in .6s both ease-in-out } @-webkit-keyframes bounceBottom-out { 100% { -webkit-transform: translateY(100%); opacity: 0 } } @keyframes bounceBottom-out { 100% { transform: translateY(100%); opacity: 0 } } @-webkit-keyframes bounceBottom-in { 0% { -webkit-transform: translateY(100%); opacity: 0 } 100% { -webkit-transform: translateY(0); opacity: 1 } } @keyframes bounceBottom-in { 0% { transform: translateY(100%); opacity: 0 } 100% { transform: translateY(0); opacity: 1 } } .<API key> .cbp-wrapper-helper { -webkit-animation: bounceLeft-out .6s both ease-in-out; animation: bounceLeft-out .6s both ease-in-out } .<API key> .cbp-wrapper { -webkit-animation: bounceLeft-in .6s both ease-in-out; animation: bounceLeft-in .6s both ease-in-out } @-webkit-keyframes bounceLeft-out { 100% { -webkit-transform: translateX(-100%); opacity: 0 } } @keyframes bounceLeft-out { 100% { transform: translateX(-100%); opacity: 0 } } @-webkit-keyframes bounceLeft-in { 0% { -webkit-transform: translateX(-100%); opacity: 0 } 100% { -webkit-transform: translateX(0); opacity: 1 } } @keyframes bounceLeft-in { 0% { transform: translateX(-100%); opacity: 0 } 100% { transform: translateX(0); opacity: 1 } } .<API key> .cbp-wrapper-helper { -webkit-animation: bounceTop-out .6s both ease-in-out; animation: bounceTop-out .6s both ease-in-out } .<API key> .cbp-wrapper { -webkit-animation: bounceTop-in .6s both ease-in-out; animation: bounceTop-in .6s both ease-in-out } @-webkit-keyframes bounceTop-out { 100% { -webkit-transform: translateY(-100%); opacity: 0 } } @keyframes bounceTop-out { 100% { transform: translateY(-100%); opacity: 0 } } @-webkit-keyframes bounceTop-in { 0% { -webkit-transform: translateY(-100%); opacity: 0 } 100% { -webkit-transform: translateY(0); opacity: 1 } } @keyframes bounceTop-in { 0% { transform: translateY(-100%); opacity: 0 } 100% { transform: translateY(0); opacity: 1 } } .<API key> { -webkit-transition: height .6s ease-in-out; transition: height .6s ease-in-out; will-change: height } .<API key> .cbp-wrapper-helper { -webkit-animation: moveLeft-out .6s both ease-in-out; animation: moveLeft-out .6s both ease-in-out } .<API key> .cbp-wrapper { -webkit-animation: moveLeft-in .6s both ease-in-out; animation: moveLeft-in .6s both ease-in-out } @-webkit-keyframes moveLeft-out { 100% { -webkit-transform: translateX(-100%); opacity: 0 } } @keyframes moveLeft-out { 100% { transform: translateX(-100%); opacity: 0 } } @-webkit-keyframes moveLeft-in { 0% { -webkit-transform: translateX(100%); opacity: 0 } 100% { -webkit-transform: translateX(0); opacity: 1 } } @keyframes moveLeft-in { 0% { transform: translateX(100%); opacity: 0 } 100% { transform: translateX(0); opacity: 1 } } .<API key> { -webkit-perspective: 1000px; perspective: 1000px } .<API key> .cbp-item { -webkit-animation: fadeInBottomToTop .3s both ease-in; animation: fadeInBottomToTop .3s both ease-in } @-webkit-keyframes fadeInBottomToTop { 0% { opacity: 0; -webkit-transform: translateY(50px) } 100% { opacity: 1; -webkit-transform: translateY(0) } } @keyframes fadeInBottomToTop { 0% { opacity: 0; transform: translateY(50px) } 100% { opacity: 1; transform: translateY(0) } } .<API key> { -webkit-animation: fadeIn .5s both ease-in; animation: fadeIn .5s both ease-in } @-webkit-keyframes fadeIn { 0% { opacity: 0 } 100% { opacity: 1 } } @keyframes fadeIn { 0% { opacity: 0 } 100% { opacity: 1 } } .<API key> { -webkit-perspective: 1000px; perspective: 1000px; -webkit-animation: fadeInToTop .5s both ease-in; animation: fadeInToTop .5s both ease-in } @-webkit-keyframes fadeInToTop { 0% { opacity: 0; -webkit-transform: translateY(30px) } 100% { opacity: 1; -webkit-transform: translateY(0) } } @keyframes fadeInToTop { 0% { opacity: 0; transform: translateY(30px) } 100% { opacity: 1; transform: translateY(0) } } .<API key> .cbp-item { -webkit-animation: fadeIn .5s both ease-in; animation: fadeIn .5s both ease-in } .cbp-lightbox img { display: block; border: 0; width: 100%; height: auto } .cbp-popup-ie8bg { position: absolute; width: 100%; height: 100%; min-height: 100%; top: 0; left: 0; z-index: -1; background: #000 } .cbp-popup-wrap { height: 100%; text-align: center; position: fixed; width: 100%; left: 0; top: 0; display: none; overflow-y: hidden; -<API key>: touch; overflow-x: hidden; z-index: 9990; padding: 0 10px } .cbp-popup-wrap video { outline: 0 } .cbp-popup-lightbox { background: rgba(0, 0, 0, .8); display: flex; justify-content: center; align-items: center } .cbp-popup-content, .cbp-popup-wrap:before { display: inline-block; vertical-align: middle } .<API key> { background: #fff; padding: 0 } .cbp-popup-wrap:before { content: ""; height: 100% } .cbp-popup-content { position: relative; text-align: left; max-width: 100% } .cbp-popup-lightbox .cbp-popup-content { display: flex } .<API key> .cbp-popup-content { position: relative; z-index: 1; margin-top: 145px; max-width: 1024px; vertical-align: top; width: 94% } .<API key> .<API key> { position: relative; z-index: 1; margin-top: 104px; vertical-align: top; width: 100%; display: inline-block; text-align: left } .<API key> { width: 100%; position: relative; padding: 20px 0 } .<API key> { position: relative; margin-top: 3px } .<API key> { padding-right: 50px } .<API key> { position: absolute; top: 0; right: 0 } .<API key> { width: auto; max-width: 100%; height: auto; display: block; box-shadow: 0 0 8px rgba(0, 0, 0, .6) } .<API key>[data-action] { cursor: pointer } .<API key> .cbp-popup-content { width: 75%; display: inline-block } @media only screen and (max-width:768px) { .<API key> .cbp-popup-content { width: 95% } } .<API key> .cbp-lightbox-bottom { left: 0; position: absolute; top: 100%; width: 100%; margin-top: 3px } .<API key> { position: relative; height: 0; padding-bottom: 56.25%; background: #000 } .<API key> iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; box-shadow: 0 0 8px rgba(0, 0, 0, .6) } .<API key> audio { margin-top: 27% } .<API key> .<API key> { position: absolute; left: 0; top: 100%; width: 100% } .<API key> .<API key> { position: absolute; top: 0; left: 0; width: 100%; z-index: 9990; height: 104px; background-color: #3D4750 } .<API key> .<API key> { position: relative; width: 100%; height: 100% } .<API key> .<API key> { position: fixed; top: 0!important } .<API key> { color: #fff; position: absolute; margin: auto; right: 40px; top: 0; bottom: 0; font: 400 14px/30px "Open Sans Condensed", sans-serif; height: 30px } .cbp-popup-lightbox .cbp-popup-next, .cbp-popup-lightbox .cbp-popup-prev, .<API key> .cbp-popup-next, .<API key> .cbp-popup-prev { width: 44px; height: 44px; top: 0; margin: auto; bottom: 0 } @media only screen and (max-width:768px) { .<API key> { right: 3% } } .cbp-popup-close, .cbp-popup-next, .cbp-popup-prev { padding: 0; border: none; position: absolute; cursor: pointer; outline: 0; user-select: none } .cbp-popup-lightbox .cbp-popup-prev { background: url(../img/cbp-sprite.png) no-repeat; left: 20px } .cbp-popup-lightbox .cbp-popup-prev:hover { background-position: 0 -46px } .<API key> .cbp-popup-prev { background: url(../img/cbp-sprite.png) 0 -92px no-repeat; right: 108px; left: 0 } .<API key> .cbp-popup-prev:hover { background-position: 0 -138px } .cbp-popup-lightbox .cbp-popup-next { background: url(../img/cbp-sprite.png) -46px 0 no-repeat; right: 20px } .cbp-popup-lightbox .cbp-popup-next:hover { background-position: -46px -46px } .<API key> .cbp-popup-next { background: url(../img/cbp-sprite.png) -46px -92px no-repeat; right: 0; left: 108px } .<API key> .cbp-popup-next:hover { background-position: -46px -138px } .cbp-popup-lightbox .cbp-popup-close { background: url(../img/cbp-sprite.png) -92px 0 no-repeat; height: 40px; width: 40px; right: 20px; top: 20px } .cbp-popup-lightbox .cbp-popup-close:hover { background-position: -92px -46px } .<API key> .cbp-popup-close { background: url(../img/cbp-sprite.png) -92px -92px no-repeat; height: 44px; width: 44px; margin: auto; top: 0; right: 0; bottom: 0; left: 0 } .<API key> .cbp-popup-close:hover { background-position: -92px -138px } .<API key> .cbp-popup-ie8bg { background-color: #fff } @media only screen and (max-width:360px), (max-height:600px) { .cbp-popup-close, .cbp-popup-next, .cbp-popup-prev { -webkit-transform: scale(.8); transform: scale(.8) } .cbp-popup-lightbox .cbp-popup-close { right: 10px; top: 10px } .cbp-popup-lightbox .cbp-popup-next { right: 10px } .cbp-popup-lightbox .cbp-popup-prev { left: 10px } .<API key> .<API key> { height: 84px } .<API key> .cbp-popup-content { margin-top: 120px } } .<API key> { width: 100%; height: 100%; position: absolute; top: 0; left: 0 } .cbp-popup-lightbox .<API key>:after { border-left: 3px solid rgba(255, 255, 255, .3); border-right: 3px solid rgba(255, 255, 255, .3); border-bottom: 3px solid rgba(255, 255, 255, .3); border-top: 3px solid rgba(255, 255, 255, .85) } .cbp-popup-ready .<API key> { visibility: hidden; display: none } .cbp-popup-loading .<API key> { visibility: visible; display: block } .<API key> { overflow-y: scroll } .<API key> { left: 100%; -webkit-transition: left .6s ease-in-out; transition: left .6s ease-in-out } .<API key>.cbp-popup-loading .cbp-popup-content { opacity: 0 } .<API key> { left: 0 } .<API key>.<API key> { left: 0; opacity: 0; -webkit-transition: opacity .25s ease-in-out; transition: opacity .25s ease-in-out } .<API key>.<API key> { opacity: 1 } .<API key>.<API key> { left: -100%; -webkit-transition: left .6s ease-in-out; transition: left .6s ease-in-out } .<API key>.<API key> { left: 0 } .cbp-l-project-title { color: #454444; font: 600 42px/46px "Open Sans Condensed", sans-serif; letter-spacing: 2px; margin-bottom: 15px; text-align: center; text-transform: uppercase } .<API key> { color: #787878; font: 400 14px/21px "Open Sans Condensed", sans-serif; margin: 0 auto 50px; max-width: 500px; text-align: center } .<API key> .cbp-popup-content .cbp-l-project-img { display: block; margin: 0 auto; max-width: 100% } .<API key> { overflow: hidden; margin: 40px auto 0; clear: both } .cbp-l-project-desc { float: left; width: 62% } .<API key> { float: right; width: 38%; padding-left: 60px; margin-bottom: 15px } @media only screen and (max-width:768px) { .cbp-l-project-title { font-size: 30px; line-height: 34px } .cbp-l-project-desc { width: 100% } .<API key> { width: 100%; margin-top: 20px; padding-left: 0 } } .<API key> { border-bottom: 1px solid #cdcdcd; margin-bottom: 22px; color: #444 } .<API key> span, .<API key> span { border-bottom: 1px solid #747474; display: inline-block; margin: 0 0 -1px; font: 400 16px/36px "Open Sans Condensed", sans-serif; padding: 0 5px 0 0 } .<API key> { font: 400 16px/20px "Open Sans Condensed", sans-serif; color: #555; margin-bottom: 20px } .<API key> { border-bottom: 1px solid #cdcdcd; margin-bottom: 19px; color: #444 } .<API key> { margin: 0; padding: 0; list-style: none } .<API key>>div, .<API key>>li { border-bottom: 1px dotted #DFDFDF; padding: inherit; color: #666; font: 400 14px/30px "Open Sans Condensed", sans-serif } .<API key>>div:last-child, .<API key>>li:last-child { border: none } .<API key> strong { display: inline-block; color: #696969; font-weight: 600; min-width: 100px } .<API key> { color: #FFF; float: right; clear: both; text-decoration: none; font: 400 11px/18px "Open Sans Condensed", sans-serif; margin-top: 25px; background-color: #62B57B; padding: 8px 19px; text-transform: uppercase; letter-spacing: .5px } .<API key>:hover { opacity: .9; color: #fff } .<API key> { font-size: 0; margin: 0; padding: 0 } .<API key> { margin-left: 5%; max-width: 30%; float: left } .<API key>:first-child { margin-left: 0 } .<API key> { font: 700 14px/18px "Open Sans Condensed", sans-serif; color: #474747; margin-top: 20px } .<API key> { text-decoration: none } .<API key>:hover { opacity: .9 } .cbp-l-member-img { float: left; width: 40%; margin-top: 20px } .cbp-l-member-img img { width: auto; max-width: 100%; height: auto; display: inline-block; border: 0 } .<API key> .<API key>:after, .<API key>:after { display: none; visibility: hidden } .cbp-l-member-info { margin-top: 20px; padding-left: 25px; float: left; width: 60% } @media only screen and (max-width:768px) { .cbp-l-member-img { width: 100%; text-align: center } .cbp-l-member-info { width: 100%; padding-left: 0 } } .cbp-l-member-name { font: 400 28px/28px "Open Sans Condensed", sans-serif; color: #474747 } .<API key> { font: 400 13px/21px "Open Sans Condensed", sans-serif; color: #888; margin-top: 6px } .cbp-l-member-desc { font: 400 12px/18px "Open Sans Condensed", sans-serif; margin-top: 25px; color: #474747 } .<API key> { -webkit-transition: height .5s 0s!important; transition: height .5s 0s!important } .<API key> .cbp-item { -webkit-transition: -webkit-transform .5s 0s!important; transition: transform .5s 0s!important } .<API key> .<API key> .cbp-popup-content, .<API key> .<API key> .<API key> { -<API key>: 0; transition-delay: 0 } .<API key> { width: 100%; position: absolute; top: 0; left: 0; z-index: 0; overflow: hidden } .<API key> .cbp-popup-content { opacity: 0; width: 100%; z-index: 1; min-height: 300px } .<API key> .cbp-popup-content, .<API key> .<API key> { -webkit-transition: opacity .4s ease-in .2s; transition: opacity .4s ease-in .2s } .<API key> .<API key> { opacity: 0; position: absolute; top: 0; right: 0; z-index: 2; width: 40px; height: 40px } .<API key> .cbp-popup-close { background: url(../img/cbp-sprite.png) -92px 0 no-repeat; height: 40px; width: 40px; right: 20px; top: 30px } .<API key> .cbp-popup-close:hover { opacity: .7 } .<API key> { z-index: 4 } .<API key> .cbp-popup-content, .<API key> .<API key> { opacity: 1 } .<API key> { opacity: .6!important } .cbp-l-inline { margin: 20px 0; overflow: hidden; background: #FAFAFA; padding: 30px } .cbp-l-inline-left { float: left; width: 44% } .cbp-l-project-img { max-width: 100% } .cbp-l-inline-right { float: right; width: 56%; padding-left: inherit } @media only screen and (max-width:768px) { .cbp-l-inline-left { width: 100%; text-align: center; margin-top: 40px } .cbp-l-inline-right { width: 100%; padding-left: 0; margin-top: 20px } } .cbp-l-inline-title { font: 400 28px/30px "Open Sans Condensed", sans-serif; color: #474747 } .<API key> { font: 400 13px/21px "Open Sans Condensed", sans-serif; color: #888; margin-top: 7px } .cbp-l-inline-desc { font: 400 13px/20px "Open Sans Condensed", sans-serif; color: #474747; margin-top: 25px; margin-bottom: 20px } .<API key> { text-align: right } .<API key>, .<API key>, .cbp-l-loadMore-text { text-align: center } .cbp-l-inline-view { font: 400 13px/35px "Open Sans Condensed", sans-serif; color: #9C9C9C; margin-top: 40px; display: inline-block; padding: 0 20px; border: 1px solid #ccc; text-decoration: none } .cbp-l-inline-view:hover { color: #757575 } .<API key> { margin-bottom: 15px; font: 13px/22px "Open Sans Condensed", sans-serif } .<API key>, .<API key> { display: block } .<API key>, .<API key>, .<API key>, .<API key> { display: none } .<API key> .<API key>, .<API key> .<API key> { display: block } .<API key> .<API key>, .<API key> .<API key>, .<API key> .<API key>, .<API key> .<API key> { display: none } .cbp-l-loadMore-stop .<API key>, .cbp-l-loadMore-stop .<API key> { display: block } .cbp-l-loadMore-stop .<API key>, .cbp-l-loadMore-stop .<API key>, .cbp-l-loadMore-stop .<API key>, .cbp-l-loadMore-stop .<API key> { display: none } .<API key> .cbp-l-loadMore-link { border: 1px solid #DEDEDE; color: #7E7B7B; display: inline-block; font: 400 13px/40px Lato, sans-serif; min-width: 80px; text-decoration: none; padding: 0 50px; margin-top: 50px; outline: 0; box-shadow: none; letter-spacing: 1px; -webkit-transition: color .25s; transition: color .25s } .<API key> .cbp-l-loadMore-link.<API key>, .<API key> .cbp-l-loadMore-link:hover { color: #B0B0B0 } .<API key> .cbp-l-loadMore-link.cbp-l-loadMore-stop { color: #B0B0B0; cursor: default } .<API key> .<API key>, .<API key> .cbp-l-loadMore-link { border-bottom: 1px solid #DEDEDE; color: #444; display: inline-block; font: 400 16px/36px "Open Sans Condensed", sans-serif; min-width: 80px; text-decoration: none; padding: 0 30px; outline: 0; margin-top: 40px; box-shadow: none; -webkit-transition: color .25s; transition: color .25s } .<API key> .<API key>.<API key>, .<API key> .<API key>:hover, .<API key> .cbp-l-loadMore-link.<API key>, .<API key> .cbp-l-loadMore-link:hover { color: #B0B0B0 } .<API key> .<API key>.<API key>, .<API key> .<API key>.cbp-l-loadMore-stop, .<API key> .cbp-l-loadMore-link.<API key>, .<API key> .cbp-l-loadMore-link.cbp-l-loadMore-stop { cursor: default; color: #B0B0B0 } .cbp-l-loadMore-text .cbp-l-loadMore-link, .cbp-l-loadMore-text .<API key> { font: 400 15px "Open Sans Condensed", sans-serif; color: #7E7B7B; text-decoration: none; cursor: pointer; margin-top: 50px; display: block } .cbp-l-loadMore-text .cbp-l-loadMore-stop, .cbp-l-loadMore-text .<API key> { color: #B0B0B0; cursor: default } .cbp-mode-slider { -webkit-transition: height .35s; transition: height .35s } .cbp-mode-slider .cbp-item, .cbp-mode-slider .cbp-wrapper { -webkit-transition: -webkit-transform .35s; transition: transform .35s } .cbp-mode-slider .cbp-wrapper { cursor: -webkit-grab; cursor: -o-grab; cursor: -ms-grab; cursor: grab } .<API key> * { cursor: move!important; cursor: -ms-grabbing!important; cursor: -webkit-grabbing!important; cursor: -moz-grabbing!important; cursor: grabbing!important } .<API key> .cbp-wrapper { -webkit-transition: none; transition: none } .cbp-nav-next, .cbp-nav-prev { position: relative; background: #7c8b90; cursor: pointer; display: inline-block; margin-left: 1px; height: 22px; width: 21px } .cbp-nav-next { border-radius: 0 2px 2px 0 } .cbp-nav-prev { border-radius: 2px 0 0 2px } .cbp-nav-next:hover, .cbp-nav-prev:hover { opacity: .8 } .cbp-nav-next:after, .cbp-nav-prev:after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; margin: auto; background: url(../img/cbp-sprite.png) no-repeat; height: 10px; width: 7px } .cbp-nav-next:after { background-position: -134px 0 } .cbp-nav-prev:after { background-position: -134px -12px } .cbp-nav-stop { opacity: .5!important; cursor: default!important } .cbp-nav { user-select: none } .cbp-nav-controls { position: absolute; top: -51px; right: 0; z-index: 100 } .cbp-nav-pagination { position: absolute; bottom: -30px; right: 0; z-index: 100; left: 0; text-align: center } .<API key>, .cbp-pagination-item { display: inline-block; position: relative; cursor: pointer } .<API key> { width: 10px; height: 10px; border-radius: 50%; margin: 0 4px; background: #c2c2c2; -webkit-transition: background .5s; transition: background .5s } .<API key> { background: #797979 } .cbp-pagination-item { max-width: 100px; margin-top: 10px; margin-right: 5px } .cbp-pagination-item img { display: block; width: 100%; height: auto; border: 0 } .cbp-pagination-item:after { content: ''; position: absolute; top: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, .5); -webkit-transition: background .5s ease-in-out; transition: background .5s ease-in-out } .<API key>:after { background: 0 0 } .cbp-slider-item, .cbp-slider-wrap { margin: 0; padding: 0; list-style-type: none } .cbp-slider .cbp-nav-controls { position: static } .cbp-slider .cbp-nav-next, .cbp-slider .cbp-nav-prev { background: 0 0; position: absolute; margin: auto; top: 0; bottom: 0; z-index: 100; width: 44px; height: 44px } .cbp-slider .cbp-nav-next { right: 25px; left: auto } .cbp-slider .cbp-nav-prev { left: 25px; right: auto } .cbp-slider .cbp-nav-next:after, .cbp-slider .cbp-nav-prev:after { background: url(../img/cbp-sprite.png) no-repeat; width: 44px; height: 44px } .cbp-slider .cbp-nav-next:after { background-position: -46px -92px } .cbp-slider .cbp-nav-next:hover:after { background-position: -46px -46px } .cbp-slider .cbp-nav-prev:after { background-position: 0 -92px } .cbp-slider .cbp-nav-prev:hover:after { background-position: 0 -46px } .cbp-slider .cbp-nav-pagination { text-align: right; bottom: 20px; right: 25px; left: auto } .cbp-slider-edge .cbp-nav-controls { position: static } .cbp-slider-edge .cbp-nav-next, .cbp-slider-edge .cbp-nav-prev { background: 0 0; position: absolute; margin: auto; top: 0; bottom: 0; z-index: 100; width: 44px; height: 44px } .cbp-slider-edge .cbp-nav-next { right: 0; left: auto } .cbp-slider-edge .cbp-nav-prev { left: 0; right: auto } .cbp-slider-edge .cbp-nav-next:after, .cbp-slider-edge .cbp-nav-prev:after { background: url(../img/cbp-sprite.png) no-repeat; width: 9px; height: 16px } .cbp-slider-edge .cbp-nav-next:after { background-position: -134px -24px } .cbp-slider-edge .cbp-nav-prev:after { background-position: -134px -42px } .cbp-slider-edge .cbp-nav-pagination { bottom: -50px } .cbp-slider-edge .<API key> { border: 2px solid #0f0f0f; opacity: .4; background: 0 0 } .cbp-slider-edge .<API key> { background: #000 } .cbp-slider-inline { position: relative } .cbp-slider-inline .cbp-slider-item { position: absolute; width: 100%; top: 0; -webkit-transition: left .5s; transition: left .5s } .cbp-slider-inline .<API key> { position: relative; z-index: 2 } .cbp-slider-wrapper { position: relative; overflow: hidden } .cbp-slider-controls { position: absolute; top: 0; right: 0; z-index: 100; opacity: 0; -webkit-transition: opacity .7s ease-in-out; transition: opacity .7s ease-in-out } .<API key> .cbp-slider-controls { opacity: 1 } .<API key>:hover, .<API key> a:hover, .cbp-social-fb:hover, .<API key>:hover, .<API key>:hover, .cbp-social-twitter:hover { opacity: .8 } .cbp-slider-next, .cbp-slider-prev { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; float: left; cursor: pointer; position: relative; width: 36px; height: 36px; background: #547EB1 } .cbp-slider-next { margin-left: 1px } .cbp-slider-next:after, .cbp-slider-prev:after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; margin: auto; background: url(../img/cbp-sprite.png) no-repeat; width: 9px; height: 16px } .cbp-slider-next:after { background-position: -134px -60px } .cbp-slider-prev:after { background-position: -134px -78px } .cbp-l-grid-agency .cbp-caption:after { position: absolute; content: ''; width: 0; height: 0; border-bottom: 10px solid #fff; border-right: 10px solid transparent; border-left: 10px solid transparent; bottom: 0; left: 50%; margin-left: -5px; z-index: 1 } .cbp-l-grid-agency.cbp-caption-zoom .cbp-caption:hover .<API key> { -webkit-transform: scale(1.15); transform: scale(1.15) } .<API key> { margin-top: 18px; font: 700 17px/24px Lato, sans-serif; color: #666; text-align: center; padding: 0 4px } .cbp-item:hover .<API key> { color: #222 } .<API key> { font: 400 12px/21px "Open Sans Condensed", sans-serif; color: #aaa; text-align: center } @media only screen and (max-width:480px) { .<API key> { font-size: 15px; line-height: 21px } } .cbp-l-grid-work.cbp-caption-zoom .<API key> { background-color: rgba(0, 0, 0, .7) } .cbp-l-grid-work .cbp-item { padding: 3px } .cbp-l-grid-work .cbp-item-wrapper { background-color: #fff; box-shadow: 0 1px 1px rgba(0, 0, 0, .2); padding: 7px 7px 27px; border-top: 1px solid #F4F4F4 } .<API key> { margin-top: 17px; font: 400 17px/25px "Roboto Condensed", sans-serif; color: #607D8B; text-align: center; text-transform: uppercase; display: block } .<API key>:hover { color: #365D67 } .<API key> { font: 400 11px/16px "Open Sans Condensed", sans-serif; color: #888; text-align: center; text-transform: uppercase } @media only screen and (max-width:480px) { .<API key> { font-size: 15px; line-height: 21px; margin-top: 15px } .cbp-l-grid-work .cbp-item-wrapper { padding-bottom: 18px } } .<API key> { font: 400 18px/30px "Open Sans Condensed", sans-serif; color: #444; display: block; margin-top: 17px } .<API key>, .<API key> { font: 400 12px/18px "Open Sans Condensed", sans-serif } .<API key>:hover { color: #787878 } .<API key> { color: #787878; display: inline-block } .<API key> { color: #3C6FBB; display: inline-block } .<API key> { font: 400 13px/18px "Open Sans Condensed", sans-serif; color: #9B9B9B; margin-top: 9px } .<API key> { margin: 0 4px; font: 400 13px/16px "Open Sans Condensed", sans-serif; color: #787878; display: inline-block } .cbp-l-grid-clients { height: 180px } .<API key> { font: 400 32px/53px Roboto, sans-serif; color: #666464; text-align: center; margin-bottom: 40px } .cbp-l-grid-faq .cbp-item { width: 100% } .<API key> { font: 700 16px/21px "Open Sans Condensed", sans-serif; color: #474747; margin-top: 15px } .<API key> { font: 400 16px/18px "Open Sans Condensed", sans-serif; color: #444; margin-top: 5px } @media only screen and (max-width:480px) { .<API key> { margin-top: 12px } .<API key> { margin-top: 3px } } .<API key> .<API key> { background-color: #59a3b6; background-color: rgba(89, 163, 182, .95) } .<API key> .<API key>, .<API key> .<API key> { background-color: #545454 } .<API key> { font: 500 15px/22px Roboto, sans-serif; color: #59a3b6; text-align: center; display: block; margin-top: 12px } .<API key>:hover { color: #457C8B } .<API key> { font: 400 12px/18px Roboto, sans-serif; color: #b2b2b2; text-align: center } .<API key> { font: 400 17px/24px "Open Sans Condensed", sans-serif; color: #456297; display: block; text-align: center; margin-top: 18px } .<API key>:hover { color: #34425C } .<API key> { font: italic 400 13px/21px "Open Sans Condensed", sans-serif; color: #999; text-align: center } @media only screen and (max-width:480px) { .<API key> { font-size: 15px; line-height: 22px; margin-top: 13px } .<API key> { font-size: 12px; line-height: 18px } } .<API key> .<API key> { background-color: #64C28E; background-color: rgba(101, 199, 150, .95) } .<API key> .cbp-l-caption-title { color: #FFF; font: 400 14px/21px Lato, sans-serif; text-transform: uppercase; letter-spacing: 2px; display: inline-block } .<API key> .cbp-l-caption-title:after { content: ''; display: block; width: 40%; height: 1px; background-color: #fff; margin: 8px auto 0 } @media only screen and (max-width:800px) { .<API key> .cbp-l-caption-title:after { display: none } } .<API key> .<API key> { background-color: #59a3b6; background-color: rgba(89, 163, 182, .97) } .cbp-l-grid-mosaic .<API key> { background-color: #FFEA71; background-color: rgba(255, 234, 113, .95) } .cbp-l-grid-mosaic .cbp-l-caption-title { color: #5A5A5A; font: 500 18px/22px Roboto, sans-serif; text-transform: uppercase; margin-bottom: 5px } .cbp-l-grid-mosaic .cbp-l-caption-desc { color: #585858; font: 400 13px/20px Roboto, sans-serif } @media only screen and (max-width:480px) { .cbp-l-grid-mosaic .cbp-l-caption-title { font-size: 16px; line-height: 22px; margin-bottom: 0 } .cbp-l-grid-mosaic .cbp-l-caption-desc { font-size: 12px; line-height: 18px } } .<API key> { border-bottom: 1px solid #cdcdcd; margin-bottom: 22px } .<API key> div { padding: 0 2px 6px 0; display: inline-block; border-bottom: 1px solid #a9a5a5; color: #5e5e5e; margin-bottom: -1px; font: 15px/21px Roboto, sans-serif } .<API key> { float: left; font: 20px/30px Roboto, sans-serif; color: #494949; margin-top: 16px } .<API key> { clear: both; font: 14px/21px Roboto, sans-serif; color: #A6A6A6 } .<API key> { font: 13px/20px Roboto, sans-serif; color: #969696; margin-top: 15px } .<API key> { float: right; margin-top: 22px } .<API key> a { margin-left: 4px } @media only screen and (max-width:600px) { .<API key> { float: left; width: 100%; margin-bottom: 10px } .<API key> { font-size: 17px; line-height: 26px; width: 100%; margin-top: 12px; text-align: center } .<API key> { width: 100%; text-align: center; margin-top: 8px } .<API key> { font-size: 13px; line-height: 20px; text-align: center } .<API key> { font-size: 12px; line-height: 18px; margin-top: 10px; text-align: center } } .<API key> { background: #f8f9f9; padding: 80px 0 110px; border-width: 1px 0; border-style: solid; border-color: #dce1e2 } .<API key> { color: #424242; max-width: 800px; margin: 0 auto; font: 20px/32px sans-serif; text-align: center; padding: 0 40px } .<API key> { font: 12px/19px Roboto, sans-serif; color: #777; text-align: center; margin-bottom: 10px; margin-top: 30px } .cbp-l-grid-tabs { height: 100px } .cbp-l-grid-tabs .cbp-item { font: 16px/24px 'Open Sans Condensed', sans-serif; max-width: 700px; width: 100%; margin: 0 auto; right: 0; text-align: center; color: #5a5a5a } .<API key> { position: relative; text-align: center; font: 26px/36px Roboto, sans-serif; color: #E7E7E7; margin-bottom: 60px } .<API key>:after { content: ''; position: absolute; margin: 0 auto; width: 23px; height: 2px; bottom: -6px; background-color: #C2C2C2; left: 0; right: 0 } .<API key> { background: #2D2D2D; padding: 60px 0 110px } .<API key> { color: #e7e7e7; max-width: 800px; margin: 0 auto; font: 20px/32px Roboto, sans-serif; text-align: center; padding: 0 20px } .<API key> { font: 12px/19px Roboto, sans-serif; color: #C2C2C2; text-align: center; margin-bottom: 40px; margin-top: 35px } .cbp-search { position: relative; width: 220px; margin-bottom: 40px } .cbp-search-icon, .cbp-search-nothing { position: absolute; top: 0; text-align: center } .cbp-search .cbp-search-nothing { display: none } .cbp-search-icon { width: 32px; height: 100%; right: 0; cursor: pointer; pointer-events: none } .cbp-search-icon:after { content: ''; display: block; background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNzkyIDE3OTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iIzczNzM3MyIgZD0iTTEyMTYgODMycTAtMTg1LTEzMS41LTMxNi41VDc2OCAzODQgNDUxLjUgNTE1LjUgMzIwIDgzMnQxMzEuNSAzMTYuNVQ3NjggMTI4MHQzMTYuNS0xMzEuNVQxMjE2IDgzMnptNTEyIDgzMnEwIDUyLTM4IDkwdC05MCAzOHEtNTQgMC05MC0zOGwtMzQzLTM0MnEtMTc5IDEyNC0zOTkgMTI0LTE0MyAwLTI3My41LTU1LjV0LTIyNS0xNTAtMTUwLTIyNVQ2NCA4MzJ0NTUuNS0yNzMuNSAxNTAtMjI1IDIyNS0xNTBUNzY4IDEyOHQyNzMuNSA1NS41IDIyNSAxNTAgMTUwIDIyNVQxNDcyIDgzMnEwIDIyMC0xMjQgMzk5bDM0MyAzNDNxMzcgMzcgMzcgOTB6Ii8+PC9zdmc+) center center no-repeat; width: 100%; height: 100%; pointer-events: none } .cbp-search-input { height: 36px; padding: 0 32px 0 12px; margin: 0; border-radius: 1px; border: 1px solid #c6c3c4; font: 400 12px "Open Sans Condensed", sans-serif; width: 100% } .cbp-search-input[value]+.cbp-search-icon { pointer-events: auto } .cbp-search-input[value]+.cbp-search-icon:after { background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNzkyIDE3OTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iIzczNzM3MyIgZD0iTTE0OTAgMTMyMnEwIDQwLTI4IDY4bC0xMzYgMTM2cS0yOCAyOC02OCAyOHQtNjgtMjhsLTI5NC0yOTQtMjk0IDI5NHEtMjggMjgtNjggMjh0LTY4LTI4bC0xMzYtMTM2cS0yOC0yOC0yOC02OHQyOC02OGwyOTQtMjk0LTI5NC0yOTRxLTI4LTI4LTI4LTY4dDI4LTY4bDEzNi0xMzZxMjgtMjggNjgtMjh0NjggMjhsMjk0IDI5NCAyOTQtMjk0cTI4LTI4IDY4LTI4dDY4IDI4bDEzNiAxMzZxMjggMjggMjggNjh0LTI4IDY4bC0yOTQgMjk0IDI5NCAyOTRxMjggMjggMjggNjh6Ii8+PC9zdmc+) } .cbp-search-nothing { padding: 0 0 30px; width: 100%; font: 13px "Open Sans Condensed", sans-serif } @media only screen and (max-width:600px) { .cbp-search { width: 100% } } .<API key> { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex } .cbp-social-fb, .<API key>, .<API key>, .cbp-social-twitter { margin-right: 9px; display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex } .cbp-social-fb:focus, .<API key>:focus, .<API key>:focus, .cbp-social-twitter:focus { outline: 0 } .cbp-social-fb path { fill: #415C9B } .cbp-social-twitter path { fill: #55acee } .<API key> path { fill: #E57371 } .<API key> path { fill: #cb2027 } .<API key> { position: absolute; top: 0; right: 0; bottom: 0; left: 0; overflow-y: hidden; overflow-x: hidden; -<API key>: touch } .<API key> .<API key> { overflow-y: scroll } .<API key> { overflow-y: hidden; }
#include "stdafx.h" #include "NET_Common.h" #include "net_client.h" #include "net_server.h" #include "net_messages.h" #include "NET_Log.h" #include "../xr_3da/xrGame/battleye.h" #pragma warning(push) #pragma warning(disable:4995) #include <malloc.h> #include "dxerr.h" //#pragma warning(pop) static INetLog* pClNetLog = NULL; #define BASE_PORT_LAN_SV 5445 #define BASE_PORT_LAN_CL 5446 #define BASE_PORT 0 #define END_PORT 65535 void dump_URL (LPCSTR p, IDirectPlay8Address* A) { string256 aaaa; DWORD aaaa_s = sizeof(aaaa); R_CHK (A->GetURLA(aaaa,&aaaa_s)); Log (p,aaaa); } INetQueue::INetQueue() #ifdef <API key> :cs(MUTEX_PROFILE_ID(INetQueue)) #endif // <API key> { unused.reserve (128); for (int i=0; i<16; i++) unused.push_back (xr_new<NET_Packet>()); } INetQueue::~INetQueue() { cs.Enter (); u32 it; for (it=0; it<unused.size(); it++) xr_delete(unused[it]); for (it=0; it<ready.size(); it++) xr_delete(ready[it]); cs.Leave (); } static u32 LastTimeCreate = 0; void INetQueue::CreateCommit(NET_Packet* P) { cs.Enter (); ready.push_back (P); cs.Leave (); } NET_Packet* INetQueue::CreateGet() { NET_Packet* P = 0; cs.Enter (); if (unused.empty()) { P = xr_new<NET_Packet> (); //. ready.push_back (xr_new<NET_Packet> ()); //. P = ready.back (); LastTimeCreate = GetTickCount(); } else { P = unused.back(); //. ready.push_back (unused.back()); unused.pop_back (); //. P = ready.back (); } cs.Leave (); return P; } NET_Packet* INetQueue::Retreive () { NET_Packet* P = 0; cs.Enter (); //#ifdef _DEBUG // Msg ("INetQueue::Retreive - ready %d, unused %d", ready.size(), unused.size()); //#endif if (!ready.empty()) P = ready.front(); else { u32 tmp_time = GetTickCount()-60000; u32 size = unused.size(); if ((LastTimeCreate < tmp_time) && (size > 32)) { xr_delete(unused.back()); unused.pop_back(); } } cs.Leave (); return P; } void INetQueue::Release () { cs.Enter (); //#ifdef _DEBUG // Msg ("INetQueue::Release - ready %d, unused %d", ready.size(), unused.size()); //#endif VERIFY (!ready.empty()); u32 tmp_time = GetTickCount()-60000; u32 size = unused.size(); if ((LastTimeCreate < tmp_time) && (size > 32)) { xr_delete(ready.front()); } else unused.push_back(ready.front()); ready.pop_front (); cs.Leave (); } const u32 syncQueueSize = 512; const int syncSamples = 256; class XRNETSERVER_API syncQueue { u32 table [syncQueueSize]; u32 write; u32 count; public: syncQueue() { clear(); } IC void push (u32 value) { table[write++] = value; if (write == syncQueueSize) write = 0; if (count <= syncQueueSize) count++; } IC u32* begin () { return table; } IC u32* end () { return table+count; } IC u32 size () { return count; } IC void clear () { write=0; count=0; } } net_DeltaArray; XRNETSERVER_API Flags32 psNET_Flags = {0}; XRNETSERVER_API int psNET_ClientUpdate = 30; // FPS XRNETSERVER_API int psNET_ClientPending = 2; XRNETSERVER_API char psNET_Name[32] = "Player"; XRNETSERVER_API BOOL <API key> = FALSE; // {<API key>} static const GUID NET_GUID = { 0x218fa8b, 0x515b, 0x4bf2, { 0x9a, 0x5f, 0x2f, 0x7, 0x9d, 0x17, 0x59, 0xf3 } }; // {<API key>} static const GUID <API key> = { 0x8d3f9e5e, 0xa3bd, 0x475b, { 0x9e, 0x49, 0xb0, 0xe7, 0x71, 0x39, 0x14, 0x3c } }; static HRESULT WINAPI Handler (PVOID pvUserContext, DWORD dwMessageType, PVOID pMessage) { IPureClient* C = (IPureClient*)pvUserContext; return C->net_Handler(dwMessageType,pMessage); } void IPureClient::_SendTo_LL( const void* data, u32 size, u32 flags, u32 timeout ) { IPureClient::SendTo_LL( const_cast<void*>(data), size, flags, timeout ); } void IPureClient::_Recieve( const void* data, u32 data_size, u32 /*param*/ ) { MSYS_PING* cfg = (MSYS_PING*)data; if( (data_size>2*sizeof(u32)) && (cfg->sign1==0x12071980) && (cfg->sign2==0x26111975) ) { // Internal system message if( (data_size == sizeof(MSYS_PING)) ) { // It is reverted(server) ping u32 time = TimerAsync( device_timer ); u32 ping = time - (cfg->dwTime_ClientSend); u32 delta = cfg->dwTime_Server + ping/2 - time; net_DeltaArray.push ( delta ); Sync_Average (); return; } if ( data_size == sizeof(MSYS_CONFIG) ) { MSYS_CONFIG* msys_cfg = (MSYS_CONFIG*)data; if ( msys_cfg->is_battleye ) { #ifdef BATTLEYE if ( !TestLoadBEClient() ) { net_Connected = EnmConnectionFails; return; } #endif // BATTLEYE } net_Connected = <API key>; return; } Msg( "! Unknown system message" ); return; } else if( net_Connected == <API key> ) { // one of the messages - decompress it if( psNET_Flags.test( <API key> ) ) { if( !pClNetLog ) pClNetLog = xr_new<INetLog>("logs\\net_cl_log.log", timeServer()); if( pClNetLog ) pClNetLog->LogData( timeServer(), const_cast<void*>(data), data_size, TRUE ); } OnMessage( const_cast<void*>(data), data_size ); } } IPureClient::IPureClient (CTimer* timer): net_Statistic(timer) #ifdef <API key> ,net_csEnumeration(MUTEX_PROFILE_ID(IPureClient::net_csEnumeration)) #endif // <API key> { NET = NULL; net_Address_server = NULL; net_Address_device = NULL; device_timer = timer; net_TimeDelta_User = 0; net_Time_LastUpdate = 0; net_TimeDelta = 0; <API key> = 0; pClNetLog = NULL;//xr_new<INetLog>("logs\\net_cl_log.log", timeServer()); } IPureClient::~IPureClient () { xr_delete(pClNetLog); pClNetLog = NULL; <API key> = FALSE; } void gen_auth_code(); BOOL IPureClient::Connect (LPCSTR options) { R_ASSERT (options); net_Disconnected = FALSE; if(!<API key> && !strstr(options,"localhost") ) { gen_auth_code (); } if(!<API key>) { string256 server_name = ""; // strcpy (server_name,options); if (strchr(options, '/')) strncpy(server_name,options, strchr(options, '/')-options); if (strchr(server_name,'/')) *strchr(server_name,'/') = 0; string64 password_str = ""; if (strstr(options, "psw=")) { const char* PSW = strstr(options, "psw=") + 4; if (strchr(PSW, '/')) strncpy(password_str, PSW, strchr(PSW, '/') - PSW); else strcpy(password_str, PSW); } string64 user_name_str = ""; if (strstr(options, "name=")) { const char* NM = strstr(options, "name=") + 5; if (strchr(NM, '/')) strncpy(user_name_str, NM, strchr(NM, '/') - NM); else strcpy(user_name_str, NM); } string64 user_pass = ""; if (strstr(options, "pass=")) { const char* UP = strstr(options, "pass=") + 5; if (strchr(UP, '/')) strncpy(user_pass, UP, strchr(UP, '/') - UP); else strcpy(user_pass, UP); } int psSV_Port = BASE_PORT_LAN_SV; if (strstr(options, "port=")) { string64 portstr; strcpy(portstr, strstr(options, "port=")+5); if (strchr(portstr,'/')) *strchr(portstr,'/') = 0; psSV_Port = atol(portstr); clamp(psSV_Port, int(BASE_PORT), int(END_PORT)); }; BOOL bPortWasSet = FALSE; int psCL_Port = BASE_PORT_LAN_CL; if (strstr(options, "portcl=")) { string64 portstr; strcpy(portstr, strstr(options, "portcl=")+7); if (strchr(portstr,'/')) *strchr(portstr,'/') = 0; psCL_Port = atol(portstr); clamp(psCL_Port, int(BASE_PORT), int(END_PORT)); bPortWasSet = TRUE; }; // Msg("* Client connect on port %d\n",psNET_Port); net_Connected = EnmConnectionWait; net_Syncronised = FALSE; net_Disconnected= FALSE; string1024 tmp=""; // HRESULT CoInitializeExRes = CoInitializeEx(NULL, 0); // if (CoInitializeExRes != S_OK && CoInitializeExRes != S_FALSE) // DXTRACE_ERR(tmp, CoInitializeExRes); // CHK_DX(CoInitializeExRes); // Create the IDirectPlay8Client object. HRESULT CoCreateInstanceRes = CoCreateInstance (<API key>, NULL, <API key>, <API key>, (LPVOID*) &NET); if (CoCreateInstanceRes != S_OK) { DXTRACE_ERR(tmp, CoCreateInstanceRes ); CHK_DX(CoCreateInstanceRes ); } // Initialize IDirectPlay8Client object. #ifdef DEBUG R_CHK(NET->Initialize (this, Handler, 0)); #else R_CHK(NET->Initialize (this, Handler, <API key> )); #endif BOOL bSimulator = FALSE; if (strstr(Core.Params,"-netsim")) bSimulator = TRUE; net_Address_device = NULL; R_CHK(CoCreateInstance (<API key>,NULL, <API key>, <API key>,(LPVOID*) &net_Address_device )); R_CHK(net_Address_device->SetSP(bSimulator? &<API key> : &CLSID_DP8SP_TCPIP )); WCHAR ServerNameUNICODE [256]; R_CHK(MultiByteToWideChar(CP_ACP, 0, server_name, -1, ServerNameUNICODE, 256 )); net_Address_server = NULL; R_CHK(CoCreateInstance (<API key>,NULL, <API key>, <API key>,(LPVOID*) &net_Address_server )); R_CHK(net_Address_server->SetSP (bSimulator? &<API key> : &CLSID_DP8SP_TCPIP )); R_CHK(net_Address_server->AddComponent (DPNA_KEY_HOSTNAME, ServerNameUNICODE, 2*u32(wcslen(ServerNameUNICODE) + 1), <API key> )); R_CHK(net_Address_server->AddComponent (DPNA_KEY_PORT, &psSV_Port, sizeof(psSV_Port), DPNA_DATATYPE_DWORD )); // Debug // dump_URL ("! cl ", net_Address_device); // dump_URL ("! en ", net_Address_server); // Now set up the Application Description <API key> dpAppDesc; ZeroMemory (&dpAppDesc, sizeof(<API key>)); dpAppDesc.dwSize = sizeof(<API key>); dpAppDesc.guidApplication = NET_GUID; // Setup client info /*strcpy_s( tmp, server_name ); strcat_s( tmp, "/name=" ); strcat_s( tmp, user_name_str ); strcat_s( tmp, "/" );*/ WCHAR ClientNameUNICODE [256]; R_CHK(MultiByteToWideChar (CP_ACP, 0, user_name_str, -1, ClientNameUNICODE, 256 )); { DPN_PLAYER_INFO Pinfo; ZeroMemory (&Pinfo,sizeof(Pinfo)); Pinfo.dwSize = sizeof(Pinfo); Pinfo.dwInfoFlags = DPNINFO_NAME|DPNINFO_DATA; Pinfo.pwszName = ClientNameUNICODE; SClientConnectData cl_data; cl_data.process_id = GetCurrentProcessId(); strcpy_s( cl_data.name, user_name_str ); strcpy_s( cl_data.pass, user_pass ); Pinfo.pvData = &cl_data; Pinfo.dwDataSize = sizeof(cl_data); R_CHK(NET->SetClientInfo (&Pinfo,0,0,<API key>)); } if ( stricmp( server_name, "localhost" ) == 0 ) { WCHAR <API key>[4096]; if ( xr_strlen( password_str ) ) { CHK_DX(MultiByteToWideChar (CP_ACP, 0, password_str, -1, <API key>, 4096 )); dpAppDesc.dwFlags |= <API key>; dpAppDesc.pwsz<API key>; }; u32 c_port = u32(psCL_Port); HRESULT res = S_FALSE; while (res != S_OK && c_port <=u32(psCL_Port+100)) { R_CHK(net_Address_device->AddComponent (DPNA_KEY_PORT, &c_port, sizeof(c_port), DPNA_DATATYPE_DWORD )); res = NET->Connect( &dpAppDesc, // pdnAppDesc net_Address_server, // pHostAddr net_Address_device, // pDeviceInfo NULL, // pdnSecurity NULL, // pdnCredentials NULL, 0, // pvUserConnectData/Size NULL, // pvAsyncContext NULL, // pvAsyncHandle DPNCONNECT_SYNC); // dwFlags if (res != S_OK) { // xr_string res = Debug.error2string(HostSuccess); if (bPortWasSet) { Msg("! IPureClient : port %d is BUSY!", c_port); return FALSE; } #ifdef DEBUG else Msg("! IPureClient : port %d is BUSY!", c_port); #endif c_port++; } else { Msg("- IPureClient : created on port %d!", c_port); } }; // R_CHK(res); if (res != S_OK) return FALSE; // Create ONE node HOST_NODE NODE; ZeroMemory (&NODE, sizeof(HOST_NODE)); // Copy the Host Address R_CHK (net_Address_server->Duplicate(&NODE.pHostAddress ) ); // Retreive session name char desc[4096]; ZeroMemory (desc,sizeof(desc)); <API key>* dpServerDesc=(<API key>*)desc; DWORD dpServerDescSize=sizeof(desc); dpServerDesc->dwSize = sizeof(<API key>); R_CHK (NET->GetApplicationDesc(dpServerDesc,&dpServerDescSize,0)); if( dpServerDesc->pwszSessionName) { string4096 dpSessionName; R_CHK(WideCharToMultiByte(CP_ACP,0,dpServerDesc->pwszSessionName,-1,dpSessionName,sizeof(dpSessionName),0,0)); NODE.dpSessionName = (char*)(&dpSessionName[0]); } net_Hosts.push_back (NODE); } else { string64 EnumData; EnumData[0] = 0; strcat (EnumData, "ToConnect"); DWORD EnumSize = xr_strlen(EnumData) + 1; // We now have the host address so lets enum u32 c_port = psCL_Port; HRESULT res = S_FALSE; while (res != S_OK && c_port <=END_PORT) { R_CHK(net_Address_device->AddComponent (DPNA_KEY_PORT, &c_port, sizeof(c_port), DPNA_DATATYPE_DWORD )); res = NET->EnumHosts( &dpAppDesc, // pApplicationDesc net_Address_server, // pdpaddrHost net_Address_device, // pdpaddrDeviceInfo EnumData, EnumSize, // pvUserEnumData, size 10, // dwEnumCount 1000, // dwRetryInterval 1000, // dwTimeOut NULL, // pvUserContext NULL, // pAsyncHandle DPNENUMHOSTS_SYNC // dwFlags ); if (res != S_OK) { // xr_string res = Debug.error2string(HostSuccess); switch (res) { case <API key>: { OnInvalidHost(); return FALSE; }break; case DPNERR_SESSIONFULL: { OnSessionFull(); return FALSE; }break; }; if (bPortWasSet) { Msg("! IPureClient : port %d is BUSY!", c_port); return FALSE; } #ifdef DEBUG else Msg("! IPureClient : port %d is BUSY!", c_port); // const char* x = DXGetErrorString9(res); string1024 tmp = ""; DXTRACE_ERR(tmp, res); #endif c_port++; } else { Msg("- IPureClient : created on port %d!", c_port); } }; IDirectPlay8Address* pHostAddress = NULL; if (net_Hosts.empty()) { OnInvalidHost(); return FALSE; }; WCHAR <API key>[4096]; if ( xr_strlen( password_str) ) { CHK_DX(MultiByteToWideChar(CP_ACP, 0, password_str, -1, <API key>, 4096 )); dpAppDesc.dwFlags |= <API key>; dpAppDesc.pwsz<API key>; }; net_csEnumeration.Enter (); // real connect for (u32 I=0; I<net_Hosts.size(); I++) Msg("* HOST #%d: %s\n",I+1,*net_Hosts[I].dpSessionName); R_CHK(net_Hosts.front().pHostAddress->Duplicate(&pHostAddress ) ); // dump_URL ("! c2s ", pHostAddress); res = NET->Connect( &dpAppDesc, // pdnAppDesc pHostAddress, // pHostAddr net_Address_device, // pDeviceInfo NULL, // pdnSecurity NULL, // pdnCredentials NULL, 0, // pvUserConnectData/Size NULL, // pvAsyncContext NULL, // pvAsyncHandle DPNCONNECT_SYNC); // dwFlags // R_CHK(res); net_csEnumeration.Leave (); _RELEASE (pHostAddress); #ifdef DEBUG // const char* x = DXGetErrorString9(res); string1024 tmp = ""; DXTRACE_ERR(tmp, res); #endif switch (res) { case <API key>: { OnInvalidPassword(); }break; case DPNERR_SESSIONFULL: { OnSessionFull(); }break; case <API key>: { Msg("! Error: Can\'t create player"); }break; } if (res != S_OK) return FALSE; } // Caps /* GUID sp_guid; DPN_SP_CAPS sp_caps; net_Address_device->GetSP(&sp_guid); ZeroMemory (&sp_caps,sizeof(sp_caps)); sp_caps.dwSize = sizeof(sp_caps); R_CHK (NET->GetSPCaps(&sp_guid,&sp_caps,0)); sp_caps.dwSystemBufferSize = 0; R_CHK (NET->SetSPCaps(&sp_guid,&sp_caps,0)); R_CHK (NET->GetSPCaps(&sp_guid,&sp_caps,0)); */ } //<API key> // Sync net_TimeDelta = 0; return TRUE; } void IPureClient::Disconnect() { if( NET ) NET->Close(0); // Clean up Host _list_ net_csEnumeration.Enter (); for (u32 i=0; i<net_Hosts.size(); i++) { HOST_NODE& N = net_Hosts[i]; _RELEASE (N.pHostAddress); } net_Hosts.clear (); net_csEnumeration.Leave (); // Release interfaces _SHOW_REF ("cl_netADR_Server",net_Address_server); _RELEASE (net_Address_server); _SHOW_REF ("cl_netADR_Device",net_Address_device); _RELEASE (net_Address_device); _SHOW_REF ("cl_netCORE",NET); _RELEASE (NET); net_Connected = EnmConnectionWait; net_Syncronised = FALSE; } HRESULT IPureClient::net_Handler(u32 dwMessageType, PVOID pMessage) { // HRESULT hr = S_OK; switch (dwMessageType) { case <API key>: { <API key> <API key>; const <API key>* pDesc; // HOST_NODE* pHostNode = NULL; // WCHAR* pwszSession = NULL; <API key> = (<API key>) pMessage; pDesc = <API key>-><API key>; // Insert each host response if it isn't already present net_csEnumeration.Enter (); BOOL bHostRegistered = FALSE; for (u32 I=0; I<net_Hosts.size(); I++) { HOST_NODE& N = net_Hosts [I]; if ( pDesc->guidInstance == N.dpAppDesc.guidInstance) { // This host is already in the list bHostRegistered = TRUE; break; } } if (!bHostRegistered) { // This host session is not in the list then so insert it. HOST_NODE NODE; ZeroMemory (&NODE, sizeof(HOST_NODE)); // Copy the Host Address R_CHK (<API key>->pAddressSender->Duplicate(&NODE.pHostAddress ) ); CopyMemory(&NODE.dpAppDesc,pDesc,sizeof(<API key>)); // Null out all the pointers we aren't copying NODE.dpAppDesc.pwszSessionName = NULL; NODE.dpAppDesc.pwszPassword = NULL; NODE.dpAppDesc.pvReservedData = NULL; NODE.dpAppDesc.dwReservedDataSize = 0; NODE.dpAppDesc.<API key> = NULL; NODE.dpAppDesc.<API key> = 0; if( pDesc->pwszSessionName) { string4096 dpSessionName; R_CHK (WideCharToMultiByte(CP_ACP,0,pDesc->pwszSessionName,-1,dpSessionName,sizeof(dpSessionName),0,0)); NODE.dpSessionName = (char*)(&dpSessionName[0]); } net_Hosts.push_back (NODE); } net_csEnumeration.Leave (); } break; case DPN_MSGID_RECEIVE: { PDPNMSG_RECEIVE pMsg = (PDPNMSG_RECEIVE) pMessage; MultipacketReciever::RecievePacket( pMsg->pReceiveData, pMsg->dwReceiveDataSize ); } break; case <API key>: { <API key> pMsg = (<API key> ) pMessage; char* m_data = (char*)pMsg->pvTerminateData; u32 m_size = pMsg->dwTerminateDataSize; HRESULT m_hResultCode = pMsg->hResultCode; net_Disconnected = TRUE; if (m_size != 0) { OnSessionTerminate(m_data); //Msg("- Session terminated : %s", m_data); } else { OnSessionTerminate( (::Debug.error2string(m_hResultCode))); //Msg("- Session terminated : %s", (::Debug.error2string(m_hResultCode))); } }; break; default: { #if 1 LPSTR msg = ""; switch (dwMessageType) { case <API key>: msg = "<API key>"; break; case <API key>: msg = "<API key>"; break; case <API key>: msg = "<API key>"; break; case <API key>: { <API key> pMsg = (<API key>)pMessage; #ifdef DEBUG // const char* x = DXGetErrorString9(pMsg->hResultCode); if (pMsg->hResultCode != S_OK) { string1024 tmp=""; DXTRACE_ERR(tmp, pMsg->hResultCode); } #endif if (pMsg-><API key>) { string256 ResStr = ""; strncpy(ResStr, (char*)(pMsg-><API key>), pMsg-><API key>); Msg("Connection result : %s", ResStr); } else msg = "<API key>"; }break; case <API key>: msg = "<API key>"; break; case <API key>: msg = "<API key>"; break; case <API key>: msg = "<API key>"; break; case <API key>: msg = "<API key>"; break; case <API key>: msg = "<API key>"; break; case <API key>: msg = "<API key>"; break; case <API key>: msg = "<API key>"; break; case <API key>: msg = "<API key>"; break; case <API key>: msg = "<API key>"; break; case DPN_MSGID_PEER_INFO: msg = "DPN_MSGID_PEER_INFO"; break; case <API key>: msg = "<API key>"; break; case <API key>: msg = "<API key>"; break; case <API key>: msg = "<API key>"; break; case <API key>: msg = "<API key>"; break; case <API key>: msg = "<API key>"; break; default: msg = "???"; break; } #endif } break; } return S_OK; } void IPureClient::OnMessage(void* data, u32 size) { // One of the messages - decompress it NET_Packet* P = net_Queue.CreateGet(); P->construct (data, size); P->timeReceive = timeServer_Async(); u16 tmp_type; P->r_begin (tmp_type); net_Queue.CreateCommit (P); } void IPureClient::timeServer_Correct(u32 sv_time, u32 cl_time) { u32 ping = net_Statistic.getPing(); u32 delta = sv_time + ping/2 - cl_time; net_DeltaArray.push (delta); Sync_Average (); } void IPureClient::SendTo_LL(void* data, u32 size, u32 dwFlags, u32 dwTimeout) { if( net_Disconnected ) return; if( psNET_Flags.test(<API key>) ) { if( !pClNetLog) pClNetLog = xr_new<INetLog>( "logs\\net_cl_log.log", timeServer() ); if( pClNetLog ) pClNetLog->LogData( timeServer(), data, size ); } DPN_BUFFER_DESC desc; desc.dwBufferSize = size; desc.pBufferData = (BYTE*)data; net_Statistic.dwBytesSended += size; // verify VERIFY(desc.dwBufferSize); VERIFY(desc.pBufferData); VERIFY(NET); DPNHANDLE hAsync = 0; HRESULT hr = NET->Send( &desc, 1, dwTimeout, 0, &hAsync, dwFlags | DPNSEND_COALESCE ); // Msg("- Client::SendTo_LL [%d]", size); if( FAILED(hr) ) { Msg ("! ERROR: Failed to send net-packet, reason: %s",::Debug.error2string(hr)); // const char* x = DXGetErrorString9(hr); string1024 tmp=""; DXTRACE_ERR(tmp, hr); } // UpdateStatistic(); } void IPureClient::Send( NET_Packet& packet, u32 dwFlags, u32 dwTimeout ) { MultipacketSender::SendPacket( packet.B.data, packet.B.count, dwFlags, dwTimeout ); } void IPureClient::Flush_Send_Buffer () { MultipacketSender::FlushSendBuffer( 0 ); } BOOL IPureClient::net_HasBandwidth () { u32 dwTime = TimeGlobal(device_timer); u32 dwInterval = 0; if (net_Disconnected) return FALSE; if (psNET_ClientUpdate != 0) dwInterval = 1000/psNET_ClientUpdate; if (psNET_Flags.test(<API key>)) dwInterval = 1000; // approx 3 times per second if(<API key>) { if( 0 != psNET_ClientUpdate && (<API key>)>dwInterval) { net_Time_LastUpdate = dwTime; return TRUE; }else return FALSE; }else if (0 != psNET_ClientUpdate && (<API key>)>dwInterval) { HRESULT hr; R_ASSERT (NET); // check queue for "empty" state DWORD dwPending=0; hr = NET->GetSendQueueInfo(&dwPending,0,0); if (FAILED(hr)) return FALSE; if (dwPending > u32(psNET_ClientPending)) { net_Statistic.dwTimesBlocked++; return FALSE; }; UpdateStatistic(); net_Time_LastUpdate = dwTime; return TRUE; } return FALSE; } void IPureClient::UpdateStatistic() { // Query network statistic for this client DPN_CONNECTION_INFO CI; ZeroMemory (&CI,sizeof(CI)); CI.dwSize = sizeof(CI); HRESULT hr = NET->GetConnectionInfo(&CI,0); if (FAILED(hr)) return; net_Statistic.Update(CI); } void IPureClient::Sync_Thread () { MSYS_PING clPing;
# IOSStudyResource IOS #IOS 1.https://github.com/JakeLin/SwiftWeather swift 2.https://github.com/xushao1990/XTNews app 3.https://github.com/12207480/KnowingLife #Xcode 1.https://github.com/limejelly/Backlight-for-XCode 2.https://github.com/FuzzyAutocomplete/<API key> 3. #IOSJavamavenAndroidGradle 1.https://github.com/CocoaPods/CocoaPods 2.https://github.com/Carthage/Carthage #IOSgoodbye 1.https://github.com/jhurray/EZLayout #UIPagerControl 1.https://github.com/KittenYang/<API key> 2.https://github.com/Spaceman-Labs/SMPageControl #PlaceHolderUIView 1.https://github.com/adad184/MMPlaceHolder #UITableViewCell 1.https://github.com/JonasGessner/<API key> 2.https://github.com/MortimerGoro/MGSwipeTableCell 3.https://github.com/CEWendel/SWTableViewCell #IOS 1.https://github.com/IFTTT/JazzHands #IOS 1.https://github.com/12207480/<API key> - 2.https://github.com/KittenYang/KYGooeyMenu 1.https://github.com/ArtFeel/AFViewShaker 2.https://github.com/12207480/TYWaterWaveView #ScrollView3D 1.https://github.com/nicklockwood/iCarousel 2.https://github.com/12207480/TYHorizenTableView UITableView 1.https://github.com/ptshih/PSCollectionView #Json 1.https://github.com/SwiftyJSON/SwiftyJSON swift 1.https://github.com/Alamofire/Alamofire AFNetworkingswift #WebSocket 1.https://github.com/daltoniam/Starscream IOSOSX 1.https://github.com/stephencelis/SQLite.swift sqlite 2.https://github.com/realm/realm-cocoa Core DataSQLite 1.https://github.com/kaishin/gifu GIF 2.https://github.com/Nyx0uf/NYXImagesKit N 1.https://github.com/robb/Cartography 1.https://github.com/kentya6/KYCircularProgress 1.https://github.com/Quick/Quick 2.https://github.com/Quick/Nimble 1.https://github.com/iosdeveloperpanc/PCGestureUnlock 2.https://github.com/nsdictionary/CoreLock #AndroidTabLayoutPageTabPagesView 1.https://github.com/nsdictionary/CorePagesView 1.https://github.com/questbeat/QBImagePicker <API key> <API key> #placeholderUITextView 1.https://github.com/gcamp/<API key> 2.https://github.com/lukagabric/<API key> #IOS 1.https://github.com/iMoreApps/<API key> 2.https://github.com/Bilibili/ijkplayer fmpegIOSAndroidBilibili #IOS 1.https://github.com/muhku/FreeStreamer FreeStreameriOSOS X, UIC++ #log 1.https://github.com/CocoaLumberjack/CocoaLumberjack 1.https://github.com/jessesquires/<API key> 1.https://github.com/KrauseFx/TSMessages #UIWebView 1.https://github.com/ninjinkun/NJKWebViewProgress UIWebView #UIWebView 1.https://github.com/TransitApp/SVWebViewController 1.https://github.com/cwRichardKim/<API key>
package org.deeplearning4j.nn.weights.embeddings; import lombok.EqualsAndHashCode; import lombok.NonNull; import org.deeplearning4j.nn.weights.IWeightInit; import org.nd4j.common.base.Preconditions; import org.nd4j.linalg.api.ndarray.INDArray; import org.nd4j.shade.jackson.annotation.<API key>; import org.nd4j.shade.jackson.annotation.JsonProperty; /** * Weight initialization for initializing the parameters of an EmbeddingLayer from a {@link <API key>} * * Note: WeightInitEmbedding supports both JSON serializable and non JSON serializable initializations. * In the case of non-JSON serializable embeddings, they are a one-time only use: once they have been used * to initialize the parameters, they will be removed from the WeightInitEmbedding instance. * This is to prevent unnecessary references to potentially large objects in memory (i.e., to avoid memory leaks) * * @author Alex Black */ @<API key>("nonSerializableInit") @EqualsAndHashCode public class WeightInitEmbedding implements IWeightInit { private <API key> serializableInit; private <API key> nonSerializableInit; public WeightInitEmbedding(@NonNull <API key> <API key>){ this((<API key>.jsonSerializable() ? <API key> : null), (<API key>.jsonSerializable() ? null : <API key>)); } protected WeightInitEmbedding(@JsonProperty("serializableInit") <API key> serializableInit, @JsonProperty("nonSerializableInit") <API key> nonSerializableInit){ this.serializableInit = serializableInit; this.nonSerializableInit = nonSerializableInit; } @Override public INDArray init(double fanIn, double fanOut, long[] shape, char order, INDArray paramView) { <API key> init = serializableInit != null ? serializableInit : nonSerializableInit; if(init == null){ throw new <API key>("Cannot initialize embedding layer weights: no <API key> is available." + " This can occur if you save network configuration, load it, and the try to "); } Preconditions.checkState(shape[0] == init.vocabSize(), "Parameters shape[0]=%s does not match embedding initializer vocab size of %s", shape[0], init.vocabSize()); Preconditions.checkState(shape[1] == init.vectorSize(), "Parameters shape[1]=%s does not match embedding initializer vector size of %s", shape[1], init.vectorSize()); INDArray reshaped = paramView.reshape('c', shape); init.loadWeightsInto(reshaped); //Now that we've loaded weights - let's clear the reference if it's non-serializable so it can be GC'd this.nonSerializableInit = null; return reshaped; } public long[] shape(){ if(serializableInit != null){ return new long[]{serializableInit.vocabSize(), serializableInit.vectorSize()}; } else if(nonSerializableInit != null){ return new long[]{nonSerializableInit.vocabSize(), nonSerializableInit.vectorSize()}; } return null; } }
Link analysis between john boards, dating websites, and prostitution websites to find serial/high frequency buyers. How it would work: Comparison of writing style across websites. There are a number of ways to tell if an author is the same across many mediums. Some parts of a writers signature will vary with context, but sort phrases and word choices will be consistent across mediums, for a small period of time. I believe the way this project would look is simple. I'd scrape the site types mentioned above, apply the necessary nlp, to establish matching conditions, and then try to build a single person for each handle. The expectation is that handles would change over time or that multiple handles may refer to a single person. Deliverables: Pictures associated with high volume consumers of commercial sex - many dating websites require you to upload pictures. And sometimes people just do this because. A more accurate representation of the number of active users of john boards. A set of ontologies of terms used by members of various john boards and how that ontology evolves over time and regionally. A greater understanding of the demand side by age, gender,ethnicity, and socio-economic class - often times people will post salary range, profession and other personal information on dating websites. A psychological understanding of high volume buyers of sex, statistically - often times people on dating websites will answer a series of questions indicating their psychological make up, used for matching algorithms. If we can link a profile to an investigation, a law enforcement agency could use subpoena compliance to obtain the list of questions and their answers. Such information could even be anonymized passed back to dating websites and be used to statistically flag for buyers of commercial sex by dating websites. This level of cooperation between companies and dating websites is unlikely, but possible. ##To Dos ##Scrapers: * Build a scraper for dating websites * Build scrapers for all of the prostitution websites * Do integrity testing of john board scraper/ integrate selenium scraper for deep web ##Identification of prostitution websites to scrape * adultsearch * alibaba * anunico * backpage * cityvibe * cityxguide * cityxguideforum * classivox * craigslist * ec21 * eroticmugshots * eroticreview * escortadsxxx * escortphonelist * escortsinca * escortsincollege * escortsintheus * gmdu * gulfjobsbank * happymassage * justlanded * liveescortreviews * manpowervacancy * massagetroll * missingkids * myproviderguide * <API key> * naughtyreviews * redbook * redbook_forum * rubads * sipsap * tradekey * usasexguide * utopiaguide ##Identification of John Boards to scrape * usasexguide.com * erotic review * Eros * city vibe ##Identification of dating websites to scrape - to do - indentify all of these * ##Database: * Choose a database for storing all of this information, pulling out keywords, hard attributes, and full text * implement the database Visualizations:
<!doctype html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang=""> <!--<![endif]--> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>My Website, improved</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="apple-touch-icon" href="apple-touch-icon.png"> <link rel="stylesheet" href="css/bootstrap.min.css"> <style> body { padding-top: 50px; padding-bottom: 20px; } </style> <link rel="stylesheet" href="css/bootstrap-theme.min.css"> <link rel="stylesheet" href="css/main.css"> <script src="js/vendor/modernizr-2.8.3-respond-1.4.2.min.js"></script> </head> <body> <!--[if lt IE 8]> <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> <![endif] <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">Project name</a> </div> <div id="navbar" class="navbar-collapse collapse"> <form class="navbar-form navbar-right" role="form"> <div class="form-group"> <input type="text" placeholder="Email" class="form-control"> </div> <div class="form-group"> <input type="password" placeholder="Password" class="form-control"> </div> <button type="submit" class="btn btn-success">Sign in</button> </form> </div><!--/.navbar-collapse --> </div> </nav> <!-- Main jumbotron for a primary marketing message or call to action --> <div class="jumbotron"> <div class="container"> <h1>Hello, world!</h1> <p>This is a template for a simple marketing or informational website. It includes a large callout called a jumbotron and three supporting pieces of content. Use it as a starting point to create something more unique.</p> <p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more &raquo;</a></p> </div> </div> <div class="container"> <!-- Example row of columns --> <div class="row"> <div class="col-md-4"> <h2>Heading</h2> <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p> <p><a class="btn btn-default" href="#" role="button">View details &raquo;</a></p> </div> <div class="col-md-4"> <h2>Heading</h2> <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p> <p><a class="btn btn-default" href="#" role="button">View details &raquo;</a></p> </div> <div class="col-md-4"> <h2>Heading</h2> <p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p> <p><a class="btn btn-default" href="#" role="button">View details &raquo;</a></p> </div> </div> <hr> <footer> <p>&copy; Company 2015</p> </footer> </div> <!-- /container --> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.2.min.js"><\/script>')</script> <script src="js/vendor/bootstrap.min.js"></script> <script src="js/main.js"></script> <!-- Google Analytics: change UA-XXXXX-X to be your site's ID. --> <script> (function(b,o,i,l,e,r){b.<API key>=l;b[l]||(b[l]= function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date; e=o.createElement(i);r=o.<API key>(i)[0]; e.src=' r.parentNode.insertBefore(e,r)}(window,document,'script','ga')); ga('create','UA-XXXXX-X','auto');ga('send','pageview'); </script> </body> </html>
<html> <head> <title>Inserir Veiculos</title> <link rel="stylesheet" href="estilo.css" type="text/css"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script language="JavaScript" type="text/javascript" src="..\MascaraValidacao.js"></script> <script> function busca(){ document.form.submit(); return true; } </script> </head> <body onload="document.form.PLACA.focus();"> <form name="form" method="post" action="InserirVeiculo2.php" onsubmit="return busca();"> <table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC"> <tr><td bgcolor=" <tr> <table> <tr> <td>Placa</td> <td>Tipo</td> <td>Modelo</td> <td>Ano</td> <td>Cor</td> <td>Cliente</td> </tr> <tr> <td><input name="PLACA" type="text" id="PLACA" maxlength="8" onKeyPress="ColocaMascaraPlaca(document.form.PLACA);"/></td> <td><select name=TIPO> <option value="Carro">Carro</option> <option value="Moto">Moto</option> <option value="Caminhao">Caminhão</option> <option value="Outro">Outro</option> </select></td> <td><input name="MODELO" type="text" id="MODELO" maxlength="30"/></td> <td><input name="ANO" type="text" id="ANO" maxlength="4"/></td> <td><input name="COR" type="text" id="COR" maxlength="15"/></td> <td><?php require_once('funcoes.php'); conectar('localhost', 'root','', 'bd_estacionamento'); $sql=mysql_query("SELECT nome_cliente,id_cliente FROM clientes order by nome_cliente"); echo "<select name=CLIENTES>"; while($rowl = mysql_fetch_assoc($sql)){ echo "<option value=". $rowl['id_cliente'] . ">" . $rowl['nome_cliente'] . "</option>"; } echo "</select>";// Closing of list box ?></td> <td><input type="submit" name="Submit" value="Incluir"</td> </tr> </table> </tr> </table> </form> <?php require_once('funcoes.php'); conectar('localhost', 'root','', 'bd_estacionamento'); $PLACA = $_POST["PLACA"]; $TIPO = $_POST["TIPO"]; $MODELO = $_POST["MODELO"]; $ANO = $_POST["ANO"]; $COR = $_POST["COR"]; $CLIENTES = $_POST["CLIENTES"]; $query = "INSERT INTO veiculos VALUES('', '$TIPO', '$ANO', '$PLACA', '$MODELO', '$COR', '$CLIENTES')"; mysql_query($query) or die ('Falha ao executar query no banco de dados'); mysql_close() or die ('Falha ao fechar o banco de dados'); ?> <?php require_once('funcoes.php'); conectar('localhost', 'root','', 'bd_estacionamento'); $result = mysql_query("SELECT * FROM veiculos"); echo "<table border=5 style=3 width=100%><tr><td>ID</td><td>Placa</td><td>Tipo</td><td>Modelo</td><td>Ano</td><td>Cor</td><td>Cliente</td></tr>"; while($row = mysql_fetch_assoc($result)){ echo "<tr><td>".$row['id_veiculo']."</td>"."<td>".$row['placa_veiculo']."</td>"."<td>".$row['tipo_veiculo']."</td>"."<td>".$row['modelo_veiculo']."</td>"."<td>".$row['ano_veiculo']."</td>"."<td>".$row['cor_veiculo']."</td>"; $fk = mysql_fetch_assoc(mysql_query("SELECT * FROM clientes where id_cliente='".$row['fk_cliente_veiculo']."'")); echo "<td>".$fk['nome_cliente']."</td></tr>"; } echo "</table><br><br>"; echo ""; ?> </body> </html>
FORMAT: 1A # Taskify API This is the API Blueprint file for Taskify API. # Group Tasks ## Task Collection [/tasks] A collection of Tasks objects List all Tasks [GET] Retrieve a collection of Tasks + Response 200 (application/json) + Body [ { "id": 1, "name": "Buy some goreceries" }, { "id": 2, "name": "Dinner with Katty" } ] Create a new task [POST] Create a Task + Request (application/json) + Attributes (object) + Response 200 + Body { "id": 1, "name": "Buy some goreceries" } ## Tasks [/tasks/{id}] A single Tasks object with all its details Get single Task [GET] Retrieve a single Task by ID + Request + Parameters + id (number) + Response 200 (application/json) + Body { "id": 1, "name": "Buy some goreceries" } Modify single Task [PUT] Edit a single Task by ID + Request (application/json) + Attributes + id (number) + Response 200 (application/json) + Body { "id": 1, "name": "Buy some goreceries" } Remove single Task [DELETE] Delete a single Task by ID + Request + Attributes + id (number) + Response 204
using Google.GData.YouTube; using NUnit.Framework; namespace Google.GData.Client.UnitTests.YouTube { <summary> This is a test class for PositionTest and is intended to contain all PositionTest Unit Tests </summary> [TestFixture] [Category("YouTube")] public class PositionTest { <summary> Gets or sets the test context which provides information about and functionality for the current test run. </summary> public TestContext TestContext { get; set; } <summary> A test for Position Constructor </summary> [Test] public void <API key>() { string initValue = "secret test string"; Position target = new Position(initValue); Assert.AreEqual(target.Value, initValue, "Object value should be identical after construction"); } <summary> A test for Position Constructor </summary> [Test] public void <API key>() { Position target = new Position(); Assert.IsNull(target.Value, "Object value should be null after construction"); } //You can use the following additional attributes as you write your tests: //Use ClassInitialize to run code before running the first test in the class //[ClassInitialize()] //public static void MyClassInitialize(TestContext testContext) //Use ClassCleanup to run code after all tests in a class have run //[ClassCleanup()] //public static void MyClassCleanup() //Use TestInitialize to run code before running each test //[TestInitialize()] //public void MyTestInitialize() //Use TestCleanup to run code after each test has run //[TestCleanup()] //public void MyTestCleanup() } }
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_51) on Thu Apr 28 18:37:57 UTC 2016 --> <title>Uses of Class org.apache.cassandra.cql3.restrictions.<API key>.IN (apache-cassandra API)</title> <meta name="date" content="2016-04-28"> <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.cassandra.cql3.restrictions.<API key>.IN (apache-cassandra API)"; } </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="topNav"><a name="navbar_top"> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/apache/cassandra/cql3/restrictions/<API key>.IN.html" title="class in org.apache.cassandra.cql3.restrictions">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> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/apache/cassandra/cql3/restrictions/class-use/<API key>.IN.html" target="_top">Frames</a></li> <li><a href="<API key>.IN.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.cassandra.cql3.restrictions.<API key>.IN" class="title">Uses of Class<br>org.apache.cassandra.cql3.restrictions.<API key>.IN</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/cassandra/cql3/restrictions/<API key>.IN.html" title="class in org.apache.cassandra.cql3.restrictions"><API key>.IN</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.cassandra.cql3.restrictions">org.apache.cassandra.cql3.restrictions</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.apache.cassandra.cql3.restrictions"> </a> <h3>Uses of <a href="../../../../../../org/apache/cassandra/cql3/restrictions/<API key>.IN.html" title="class in org.apache.cassandra.cql3.restrictions"><API key>.IN</a> in <a href="../../../../../../org/apache/cassandra/cql3/restrictions/package-summary.html">org.apache.cassandra.cql3.restrictions</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing subclasses, and an explanation"> <caption><span>Subclasses of <a href="../../../../../../org/apache/cassandra/cql3/restrictions/<API key>.IN.html" title="class in org.apache.cassandra.cql3.restrictions"><API key>.IN</a> in <a href="../../../../../../org/apache/cassandra/cql3/restrictions/package-summary.html">org.apache.cassandra.cql3.restrictions</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../../org/apache/cassandra/cql3/restrictions/<API key>.InWithMarker.html" title="class in org.apache.cassandra.cql3.restrictions"><API key>.InWithMarker</a></strong></code> <div class="block">An IN restriction that uses a single marker for a set of IN values that are tuples.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../../org/apache/cassandra/cql3/restrictions/<API key>.InWithValues.html" title="class in org.apache.cassandra.cql3.restrictions"><API key>.InWithValues</a></strong></code> <div class="block">An IN restriction that has a set of terms for in values.</div> </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/cassandra/cql3/restrictions/<API key>.IN.html" title="class in org.apache.cassandra.cql3.restrictions">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> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/apache/cassandra/cql3/restrictions/class-use/<API key>.IN.html" target="_top">Frames</a></li> <li><a href="<API key>.IN.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>Copyright &copy; 2016 The Apache Software Foundation</small></p> </body> </html>
package org.http4s package headers class LinkSpec extends HeaderLaws { // checkAll(name = "Link", headerLaws(Link)) "parse" should { "accept format RFC 5988" in { val link = """</feed>; rel="alternate"; type="text/*"; title="main"; rev="previous"""" val parsedLinks = Link.parse(link).map(_.values) val parsedLink = parsedLinks.map(_.head) parsedLink.map(_.uri) must beRight(uri"/feed") parsedLink.map(_.rel) must beRight(Option("alternate")) parsedLink.map(_.title) must beRight(Option("main")) ", ", ", "
#!/usr/bin/env python from random import choice from python.decorators import euler_timer SQUARES = ["GO", "A1", "CC1", "A2", "T1", "R1", "B1", "CH1", "B2", "B3", "JAIL", "C1", "U1", "C2", "C3", "R2", "D1", "CC2", "D2", "D3", "FP", "E1", "CH2", "E2", "E3", "R3", "F1", "F2", "U2", "F3", "G2J", "G1", "G2", "CC3", "G3", "R4", "CH3", "H1", "T2", "H2"] def roll_die(size): first_die = choice(range(1, size + 1)) second_die = choice(range(1, size + 1)) return (first_die + second_die, (first_die == second_die)) def back(square, step): index = SQUARES.index(square) new_index = (index - step) % len(SQUARES) return SQUARES[new_index] def next_specific(square, next_type): if next_type not in ["R", "U"]: raise Exception("next_specific only intended for R and U") # R1=5, R2=15, R3=25, R4=35 index = SQUARES.index(square) if next_type == "R": if 0 <= index < 5 or 35 < index: return "R1" elif 5 < index < 15: return "R2" elif 15 < index < 25: return "R3" elif 25 < index < 35: return "R4" else: raise Exception("Case should not occur") # U1=12, U2=28 elif next_type == "U": if 0 <= index < 12 or index > 28: return "U1" elif 12 < index < 28: return "U2" else: return Exception("Case should not occur") else: raise Exception("Case should not occur") def next_square(landing_square, chance_card, chest_card): if landing_square not in ["CC1", "CC2", "CC3", "CH1", "CH2", "CH3", "G2J"]: return (landing_square, chance_card, chest_card) if landing_square == "G2J": return ("JAIL", chance_card, chest_card) elif landing_square in ["CC1", "CC2", "CC3"]: # 1/16 Go, Jail # 14/16 Stay chest_card = (chest_card + 1) % 16 if chest_card == 0: return ("GO", chance_card, chest_card) elif chest_card == 1: return ("JAIL", chance_card, chest_card) else: return (landing_square, chance_card, chest_card) elif landing_square in ["CH1", "CH2", "CH3"]: # 1/16 Go, Jail, C1, E3, H2, R1, next U, back 3 # 1/8 Next R chance_card = (chance_card + 1) % 16 if chance_card == 0: return ("GO", chance_card, chest_card) elif chance_card == 1: return ("JAIL", chance_card, chest_card) elif chance_card == 2: return ("C1", chance_card, chest_card) elif chance_card == 3: return ("E3", chance_card, chest_card) elif chance_card == 4: return ("H2", chance_card, chest_card) elif chance_card == 5: return ("R1", chance_card, chest_card) elif chance_card == 6: return (next_specific(landing_square, "U"), chance_card, chest_card) elif chance_card == 7: return next_square(back(landing_square, 3), chance_card, chest_card) elif chance_card in [8, 9]: return (next_specific(landing_square, "R"), chance_card, chest_card) else: return (landing_square, chance_card, chest_card) else: raise Exception("Case should not occur") def main(verbose=False): GAME_PLAY = 10 ** 6 dice_size = 4 visited = {"GO": 1} current = "GO" chance_card = 0 chest_card = 0 doubles = 0 for place in xrange(GAME_PLAY): total, double = roll_die(dice_size) if double: doubles += 1 else: doubles = 0 if doubles == 3: doubles = 0 current = "JAIL" else: index = SQUARES.index(current) landing_square = SQUARES[(index + total) % len(SQUARES)] (current, chance_card, chest_card) = next_square(landing_square, chance_card, chest_card) # if current is not in visited, sets to 1 # (default 0 returned by get) visited[current] = visited.get(current, 0) + 1 top_visited = sorted(visited.items(), key=lambda pair: pair[1], reverse=True) top_visited = [SQUARES.index(square[0]) for square in top_visited[:3]] return ''.join(str(index).zfill(2) for index in top_visited) if __name__ == '__main__': print euler_timer(84)(main)(verbose=True)
/* * <API key>: 2015-2022 Espressif Systems (Shanghai) CO LTD * * <API key>: Apache-2.0 */ #pragma once #include "esp_bit_defs.h" Mask of interrupts sending to the host. typedef enum { <API key> = BIT(0), ///< General purpose interrupt bit 0. <API key> = BIT(1), <API key> = BIT(2), <API key> = BIT(3), <API key> = BIT(4), <API key> = BIT(5), <API key> = BIT(6), <API key> = BIT(7), <API key> = BIT(23), ///< New packet available } <API key>; Timing of SDIO slave typedef enum { <API key> = 0,/**< Send at posedge, and sample at posedge. Default value for HS mode. * Normally there's no problem using this to work in DS mode. */ <API key> ,///< Send at negedge, and sample at posedge. Default value for DS mode and below. <API key>, ///< Send at posedge, and sample at negedge <API key>, ///< Send at negedge, and sample at negedge } sdio_slave_timing_t; Configuration of SDIO slave mode typedef enum { <API key> = 0, ///< Stream mode, all packets to send will be combined as one if possible <API key> = 1, ///< Packet mode, one packets will be sent one after another (only increase packet_len if last packet sent). } <API key>;
import { promises as fsPromises } from 'fs'; import { expect } from 'chai'; describe('Verify stryker runs with mocha < 6', () => { let strykerLog: string; before(async () => { strykerLog = await fsPromises.readFile('./stryker.log', 'utf8'); }); it('should warn about old mocha version', async () => { expect(strykerLog).contains('DEPRECATED: Mocha < 6 detected. Please upgrade to at least Mocha version 6. Stryker will drop support for Mocha < 6 in V5'); }); });
# AUTOGENERATED FILE FROM balenalib/<API key>:34-run ENV NODE_VERSION 16.14.0 ENV YARN_VERSION 1.22.4 RUN for key in \ <API key> \ ; do \ gpg --keyserver pgp.mit.edu --recv-keys "$key" || \ gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \ gpg --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \ done \ && curl -SLO "http://nodejs.org/dist/v$NODE_VERSION/node-v$<API key>.tar.gz" \ && echo "<SHA256-like> node-v$<API key>.tar.gz" | sha256sum -c - \ && tar -xzf "node-v$<API key>.tar.gz" -C /usr/local --strip-components=1 \ && rm "node-v$<API key>.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \ && gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && mkdir -p /opt/yarn \ && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \ && rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && npm config set unsafe-perm true -g --unsafe-perm \
import React from 'react'; import RadioButton from '../RadioButton'; import { mount } from 'enzyme'; const render = (props) => mount( <RadioButton {...props} className="extra-class" name="test-name" value="test-value" /> ); describe('RadioButton', () => { describe('renders as expected', () => { const wrapper = render({ checked: true, }); const input = wrapper.find('input'); const label = wrapper.find('label'); const div = wrapper.find('div'); describe('input', () => { it('is of type radio', () => { expect(input.props().type).toEqual('radio'); }); it('has the expected class', () => { expect(input.hasClass('bx--radio-button')).toEqual(true); }); it('has a unique id set by default', () => { expect(input.props().id).toBeDefined(); }); it('should have checked set when checked is passed', () => { wrapper.setProps({ checked: true }); expect(input.props().checked).toEqual(true); }); it('should set the name prop as expected', () => { expect(input.props().name).toEqual('test-name'); }); }); describe('label', () => { it('should set htmlFor', () => { expect(label.props().htmlFor) .toEqual(input.props().id); }); it('should set the correct class', () => { expect(label.props().className).toEqual('<API key>'); }); it('should render a span with the correct class', () => { const span = label.find('span'); expect(span.hasClass('<API key>')).toEqual(true); }); it('should render label text', () => { wrapper.setProps({ labelText: 'test label text' }); expect(label.text()).toMatch(/test label text/); }); }); describe('wrapper', () => { it('should have the correct class', () => { expect(div.hasClass('radioButtonWrapper')).toEqual(true); }); it('should have extra classes applied', () => { expect(div.hasClass('extra-class')).toEqual(true); }); }); }); it('should set defaultChecked as expected', () => { const wrapper = render({ defaultChecked: true, }); const input = wrapper.find('input'); expect(input.props().defaultChecked).toEqual(true); wrapper.setProps({ defaultChecked: false }); expect(input.props().defaultChecked).toEqual(false); }); it('should set id if one is passed in', () => { const wrapper = render({ id: 'unique-id', }); const input = wrapper.find('input'); expect(input.props().id).toEqual('unique-id'); }); describe('events', () => { it('should invoke onChange with expected arguments', () => { const onChange = jest.fn(); const wrapper = render({ onChange }); const input = wrapper.find('input'); const inputElement = input.get(0); inputElement.checked = true; wrapper.find('input').simulate('change'); const call = onChange.mock.calls[0]; expect(call[0]).toEqual('test-value'); expect(call[1]).toEqual('test-name'); expect(call[2].target).toBe(inputElement); }); }); });
using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Net; using System.Runtime.Serialization.Json; using System.Text; using System.Threading; using System.Threading.Tasks; using System.Xml.Linq; using FeedProcessor.Contracts; using FeedProcessor.Enums; using FeedProcessor.FeedItems; using FeedProcessor.Net; namespace FeedProcessor.Feeds { <summary> A feed which loads tweets from the twitter straming API. </summary> internal class <TwitterConsumerkey> : Feed { <summary> A mapping of twitter user ids to user names. </summary> private static Dictionary<string, string> _<TwitterConsumerkey> = new Dictionary<string, string>(); <summary> The username to use for the twitter streaming API. </summary> private string _twitterUsername; <summary> The password to use for the twitter streaming API. </summary> private string _twitterPassword; <summary> A JSON deserializer. </summary> private <API key> _json = new <API key>(typeof(<TwitterConsumerkey>)); <summary> The background task which is connected to the streaming API. </summary> private Task _task; <summary> Initializes a new instance of the <see cref="<TwitterConsumerkey>"/> class. </summary> <param name="username">The username.</param> <param name="password">The password.</param> internal <TwitterConsumerkey>(string username, string password) : base(TimeSpan.FromDays(1), DateTime.MinValue) { _twitterUsername = username; _twitterPassword = password; SourceType = SourceType.Twitter; } <summary> Builds the query that is passed to the feed service. </summary> <returns>The query URI.</returns> internal override Uri BuildQuery() { return new Uri(string.Format(CultureInfo.InvariantCulture, "http://stream.twitter.com/1/statuses/filter.json?{0}", Query)); } <summary> Initiates a request to the feed service. </summary> [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:<API key>", Justification = "Really do want all exceptions."), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "System.Debug.WriteLine(System.String)", Justification = "It's just a log message.")] protected override void Poll() { if (_task != null) { return; } _task = Task.Factory.StartNew(new Action(() => { HttpWebResponse webResponse = null; StreamReader responseStream = null; HttpWebRequest webRequest = null; int wait = 250; try { while (true) { try { // Connect webRequest = (HttpWebRequest)WebRequest.Create(BuildQuery()); webRequest.Credentials = new NetworkCredential(_twitterUsername, _twitterPassword); webRequest.Timeout = -1; webResponse = (HttpWebResponse)webRequest.GetResponse(); responseStream = new StreamReader(webResponse.GetResponseStream(), Encoding.GetEncoding("utf-8")); // Read the stream. while (true) { wait = 250; ProcessResponse(responseStream.ReadLine()); RetryTime(HttpStatusCode.OK); } } catch (WebException ex) { Debug.WriteLine(ex.Message); if (ex.Status == WebExceptionStatus.ProtocolError) { // -- From Twitter Docs -- // When a HTTP error (> 200) is returned, back off exponentially. // Perhaps start with a 10 second wait, double on each subsequent failure, // and finally cap the wait at 240 seconds. // Exponential Backoff if (wait < 10000) { wait = 10000; } else { if (wait < 240000) { wait = wait * 2; } } } else { // -- From Twitter Docs -- // When a network error (TCP/IP level) is encountered, back off linearly. // Perhaps start at 250 milliseconds and cap at 16 seconds. // Linear Backoff if (wait < 16000) { wait += 250; } } } catch (Exception ex) { Debug.WriteLine(ex.Message); } finally { if (webRequest != null) { webRequest.Abort(); } if (responseStream != null) { responseStream.Close(); responseStream = null; } if (webResponse != null) { webResponse.Close(); webResponse = null; } Debug.WriteLine("Waiting: " + wait); RetryTime(HttpStatusCode.NotAcceptable); Thread.Sleep(wait); } } } catch (Exception ex) { RetryTime(HttpStatusCode.NotAcceptable); Debug.WriteLine(ex.Message); Debug.WriteLine("Waiting: " + wait); Thread.Sleep(wait); } })); } <summary> Processes the response from the feed service. </summary> <param name="response">response from the feed service.</param> internal override void ProcessResponse(object responseObject) { string response = responseObject.ToString(); byte[] byteArray = Encoding.UTF8.GetBytes(response); <TwitterConsumerkey> status = null; using (MemoryStream stream = new MemoryStream(byteArray)) { status = _json.ReadObject(stream) as <TwitterConsumerkey>; } StatusFeedItem feedItem = new StatusFeedItem { Author = status.user.screen_name, AvatarUri = new Uri(status.user.profile_image_url), Date = DateTimeOffset.ParseExact(status.created_at, "ddd MMM dd HH:mm:ss zzz yyyy", CultureInfo.InvariantCulture).DateTime, ServiceId = status.id, Uri = new Uri(string.Format(CultureInfo.InvariantCulture, "http://twitter.com/#!/{0}/status/{1}", status.user.screen_name, status.id)), Status = status.text }; RaiseGotNewFeedItem(feedItem); } <summary> Returns a time after which it's ok to make another query. </summary> <param name="httpStatusCode">The HTTP status code returned from the last attempt.</param> <returns> The time after which it's ok to make another query. </returns> internal override DateTime RetryTime(HttpStatusCode httpStatusCode) { <API key>(httpStatusCode == HttpStatusCode.OK); return DateTime.MinValue; } <summary> Releases unmanaged and - optionally - managed resources </summary> <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> protected override void Dispose(bool disposing) { base.Dispose(disposing); } #region Utility Methods #region <API key> <summary> Callback for Get<TwitterConsumerkey>. </summary> <param name="userId">The userId returned by the twitter API.</param> internal delegate void Get<TwitterConsumerkey>(string userId); <summary> Gets the twitter user id from a username. </summary> <param name="username">The username.</param> <param name="callback">The callback.</param> [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:<API key>", Justification = "Really do want all exceptions.")] internal static void Get<TwitterConsumerkey>(string username, Get<TwitterConsumerkey> callback) { if (_<TwitterConsumerkey>.ContainsValue(username)) { callback((from kvp in _<TwitterConsumerkey> where kvp.Value == username select kvp.Key).FirstOrDefault()); return; } string query = string.Format(CultureInfo.InvariantCulture, "http://api.twitter.com/1/users/show.xml?screen_name={0}", username); AsyncWebRequest request = new AsyncWebRequest(); request.Request(new Uri(query)); request.Result += (sender, e) => { if (e.Status != HttpStatusCode.OK) { callback(null); } try { string userid = XDocument.Parse(e.Response).Element("user").Element("id").Value; _<TwitterConsumerkey>[userid] = username; callback(userid); } catch { callback(null); } }; } #endregion #endregion } }
package com.webbuilder.interact; import com.webbuilder.controls.Query; import com.webbuilder.utils.CompressUtil; import com.webbuilder.utils.DateUtil; import com.webbuilder.utils.DbUtil; import com.webbuilder.utils.FileUtil; import com.webbuilder.utils.StringUtil; import com.webbuilder.utils.SysUtil; import com.webbuilder.utils.WebUtil; import com.webbuilder.utils.XMLParser; import java.awt.Color; import java.awt.Graphics; import java.awt.image.BufferedImage; import java.io.File; import java.io.FileInputStream; import java.io.InputStream; import java.io.PrintWriter; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.Timestamp; import java.util.Calendar; import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import javax.imageio.ImageIO; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import javax.swing.Icon; import javax.swing.filechooser.FileSystemView; import org.dom4j.Attribute; import org.dom4j.Document; import org.dom4j.Element; import org.json.JSONArray; import org.json.JSONObject; public class Explorer { public void getRcvFilter(HttpServletRequest request, HttpServletResponse response) throws Exception { String find = StringUtil.fetchString(request, "findCombo"); if (!StringUtil.isEmpty(find)) { request.setAttribute("findValue", "%" + find + "%"); String sql = " and WB_NAME like {?findValue?}"; request.setAttribute("whereSql", sql); } else { DbUtil.getDefaultWhere(request, response, "WB_DATE,WB_CODE=b", false); } } public void sendFile(HttpServletRequest request, HttpServletResponse response) throws Exception { Connection conn = DbUtil.fetchConnection(request, request.getAttribute( "sys.jndi").toString()); String depts = request.getAttribute("WB_RDEPT").toString(); String roles = request.getAttribute("WB_RROLE").toString(); String users = request.getAttribute("WB_RUSER").toString(); String scope = request.getAttribute("sys.scope").toString(); String dbType = request.getAttribute("sys.dbType").toString(); HashSet userList = new HashSet(); userList = DbUtil.getUserList(conn, dbType, scope, depts, roles, users); conn.setAutoCommit(false); try { PreparedStatement stm = null; int k = 0; int l = userList.size(); boolean commitAll = false; boolean added = false; stm = conn .prepareStatement("insert into WB_FILERECEIVE values(?,?,?,?,null)"); try { stm.setString(1, scope); stm.setTimestamp(2, new Timestamp(DateUtil.stringToStdDate( request.getAttribute("sys.now").toString()).getTime())); stm.setString(3, request.getAttribute("sys.code").toString()); while ( userList.iterator().hasNext()) { String s=userList.iterator().next().toString(); k++; stm.setString(4, s); stm.addBatch(); if (!added) added = true; if (k % 1000 == 0) { if (k == l) commitAll = true; stm.executeBatch(); } } if ((added) && (!commitAll)) stm.executeBatch(); } finally { DbUtil.closeStatement(stm); } conn.commit(); } catch (Exception e) { conn.rollback(); throw new Exception(e); } finally { conn.setAutoCommit(true); } } private String createUserDir(String root) throws Exception { /* 104 */ Date dt = new Date(); /* 105 */ String y = "y" + Integer.toString(DateUtil.yearOf(dt)); /* 106 */ String d = "d" + Integer.toString(DateUtil.dayOfYear(dt)); /* 107 */ String h = "h" + Integer.toString(DateUtil.hourOfDay(dt)); /* 108 */ Calendar cal = Calendar.getInstance(); /* 109 */ cal.setTime(dt); /* 110 */ int m = cal.get(12); /* 111 */ h = h + "m" + Integer.toString(m / 10); /* 112 */ String rel = y + "/" + d + "/" + h + "/"; /* 113 */ File file = FileUtil.getUniqueFile(new File(root + "/" + rel + "s" + /* 114 */ DateUtil.formatDate(dt, "ssSSS"))); /* 115 */ rel = rel + file.getName(); /* 116 */ File dir = new File(root + "/" + rel); /* 117 */ if (!dir.mkdirs()) /* 118 */ throw new Exception(""); /* 119 */ return rel; } public void createPubDir(HttpServletRequest request, HttpServletResponse response) throws Exception { /* 124 */ String root = request.getAttribute("sys.path").toString() + /* 125 */ "WEB-INF/myfile"; /* 126 */ String scope = request.getAttribute("sys.scope").toString(); /* 128 */ String sysPubDir = FileUtil.fetchPubDir(root, scope); /* 129 */ request.setAttribute("sysPubDir", sysPubDir); } public void createUserDir(HttpServletRequest request, HttpServletResponse response) throws Exception { /* 134 */ String userPath = request.getAttribute("sys.rootpath").toString(); /* 136 */ if (StringUtil.isEmpty(userPath)) { /* 137 */ String root = request.getAttribute("sys.path").toString() + /* 138 */ "WEB-INF/myfile"; /* 139 */ String path = createUserDir(root); /* 140 */ Query query = new Query(); /* 141 */ query.setRequest(request); /* 142 */ query.type = "update"; /* 143 */ request.setAttribute("rootPath", path); /* 144 */ query.sql = "update WB_USER set ROOT_PATH={?rootPath?} where USERNAME={?sys.user?}"; /* 145 */ query.jndi = StringUtil.fetchString(request, "sys.jndi"); /* 146 */ query.setName("query.updateUser"); /* 147 */ query.create(); /* 148 */ request.getSession(false).setAttribute("sys.rootpath", /* 149 */ root + "/" + path); /* 150 */ request.setAttribute("sys.rootpath", root + "/" + path); } else { /* 152 */ File dir = new File(userPath); /* 153 */ if ((!dir.exists()) && (!dir.mkdirs())) /* 154 */ throw new Exception(""); } } public void setOrder(HttpServletRequest request, HttpServletResponse response) throws Exception { /* 160 */ JSONArray files = new JSONArray(request.getParameter("orderTree")); /* 161 */ int j = files.length(); /* 162 */ if (j == 0) /* 163 */ return; /* 164 */ File dir = new File(request.getParameter("orderDir")); /* 168 */ HashMap hashMap = new HashMap(); /* 170 */ XMLParser mapXml = new XMLParser(FileUtil.getUserIndex(dir, request.getAttribute( /* 171 */ "sys.scope").toString(), false)); /* 172 */ Element root = mapXml.document.getRootElement(); /* 173 */ Iterator iterator = root.elementIterator(); /* 174 */ while (iterator.hasNext()) { /* 175 */ Element el = (Element)iterator.next(); /* 176 */ hashMap.put(el.attribute("name").getText(), el); } /* 178 */ for (int i = 0; i < j; i++) { /* 179 */ String name = new JSONObject(files.getString(i)).getString("filename"); /* 180 */ Element el = (Element)hashMap.get(name); /* 181 */ if (el != null) { /* 182 */ root.add(el.createCopy()); /* 183 */ root.remove(el); } } /* 186 */ mapXml.save(); } public void getOrder(HttpServletRequest request, HttpServletResponse response) throws Exception { /* 195 */ StringBuilder buf = new StringBuilder(); /* 196 */ boolean added = false; /* 198 */ buf.append("["); /* 199 */ File file = new File(request.getParameter("dir")); /* 200 */ File mapFile = FileUtil.getUserIndex(file, request.getAttribute("sys.scope") /* 201 */ .toString(), false); /* 202 */ if (mapFile.exists()) { /* 203 */ XMLParser mapXml = new XMLParser(mapFile); /* 204 */ Element el = mapXml.document.getRootElement(); /* 205 */ if (el != null) { /* 206 */ Iterator iterator = el.elementIterator(); /* 207 */ while (iterator.hasNext()) { /* 208 */ el = (Element)iterator.next(); /* 209 */ if (added) /* 210 */ buf.append(","); else /* 212 */ added = true; /* 213 */ buf.append("{text:\""); /* 214 */ String text = StringUtil.replaceParameters(request, el.attribute( /* 215 */ "caption").getValue()); /* 216 */ String name = el.attribute("name").getValue(); /* 217 */ if (StringUtil.isEmpty(text)) /* 218 */ text = name; /* 219 */ buf.append(StringUtil.toExpress(text)); /* 220 */ text = el.attribute("icon").getValue(); /* 221 */ if (!StringUtil.isEmpty(text)) { /* 222 */ buf.append("\",iconCls:\""); /* 223 */ buf.append(text); } /* 225 */ buf.append("\",filename:\""); /* 226 */ buf.append(name); /* 227 */ buf.append("\",leaf:true}"); } } } /* 231 */ buf.append("]"); /* 232 */ response.getWriter().print(buf); } public void getProperty(HttpServletRequest request, HttpServletResponse response) throws Exception { /* 243 */ File file = new File(request.getParameter("fileName")); /* 244 */ File mapFile = FileUtil.getUserIndex(file.getParentFile(), request /* 245 */ .getAttribute("sys.scope").toString(), false); /* 246 */ if (mapFile.exists()) { /* 247 */ String fileName = file.getName(); /* 248 */ XMLParser mapXml = new XMLParser(mapFile); /* 249 */ Element el = mapXml.document.getRootElement(); /* 250 */ if (el != null) { /* 251 */ Iterator iterator = el.elementIterator(); /* 252 */ while (iterator.hasNext()) { /* 253 */ el = (Element)iterator.next(); /* 254 */ if (!StringUtil.isSame(el.attribute("name").getText(), /* 255 */ fileName)) continue; /* 256 */ StringBuilder buf = new StringBuilder(); /* 257 */ buf.append("{fileCaption:\""); /* 258 */ Attribute attr = el.attribute("caption"); /* 259 */ if (attr != null) /* 260 */ buf.append(StringUtil.toExpress(attr.getText())); /* 261 */ buf.append("\",fileRole:\""); /* 262 */ attr = el.attribute("role"); /* 263 */ if (attr != null) /* 264 */ buf.append(StringUtil.toExpress(attr.getText())); /* 265 */ buf.append("\",fileIcon:\""); /* 266 */ attr = el.attribute("icon"); /* 267 */ if (attr != null) /* 268 */ buf.append(attr.getText()); /* 269 */ buf.append("\",fileHint:\""); /* 270 */ attr = el.attribute("hint"); /* 271 */ if (attr != null) /* 272 */ buf.append(attr.getText()); /* 273 */ buf.append("\",fileHidden:\""); /* 274 */ attr = el.attribute("hidden"); /* 275 */ if (attr != null) /* 276 */ buf.append(StringUtil.toExpress(attr.getText())); else /* 278 */ buf.append("0"); /* 279 */ buf.append("\"}"); /* 280 */ response.getWriter().print(buf); /* 281 */ return; } } } } public void setPropertyCopy(HttpServletRequest request, HttpServletResponse response) throws Exception { /* 290 */ innerSetProperty(request, response, true); } public void setProperty(HttpServletRequest request, HttpServletResponse response) throws Exception { /* 295 */ innerSetProperty(request, response, false); } private void innerSetProperty(HttpServletRequest request, HttpServletResponse response, boolean createCopy) throws Exception { /* 304 */ String caption = request.getParameter("fileCaption"); /* 305 */ String role = request.getParameter("fileRole"); /* 306 */ String icon = request.getParameter("fileIcon"); /* 307 */ String hint = request.getParameter("fileHint"); /* 308 */ String hidden = request.getParameter("fileHidden"); /* 309 */ JSONArray files = new JSONArray(request.getParameter("setFile")); /* 310 */ HashMap map = new HashMap(); /* 313 */ File file = new File(files.getString(0)); /* 314 */ File dir = file.getParentFile(); /* 315 */ XMLParser mapXml = new XMLParser(FileUtil.getUserIndex(dir, request.getAttribute( /* 316 */ "sys.scope").toString(), createCopy)); /* 317 */ Element root = mapXml.document.getRootElement(); /* 318 */ if (root != null) { /* 319 */ Iterator iterator = root.elementIterator(); /* 320 */ while (iterator.hasNext()) { /* 321 */ Element el = (Element)iterator.next(); /* 322 */ String name = el.attribute("name").getText(); /* 323 */ file = new File(dir, name); /* 324 */ if ((!file.exists()) || (map.containsKey(name))) /* 325 */ root.remove(el); else /* 327 */ map.put(name, el); } } else { /* 330 */ root = mapXml.document.addElement("map"); /* 331 */ }int j = files.length(); /* 332 */ for (int i = 0; i < j; i++) { /* 333 */ String name = FileUtil.extractFileName(files.getString(i)); /* 334 */ Element el = (Element)map.get(name); /* 335 */ if (el == null) { /* 336 */ el = root.addElement("file"); /* 337 */ el.addAttribute("name", name); /* 338 */ el.addAttribute("caption", caption); /* 339 */ el.addAttribute("role", role); /* 340 */ el.addAttribute("icon", icon); /* 341 */ el.addAttribute("hint", hint); /* 342 */ el.addAttribute("hidden", hidden); } else { /* 344 */ el.attribute("name").setText(name); /* 345 */ el.attribute("caption").setText(caption); /* 346 */ el.attribute("role").setText(role); /* 347 */ el.attribute("icon").setText(icon); /* 348 */ el.attribute("hint").setText(hint); /* 349 */ el.attribute("hidden").setText(hidden); } } /* 352 */ mapXml.save(); } public void importFile(HttpServletRequest request, HttpServletResponse response) throws Exception { /* 357 */ String importDir = request.getAttribute("importDir").toString(); /* 358 */ FileUtil.checkRight(request, new File(importDir)); /* 359 */ InputStream stream = (InputStream)request.getAttribute("importFile"); /* 360 */ String fn = request.getAttribute("importFile__file").toString(); /* 362 */ if (StringUtil.isEqual(request.getAttribute("importType").toString(), /* 363 */ "1")) { /* 364 */ if (StringUtil.isSame(FileUtil.extractFileExt(fn), "zip")) /* 365 */ CompressUtil.unzip(stream, new File(importDir), /* 366 */ (String)request.getAttribute("sys.fileCharset")); else /* 368 */ throw new Exception("zip"); } /* 370 */ else FileUtil.<API key>(stream, new File(importDir, fn)); } public void exportFile(HttpServletRequest request, HttpServletResponse response) throws Exception { /* 375 */ String[] list = StringUtil.split(request.getParameter("exportFiles"), /* 376 */ "|"); /* 378 */ int i = 0; int j = list.length; /* 380 */ File[] files = new File[j]; /* 382 */ for (i = 0; i < j; i++) { /* 383 */ WebUtil.recordLog(request, "explorer:" + list[i], 1); /* 384 */ files[i] = new File(list[i]); /* 385 */ FileUtil.checkRight(request, files[i]); } String fileName; /* 387 */ if (j == 1) { /* 388 */ fileName = FileUtil.<API key>(files[0].getName()); } else { /* 390 */ File parentFile = files[0].getParentFile(); /* 391 */ fileName = ""; /* 392 */ if (parentFile != null) /* 393 */ fileName = FileUtil.<API key>(parentFile.getName()); /* 394 */ if (StringUtil.isEmpty(fileName)) /* 395 */ fileName = "data"; } /* 397 */ boolean useZip = (StringUtil.isEqual(request.getParameter("exportType"), "1")) || /* 398 */ (j > 1) || (files[0].isDirectory()); /* 399 */ response.reset(); /* 400 */ if (!useZip) { /* 401 */ response.setHeader("content-length", Long.toString(files[0] /* 402 */ .length())); /* 403 */ fileName = files[0].getName(); } else { /* 405 */ fileName = fileName + ".zip"; /* 406 */ }response.setHeader("content-type", "application/force-download"); /* 407 */ String charset = (String)request.getAttribute("sys.fileCharset"); /* 408 */ response.setHeader("content-disposition", "attachment;filename=" + /* 409 */ WebUtil.getFileName(fileName, charset)); /* 410 */ if (useZip) { /* 411 */ CompressUtil.zip(files, response.getOutputStream(), /* 412 */ (String)request.getAttribute("sys.fileCharset")); } else { /* 414 */ FileInputStream inputStream = new FileInputStream(files[0]); /* 415 */ SysUtil.<API key>(inputStream, response /* 416 */ .getOutputStream()); /* 417 */ inputStream.close(); } } public void exportFile2(HttpServletRequest request, HttpServletResponse response) throws Exception { String root = request.getAttribute("sys.path").toString() + "WEB-INF/myfile.doc"; /* 378 */ int i = 0; int j = 1; /* 380 */ File[] files = new File[j]; /* 382 */ /* 383 */ WebUtil.recordLog(request, "explorer:" + root, 1); /* 384 */ files[i] = new File(root); /* 385 */ FileUtil.checkRight(request, files[i]); String fileName; /* 387 */ if (j == 1) { /* 388 */ fileName = FileUtil.<API key>(files[0].getName()); } else { /* 390 */ File parentFile = files[0].getParentFile(); /* 391 */ fileName = ""; /* 392 */ if (parentFile != null) /* 393 */ fileName = FileUtil.<API key>(parentFile.getName()); /* 394 */ if (StringUtil.isEmpty(fileName)) /* 395 */ fileName = "data"; } /* 397 */ boolean useZip = (StringUtil.isEqual(request.getParameter("exportType"), "1")) || /* 398 */ (j > 1) || (files[0].isDirectory()); /* 399 */ response.reset(); /* 400 */ if (!useZip) { /* 401 */ response.setHeader("content-length", Long.toString(files[0] /* 402 */ .length())); /* 403 */ fileName = files[0].getName(); } else { /* 405 */ fileName = fileName + ".zip"; /* 406 */ }response.setHeader("content-type", "application/force-download"); /* 407 */ String charset = (String)request.getAttribute("sys.fileCharset"); /* 408 */ response.setHeader("content-disposition", "attachment;filename=" + /* 409 */ WebUtil.getFileName(fileName, charset)); /* 410 */ if (useZip) { /* 411 */ CompressUtil.zip(files, response.getOutputStream(), /* 412 */ (String)request.getAttribute("sys.fileCharset")); } else { /* 414 */ FileInputStream inputStream = new FileInputStream(files[0]); /* 415 */ SysUtil.<API key>(inputStream, response /* 416 */ .getOutputStream()); /* 417 */ inputStream.close(); } } public void execute(HttpServletRequest request, HttpServletResponse response) throws Exception { /* 423 */ String fileName = request.getParameter("file"); try { /* 425 */ Runtime.getRuntime().exec(fileName); } catch (Exception e) { /* 427 */ throw new Exception(" \"" + FileUtil.extractFileName(fileName) + /* 428 */ "\""); } } public void openFile(HttpServletRequest request, HttpServletResponse response) throws Exception { /* 434 */ FileUtil.checkRight(request, new File(request.getParameter("file"))); /* 435 */ String charset = request.getParameter("charset"); /* 437 */ if (StringUtil.isEmpty(charset)) /* 438 */ charset = (String)request.getAttribute("sys.charset"); /* 439 */ response.getWriter().print( /* 440 */ FileUtil.readText(request.getParameter("file"), charset)); } public void saveFile(HttpServletRequest request, HttpServletResponse response) throws Exception { /* 445 */ FileUtil.checkRight(request, new File(request.getParameter("file"))); /* 446 */ String charset = request.getParameter("charset"); /* 447 */ if (StringUtil.isEmpty(charset)) /* 448 */ charset = (String)request.getAttribute("sys.charset"); /* 449 */ FileUtil.writeText(request.getParameter("file"), request /* 450 */ .getParameter("text"), charset); } public void deleteFiles(HttpServletRequest request, HttpServletResponse response) throws Exception { /* 457 */ JSONArray files = new JSONArray(request.getParameter("files")); /* 458 */ int j = files.length(); /* 460 */ for (int i = 0; i < j; i++) { /* 461 */ String fileName = files.getString(i); /* 462 */ File file = new File(fileName); /* 463 */ FileUtil.checkRight(request, file); /* 464 */ WebUtil.recordLog(request, "explorer:" + fileName, 1); /* 465 */ if (file.isDirectory()) /* 466 */ FileUtil.deleteFolder(file); /* 467 */ else if (!file.delete()) /* 468 */ throw new Exception(" \"" + file.getName() + "\""); } } public void pasteFiles(HttpServletRequest request, HttpServletResponse response) throws Exception { /* 474 */ String filesParam = request.getParameter("files"); /* 475 */ String dir = request.getParameter("dir") + "/"; /* 476 */ File destFile = new File(dir); /* 477 */ JSONArray files = new JSONArray(filesParam); /* 478 */ boolean isCut = StringUtil.getStringBool(request.getParameter("isCut")); /* 479 */ int j = files.length(); /* 481 */ for (int i = 0; i < j; i++) { /* 482 */ File file = new File(files.getString(i)); /* 483 */ File dest = new File(dir + file.getName()); /* 484 */ FileUtil.checkRight(request, file); /* 485 */ FileUtil.checkRight(request, dest); /* 486 */ WebUtil.recordLog(request, "explorer:" + (isCut ? "" : "") + /* 487 */ "," + files.getString(i) + "" + dir, 1); /* 488 */ if (file.isDirectory()) { /* 489 */ if (FileUtil.isSubFolder(file, destFile)) /* 490 */ throw new Exception(""); /* 491 */ FileUtil.copyFolder(file, dest, true, isCut); } else { /* 493 */ FileUtil.copyFile(file, dest, true, isCut); } } } public void rename(HttpServletRequest request, HttpServletResponse response) throws Exception { /* 499 */ String fileName = request.getParameter("fileName"); /* 500 */ String rename = request.getParameter("fileValue"); /* 501 */ File file = new File(fileName); /* 502 */ FileUtil.checkRight(request, file); /* 503 */ if ((rename.indexOf("/") > -1) || /* 504 */ (rename.indexOf("\\") > -1) || /* 505 */ (!file.renameTo( /* 506 */ new File(FileUtil.extractFilePath(fileName) + /* 506 */ rename)))) /* 507 */ throw new Exception(""); } public void newFile(HttpServletRequest request, HttpServletResponse response) throws Exception { /* 512 */ String name = request.getParameter("fileValue"); /* 513 */ String fileName = request.getParameter("dir") + "/" + name; /* 514 */ String type = request.getParameter("type"); /* 517 */ File file = new File(fileName); /* 518 */ FileUtil.checkRight(request, file); boolean flag; /* 519 */ if (type.equals("dir")) /* 520 */ flag = file.mkdir(); else /* 522 */ flag = file.createNewFile(); /* 523 */ if (!flag) /* 524 */ throw new Exception("\"" + name + "\""); } public void getPubDir(HttpServletRequest request, HttpServletResponse response) throws Exception { /* 529 */ String dir = request.getParameter("dir"); /* 530 */ StringBuilder buf = new StringBuilder(); /* 531 */ String root = request.getAttribute("sys.path").toString() + /* 532 */ "WEB-INF/myfile"; /* 533 */ String scope = request.getAttribute("sys.scope").toString(); /* 535 */ if (StringUtil.isEmpty(dir)) { /* 536 */ loadPubDir(FileUtil.fetchPubDir(root, scope), buf); } else { /* 538 */ File fl = new File(dir); /* 539 */ FileUtil.checkRight(request, fl); /* 540 */ File[] files = fl.listFiles(); /* 541 */ FileUtil.sortFiles(files); /* 542 */ loadFilesBuf(files, buf); } /* 544 */ response.getWriter().print(buf); } public void getUserDir(HttpServletRequest request, HttpServletResponse response) throws Exception { /* 549 */ String dir = request.getParameter("dir"); /* 550 */ StringBuilder buf = new StringBuilder(); /* 552 */ if (StringUtil.isEmpty(dir)) { /* 553 */ loadUserDir((String)request.getAttribute("sys.rootpath"), buf); } else { /* 555 */ File fl = new File(dir); /* 556 */ FileUtil.checkRight(request, fl); /* 557 */ File[] files = fl.listFiles(); /* 558 */ FileUtil.sortFiles(files); /* 559 */ loadFilesBuf(files, buf); } /* 561 */ response.getWriter().print(buf); } public void getDir(HttpServletRequest request, HttpServletResponse response) throws Exception { /* 566 */ String dir = request.getParameter("dir"); /* 567 */ boolean appRoot = StringUtil.getStringBool(request /* 568 */ .getParameter("setAppRoot")); /* 569 */ StringBuilder buf = new StringBuilder(); /* 571 */ if (StringUtil.isEmpty(dir)) { /* 572 */ if ((appRoot) || (!loadFilesBuf(File.listRoots(), buf))) { /* 573 */ buf = new StringBuilder(); /* 574 */ loadAppDir((String)request.getAttribute("sys.path"), buf); } } else { /* 577 */ File[] files = new File(dir).listFiles(); /* 578 */ FileUtil.sortFiles(files); /* 579 */ loadFilesBuf(files, buf); } /* 581 */ response.getWriter().print(buf); } public void getFile(HttpServletRequest request, HttpServletResponse response) throws Exception { /* 586 */ String dir = request.getParameter("dir"); /* 587 */ File dirFile = new File(dir); /* 588 */ FileUtil.checkRight(request, dirFile); /* 589 */ File[] files = dirFile.listFiles(); /* 590 */ if (files == null) { /* 591 */ response.getWriter().print("{total:0,row:[]}"); /* 592 */ return; } /* 594 */ FileUtil.sortFiles(files); /* 595 */ StringBuilder buf = new StringBuilder(); /* 596 */ FileSystemView fileView = FileSystemView.getFileSystemView(); /* 597 */ boolean isFirst = true; /* 598 */ String start = request.getParameter("start"); /* 599 */ String limit = request.getParameter("limit"); /* 600 */ int count = 0; int startValue; /* 602 */ if (start == null) /* 603 */ startValue = 1; else /* 605 */ startValue = Integer.parseInt(start) + 1; int limitValue; /* 606 */ if (limit == null) /* 607 */ limitValue = 2147483647 - startValue; else /* 609 */ limitValue = Integer.parseInt(limit); /* 610 */ int end = startValue + limitValue - 1; /* 611 */ buf.append("{total:"); /* 612 */ buf.append(files.length); /* 613 */ buf.append(",row:["); /* 614 */ for (File file : files) { /* 615 */ count++; /* 616 */ if (count < startValue) continue; /* 618 */ if (count > end) break; /* 620 */ if (isFirst) /* 621 */ isFirst = false; else /* 623 */ buf.append(","); /* 624 */ boolean isDir = file.isDirectory(); /* 625 */ buf.append("{filename:\""); /* 626 */ if (isDir) /* 627 */ buf.append("0"); else /* 629 */ buf.append("1"); /* 630 */ String fileName = file.getName(); /* 631 */ buf.append(fileName); /* 632 */ buf.append("\",size:"); /* 633 */ if (isDir) /* 634 */ buf.append(-1); else /* 636 */ buf.append(file.length()); /* 637 */ buf.append(",file:\""); /* 638 */ buf.append(StringUtil.replace(file.getAbsolutePath(), "\\", "/")); /* 639 */ buf.append("\",type:\""); /* 640 */ if (isDir) { /* 641 */ buf.append("0"); } else { String type; try { type = fileView.<API key>(file); } catch (Exception e) { /* 646 */ type = null; } /* 648 */ if (type != null) { /* 649 */ buf.append("1" + StringUtil.toExpress(type)); } else { /* 651 */ String ext = FileUtil.extractFileExt(fileName); /* 652 */ if (StringUtil.isEmpty(ext)) { /* 653 */ buf.append("1"); } else { /* 655 */ buf.append("1" + ext); /* 656 */ buf.append(" "); } } } /* 660 */ buf.append("\",modifyTime:\""); /* 661 */ buf.append(DateUtil.dateToString(new Date(file.lastModified()))); /* 662 */ buf.append("\"}"); } /* 664 */ buf.append("]}"); /* 665 */ response.getWriter().print(buf); } public void getIcon(HttpServletRequest request, HttpServletResponse response) throws Exception { /* 671 */ File file = new File(new String(request.getParameter("file") /* 671 */ .getBytes("ISO-8859-1"), "utf-8")); FileSystemView fileView = FileSystemView.getFileSystemView(); Icon icon = fileView.getSystemIcon(file); response.reset(); if (icon == null) { response.setContentType("image/gif"); InputStream is = new FileInputStream(request.getAttribute("sys.path") + "webbuilder/images/file.gif"); SysUtil.<API key>(is, response.getOutputStream()); is.close(); } else { response.setContentType("image/jpeg"); int width = icon.getIconWidth(); int height = icon.getIconHeight(); BufferedImage image = new BufferedImage(width, height, 1); Graphics graphics = image.getGraphics(); graphics.setColor(Color.white); graphics.fillRect(0, 0, width, height); icon.paintIcon(null, graphics, 0, 0); ImageIO.write(image, "jpeg", response.getOutputStream()); graphics.dispose(); } } private void loadPubDir(String pubDir, StringBuilder buf) { /* 697 */ buf.append("["); /* 698 */ buf.append("{text:\"\",dir:\""); /* 699 */ buf.append(StringUtil.toExpress(pubDir)); /* 700 */ buf.append("\"}"); /* 701 */ buf.append("]"); } private void loadUserDir(String userDir, StringBuilder buf) { /* 705 */ buf.append("["); /* 706 */ buf.append("{text:\"\",dir:\""); /* 707 */ buf.append(StringUtil.toExpress(userDir)); /* 708 */ buf.append("\"}"); /* 709 */ buf.append("]"); } private void loadAppDir(String appDir, StringBuilder buf) { /* 713 */ String s = FileUtil.extractFileDir(appDir); /* 714 */ buf.append("["); /* 715 */ buf.append("{text:\""); /* 716 */ buf.append(StringUtil.toExpress(s)); /* 717 */ buf.append("\",dir:\""); /* 718 */ buf.append(StringUtil.toExpress(s)); /* 719 */ buf.append("\"}"); /* 720 */ buf.append("]"); } private boolean loadFilesBuf(File[] files, StringBuilder buf) { /* 724 */ boolean isOk = false; boolean isFirst = true; /* 727 */ buf.append("["); /* 728 */ for (File file : files) { /* 729 */ if (file.isDirectory()) { /* 730 */ isOk = true; /* 731 */ if (isFirst) /* 732 */ isFirst = false; else /* 734 */ buf.append(","); /* 735 */ buf.append("{text:\""); /* 736 */ String name = file.getName(); /* 737 */ String dir = StringUtil.replace(file.getAbsolutePath(), "\\", "/"); /* 738 */ if (StringUtil.isEmpty(name)) /* 739 */ name = FileUtil.extractFileDir(dir); /* 740 */ buf.append(StringUtil.toExpress(name)); /* 741 */ buf.append("\",dir:\""); /* 742 */ buf.append(StringUtil.replace(dir, "\\", "/")); /* 743 */ if (FileUtil.hasSubFile(file, true)) /* 744 */ buf.append("\"}"); else /* 746 */ buf.append("\",leaf:true,iconCls:\"icon_folder\"}"); } } /* 749 */ buf.append("]"); /* 750 */ return isOk; } }
package org.fax4j.spi.email; import java.io.IOException; import javax.mail.Message; import javax.mail.Transport; import org.fax4j.FaxException; import org.fax4j.FaxJob; import org.fax4j.common.Logger; import org.fax4j.spi.<API key>; import org.fax4j.util.Connection; import org.fax4j.util.ReflectionHelper; /** * This class implements the fax client service provider interface.<br> * This parial implementation will invoke the requests by sending emails to a mail server that supports * conversion between email messages and fax messages.<br> * The mail SPI supports persistent connection to enable to reuse the same connection for all fax * operation invocations or to create a new connection for each fax operation invocation.<br> * By default the SPI will create a new connection for each operation invocation however the * <b>org.fax4j.spi.mail.persistent.connection</b> set to true will enable to reuse the connection.<br> * To set the user/password values of the mail connection the following 2 properties must be defined: * <b>org.fax4j.spi.mail.user.name</b> and <b>org.fax4j.spi.mail.password</b><br> * All properties defined in the fax4j configuration will be passed to the mail connection therefore it is * possible to define mail specific properties (see java mail for more info) in the fax4j properties.<br> * Implementing SPI class will have to implement the <API key> methods.<br> * These methods will return the message to be sent for that fax job operation. In case the method * returns null, this class will throw an <API key> exception. * <br> * The configuration of the fax4j framework is made up of 3 layers.<br> * The configuration is based on simple properties.<br> * Each layer overrides the lower layers by adding/changing the property values.<br> * The first layer is the internal fax4j.properties file located in the fax4j jar.<br> * This layer contains the preconfigured values for the fax4j framework and can be changed * by updating these properties in the higher layers.<br> * The second layer is the external fax4j.properties file that is located on the classpath.<br> * This file is optional and provides the ability to override the internal configuration for the * entire fax4j framework.<br> * The top most layer is the optional java.util.Properties object provided by the external classes * when creating a new fax client.<br> * These properties enable to override the configuration of the lower 2 layers.<br> * <br> * <b>SPI Status (Draft, Beta, Stable): </b>Stable<br> * <br> * Below table describes the configuration values relevant for this class.<br> * <b>Configuration:</b> * <table summary="" border="1"> * <tr> * <td>Name</td> * <td>Description</td> * <td>Preconfigured Value</td> * <td>Default Value</td> * <td>Mandatory</td> * </tr> * <tr> * <td>org.fax4j.spi.mail.persistent.connection</td> * <td>True to reuse the same mail connection for all fax activites, false to create a * new mail connection for each fax activity.</td> * <td>false</td> * <td>false</td> * <td>false</td> * </tr> * <tr> * <td>org.fax4j.spi.mail.connection.factory.class.name</td> * <td>The connection factory class name</td> * <td>org.fax4j.spi.email.<API key></td> * <td>org.fax4j.spi.email.<API key></td> * <td>false</td> * </tr> * <tr> * <td>org.fax4j.spi.mail.user.name</td> * <td>The mail account user name.</td> * <td>none</td> * <td>none</td> * <td>false</td> * </tr> * <tr> * <td>org.fax4j.spi.mail.password</td> * <td>The mail account password.</td> * <td>none</td> * <td>none</td> * <td>false</td> * </tr> * <tr> * <td>javax mail properties</td> * <td>Any of the javax mail properties can be defined in the fax4j properties.<br> * These properties will be passed to the java mail framework.</td> * <td>mail.transport.protocol=smtp<br> * mail.smtp.port=25</td> * <td>none</td> * <td>false</td> * </tr> * </table> * <br> * <b>Limitations:</b><br> * <ul> * <li>This SPI is based on the java mail infrastructure, therefore this SPI cannot * connect to mail servers through a proxy server. * <li>This SPI provides only partial implementation (this is an abstract class). * </ul> * <br> * <b>Dependencies:</b><br> * <ul> * <li>Required jar files: mail-1.4.jar, activation-1.1.jar * </ul> * <br> * * @author Sagie Gur-Ari * @version 1.12 * @since 0.1 */ public abstract class <API key> extends <API key> { /** * The use persistent connection flag which defines if the SPI will use a new * connection for each request or will reuse the same connection */ private boolean <API key>; /**The mail connection factory*/ private <API key> connectionFactory; /**The mail connection*/ private Connection<MailResourcesHolder> connection; /** * This class holds the SPI configuration constants. * * @author Sagie Gur-Ari * @version 1.03 * @since 0.1 */ public enum <API key> { /** * The use persistent connection property key which defines if the SPI will use a new * connection for each request or will reuse the same connection */ <API key>("org.fax4j.spi.mail.persistent.connection"), /**The connection factory class name*/ <API key>("org.fax4j.spi.mail.connection.factory.class.name"), /**The user name used to connect to the mail server*/ <API key>("org.fax4j.spi.mail.user.name"), /**The password used to connect to the mail server*/ <API key>("org.fax4j.spi.mail.password"); /**The string value*/ private String value; /** * This is the class constructor. * * @param value * The string value */ private <API key>(String value) { this.value=value; } /** * This function returns the string value. * * @return The string value */ @Override public final String toString() { return this.value; } } /** * This is the default constructor. */ public <API key>() { super(); } /** * This function initializes the fax client SPI. */ @Override protected void initializeImpl() { //get logger Logger logger=this.getLogger(); //get use persistent connection value this.<API key>=Boolean.parseBoolean(this.<API key>(<API key>.<API key>)); logger.logDebug(new Object[]{"Using persistent connection: ",String.valueOf(this.<API key>)},null); //setup connection factory String className=this.<API key>(<API key>.<API key>); this.connectionFactory=this.<API key>(className); if(this.connectionFactory==null) { throw new FaxException("Mail connection factory is not available."); } } /** * Creates and returns the mail connection factory. * * @param className * The connection factory class name * @return The mail connection factory */ protected final <API key> <API key>(String className) { String factoryClassName=className; if(factoryClassName==null) { factoryClassName=<API key>.class.getName(); } //create new instance <API key> factory=(<API key>)ReflectionHelper.createInstance(factoryClassName); //initialize factory.initialize(this); return factory; } /** * Releases the connection if open. * * @throws Throwable * Any throwable */ @Override protected void finalize() throws Throwable { //get reference Connection<MailResourcesHolder> mailConnection=this.connection; //release connection this.closeMailConnection(mailConnection); super.finalize(); } /** * Creates and returns the mail connection to be used to send the fax * via mail. * * @return The mail connection */ protected Connection<MailResourcesHolder> <API key>() { //create new connection Connection<MailResourcesHolder> mailConnection=this.connectionFactory.createConnection(); //log debug Logger logger=this.getLogger(); logger.logInfo(new Object[]{"Created mail connection."},null); return mailConnection; } /** * This function closes the provided mail connection. * * @param mailConnection * The mail connection to close * @throws IOException * Never thrown */ protected void closeMailConnection(Connection<MailResourcesHolder> mailConnection) throws IOException { if(mailConnection!=null) { //get logger Logger logger=this.getLogger(); //release connection logger.logInfo(new Object[]{"Closing mail connection."},null); mailConnection.close(); } } /** * Returns the mail connection to be used to send the fax * via mail. * * @return The mail connection */ protected Connection<MailResourcesHolder> getMailConnection() { Connection<MailResourcesHolder> mailConnection=null; if(this.<API key>) { synchronized(this) { if(this.connection==null) { //create new connection this.connection=this.<API key>(); } } //get connection mailConnection=this.connection; } else { //create new connection mailConnection=this.<API key>(); } return mailConnection; } /** * This function will send the mail message. * * @param faxJob * The fax job object containing the needed information * @param mailConnection * The mail connection (will be released if not persistent) * @param message * The message to send */ protected void sendMail(FaxJob faxJob,Connection<MailResourcesHolder> mailConnection,Message message) { if(message==null) { this.<API key>(); } else { //get holder MailResourcesHolder mailResourcesHolder=mailConnection.getResource(); //get transport Transport transport=mailResourcesHolder.getTransport(); try { //send message message.saveChanges(); if(transport==null) { Transport.send(message,message.getAllRecipients()); } else { transport.sendMessage(message,message.getAllRecipients()); } } catch(Throwable throwable) { throw new FaxException("Unable to send message.",throwable); } finally { if(!this.<API key>) { try { //close connection this.closeMailConnection(mailConnection); } catch(Exception exception) { //log error Logger logger=this.getLogger(); logger.logInfo(new Object[]{"Error while releasing mail connection."},exception); } } } } } /** * This function will submit a new fax job.<br> * The fax job ID may be populated by this method in the provided * fax job object. * * @param faxJob * The fax job object containing the needed information */ @Override protected void submitFaxJobImpl(FaxJob faxJob) { //get connection Connection<MailResourcesHolder> mailConnection=this.getMailConnection(); //get holder MailResourcesHolder mailResourcesHolder=mailConnection.getResource(); //create message Message message=this.<API key>(faxJob,mailResourcesHolder); //send message this.sendMail(faxJob,mailConnection,message); } /** * This function will suspend an existing fax job. * * @param faxJob * The fax job object containing the needed information */ @Override protected void suspendFaxJobImpl(FaxJob faxJob) { //get connection Connection<MailResourcesHolder> mailConnection=this.getMailConnection(); //get holder MailResourcesHolder mailResourcesHolder=mailConnection.getResource(); //create message Message message=this.<API key>(faxJob,mailResourcesHolder); //send message this.sendMail(faxJob,mailConnection,message); } /** * This function will resume an existing fax job. * * @param faxJob * The fax job object containing the needed information */ @Override protected void resumeFaxJobImpl(FaxJob faxJob) { //get connection Connection<MailResourcesHolder> mailConnection=this.getMailConnection(); //get holder MailResourcesHolder mailResourcesHolder=mailConnection.getResource(); //create message Message message=this.<API key>(faxJob,mailResourcesHolder); //send message this.sendMail(faxJob,mailConnection,message); } /** * This function will cancel an existing fax job. * * @param faxJob * The fax job object containing the needed information */ @Override protected void cancelFaxJobImpl(FaxJob faxJob) { //get connection Connection<MailResourcesHolder> mailConnection=this.getMailConnection(); //get holder MailResourcesHolder mailResourcesHolder=mailConnection.getResource(); //create message Message message=this.<API key>(faxJob,mailResourcesHolder); //send message this.sendMail(faxJob,mailConnection,message); } /** * This function will create the message used to invoke the fax * job action.<br> * If this method returns null, the SPI will throw an <API key>. * * @param faxJob * The fax job object containing the needed information * @param mailResourcesHolder * The mail resources holder * @return The message to send (if null, the SPI will throw an <API key>) */ protected abstract Message <API key>(FaxJob faxJob,MailResourcesHolder mailResourcesHolder); /** * This function will create the message used to invoke the fax * job action.<br> * If this method returns null, the SPI will throw an <API key>. * * @param faxJob * The fax job object containing the needed information * @param mailResourcesHolder * The mail resources holder * @return The message to send (if null, the SPI will throw an <API key>) */ protected abstract Message <API key>(FaxJob faxJob,MailResourcesHolder mailResourcesHolder); /** * This function will create the message used to invoke the fax * job action.<br> * If this method returns null, the SPI will throw an <API key>. * * @param faxJob * The fax job object containing the needed information * @param mailResourcesHolder * The mail resources holder * @return The message to send (if null, the SPI will throw an <API key>) */ protected abstract Message <API key>(FaxJob faxJob,MailResourcesHolder mailResourcesHolder); /** * This function will create the message used to invoke the fax * job action.<br> * If this method returns null, the SPI will throw an <API key>. * * @param faxJob * The fax job object containing the needed information * @param mailResourcesHolder * The mail resources holder * @return The message to send (if null, the SPI will throw an <API key>) */ protected abstract Message <API key>(FaxJob faxJob,MailResourcesHolder mailResourcesHolder); }
<html><head><title>dlib C++ Library - <API key>.h</title></head><body bgcolor='white'><pre> <font color=' </font><font color=' </font><font color='#0000FF'>#undef</font> <API key> <font color='#0000FF'>#ifdef</font> <API key> <font color='#0000FF'>#include</font> <font color='#5555FF'>&lt;</font>complex<font color='#5555FF'>&gt;</font> <font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='../matrix.h.html'>../matrix.h</a>" <font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='../rand.h.html'>../rand.h</a>" <font color='#0000FF'>namespace</font> dlib <b>{</b> <font color=' </font> <font color='#0000FF'>typedef</font> std::complex<font color='#5555FF'>&lt;</font><font color='#0000FF'><u>double</u></font><font color='#5555FF'>&gt;</font> qc_scalar_type; <font color=' </font> <font color='#0000FF'>class</font> <b><a name='quantum_register'></a>quantum_register</b> <b>{</b> <font color='#009900'>/*! INITIAL VALUE - num_bits() == 1 - state_vector().nr() == 2 - state_vector().nc() == 1 - state_vector()(0) == 1 - state_vector()(1) == 0 - probability_of_bit(0) == 0 - i.e. This register represents a single quantum bit and it is completely in the 0 state. WHAT THIS OBJECT REPRESENTS This object represents a set of quantum bits. !*/</font> <font color='#0000FF'>public</font>: <b><a name='quantum_register'></a>quantum_register</b><font face='Lucida Console'>(</font> <font face='Lucida Console'>)</font>; <font color='#009900'>/*! ensures - this object is properly initialized !*/</font> <font color='#0000FF'><u>int</u></font> <b><a name='num_bits'></a>num_bits</b> <font face='Lucida Console'>(</font> <font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>; <font color='#009900'>/*! ensures - returns the number of quantum bits in this register !*/</font> <font color='#0000FF'><u>void</u></font> <b><a name='set_num_bits'></a>set_num_bits</b> <font face='Lucida Console'>(</font> <font color='#0000FF'><u>int</u></font> new_num_bits <font face='Lucida Console'>)</font>; <font color='#009900'>/*! requires - 1 &lt;= new_num_bits &lt;= 30 ensures - #num_bits() == new_num_bits - #state_vector().nr() == 2^new_num_bits (i.e. the size of the state_vector is exponential in the number of bits in a register) - for all valid i: - probability_of_bit(i) == 0 !*/</font> <font color='#0000FF'><u>void</u></font> <b><a name='zero_all_bits'></a>zero_all_bits</b><font face='Lucida Console'>(</font> <font face='Lucida Console'>)</font>; <font color='#009900'>/*! ensures - for all valid i: - probability_of_bit(i) == 0 !*/</font> <font color='#0000FF'><u>void</u></font> <b><a name='append'></a>append</b> <font face='Lucida Console'>(</font> <font color='#0000FF'>const</font> quantum_register<font color='#5555FF'>&amp;</font> reg <font face='Lucida Console'>)</font>; <font color='#009900'>/*! ensures - #num_bits() == num_bits() + reg.num_bits() - #this-&gt;state_vector() == tensor_product(this-&gt;state_vector(), reg.state_vector()) - The original bits in *this become the high order bits of the resulting register and all the bits in reg end up as the low order bits in the resulting register. !*/</font> <font color='#0000FF'><u>double</u></font> <b><a name='probability_of_bit'></a>probability_of_bit</b> <font face='Lucida Console'>(</font> <font color='#0000FF'><u>int</u></font> bit <font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>; <font color='#009900'>/*! requires - 0 &lt;= bit &lt; num_bits() ensures - returns the probability of measuring the given bit and it being in the 1 state. - The returned value is also equal to the sum of norm(state_vector()(i)) for all i where the bit'th bit in i is set to 1. (note that the lowest order bit is bit 0) !*/</font> <font color='#0000FF'>template</font> <font color='#5555FF'>&lt;</font><font color='#0000FF'>typename</font> rand_type<font color='#5555FF'>&gt;</font> <font color='#0000FF'><u>bool</u></font> <b><a name='measure_bit'></a>measure_bit</b> <font face='Lucida Console'>(</font> <font color='#0000FF'><u>int</u></font> bit, rand_type<font color='#5555FF'>&amp;</font> rnd <font face='Lucida Console'>)</font>; <font color='#009900'>/*! requires - 0 &lt;= bit &lt; num_bits() - rand_type == an implementation of dlib/rand/rand_float_abstract.h ensures - measures the given bit in this register. Let R denote the boolean result of the measurement, where true means the bit was measured to have value 1 and false means it had a value of 0. - if (R == true) then - returns true - #probability_of_bit(bit) == 1 - else - returns false - #probability_of_bit(bit) == 0 !*/</font> <font color='#0000FF'>template</font> <font color='#5555FF'>&lt;</font><font color='#0000FF'>typename</font> rand_type<font color='#5555FF'>&gt;</font> <font color='#0000FF'><u>bool</u></font> <b><a name='<API key>'></a><API key></b> <font face='Lucida Console'>(</font> <font color='#0000FF'><u>int</u></font> bit, rand_type<font color='#5555FF'>&amp;</font> rnd <font face='Lucida Console'>)</font>; <font color='#009900'>/*! requires - num_bits() &gt; 1 - 0 &lt;= bit &lt; num_bits() - rand_type == an implementation of dlib/rand/rand_float_abstract.h ensures - measures the given bit in this register. Let R denote the boolean result of the measurement, where true means the bit was measured to have value 1 and false means it had a value of 0. - #num_bits() == num_bits() - 1 - removes the bit that was measured from this register. - if (R == true) then - returns true - else - returns false !*/</font> <font color='#0000FF'>const</font> matrix<font color='#5555FF'>&lt;</font>qc_scalar_type,<font color='#979000'>0</font>,<font color='#979000'>1</font><font color='#5555FF'>&gt;</font><font color='#5555FF'>&amp;</font> <b><a name='state_vector'></a>state_vector</b><font face='Lucida Console'>(</font> <font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>; <font color='#009900'>/*! ensures - returns a const reference to the state vector that describes the state of the quantum bits in this register. !*/</font> matrix<font color='#5555FF'>&lt;</font>qc_scalar_type,<font color='#979000'>0</font>,<font color='#979000'>1</font><font color='#5555FF'>&gt;</font><font color='#5555FF'>&amp;</font> <b><a name='state_vector'></a>state_vector</b><font face='Lucida Console'>(</font> <font face='Lucida Console'>)</font>; <font color='#009900'>/*! ensures - returns a non-const reference to the state vector that describes the state of the quantum bits in this register. !*/</font> <font color='#0000FF'><u>void</u></font> <b><a name='swap'></a>swap</b> <font face='Lucida Console'>(</font> quantum_register<font color='#5555FF'>&amp;</font> item <font face='Lucida Console'>)</font>; <font color='#009900'>/*! ensures - swaps *this and item !*/</font> <b>}</b>; <font color='#0000FF'>inline</font> <font color='#0000FF'><u>void</u></font> <b><a name='swap'></a>swap</b> <font face='Lucida Console'>(</font> quantum_register<font color='#5555FF'>&amp;</font> a, quantum_register<font color='#5555FF'>&amp;</font> b <font face='Lucida Console'>)</font> <b>{</b> a.<font color='#BB00BB'>swap</font><font face='Lucida Console'>(</font>b<font face='Lucida Console'>)</font>; <b>}</b> <font color='#009900'>/*! provides a global swap function !*/</font> <font color=' </font> <font color='#0000FF'>template</font> <font color='#5555FF'>&lt;</font><font color='#0000FF'>typename</font> T<font color='#5555FF'>&gt;</font> <font color='#0000FF'>class</font> <b><a name='gate_exp'></a>gate_exp</b> <b>{</b> <font color='#009900'>/*! REQUIREMENTS ON T T must be some object that inherits from gate_exp and implements its own version of operator() and <API key>(). WHAT THIS OBJECT REPRESENTS This object represents an expression that evaluates to a quantum gate that operates on T::num_bits qubits. This object makes it easy to create new types of gate objects. All you need to do is inherit from gate_exp in the proper way and then you can use your new gate objects in conjunction with all the others. !*/</font> <font color='#0000FF'>public</font>: <font color='#0000FF'>static</font> <font color='#0000FF'>const</font> <font color='#0000FF'><u>long</u></font> num_bits <font color='#5555FF'>=</font> T::num_bits; <font color='#0000FF'>static</font> <font color='#0000FF'>const</font> <font color='#0000FF'><u>long</u></font> dims <font color='#5555FF'>=</font> T::dims; <b><a name='gate_exp'></a>gate_exp</b><font face='Lucida Console'>(</font> T<font color='#5555FF'>&amp;</font> exp <font face='Lucida Console'>)</font>; <font color='#009900'>/*! ensures - #&amp;ref() == &amp;exp !*/</font> <font color='#0000FF'>const</font> qc_scalar_type <b><a name='operator'></a>operator</b><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font face='Lucida Console'>(</font> <font color='#0000FF'><u>long</u></font> r, <font color='#0000FF'><u>long</u></font> c <font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>; <font color='#009900'>/*! requires - 0 &lt;= r &lt; dims - 0 &lt;= c &lt; dims ensures - returns ref()(r,c) !*/</font> <font color='#0000FF'><u>void</u></font> <b><a name='apply_gate_to'></a>apply_gate_to</b> <font face='Lucida Console'>(</font> quantum_register<font color='#5555FF'>&amp;</font> reg <font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>; <font color='#009900'>/*! requires - reg.num_bits() == num_bits ensures - applies this quantum gate to the given quantum register - Let M represent the matrix for this quantum gate, then #reg().state_vector() = M*reg().state_vector() !*/</font> <font color='#0000FF'>template</font> <font color='#5555FF'>&lt;</font><font color='#0000FF'>typename</font> exp<font color='#5555FF'>&gt;</font> qc_scalar_type <b><a name='<API key>'></a><API key></b> <font face='Lucida Console'>(</font> <font color='#0000FF'>const</font> matrix_exp<font color='#5555FF'>&lt;</font>exp<font color='#5555FF'>&gt;</font><font color='#5555FF'>&amp;</font> reg, <font color='#0000FF'><u>long</u></font> row_idx <font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>; <font color='#009900'>/*! requires - reg.nr() == dims - reg.nc() == 1 - 0 &lt;= row_idx &lt; dims ensures - Let M represent the matrix for this gate, then this function returns rowm(M*reg, row_idx) (i.e. returns the row_idx row of what you get when you apply this gate to the given column vector in reg) - This function works by calling ref().<API key>(reg,row_idx) !*/</font> <font color='#0000FF'>const</font> T<font color='#5555FF'>&amp;</font> <b><a name='ref'></a>ref</b><font face='Lucida Console'>(</font> <font face='Lucida Console'>)</font>; <font color='#009900'>/*! ensures - returns a reference to the subexpression contained in this object !*/</font> <font color='#0000FF'>const</font> matrix<font color='#5555FF'>&lt;</font>qc_scalar_type<font color='#5555FF'>&gt;</font> <b><a name='mat'></a>mat</b> <font face='Lucida Console'>(</font> <font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>; <font color='#009900'>/*! ensures - returns a dense matrix object that contains the matrix for this gate !*/</font> <b>}</b>; <font color=' </font> <font color='#0000FF'>template</font> <font color='#5555FF'>&lt;</font><font color='#0000FF'>typename</font> T, <font color='#0000FF'>typename</font> U<font color='#5555FF'>&gt;</font> <font color='#0000FF'>class</font> <b><a name='composite_gate'></a>composite_gate</b> : <font color='#0000FF'>public</font> gate_exp<font color='#5555FF'>&lt;</font>composite_gate<font color='#5555FF'>&lt;</font>T,U<font color='#5555FF'>&gt;</font> <font color='#5555FF'>&gt;</font> <b>{</b> <font color='#009900'>/*! REQUIREMENTS ON T AND U Both must be gate expressions that inherit from gate_exp WHAT THIS OBJECT REPRESENTS This object represents a quantum gate that is the tensor product of two other quantum gates. As an example, suppose you have 3 registers, reg_high, reg_low, and reg_all. Also suppose that reg_all is what you get when you append reg_high and reg_low, so reg_all.state_vector() == tensor_product(reg_high.state_vector(),reg_low.state_vector()). Then applying a composite gate to reg_all would give you the same thing as applying the lhs gate to reg_high and the rhs gate to reg_low and then appending the two resulting registers. So the lhs gate of a composite_gate applies to the high order bits of a regitser and the rhs gate applies to the lower order bits. !*/</font> <font color='#0000FF'>public</font>: <b><a name='composite_gate'></a>composite_gate</b> <font face='Lucida Console'>(</font> <font color='#0000FF'>const</font> composite_gate<font color='#5555FF'>&amp;</font> g <font face='Lucida Console'>)</font>; <font color='#009900'>/*! ensures - *this is a copy of g !*/</font> <b><a name='composite_gate'></a>composite_gate</b><font face='Lucida Console'>(</font> <font color='#0000FF'>const</font> gate_exp<font color='#5555FF'>&lt;</font>T<font color='#5555FF'>&gt;</font><font color='#5555FF'>&amp;</font> lhs_, <font color='#0000FF'>const</font> gate_exp<font color='#5555FF'>&lt;</font>U<font color='#5555FF'>&gt;</font><font color='#5555FF'>&amp;</font> rhs_ <font face='Lucida Console'>)</font>: <font color='#009900'>/*! ensures - #lhs == lhs_.ref() - #rhs == rhs_.ref() - #num_bits == T::num_bits + U::num_bits - #dims == 2^num_bits - #&amp;ref() == this !*/</font> <font color='#0000FF'>const</font> qc_scalar_type <b><a name='operator'></a>operator</b><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font face='Lucida Console'>(</font> <font color='#0000FF'><u>long</u></font> r, <font color='#0000FF'><u>long</u></font> c <font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>; <font color='#009900'>/*! requires - 0 &lt;= r &lt; dims - 0 &lt;= c &lt; dims ensures - Let M denote the tensor product of lhs with rhs, then this function returns M(r,c) (i.e. returns lhs(r/U::dims,c/U::dims)*rhs(r%U::dims, c%U::dims)) !*/</font> <font color='#0000FF'>template</font> <font color='#5555FF'>&lt;</font><font color='#0000FF'>typename</font> exp<font color='#5555FF'>&gt;</font> qc_scalar_type <API key> <font face='Lucida Console'>(</font> <font color='#0000FF'>const</font> matrix_exp<font color='#5555FF'>&lt;</font>exp<font color='#5555FF'>&gt;</font><font color='#5555FF'>&amp;</font> reg, <font color='#0000FF'><u>long</u></font> row_idx <font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>; <font color='#009900'>/*! requires - reg.nr() == dims - reg.nc() == 1 - 0 &lt;= row_idx &lt; dims ensures - Let M represent the matrix for this gate, then this function returns rowm(M*reg, row_idx) (i.e. returns the row_idx row of what you get when you apply this gate to the given column vector in reg) - This function works by calling rhs.<API key>() and using elements of the matrix in lhs. !*/</font> <font color='#0000FF'>static</font> <font color='#0000FF'>const</font> <font color='#0000FF'><u>long</u></font> num_bits; <font color='#0000FF'>static</font> <font color='#0000FF'>const</font> <font color='#0000FF'><u>long</u></font> dims; <font color='#0000FF'>const</font> T lhs; <font color='#0000FF'>const</font> U rhs; <b>}</b>; <font color=' </font> <font color='#0000FF'>template</font> <font color='#5555FF'>&lt;</font><font color='#0000FF'><u>long</u></font> bits<font color='#5555FF'>&gt;</font> <font color='#0000FF'>class</font> <b><a name='gate'></a>gate</b> : <font color='#0000FF'>public</font> gate_exp<font color='#5555FF'>&lt;</font>gate<font color='#5555FF'>&lt;</font>bits<font color='#5555FF'>&gt;</font> <font color='#5555FF'>&gt;</font> <b>{</b> <font color='#009900'>/*! REQUIREMENTS ON bits 0 &lt; bits &lt;= 30 WHAT THIS OBJECT REPRESENTS This object represents a quantum gate that operates on bits qubits. It stores its gate matrix explicitly in a dense in-memory matrix. !*/</font> <font color='#0000FF'>public</font>: <b><a name='gate'></a>gate</b><font face='Lucida Console'>(</font> <font face='Lucida Console'>)</font>; <font color='#009900'>/*! ensures - num_bits == bits - dims == 2^bits - #&amp;ref() == this - for all valid r and c: #(*this)(r,c) == 0 !*/</font> <b><a name='gate'></a>gate</b> <font face='Lucida Console'>(</font> <font color='#0000FF'>const</font> gate<font color='#5555FF'>&amp;</font> g <font face='Lucida Console'>)</font>; <font color='#009900'>/*! ensures - *this is a copy of g !*/</font> <font color='#0000FF'>template</font> <font color='#5555FF'>&lt;</font><font color='#0000FF'>typename</font> T<font color='#5555FF'>&gt;</font> <font color='#0000FF'>explicit</font> <b><a name='gate'></a>gate</b><font face='Lucida Console'>(</font> <font color='#0000FF'>const</font> gate_exp<font color='#5555FF'>&lt;</font>T<font color='#5555FF'>&gt;</font><font color='#5555FF'>&amp;</font> g <font face='Lucida Console'>)</font>; <font color='#009900'>/*! requires - T::num_bits == num_bits ensures - num_bits == bits - dims == 2^bits - #&amp;ref() == this - for all valid r and c: #(*this)(r,c) == g(r,c) !*/</font> <font color='#0000FF'>const</font> qc_scalar_type<font color='#5555FF'>&amp;</font> <b><a name='operator'></a>operator</b><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font face='Lucida Console'>(</font> <font color='#0000FF'><u>long</u></font> r, <font color='#0000FF'><u>long</u></font> c <font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>; <font color='#009900'>/*! requires - 0 &lt;= r &lt; dims - 0 &lt;= c &lt; dims ensures - Let M denote the matrix for this gate, then this function returns a const reference to M(r,c) !*/</font> qc_scalar_type<font color='#5555FF'>&amp;</font> <b><a name='operator'></a>operator</b><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font face='Lucida Console'>(</font> <font color='#0000FF'><u>long</u></font> r, <font color='#0000FF'><u>long</u></font> c <font face='Lucida Console'>)</font>; <font color='#009900'>/*! requires - 0 &lt;= r &lt; dims - 0 &lt;= c &lt; dims ensures - Let M denote the matrix for this gate, then this function returns a non-const reference to M(r,c) !*/</font> <font color='#0000FF'>template</font> <font color='#5555FF'>&lt;</font><font color='#0000FF'>typename</font> exp<font color='#5555FF'>&gt;</font> qc_scalar_type <b><a name='<API key>'></a><API key></b> <font face='Lucida Console'>(</font> <font color='#0000FF'>const</font> matrix_exp<font color='#5555FF'>&lt;</font>exp<font color='#5555FF'>&gt;</font><font color='#5555FF'>&amp;</font> reg, <font color='#0000FF'><u>long</u></font> row_idx <font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>; <font color='#009900'>/*! requires - reg.nr() == dims - reg.nc() == 1 - 0 &lt;= row_idx &lt; dims ensures - Let M represent the matrix for this gate, then this function returns rowm(M*reg, row_idx) (i.e. returns the row_idx row of what you get when you apply this gate to the given column vector in reg) !*/</font> <font color='#0000FF'>static</font> <font color='#0000FF'>const</font> <font color='#0000FF'><u>long</u></font> num_bits; <font color='#0000FF'>static</font> <font color='#0000FF'>const</font> <font color='#0000FF'><u>long</u></font> dims; <b>}</b>; <font color=' </font> <font color='#0000FF'>template</font> <font color='#5555FF'>&lt;</font><font color='#0000FF'>typename</font> T, <font color='#0000FF'>typename</font> U<font color='#5555FF'>&gt;</font> <font color='#0000FF'>const</font> composite_gate<font color='#5555FF'>&lt;</font>T,U<font color='#5555FF'>&gt;</font> <b><a name='operator'></a>operator</b>, <font face='Lucida Console'>(</font> <font color='#0000FF'>const</font> gate_exp<font color='#5555FF'>&lt;</font>T<font color='#5555FF'>&gt;</font><font color='#5555FF'>&amp;</font> lhs, <font color='#0000FF'>const</font> gate_exp<font color='#5555FF'>&lt;</font>U<font color='#5555FF'>&gt;</font><font color='#5555FF'>&amp;</font> rhs <font face='Lucida Console'>)</font> <b>{</b> <font color='#0000FF'>return</font> composite_gate<font color='#5555FF'>&lt;</font>T,U<font color='#5555FF'>&gt;</font><font face='Lucida Console'>(</font>lhs,rhs<font face='Lucida Console'>)</font>; <b>}</b> <font color='#009900'>/*! ensures - returns a composite_gate that represents the tensor product of the lhs gate with the rhs gate. !*/</font> <font color=' </font> <font color='#0000FF'>namespace</font> quantum_gates <b>{</b> <font color='#0000FF'>inline</font> <font color='#0000FF'>const</font> gate<font color='#5555FF'>&lt;</font><font color='#979000'>1</font><font color='#5555FF'>&gt;</font> <b><a name='hadamard'></a>hadamard</b><font face='Lucida Console'>(</font> <font face='Lucida Console'>)</font>; <font color='#009900'>/*! ensures - returns the Hadamard gate. (i.e. A gate with a matrix of |1, 1| 1/sqrt(2) * |1,-1| ) !*/</font> <font color='#0000FF'>inline</font> <font color='#0000FF'>const</font> gate<font color='#5555FF'>&lt;</font><font color='#979000'>1</font><font color='#5555FF'>&gt;</font> <b><a name='x'></a>x</b><font face='Lucida Console'>(</font> <font face='Lucida Console'>)</font>; <font color='#009900'>/*! ensures - returns the not gate. (i.e. A gate with a matrix of |0, 1| |1, 0| ) !*/</font> <font color='#0000FF'>inline</font> <font color='#0000FF'>const</font> gate<font color='#5555FF'>&lt;</font><font color='#979000'>1</font><font color='#5555FF'>&gt;</font> <b><a name='y'></a>y</b><font face='Lucida Console'>(</font> <font face='Lucida Console'>)</font>; <font color='#009900'>/*! ensures - returns the y gate. (i.e. A gate with a matrix of |0,-i| |i, 0| ) !*/</font> <font color='#0000FF'>inline</font> <font color='#0000FF'>const</font> gate<font color='#5555FF'>&lt;</font><font color='#979000'>1</font><font color='#5555FF'>&gt;</font> <b><a name='z'></a>z</b><font face='Lucida Console'>(</font> <font face='Lucida Console'>)</font>; <font color='#009900'>/*! ensures - returns the z gate. (i.e. A gate with a matrix of |1, 0| |0,-1| ) !*/</font> <font color='#0000FF'>inline</font> <font color='#0000FF'>const</font> gate<font color='#5555FF'>&lt;</font><font color='#979000'>1</font><font color='#5555FF'>&gt;</font> <b><a name='noop'></a>noop</b><font face='Lucida Console'>(</font> <font face='Lucida Console'>)</font>; <font color='#009900'>/*! ensures - returns the no-op or identity gate. (i.e. A gate with a matrix of |1, 0| |0, 1| ) !*/</font> <font color='#0000FF'>template</font> <font color='#5555FF'>&lt;</font> <font color='#0000FF'><u>int</u></font> control_bit, <font color='#0000FF'><u>int</u></font> target_bit <font color='#5555FF'>&gt;</font> <font color='#0000FF'>class</font> <b><a name='cnot'></a>cnot</b> : <font color='#0000FF'>public</font> gate_exp<font color='#5555FF'>&lt;</font>cnot<font color='#5555FF'>&lt;</font>control_bit, target_bit<font color='#5555FF'>&gt;</font> <font color='#5555FF'>&gt;</font> <b>{</b> <font color='#009900'>/*! REQUIREMENTS ON control_bit AND target_bit - control_bit != target_bit WHAT THIS OBJECT REPRESENTS This object represents the controlled-not quantum gate. It is a gate that operates on abs(<API key>)+1 qubits. In terms of the computational basis vectors, this gate maps input vectors to output vectors in the following way: - if (the input vector corresponds to a state where the control_bit qubit is 1) then - this gate outputs the computational basis vector that corresponds to the state where the target_bit has been flipped with respect to the input vector - else - this gate outputs the input vector unmodified !*/</font> <b>}</b>; <font color='#0000FF'>template</font> <font color='#5555FF'>&lt;</font> <font color='#0000FF'><u>int</u></font> control_bit1, <font color='#0000FF'><u>int</u></font> control_bit2, <font color='#0000FF'><u>int</u></font> target_bit <font color='#5555FF'>&gt;</font> <font color='#0000FF'>class</font> <b><a name='toffoli'></a>toffoli</b> : <font color='#0000FF'>public</font> gate_exp<font color='#5555FF'>&lt;</font>toffoli<font color='#5555FF'>&lt;</font>control_bit1, control_bit2, target_bit<font color='#5555FF'>&gt;</font> <font color='#5555FF'>&gt;</font> <b>{</b> <font color='#009900'>/*! REQUIREMENTS ON control_bit1, control_bit2, AND target_bit - all the arguments denote different bits, i.e.: - control_bit1 != target_bit - control_bit2 != target_bit - control_bit1 != control_bit2 - The target bit can't be in-between the control bits, i.e.: - (control_bit1 &lt; target_bit &amp;&amp; control_bit2 &lt; target_bit) || (control_bit1 &gt; target_bit &amp;&amp; control_bit2 &gt; target_bit) WHAT THIS OBJECT REPRESENTS This object represents the toffoli variant of a controlled-not quantum gate. It is a gate that operates on max(abs(<API key>),abs(<API key>))+1 qubits. In terms of the computational basis vectors, this gate maps input vectors to output vectors in the following way: - if (the input vector corresponds to a state where the control_bit1 and control_bit2 qubits are 1) then - this gate outputs the computational basis vector that corresponds to the state where the target_bit has been flipped with respect to the input vector - else - this gate outputs the input vector unmodified !*/</font> <b>}</b>; <font color=' </font> <b>}</b> <font color=' </font> <b>}</b> <font color='#0000FF'>#endif</font> <font color='#009900'>// <API key> </font> </pre></body></html>
package fr.javatronic.blog.massive.annotation1.sub1; import fr.javatronic.blog.processor.Annotation_001; @Annotation_001 public class Class_1435 { }
package org.hibernate.validator.test.internal.engine.<API key>; import static org.hibernate.validator.testutil.<API key>.assertThat; import static org.hibernate.validator.testutil.<API key>.violationOf; import static org.testng.Assert.fail; import java.util.Enumeration; import java.util.Locale; import java.util.ResourceBundle; import java.util.Set; import javax.validation.ConstraintViolation; import javax.validation.MessageInterpolator; import javax.validation.Validator; import javax.validation.ValidatorFactory; import javax.validation.constraints.Max; import org.hibernate.validator.<API key>; import org.hibernate.validator.<API key>.<API key>; import org.hibernate.validator.spi.resourceloading.<API key>; import org.hibernate.validator.testutil.TestForIssue; import org.hibernate.validator.testutils.ValidatorUtil; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; /** * @author Hardy Ferentschik */ @TestForIssue(jiraKey = "HV-798") public class <API key> { private Validator validator; @BeforeTest public void setUp() { MessageInterpolator interpolator = new <API key>( new <API key>() { @Override public ResourceBundle getResourceBundle(Locale locale) { return new ResourceBundle() { @Override protected Object handleGetObject(String key) { if ( "key-1".equals( key ) ) { return "\\{escapedParameterKey\\}"; } else if ( "key-2".equals( key ) ) { // since {} are unbalanced the original key (key-2) should be returned from the interpolation return "{escapedParameterKey\\}"; } else if ( "key-3".equals( key ) ) { // since {} are unbalanced the original key (key-3) should be returned from the interpolation return "\\{escapedParameterKey}"; } else if ( "key-4".equals( key ) ) { return "foo"; } else { fail( "Unexpected key: " + key ); } return null; } @Override public Enumeration<String> getKeys() { throw new <API key>(); } }; } }, false ); <API key> config = ValidatorUtil.getConfiguration(); ValidatorFactory factory = config.messageInterpolator( interpolator ).<API key>(); validator = factory.getValidator(); } @Test public void <API key>() throws Exception { Set<ConstraintViolation<A>> <API key> = validator.validate( new A() ); assertThat( <API key> ).<API key>( violationOf( Max.class ).withMessage( "{escapedParameterKey}" ) ); } @Test public void <API key>() throws Exception { Set<ConstraintViolation<B>> <API key> = validator.validate( new B() ); assertThat( <API key> ).<API key>( violationOf( Max.class ).withMessage( "{key-2}" ) ); } @Test public void <API key>() throws Exception { Set<ConstraintViolation<C>> <API key> = validator.validate( new C() ); assertThat( <API key> ).<API key>( violationOf( Max.class ).withMessage( "{key-3}" ) ); } @Test public void <API key>() throws Exception { Set<ConstraintViolation<D>> <API key> = validator.validate( new D() ); assertThat( <API key> ).<API key>( violationOf( Max.class ).withMessage( "{key-4} {" ) ); } private class A { @Max(value = 1, message = "{key-1}") private int a = 2; } private class B { @Max(value = 1, message = "{key-2}") private int a = 2; } private class C { @Max(value = 1, message = "{key-3}") private int a = 2; } private class D { @Max(value = 1, message = "{key-4} {") private int a = 2; } }
using System; using System.Collections.Generic; using System.Data; using System.Data.Entity; using System.Linq; using System.Web; using System.Web.Mvc; using Cats.Helpers; using Cats.Models; using Cats.Models.PSNP; using Cats.Data; using Cats.Services.Administration; using Cats.Services.PSNP; using Cats.Services.Security; using Cats.Services.Transaction; using Kendo.Mvc.Extensions; using Kendo.Mvc.UI; using Cats.Services.EarlyWarning; using Cats.Services.Common; using Cats.Infrastructure; using log4net; using IAdminUnitService = Cats.Services.EarlyWarning.IAdminUnitService; namespace Cats.Areas.PSNP { public class <API key> : Controller { private int _regionalPsnpId = 0; private readonly <API key> <API key>; private readonly IAdminUnitService _adminUnitService; private readonly IRationService _rationService; private readonly <API key> <API key>; private readonly <API key> <API key>; private readonly <API key> <API key>; private readonly ILog _log; private readonly IPlanService _planService; private readonly IUserAccountService _userAccountService; private readonly Cats.Services.Transaction.ITransactionService _transactionService; private readonly IUserProfileService _userProfileService; public <API key>(<API key> <API key> , IRationService rationServiceParam , IAdminUnitService <API key> , <API key> <API key> , <API key> <API key> , <API key> <API key> , ILog log , IPlanService planService ,IUserAccountService userAccountService, ITransactionService transactionService, IUserProfileService userProfileService) { this.<API key> = <API key>; this._rationService = rationServiceParam; this._adminUnitService = <API key>; this.<API key> = <API key>; this.<API key> = <API key>; this.<API key> = <API key>; this._log = log; this._planService = planService; this._userAccountService = userAccountService; _transactionService = transactionService; this._userProfileService = userProfileService; } public IEnumerable<<API key>> toViewModel(IEnumerable<Cats.Models.RegionalPSNPPlan> list) { var datePref = _userAccountService.GetUserInfo(HttpContext.User.Identity.Name).DatePreference; try { return (from plan in list select new <API key> { RegionalPSNPPlanID = plan.RegionalPSNPPlanID, Duration = plan.Duration, PlanName = plan.Plan.PlanName, Year = plan.Year, // RegionName = plan.Region.Name, RationName = plan.Ration.RefrenceNumber, From = plan.Plan.StartDate.<API key>(datePref), To = plan.Plan.EndDate.<API key>(datePref), StatusName = plan.<API key>.CurrentState.BaseStateTemplate.Name, UserId = plan.User }); } catch (Exception e) { var log = new Logger(); log.<API key>(e,_log); } return new List<<API key>>(); } public void LoadLookups() { ViewBag.RegionID = new SelectList(_adminUnitService.FindBy(t => t.AdminUnitTypeID == 2), "AdminUnitID", "Name"); ViewBag.RationID = new SelectList(_rationService.GetAllRation(), "RationID", "RefrenceNumber"); var psnpPlans = _planService.FindBy(p => p.ProgramID == 2); ViewBag.PlanId = new SelectList(_planService.FindBy(p => p.ProgramID == 2), "PlanID", "PlanName"); } // GET: /PSNP/RegionalPSNPPlan/ public ActionResult Index() { IEnumerable<RegionalPSNPPlan> list = (IEnumerable<Cats.Models.RegionalPSNPPlan>)<API key>.<API key>(); return View(list); } public ActionResult GetListAjax([DataSourceRequest] DataSourceRequest request) { IEnumerable<Cats.Models.RegionalPSNPPlan> list = (IEnumerable<Cats.Models.RegionalPSNPPlan>)<API key>.<API key>().OrderByDescending(m=>m.RegionalPSNPPlanID); return Json(toViewModel(list).ToDataSourceResult(request), JsonRequestBehavior.AllowGet); } public ActionResult Print(int id = 0) { if (id == 0) { RedirectToAction("Index"); } var reportPath = Server.MapPath("~/Report/PSNP/AnnualPlan.rdlc"); var reportData = <API key>.GetAnnualPlanRpt(id); var dataSourceName = "annualplan"; var result = ReportHelper.PrintReport(reportPath, reportData, dataSourceName); return File(result.RenderBytes, result.MimeType); } public ActionResult Details(int id = 0) { RegionalPSNPPlan regionalpsnpplan = <API key>.FindById(id); if (regionalpsnpplan == null) { return HttpNotFound(); } return View(regionalpsnpplan); } public ActionResult Promote(<API key> st) { var isReject = <API key>.<API key>(st); if (isReject) { } <API key>.PromotWorkflow(st); return RedirectToAction("Index"); } public ActionResult promotWorkflow(int id, int nextState) { RegionalPSNPPlan item = <API key>.FindById(id); item.StatusID = nextState; <API key>.<API key>(item); if (item.StatusID == (int) Cats.Models.Constant.PSNPWorkFlow.Completed) PostPSNP(item); return RedirectToAction("Index"); } public void PostPSNP(RegionalPSNPPlan plan) { try { var ration = _rationService.FindBy(r => r.RationID == plan.RationID).FirstOrDefault(); _transactionService.PostPSNPPlan(plan, ration); } catch (Exception ex) { _log.Error("Error in posting psnp:",new Exception(ex.Message)); } } // GET: /PSNP/RegionalPSNPPlan/Create public ActionResult Create() { LoadLookups(); return View(); } // POST: /PSNP/RegionalPSNPPlan/Create [HttpPost] public ActionResult Create(RegionalPSNPPlan regionalpsnpplan) { var planName = regionalpsnpplan.Plan.PlanName; var startDate = regionalpsnpplan.Plan.StartDate; var firstDayOfTheMonth = startDate.AddDays(1 - startDate.Day); var endDate = firstDayOfTheMonth.AddMonths(regionalpsnpplan.Duration).AddDays(-1); UserProfile user = _userProfileService.GetUser(User.Identity.Name); if (ModelState.IsValid) { <API key>.AddPsnpPlan(planName, firstDayOfTheMonth, endDate); var plan = _planService.Get(m => m.PlanName == planName,null,"Program").FirstOrDefault(); regionalpsnpplan.Plan = plan; //check if this psnp plan exitsts for this year and Plan var exists = plan != null && <API key>.<API key>(plan.PlanID, regionalpsnpplan.Year); if (!exists) { int BP_PSNP = <API key>.getPSNPWorkflow(); if (BP_PSNP != 0) { <API key> createdstate = new <API key> { DatePerformed = DateTime.Now, PerformedBy = "System", Comment = "Created workflow for PSNP Plan" }; var psnpPlan= <API key>.CreatePsnpPlan(regionalpsnpplan.Year,regionalpsnpplan.Duration,regionalpsnpplan.RationID,regionalpsnpplan.StatusID,plan.PlanID,user.UserProfileID); //_planService.ChangePlanStatus(regionalpsnpplan.PlanId); BusinessProcess bp = <API key>.<API key>(BP_PSNP, regionalpsnpplan. RegionalPSNPPlanID, "PSNP", createdstate); psnpPlan.StatusID = bp.BusinessProcessID; <API key>.<API key>(psnpPlan); return RedirectToAction("Index"); } ViewBag.ErrorMessage1 = "The workflow assosiated with PSNP planning doesnot exist."; ViewBag.ErrorMessage2 = "Please make sure the workflow is created and configured."; } LoadLookups(); ModelState.AddModelError("Errors", @"PSNP plan already made for this period and plan Name."); return View(regionalpsnpplan); } LoadLookups(); return View(regionalpsnpplan); } // GET: /PSNP/RegionalPSNPPlan/Edit/5 public ActionResult Edit(int id = 0) { LoadLookups(); RegionalPSNPPlan regionalpsnpplan = <API key>.FindById(id); if (regionalpsnpplan == null) { return HttpNotFound(); } return View(regionalpsnpplan); } [HttpPost] public ActionResult Edit(RegionalPSNPPlan regionalpsnpplan) { if (ModelState.IsValid) { <API key>.<API key>(regionalpsnpplan); return RedirectToAction("Index"); } LoadLookups(); return View(regionalpsnpplan); } // GET: /PSNP/RegionalPSNPPlan/Delete/5 public ActionResult Delete(int id = 0) { RegionalPSNPPlan regionalpsnpplan = <API key>.FindById(id); if (regionalpsnpplan == null) { return HttpNotFound(); } return View(regionalpsnpplan); } // POST: /PSNP/RegionalPSNPPlan/Delete/5 [HttpPost, ActionName("Delete")] public ActionResult DeleteConfirmed(int id) { <API key>.DeleteById(id); return RedirectToAction("Index"); } protected override void Dispose(bool disposing) { base.Dispose(disposing); } } }
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_80) on Thu Jun 18 14:08:33 EDT 2015 --> <title>UpdateStatement (apache-cassandra API)</title> <meta name="date" content="2015-06-18"> <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="UpdateStatement (apache-cassandra API)"; } </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="topNav"><a name="navbar_top"> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/UpdateStatement.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/apache/cassandra/cql/Term.html" title="class in org.apache.cassandra.cql"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../org/apache/cassandra/cql/WhereClause.html" title="class in org.apache.cassandra.cql"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/apache/cassandra/cql/UpdateStatement.html" target="_top">Frames</a></li> <li><a href="UpdateStatement.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#<API key>.apache.cassandra.cql.<API key>">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>Field&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">org.apache.cassandra.cql</div> <h2 title="Class UpdateStatement" class="title">Class UpdateStatement</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li><a href="../../../../org/apache/cassandra/cql/<API key>.html" title="class in org.apache.cassandra.cql">org.apache.cassandra.cql.<API key></a></li> <li> <ul class="inheritance"> <li>org.apache.cassandra.cql.UpdateStatement</li> </ul> </li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>public class <span class="strong">UpdateStatement</span> extends <a href="../../../../org/apache/cassandra/cql/<API key>.html" title="class in org.apache.cassandra.cql"><API key></a></pre> <div class="block">An <code>UPDATE</code> statement parsed from a CQL query statement.</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="field_summary"> </a> <h3>Field Summary</h3> <ul class="blockList"> <li class="blockList"><a name="<API key>.apache.cassandra.cql.<API key>"> </a> <h3>Fields inherited from class&nbsp;org.apache.cassandra.cql.<a href="../../../../org/apache/cassandra/cql/<API key>.html" title="class in org.apache.cassandra.cql"><API key></a></h3> <code><a href="../../../../org/apache/cassandra/cql/<API key>.html#cLevel">cLevel</a>, <a href="../../../../org/apache/cassandra/cql/<API key>.html#columnFamily">columnFamily</a>, <a href="../../../../org/apache/cassandra/cql/<API key>.html#defaultConsistency">defaultConsistency</a>, <a href="../../../../org/apache/cassandra/cql/<API key>.html#keyName">keyName</a>, <a href="../../../../org/apache/cassandra/cql/<API key>.html#keyspace">keyspace</a>, <a href="../../../../org/apache/cassandra/cql/<API key>.html#timestamp">timestamp</a>, <a href="../../../../org/apache/cassandra/cql/<API key>.html#timeToLive">timeToLive</a></code></li> </ul> </li> </ul> <ul class="blockList"> <li class="blockList"><a name="constructor_summary"> </a> <h3>Constructor Summary</h3> <table class="overviewSummary" 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><strong><a href="../../../../org/apache/cassandra/cql/UpdateStatement.html#UpdateStatement(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.util.List,%20java.util.List,%20java.util.List,%20org.apache.cassandra.cql.Attributes)">UpdateStatement</a></strong>(java.lang.String&nbsp;keyspace, java.lang.String&nbsp;columnFamily, java.lang.String&nbsp;keyName, java.util.List&lt;<a href="../../../../org/apache/cassandra/cql/Term.html" title="class in org.apache.cassandra.cql">Term</a>&gt;&nbsp;columnNames, java.util.List&lt;<a href="../../../../org/apache/cassandra/cql/Term.html" title="class in org.apache.cassandra.cql">Term</a>&gt;&nbsp;columnValues, java.util.List&lt;<a href="../../../../org/apache/cassandra/cql/Term.html" title="class in org.apache.cassandra.cql">Term</a>&gt;&nbsp;keys, <a href="../../../../org/apache/cassandra/cql/Attributes.html" title="class in org.apache.cassandra.cql">Attributes</a>&nbsp;attrs)</code> <div class="block">Creates a new UpdateStatement from a column family name, a consistency level, key, and lists of column names and values.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><code><strong><a href="../../../../org/apache/cassandra/cql/UpdateStatement.html#UpdateStatement(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.util.Map,%20java.util.List,%20org.apache.cassandra.cql.Attributes)">UpdateStatement</a></strong>(java.lang.String&nbsp;keyspace, java.lang.String&nbsp;columnFamily, java.lang.String&nbsp;keyName, java.util.Map&lt;<a href="../../../../org/apache/cassandra/cql/Term.html" title="class in org.apache.cassandra.cql">Term</a>,<a href="../../../../org/apache/cassandra/cql/Operation.html" title="class in org.apache.cassandra.cql">Operation</a>&gt;&nbsp;columns, java.util.List&lt;<a href="../../../../org/apache/cassandra/cql/Term.html" title="class in org.apache.cassandra.cql">Term</a>&gt;&nbsp;keys, <a href="../../../../org/apache/cassandra/cql/Attributes.html" title="class in org.apache.cassandra.cql">Attributes</a>&nbsp;attrs)</code> <div class="block">Creates a new UpdateStatement from a column family name, columns map, consistency level, and key term.</div> </td> </tr> </table> </li> </ul> <ul class="blockList"> <li class="blockList"><a name="method_summary"> </a> <h3>Method Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/cql/UpdateStatement.html#getColumnFamily()">getColumnFamily</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>java.util.List&lt;<a href="../../../../org/apache/cassandra/cql/Term.html" title="class in org.apache.cassandra.cql">Term</a>&gt;</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/cql/UpdateStatement.html#getColumnNames()">getColumnNames</a></strong>()</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>java.util.Map&lt;<a href="../../../../org/apache/cassandra/cql/Term.html" title="class in org.apache.cassandra.cql">Term</a>,<a href="../../../../org/apache/cassandra/cql/Operation.html" title="class in org.apache.cassandra.cql">Operation</a>&gt;</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/cql/UpdateStatement.html#getColumns()">getColumns</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>java.util.List&lt;<a href="../../../../org/apache/cassandra/cql/Term.html" title="class in org.apache.cassandra.cql">Term</a>&gt;</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/cql/UpdateStatement.html#getColumnValues()">getColumnValues</a></strong>()</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../org/apache/cassandra/db/marshal/AbstractType.html" title="class in org.apache.cassandra.db.marshal">AbstractType</a>&lt;?&gt;</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/cql/UpdateStatement.html#getComparator(java.lang.String)">getComparator</a></strong>(java.lang.String&nbsp;keyspace)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../org/apache/cassandra/db/ConsistencyLevel.html" title="enum in org.apache.cassandra.db">ConsistencyLevel</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/cql/UpdateStatement.html#getConsistencyLevel()">getConsistencyLevel</a></strong>()</code> <div class="block">Returns the consistency level of this <code>UPDATE</code> statement, either one parsed from the CQL statement, or the default level otherwise.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>java.util.List&lt;<a href="../../../../org/apache/cassandra/cql/Term.html" title="class in org.apache.cassandra.cql">Term</a>&gt;</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/cql/UpdateStatement.html#getKeys()">getKeys</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../org/apache/cassandra/db/marshal/AbstractType.html" title="class in org.apache.cassandra.db.marshal">AbstractType</a>&lt;?&gt;</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/cql/UpdateStatement.html#getKeyType(java.lang.String)">getKeyType</a></strong>(java.lang.String&nbsp;keyspace)</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/cql/UpdateStatement.html#<API key>()"><API key></a></strong>()</code> <div class="block">True if an explicit consistency level was parsed from the statement.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>java.util.List&lt;<a href="../../../../org/apache/cassandra/db/IMutation.html" title="interface in org.apache.cassandra.db">IMutation</a>&gt;</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/cql/UpdateStatement.html#prepareRowMutations(java.lang.String,%20org.apache.cassandra.thrift.ThriftClientState,%20java.util.List)">prepareRowMutations</a></strong>(java.lang.String&nbsp;keyspace, <a href="../../../../org/apache/cassandra/thrift/ThriftClientState.html" title="class in org.apache.cassandra.thrift">ThriftClientState</a>&nbsp;clientState, java.util.List&lt;java.nio.ByteBuffer&gt;&nbsp;variables)</code> <div class="block">Convert statement into a list of mutations to apply on the server</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>java.util.List&lt;<a href="../../../../org/apache/cassandra/db/IMutation.html" title="interface in org.apache.cassandra.db">IMutation</a>&gt;</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/cql/UpdateStatement.html#prepareRowMutations(java.lang.String,%20org.apache.cassandra.thrift.ThriftClientState,%20java.lang.Long,%20java.util.List)">prepareRowMutations</a></strong>(java.lang.String&nbsp;keyspace, <a href="../../../../org/apache/cassandra/thrift/ThriftClientState.html" title="class in org.apache.cassandra.thrift">ThriftClientState</a>&nbsp;clientState, java.lang.Long&nbsp;timestamp, java.util.List&lt;java.nio.ByteBuffer&gt;&nbsp;variables)</code> <div class="block">Convert statement into a list of mutations to apply on the server</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/cql/UpdateStatement.html#toString()">toString</a></strong>()</code>&nbsp;</td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="<API key>.apache.cassandra.cql.<API key>"> </a> <h3>Methods inherited from class&nbsp;org.apache.cassandra.cql.<a href="../../../../org/apache/cassandra/cql/<API key>.html" title="class in org.apache.cassandra.cql"><API key></a></h3> <code><a href="../../../../org/apache/cassandra/cql/<API key>.html#getKeyName()">getKeyName</a>, <a href="../../../../org/apache/cassandra/cql/<API key>.html#getKeyspace()">getKeyspace</a>, <a href="../../../../org/apache/cassandra/cql/<API key>.html#getTimestamp(org.apache.cassandra.thrift.ThriftClientState)">getTimestamp</a>, <a href="../../../../org/apache/cassandra/cql/<API key>.html#getTimeToLive()">getTimeToLive</a>, <a href="../../../../org/apache/cassandra/cql/<API key>.html#isSetTimestamp()">isSetTimestamp</a></code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="<API key>.lang.Object"> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="constructor_detail"> </a> <h3>Constructor Detail</h3> <a name="UpdateStatement(java.lang.String, java.lang.String, java.lang.String, java.util.Map, java.util.List, org.apache.cassandra.cql.Attributes)"> </a> <ul class="blockList"> <li class="blockList"> <h4>UpdateStatement</h4> <pre>public&nbsp;UpdateStatement(java.lang.String&nbsp;keyspace, java.lang.String&nbsp;columnFamily, java.lang.String&nbsp;keyName, java.util.Map&lt;<a href="../../../../org/apache/cassandra/cql/Term.html" title="class in org.apache.cassandra.cql">Term</a>,<a href="../../../../org/apache/cassandra/cql/Operation.html" title="class in org.apache.cassandra.cql">Operation</a>&gt;&nbsp;columns, java.util.List&lt;<a href="../../../../org/apache/cassandra/cql/Term.html" title="class in org.apache.cassandra.cql">Term</a>&gt;&nbsp;keys, <a href="../../../../org/apache/cassandra/cql/Attributes.html" title="class in org.apache.cassandra.cql">Attributes</a>&nbsp;attrs)</pre> <div class="block">Creates a new UpdateStatement from a column family name, columns map, consistency level, and key term.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>keyspace</code> - Keyspace (optional)</dd><dd><code>columnFamily</code> - column family name</dd><dd><code>keyName</code> - alias key name</dd><dd><code>columns</code> - a map of column name/values pairs</dd><dd><code>keys</code> - the keys to update</dd><dd><code>attrs</code> - additional attributes for statement (CL, timestamp, timeToLive)</dd></dl> </li> </ul> <a name="UpdateStatement(java.lang.String, java.lang.String, java.lang.String, java.util.List, java.util.List, java.util.List, org.apache.cassandra.cql.Attributes)"> </a> <ul class="blockListLast"> <li class="blockList"> <h4>UpdateStatement</h4> <pre>public&nbsp;UpdateStatement(java.lang.String&nbsp;keyspace, java.lang.String&nbsp;columnFamily, java.lang.String&nbsp;keyName, java.util.List&lt;<a href="../../../../org/apache/cassandra/cql/Term.html" title="class in org.apache.cassandra.cql">Term</a>&gt;&nbsp;columnNames, java.util.List&lt;<a href="../../../../org/apache/cassandra/cql/Term.html" title="class in org.apache.cassandra.cql">Term</a>&gt;&nbsp;columnValues, java.util.List&lt;<a href="../../../../org/apache/cassandra/cql/Term.html" title="class in org.apache.cassandra.cql">Term</a>&gt;&nbsp;keys, <a href="../../../../org/apache/cassandra/cql/Attributes.html" title="class in org.apache.cassandra.cql">Attributes</a>&nbsp;attrs)</pre> <div class="block">Creates a new UpdateStatement from a column family name, a consistency level, key, and lists of column names and values. It is intended for use with the alternate update format, <code>INSERT</code>.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>keyspace</code> - Keyspace (optional)</dd><dd><code>columnFamily</code> - column family name</dd><dd><code>keyName</code> - alias key name</dd><dd><code>columnNames</code> - list of column names</dd><dd><code>columnValues</code> - list of column values (corresponds to names)</dd><dd><code>keys</code> - the keys to update</dd><dd><code>attrs</code> - additional attributes for statement (CL, timestamp, timeToLive)</dd></dl> </li> </ul> </li> </ul> <ul class="blockList"> <li class="blockList"><a name="method_detail"> </a> <h3>Method Detail</h3> <a name="getConsistencyLevel()"> </a> <ul class="blockList"> <li class="blockList"> <h4>getConsistencyLevel</h4> <pre>public&nbsp;<a href="../../../../org/apache/cassandra/db/ConsistencyLevel.html" title="enum in org.apache.cassandra.db">ConsistencyLevel</a>&nbsp;getConsistencyLevel()</pre> <div class="block">Returns the consistency level of this <code>UPDATE</code> statement, either one parsed from the CQL statement, or the default level otherwise.</div> <dl> <dt><strong>Overrides:</strong></dt> <dd><code><a href="../../../../org/apache/cassandra/cql/<API key>.html#getConsistencyLevel()">getConsistencyLevel</a></code>&nbsp;in class&nbsp;<code><a href="../../../../org/apache/cassandra/cql/<API key>.html" title="class in org.apache.cassandra.cql"><API key></a></code></dd> <dt><span class="strong">Returns:</span></dt><dd>the consistency level as a Thrift enum.</dd></dl> </li> </ul> <a name="<API key>()"> </a> <ul class="blockList"> <li class="blockList"> <h4><API key></h4> <pre>public&nbsp;boolean&nbsp;<API key>()</pre> <div class="block">True if an explicit consistency level was parsed from the statement.</div> <dl> <dt><strong>Overrides:</strong></dt> <dd><code><a href="../../../../org/apache/cassandra/cql/<API key>.html#<API key>()"><API key></a></code>&nbsp;in class&nbsp;<code><a href="../../../../org/apache/cassandra/cql/<API key>.html" title="class in org.apache.cassandra.cql"><API key></a></code></dd> <dt><span class="strong">Returns:</span></dt><dd>true if a consistency was parsed, false otherwise.</dd></dl> </li> </ul> <a name="prepareRowMutations(java.lang.String, org.apache.cassandra.thrift.ThriftClientState, java.util.List)"> </a> <ul class="blockList"> <li class="blockList"> <h4>prepareRowMutations</h4> <pre>public&nbsp;java.util.List&lt;<a href="../../../../org/apache/cassandra/db/IMutation.html" title="interface in org.apache.cassandra.db">IMutation</a>&gt;&nbsp;prepareRowMutations(java.lang.String&nbsp;keyspace, <a href="../../../../org/apache/cassandra/thrift/ThriftClientState.html" title="class in org.apache.cassandra.thrift">ThriftClientState</a>&nbsp;clientState, java.util.List&lt;java.nio.ByteBuffer&gt;&nbsp;variables) throws <a href="../../../../org/apache/cassandra/exceptions/<API key>.html" title="class in org.apache.cassandra.exceptions"><API key></a>, <a href="../../../../org/apache/cassandra/exceptions/<API key>.html" title="class in org.apache.cassandra.exceptions"><API key></a></pre> <div class="block">Convert statement into a list of mutations to apply on the server</div> <dl> <dt><strong>Specified by:</strong></dt> <dd><code><a href="../../../../org/apache/cassandra/cql/<API key>.html#prepareRowMutations(java.lang.String,%20org.apache.cassandra.thrift.ThriftClientState,%20java.util.List)">prepareRowMutations</a></code>&nbsp;in class&nbsp;<code><a href="../../../../org/apache/cassandra/cql/<API key>.html" title="class in org.apache.cassandra.cql"><API key></a></code></dd> <dt><span class="strong">Parameters:</span></dt><dd><code>keyspace</code> - The working keyspace</dd><dd><code>clientState</code> - current client status</dd> <dt><span class="strong">Returns:</span></dt><dd>list of the mutations</dd> <dt><span class="strong">Throws:</span></dt> <dd><code><a href="../../../../org/apache/cassandra/exceptions/<API key>.html" title="class in org.apache.cassandra.exceptions"><API key></a></code> - on the wrong request</dd> <dd><code><a href="../../../../org/apache/cassandra/exceptions/<API key>.html" title="class in org.apache.cassandra.exceptions"><API key></a></code></dd></dl> </li> </ul> <a name="prepareRowMutations(java.lang.String, org.apache.cassandra.thrift.ThriftClientState, java.lang.Long, java.util.List)"> </a> <ul class="blockList"> <li class="blockList"> <h4>prepareRowMutations</h4> <pre>public&nbsp;java.util.List&lt;<a href="../../../../org/apache/cassandra/db/IMutation.html" title="interface in org.apache.cassandra.db">IMutation</a>&gt;&nbsp;prepareRowMutations(java.lang.String&nbsp;keyspace, <a href="../../../../org/apache/cassandra/thrift/ThriftClientState.html" title="class in org.apache.cassandra.thrift">ThriftClientState</a>&nbsp;clientState, java.lang.Long&nbsp;timestamp, java.util.List&lt;java.nio.ByteBuffer&gt;&nbsp;variables) throws <a href="../../../../org/apache/cassandra/exceptions/<API key>.html" title="class in org.apache.cassandra.exceptions"><API key></a>, <a href="../../../../org/apache/cassandra/exceptions/<API key>.html" title="class in org.apache.cassandra.exceptions"><API key></a></pre> <div class="block">Convert statement into a list of mutations to apply on the server</div> <dl> <dt><strong>Specified by:</strong></dt> <dd><code><a href="../../../../org/apache/cassandra/cql/<API key>.html#prepareRowMutations(java.lang.String,%20org.apache.cassandra.thrift.ThriftClientState,%20java.lang.Long,%20java.util.List)">prepareRowMutations</a></code>&nbsp;in class&nbsp;<code><a href="../../../../org/apache/cassandra/cql/<API key>.html" title="class in org.apache.cassandra.cql"><API key></a></code></dd> <dt><span class="strong">Parameters:</span></dt><dd><code>keyspace</code> - The working keyspace</dd><dd><code>clientState</code> - current client status</dd><dd><code>timestamp</code> - global timestamp to use for all mutations</dd> <dt><span class="strong">Returns:</span></dt><dd>list of the mutations</dd> <dt><span class="strong">Throws:</span></dt> <dd><code><a href="../../../../org/apache/cassandra/exceptions/<API key>.html" title="class in org.apache.cassandra.exceptions"><API key></a></code> - on the wrong request</dd> <dd><code><a href="../../../../org/apache/cassandra/exceptions/<API key>.html" title="class in org.apache.cassandra.exceptions"><API key></a></code></dd></dl> </li> </ul> <a name="getColumnFamily()"> </a> <ul class="blockList"> <li class="blockList"> <h4>getColumnFamily</h4> <pre>public&nbsp;java.lang.String&nbsp;getColumnFamily()</pre> <dl> <dt><strong>Overrides:</strong></dt> <dd><code><a href="../../../../org/apache/cassandra/cql/<API key>.html#getColumnFamily()">getColumnFamily</a></code>&nbsp;in class&nbsp;<code><a href="../../../../org/apache/cassandra/cql/<API key>.html" title="class in org.apache.cassandra.cql"><API key></a></code></dd> </dl> </li> </ul> <a name="getKeys()"> </a> <ul class="blockList"> <li class="blockList"> <h4>getKeys</h4> <pre>public&nbsp;java.util.List&lt;<a href="../../../../org/apache/cassandra/cql/Term.html" title="class in org.apache.cassandra.cql">Term</a>&gt;&nbsp;getKeys()</pre> </li> </ul> <a name="getColumns()"> </a> <ul class="blockList"> <li class="blockList"> <h4>getColumns</h4> <pre>public&nbsp;java.util.Map&lt;<a href="../../../../org/apache/cassandra/cql/Term.html" title="class in org.apache.cassandra.cql">Term</a>,<a href="../../../../org/apache/cassandra/cql/Operation.html" title="class in org.apache.cassandra.cql">Operation</a>&gt;&nbsp;getColumns() throws <a href="../../../../org/apache/cassandra/exceptions/<API key>.html" title="class in org.apache.cassandra.exceptions"><API key></a></pre> <dl><dt><span class="strong">Throws:</span></dt> <dd><code><a href="../../../../org/apache/cassandra/exceptions/<API key>.html" title="class in org.apache.cassandra.exceptions"><API key></a></code></dd></dl> </li> </ul> <a name="toString()"> </a> <ul class="blockList"> <li class="blockList"> <h4>toString</h4> <pre>public&nbsp;java.lang.String&nbsp;toString()</pre> <dl> <dt><strong>Overrides:</strong></dt> <dd><code>toString</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd> </dl> </li> </ul> <a name="getKeyType(java.lang.String)"> </a> <ul class="blockList"> <li class="blockList"> <h4>getKeyType</h4> <pre>public&nbsp;<a href="../../../../org/apache/cassandra/db/marshal/AbstractType.html" title="class in org.apache.cassandra.db.marshal">AbstractType</a>&lt;?&gt;&nbsp;getKeyType(java.lang.String&nbsp;keyspace)</pre> </li> </ul> <a name="getComparator(java.lang.String)"> </a> <ul class="blockList"> <li class="blockList"> <h4>getComparator</h4> <pre>public&nbsp;<a href="../../../../org/apache/cassandra/db/marshal/AbstractType.html" title="class in org.apache.cassandra.db.marshal">AbstractType</a>&lt;?&gt;&nbsp;getComparator(java.lang.String&nbsp;keyspace)</pre> </li> </ul> <a name="getColumnNames()"> </a> <ul class="blockList"> <li class="blockList"> <h4>getColumnNames</h4> <pre>public&nbsp;java.util.List&lt;<a href="../../../../org/apache/cassandra/cql/Term.html" title="class in org.apache.cassandra.cql">Term</a>&gt;&nbsp;getColumnNames()</pre> </li> </ul> <a name="getColumnValues()"> </a> <ul class="blockListLast"> <li class="blockList"> <h4>getColumnValues</h4> <pre>public&nbsp;java.util.List&lt;<a href="../../../../org/apache/cassandra/cql/Term.html" title="class in org.apache.cassandra.cql">Term</a>&gt;&nbsp;getColumnValues()</pre> </li> </ul> </li> </ul> </li> </ul> </div> </div> <div class="bottomNav"><a name="navbar_bottom"> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="<API key>"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/UpdateStatement.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/apache/cassandra/cql/Term.html" title="class in org.apache.cassandra.cql"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../org/apache/cassandra/cql/WhereClause.html" title="class in org.apache.cassandra.cql"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/apache/cassandra/cql/UpdateStatement.html" target="_top">Frames</a></li> <li><a href="UpdateStatement.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#<API key>.apache.cassandra.cql.<API key>">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>Field&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> <p class="legalCopy"><small>Copyright &copy; 2015 The Apache Software Foundation</small></p> </body> </html>
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Gtk; namespace SailorsTab.Common { public class UIHelper { public static void ShowErrorDialog(Gtk.Widget parent, string message, params object[] parameters) { MessageDialog messagedialog1 = new MessageDialog(findParentWindow(parent), (DialogFlags)3, MessageType.Error, ButtonsType.Ok, message, parameters); messagedialog1.Run(); messagedialog1.Destroy(); } public static int ShowInfoDialog(Gtk.Widget parent, string message, params object[] parameters) { MessageDialog messagedialog1 = new MessageDialog(findParentWindow(parent), (DialogFlags)3, MessageType.Question, ButtonsType.YesNo, false, message, parameters); int num1 = messagedialog1.Run(); messagedialog1.Destroy(); return num1; } private static Window findParentWindow(Gtk.Widget parent) { Window window = null; do { if (parent is Window) { window = (Window)parent; } else { parent = parent.Parent; } } while (window == null); return window; } } }
using FluentAssertions; using Nest.Tests.MockData.Domain; using NUnit.Framework; namespace Nest.Tests.Integration.Template { [TestFixture] public class TemplateTests : IntegrationTests { [Test] public void SimplePutAndGet() { this.Client.DeleteTemplate("<API key>"); var putResponse = this.Client.PutTemplate("<API key>", t => t .Template("<API key>-*") .Order(42) ); Assert.IsTrue(putResponse.Acknowledged); var templateResponse = this.Client.GetTemplate("<API key>"); templateResponse.Should().NotBeNull(); templateResponse.IsValid.Should().BeTrue(); templateResponse.TemplateMapping.Should().NotBeNull(); templateResponse.TemplateMapping.Mappings.Should().NotBeNull(); var settings = templateResponse.TemplateMapping.Settings; templateResponse.TemplateMapping.Order.Should().Be(42); settings.Should().NotBeNull(); } [Test] public void <API key>() { this.Client.DeleteTemplate("<API key>"); var putResponse = this.Client.PutTemplate("<API key>", t=>t .Template("<API key>-*") .Settings(s=>s .Add("index.number_of_shards", 3) .Add("index.number_of_replicas", 2) ) ); Assert.IsTrue(putResponse.Acknowledged); var templateResponse = this.Client.GetTemplate("<API key>"); templateResponse.Should().NotBeNull(); templateResponse.IsValid.Should().BeTrue(); templateResponse.TemplateMapping.Should().NotBeNull(); templateResponse.TemplateMapping.Mappings.Should().NotBeNull(); var settings = templateResponse.TemplateMapping.Settings; settings.Should().NotBeNull(); Assert.AreEqual("3", settings["index.number_of_shards"]); Assert.AreEqual("2", settings["index.number_of_replicas"]); } [Test] public void <API key>() { this.Client.DeleteTemplate("<API key>"); var putResponse = this.Client.PutTemplate("<API key>",t => t .Template("<API key>") .AddMapping<<API key>>(s=>s .AllField(a=>a.Enabled(false)) ) ); Assert.IsTrue(putResponse.Acknowledged); var templateResponse = this.Client.GetTemplate("<API key>"); templateResponse.Should().NotBeNull(); templateResponse.IsValid.Should().BeTrue(); templateResponse.TemplateMapping.Should().NotBeNull(); templateResponse.TemplateMapping.Mappings.Should().NotBeNull().And.NotBeEmpty(); var mappings = templateResponse.TemplateMapping.Mappings; Assert.IsTrue(mappings.ContainsKey("<API key>"), "<API key> template should have a `mytype` mapping"); Assert.NotNull(mappings["<API key>"].AllFieldMapping, "`mytype` mapping should contain the _all field mapping"); Assert.AreEqual(false, mappings["<API key>"].AllFieldMapping.Enabled, "_all { enabled } should be set to false"); } [Test] public void <API key>() { this.Client.DeleteTemplate("<API key>"); var putResponse = this.Client.PutTemplate("<API key>", t => t .Template("<API key>") .AddWarmer<<API key>>(w => w .WarmerName("matchall") .Type("<API key>") .Search(s=>s .MatchAll() ) ) ); Assert.IsTrue(putResponse.Acknowledged); var templateResponse = this.Client.GetTemplate("<API key>"); templateResponse.Should().NotBeNull(); templateResponse.IsValid.Should().BeTrue(); templateResponse.TemplateMapping.Should().NotBeNull(); //templateResponse.TemplateMapping.Warmers.Should().NotBeNull().And.NotBeEmpty(); } } }
package org.eclipse.jetty.spdy.parser; import java.io.<API key>; import java.nio.ByteBuffer; import java.security.cert.Certificate; import java.security.cert.<API key>; import java.security.cert.CertificateFactory; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.eclipse.jetty.spdy.SessionException; import org.eclipse.jetty.spdy.api.SessionStatus; import org.eclipse.jetty.spdy.frames.ControlFrameType; import org.eclipse.jetty.spdy.frames.CredentialFrame; public class <API key> extends <API key> { private final List<Certificate> certificates = new ArrayList<>(); private final ControlFrameParser controlFrameParser; private State state = State.SLOT; private int totalLength; private int cursor; private short slot; private int proofLength; private byte[] proof; private int certificateLength; private byte[] certificate; public <API key>(ControlFrameParser controlFrameParser) { this.controlFrameParser = controlFrameParser; } @Override public boolean parse(ByteBuffer buffer) { while (buffer.hasRemaining()) { switch (state) { case SLOT: { if (buffer.remaining() >= 2) { slot = buffer.getShort(); checkSlotValid(); state = State.PROOF_LENGTH; } else { state = State.SLOT_BYTES; cursor = 2; } break; } case SLOT_BYTES: { byte currByte = buffer.get(); --cursor; slot += (currByte & 0xFF) << 8 * cursor; if (cursor == 0) { checkSlotValid(); state = State.PROOF_LENGTH; } break; } case PROOF_LENGTH: { if (buffer.remaining() >= 4) { proofLength = buffer.getInt() & 0x7F_FF_FF_FF; state = State.PROOF; } else { state = State.PROOF_LENGTH_BYTES; cursor = 4; } break; } case PROOF_LENGTH_BYTES: { byte currByte = buffer.get(); --cursor; proofLength += (currByte & 0xFF) << 8 * cursor; if (cursor == 0) { proofLength &= 0x7F_FF_FF_FF; state = State.PROOF; } break; } case PROOF: { totalLength = controlFrameParser.getLength() - 2 - 4 - proofLength; proof = new byte[proofLength]; if (buffer.remaining() >= proofLength) { buffer.get(proof); state = State.CERTIFICATE_LENGTH; if (totalLength == 0) { onCredential(); return true; } } else { state = State.PROOF_BYTES; cursor = proofLength; } break; } case PROOF_BYTES: { proof[proofLength - cursor] = buffer.get(); --cursor; if (cursor == 0) { state = State.CERTIFICATE_LENGTH; if (totalLength == 0) { onCredential(); return true; } } break; } case CERTIFICATE_LENGTH: { if (buffer.remaining() >= 4) { certificateLength = buffer.getInt() & 0x7F_FF_FF_FF; state = State.CERTIFICATE; } else { state = State.<API key>; cursor = 4; } break; } case <API key>: { byte currByte = buffer.get(); --cursor; certificateLength += (currByte & 0xFF) << 8 * cursor; if (cursor == 0) { certificateLength &= 0x7F_FF_FF_FF; state = State.CERTIFICATE; } break; } case CERTIFICATE: { totalLength -= 4 + certificateLength; certificate = new byte[certificateLength]; if (buffer.remaining() >= certificateLength) { buffer.get(certificate); if (onCertificate()) return true; } else { state = State.CERTIFICATE_BYTES; cursor = certificateLength; } break; } case CERTIFICATE_BYTES: { certificate[certificateLength - cursor] = buffer.get(); --cursor; if (cursor == 0) { if (onCertificate()) return true; } break; } default: { throw new <API key>(); } } } return false; } private void checkSlotValid() { if (slot <= 0) throw new SessionException(SessionStatus.PROTOCOL_ERROR, "Invalid slot " + slot + " for " + ControlFrameType.CREDENTIAL + " frame"); } private boolean onCertificate() { certificates.add(<API key>(certificate)); if (totalLength == 0) { onCredential(); return true; } else { certificateLength = 0; state = State.CERTIFICATE_LENGTH; } return false; } private Certificate <API key>(byte[] bytes) { try { CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); return certificateFactory.generateCertificate(new <API key>(bytes)); } catch (<API key> x) { throw new SessionException(SessionStatus.PROTOCOL_ERROR, x); } } private void onCredential() { CredentialFrame frame = new CredentialFrame(controlFrameParser.getVersion(), slot, Arrays.copyOf(proof, proof.length), certificates.toArray(new Certificate[certificates.size()])); controlFrameParser.onControlFrame(frame); reset(); } private void reset() { state = State.SLOT; totalLength = 0; cursor = 0; slot = 0; proofLength = 0; proof = null; certificateLength = 0; certificate = null; certificates.clear(); } public enum State { SLOT, SLOT_BYTES, PROOF_LENGTH, PROOF_LENGTH_BYTES, PROOF, PROOF_BYTES, CERTIFICATE_LENGTH, <API key>, CERTIFICATE, CERTIFICATE_BYTES } }
package com.ctrip.xpipe.redis.core.protocal; /** * @author wenchao.meng * * 2016324 6:27:48 */ public interface RedisProtocol { int REDIS_PORT_DEFAULT = 6379; int KEEPER_PORT_DEFAULT = 6380; int RUN_ID_LENGTH = 40; String CRLF = "\r\n"; String OK = "OK"; String KEEPER_ROLE_PREFIX = "keeperrole"; static String booleanToString(boolean yes){ if(yes){ return "yes"; } return "no"; } }
<? namespace CodeCraft; use CodeCraft\Helpers\LanguageLink; class SiteRouter { private $language = []; private $defaultLanguage = 'ru'; private $languageUrlMap = []; private $languageList = ['ru' => ['ru', 'be', 'uk', 'ky', 'ab', 'mo', 'et', 'lv'], 'en' => 'en']; /** * @param array $languageUrlMap - ['language' => 'url', ..., 'default' => 'url'] */ public function __construct($languageUrlMap) { $this->setLanguageUrlMap($languageUrlMap); if (($list = strtolower($_SERVER['<API key>']))) { if (preg_match_all('/([a-z]{1,8}(?:-[a-z]{1,8})?)(?:;q=([0-9.]+))?/', $list, $list)) { $this->language = array_combine($list[1], $list[2]); foreach ($this->language as $n => $v) { $this->language[$n] = $v ? $v : 1; } arsort($this->language, SORT_NUMERIC); } } else { $this->language = []; } } /** * @param array $languageUrlMap */ public function setLanguageUrlMap(array $languageUrlMap) { $this->languageUrlMap = $languageUrlMap; } /** * @return array */ public function getLanguageUrlMap() { return $this->languageUrlMap; } /** * @param array $languageList * * @return string */ private function getBestMatch(array $languageList) { $languages = array(); foreach ($languageList as $lang => $alias) { if (is_array($alias)) { foreach ($alias as $alias_lang) { $languages[strtolower($alias_lang)] = strtolower($lang); } } else { $languages[strtolower($alias)] = strtolower($lang); } } foreach ($this->language as $l => $v) { $s = strtok($l, '-'); if (isset($languages[$s])) { return $languages[$s]; } } return $this->defaultLanguage; } /** * @param array $languageList */ public function setLanguageList(array $languageList) { $this->languageList = $languageList; } /** * @param string $pathTo404 */ public function route($pathTo404 = '') { $language = $this->getBestMatch($this->languageList); $languageUrlMap = $this->getLanguageUrlMap(); LanguageLink::<API key>($language); if ($languageUrlMap[$language] || $languageUrlMap['default']) { LocalRedirect($languageUrlMap[$language] ?: $languageUrlMap['default'], false, '301 Moved Permanently'); } else { $this->showNotFoundPage($pathTo404); } } /** * @param string $pathTo404 * * @buffer_restart * * @require 404 page * * @die */ public function showNotFoundPage($pathTo404 = '') { if (!$pathTo404) { $pathTo404 = $_SERVER['DOCUMENT_ROOT'] . '/' . $this->getBestMatch($this->languageList) . '/404.php'; } global $APPLICATION; $APPLICATION->RestartBuffer(); try { require_once($pathTo404); } catch (\Exception $e) { \CHTTP::SetStatus('404 Not Found'); echo '<h1>404 Not Found</h1>'; } die; } }
// YRMConst.h // Budejie #import <UIKit/UIKit.h> UIKIT_EXTERN CGFloat const YRMTitlesViewH; UIKIT_EXTERN CGFloat const YRMTitlesViewY; UIKIT_EXTERN CGFloat const YRMTopicCellTextY; UIKIT_EXTERN CGFloat const <API key>; UIKIT_EXTERN CGFloat const YRMTopicCellMargin; UIKIT_EXTERN CGFloat const <API key>; UIKIT_EXTERN CGFloat const <API key>;
package com.pi.xerosync.dbconnect; public interface XeroCredentials { String getXeroConsumerKey(); String <API key>(); String getPrivateKeyPath(); }
<!DOCTYPE HTML PUBLIC "- <!--NewPage <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_45) on Wed Aug 28 02:24:21 PDT 2013 --> <TITLE> <API key>.ActivitySorter </TITLE> <META NAME="date" CONTENT="2013-08-28"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="<API key>.ActivitySorter"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <A NAME="navbar_top"></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/<API key>.ActivitySorter.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../../android/support/v7/internal/widget/<API key>.ActivityResolveInfo.html" title="class in android.support.v7.internal.widget"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../../../android/support/v7/internal/widget/<API key>.HistoricalRecord.html" title="class in android.support.v7.internal.widget"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?android/support/v7/internal/widget/<API key>.ActivitySorter.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="<API key>.ActivitySorter.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <! if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <HR> <H2> <FONT SIZE="-1"> android.support.v7.internal.widget</FONT> <BR> Interface <API key>.ActivitySorter</H2> <DL> <DT><B>Enclosing class:</B><DD><A HREF="../../../../../android/support/v7/internal/widget/<API key>.html" title="class in android.support.v7.internal.widget"><API key></A></DD> </DL> <HR> <DL> <DT><PRE>public static interface <B><API key>.ActivitySorter</B></DL> </PRE> <P> Defines a sorter that is responsible for sorting the activities based on the provided historical choices and an intent. <P> <P> <HR> <P> <A NAME="method_summary"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../android/support/v7/internal/widget/<API key>.ActivitySorter.html#sort(Intent, java.util.List, java.util.List)">sort</A></B>(Intent&nbsp;intent, java.util.List&lt;<A HREF="../../../../../android/support/v7/internal/widget/<API key>.ActivityResolveInfo.html" title="class in android.support.v7.internal.widget"><API key>.ActivityResolveInfo</A>&gt;&nbsp;activities, java.util.List&lt;<A HREF="../../../../../android/support/v7/internal/widget/<API key>.HistoricalRecord.html" title="class in android.support.v7.internal.widget"><API key>.HistoricalRecord</A>&gt;&nbsp;historicalRecords)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sorts the <code>activities</code> in descending order of relevance based on previous history and an intent.</TD> </TR> </TABLE> &nbsp; <P> <A NAME="method_detail"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="sort(Intent, java.util.List, java.util.List)"></A><H3> sort</H3> <PRE> void <B>sort</B>(Intent&nbsp;intent, java.util.List&lt;<A HREF="../../../../../android/support/v7/internal/widget/<API key>.ActivityResolveInfo.html" title="class in android.support.v7.internal.widget"><API key>.ActivityResolveInfo</A>&gt;&nbsp;activities, java.util.List&lt;<A HREF="../../../../../android/support/v7/internal/widget/<API key>.HistoricalRecord.html" title="class in android.support.v7.internal.widget"><API key>.HistoricalRecord</A>&gt;&nbsp;historicalRecords)</PRE> <DL> <DD>Sorts the <code>activities</code> in descending order of relevance based on previous history and an intent. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>intent</CODE> - The <CODE>Intent</CODE>.<DD><CODE>activities</CODE> - Activities to be sorted.<DD><CODE>historicalRecords</CODE> - Historical records.</DL> </DD> </DL> <HR> <A NAME="navbar_bottom"></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="<API key>"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/<API key>.ActivitySorter.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../../android/support/v7/internal/widget/<API key>.ActivityResolveInfo.html" title="class in android.support.v7.internal.widget"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../../../android/support/v7/internal/widget/<API key>.HistoricalRecord.html" title="class in android.support.v7.internal.widget"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?android/support/v7/internal/widget/<API key>.ActivitySorter.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="<API key>.ActivitySorter.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <! if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <HR> </BODY> </HTML>
<reference path='fourslash.ts' /> // @BaselineFile: bpSpan_interface.baseline // @Filename: bpSpan_interface.ts /interface I { / property: string; / method(): number; / (a: string): string; / new (a: string): I; / [a: number]: number; /} /module m { / interface I1 { / property: string; / method(): number; / (a: string): string; / new (a: string): I; / [a: number]: number; / } / export interface I2 { / property: string; / method(): number; / (a: string): string; / new (a: string): I; / [a: number]: number; / } /} verify.<API key>();
package main.java; public class SelectionSort9 { public static <T extends Comparable<T>> void sort(final T[] a) { for (int i = 0; i < a.length - 1; i++) { int min = i; for (int j = i + 1; j < a.length; j++) { if (a[j].compareTo(a[min]) < 0) { min = j; } } if (i != min) { final T tmp = a[min]; a[min] = a[i]; a[i] = tmp; } } } }
package com.sequenceiq.environment.api.v1.environment.model.response; import java.io.Serializable; import com.sequenceiq.environment.api.doc.environment.<API key>; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @ApiModel("Environment<API key>) public class Environment<API key> implements Serializable { @ApiModelProperty(<API key>.PUBLIC_KEY) private String publicKey; @ApiModelProperty(<API key>.PUBLIC_KEY_ID) private String publicKeyId; @ApiModelProperty(<API key>.LOGIN_USER_NAME) private String loginUserName; public String getPublicKey() { return publicKey; } public void setPublicKey(String publicKey) { this.publicKey = publicKey; } public String getPublicKeyId() { return publicKeyId; } public void setPublicKeyId(String publicKeyId) { this.publicKeyId = publicKeyId; } public String getLoginUserName() { return loginUserName; } public void setLoginUserName(String loginUserName) { this.loginUserName = loginUserName; } public static Builder builder() { return new Builder(); } @Override public String toString() { return "Environment<API key>{" + "publicKey='" + publicKey + '\'' + ", publicKeyId='" + publicKeyId + '\'' + ", loginUserName='" + loginUserName + '\'' + '}'; } public static class Builder { private String publicKey; private String publicKeyId; private String loginUserName; private Builder() { } public Builder withPublicKey(String publicKey) { this.publicKey = publicKey; return this; } public Builder withPublicKeyId(String publicKeyId) { this.publicKeyId = publicKeyId; return this; } public Builder withLoginUserName(String loginUserName) { this.loginUserName = loginUserName; return this; } public Environment<API key> build() { Environment<API key> response = new Environment<API key>(); response.setLoginUserName(loginUserName); response.setPublicKey(publicKey); response.setPublicKeyId(publicKeyId); return response; } } }
# 3rd Year Main Project # Design Document Check out the [Wiki](https://github.com/ianburkeixiv/ThirdYearProject/wiki) for the design document # Video Click [here](https://youtu.be/jd0N7RG_bnA) to check out the video I uploaded on Youtube showing how to run the application. # Installation and Configuration Manual Download the [Install&ConfigManual](https://github.com/ianburkeixiv/ThirdYearProject/raw/master/Install%26ConfigManual.docx) word document above to install the various technologies used in this project. # User Guide Once the installation and configuration is done. Here are the following steps on how to run the the database, server and the ionic app together. Download [MyApp2/](https: Step 1: Launch MongoDB server To launch the MongoDB server, we must locate the executable files in the MongoDB Server binary folder. Open a command terminal and enter the following: sh $ cd/ ![](https://cloud.githubusercontent.com/assets/22341150/25337063/<API key>.PNG) Cd/ will change back to the root directory. Once in the root directory, we need to go into the Program Files directory sh $ cd "Program Files" ![](https://cloud.githubusercontent.com/assets/22341150/25337079/<API key>.PNG) *A shortcut to this is typing the first few words like "pro" and then press the tab button to bring up the full word*. Once in the Program Files directory, we must go into the MongoDB directory. sh $ cd MongoDB ![](https://cloud.githubusercontent.com/assets/22341150/25337082/<API key>.PNG) Then cd into the server directory.. sh $ cd server Use version 3.4.. sh $ cd 3.4 cd into the bin folder which contains all the executable files. sh $ cd bin ![](https://cloud.githubusercontent.com/assets/22341150/25337087/<API key>.PNG) Once you are inside the bin folder, enter mongod command to launch the server. sh $ mongod ![](https://cloud.githubusercontent.com/assets/22341150/25337073/<API key>.PNG) Step 2: Launch the Node Server In the [Server](https://github.com/ianburkeixiv/ThirdYearProject/tree/master/server) folder there are two files. The package.json file is used to specify dependencies to be installed by NPM (Node Package Manager). Server.js is the actual server file. To launch the server, open up another command terminal and locate the server directory using the cd (change directory) command. Once you are in the server directory, enter the following command to launch the server: sh $ node server.js ![](https://cloud.githubusercontent.com/assets/22341150/25339672/<API key>.PNG) Once the MongoDB server and the Node server are running, we can now launch the Ionic 2 app. Step 3: Launh Ionic 2 First you must locate the MyApp2 directory containing the Ionic 2 project. Open up another (No.3) command terminal and cd into MyApp2 directory. Once you are inside the directory, enter the following command to run the Ionic app: - *Note: 'ionic serve' command will run the app on your local browser* - We will be using 'ionic lab'. This feature makes it easy to run the app in a phone frame and with iOS and Android platforms side by side. sh $ ionic lab ![](https://cloud.githubusercontent.com/assets/22341150/25341218/<API key>.PNG) 'Once the Ionic app is running, you can test it out!' ![](https://cloud.githubusercontent.com/assets/22341150/25342669/<API key>.PNG) ![](https://cloud.githubusercontent.com/assets/22341150/25342685/<API key>.PNG)
""" Generate a toy dataset for the matrix factorisation case, and store it. We use dimensions 100 by 50 for the dataset, and 10 latent factors. As the prior for U and V we take value 1 for all entries (so exp 1). As a result, each value in R has a value of around 20, and a variance of 100-120. For contrast, the Sanger dataset of 705 by 140 shifted to nonnegative has mean 31.522999753779082 and variance 243.2427345740027. We add Gaussian noise of precision tau = 1 (prior for gamma: alpha=1,beta=1). (Simply using the expectation of our Gamma distribution over tau) """ import sys, os project_location = os.path.dirname(__file__)+"/../../../" sys.path.append(project_location) from BNMTF.code.models.distributions.exponential import exponential_draw from BNMTF.code.models.distributions.normal import normal_draw from BNMTF.code.cross_validation.mask import generate_M import numpy, itertools, matplotlib.pyplot as plt def generate_dataset(I,J,K,lambdaU,lambdaV,tau): # Generate U, V U = numpy.zeros((I,K)) for i,k in itertools.product(xrange(0,I),xrange(0,K)): U[i,k] = exponential_draw(lambdaU[i,k]) V = numpy.zeros((J,K)) for j,k in itertools.product(xrange(0,J),xrange(0,K)): V[j,k] = exponential_draw(lambdaV[j,k]) # Generate R true_R = numpy.dot(U,V.T) R = add_noise(true_R,tau) return (U,V,tau,true_R,R) def add_noise(true_R,tau): if numpy.isinf(tau): return numpy.copy(true_R) (I,J) = true_R.shape R = numpy.zeros((I,J)) for i,j in itertools.product(xrange(0,I),xrange(0,J)): R[i,j] = normal_draw(true_R[i,j],tau) return R def try_generate_M(I,J,fraction_unknown,attempts): for attempt in range(1,attempts+1): try: M = generate_M(I,J,fraction_unknown) sums_columns = M.sum(axis=0) sums_rows = M.sum(axis=1) for i,c in enumerate(sums_rows): assert c != 0, "Fully unobserved row in M, row %s. Fraction %s." % (i,fraction_unknown) for j,c in enumerate(sums_columns): assert c != 0, "Fully unobserved column in M, column %s. Fraction %s." % (j,fraction_unknown) print "Took %s attempts to generate M." % attempt return M except AssertionError: pass raise Exception("Tried to generate M %s times, with I=%s, J=%s, fraction=%s, but failed." % (attempts,I,J,fraction_unknown)) if __name__ == "__main__": output_folder = project_location+"BNMTF/data_toy/bnmf/" I,J,K = 100, 80, 10 #20, 10, 5 # fraction_unknown = 0.1 alpha, beta = 1., 1. lambdaU = numpy.ones((I,K)) lambdaV = numpy.ones((I,K)) tau = alpha / beta (U,V,tau,true_R,R) = generate_dataset(I,J,K,lambdaU,lambdaV,tau) # Try to generate M M = try_generate_M(I,J,fraction_unknown,attempts=1000) # Store all matrices in text files numpy.savetxt(open(output_folder+"U.txt",'w'),U) numpy.savetxt(open(output_folder+"V.txt",'w'),V) numpy.savetxt(open(output_folder+"R_true.txt",'w'),true_R) numpy.savetxt(open(output_folder+"R.txt",'w'),R) numpy.savetxt(open(output_folder+"M.txt",'w'),M) print "Mean R: %s. Variance R: %s. Min R: %s. Max R: %s." % (numpy.mean(R),numpy.var(R),R.min(),R.max()) fig = plt.figure() plt.hist(R.flatten(),bins=range(0,int(R.max())+1)) plt.show()
using Artemis.System; using IHateRectangles.Screens; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; namespace IHateRectangles { public class MenuScreen : Screen { private SpriteBatch _spriteBatch; private SpriteFont _menuFont; private ContentManager _contentManager; public event ScreenFinished OnScreenFinished; public void Initialize() { _contentManager = EntitySystem.BlackBoard.GetEntry<ContentManager>("ContentManager"); _menuFont = _contentManager.Load<SpriteFont>(@"Fonts\Hud"); _spriteBatch = EntitySystem.BlackBoard.GetEntry<SpriteBatch>("SpriteBatch"); } public void Update() { if (Keyboard.GetState().GetPressedKeys().Length > 0) if (OnScreenFinished != null) OnScreenFinished(new GameScreen()); } public void Draw() { var viewport = EntitySystem.BlackBoard.GetEntry<GraphicsDevice>("GraphicsDevice").Viewport; _spriteBatch.Begin(); _spriteBatch.DrawString(_menuFont, "I Hate Rectangles", new Vector2(viewport.Width / 2 - 100, viewport.Height / 2 - 200), Color.White); _spriteBatch.DrawString(_menuFont, "Press any key to continue.", new Vector2(viewport.Width / 2 - 138, viewport.Height / 2 - 100), Color.White); _spriteBatch.End(); } public void Destroy() { } } }
## Description: ## Test with ibv_rc_pingpong, perf and rping between 2 Guests on the same Hosts ## Revision: ## v1.0.0 - ldu - 12/04/2018 - Build the script < .Synopsis Test with ibv_rc_pingpong, perf and rping between 2 Guests on the different Hosts .Description .Parameter vmName Name of the test VM. .Parameter testParams Semicolon separated list of test parameters. param([String] $vmName, [String] $hvServer, [String] $testParams) # Checking the input arguments if (-not $vmName) { "Error: VM name cannot be null!" exit 100 } if (-not $hvServer) { "Error: hvServer cannot be null!" exit 100 } if (-not $testParams) { Throw "Error: No test parameters specified" } # Output test parameters so they are captured in log file "TestParams : '${testParams}'" # Parse the test parameters $rootDir = $null $sshKey = $null $ipv4 = $null $dstHost6_7 = $null $dstHost6_5 = $null $dstDatastore = $null $params = $testParams.Split(";") foreach ($p in $params) { $fields = $p.Split("=") switch ($fields[0].Trim()) { "sshKey" { $sshKey = $fields[1].Trim() } "rootDir" { $rootDir = $fields[1].Trim() } "ipv4" { $ipv4 = $fields[1].Trim() } "dstHost6.7" { $dstHost6_7 = $fields[1].Trim()} "dstHost6.5" { $dstHost6_5 = $fields[1].Trim()} "dstDatastore" { $dstDatastore = $fields[1].Trim() } "tool" { $tool = $fields[1].Trim() } default {} } } # Check all parameters are valid if (-not $rootDir) { "Warn : no rootdir was specified" } else { if ( (Test-Path -Path "${rootDir}") ) { Set-Location $rootDir } else { "Warn : rootdir '${rootDir}' does not exist" } } if ($null -eq $sshKey) { "FAIL: Test parameter sshKey was not specified" return $False } if ($null -eq $ipv4) { "FAIL: Test parameter ipv4 was not specified" return $False } if ($null -eq $dstDatastore) { "FAIL: Test parameter dstDatastore was not specified" return $False } if (-not $dstHost6_7 -or -not $dstHost6_5) { "INFO: dstHost 6.7 is $dstHost6_7" "INFO: dstHost 6.5 is $dstHost6_5" "Warn : dstHost was not specified" return $false } # Source the tcutils.ps1 file . .\setupscripts\tcutils.ps1 PowerCLIImport ConnectToVIServer $env:ENVVISIPADDR ` $env:ENVVISUSERNAME ` $env:ENVVISPASSWORD ` $env:ENVVISPROTOCOL # Main Body $retVal = $Failed $vmObj = Get-VMHost -Name $hvServer | Get-VM -Name $vmName if (-not $vmObj) { LogPrint "ERROR: Unable to Get-VM with $vmName" <API key> return $Aborted } # Specify dst host $dstHost = FindDstHost -hvServer $hvServer -Host6_5 $dstHost6_5 -Host6_7 $dstHost6_7 if ($null -eq $dstHost) { LogPrint "ERROR: Cannot find required Host" <API key> return $Aborted } LogPrint "INFO: Destination Host is $dstHost" # Get the Guest version $DISTRO = GetLinuxDistro ${ipv4} ${sshKey} LogPrint "DEBUG: DISTRO: $DISTRO" if (-not $DISTRO) { LogPrint "ERROR: Guest OS version is NULL" <API key> return $Aborted } LogPrint "INFO: Guest OS version is $DISTRO" # Different Guest DISTRO if ($DISTRO -ne "RedHat7" -and $DISTRO -ne "RedHat8" -and $DISTRO -ne "RedHat6") { LogPrint "ERROR: Guest OS ($DISTRO) isn't supported, MUST UPDATE in Framework / XML / Script" <API key> return $Skipped } # Start another VM $GuestBName = $vmObj.Name.Split('-') # Get another VM by change Name $GuestBName[-1] = "B" $GuestBName = $GuestBName -join "-" $GuestB = Get-VMHost -Name $hvServer | Get-VM -Name $GuestBName # Add RDMA NIC for Guest B $status = AddPVrdmaNIC $GuestBName $hvServer if ( -not $status[-1]) { LogPrint "ERROR: RDMA NIC adds failed" <API key> return $Aborted } # Start GuestB Start-VM -VM $GuestB -Confirm:$false -RunAsync:$true -ErrorAction SilentlyContinue if (-not $?) { LogPrint "ERROR : Cannot start VM" <API key> return $Aborted } # Wait for GuestB SSH ready if ( -not (WaitForVMSSHReady $GuestBName $hvServer $sshKey 300)) { LogPrint "ERROR : Cannot start SSH" <API key> return $Aborted } LogPrint "INFO: Ready SSH" # Get another VM IP addr $ipv4Addr_B = GetIPv4 -vmName $GuestBName -hvServer $hvServer $GuestB = Get-VMHost -Name $hvServer | Get-VM -Name $GuestBName # Find out new add RDMA nic for Guest B $nics += @($(FindAllNewAddNIC $ipv4Addr_B $sshKey)) if ($null -eq $nics) { LogPrint "ERROR: Cannot find new add RDMA NIC" <API key> return $Failed } else { $rdmaNIC = $nics[-1] } LogPrint "INFO: New NIC is $rdmaNIC" # Config RDMA NIC IP addr for Guest B $IPAddr_guest_B = "172.31.1." + (Get-Random -Maximum 254 -Minimum 125) if ( -not (<API key> $ipv4Addr_B $sshKey $rdmaNIC ($IPAddr_guest_B + "/24"))) { LogPrint "ERROR : Guest B Config IP Failed" <API key> return $Failed } LogPrint "INFO: Guest B RDMA NIC IP add is $IPAddr_guest_B" # Find out new add RDMA nic for Guest A $nics += @($(FindAllNewAddNIC $ipv4 $sshKey)) if ($null -eq $nics) { LogPrint "ERROR: Cannot find new add rdma NIC" <API key> return $Failed } else { $rdmaNIC = $nics[-1] } LogPrint "INFO: New NIC is $rdmaNIC" # Config RDMA NIC IP addr for Guest A $IPAddr_guest_A = "172.31.1." + (Get-Random -Maximum 124 -Minimum 2) if ( -not (<API key> $ipv4 $sshKey $rdmaNIC ($IPAddr_guest_A + "/24"))) { LogPrint "ERROR : Guest A Config IP Failed" <API key> return $Failed } LogPrint "INFO: Guest A RDMA NIC IP add is $IPAddr_guest_A" # Check can we ping GuestA from GuestB via RDMA NIC $Command = "ping $IPAddr_guest_A -c 10 -W 15 | grep ttl > /dev/null" $status = SendCommandToVM $ipv4Addr_B $sshkey $command if (-not $status) { LogPrint "ERROR : Ping test Failed" $retVal = $Failed } else { LogPrint "Pass : Ping test passed" } #For RHEL8 and RHEL7 install different package. if ($DISTRO -eq "RedHat8") { $command1 = "yum install -y opensm rdma libibverbs librdmacm librdmacm-utils ibacm libibverbs-utils infiniband-diags perftest qperf libcxgb4 libmlx4 libmlx5 rdma-core" } else { $command1 = "yum install -y opensm rdma libibverbs librdmacm librdmacm-utils ibacm libibverbs-utils infiniband-diags ibutils perftest qperf infinipath-psm libcxgb3 libcxgb4 libehca libipathverbs libmthca libmlx4 libmlx5 libnes libocrdma dapl dapl-devel dapl-utils dapl dapl-devel dapl-utils" } #install dependency package on guest B. $status = SendCommandToVM $ipv4Addr_B $sshkey $command1 if (-not $status) { LogPrint "ERROR : install package Failed" return $Aborted } #load ib related modules $command2 = "modprobe ib_umad" $status = SendCommandToVM $ipv4Addr_B $sshkey $command2 if (-not $status) { LogPrint "ERROR : load modules Failed" return $Aborted } #install dependency package on guest A. $status = SendCommandToVM $ipv4 $sshkey $command1 if (-not $status) { LogPrint "ERROR : install package Failed" return $Aborted } #load ib related modules $status = SendCommandToVM $ipv4 $sshkey $command2 if (-not $status) { LogPrint "ERROR : load modules Failed" return $Aborted } #check the test tools used for test. LogPrint "test is $tool" write-host -F Red "Test tool is $tool" if ( $tool -eq "perf" ) { #array for perftest command $perf_guestB = @("ib_send_lat -x 0 -a","ib_send_bw -x 0 -a","ib_read_lat -x 0 -a","ib_read_bw -x 0 -a","ib_write_lat -x 0 -a","ib_write_bw -x 0 -a" ) $perf_guestA = @("ib_send_lat -x 0 -a $IPAddr_guest_B","ib_send_bw -x 0 -a $IPAddr_guest_B","ib_read_lat -x 0 -a $IPAddr_guest_B","ib_read_bw -x 0 -a $IPAddr_guest_B","ib_write_lat -x 0 -a $IPAddr_guest_B","ib_write_bw -x 0 -a $IPAddr_guest_B" ) foreach($i in $perf_guestB) { $Process = Start-Process bin\plink -ArgumentList "-i ssh\${sshKey} root@${ipv4Addr_B} ${i}" -PassThru -WindowStyle Hidden write-host -F Red "the process1 id is $($Process.id) and $i" $index = $perf_guestB.IndexOf($i) $commandA = $perf_guestA[$index] $status = SendCommandToVM $ipv4 $sshkey $commandA if (-not $status) { LogPrint "ERROR : $commandA test Failed" return $Failed } else { $retVal = $Passed LogPrint "pass : $commandA test passed" } } } else { if ( $tool -eq "ibvrc" ) { $commandA = "ibv_rc_pingpong -s 1 -g 1 $IPAddr_guest_B" $commandB = "ibv_rc_pingpong -s 1 -g 1" } else { $commandA = "rping -c -a $IPAddr_guest_B -v -C 1" $commandB = "rping -s -v -V -C 1 -a $IPAddr_guest_B" } #Run test on guest B first,because guest B is test as server. $Process1 = Start-Process bin\plink -ArgumentList "-i ssh\${sshKey} root@${ipv4Addr_B} ${commandB}" -PassThru -WindowStyle Hidden write-host -F Red "$($Process1.id)" #Then run test on guest A, guest A as client. $a = "touch /root/aa" $status = SendCommandToVM $ipv4 $sshkey $a $status = SendCommandToVM $ipv4 $sshkey $commandA if (-not $status) { LogPrint "ERROR : test $commandA test Failed" <API key> $retVal = $Failed } else { $retVal = $Passed LogPrint "pass : test $commandA test passed" } } <API key> return $retVal
package org.easyaccess.nist; import java.io.File; import java.util.HashMap; import java.util.Locale; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.os.Bundle; import android.speech.tts.TextToSpeech.OnInitListener; import android.util.Log; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; import android.view.View.OnClickListener; import android.view.View.OnTouchListener; import android.view.Window; import android.view.WindowManager; import android.widget.Button; import android.widget.Toast; public class HomeScreenActivity extends Activity implements OnInitListener { private static final String TAG = "HomeScreenActivity"; boolean isButtonPressed = false; int gFocusPosition = 1; int gMaxFocusableItem = 2; Context gContext = null; String gTTsOnStart = null; SpeakManager gTTS = null; Button gBtnScan = null, gBtnSkipScan = null; View rootView = null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); <API key>(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.<API key>); gContext = this; rootView = findViewById(R.id.alrt_root_view); gBtnScan = (Button) findViewById(R.id.btn_scan); gBtnSkipScan = (Button) findViewById(R.id.btn_skip_scan); gBtnScan.setBackgroundColor(getResources().getColor(R.color.bg_button)); gBtnScan.setTextColor(getResources().getColor(android.R.color.white)); gBtnSkipScan.setBackgroundColor(getResources().getColor(R.color.bg_button)); gBtnSkipScan.setTextColor(getResources().getColor(android.R.color.white)); gBtnScan.isInTouchMode(); File directory = new File(Constants.<API key>); if (!directory.exists()) { directory.mkdir(); } File sampleFile = new File(directory, Constants.<API key>); if (!sampleFile.exists()) { StringBuilder builder = Utils.readFile(gContext, this.getResources().openRawResource(R.raw.election_info_sp)); Utils.writeToFile(builder.toString(), directory + File.separator + Constants.<API key>, false); } sampleFile = new File(directory, Constants.<API key>); if (!sampleFile.exists()) { StringBuilder builder = Utils.readFile(gContext, this.getResources().openRawResource(R.raw.election_info_en)); Utils.writeToFile(builder.toString(), directory + File.separator + Constants.<API key>, false); } } private OnClickListener sOnClickListener = new OnClickListener() { Intent intent = null; @Override public void onClick(View v) { switch (v.getId()) { case R.id.btn_scan: launchScan(); break; case R.id.btn_skip_scan: skipScan(); break; case R.id.alrt_root_view: speakWord("", null, false); break; } } private void skipScan() { resetPreferences(); intent = new Intent(gContext, ContestActivity.class); intent.setFlags(Intent.<API key>); intent.setFlags(Intent.<API key>); startActivity(intent); } private void launchScan() { resetPreferences(); intent = new Intent(gContext, ScannerActivity.class); intent.setFlags(Intent.<API key>); intent.setFlags(Intent.<API key>); startActivity(intent); } }; private void resetPreferences() { Constants.SETTING_LANGUAGE = Constants.<API key>; Constants.<API key> = Constants.<API key>; Constants.SETTING_FONT_SIZE = Constants.FONT_SIZE_STD; Constants.<API key> = Constants.<API key>; Constants.SETTING_TTS_VOICE = Constants.DEFAULT_TTS_VOICE; Constants.SETTING_TTS_SPEED = Constants.TTS_SPEED_STD; Constants.SETTING_SCAN_MODE = Constants.<API key>; Constants.<API key> = Constants.<API key>; SharedPreferences preferences = <API key>( Constants.PREFERENCE_NAME, Context.MODE_PRIVATE); Editor editor = preferences.edit(); editor.clear(); editor.commit(); } private OnTouchListener gOnTouchListener = new OnTouchListener() { /** * on touch down announce the info if it represent text. on touch up * perform the action */ @Override public boolean onTouch(View v, MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN) { navigateToOtherItem(gFocusPosition, Constants.<API key>); gFocusPosition = 0; switch (v.getId()) { case R.id.btn_scan: v.setBackground(getResources().getDrawable( R.drawable.focused)); if (HeadsetListener.isHeadsetConnected) { speakWord(gBtnScan.getText().toString(), null, true); } break; case R.id.btn_skip_scan: v.setBackground(getResources().getDrawable( R.drawable.focused)); if (HeadsetListener.isHeadsetConnected) { speakWord(gBtnSkipScan.getText().toString(), null, true); } break; } } else if (event.getAction() == MotionEvent.ACTION_UP) { switch (v.getId()) { case R.id.btn_scan: v.setBackground(null); // v.performClick(); break; case R.id.btn_skip_scan: v.setBackground(null); // v.performClick(); break; } } return false; } }; @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (!isButtonPressed) { int keyPressed = -1; if (keyCode == KeyEvent.KEYCODE_UNKNOWN) { keyPressed = event.getScanCode(); } else { keyPressed = keyCode; } switch (keyPressed) { case KeyEvent.KEYCODE_TAB: if(event.isShiftPressed()){ navigateToOtherItem(gFocusPosition, Constants.<API key>); gFocusPosition if (gFocusPosition <= 0) { gFocusPosition = gMaxFocusableItem; } navigateToOtherItem(gFocusPosition, Constants.REACH_NEW_ITEM); }else{ navigateToOtherItem(gFocusPosition, Constants.<API key>); gFocusPosition++; if (gFocusPosition > gMaxFocusableItem) { gFocusPosition = 1; } navigateToOtherItem(gFocusPosition, Constants.REACH_NEW_ITEM); } break; case KeyEvent.KEYCODE_DPAD_UP: case KeyEvent.KEYCODE_BUTTON_1: navigateToOtherItem(gFocusPosition, Constants.<API key>); gFocusPosition if (gFocusPosition <= 0) { gFocusPosition = gMaxFocusableItem; } navigateToOtherItem(gFocusPosition, Constants.REACH_NEW_ITEM); break; case KeyEvent.KEYCODE_DPAD_DOWN: case KeyEvent.KEYCODE_BUTTON_2: navigateToOtherItem(gFocusPosition, Constants.<API key>); gFocusPosition++; if (gFocusPosition > gMaxFocusableItem) { gFocusPosition = 1; } navigateToOtherItem(gFocusPosition, Constants.REACH_NEW_ITEM); break; case KeyEvent.KEYCODE_ENTER: case KeyEvent.KEYCODE_BUTTON_3: <API key>(gFocusPosition, Constants.<API key>); break; } } isButtonPressed = true; return true; } @Override public boolean onKeyUp(int keyCode, KeyEvent event) { isButtonPressed = false; int keyPressed = -1; if (keyCode == KeyEvent.KEYCODE_UNKNOWN) { keyPressed = event.getScanCode(); } else { keyPressed = keyCode; } switch (keyPressed) { case KeyEvent.KEYCODE_ENTER: case KeyEvent.KEYCODE_BUTTON_3: // <API key>(gFocusPosition, // Constants.<API key>); break; } return true; } public void <API key>(int focusPosition, int pressed_released) { switch (pressed_released) { case Constants.REACH_NEW_ITEM: break; case Constants.<API key>: if (gFocusPosition == 1) { gBtnScan.performClick(); } else if (gFocusPosition == 2) { gBtnSkipScan.performClick(); } break; } } public void navigateToOtherItem(int focusPosition, int reach_jump) { View view = getCurrentFocus(); Log.d(TAG, " from navigation method focus position = " + focusPosition + ", current focus = " + view ); // + ", next focus down id = " // + view.getNextFocusDownId() // + ", next focus forward id = " + view.<API key>() // + ", next focus left id = " + view.getNextFocusLeftId() // + ", next focus right id = " + view.getNextFocusRightId() // + ", next focus up id = " + view.getNextFocusUpId()); switch (reach_jump) { case Constants.<API key>: if (focusPosition == 1) { // gBtnScan.setBackground(null); } else if (focusPosition == 2) { // gBtnSkipScan.setBackground(null); } break; case Constants.REACH_NEW_ITEM: if (focusPosition == 1) { gBtnScan.<API key>(true);// for handling the ez-keypad focus gBtnSkipScan.<API key>(false);// for handling the ez-keypad focus gBtnScan.requestFocus();// for handling the focus when come out of touch mode // gBtnScan.setBackground(getResources().getDrawable( // R.drawable.focused)); if (HeadsetListener.isHeadsetConnected) { speakWord(gBtnScan.getText().toString() + Constants.COMMA_SPACE + getString(R.string.button), null, true); } } else if (focusPosition == 2) { gBtnScan.<API key>(false);// for handling the ez-keypad focus gBtnSkipScan.<API key>(true);// for handling the ez-keypad focus gBtnSkipScan.requestFocus();// for handling the focus when come out of touch mode // gBtnSkipScan.setBackground(getResources().getDrawable( // R.drawable.focused)); if (HeadsetListener.isHeadsetConnected) { speakWord(gBtnSkipScan.getText().toString() + Constants.COMMA_SPACE + getString(R.string.button), null, true); } } break; } } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); Log.d(TAG,"resultCode = " + resultCode); if (requestCode == Constants.TTS_DATA_CHECK_CODE) { if (resultCode == SpeakManager.Engine.<API key>) { Log.d(TAG,"Setting speak manager"); if (Constants.SETTING_TTS_VOICE == Constants.DEFAULT_TTS_VOICE) { gTTS = new SpeakManager(gContext, this, "com.svox.classic"); } else { gTTS = new SpeakManager(gContext, this, "com.ivona.tts"); } } else { Log.d(TAG,"launching intent for installing tts"); Intent ttsInstallIntent = new Intent(); ttsInstallIntent .setAction(SpeakManager.Engine.<API key>); startActivity(ttsInstallIntent); } } } @Override public void onInit(int status) { if (status == SpeakManager.SUCCESS) { if (Constants.SETTING_LANGUAGE == Constants.<API key>) { gTTS.setLanguage(Locale.US); } else { gTTS.setLanguage(new Locale("spa", "ESP")); } gTTS.setSpeechRate(Constants.SETTING_TTS_SPEED); speakWord(gTTsOnStart, null, true); } else if (status == SpeakManager.ERROR) { Toast.makeText(gContext, getString(R.string.failed), Toast.LENGTH_SHORT).show(); } } public void speakWord(String word, HashMap<String, String> utteranceId, boolean shouldRepeat) { if (gTTS != null) { gTTS.speak(word, SpeakManager.QUEUE_FLUSH, utteranceId, shouldRepeat); } } @Override protected void onStop() { super.onStop(); if (gTTS != null) { gTTS.stop(); gTTS.shutdown(); } } @Override protected void onStart() { super.onStart(); Intent checkTTSIntent = new Intent(); checkTTSIntent.setAction(SpeakManager.Engine.<API key>); <API key>(checkTTSIntent, Constants.TTS_DATA_CHECK_CODE); gBtnScan.setText(R.string.scan_barcode); gBtnSkipScan.setText(R.string.skip_barcode); gBtnScan.setTextSize(Constants.SETTING_FONT_SIZE); gBtnSkipScan.setTextSize(Constants.SETTING_FONT_SIZE); gBtnScan.setOnClickListener(sOnClickListener); // gBtnScan.setOnTouchListener(gOnTouchListener); gBtnSkipScan.setOnClickListener(sOnClickListener); // gBtnSkipScan.setOnTouchListener(gOnTouchListener); rootView.setOnClickListener(sOnClickListener); gBtnSkipScan.<API key>(new View.<API key>() { @Override public void onFocusChange(View v, boolean hasFocus) { if(hasFocus){ // gBtnSkipScan.<API key>(true); }else{ // gBtnSkipScan.<API key>(false); } } }); gBtnScan.<API key>(new View.<API key>() { @Override public void onFocusChange(View v, boolean hasFocus) { if(hasFocus){ // gBtnScan.<API key>(true); }else{ // gBtnScan.<API key>(false); } } }); gTTsOnStart = getString(R.string.scan_barcode) + Constants.COMMA_SPACE + getString(R.string.button); // View view = getCurrentFocus(); // Log.d(TAG, "current focus = " + view // + ", next focus down id = " // + view.getNextFocusDownId() // + ", next focus forward id = " + view.<API key>() // + ", next focus left id = " + view.getNextFocusLeftId() // + ", next focus right id = " + view.getNextFocusRightId() // + ", next focus up id = " + view.getNextFocusUpId()); // gBtnScan.<API key>(R.drawable.focused); gBtnScan.<API key>(true);// for showing focus initially gBtnScan.requestFocus(); // view = getCurrentFocus(); // Log.d(TAG, "current focus = " + view // + ", next focus down id = " // + view.getNextFocusDownId() // + ", next focus forward id = " + view.<API key>() // + ", next focus left id = " + view.getNextFocusLeftId() // + ", next focus right id = " + view.getNextFocusRightId() // + ", next focus up id = " + view.getNextFocusUpId()); } }
package org.gs1.source.tsd; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "<API key>", namespace = "urn:gs1:tsd:tsd_common:xsd:1", propOrder = { "stringAVP" }) public class <API key> { @XmlElement(required = true) protected List<<API key>> stringAVP; /** * Gets the value of the stringAVP property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the stringAVP property. * * <p> * For example, to add a new item, do as follows: * <pre> * getStringAVP().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link <API key> } * * */ public List<<API key>> getStringAVP() { if (stringAVP == null) { stringAVP = new ArrayList<<API key>>(); } return this.stringAVP; } }
<!-- This comment will put IE 6, 7 and 8 in quirks mode --> <!DOCTYPE html PUBLIC "- <html xmlns="http: <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>GraphBuilder 2.0 (alpha): Class Members</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javaScript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body onload='searchBox.OnSelectItem(0);'> <!-- Generated by Doxygen 1.6.1 --> <script type="text/javascript"><! var searchBox = new SearchBox("searchBox", "search",false,'Search'); --></script> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main&nbsp;Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <img id="MSearchSelect" src="search/search.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </div> </li> </ul> </div> <div class="tabs"> <ul> <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li> <li><a href="classes.html"><span>Class&nbsp;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li> <li class="current"><a href="functions.html"><span>Class&nbsp;Members</span></a></li> </ul> </div> <div class="tabs"> <ul> <li class="current"><a href="functions.html"><span>All</span></a></li> <li><a href="functions_func.html"><span>Functions</span></a></li> <li><a href="functions_vars.html"><span>Variables</span></a></li> <li><a href="functions_enum.html"><span>Enumerations</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="functions.html#index_["><span>[</span></a></li> <li><a href="functions_0x5f.html#index__"><span>_</span></a></li> <li><a href="functions_0x61.html#index_a"><span>a</span></a></li> <li><a href="functions_0x62.html#index_b"><span>b</span></a></li> <li><a href="functions_0x63.html#index_c"><span>c</span></a></li> <li><a href="functions_0x64.html#index_d"><span>d</span></a></li> <li><a href="functions_0x65.html#index_e"><span>e</span></a></li> <li><a href="functions_0x66.html#index_f"><span>f</span></a></li> <li><a href="functions_0x67.html#index_g"><span>g</span></a></li> <li><a href="functions_0x68.html#index_h"><span>h</span></a></li> <li><a href="functions_0x69.html#index_i"><span>i</span></a></li> <li><a href="functions_0x6b.html#index_k"><span>k</span></a></li> <li><a href="functions_0x6c.html#index_l"><span>l</span></a></li> <li><a href="functions_0x6d.html#index_m"><span>m</span></a></li> <li><a href="functions_0x6e.html#index_n"><span>n</span></a></li> <li><a href="functions_0x6f.html#index_o"><span>o</span></a></li> <li><a href="functions_0x70.html#index_p"><span>p</span></a></li> <li><a href="functions_0x72.html#index_r"><span>r</span></a></li> <li><a href="functions_0x73.html#index_s"><span>s</span></a></li> <li><a href="functions_0x74.html#index_t"><span>t</span></a></li> <li class="current"><a href="functions_0x75.html#index_u"><span>u</span></a></li> <li><a href="functions_0x76.html#index_v"><span>v</span></a></li> <li><a href="functions_0x77.html#index_w"><span>w</span></a></li> <li><a href="functions_0x78.html#index_x"><span>x</span></a></li> <li><a href="functions_0x7a.html#index_z"><span>z</span></a></li> </ul> </div> </div> <div class="contents"> Here is a list of all class members with links to the classes they belong to: <h3><a class="anchor" id="index_u">- u -</a></h3><ul> <li>UNIQUE : <a class="el" href="classcom_1_1intel_1_1hadoop_1_1graphbuilder_1_1pipeline_1_1output_1_1titan_1_1TitanCommandLineOptions.html#<API key>">com::intel::hadoop::graphbuilder::pipeline::output::titan::<API key></a> </li> <li><API key>() : <a class="el" href="interfacecom_1_1intel_1_1hadoop_1_1graphbuilder_1_1pipeline_1_1input_1_1InputConfiguration.html#<API key>">com::intel::hadoop::graphbuilder::pipeline::input::InputConfiguration</a> </li> <li>updateJobForMapper() : <a class="el" href="interfacecom_1_1intel_1_1hadoop_1_1graphbuilder_1_1pipeline_1_1input_1_1InputConfiguration.html#<API key>">com::intel::hadoop::graphbuilder::pipeline::input::InputConfiguration</a> </li> <li>usesHBase() : <a class="el" href="interfacecom_1_1intel_1_1hadoop_1_1graphbuilder_1_1pipeline_1_1input_1_1InputConfiguration.html#<API key>">com::intel::hadoop::graphbuilder::pipeline::input::InputConfiguration</a> </li> </ul> </div> <!--- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&nbsp;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&nbsp;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&nbsp;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&nbsp;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&nbsp;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&nbsp;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&nbsp;</span>Enumerations</a></div> <!-- iframe showing the search results (closed by default) --> <div id="<API key>"> <iframe src="" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <hr size="1"/><address style="text-align: right;"><small>Generated on 26 Dec 2013 for GraphBuilder 2.0 (alpha) by&nbsp; <a href="http: <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> </body> </html>
using System; namespace Benchy.Framework { <summary> Represents a breakdown of TimeSpan values. </summary> public interface IDataBreakout { <summary> The minimum value of the breakout. </summary> TimeSpan RangeMinValue { get; set; } <summary> The maximum value of the breakout. </summary> TimeSpan RangeMaxValue { get; set; } <summary> The number of items that fit between that breakout. </summary> int Occurences { get; set; } <summary> Represents a way to render it textually. </summary> <returns>A string representing the Breakout.</returns> string GetText(); } }
package com.intellij.openapi.fileTypes.impl; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.fileTypes.<API key>; import com.intellij.openapi.fileTypes.FileNameMatcher; import com.intellij.openapi.fileTypes.FileTypeManager; import com.intellij.openapi.util.<API key>; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.containers.MultiMap; import org.jdom.Element; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import java.util.*; import java.util.function.Predicate; import java.util.stream.Collectors; final class <API key> { private static final Logger LOG = Logger.getInstance(<API key>.class); static final class RemovedMapping { private final FileNameMatcher myFileNameMatcher; private final String myFileTypeName; private final boolean myApproved; private RemovedMapping(@NotNull FileNameMatcher matcher, @NotNull String fileTypeName, boolean approved) { myFileNameMatcher = matcher; myFileTypeName = fileTypeName; myApproved = approved; } @NotNull FileNameMatcher getFileNameMatcher() { return myFileNameMatcher; } @NotNull String getFileTypeName() { return myFileTypeName; } boolean isApproved() { return myApproved; } @Override public String toString() { return "Removed mapping '" + myFileNameMatcher + "' -> " + myFileTypeName; } // must not look at myApproved @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; RemovedMapping mapping = (RemovedMapping)o; if (!myFileNameMatcher.equals(mapping.myFileNameMatcher)) return false; return myFileTypeName.equals(mapping.myFileTypeName); } @Override public int hashCode() { int result = myFileNameMatcher.hashCode(); result = 31 * result + myFileTypeName.hashCode(); return result; } } private final MultiMap<FileNameMatcher, RemovedMapping> myRemovedMappings = new MultiMap<>(); @NonNls private static final String <API key> = "removed_mapping"; /** Applied for removed mappings approved by user */ @NonNls private static final String ATTRIBUTE_APPROVED = "approved"; @NonNls private static final String ATTRIBUTE_TYPE = "type"; void clear() { myRemovedMappings.clear(); } @NotNull RemovedMapping add(@NotNull FileNameMatcher matcher, @NotNull String fileTypeName, boolean approved) { RemovedMapping mapping = new RemovedMapping(matcher, fileTypeName, approved); List<RemovedMapping> mappings = (List<RemovedMapping>)myRemovedMappings.getModifiable(matcher); boolean found = false; for (int i = 0; i < mappings.size(); i++) { RemovedMapping removedMapping = mappings.get(i); if (removedMapping.getFileTypeName().equals(fileTypeName)) { mappings.set(i, mapping); found = true; break; } } if (!found) { mappings.add(mapping); } return mapping; } void load(@NotNull Element e) { myRemovedMappings.clear(); List<RemovedMapping> removedMappings = readRemovedMappings(e); Set<RemovedMapping> uniques = new LinkedHashSet<>(removedMappings.size()); for (RemovedMapping mapping : removedMappings) { if (!uniques.add(mapping)) { LOG.warn(new <API key>("Duplicate <removed_mapping> tag for " + mapping)); } } for (RemovedMapping mapping : uniques) { myRemovedMappings.putValue(mapping.myFileNameMatcher, mapping); } } @NotNull static List<RemovedMapping> readRemovedMappings(@NotNull Element e) { List<Element> children = e.getChildren(<API key>); if (children.isEmpty()) { return Collections.emptyList(); } List<RemovedMapping> result = new ArrayList<>(); for (Element mapping : children) { String ext = mapping.getAttributeValue(AbstractFileType.ATTRIBUTE_EXT); FileNameMatcher matcher = ext == null ? FileTypeManager.parseFromString(mapping.getAttributeValue(AbstractFileType.ATTRIBUTE_PATTERN)) : new <API key>(ext); boolean approved = Boolean.parseBoolean(mapping.getAttributeValue(ATTRIBUTE_APPROVED)); String fileTypeName = mapping.getAttributeValue(ATTRIBUTE_TYPE); if (fileTypeName == null) continue; RemovedMapping removedMapping = new RemovedMapping(matcher, fileTypeName, approved); result.add(removedMapping); } return result; } void save(@NotNull Element element) { List<RemovedMapping> removedMappings = new ArrayList<>(myRemovedMappings.values()); removedMappings.sort(Comparator.comparing((RemovedMapping mapping) -> mapping.getFileNameMatcher().<API key>()).thenComparing(RemovedMapping::getFileTypeName)); for (RemovedMapping mapping : removedMappings) { Element content = writeRemovedMapping(mapping.myFileTypeName, mapping.myFileNameMatcher, true, mapping.myApproved); if (content != null) { element.addContent(content); } } } void <API key>(@NotNull Element map, @NotNull String fileTypeName, @NotNull Collection<? extends FileNameMatcher> associations, boolean specifyTypeName) { for (FileNameMatcher matcher : associations) { Element content = writeRemovedMapping(fileTypeName, matcher, specifyTypeName, isApproved(matcher, fileTypeName)); if (content != null) { map.addContent(content); } } } boolean hasRemovedMapping(@NotNull FileNameMatcher matcher) { return myRemovedMappings.containsKey(matcher); } private boolean isApproved(@NotNull FileNameMatcher matcher, @NotNull String fileTypeName) { RemovedMapping mapping = ContainerUtil.find(myRemovedMappings.get(matcher), m -> m.getFileTypeName().equals(fileTypeName)); return mapping != null && mapping.isApproved(); } @NotNull List<RemovedMapping> getRemovedMappings() { return new ArrayList<>(myRemovedMappings.values()); } @NotNull List<FileNameMatcher> <API key>(@NotNull String fileTypeName) { return myRemovedMappings.values().stream() .filter(mapping -> mapping.myFileTypeName.equals(fileTypeName)) .map(mapping -> mapping.myFileNameMatcher) .collect(Collectors.toList()); } @NotNull List<RemovedMapping> removeIf(@NotNull Predicate<? super RemovedMapping> predicate) { List<RemovedMapping> result = new ArrayList<>(); for (Iterator<Map.Entry<FileNameMatcher, Collection<RemovedMapping>>> iterator = myRemovedMappings.entrySet().iterator(); iterator.hasNext(); ) { Map.Entry<FileNameMatcher, Collection<RemovedMapping>> entry = iterator.next(); Collection<RemovedMapping> mappings = entry.getValue(); mappings.removeIf(mapping -> { boolean toRemove = predicate.test(mapping); if (toRemove) { result.add(mapping); } return toRemove; }); if (mappings.isEmpty()) { iterator.remove(); } } return result; } void <API key>() { for (RemovedMapping mapping : new ArrayList<>(myRemovedMappings.values())) { if (!mapping.isApproved()) { myRemovedMappings.remove(mapping.getFileNameMatcher(), mapping); myRemovedMappings.putValue(mapping.getFileNameMatcher(), new RemovedMapping(mapping.getFileNameMatcher(), mapping.getFileTypeName(), true)); } } } private static Element writeRemovedMapping(@NotNull String fileTypeName, @NotNull FileNameMatcher matcher, boolean specifyTypeName, boolean approved) { Element mapping = new Element(<API key>); if (!AbstractFileType.writePattern(matcher, mapping)) { return null; } if (approved) { mapping.setAttribute(ATTRIBUTE_APPROVED, "true"); } if (specifyTypeName) { mapping.setAttribute(ATTRIBUTE_TYPE, fileTypeName); } return mapping; } }
<!DOCTYPE HTML PUBLIC "- <!--NewPage <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_11) on Fri Apr 30 11:06:46 CST 2010 --> <TITLE> com.siemens.cmiv.avt.mvt.io </TITLE> <META NAME="date" CONTENT="2010-04-30"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="com.siemens.cmiv.avt.mvt.io"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <A NAME="navbar_top"></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../../../com/siemens/cmiv/avt/mvt/datatype/package-summary.html"><B>PREV PACKAGE</B></A>&nbsp; &nbsp;<A HREF="../../../../../../com/siemens/cmiv/avt/mvt/outlier/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?com/siemens/cmiv/avt/mvt/io/package-summary.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <! if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <HR> <H2> Package com.siemens.cmiv.avt.mvt.io </H2> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Interface Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../../com/siemens/cmiv/avt/mvt/io/SubjectList.html" title="interface in com.siemens.cmiv.avt.mvt.io">SubjectList</A></B></TD> <TD>&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Class Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../../com/siemens/cmiv/avt/mvt/io/SubjectListFactory.html" title="class in com.siemens.cmiv.avt.mvt.io">SubjectListFactory</A></B></TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../../com/siemens/cmiv/avt/mvt/io/SubjectListXml.html" title="class in com.siemens.cmiv.avt.mvt.io">SubjectListXml</A></B></TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../../com/siemens/cmiv/avt/mvt/io/XMLComputationList.html" title="class in com.siemens.cmiv.avt.mvt.io">XMLComputationList</A></B></TD> <TD>Parses XML document.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../../com/siemens/cmiv/avt/mvt/io/XMLMeasurement.html" title="class in com.siemens.cmiv.avt.mvt.io">XMLMeasurement</A></B></TD> <TD>Parses XML document.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../../com/siemens/cmiv/avt/mvt/io/XMLSubjectList.html" title="class in com.siemens.cmiv.avt.mvt.io">XMLSubjectList</A></B></TD> <TD>Parses XML document.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../../com/siemens/cmiv/avt/mvt/io/XMLSubjectListImpl.html" title="class in com.siemens.cmiv.avt.mvt.io">XMLSubjectListImpl</A></B></TD> <TD>Parses XML document.</TD> </TR> </TABLE> &nbsp; <P> <DL> </DL> <HR> <A NAME="navbar_bottom"></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="<API key>"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../../../com/siemens/cmiv/avt/mvt/datatype/package-summary.html"><B>PREV PACKAGE</B></A>&nbsp; &nbsp;<A HREF="../../../../../../com/siemens/cmiv/avt/mvt/outlier/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?com/siemens/cmiv/avt/mvt/io/package-summary.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <! if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <HR> </BODY> </HTML>
<?php include("inc_header.php"); ?> <?php include("inc_lang_detect.php"); ?> <!-- Inner Page 4404 Error --> <div class="container"> <div class="inner-error"> <h3><strong>HTTP 404<strong></h3> <?php if (getDefaultLanguage() == "pt-br") { ?> <h3 >Objeto n&atilde;o encontrado!</h3> <p>A URL requisitada n&atilde;o foi encontrada neste servidor.</p> <p>Se o endere&ccedil;o (URL) foi digitado manualmente, pedimos a gentileza de verificar novamente a sintaxe do endere&ccedil;o.</p> <?php } else { ?> <h3 >Object not found!</h3> <p>The requested URL was not found on this server.</p> <p>If you entered the URL manually please check your spelling and try again.</p> <?php } ?> </div> </div> </div> <!-- Inner Page Content End --> <?php include("inc_footer.php"); ?>
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package beans; import java.io.Serializable; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; /** * * @author Chema */ @Component public class Persona implements Serializable { @Value("#{p.nombre}") private String nombre; @Value("#{p.apellido}") private String apellido; public Persona() { } public Persona(String nombre, String apellido) { this.nombre = nombre; this.apellido = apellido; } public String getApellido() { return apellido; } public void setApellido(String apellido) { this.apellido = apellido; } public String getNombre() { return nombre; } public void setNombre(String nombre) { this.nombre = nombre; } }
import { Component } from '@angular/core'; import {ROUTER_DIRECTIVES, RouteData} from '@angular/router-deprecated'; import {TravelFormComponent} from "./travel-form.component"; import {NavbarComponent} from '../../shared/index'; @Component({ selector: "home", templateUrl: 'app/home/components/home.component.html', styleUrls: ['app/home/components/home.component.css'], directives: [ROUTER_DIRECTIVES, TravelFormComponent, NavbarComponent] }) export class HomeComponent{ signInOnly: boolean; constructor(private _data: RouteData) { //when arriving directly from /login URL this.signInOnly = this._data.get('signInOnly') || true; // set default to false to re-activate the destination form } }
package com.openthinks.libs.utilities.lookup; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Optional; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.<API key>; import com.openthinks.libs.utilities.Checker; import com.openthinks.libs.utilities.InstanceUtilities; import com.openthinks.libs.utilities.InstanceUtilities.InstanceWrapper; import com.openthinks.libs.utilities.exception.<API key>; import com.openthinks.libs.utilities.pools.object.ObjectPool; public abstract class LookupPool { protected final ObjectPool objectPool; protected final ReadWriteLock lock; public abstract String name(); protected LookupPool() { objectPool = new ObjectPool(); lock = new <API key>(); } /** * lookup a object by its type, if not find firstly, try to instance by instanceType and * constructor parameters args * * @param <T> lookup object type * @param type Class lookup key type * @param args Object[] instance constructor parameters * @return T lookup object or null */ public <T> T lookup(Class<T> type, Object... args) { return lookup(type, null, args); } /** * lookup a object by its type, if not find firstly, try to instance by instanceType and * constructor parameters args * * @param <T> lookup object type * @param <E> lookup object type * @param searchType Class lookup key type * @param instancewrapper Class instance type when not lookup the key * @param args Object[] instance constructor parameters * @return T lookup object or null */ public <T, E extends T> T lookup(final Class<T> searchType, InstanceWrapper<E> instancewrapper, Object... args) { T object = null; lock.readLock().lock(); try { object = objectPool.get(searchType); } finally { lock.readLock().unlock(); } if (object == null) { lock.writeLock().lock(); try { object = InstanceUtilities.create(searchType, instancewrapper, args); register(searchType, object); } finally { lock.writeLock().unlock(); } } return object; } /** * look up object by its bean name * * @param <T> lookup object type * @param beanName String lookup object mapping name * @return T lookup object or null */ public <T> T lookup(String beanName) { lock.readLock().lock(); try { return objectPool.get(beanName); } finally { lock.readLock().unlock(); } } /** * lookup a optional object by its type, if not find firstly, try to instance by instanceType and * constructor parameters args * * @param <T> lookup object type * @param type Class lookup key type * @param args Object[] instance constructor parameters * @return Optional of lookup object */ public <T> Optional<T> lookupIf(Class<T> type, Object... args) { return Optional.ofNullable(lookup(type, args)); } /** * lookup a optional object by its type, if not find firstly, try to instance by instanceType and * constructor parameters args * * @param <T> lookup object type * @param <E> lookup object type * @param searchType Class lookup key type * @param instancewrapper Class instance type when not lookup the key * @param args Object[] instance constructor parameters * @return Optional of lookup object */ public <T, E extends T> Optional<T> lookupIf(final Class<T> searchType, InstanceWrapper<E> instancewrapper, Object... args) { return Optional.ofNullable(lookup(searchType, instancewrapper, args)); } /** * look up optional object by its bean name * * @param <T> lookup object type * @param beanName String lookup object mapping name * @return Optional of lookup object */ public <T> Optional<T> lookupIf(String beanName) { return Optional.ofNullable(lookup(beanName)); } /** * * lookupSPI:this will used {@link ServiceLoader} to load SPI which defined in folder * <B>META-INF/services</B>. <br> * It will first to try to load instance from cached {@link ObjectPool}, if not found, then try to * load SPI class and instantiate it.<br> * Notice: only load and instantiate first SPI class in defined file<br> * * @param <T> lookup SPI interface class * @param spiInterface SPI interface or abstract class type * @param args constructor arguments * @return implementation of parameter spiInterface */ public <T> T lookupSPI(Class<T> spiInterface, Object... args) { return lookupFocusSPI(spiInterface, null, args); } /** * * lookupFocusSPI:this will used {@link ServiceLoader} to load SPI which defined in folder * <B>META-INF/services</B>. <br> * It will first to try to load instance from cached {@link ObjectPool}, if not found, then try to * load SPI class and instantiate it.<br> * Notice: only load and instantiate focused SPI class in defined file<br> * * @param <T> lookup SPI interface class * @param spiInterface SPI interface or abstract class type * @param focusClassName focused SPI implementation class aname * @param args constructor arguments * @return implementation of parameter spiInterface * */ public <T> T lookupFocusSPI(Class<T> spiInterface, String focusClassName, Object... args) { T object = null; lock.readLock().lock(); try { object = objectPool.get(spiInterface); } finally { lock.readLock().unlock(); } if (object == null) { lock.writeLock().lock(); try { ServiceLoader<T> serviceLoader = ServiceLoader.load(spiInterface, focusClassName, args); object = serviceLoader.iterator().next(); Checker.require(object).notNull("Cannot found SPI implementation for " + spiInterface); register(spiInterface, object); } finally { lock.writeLock().unlock(); } } return object; } /** * * lookupSPISkipCache:this will used {@link ServiceLoader} to load SPI which defined in folder * <B>META-INF/services</B>. <br> * It will do load SPI skip cache each time, not try to lookup from cache firstly.<br> * Notice: only load and instantiate first SPI class in defined file<br> * * @param <T> lookup SPI interface class * @param spiInterface SPI interface or abstract class type * @param args constructor arguments * @return implementation of parameter spiInterface * @throws <API key> when not found implementation SPI */ public <T> T lookupSPISkipCache(Class<T> spiInterface, Object... args) { return <API key>(spiInterface, null, args); } /** * * <API key>:this will used {@link ServiceLoader} to load SPI which defined in * folder <B>META-INF/services</B>. <br> * It will do load SPI skip cache each time, not try to lookup from cache firstly.<br> * Notice: only load and instantiate focused SPI class in defined file<br> * * @param <T> lookup SPI interface class * @param spiInterface SPI interface or abstract class type * @param focusClassName focused SPI implementation class name * @param args constructor arguments * @return implementation of parameter spiInterface * * @throws <API key> when not found implementation SPI */ public <T> T <API key>(Class<T> spiInterface, String focusClassName, Object... args) { T object = null; ServiceLoader<T> serviceLoader = ServiceLoader.load(spiInterface, focusClassName, args); object = serviceLoader.iterator().next(); Checker.require(object).notNull("Cannot found SPI implementation for " + spiInterface); return object; } /** * * lookupAllSPI:fina all instance of SPI implementation. <br> * Notice:<BR> * <ul> * <li>all implementation need default constructor.</li> * <li>do not search from cache</li> * </ul> * * @param <T> SPI type * @param spiInterface SPI interface or abstract class type * @return list of all SPI implementation instance */ public <T> List<T> lookupAllSPI(Class<T> spiInterface) { List<T> list = new ArrayList<>(); ServiceLoader<T> serviceLoader = ServiceLoader.load(spiInterface); Iterator<T> iterator = serviceLoader.iterator(); while (iterator.hasNext()) { try { list.add(iterator.next()); } catch (Exception e) { // ignore } } return list; } /** * * register an instance, which key is object.getClass(). <br> * * @param <T> registered object class type * @param object instance which need registered */ public <T> void register(T object) { if (object != null) { lock.writeLock().tryLock(); try { objectPool.put(object.getClass(), object); } finally { lock.writeLock().unlock(); } } } /** * register an instance, which key is given parameter classType * * @param <T> registered object class type * @param classType Class as the key for registered instance * @param object instance which need registered */ public <T> void register(Class<T> classType, T object) { if (object != null) { lock.writeLock().tryLock(); try { objectPool.put(classType, object); } finally { lock.writeLock().unlock(); } } } /** * register object and mapping it to given bean name * * @param <T> register object type * @param beanName String bean name * @param object register object */ public <T> void register(String beanName, T object) { if (object != null) { lock.writeLock().lock(); try { objectPool.put(beanName, object); } finally { lock.writeLock().unlock(); } } } protected void cleanUp() { lock.writeLock().lock(); try { objectPool.cleanUp(); } finally { lock.writeLock().unlock(); } } }
package com.arges.sepan.argmusicplayer.Callbacks; import com.arges.sepan.argmusicplayer.Models.ArgAudio; //Interfaces public interface OnPreparedListener { void onPrepared(ArgAudio audio, int duration); }
package io.monocycle.agent; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.<API key>; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableScheduling; @Configuration @<API key> @ComponentScan @EnableAsync @EnableScheduling public class AgentApplication { private static final Logger LOGGER = LoggerFactory.getLogger(AgentApplication.class); public static void main(String[] args) { LOGGER.debug("Starting Monocycle Agent..."); SpringApplication.run(AgentApplication.class, args); } }
#device-check, #<API key> { background: #000000; } .<API key> { width: 100%; height: 140px; margin: 0 auto 10px auto; padding-top: 15px; background: rgba(0, 0, 0, 0.5); } .landing-logo { width: 130px; height: 125px; } .<API key> { position: absolute; display: inline-block; width: 100%; margin: 0 auto; padding: 0 0 20px 0; bottom: 0; left: 0; text-align: center; } .<API key> input { height: 40px; font-size: 0.6em; font-weight: 300; padding-left: 10px; padding-right: 30px; width: 250px; text-align: center; border: none; background: rgba(0, 0, 0, 0.5); } .<API key> > img { display: inline-block; height: 34px; width: 30px; padding: 3px 5px; margin-left: -45px; vertical-align: bottom; cursor: pointer; background: rgba(0, 0, 0, 0.5); opacity: 0.5; } .<API key> > img:hover { opacity: 1; } .<API key> > a > img.social-icon { width: 50px; height: 50px; margin: 15px 5px 0 5px; opacity: 0.3; } .<API key> > a > img.social-icon:hover { opacity: 1; } .container { width: 100%; } .container > .logo-container > input { width: 60%; height: 50px; margin-top: 8px; } .container > .logo-container .withLeftMargin { margin-left: 5%; } nav, nav > ul, nav > ul > li { height: 50px; } nav > ul > li { padding-top: 30px; } nav > ul > li > img { width: 25px; height: 25px; } nav > ul > li.special > img { width: 32px; height: 23px; margin-top: 2px; } .container > section.page-container { height: 350px; padding-top: 30px; } .container > button { height: 70px; } .container > button > img { width: 40px; height: 30px; margin-top: 5px; } /* info page */ div#page4 #address-icon { margin-top: 25px; } div#page4 hr { margin-bottom: 10px; } div#page4 input { width: 60%; font-size: 0.8em; }
' ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.239 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> ' Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.<API key>(), _ Global.System.CodeDom.Compiler.<API key>("Microsoft.VisualStudio.Editors.SettingsDesigner.<API key>", "10.0.0.0"), _ Global.System.ComponentModel.<API key>(Global.System.ComponentModel.<API key>.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.<API key> Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.<API key>.Synchronized(New MySettings()),MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared <API key> As New Object <Global.System.Diagnostics.<API key>(), Global.System.ComponentModel.<API key>(Global.System.ComponentModel.<API key>.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.<API key> Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock <API key> If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.<API key>(), _ Global.System.Diagnostics.<API key>(), _ Global.System.Runtime.CompilerServices.<API key>()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.<API key>("My.Settings")> _ Friend ReadOnly Property Settings() As Global.App.My.MySettings Get Return Global.App.My.MySettings.Default End Get End Property End Module End Namespace
module.exports = function(fancyRequire) { fancyRequire('merchant_row'); };
package fr.xebia.unittestwithdagger; import android.widget.TextView; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.Robolectric; import org.robolectric.<API key>; import org.robolectric.annotation.Config; import fr.xebia.unittestwithdagger.internal.<API key>; import static junit.framework.Assert.assertEquals; import static org.mockito.BDDMockito.given; @RunWith(<API key>.class) @Config(application = MyTestApplication.class, constants = BuildConfig.class, sdk=21) public class UserActivityTest { UserActivity activity; UserStorage userStorage; @Before public void setUp() throws Exception { activity = Robolectric.buildActivity(UserActivity.class).create().get(); userStorage = MyApplication.get().component().userStorage(); } @Test public void <API key>(){ given(userStorage.loadUser()).willReturn(new User("florent")); TextView textView = (TextView)activity.findViewById(R.id.text); activity.displayLoggedUser(); assertEquals("florent", textView.getText().toString()); } }
great_rsd(p1,ee1). great_rsd(g1,dd1). great_rsd(e1,x1). great_rsd(e1,f1). great_rsd(t1,m1). great_rsd(u1,t1). great_rsd(w1,dd1). great_rsd(p1,m1). great_rsd(p1,h1). great_rsd(ee1,g1). great_rsd(ee1,dd1). great_rsd(f1,hh1). great_rsd(w1,m1). great_rsd(u1,q1). great_rsd(q1,ee1). great_rsd(cc1,dd1). great_rsd(f1,g1). great_rsd(q1,c1). great_rsd(aa1,x1). great_rsd(dd1,x1). great_rsd(cc1,u1). great_rsd(p1,cc1). great_rsd(ee1,x1). great_rsd(v1,x1). great_rsd(p1,ff1). great_rsd(k1,l1). great_rsd(a1,t1). great_rsd(f1,a1). great_rsd(a1,h1). great_rsd(p1,x1). great_rsd(cc1,kk1). great_rsd(f1,kk1). great_rsd(e1,dd1). great_rsd(jj1,dd1). great_rsd(p1,kk1). great_rsd(t1,h1). great_rsd(v1,hh1). great_rsd(c1,x1). great_rsd(c1,jj1). great_rsd(v1,g1). great_rsd(p1,w1). great_rsd(u1,g1). great_rsd(u1,ee1). great_rsd(e1,p1). great_rsd(f1,ee1). great_rsd(v1,aa1). great_rsd(k1,dd1). great_rsd(cc1,z1). great_rsd(q1,ff1). great_rsd(e1,k1). great_rsd(z1,jj1). great_rsd(p1,dd1). great_rsd(e1,c1). great_rsd(e1,q1). great_rsd(l1,jj1). great_rsd(aa1,ii1). great_rsd(f1,ii1). great_rsd(p1,v1). great_rsd(k1,kk1). great_rsd(ee1,ii1). great_rsd(cc1,ff1). great_rsd(c1,z1). great_rsd(q1,h1). great_rsd(cc1,ee1). great_rsd(v1,dd1). great_rsd(f1,jj1). great_rsd(u1,hh1). great_rsd(q1,ii1). great_rsd(cc1,l1). great_rsd(u1,l1). great_rsd(h1,x1). great_rsd(cc1,c1). great_rsd(w1,ff1). great_rsd(u1,ii1). great_rsd(e1,l1). great_rsd(ee1,hh1). great_rsd(aa1,z1). great_rsd(a1,x1). great_rsd(hh1,jj1). great_rsd(cc1,ii1). great_rsd(t1,z1). great_rsd(w1,kk1). great_rsd(aa1,h1). great_rsd(v1,ff1). great_rsd(ee1,m1). great_rsd(f1,t1). great_rsd(t1,ii1).
import { PluginMeta } from '@savantly/sprout-api'; export const validatePluginJson = (pluginJson: any) => { if (!pluginJson.id) { throw new Error('Plugin id is missing in plugin.json'); } if (!pluginJson.info) { throw new Error('Plugin info node is missing in plugin.json'); } if (!pluginJson.info.version) { throw new Error('Plugin info.version is missing in plugin.json'); } const types = ['panel', 'datasource', 'app']; const type = pluginJson.type; if (!types.includes(type)) { throw new Error('Invalid plugin type in plugin.json: ' + type); } if (!pluginJson.id.endsWith('-' + type)) { throw new Error('[plugin.json] id should end with: -' + type); } }; export const getPluginJson = (path: string): PluginMeta => { let pluginJson; try { pluginJson = require(path); } catch (e) { throw new Error('Unable to find: ' + path); } validatePluginJson(pluginJson); return pluginJson as PluginMeta; };
body { color: #2a2d2b; background-color: lightgrey; } h1 { color: #2a2d2b; } h2 { color: #336699; } h3 { color: #2a2d2b; } .link { color: #336699; } a:hover, .link:hover { font-weight: bold; text-decoration: underline; } ul { padding-left: 5px; } div#header { background-color: #fff; padding: 15px 15px; color: #2a2d2b; } button, div#header button { color: #ffffff; } .btn, div#header .btn, div#content div#sidebar .btn, ul.dropdown-menu { font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif; } div#header .alert { margin: 5px 0px; text-align: left; } .alert { color: #fff; } .alert-info, .alert-success, .brand-info, .btn-success { background-color: #4a9e43; } .alert-danger, .brand-danger { background-color: #ff2a00; } .brand-primary, .btn-primary { background-color: #336699; } .btn { color: #fff; } .btn-default { background-color: #444547; } .btn-default:hover { background-color: #444547; border-color: #2a2d2b; color: #fff; } .sycned { color: #4a9e43; } .unsycned { color: #ff2a00; } div#message { margin: 0px 5px; } .divider { border: 10px solid #2a2d2b; } #content { min-height: 450px; padding: 0px; box-shadow: 0px 5px 5px #888888; background-color: #fff; } #content .divider { border: 3px solid #2a2d2b; margin: 20px -50px; } #content h2, #content li>h3, #content li>h4 { display: inline-block; margin-right: 10px; } #content .btn { vertical-align: baseline; } #footer { font-size: 12px; text-align: center; margin: 10px 0px; } ul.alert { padding-left: 30px; } .spacing-top { margin-top: 10px; } div#sitemenu { text-align: right; color: #ffffff; } button#headerDropdownMenu { background-color: #404040; border: 0px; color: #ffffff; } div#sidebar { background-color: #444547; min-height: 450px; } div#sidebar h1, div#sidebar h2, div#sidebar h3, div#sidebar a { color: #fff; } li>h1, li>h2, li>h3, li>h4 { margin-top: 5px; margin-bottom: 5px; } div#center { background-color: #fff; min-height: 450px; padding: 30px 50px; } div.button-group-center { text-align: center; margin: 30px; } div.button-group-right { float: right; } .modal-footer { border-top: 0px; } .fa { margin-right: 10px; font-size: 24px; } li.folder, li.file { list-style: none; margin-left: 36px; } .row-flex { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; } ul.abn-tree { padding-left: 30px; } ul.abn-tree li.abn-tree-row a { color: #2a2d2b; font-size: 18px; } ul.nav.abn-tree i { font-size: 18px; } .spinner { float: right; position: relative; left: -50%; text-align: left; z-index: 1000; color: #ff2a00; } .spinner > .child { position: relative; left: 50%; float: right; z-index: 1000; } .fa-spin { font-size: 80px; width: 0px; margin: 0px; } .nav, .pagination, .carousel, .panel-title a { cursor: pointer; } #progressBar { background-color: #444547; display: table; height: 450px; width: 100%; } #progressBar > div { display: table-cell; vertical-align: middle; } #progressBar > div { margin-left: auto; margin-right: auto; width: 200px; } .progress { height: 30px; } .progress span { font-size: 25px; line-height: 20px; } .progress-bar { padding: 3px; } .deploy-errors { border: 2px solid red; padding: 10px; background-color: #333; color: white; } .deploy-errors h3 { color: white; margin: 0px 0px 10px 0px; } .error-msg { font-weight: bold; } .error-loc { margin-left: 20px; } .modal-sm { width: 600px; } .modal-content { width:inherit; height:inherit; margin: 0 auto; } .tree-scroller-cust1 { height: 200px; overflow-y: auto; border-color: #ddd; } /* The starting CSS styles for the enter animation */ .fade.ng-enter { transition:0.5s linear all; opacity:0; } /* The finishing CSS styles for the enter animation */ .fade.ng-enter.ng-enter-active { opacity:1; } /* now the element will fade out before it is removed from the DOM */ .fade.ng-leave { transition:0.5s linear all; opacity:1; } .fade.ng-leave.ng-leave-active { opacity:0; } .caption { font-style: italic; font-weight: normal; } .hint { color: #666; } .code { font-weight: normal; font-family: sans-serif; } .copy-icon { font-size: 14px; margin-left: 10px; cursor: pointer; } .code textarea { border: none; width: 100%; resize: none; } .code textarea:focus { outline: none; } section { border: 1px solid #ccc; padding: 6px 12px; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075); box-shadow: inset 0 1px 1px rgba(0,0,0,.075); } .navbar-default { background-color: #2a2d2b; color: white; } /* This is specifically for Swagger UI */ .swagger-validator { display: none; } div.api-doc > div { padding: 15px; } #img_logo { margin: 0pt 10px; height: 50px; }
<div id="<API key>"> <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="800px" height="600px" id="silverlightObject"> <param name="source" value="static/sl/Overlay.xap"/> <param name="onError" value="onSilverlightError" /> <param name="background" value="white" /> <param name="windowless" value="false" /> <! <param name="background" value="transparent" /> <param name="windowless" value="true" /> <param name="minRuntimeVersion" value="3.0.40624.0" /> <param name="autoUpgrade" value="true" /> <param name="onLoad" value="pluginLoaded" /> <!--a href="http://go.microsoft.com/fwlink/?LinkID=149156&amp;v=5.0.61118.0" style="text-decoration:none"> <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none" /> </a </object> </div>
package org.politaktiv.map.model.impl; import com.liferay.portal.kernel.util.StringBundler; import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.model.CacheModel; import org.politaktiv.map.model.Layer; import java.io.Externalizable; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import java.util.Date; /** * The cache model class for representing Layer in entity cache. * * @author Paul Butenko * @see Layer * @generated */ public class LayerCacheModel implements CacheModel<Layer>, Externalizable { @Override public String toString() { StringBundler sb = new StringBundler(11); sb.append("{layerId="); sb.append(layerId); sb.append(", createDate="); sb.append(createDate); sb.append(", label="); sb.append(label); sb.append(", userId="); sb.append(userId); sb.append(", portletInstance="); sb.append(portletInstance); sb.append("}"); return sb.toString(); } @Override public Layer toEntityModel() { LayerImpl layerImpl = new LayerImpl(); layerImpl.setLayerId(layerId); if (createDate == Long.MIN_VALUE) { layerImpl.setCreateDate(null); } else { layerImpl.setCreateDate(new Date(createDate)); } if (label == null) { layerImpl.setLabel(StringPool.BLANK); } else { layerImpl.setLabel(label); } layerImpl.setUserId(userId); if (portletInstance == null) { layerImpl.setPortletInstance(StringPool.BLANK); } else { layerImpl.setPortletInstance(portletInstance); } layerImpl.resetOriginalValues(); return layerImpl; } @Override public void readExternal(ObjectInput objectInput) throws IOException { layerId = objectInput.readLong(); createDate = objectInput.readLong(); label = objectInput.readUTF(); userId = objectInput.readLong(); portletInstance = objectInput.readUTF(); } @Override public void writeExternal(ObjectOutput objectOutput) throws IOException { objectOutput.writeLong(layerId); objectOutput.writeLong(createDate); if (label == null) { objectOutput.writeUTF(StringPool.BLANK); } else { objectOutput.writeUTF(label); } objectOutput.writeLong(userId); if (portletInstance == null) { objectOutput.writeUTF(StringPool.BLANK); } else { objectOutput.writeUTF(portletInstance); } } public long layerId; public long createDate; public String label; public long userId; public String portletInstance; }
package main import ( "encoding/json" "fmt" "github.com/codegangsta/cli" "github.com/olekukonko/tablewriter" "github.com/zero-os/0-core/base/pm" "gopkg.in/yaml.v2" "os" "sort" "strconv" "strings" ) type containerData struct { Container struct { Arguments struct { Root string `json:"root"` Hostname string `json:"hostname"` Tags []string `json:"tags"` } `json:"arguments"` PID int `json:"pid"` Root string `json:"root"` } `json:"container"` } func containers(t Transport, c *cli.Context) { var tags []string if c.Args().Present() { tags = append(tags, c.Args().First()) tags = append(tags, c.Args().Tail()...) } response, err := t.Run(Command{ Sync: true, Content: pm.Command{ Command: "corex.find", Arguments: pm.MustArguments(M{ "tags": tags, }), }, }) if err != nil { log.Fatal(err) } response.<API key>() var containers map[string]containerData if err := json.Unmarshal([]byte(response.Data), &containers); err != nil { log.Fatal(err) } table := tablewriter.NewWriter(os.Stdout) table.SetBorders(tablewriter.Border{}) table.SetAlignment(tablewriter.ALIGN_LEFT) table.SetHeader([]string{"ID", "FLIST", "HOSTNAME", "TAGS"}) ids := make([]int, 0, len(containers)) for id := range containers { iid, _ := strconv.ParseInt(id, 10, 32) ids = append(ids, int(iid)) } sort.Ints(ids) for _, id := range ids { sid := fmt.Sprintf("%d", id) container := containers[sid] table.Append([]string{ sid, container.Container.Arguments.Root, container.Container.Arguments.Hostname, strings.Join(container.Container.Arguments.Tags, ", "), }) } table.Render() } func containerInspect(t Transport, c *cli.Context) { id := c.Args().First() if id == "" { log.Fatal("missing container id") } response, err := t.Run(Command{ Sync: true, Content: pm.Command{ Command: "corex.list", Arguments: pm.MustArguments(M{}), }, }) if err != nil { log.Fatal(err) } response.<API key>() var containers map[string]interface{} if err := json.Unmarshal([]byte(response.Data), &containers); err != nil { log.Fatal(err) } container, ok := containers[id] if !ok { log.Fatalf("no container with id: %s", id) } data, _ := yaml.Marshal(container) fmt.Println(string(data)) }
package org.poormanscastle.studies.compilers.grammar.grammar3_1.astparser.ast; import org.poormanscastle.studies.compilers.utils.grammartools.ast.CodePosition; public class OperatorExpression extends AbstractAstItem implements Expression { private final Expression leftOperand, rightOperand; private final Operator operator; public OperatorExpression(CodePosition codePosition, Expression leftOperand, Operator operator, Expression rightOperand) { super(codePosition); this.leftOperand = leftOperand; this.rightOperand = rightOperand; this.operator = operator; } public Expression getLeftOperand() { return leftOperand; } public Expression getRightOperand() { return rightOperand; } public Operator getOperator() { return operator; } @Override public boolean handleProceedWith(AstItemVisitor visitor) { return visitor.<API key>(this); } @Override public void accept(AstItemVisitor visitor) { visitor.<API key>(this); if (leftOperand.handleProceedWith(visitor)) { leftOperand.accept(visitor); } if (rightOperand.handleProceedWith(visitor)) { rightOperand.accept(visitor); } visitor.<API key>(this); } }
using Microsoft.AspNetCore.Http; using System.Collections.Generic; namespace OAuth.AspNet.AuthServer { <summary> Provides context information used in handling an OAuth resource owner grant. </summary> public class O<API key> : <API key><O<API key>> { <summary> Initializes a new instance of the <see cref="O<API key>/> class </summary> <param name="context"></param> <param name="options"></param> <param name="clientId"></param> <param name="userName"></param> <param name="password"></param> <param name="scope"></param> public O<API key>(HttpContext context, O<API key> options, string clientId, string userName, string password, IList<string> scope) : base(context, options, null) { ClientId = clientId; UserName = userName; Password = password; Scope = scope; } <summary> OAuth client id. </summary> public string ClientId { get; private set; } <summary> Resource owner username. </summary> public string UserName { get; private set; } <summary> Resource owner password. </summary> public string Password { get; private set; } <summary> List of scopes allowed by the resource owner. </summary> public IList<string> Scope { get; private set; } } }
# Generated by Django 2.1.7 on 2019-04-30 13:20 from django.db import migrations, models import uuid class Migration(migrations.Migration): dependencies = [ ('core', '0001_initial'), ] operations = [ migrations.AlterField( model_name='publishablemodel', name='id', field=models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False), ), ]
<!DOCTYPE HTML PUBLIC "- <!--NewPage <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_45) on Thu Mar 26 16:48:34 UTC 2015 --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> com.hazelcast.queue.impl.operations (Hazelcast Root 3.4.2 API) </TITLE> <META NAME="date" CONTENT="2015-03-26"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> </HEAD> <BODY BGCOLOR="white"> <FONT size="+1" CLASS="FrameTitleFont"> <A HREF="../../../../../com/hazelcast/queue/impl/operations/package-summary.html" target="classFrame">com.hazelcast.queue.impl.operations</A></FONT> <TABLE BORDER="0" WIDTH="100%" SUMMARY=""> <TR> <TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont"> Classes</FONT>&nbsp; <FONT CLASS="FrameItemFont"> <BR> <A HREF="<API key>.html" title="class in com.hazelcast.queue.impl.operations" target="classFrame"><API key></A> <BR> <A HREF="AddAllOperation.html" title="class in com.hazelcast.queue.impl.operations" target="classFrame">AddAllOperation</A> <BR> <A HREF="<API key>.html" title="class in com.hazelcast.queue.impl.operations" target="classFrame"><API key></A> <BR> <A HREF="<API key>.html" title="class in com.hazelcast.queue.impl.operations" target="classFrame"><API key></A> <BR> <A HREF="ClearOperation.html" title="class in com.hazelcast.queue.impl.operations" target="classFrame">ClearOperation</A> <BR> <A HREF="<API key>.html" title="class in com.hazelcast.queue.impl.operations" target="classFrame"><API key></A> <BR> <A HREF="<API key>.html" title="class in com.hazelcast.queue.impl.operations" target="classFrame"><API key></A> <BR> <A HREF="ContainsOperation.html" title="class in com.hazelcast.queue.impl.operations" target="classFrame">ContainsOperation</A> <BR> <A HREF="<API key>.html" title="class in com.hazelcast.queue.impl.operations" target="classFrame"><API key></A> <BR> <A HREF="DrainOperation.html" title="class in com.hazelcast.queue.impl.operations" target="classFrame">DrainOperation</A> <BR> <A HREF="IsEmptyOperation.html" title="class in com.hazelcast.queue.impl.operations" target="classFrame">IsEmptyOperation</A> <BR> <A HREF="IteratorOperation.html" title="class in com.hazelcast.queue.impl.operations" target="classFrame">IteratorOperation</A> <BR> <A HREF="<API key>.html" title="class in com.hazelcast.queue.impl.operations" target="classFrame"><API key></A> <BR> <A HREF="OfferOperation.html" title="class in com.hazelcast.queue.impl.operations" target="classFrame">OfferOperation</A> <BR> <A HREF="PeekOperation.html" title="class in com.hazelcast.queue.impl.operations" target="classFrame">PeekOperation</A> <BR> <A HREF="PollBackupOperation.html" title="class in com.hazelcast.queue.impl.operations" target="classFrame">PollBackupOperation</A> <BR> <A HREF="PollOperation.html" title="class in com.hazelcast.queue.impl.operations" target="classFrame">PollOperation</A> <BR> <A HREF="<API key>.html" title="class in com.hazelcast.queue.impl.operations" target="classFrame"><API key></A> <BR> <A HREF="QueueOperation.html" title="class in com.hazelcast.queue.impl.operations" target="classFrame">QueueOperation</A> <BR> <A HREF="<API key>.html" title="class in com.hazelcast.queue.impl.operations" target="classFrame"><API key></A> <BR> <A HREF="<API key>.html" title="class in com.hazelcast.queue.impl.operations" target="classFrame"><API key></A> <BR> <A HREF="<API key>.html" title="class in com.hazelcast.queue.impl.operations" target="classFrame"><API key></A> <BR> <A HREF="RemoveOperation.html" title="class in com.hazelcast.queue.impl.operations" target="classFrame">RemoveOperation</A> <BR> <A HREF="SizeOperation.html" title="class in com.hazelcast.queue.impl.operations" target="classFrame">SizeOperation</A></FONT></TD> </TR> </TABLE> </BODY> </HTML>
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="ro"> <head> <!-- Generated by javadoc (version 1.7.0_07) on Tue May 27 14:37:25 EEST 2014 --> <title>Uses of Interface net.sf.jasperreports.engine.util.BigDecimalHandler (JasperReports 5.6.0 API)</title> <meta name="date" content="2014-05-27"> <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 Interface net.sf.jasperreports.engine.util.BigDecimalHandler (JasperReports 5.6.0 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="../../../../../../net/sf/jasperreports/engine/util/BigDecimalHandler.html" title="interface in net.sf.jasperreports.engine.util">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?net/sf/jasperreports/engine/util/class-use/BigDecimalHandler.html" target="_top">Frames</a></li> <li><a href="BigDecimalHandler.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 Interface net.sf.jasperreports.engine.util.BigDecimalHandler" class="title">Uses of Interface<br>net.sf.jasperreports.engine.util.BigDecimalHandler</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="../../../../../../net/sf/jasperreports/engine/util/BigDecimalHandler.html" title="interface in net.sf.jasperreports.engine.util">BigDecimalHandler</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="#net.sf.jasperreports.engine.util">net.sf.jasperreports.engine.util</a></td> <td class="colLast"> <div class="block">Contains utility classes for the core library.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="net.sf.jasperreports.engine.util"> </a> <h3>Uses of <a href="../../../../../../net/sf/jasperreports/engine/util/BigDecimalHandler.html" title="interface in net.sf.jasperreports.engine.util">BigDecimalHandler</a> in <a href="../../../../../../net/sf/jasperreports/engine/util/package-summary.html">net.sf.jasperreports.engine.util</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation"> <caption><span>Classes in <a href="../../../../../../net/sf/jasperreports/engine/util/package-summary.html">net.sf.jasperreports.engine.util</a> that implement <a href="../../../../../../net/sf/jasperreports/engine/util/BigDecimalHandler.html" title="interface in net.sf.jasperreports.engine.util">BigDecimalHandler</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../../net/sf/jasperreports/engine/util/<API key>.html" title="class in net.sf.jasperreports.engine.util"><API key></a></strong></code> <div class="block"><a href="../../../../../../net/sf/jasperreports/engine/util/BigDecimalHandler.html" title="interface in net.sf.jasperreports.engine.util"><code>BigDecimalHandler</code></a> implementation used on Java 1.4.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../../net/sf/jasperreports/engine/util/<API key>.html" title="class in net.sf.jasperreports.engine.util"><API key></a></strong></code> <div class="block"><a href="../../../../../../net/sf/jasperreports/engine/util/BigDecimalHandler.html" title="interface in net.sf.jasperreports.engine.util"><code>BigDecimalHandler</code></a> implementation used on Java 1.5 or newer.</div> </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="../../../../../../net/sf/jasperreports/engine/util/BigDecimalHandler.html" title="interface in net.sf.jasperreports.engine.util">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?net/sf/jasperreports/engine/util/class-use/BigDecimalHandler.html" target="_top">Frames</a></li> <li><a href="BigDecimalHandler.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> <span style="font-decoration:none;font-family:Arial,Helvetica,sans-serif;font-size:8pt;font-style:normal;color: </small></p> </body> </html>
package uk.ac.ebi.ddi.extservices.entrez.ncbiresult; import com.fasterxml.jackson.annotation.<API key>; import com.fasterxml.jackson.annotation.JsonProperty; /** * @author Yasset Perez-Riverol (ypriverol@gmail.com) * @date 18/05/2015 */ @<API key>(ignoreUnknown = true) public class NCBITaxResult { @JsonProperty("header") NCBIHeader header; @JsonProperty("esearchresult") NCBIEResult result; public NCBIHeader getHeader() { return header; } public void setHeader(NCBIHeader header) { this.header = header; } public NCBIEResult getResult() { return result; } public void setResult(NCBIEResult result) { this.result = result; } public String[] getNCBITaxonomy() { if (getResult() != null && getResult().getIdList() != null && getResult().getIdList().length == 1) { return getResult().getIdList(); } return null; } }
package peng.zhang.mobilesafe01.servicer; import android.app.Service; import android.content.Intent; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.location.Criteria; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.Bundle; import android.os.IBinder; import android.util.Log; public class GPSService extends Service { private LocationManager lm; private MyLocationListener listener; @Override public IBinder onBind(Intent intent) { // TODO Auto-generated method stub return null; } @Override public void onCreate() { // TODO Auto-generated method stub super.onCreate(); lm=(LocationManager) getSystemService(LOCATION_SERVICE); /** * List<String> providers=lm.getAllProviders(); for(String pv :providers){ Log.d(TAG, pv); } */ Criteria criteria=new Criteria(); criteria.setAccuracy(Criteria.ACCURACY_FINE); listener =new MyLocationListener(); String provider=lm.getBestProvider(criteria, true); lm.<API key>(provider,0, 0, listener); Log.d("Location", "Location0"+"Æô¶¯·þÎñ"); } @Override public void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); lm.removeUpdates(listener); listener=null; } class MyLocationListener implements LocationListener{ @Override public void onLocationChanged(Location location) { Log.d("Location", "Location1"+"MyLocationListenerÖ´ÐÐÁË"); String longitude = "jj:" + location.getLongitude() + "\n"; String latitude = "w:" + location.getLatitude() + "\n"; String accuracy = "a" + location.getAccuracy() + "\n"; Log.d("Location", "Location1"+longitude); // InputStream in = null; // try { // in=getResources().getAssets().open("axisoffset.dat"); // ModifyOffset offset=ModifyOffset.getInstance(in); // PointDouble double1=offset.s2c(new PointDouble(location.getLongitude(), location.getLatitude())); // longitude ="j:" + offset.X+ "\n"; // latitude = "w:" +offset.Y+ "\n"; // } catch (IOException e) { // e.printStackTrace(); // } catch (Exception e) { // e.printStackTrace(); SharedPreferences sp=<API key>("config", MODE_PRIVATE); Editor editor=sp.edit(); editor.putString("lastlocation", longitude + latitude + accuracy); editor.commit(); } @Override public void onStatusChanged(String provider, int status, Bundle extras) { // TODO Auto-generated method stub } @Override public void onProviderEnabled(String provider) { } @Override public void onProviderDisabled(String provider) { // TODO Auto-generated method stub } } }
package com.ty.activity; import com.ty.app.R; import com.ty.service.AutoUpdateService; import com.ty.util.<API key>; import com.ty.util.HttpUtil; import com.ty.util.Utility; import android.app.Activity; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; import android.text.TextUtils; import android.view.View; import android.view.Window; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.LinearLayout; import android.widget.TextView; public class WeatherActivity extends Activity implements OnClickListener{ private LinearLayout weatherInfoLayout; private TextView cityNameText; private TextView publishText; private TextView weatherDespText; private TextView temp1Text; private TextView temp2Text; private TextView currentDateText; private Button switchCity; private Button refreshWeather; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); <API key>(Window.FEATURE_NO_TITLE); setContentView(R.layout.weather_layout); weatherInfoLayout = (LinearLayout) findViewById(R.id.<API key>); cityNameText = (TextView) findViewById(R.id.tycity_name); publishText = (TextView) findViewById(R.id.typublish_text); weatherDespText = (TextView) findViewById(R.id.tyweather_desp); temp1Text = (TextView) findViewById(R.id.tytemp1); temp2Text = (TextView) findViewById(R.id.tytemp2); currentDateText = (TextView) findViewById(R.id.tycurrent_date); switchCity = (Button) findViewById(R.id.tyswitch_city); refreshWeather = (Button) findViewById(R.id.tyrefresh_weather); String countyCode = getIntent().getStringExtra("county_code"); if (!TextUtils.isEmpty(countyCode)) { publishText.setText("..."); weatherInfoLayout.setVisibility(View.INVISIBLE); cityNameText.setVisibility(View.INVISIBLE); queryWeatherCode(countyCode); } else { showWeather(); } switchCity.setOnClickListener(this); refreshWeather.setOnClickListener(this); } @Override public void onClick(View v) { switch (v.getId()) { case R.id.tycity_name: Intent intent = new Intent(this, ChooseAreaActivity.class); intent.putExtra("<API key>", true); startActivity(intent); finish(); break; case R.id.tyrefresh_weather: publishText.setText("..."); SharedPreferences prefs = PreferenceManager.<API key>(this); String weatherCode = prefs.getString("weather_code", ""); if (!TextUtils.isEmpty(weatherCode)) { queryWeatherInfo(weatherCode); } break; default: break; } } private void queryWeatherCode(String countyCode) { String address = "http: queryFromServer(address, "countyCode"); } private void queryWeatherInfo(String weatherCode) { String address = "http: queryFromServer(address, "weatherCode"); } private void queryFromServer(final String address, final String type) { HttpUtil.sendHttpRequest(address, new <API key>() { @Override public void onFinish(final String response) { if ("countyCode".equals(type)) { if (!TextUtils.isEmpty(response)) { String[] array = response.split("\\|"); if (array != null && array.length == 2) { String weatherCode = array[1]; queryWeatherInfo(weatherCode); } } } else if ("weatherCode".equals(type)) { Utility.<API key>(WeatherActivity.this, response); runOnUiThread(new Runnable() { @Override public void run() { showWeather(); } }); } } @Override public void onError(Exception e) { runOnUiThread(new Runnable() { @Override public void run() { publishText.setText(""); } }); } }); } /** * SharedPreferences */ private void showWeather() { SharedPreferences prefs = PreferenceManager.<API key>(this); cityNameText.setText( prefs.getString("city_name", "")); temp1Text.setText(prefs.getString("temp1", "")); temp2Text.setText(prefs.getString("temp2", "")); weatherDespText.setText(prefs.getString("weather_desp", "")); publishText.setText("" + prefs.getString("publish_time", "") + ""); currentDateText.setText(prefs.getString("current_date", "")); weatherInfoLayout.setVisibility(View.VISIBLE); cityNameText.setVisibility(View.VISIBLE); Intent intent = new Intent(this, AutoUpdateService.class); startService(intent); } }
// Generated from /POI/java/org/apache/poi/hssf/record/DBCellRecord.java #pragma once #include <fwd-POI.hpp> #include <java/lang/fwd-POI.hpp> #include <org/apache/poi/hssf/record/fwd-POI.hpp> #include <org/apache/poi/util/fwd-POI.hpp> #include <org/apache/poi/hssf/record/StandardRecord.hpp> #include <java/lang/Cloneable.hpp> struct default_init_tag; class poi::hssf::record::DBCellRecord final : public StandardRecord , public ::java::lang::Cloneable { public: typedef StandardRecord super; static constexpr int16_t sid { int16_t(215) }; static constexpr int32_t BLOCK_SIZE { int32_t(32) }; private: int32_t field_1_row_offset { }; ::int16_tArray* <API key> { }; protected: void ctor(int32_t rowOffset, ::int16_tArray* cellOffsets); void ctor(RecordInputStream* in); public: ::java::lang::String* toString() override; void serialize(::poi::util::LittleEndianOutput* out) override; public: /* protected */ int32_t getDataSize() override; public: int16_t getSid() override; DBCellRecord* clone() override; // Generated public: /* package */ DBCellRecord(int32_t rowOffset, ::int16_tArray* cellOffsets); public: DBCellRecord(RecordInputStream* in); protected: DBCellRecord(const ::default_init_tag&); public: static ::java::lang::Class *class_(); int32_t serialize(int32_t offset, ::int8_tArray* data); ::int8_tArray* serialize(); private: virtual ::java::lang::Class* getClass0(); friend class <API key>; };
<HTML> <HEAD> <meta charset="UTF-8"> <title>Box2DLevel.engine - core</title> <link rel="stylesheet" href="..\..\..\style.css"> </HEAD> <BODY> <a href="../../index.html">core</a>&nbsp;/&nbsp;<a href="../index.html">io.github.restioson.kettle.level</a>&nbsp;/&nbsp;<a href="index.html">Box2DLevel</a>&nbsp;/&nbsp;<a href=".">engine</a><br/> <br/> <h1>engine</h1> <a name="io.github.restioson.kettle.level.Box2DLevel$engine"></a> <code><span class="keyword">val </span><span class="identifier">engine</span><span class="symbol">: </span><span class="identifier">Kettle</span></code> <a href="https://github.com/Restioson/kettle-engine/tree/master/core/src/kotlin/io/github/restioson/kettle/level/Box2DLevel.kt#L10">(source)</a> </BODY> </HTML>
import { Pipe, PipeTransform } from '@angular/core'; import { Project } from 'app/models/project'; @Pipe({ name: 'operatorFilter' }) export class OperatorFilterPipe implements PipeTransform { transform(value: Project[], q: string) { if (!q) { return value; } return value.filter(item => -1 < item.operator.toLowerCase().indexOf(q.toLowerCase())); } }
// <API key>: Apache-2.0 WITH LLVM-exception // This contains code dealing with code generation of C++ declarations #include "CodeGenFunction.h" #include "CGCXXABI.h" #include "CGObjCRuntime.h" #include "CGOpenMPRuntime.h" #include "clang/Basic/CodeGenOptions.h" #include "llvm/ADT/StringExtras.h" #include "llvm/IR/Intrinsics.h" #include "llvm/IR/MDBuilder.h" #include "llvm/Support/Path.h" using namespace clang; using namespace CodeGen; static void EmitDeclInit(CodeGenFunction &CGF, const VarDecl &D, ConstantAddress DeclPtr) { assert( (D.hasGlobalStorage() || (D.hasLocalStorage() && CGF.getContext().getLangOpts().OpenCLCPlusPlus)) && "VarDecl must have global or local (in the case of OpenCL) storage!"); assert(!D.getType()->isReferenceType() && "Should not call EmitDeclInit on a reference!"); QualType type = D.getType(); LValue lv = CGF.MakeAddrLValue(DeclPtr, type); const Expr *Init = D.getInit(); switch (CGF.getEvaluationKind(type)) { case TEK_Scalar: { CodeGenModule &CGM = CGF.CGM; if (lv.isObjCStrong()) CGM.getObjCRuntime().<API key>(CGF, CGF.EmitScalarExpr(Init), DeclPtr, D.getTLSKind()); else if (lv.isObjCWeak()) CGM.getObjCRuntime().EmitObjCWeakAssign(CGF, CGF.EmitScalarExpr(Init), DeclPtr); else CGF.EmitScalarInit(Init, &D, lv, false); return; } case TEK_Complex: CGF.<API key>(Init, lv, /*isInit*/ true); return; case TEK_Aggregate: CGF.EmitAggExpr(Init, AggValueSlot::forLValue(lv,AggValueSlot::IsDestructed, AggValueSlot::<API key>, AggValueSlot::IsNotAliased, AggValueSlot::DoesNotOverlap)); return; } llvm_unreachable("bad evaluation kind"); } Emit code to cause the destruction of the given variable with static storage duration. static void EmitDeclDestroy(CodeGenFunction &CGF, const VarDecl &D, ConstantAddress Addr) { // Honor __attribute__((no_destroy)) and bail instead of attempting // to emit a reference to a possibly nonexistent destructor, which // in turn can cause a crash. This will result in a global constructor // that isn't balanced out by a destructor call as intended by the // attribute. This also checks for -fno-c++-static-destructors and // bails even if the attribute is not present. if (D.isNoDestroy(CGF.getContext())) return; CodeGenModule &CGM = CGF.CGM; // FIXME: __attribute__((cleanup)) ? QualType Type = D.getType(); QualType::DestructionKind DtorKind = Type.isDestructedType(); switch (DtorKind) { case QualType::DK_none: return; case QualType::DK_cxx_destructor: break; case QualType::<API key>: case QualType::<API key>: case QualType::<API key>: // We don't care about releasing objects during process teardown. assert(!D.getTLSKind() && "should have rejected this"); return; } llvm::FunctionCallee Func; llvm::Constant *Argument; // Special-case non-array C++ destructors, if they have the right signature. // Under some ABIs, destructors return this instead of void, and cannot be // passed directly to __cxa_atexit if the target does not allow this // mismatch. const CXXRecordDecl *Record = Type->getAsCXXRecordDecl(); bool <API key> = Record && (!CGM.getCXXABI().HasThisReturn( GlobalDecl(Record->getDestructor(), Dtor_Complete)) || CGM.getCXXABI().<API key>()); // If __cxa_atexit is disabled via a flag, a different helper function is // generated elsewhere which uses atexit instead, and it takes the destructor // directly. bool UsingExternalHelper = !CGM.getCodeGenOpts().CXAAtExit; if (Record && (<API key> || UsingExternalHelper)) { assert(!Record-><API key>()); CXXDestructorDecl *Dtor = Record->getDestructor(); Func = CGM.<API key>(GlobalDecl(Dtor, Dtor_Complete)); Argument = llvm::ConstantExpr::getBitCast( Addr.getPointer(), CGF.getTypes().ConvertType(Type)->getPointerTo()); // Otherwise, the standard logic requires a helper function. } else { Func = CodeGenFunction(CGM) .<API key>(Addr, Type, CGF.getDestroyer(DtorKind), CGF.needsEHCleanup(DtorKind), &D); Argument = llvm::Constant::getNullValue(CGF.Int8PtrTy); } CGM.getCXXABI().registerGlobalDtor(CGF, D, Func, Argument); } Emit code to cause the variable at the given address to be considered as constant from this point onwards. static void EmitDeclInvariant(CodeGenFunction &CGF, const VarDecl &D, llvm::Constant *Addr) { return CGF.EmitInvariantStart( Addr, CGF.getContext().getTypeSizeInChars(D.getType())); } void CodeGenFunction::EmitInvariantStart(llvm::Constant *Addr, CharUnits Size) { // Do not emit the intrinsic if we're not optimizing. if (!CGM.getCodeGenOpts().OptimizationLevel) return; // Grab the llvm.invariant.start intrinsic. llvm::Intrinsic::ID InvStartID = llvm::Intrinsic::invariant_start; // Overloaded address space type. llvm::Type *ObjectPtr[1] = {Int8PtrTy}; llvm::Function *InvariantStart = CGM.getIntrinsic(InvStartID, ObjectPtr); // Emit a call with the size in bytes of the object. uint64_t Width = Size.getQuantity(); llvm::Value *Args[2] = { llvm::ConstantInt::getSigned(Int64Ty, Width), llvm::ConstantExpr::getBitCast(Addr, Int8PtrTy)}; Builder.CreateCall(InvariantStart, Args); } void CodeGenFunction::<API key>(const VarDecl &D, llvm::Constant *DeclPtr, bool PerformInit) { const Expr *Init = D.getInit(); QualType T = D.getType(); // The address space of a static local variable (DeclPtr) may be different // from the address space of the "this" argument of the constructor. In that // case, we need an addrspacecast before calling the constructor. // struct StructWithCtor { // __device__ StructWithCtor() {...} // __device__ void foo() { // __shared__ StructWithCtor s; // For example, in the above CUDA code, the static local variable s has a // "shared" address space qualifier, but the constructor of StructWithCtor // expects "this" in the "generic" address space. unsigned ExpectedAddrSpace = getContext().<API key>(T); unsigned ActualAddrSpace = DeclPtr->getType()-><API key>(); if (ActualAddrSpace != ExpectedAddrSpace) { llvm::Type *LTy = CGM.getTypes().ConvertTypeForMem(T); llvm::PointerType *PTy = llvm::PointerType::get(LTy, ExpectedAddrSpace); DeclPtr = llvm::ConstantExpr::getAddrSpaceCast(DeclPtr, PTy); } ConstantAddress DeclAddr(DeclPtr, getContext().getDeclAlign(&D)); if (!T->isReferenceType()) { if (getLangOpts().OpenMP && !getLangOpts().OpenMPSimd && D.hasAttr<<API key>>()) { (void)CGM.getOpenMPRuntime().<API key>( &D, DeclAddr, D.getAttr<<API key>>()->getLocation(), PerformInit, this); } if (PerformInit) EmitDeclInit(*this, D, DeclAddr); if (CGM.isTypeConstant(D.getType(), true)) EmitDeclInvariant(*this, D, DeclPtr); else EmitDeclDestroy(*this, D, DeclAddr); return; } assert(PerformInit && "cannot have constant initializer which needs " "destruction for reference"); RValue RV = <API key>(Init); EmitStoreOfScalar(RV.getScalarVal(), DeclAddr, false, T); } Create a stub function, suitable for being passed to atexit, which passes the given address to the given destructor function. llvm::Function *CodeGenFunction::createAtExitStub(const VarDecl &VD, llvm::FunctionCallee dtor, llvm::Constant *addr) { // Get the destructor function type, void(*)(void). llvm::FunctionType *ty = llvm::FunctionType::get(CGM.VoidTy, false); SmallString<256> FnName; { llvm::raw_svector_ostream Out(FnName); CGM.getCXXABI().getMangleContext().<API key>(&VD, Out); } const CGFunctionInfo &FI = CGM.getTypes().<API key>(); llvm::Function *fn = CGM.<API key>( ty, FnName.str(), FI, VD.getLocation()); CodeGenFunction CGF(CGM); CGF.StartFunction(GlobalDecl(&VD, DynamicInitKind::AtExit), CGM.getContext().VoidTy, fn, FI, FunctionArgList()); llvm::CallInst *call = CGF.Builder.CreateCall(dtor, addr); // Make sure the call and the callee agree on calling convention. if (llvm::Function *dtorFn = dyn_cast<llvm::Function>(dtor.getCallee()->stripPointerCasts())) call->setCallingConv(dtorFn->getCallingConv()); CGF.FinishFunction(); return fn; } Register a global destructor using the C atexit runtime function. void CodeGenFunction::<API key>(const VarDecl &VD, llvm::FunctionCallee dtor, llvm::Constant *addr) { // Create a function which calls the destructor. llvm::Constant *dtorStub = createAtExitStub(VD, dtor, addr); <API key>(dtorStub); } void CodeGenFunction::<API key>(llvm::Constant *dtorStub) { // extern "C" int atexit(void (*f)(void)); llvm::FunctionType *atexitTy = llvm::FunctionType::get(IntTy, dtorStub->getType(), false); llvm::FunctionCallee atexit = CGM.<API key>(atexitTy, "atexit", llvm::AttributeList(), /*Local=*/true); if (llvm::Function *atexitFn = dyn_cast<llvm::Function>(atexit.getCallee())) atexitFn->setDoesNotThrow(); <API key>(atexit, dtorStub); } void CodeGenFunction::EmitCXXGuardedInit(const VarDecl &D, llvm::GlobalVariable *DeclPtr, bool PerformInit) { // If we've been asked to forbid guard variables, emit an error now. // This diagnostic is hard-coded for Darwin's use case; we can find // better phrasing if someone else needs it. if (CGM.getCodeGenOpts().<API key>) CGM.Error(D.getLocation(), "this initialization requires a guard variable, which " "the kernel does not support"); CGM.getCXXABI().EmitGuardedInit(*this, D, DeclPtr, PerformInit); } void CodeGenFunction::<API key>(llvm::Value *NeedsInit, llvm::BasicBlock *InitBlock, llvm::BasicBlock *NoInitBlock, GuardKind Kind, const VarDecl *D) { assert((Kind == GuardKind::TlsGuard || D) && "no guarded variable"); // A guess at how many times we will enter the initialization of a // variable, depending on the kind of variable. static const uint64_t InitsPerTLSVar = 1024; static const uint64_t InitsPerLocalVar = 1024 * 1024; llvm::MDNode *Weights; if (Kind == GuardKind::VariableGuard && !D->isLocalVarDecl()) { // For non-local variables, don't apply any weighting for now. Due to our // use of COMDATs, we expect there to be at most one initialization of the // variable per DSO, but we have no way to know how many DSOs will try to // initialize the variable. Weights = nullptr; } else { uint64_t NumInits; // FIXME: For the TLS case, collect and use profiling information to // determine a more accurate brach weight. if (Kind == GuardKind::TlsGuard || D->getTLSKind()) NumInits = InitsPerTLSVar; else NumInits = InitsPerLocalVar; // The probability of us entering the initializer is // 1 / (total number of times we attempt to initialize the variable). llvm::MDBuilder MDHelper(CGM.getLLVMContext()); Weights = MDHelper.createBranchWeights(1, NumInits - 1); } Builder.CreateCondBr(NeedsInit, InitBlock, NoInitBlock, Weights); } llvm::Function *CodeGenModule::<API key>( llvm::FunctionType *FTy, const Twine &Name, const CGFunctionInfo &FI, SourceLocation Loc, bool TLS) { llvm::Function *Fn = llvm::Function::Create(FTy, llvm::GlobalValue::InternalLinkage, Name, &getModule()); if (!getLangOpts().AppleKext && !TLS) { // Set the section if needed. if (const char *Section = getTarget().<API key>()) Fn->setSection(Section); } <API key>(GlobalDecl(), Fn, FI); Fn->setCallingConv(getRuntimeCC()); if (!getLangOpts().Exceptions) Fn->setDoesNotThrow(); if (getLangOpts().Sanitize.has(SanitizerKind::Address) && !<API key>(SanitizerKind::Address, Fn, Loc)) Fn->addFnAttr(llvm::Attribute::SanitizeAddress); if (getLangOpts().Sanitize.has(SanitizerKind::KernelAddress) && !<API key>(SanitizerKind::KernelAddress, Fn, Loc)) Fn->addFnAttr(llvm::Attribute::SanitizeAddress); if (getLangOpts().Sanitize.has(SanitizerKind::HWAddress) && !<API key>(SanitizerKind::HWAddress, Fn, Loc)) Fn->addFnAttr(llvm::Attribute::SanitizeHWAddress); if (getLangOpts().Sanitize.has(SanitizerKind::KernelHWAddress) && !<API key>(SanitizerKind::KernelHWAddress, Fn, Loc)) Fn->addFnAttr(llvm::Attribute::SanitizeHWAddress); if (getLangOpts().Sanitize.has(SanitizerKind::Thread) && !<API key>(SanitizerKind::Thread, Fn, Loc)) Fn->addFnAttr(llvm::Attribute::SanitizeThread); if (getLangOpts().Sanitize.has(SanitizerKind::Memory) && !<API key>(SanitizerKind::Memory, Fn, Loc)) Fn->addFnAttr(llvm::Attribute::SanitizeMemory); if (getLangOpts().Sanitize.has(SanitizerKind::KernelMemory) && !<API key>(SanitizerKind::KernelMemory, Fn, Loc)) Fn->addFnAttr(llvm::Attribute::SanitizeMemory); if (getLangOpts().Sanitize.has(SanitizerKind::SafeStack) && !<API key>(SanitizerKind::SafeStack, Fn, Loc)) Fn->addFnAttr(llvm::Attribute::SafeStack); if (getLangOpts().Sanitize.has(SanitizerKind::ShadowCallStack) && !<API key>(SanitizerKind::ShadowCallStack, Fn, Loc)) Fn->addFnAttr(llvm::Attribute::ShadowCallStack); auto RASignKind = getCodeGenOpts().<API key>(); if (RASignKind != CodeGenOptions::<API key>::None) { Fn->addFnAttr("sign-return-address", RASignKind == CodeGenOptions::<API key>::All ? "all" : "non-leaf"); auto RASignKey = getCodeGenOpts().<API key>(); Fn->addFnAttr("<API key>", RASignKey == CodeGenOptions::<API key>::AKey ? "a_key" : "b_key"); } if (getCodeGenOpts().<API key>) Fn->addFnAttr("<API key>"); return Fn; } Create a global pointer to a function that will initialize a global variable. The user has requested that this pointer be emitted in a specific section. void CodeGenModule::<API key>(const VarDecl *D, llvm::GlobalVariable *GV, llvm::Function *InitFunc, InitSegAttr *ISA) { llvm::GlobalVariable *PtrArray = new llvm::GlobalVariable( TheModule, InitFunc->getType(), /*isConstant=*/true, llvm::GlobalValue::PrivateLinkage, InitFunc, "__cxx_init_fn_ptr"); PtrArray->setSection(ISA->getSection()); addUsedGlobal(PtrArray); // If the GV is already in a comdat group, then we have to join it. if (llvm::Comdat *C = GV->getComdat()) PtrArray->setComdat(C); } void CodeGenModule::<API key>(const VarDecl *D, llvm::GlobalVariable *Addr, bool PerformInit) { // According to E.2.3.1 in CUDA-7.5 Programming guide: __device__, // __constant__ and __shared__ variables defined in namespace scope, // that are of class type, cannot have a non-empty constructor. All // the checks have been done in Sema by now. Whatever initializers // are allowed are empty and we just need to ignore them here. if (getLangOpts().CUDA && getLangOpts().CUDAIsDevice && (D->hasAttr<CUDADeviceAttr>() || D->hasAttr<CUDAConstantAttr>() || D->hasAttr<CUDASharedAttr>())) return; if (getLangOpts().OpenMP && getOpenMPRuntime().<API key>(D, Addr, PerformInit)) return; // Check if we've already initialized this decl. auto I = <API key>.find(D); if (I != <API key>.end() && I->second == ~0U) return; llvm::FunctionType *FTy = llvm::FunctionType::get(VoidTy, false); SmallString<256> FnName; { llvm::raw_svector_ostream Out(FnName); getCXXABI().getMangleContext().<API key>(D, Out); } // Create a variable initialization function. llvm::Function *Fn = <API key>(FTy, FnName.str(), getTypes().<API key>(), D->getLocation()); auto *ISA = D->getAttr<InitSegAttr>(); CodeGenFunction(*this).<API key>(Fn, D, Addr, PerformInit); llvm::GlobalVariable *COMDATKey = supportsCOMDAT() && D->isExternallyVisible() ? Addr : nullptr; if (D->getTLSKind()) { // FIXME: Should we support init_priority for thread_local? // FIXME: We only need to register one __cxa_thread_atexit function for the // entire TU. CXXThreadLocalInits.push_back(Fn); <API key>.push_back(D); } else if (PerformInit && ISA) { <API key>(D, Addr, Fn, ISA); } else if (auto *IPA = D->getAttr<InitPriorityAttr>()) { OrderGlobalInits Key(IPA->getPriority(), <API key>.size()); <API key>.push_back(std::make_pair(Key, Fn)); } else if (<API key>(D-><API key>()) || getContext().<API key>(D) == GVA_DiscardableODR) { // C++ [basic.start.init]p2: // Definitions of explicitly specialized class template static data // members have ordered initialization. Other class template static data // members (i.e., implicitly or explicitly instantiated specializations) // have unordered initialization. // As a consequence, we can put them into their own llvm.global_ctors entry. // If the global is externally visible, put the initializer into a COMDAT // group with the global being initialized. On most platforms, this is a // minor startup time optimization. In the MS C++ ABI, there are no guard // variables, so this COMDAT key is required for correctness. AddGlobalCtor(Fn, 65535, COMDATKey); if (getTarget().getCXXABI().isMicrosoft() && COMDATKey) { // In The MS C++, MS add template static data member in the linker // drective. addUsedGlobal(COMDATKey); } } else if (D->hasAttr<SelectAnyAttr>()) { // SelectAny globals will be comdat-folded. Put the initializer into a // COMDAT group associated with the global, so the initializers get folded // too. AddGlobalCtor(Fn, 65535, COMDATKey); } else { I = <API key>.find(D); // Re-do lookup in case of re-hash. if (I == <API key>.end()) { CXXGlobalInits.push_back(Fn); } else if (I->second != ~0U) { assert(I->second < CXXGlobalInits.size() && CXXGlobalInits[I->second] == nullptr); CXXGlobalInits[I->second] = Fn; } } // Remember that we already emitted the initializer for this global. <API key>[D] = ~0U; } void CodeGenModule::<API key>() { getCXXABI().<API key>( *this, CXXThreadLocals, CXXThreadLocalInits, <API key>); CXXThreadLocalInits.clear(); <API key>.clear(); CXXThreadLocals.clear(); } void CodeGenModule::<API key>() { while (!CXXGlobalInits.empty() && !CXXGlobalInits.back()) CXXGlobalInits.pop_back(); if (CXXGlobalInits.empty() && <API key>.empty()) return; llvm::FunctionType *FTy = llvm::FunctionType::get(VoidTy, false); const CGFunctionInfo &FI = getTypes().<API key>(); // Create our global initialization function. if (!<API key>.empty()) { SmallVector<llvm::Function *, 8> LocalCXXGlobalInits; llvm::array_pod_sort(<API key>.begin(), <API key>.end()); // Iterate over "chunks" of ctors with same priority and emit each chunk // into separate function. Note - everything is sorted first by priority, // second - by lex order, so we emit ctor functions in proper order. for (SmallVectorImpl<GlobalInitData >::iterator I = <API key>.begin(), E = <API key>.end(); I != E; ) { SmallVectorImpl<GlobalInitData >::iterator PrioE = std::upper_bound(I + 1, E, *I, <API key>()); LocalCXXGlobalInits.clear(); unsigned Priority = I->first.priority; // Compute the function suffix from priority. Prepend with zeroes to make // sure the function names are also ordered as priorities. std::string PrioritySuffix = llvm::utostr(Priority); // Priority is always <= 65535 (enforced by sema). PrioritySuffix = std::string(6-PrioritySuffix.size(), '0')+PrioritySuffix; llvm::Function *Fn = <API key>( FTy, "_GLOBAL__I_" + PrioritySuffix, FI); for (; I < PrioE; ++I) LocalCXXGlobalInits.push_back(I->second); CodeGenFunction(*this).<API key>(Fn, LocalCXXGlobalInits); AddGlobalCtor(Fn, Priority); } <API key>.clear(); } // Include the filename in the symbol name. Including "sub_" matches gcc and // makes sure these symbols appear lexicographically behind the symbols with // priority emitted above. SmallString<128> FileName = llvm::sys::path::filename(getModule().getName()); if (FileName.empty()) FileName = "<null>"; for (size_t i = 0; i < FileName.size(); ++i) { // Replace everything that's not [a-zA-Z0-9._] with a _. This set happens // to be the set of C preprocessing numbers. if (!<API key>(FileName[i])) FileName[i] = '_'; } llvm::Function *Fn = <API key>( FTy, llvm::Twine("_GLOBAL__sub_I_", FileName), FI); CodeGenFunction(*this).<API key>(Fn, CXXGlobalInits); AddGlobalCtor(Fn); // In OpenCL global init functions must be converted to kernels in order to // be able to launch them from the host. // FIXME: Some more work might be needed to handle destructors correctly. // Current initialization function makes use of function pointers callbacks. // We can't support function pointers especially between host and device. // However it seems global destruction has little meaning without any // dynamic resource allocation on the device and program scope variables are // destroyed by the runtime when program is released. if (getLangOpts().OpenCL) { <API key>(Fn); Fn->setCallingConv(llvm::CallingConv::SPIR_KERNEL); } CXXGlobalInits.clear(); } void CodeGenModule::<API key>() { if (CXXGlobalDtors.empty()) return; llvm::FunctionType *FTy = llvm::FunctionType::get(VoidTy, false); // Create our global destructor function. const CGFunctionInfo &FI = getTypes().<API key>(); llvm::Function *Fn = <API key>(FTy, "_GLOBAL__D_a", FI); CodeGenFunction(*this).<API key>(Fn, CXXGlobalDtors); AddGlobalDtor(Fn); } Emit the code necessary to initialize the given global variable. void CodeGenFunction::<API key>(llvm::Function *Fn, const VarDecl *D, llvm::GlobalVariable *Addr, bool PerformInit) { // Check if we need to emit debug info for variable initializer. if (D->hasAttr<NoDebugAttr>()) DebugInfo = nullptr; // disable debug info indefinitely for this function CurEHLocation = D->getBeginLoc(); StartFunction(GlobalDecl(D, DynamicInitKind::Initializer), getContext().VoidTy, Fn, getTypes().<API key>(), FunctionArgList(), D->getLocation(), D->getInit()->getExprLoc()); // Use guarded initialization if the global variable is weak. This // occurs for, e.g., instantiated static data members and // definitions explicitly marked weak. // Also use guarded initialization for a variable with dynamic TLS and // unordered initialization. (If the initialization is ordered, the ABI // layer will guard the whole-TU initialization for us.) if (Addr->hasWeakLinkage() || Addr->hasLinkOnceLinkage() || (D->getTLSKind() == VarDecl::TLS_Dynamic && <API key>(D-><API key>()))) { EmitCXXGuardedInit(*D, Addr, PerformInit); } else { <API key>(*D, Addr, PerformInit); } FinishFunction(); } void CodeGenFunction::<API key>(llvm::Function *Fn, ArrayRef<llvm::Function *> Decls, ConstantAddress Guard) { { auto NL = ApplyDebugLocation::CreateEmpty(*this); StartFunction(GlobalDecl(), getContext().VoidTy, Fn, getTypes().<API key>(), FunctionArgList()); // Emit an artificial location for this function. auto AL = ApplyDebugLocation::CreateArtificial(*this); llvm::BasicBlock *ExitBlock = nullptr; if (Guard.isValid()) { // If we have a guard variable, check whether we've already performed // these initializations. This happens for TLS initialization functions. llvm::Value *GuardVal = Builder.CreateLoad(Guard); llvm::Value *Uninit = Builder.CreateIsNull(GuardVal, "guard.uninitialized"); llvm::BasicBlock *InitBlock = createBasicBlock("init"); ExitBlock = createBasicBlock("exit"); <API key>(Uninit, InitBlock, ExitBlock, GuardKind::TlsGuard, nullptr); EmitBlock(InitBlock); // Mark as initialized before initializing anything else. If the // initializers use <API key> thread_local vars, that's // probably supposed to be OK, but the standard doesn't say. Builder.CreateStore(llvm::ConstantInt::get(GuardVal->getType(),1), Guard); // The guard variable can't ever change again. EmitInvariantStart( Guard.getPointer(), CharUnits::fromQuantity( CGM.getDataLayout().getTypeAllocSize(GuardVal->getType()))); } RunCleanupsScope Scope(*this); // When building in Objective-C++ ARC mode, create an autorelease pool // around the global initializers. if (getLangOpts().ObjCAutoRefCount && getLangOpts().CPlusPlus) { llvm::Value *<API key>(); <API key>(token); } for (unsigned i = 0, e = Decls.size(); i != e; ++i) if (Decls[i]) EmitRuntimeCall(Decls[i]); Scope.ForceCleanup(); if (ExitBlock) { Builder.CreateBr(ExitBlock); EmitBlock(ExitBlock); } } FinishFunction(); } void CodeGenFunction::<API key>( llvm::Function *Fn, const std::vector<std::tuple<llvm::FunctionType *, llvm::WeakTrackingVH, llvm::Constant *>> &DtorsAndObjects) { { auto NL = ApplyDebugLocation::CreateEmpty(*this); StartFunction(GlobalDecl(), getContext().VoidTy, Fn, getTypes().<API key>(), FunctionArgList()); // Emit an artificial location for this function. auto AL = ApplyDebugLocation::CreateArtificial(*this); // Emit the dtors, in reverse order from construction. for (unsigned i = 0, e = DtorsAndObjects.size(); i != e; ++i) { llvm::FunctionType *CalleeTy; llvm::Value *Callee; llvm::Constant *Arg; std::tie(CalleeTy, Callee, Arg) = DtorsAndObjects[e - i - 1]; llvm::CallInst *CI = Builder.CreateCall(CalleeTy, Callee, Arg); // Make sure the call and the callee agree on calling convention. if (llvm::Function *F = dyn_cast<llvm::Function>(Callee)) CI->setCallingConv(F->getCallingConv()); } } FinishFunction(); } <API key> - Generates a helper function which, when invoked, destroys the given object. The address of the object should be in global memory. llvm::Function *CodeGenFunction::<API key>( Address addr, QualType type, Destroyer *destroyer, bool <API key>, const VarDecl *VD) { FunctionArgList args; ImplicitParamDecl Dst(getContext(), getContext().VoidPtrTy, ImplicitParamDecl::Other); args.push_back(&Dst); const CGFunctionInfo &FI = CGM.getTypes().<API key>(getContext().VoidTy, args); llvm::FunctionType *FTy = CGM.getTypes().GetFunctionType(FI); llvm::Function *fn = CGM.<API key>( FTy, "<API key>", FI, VD->getLocation()); CurEHLocation = VD->getBeginLoc(); StartFunction(VD, getContext().VoidTy, fn, FI, args); emitDestroy(addr, type, destroyer, <API key>); FinishFunction(); return fn; }
# Builders ARG BUNDLE_IMAGE=<API key> ARG BUNDLE_TAG=latest ARG <API key>=fission/builder ARG FISSION_TAG=latest FROM $BUNDLE_IMAGE:$BUNDLE_TAG as workflows-bundle FROM scratch COPY --from=workflows-bundle /<API key> /<API key> EXPOSE 8888 EXPOSE 8080 ENV <API key> http://controller.fission ENV <API key> http://executor.fission ENV ES_NATS_URL nats://<API key>@nats-streaming.fission:4222 ENV ES_NATS_CLUSTER fissionMQTrigger # Remove APIs when components stabilize ENTRYPOINT ["/<API key>", \ "--nats", \ "--fission", \ "--internal", \ "--controller", \ "--api-http", \ "--<API key>", \ "--api-workflow", \ "--api-admin", \ "--metrics"]
# Penicillium rufulum (Bainier) Sacc. SPECIES # Status ACCEPTED # According to Index Fungorum # Published in Syll. fung. (Abellini) 22: 1275 (1913) # Original name Scopulariopsis rufulus Bainier Remarks null
// of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // all copies or substantial portions of the Software. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. package m3ql //go:generate peg -inline -switch src/query/parser/m3ql/grammar.peg import ( "fmt" "io" "math" "os" "sort" "strconv" ) const endSymbol rune = 1114112 /* The rule types inferred from the grammar are below. */ type pegRule uint8 const ( ruleUnknown pegRule = iota ruleGrammar ruleMacroDef rulePipeline ruleExpression ruleFunctionCall ruleArgument <API key> ruleNesting ruleSpacing ruleSpace ruleEOL ruleComment ruleCommentStart ruleIdentifier ruleIdentifierStart ruleIdentifierChars ruleOperator ruleOperatorSymbols ruleBoolean ruleTrue ruleFalse ruleNumber ruleIntegralNumber ruleFloatingNumber ruleMinus ruleStringLiteral ruleQuoteChar rulePattern rulePatternChars ruleGlobSymbols ruleSemicolon ruleEquals rulePipe ruleLParenthesis ruleRParenthesis ruleColon ruleEOF ruleAction0 ruleAction1 ruleAction2 ruleAction3 ruleAction4 ruleAction5 ruleAction6 ruleAction7 ruleAction8 ruleAction9 rulePegText ) var rul3s = [...]string{ "Unknown", "Grammar", "MacroDef", "Pipeline", "Expression", "FunctionCall", "Argument", "KeywordSpecifier", "Nesting", "Spacing", "Space", "EOL", "Comment", "CommentStart", "Identifier", "IdentifierStart", "IdentifierChars", "Operator", "OperatorSymbols", "Boolean", "True", "False", "Number", "IntegralNumber", "FloatingNumber", "Minus", "StringLiteral", "QuoteChar", "Pattern", "PatternChars", "GlobSymbols", "Semicolon", "Equals", "Pipe", "LParenthesis", "RParenthesis", "Colon", "EOF", "Action0", "Action1", "Action2", "Action3", "Action4", "Action5", "Action6", "Action7", "Action8", "Action9", "PegText", } type token32 struct { pegRule begin, end uint32 } func (t *token32) String() string { return fmt.Sprintf("\x1B[34m%v\x1B[m %v %v", rul3s[t.pegRule], t.begin, t.end) } type node32 struct { token32 up, next *node32 } func (node *node32) print(w io.Writer, pretty bool, buffer string) { var print func(node *node32, depth int) print = func(node *node32, depth int) { for node != nil { for c := 0; c < depth; c++ { fmt.Printf(" ") } rule := rul3s[node.pegRule] quote := strconv.Quote(string(([]rune(buffer)[node.begin:node.end]))) if !pretty { fmt.Fprintf(w, "%v %v\n", rule, quote) } else { fmt.Fprintf(w, "\x1B[34m%v\x1B[m %v\n", rule, quote) } if node.up != nil { print(node.up, depth+1) } node = node.next } } print(node, 0) } func (node *node32) Print(w io.Writer, buffer string) { node.print(w, false, buffer) } func (node *node32) PrettyPrint(w io.Writer, buffer string) { node.print(w, true, buffer) } type tokens32 struct { tree []token32 } func (t *tokens32) Trim(length uint32) { t.tree = t.tree[:length] } func (t *tokens32) Print() { for _, token := range t.tree { fmt.Println(token.String()) } } func (t *tokens32) AST() *node32 { type element struct { node *node32 down *element } tokens := t.Tokens() var stack *element for _, token := range tokens { if token.begin == token.end { continue } node := &node32{token32: token} for stack != nil && stack.node.begin >= token.begin && stack.node.end <= token.end { stack.node.next = node.up node.up = stack.node stack = stack.down } stack = &element{node: node, down: stack} } if stack != nil { return stack.node } return nil } func (t *tokens32) PrintSyntaxTree(buffer string) { t.AST().Print(os.Stdout, buffer) } func (t *tokens32) WriteSyntaxTree(w io.Writer, buffer string) { t.AST().Print(w, buffer) } func (t *tokens32) <API key>(buffer string) { t.AST().PrettyPrint(os.Stdout, buffer) } func (t *tokens32) Add(rule pegRule, begin, end, index uint32) { if tree := t.tree; int(index) >= len(tree) { expanded := make([]token32, 2*len(tree)) copy(expanded, tree) t.tree = expanded } t.tree[index] = token32{ pegRule: rule, begin: begin, end: end, } } func (t *tokens32) Tokens() []token32 { return t.tree } type m3ql struct { scriptBuilder Buffer string buffer []rune rules [49]func() bool parse func(rule ...int) error reset func() Pretty bool tokens32 } func (p *m3ql) Parse(rule ...int) error { return p.parse(rule...) } func (p *m3ql) Reset() { p.reset() } type textPosition struct { line, symbol int } type textPositionMap map[int]textPosition func translatePositions(buffer []rune, positions []int) textPositionMap { length, translations, j, line, symbol := len(positions), make(textPositionMap, len(positions)), 0, 1, 0 sort.Ints(positions) search: for i, c := range buffer { if c == '\n' { line, symbol = line+1, 0 } else { symbol++ } if i == positions[j] { translations[positions[j]] = textPosition{line, symbol} for j++; j < length; j++ { if i != positions[j] { continue search } } break search } } return translations } type parseError struct { p *m3ql max token32 } func (e *parseError) Error() string { tokens, error := []token32{e.max}, "\n" positions, p := make([]int, 2*len(tokens)), 0 for _, token := range tokens { positions[p], p = int(token.begin), p+1 positions[p], p = int(token.end), p+1 } translations := translatePositions(e.p.buffer, positions) format := "parse error near %v (line %v symbol %v - line %v symbol %v):\n%v\n" if e.p.Pretty { format = "parse error near \x1B[34m%v\x1B[m (line %v symbol %v - line %v symbol %v):\n%v\n" } for _, token := range tokens { begin, end := int(token.begin), int(token.end) error += fmt.Sprintf(format, rul3s[token.pegRule], translations[begin].line, translations[begin].symbol, translations[end].line, translations[end].symbol, strconv.Quote(string(e.p.buffer[begin:end]))) } return error } func (p *m3ql) PrintSyntaxTree() { if p.Pretty { p.tokens32.<API key>(p.Buffer) } else { p.tokens32.PrintSyntaxTree(p.Buffer) } } func (p *m3ql) WriteSyntaxTree(w io.Writer) { p.tokens32.WriteSyntaxTree(w, p.Buffer) } func (p *m3ql) Execute() { buffer, _buffer, text, begin, end := p.Buffer, p.buffer, "", 0, 0 for _, token := range p.Tokens() { switch token.pegRule { case rulePegText: begin, end = int(token.begin), int(token.end) text = string(_buffer[begin:end]) case ruleAction0: p.newMacro(text) case ruleAction1: p.newPipeline() case ruleAction2: p.endPipeline() case ruleAction3: p.newExpression(text) case ruleAction4: p.endExpression() case ruleAction5: p.newBooleanArgument(text) case ruleAction6: p.newNumericArgument(text) case ruleAction7: p.newPatternArgument(text) case ruleAction8: p.<API key>(text) case ruleAction9: p.newKeywordArgument(text) } } _, _, _, _, _ = buffer, _buffer, text, begin, end } func (p *m3ql) Init() { var ( max token32 position, tokenIndex uint32 buffer []rune ) p.reset = func() { max = token32{} position, tokenIndex = 0, 0 p.buffer = []rune(p.Buffer) if len(p.buffer) == 0 || p.buffer[len(p.buffer)-1] != endSymbol { p.buffer = append(p.buffer, endSymbol) } buffer = p.buffer } p.reset() _rules := p.rules tree := tokens32{tree: make([]token32, math.MaxInt16)} p.parse = func(rule ...int) error { r := 1 if len(rule) > 0 { r = rule[0] } matches := p.rules[r]() p.tokens32 = tree if matches { p.Trim(tokenIndex) return nil } return &parseError{p, max} } add := func(rule pegRule, begin uint32) { tree.Add(rule, begin, position, tokenIndex) tokenIndex++ if begin != position && position > max.end { max = token32{rule, begin, position} } } matchDot := func() bool { if buffer[position] != endSymbol { position++ return true } return false } /*matchChar := func(c byte) bool { if buffer[position] == c { position++ return true } return false }*/ /*matchRange := func(lower byte, upper byte) bool { if c := buffer[position]; c >= lower && c <= upper { position++ return true } return false }*/ _rules = [...]func() bool{ nil, /* 0 Grammar <- <(Spacing (MacroDef Semicolon)* Pipeline EOF)> */ func() bool { position0, tokenIndex0 := position, tokenIndex { position1 := position if !_rules[ruleSpacing]() { goto l0 } l2: { position3, tokenIndex3 := position, tokenIndex { position4 := position if !_rules[ruleIdentifier]() { goto l3 } { add(ruleAction0, position) } { position6 := position if buffer[position] != rune('=') { goto l3 } position++ if !_rules[ruleSpacing]() { goto l3 } add(ruleEquals, position6) } if !_rules[rulePipeline]() { goto l3 } add(ruleMacroDef, position4) } { position7 := position if buffer[position] != rune(';') { goto l3 } position++ if !_rules[ruleSpacing]() { goto l3 } add(ruleSemicolon, position7) } goto l2 l3: position, tokenIndex = position3, tokenIndex3 } if !_rules[rulePipeline]() { goto l0 } { position8 := position { position9, tokenIndex9 := position, tokenIndex if !matchDot() { goto l9 } goto l0 l9: position, tokenIndex = position9, tokenIndex9 } add(ruleEOF, position8) } add(ruleGrammar, position1) } return true l0: position, tokenIndex = position0, tokenIndex0 return false }, /* 1 MacroDef <- <(Identifier Action0 Equals Pipeline)> */ nil, /* 2 Pipeline <- <(Action1 Expression (Pipe Expression)* Action2)> */ func() bool { position11, tokenIndex11 := position, tokenIndex { position12 := position { add(ruleAction1, position) } if !_rules[ruleExpression]() { goto l11 } l14: { position15, tokenIndex15 := position, tokenIndex { position16 := position if buffer[position] != rune('|') { goto l15 } position++ if !_rules[ruleSpacing]() { goto l15 } add(rulePipe, position16) } if !_rules[ruleExpression]() { goto l15 } goto l14 l15: position, tokenIndex = position15, tokenIndex15 } { add(ruleAction2, position) } add(rulePipeline, position12) } return true l11: position, tokenIndex = position11, tokenIndex11 return false }, /* 3 Expression <- <(FunctionCall / Nesting)> */ func() bool { position18, tokenIndex18 := position, tokenIndex { position19 := position { position20, tokenIndex20 := position, tokenIndex { position22 := position { position23, tokenIndex23 := position, tokenIndex if !_rules[ruleIdentifier]() { goto l24 } goto l23 l24: position, tokenIndex = position23, tokenIndex23 { position25 := position { position26 := position { position27 := position { position28, tokenIndex28 := position, tokenIndex if buffer[position] != rune('<') { goto l29 } position++ if buffer[position] != rune('=') { goto l29 } position++ goto l28 l29: position, tokenIndex = position28, tokenIndex28 if buffer[position] != rune('>') { goto l30 } position++ if buffer[position] != rune('=') { goto l30 } position++ goto l28 l30: position, tokenIndex = position28, tokenIndex28 { switch buffer[position] { case '>': if buffer[position] != rune('>') { goto l21 } position++ break case '!': if buffer[position] != rune('!') { goto l21 } position++ if buffer[position] != rune('=') { goto l21 } position++ break case '=': if buffer[position] != rune('=') { goto l21 } position++ if buffer[position] != rune('=') { goto l21 } position++ break default: if buffer[position] != rune('<') { goto l21 } position++ break } } } l28: add(ruleOperatorSymbols, position27) } add(rulePegText, position26) } if !_rules[ruleSpacing]() { goto l21 } add(ruleOperator, position25) } } l23: { add(ruleAction3, position) } l33: { position34, tokenIndex34 := position, tokenIndex { position35 := position { position36, tokenIndex36 := position, tokenIndex { position38 := position if !_rules[ruleIdentifier]() { goto l36 } { add(ruleAction9, position) } { position40 := position if buffer[position] != rune(':') { goto l36 } position++ if !_rules[ruleSpacing]() { goto l36 } add(ruleColon, position40) } add(<API key>, position38) } goto l37 l36: position, tokenIndex = position36, tokenIndex36 } l37: { position41, tokenIndex41 := position, tokenIndex { position43 := position { position44 := position { position45, tokenIndex45 := position, tokenIndex { position47 := position { position48, tokenIndex48 := position, tokenIndex if buffer[position] != rune('t') { goto l49 } position++ goto l48 l49: position, tokenIndex = position48, tokenIndex48 if buffer[position] != rune('T') { goto l46 } position++ } l48: { position50, tokenIndex50 := position, tokenIndex if buffer[position] != rune('r') { goto l51 } position++ goto l50 l51: position, tokenIndex = position50, tokenIndex50 if buffer[position] != rune('R') { goto l46 } position++ } l50: { position52, tokenIndex52 := position, tokenIndex if buffer[position] != rune('u') { goto l53 } position++ goto l52 l53: position, tokenIndex = position52, tokenIndex52 if buffer[position] != rune('U') { goto l46 } position++ } l52: { position54, tokenIndex54 := position, tokenIndex if buffer[position] != rune('e') { goto l55 } position++ goto l54 l55: position, tokenIndex = position54, tokenIndex54 if buffer[position] != rune('E') { goto l46 } position++ } l54: add(ruleTrue, position47) } goto l45 l46: position, tokenIndex = position45, tokenIndex45 { position56 := position { position57, tokenIndex57 := position, tokenIndex if buffer[position] != rune('f') { goto l58 } position++ goto l57 l58: position, tokenIndex = position57, tokenIndex57 if buffer[position] != rune('F') { goto l42 } position++ } l57: { position59, tokenIndex59 := position, tokenIndex if buffer[position] != rune('a') { goto l60 } position++ goto l59 l60: position, tokenIndex = position59, tokenIndex59 if buffer[position] != rune('A') { goto l42 } position++ } l59: { position61, tokenIndex61 := position, tokenIndex if buffer[position] != rune('l') { goto l62 } position++ goto l61 l62: position, tokenIndex = position61, tokenIndex61 if buffer[position] != rune('L') { goto l42 } position++ } l61: { position63, tokenIndex63 := position, tokenIndex if buffer[position] != rune('s') { goto l64 } position++ goto l63 l64: position, tokenIndex = position63, tokenIndex63 if buffer[position] != rune('S') { goto l42 } position++ } l63: { position65, tokenIndex65 := position, tokenIndex if buffer[position] != rune('e') { goto l66 } position++ goto l65 l66: position, tokenIndex = position65, tokenIndex65 if buffer[position] != rune('E') { goto l42 } position++ } l65: add(ruleFalse, position56) } } l45: add(rulePegText, position44) } { position67, tokenIndex67 := position, tokenIndex if !_rules[rulePatternChars]() { goto l67 } goto l42 l67: position, tokenIndex = position67, tokenIndex67 } if !_rules[ruleSpacing]() { goto l42 } add(ruleBoolean, position43) } { add(ruleAction5, position) } goto l41 l42: position, tokenIndex = position41, tokenIndex41 { position70 := position { position71 := position { position72, tokenIndex72 := position, tokenIndex { position74 := position if buffer[position] != rune('-') { goto l72 } position++ add(ruleMinus, position74) } goto l73 l72: position, tokenIndex = position72, tokenIndex72 } l73: { position75, tokenIndex75 := position, tokenIndex { position77 := position { position78, tokenIndex78 := position, tokenIndex if !_rules[ruleIntegralNumber]() { goto l78 } goto l79 l78: position, tokenIndex = position78, tokenIndex78 } l79: if buffer[position] != rune('.') { goto l76 } position++ if !_rules[ruleIntegralNumber]() { goto l76 } add(ruleFloatingNumber, position77) } goto l75 l76: position, tokenIndex = position75, tokenIndex75 if !_rules[ruleIntegralNumber]() { goto l69 } } l75: add(rulePegText, position71) } { position80, tokenIndex80 := position, tokenIndex if !_rules[rulePatternChars]() { goto l80 } goto l69 l80: position, tokenIndex = position80, tokenIndex80 } if !_rules[ruleSpacing]() { goto l69 } add(ruleNumber, position70) } { add(ruleAction6, position) } goto l41 l69: position, tokenIndex = position41, tokenIndex41 { switch buffer[position] { case '(': if !_rules[ruleNesting]() { goto l34 } break case '"': { position83 := position if !_rules[ruleQuoteChar]() { goto l34 } { position84 := position l85: { position86, tokenIndex86 := position, tokenIndex { position87, tokenIndex87 := position, tokenIndex if buffer[position] != rune('"') { goto l87 } position++ goto l86 l87: position, tokenIndex = position87, tokenIndex87 } if !matchDot() { goto l86 } goto l85 l86: position, tokenIndex = position86, tokenIndex86 } add(rulePegText, position84) } if !_rules[ruleQuoteChar]() { goto l34 } if !_rules[ruleSpacing]() { goto l34 } add(ruleStringLiteral, position83) } { add(ruleAction8, position) } break default: { position89 := position { position90 := position if !_rules[rulePatternChars]() { goto l34 } l91: { position92, tokenIndex92 := position, tokenIndex if !_rules[rulePatternChars]() { goto l92 } goto l91 l92: position, tokenIndex = position92, tokenIndex92 } add(rulePegText, position90) } if !_rules[ruleSpacing]() { goto l34 } add(rulePattern, position89) } { add(ruleAction7, position) } break } } } l41: add(ruleArgument, position35) } goto l33 l34: position, tokenIndex = position34, tokenIndex34 } { add(ruleAction4, position) } add(ruleFunctionCall, position22) } goto l20 l21: position, tokenIndex = position20, tokenIndex20 if !_rules[ruleNesting]() { goto l18 } } l20: add(ruleExpression, position19) } return true l18: position, tokenIndex = position18, tokenIndex18 return false }, /* 4 FunctionCall <- <((Identifier / Operator) Action3 Argument* Action4)> */ nil, /* 5 Argument <- <(KeywordSpecifier? ((Boolean Action5) / (Number Action6) / ((&('(') Nesting) | (&('"') (StringLiteral Action8)) | (&('$' | '*' | ',' | '-' | '.' | '/' | '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '?' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z' | '[' | '\\' | ']' | '^' | '_' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z' | '{' | '}') (Pattern Action7)))))> */ nil, /* 6 KeywordSpecifier <- <(Identifier Action9 Colon)> */ nil, /* 7 Nesting <- <(LParenthesis Pipeline RParenthesis)> */ func() bool { position98, tokenIndex98 := position, tokenIndex { position99 := position { position100 := position if buffer[position] != rune('(') { goto l98 } position++ if !_rules[ruleSpacing]() { goto l98 } add(ruleLParenthesis, position100) } if !_rules[rulePipeline]() { goto l98 } { position101 := position if buffer[position] != rune(')') { goto l98 } position++ if !_rules[ruleSpacing]() { goto l98 } add(ruleRParenthesis, position101) } add(ruleNesting, position99) } return true l98: position, tokenIndex = position98, tokenIndex98 return false }, /* 8 Spacing <- <((&('#') Comment) | (&('\n' | '\r') EOL) | (&('\t' | ' ') Space))*> */ func() bool { { position103 := position l104: { position105, tokenIndex105 := position, tokenIndex { switch buffer[position] { case ' { position107 := position { position108 := position if buffer[position] != rune(' goto l105 } position++ add(ruleCommentStart, position108) } l109: { position110, tokenIndex110 := position, tokenIndex { position111, tokenIndex111 := position, tokenIndex if !_rules[ruleEOL]() { goto l111 } goto l110 l111: position, tokenIndex = position111, tokenIndex111 } if !matchDot() { goto l110 } goto l109 l110: position, tokenIndex = position110, tokenIndex110 } add(ruleComment, position107) } break case '\n', '\r': if !_rules[ruleEOL]() { goto l105 } break default: { position112 := position { position113, tokenIndex113 := position, tokenIndex if buffer[position] != rune(' ') { goto l114 } position++ goto l113 l114: position, tokenIndex = position113, tokenIndex113 if buffer[position] != rune('\t') { goto l105 } position++ } l113: add(ruleSpace, position112) } break } } goto l104 l105: position, tokenIndex = position105, tokenIndex105 } add(ruleSpacing, position103) } return true }, /* 9 Space <- <(' ' / '\t')> */ nil, /* 10 EOL <- <(('\r' '\n') / '\n' / '\r')> */ func() bool { position116, tokenIndex116 := position, tokenIndex { position117 := position { position118, tokenIndex118 := position, tokenIndex if buffer[position] != rune('\r') { goto l119 } position++ if buffer[position] != rune('\n') { goto l119 } position++ goto l118 l119: position, tokenIndex = position118, tokenIndex118 if buffer[position] != rune('\n') { goto l120 } position++ goto l118 l120: position, tokenIndex = position118, tokenIndex118 if buffer[position] != rune('\r') { goto l116 } position++ } l118: add(ruleEOL, position117) } return true l116: position, tokenIndex = position116, tokenIndex116 return false }, /* 11 Comment <- <(CommentStart (!EOL .)*)> */ nil, /* 12 CommentStart <- <'#'> */ nil, /* 13 Identifier <- <(<(IdentifierStart IdentifierChars*)> Spacing)> */ func() bool { position123, tokenIndex123 := position, tokenIndex { position124 := position { position125 := position if !_rules[ruleIdentifierStart]() { goto l123 } l126: { position127, tokenIndex127 := position, tokenIndex if !_rules[ruleIdentifierChars]() { goto l127 } goto l126 l127: position, tokenIndex = position127, tokenIndex127 } add(rulePegText, position125) } if !_rules[ruleSpacing]() { goto l123 } add(ruleIdentifier, position124) } return true l123: position, tokenIndex = position123, tokenIndex123 return false }, /* 14 IdentifierStart <- <((&('_') '_') | (&('A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z') [A-Z]) | (&('a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z') [a-z]))> */ func() bool { position128, tokenIndex128 := position, tokenIndex { position129 := position { switch buffer[position] { case '_': if buffer[position] != rune('_') { goto l128 } position++ break case 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z': if c := buffer[position]; c < rune('A') || c > rune('Z') { goto l128 } position++ break default: if c := buffer[position]; c < rune('a') || c > rune('z') { goto l128 } position++ break } } add(ruleIdentifierStart, position129) } return true l128: position, tokenIndex = position128, tokenIndex128 return false }, /* 15 IdentifierChars <- <((&('\\') '\\') | (&('/') '/') | (&('-') '-') | (&('.') '.') | (&('0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9') [0-9]) | (&('A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z' | '_' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z') IdentifierStart))> */ func() bool { position131, tokenIndex131 := position, tokenIndex { position132 := position { switch buffer[position] { case '\\': if buffer[position] != rune('\\') { goto l131 } position++ break case '/': if buffer[position] != rune('/') { goto l131 } position++ break case '-': if buffer[position] != rune('-') { goto l131 } position++ break case '.': if buffer[position] != rune('.') { goto l131 } position++ break case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': if c := buffer[position]; c < rune('0') || c > rune('9') { goto l131 } position++ break default: if !_rules[ruleIdentifierStart]() { goto l131 } break } } add(ruleIdentifierChars, position132) } return true l131: position, tokenIndex = position131, tokenIndex131 return false }, /* 16 Operator <- <(<OperatorSymbols> Spacing)> */ nil, /* 17 OperatorSymbols <- <(('<' '=') / ('>' '=') / ((&('>') '>') | (&('!') ('!' '=')) | (&('=') ('=' '=')) | (&('<') '<')))> */ nil, /* 18 Boolean <- <(<(True / False)> !PatternChars Spacing)> */ nil, /* 19 True <- <(('t' / 'T') ('r' / 'R') ('u' / 'U') ('e' / 'E'))> */ nil, /* 20 False <- <(('f' / 'F') ('a' / 'A') ('l' / 'L') ('s' / 'S') ('e' / 'E'))> */ nil, /* 21 Number <- <(<(Minus? (FloatingNumber / IntegralNumber))> !PatternChars Spacing)> */ nil, /* 22 IntegralNumber <- <[0-9]+> */ func() bool { position140, tokenIndex140 := position, tokenIndex { position141 := position if c := buffer[position]; c < rune('0') || c > rune('9') { goto l140 } position++ l142: { position143, tokenIndex143 := position, tokenIndex if c := buffer[position]; c < rune('0') || c > rune('9') { goto l143 } position++ goto l142 l143: position, tokenIndex = position143, tokenIndex143 } add(ruleIntegralNumber, position141) } return true l140: position, tokenIndex = position140, tokenIndex140 return false }, /* 23 FloatingNumber <- <(IntegralNumber? '.' IntegralNumber)> */ nil, /* 24 Minus <- <'-'> */ nil, /* 25 StringLiteral <- <(QuoteChar <(!'"' .)*> QuoteChar Spacing)> */ nil, /* 26 QuoteChar <- <'"'> */ func() bool { position147, tokenIndex147 := position, tokenIndex { position148 := position if buffer[position] != rune('"') { goto l147 } position++ add(ruleQuoteChar, position148) } return true l147: position, tokenIndex = position147, tokenIndex147 return false }, /* 27 Pattern <- <(<PatternChars+> Spacing)> */ nil, /* 28 PatternChars <- <(IdentifierChars / GlobSymbols)> */ func() bool { position150, tokenIndex150 := position, tokenIndex { position151 := position { position152, tokenIndex152 := position, tokenIndex if !_rules[ruleIdentifierChars]() { goto l153 } goto l152 l153: position, tokenIndex = position152, tokenIndex152 { position154 := position { switch buffer[position] { case '$': if buffer[position] != rune('$') { goto l150 } position++ break case '^': if buffer[position] != rune('^') { goto l150 } position++ break case ',': if buffer[position] != rune(',') { goto l150 } position++ break case '?': if buffer[position] != rune('?') { goto l150 } position++ break case '*': if buffer[position] != rune('*') { goto l150 } position++ break case ']': if buffer[position] != rune(']') { goto l150 } position++ break case '[': if buffer[position] != rune('[') { goto l150 } position++ break case '}': if buffer[position] != rune('}') { goto l150 } position++ break default: if buffer[position] != rune('{') { goto l150 } position++ break } } add(ruleGlobSymbols, position154) } } l152: add(rulePatternChars, position151) } return true l150: position, tokenIndex = position150, tokenIndex150 return false }, /* 29 GlobSymbols <- <((&('$') '$') | (&('^') '^') | (&(',') ',') | (&('?') '?') | (&('*') '*') | (&(']') ']') | (&('[') '[') | (&('}') '}') | (&('{') '{'))> */ nil, /* 30 Semicolon <- <(';' Spacing)> */ nil, /* 31 Equals <- <('=' Spacing)> */ nil, /* 32 Pipe <- <('|' Spacing)> */ nil, /* 33 LParenthesis <- <('(' Spacing)> */ nil, /* 34 RParenthesis <- <(')' Spacing)> */ nil, /* 35 Colon <- <(':' Spacing)> */ nil, /* 36 EOF <- <!.> */ nil, /* 38 Action0 <- <{ p.newMacro(text) }> */ nil, /* 39 Action1 <- <{ p.newPipeline() }> */ nil, /* 40 Action2 <- <{ p.endPipeline() }> */ nil, /* 41 Action3 <- <{ p.newExpression(text) }> */ nil, /* 42 Action4 <- <{ p.endExpression() }> */ nil, /* 43 Action5 <- <{ p.newBooleanArgument(text) }> */ nil, /* 44 Action6 <- <{ p.newNumericArgument(text) }> */ nil, /* 45 Action7 <- <{ p.newPatternArgument(text) }> */ nil, /* 46 Action8 <- <{ p.<API key>(text) }> */ nil, /* 47 Action9 <- <{ p.newKeywordArgument(text) }> */ nil, nil, } p.rules = _rules }
<?php namespace PortaText\Command\Api; use PortaText\Command\Base; /** * The Campaigns endpoint. This is a campaign of type SMS. */ class SmsCampaign extends Campaigns { /** * Specifies source sms service. * * @param string $serviceId SMS Service ID. * * @return PortaText\Command\ICommand */ public function fromService($serviceId) { return $this->setArgument("service_id", $serviceId); } /** * Sets the template id to use. * * @param integer $templateId Use the given template as the message body. * @param array $variables Variables to use in template. * * @return PortaText\Command\ICommand */ public function useTemplate($templateId, array $variables = array()) { $this->setSetting("template_id", $templateId); return $this->setSetting("variables", $variables); } /** * Sets the message text. * * @param string $text Message text. * * @return PortaText\Command\ICommand */ public function text($text) { return $this->setSetting("text", $text); } /** * Standard constructor. * */ public function __construct() { parent::__construct(); $this->setArgument("type", "sms"); } }
# <API key>: true require 'github_request' class <API key> SUBSCRIBE_NAME = "web" def initialize(repository, oauth_token) @repository = repository @oauth_token = oauth_token @root_url = "#{repository.base_api_url}/hooks" @hook_url = "#{repository.base_api_url}/hooks/#{repository.<API key>}" @receive_url = Rails.application.routes.url_helpers.<API key> @interested_events = @repository.<API key> @subscribe_args = {:name => "web", :config => {:url => @receive_url}, :events => @interested_events, :active => true} end def subscribe! if @repository.<API key> <API key>! else <API key>! end end private def <API key>! begin GithubRequest.patch(@hook_url, @subscribe_args, @oauth_token) rescue GithubRequest::ResponseError => e if e.response.class == Net::HTTPNotFound create_hook else raise e end end end def <API key>! begin response_body = GithubRequest.get(@root_url, @oauth_token) existing_hooks = JSON.parse(response_body) <API key> = existing_hooks.detect do |hook| hook["active"] && hook["events"] == @interested_events && hook["config"]["url"] == @receive_url end if <API key> @repository.update_attributes(:<API key> => <API key>["id"]) return response_body end rescue GithubRequest::ResponseError Rails.logger.info("Failed to get hooks for #{@root_url}") end create_hook end def create_hook GithubRequest.post(@root_url, @subscribe_args, @oauth_token) end end
package org.swtk.commons.dict.wiktionary.generated.a.u.v; import java.util.Collection; import java.util.HashMap; import java.util.Map; import org.swtk.common.dict.dto.wiktionary.Entry; import com.trimc.blogger.commons.utils.GsonUtils; public class WiktionaryAUV000 { private static Map<String, Entry> map = new HashMap<String, Entry>(); static { add("auvergne", "{\"term\":\"auvergne\", \"etymology\":{\"influencers\":[], \"languages\":[], \"text\":\"{{rfe|lang\u003den}}\"}, \"definitions\":{\"list\":[{\"upperType\":\"NOUN\", \"text\":\"A region and historical province of France\", \"priority\":1}]}, \"synonyms\":{}}"); } private static void add(String term, String json) { map.put(term, GsonUtils.toObject(json, Entry.class)); } public static Entry get(String term) { return map.get(term); } public static boolean has(String term) { return null != get(term); } public static Collection<String> terms() { return map.keySet(); } }
# <API key>: true # rubocop:disable Layout/LineLength # == Schema Information # Table name: form_items # id :uuid not null, primary key # all_levels_required :boolean default(FALSE), not null # ancestry :text # ancestry_depth :integer not null # default :string # disabled :boolean default(FALSE), not null # display_if :string default("always"), not null # <API key> :jsonb # <API key> :jsonb # <API key> :jsonb # hidden :boolean default(FALSE), not null # one_screen :boolean # rank :integer not null # read_only :boolean # repeatable :boolean # required :boolean default(FALSE), not null # type :string(255) not null # created_at :datetime not null # updated_at :datetime not null # form_id :uuid not null # form_old_id :integer # mission_id :uuid # old_id :integer # question_id :uuid # question_old_id :integer # Indexes # <API key> (ancestry) # <API key> (form_id) # <API key> (form_id,question_id) UNIQUE # <API key> (mission_id) # <API key> (question_id) # Foreign Keys # <API key> (form_id => forms.id) ON DELETE => restrict ON UPDATE => restrict # <API key> (mission_id => missions.id) ON DELETE => restrict ON UPDATE => restrict # <API key> (question_id => questions.id) ON DELETE => restrict ON UPDATE => restrict # rubocop:enable Layout/LineLength require "rails_helper" describe Questioning do it "mission should get copied from question on creation" do f = create(:form, question_types: %w[integer], mission: get_mission) expect(f.questionings[0].mission).to eq(get_mission) end describe "normalization" do # Run valid? to trigger normalization let(:q_attrs) { {} } let(:question) { create(:question, q_attrs) } let(:qing) { build(:questioning, submitted.merge(question: question)).tap(&:valid?) } subject { submitted.keys.index_with { |k| qing.send(k) }.to_h } describe "hidden/disabled/required/read_only" do context do let(:submitted) { {hidden: true, disabled: false, required: true, read_only: false} } it { is_expected.to eq(hidden: true, disabled: false, required: false, read_only: false) } end context do let(:submitted) { {hidden: false, disabled: true, required: true, read_only: false} } it { is_expected.to eq(hidden: false, disabled: true, required: true, read_only: false) } end context do let(:submitted) { {hidden: true, disabled: true, required: false, read_only: false} } it { is_expected.to eq(hidden: true, disabled: true, required: false, read_only: false) } end context do let(:submitted) { {hidden: false, disabled: false, required: true, read_only: false} } it { is_expected.to eq(hidden: false, disabled: false, required: true, read_only: false) } end context do let(:submitted) { {hidden: false, disabled: false, required: true, read_only: true} } it { is_expected.to eq(hidden: false, disabled: false, required: false, read_only: true) } end context do let(:submitted) { {hidden: false, disabled: false, required: false, read_only: true} } it { is_expected.to eq(hidden: false, disabled: false, required: false, read_only: true) } end end describe "preload_last_saved and default" do context do let(:submitted) { {preload_last_saved: false, default: "foo"} } it { is_expected.to eq(preload_last_saved: false, default: "foo") } end context do let(:submitted) { {preload_last_saved: true, default: "foo"} } it { is_expected.to eq(preload_last_saved: true, default: nil) } end end describe "question metadata and hidden/disabled/required" do context do let(:q_attrs) { {qtype_name: "datetime", metadata_type: "formstart"} } let(:submitted) { {required: true, hidden: false, disabled: false} } it { is_expected.to eq(required: false, hidden: true, disabled: false) } end context do let(:q_attrs) { {qtype_name: "datetime", metadata_type: "formstart"} } let(:submitted) { {required: "", hidden: true, disabled: true} } it { is_expected.to eq(required: false, hidden: true, disabled: true) } end context do let(:q_attrs) { {qtype_name: "datetime", metadata_type: ""} } let(:submitted) { {required: true, disabled: false} } it { is_expected.to eq(required: true, disabled: false) } end end describe "question metadata and condition" do let(:condition) { build(:condition) } context "not adding a metadata_type" do let(:q_attrs) { {qtype_name: "datetime", metadata_type: nil} } let(:submitted) { {display_conditions: [condition]} } it "should not destroy existing conditions" do is_expected.to eq(display_conditions: [condition]) end end context "add a metadata_type with an existing condition" do let(:q_attrs) { {qtype_name: "datetime", metadata_type: "formstart"} } let(:submitted) { {display_conditions: [condition]} } it "should destroy existing conditions" do is_expected.to eq(display_conditions: []) expect(condition).to be_destroyed end end context "add a metadata_type with no existing conditions" do let(:q_attrs) { {qtype_name: "datetime", metadata_type: "formstart"} } let(:submitted) { {display_conditions: []} } it "should not change the display conditions" do is_expected.to eq(display_conditions: []) end end end describe "all_levels_required" do let(:question) { form.c[0].question } context "multilevel, required question" do let(:form) { create(:form, question_types: %w[<API key>]) } let(:submitted) { {all_levels_required: true, required: true} } it "should leave all_levels_required alone" do is_expected.to eq(all_levels_required: true, required: true) end end context "multilevel, non-required question" do let(:form) { create(:form, question_types: %w[<API key>]) } let(:submitted) { {all_levels_required: true, required: false} } it "should reset all_levels_required" do is_expected.to eq(all_levels_required: false, required: false) end end context "non-multilevel question" do let(:form) { create(:form, question_types: %w[select_one]) } let(:submitted) { {all_levels_required: true, required: true} } it "should reset all_levels_required" do is_expected.to eq(all_levels_required: false, required: true) end end context "non-select question" do let(:form) { create(:form, question_types: %w[integer]) } let(:submitted) { {all_levels_required: true, required: true} } it "should reset all_levels_required" do is_expected.to eq(all_levels_required: false, required: true) end end end end describe "validation" do let(:questioning) { build(:questioning, default: "Item: calc($Foo + 4) ") } # Detailed testing of this validator is in own file. describe "<API key>" do it "is hooked up properly" do expect(questioning).to be_invalid expect(questioning.errors[:default].join).to match(/must surround/) end end it "should fail properly when there is no qtype" do questioning.qtype_name = nil expect { questioning.save }.not_to raise_error end end end
package org.qcri.rheem.basic.operators; import org.apache.commons.lang3.Validate; import org.qcri.rheem.core.api.Configuration; import org.qcri.rheem.core.function.<API key>; import org.qcri.rheem.core.function.PredicateDescriptor; import org.qcri.rheem.core.optimizer.OptimizationContext; import org.qcri.rheem.core.optimizer.<API key>; import org.qcri.rheem.core.optimizer.cardinality.CardinalityEstimate; import org.qcri.rheem.core.optimizer.cardinality.<API key>; import org.qcri.rheem.core.optimizer.cardinality.<API key>; import org.qcri.rheem.core.plan.rheemplan.<API key>; import org.qcri.rheem.core.types.DataSetType; import java.util.Optional; /** * This operator returns the distinct elements in this dataset. */ public class DistinctOperator<Type> extends <API key><Type, Type> { protected final <API key><Type> predicateDescriptor; /** * Creates a new instance. * * @param type type of the dataunit elements */ public DistinctOperator(DataSetType<Type> type) { super(type, type, false); this.predicateDescriptor = null; } public DistinctOperator(DataSetType<Type> type, <API key><Type> predicateDescriptor) { super(type, type, false); this.predicateDescriptor = predicateDescriptor; } /** * Creates a new instance. * * @param typeClass type of the dataunit elements */ public DistinctOperator(Class<Type> typeClass) { this(DataSetType.createDefault(typeClass)); } /** * Copies an instance (exclusive of broadcasts). * * @param that that should be copied */ public DistinctOperator(DistinctOperator<Type> that) { super(that); this.predicateDescriptor = that.<API key>(); } public <API key><Type> <API key>() { return this.predicateDescriptor; } public String getSelectKeyString(){ if (this.<API key>() != null && this.<API key>().getUdfSelectivity() != null){ return this.<API key>().<API key>(); } else { return ""; } } // // Assume with a confidence of 0.7 that 70% of the data quanta are pairwise distinct. // return Optional.of(new <API key>(0.7d, 1, this.<API key>(), // inputCards -> (long) (inputCards[0] * 0.7d))); // TODO JRK: Do not make baseline worse @Override public Optional<org.qcri.rheem.core.optimizer.cardinality.<API key>> <API key>( final int outputIndex, final Configuration configuration) { Validate.inclusiveBetween(0, this.getNumOutputs() - 1, outputIndex); return Optional.of(new DistinctOperator.<API key>(configuration)); } private class <API key> implements org.qcri.rheem.core.optimizer.cardinality.<API key> { /** * The expected selectivity to be applied in this instance. */ private final <API key> selectivity; Configuration configuration; public <API key>(Configuration configuration) { this.selectivity = configuration.<API key>().provideFor(DistinctOperator.this.predicateDescriptor); this.configuration = configuration; } @Override public CardinalityEstimate estimate(OptimizationContext optimizationContext, CardinalityEstimate... inputEstimates) { Validate.isTrue(inputEstimates.length == DistinctOperator.this.getNumInputs()); final CardinalityEstimate inputEstimate = inputEstimates[0]; String mode = this.configuration.getStringProperty("rheem.optimizer.sr.mode", "best"); if (mode.equals("best")){ mode = this.selectivity.getBest(); } if (mode.equals("lin")) { return new CardinalityEstimate( (long) Math.max(0, ((inputEstimate.getLowerEstimate() * this.selectivity.getCoeff() + this.selectivity.getIntercept()) * inputEstimate.getLowerEstimate())), (long) Math.max(0, ((inputEstimate.getUpperEstimate() * this.selectivity.getCoeff() + this.selectivity.getIntercept()) * inputEstimate.getUpperEstimate())), inputEstimate.<API key>() * this.selectivity.<API key>() ); } else if (mode.equals("log")) { return new CardinalityEstimate( (long) Math.max(0, ((Math.log(inputEstimate.getLowerEstimate()) * this.selectivity.getLog_coeff() + this.selectivity.getLog_intercept()) * inputEstimate.getLowerEstimate())), (long) Math.max(0, ((Math.log(inputEstimate.getUpperEstimate()) * this.selectivity.getLog_coeff() + this.selectivity.getLog_intercept()) * inputEstimate.getUpperEstimate())), inputEstimate.<API key>() * this.selectivity.<API key>() ); } else { return new CardinalityEstimate( (long) Math.max(0, (inputEstimate.getLowerEstimate() * this.selectivity.getLowerEstimate())), (long) Math.max(0, (inputEstimate.getUpperEstimate() * this.selectivity.getUpperEstimate())), inputEstimate.<API key>() * this.selectivity.<API key>() ); } } } }
import Future = require("fibers/future"); import * as npm from "npm"; interface INpmOpts { config?: any; subCommandName?: string; path?: string; } export class NodePackageManager implements INodePackageManager { constructor(private $childProcess: IChildProcess, private $logger: ILogger, private $options: IOptions) { } public getCache(): string { return npm.cache; } public load(config?: any): IFuture<void> { if (npm.config.loaded) { let data = npm.config.sources.cli.data; Object.keys(data).forEach(k => delete data[k]); if (config) { _.assign(data, config); } return Future.fromResult(); } else { let future = new Future<void>(); npm.load(config, (err: Error) => { if (err) { future.throw(err); } else { future.return(); } }); return future; } } public install(packageName: string, pathToSave: string, config?: any): IFuture<any> { return (() => { if (this.$options.disableNpmInstall) { return; } if (this.$options.ignoreScripts) { config = config || {}; config["ignore-scripts"] = true; } try { return this.loadAndExecute("install", [pathToSave, packageName], { config: config }).wait(); } catch (err) { if (err.code === "EPEERINVALID") { // Not installed peer dependencies are treated by npm 2 as errors, but npm 3 treats them as warnings. // We'll show them as warnings and let the user install them in case they are needed. // The strucutre of the error object in such case is: // { [Error: The package @angular/core@2.1.0-beta.0 does not satisfy its siblings' peerDependencies requirements!] // code: 'EPEERINVALID', // packageName: '@angular/core', // peersDepending: // { '@angular/common@2.1.0-beta.0': '2.1.0-beta.0', // '@angular/compiler@2.1.0-beta.0': '2.1.0-beta.0', // '@angular/forms@2.1.0-beta.0': '2.1.0-beta.0', // '@angular/http@2.1.0-beta.0': '2.1.0-beta.0', // '@angular/platform-browser@2.1.0-beta.0': '2.1.0-beta.0', // '@angular/<API key>@2.1.0-beta.0': '2.1.0-beta.0', // '@angular/platform-server@2.1.0-beta.0': '2.1.0-beta.0', // '@angular/router@3.1.0-beta.0': '2.1.0-beta.0', // '@ngrx/effects@2.0.0': '^2.0.0', // '@ngrx/store@2.2.1': '^2.0.0', // 'ng2-translate@2.5.0': '~2.0.0' } } this.$logger.warn(err.message); this.$logger.trace("Required peerDependencies are: ", err.peersDepending); } else { // All other errors should be handled by the caller code. throw err; } } }).future<any>()(); } public uninstall(packageName: string, config?: any, path?: string): IFuture<any> { return this.loadAndExecute("uninstall", [[packageName]], { config, path }); } public search(filter: string[], silent: boolean): IFuture<any> { let args = (<any[]>([filter] || [])).concat(silent); return this.loadAndExecute("search", args); } public cache(packageName: string, version: string, config?: any): IFuture<IDependencyData> { // function cache (pkg, ver, where, scrub, cb) return this.loadAndExecute("cache", [packageName, version, undefined, false], { subCommandName: "add", config: config }); } public cacheUnpack(packageName: string, version: string, unpackTarget?: string): IFuture<void> { // function unpack (pkg, ver, unpackTarget, dMode, fMode, uid, gid, cb) return this.loadAndExecute("cache", [packageName, version, unpackTarget, null, null, null, null], { subCommandName: "unpack" }); } public view(packageName: string, propertyName: string): IFuture<any> { return this.loadAndExecute("view", [[packageName, propertyName], [false]]); } public executeNpmCommand(npmCommandName: string, <API key>: string): IFuture<any> { return this.$childProcess.exec(npmCommandName, { cwd: <API key> }); } private loadAndExecute(commandName: string, args: any[], opts?: INpmOpts): IFuture<any> { return (() => { opts = opts || {}; this.load(opts.config).wait(); return this.executeCore(commandName, args, opts).wait(); }).future<any>()(); } private executeCore(commandName: string, args: any[], opts?: INpmOpts): IFuture<any> { let future = new Future<any>(); let oldNpmPath: string = undefined; let callback = (err: Error, data: any) => { if (oldNpmPath) { npm.prefix = oldNpmPath; } if (err) { future.throw(err); } else { future.return(data); } }; args.push(callback); if (opts && opts.path) { oldNpmPath = npm.prefix; npm.prefix = opts.path; } let subCommandName: string = opts.subCommandName; let command = subCommandName ? npm.commands[commandName][subCommandName] : npm.commands[commandName]; command.apply(this, args); return future; } } $injector.register("npm", NodePackageManager);
package com.github.obourgain.elasticsearch.http.response.parser; import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; import org.elasticsearch.common.xcontent.XContentParser; import com.github.obourgain.elasticsearch.http.response.entity.Indices; import com.github.obourgain.elasticsearch.http.response.entity.ShardFailure; import com.github.obourgain.elasticsearch.http.response.entity.Shards; import lombok.Getter; @Getter public class IndicesParser { private static List<ShardFailure> failures; public static Indices parse(XContentParser parser) { Map<String, Shards> result = new HashMap<>(); try { XContentParser.Token token; String currentFieldName = null; while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) { if (token == XContentParser.Token.FIELD_NAME) { currentFieldName = parser.currentName(); } else if (token == XContentParser.Token.START_ARRAY) { failures = ShardFailure.parse(parser); } else if (token == XContentParser.Token.START_OBJECT) { Shards shards = new Shards().parse(parser); result.put(currentFieldName, shards); } } return Indices.fromMap(result); } catch (IOException e) { throw new RuntimeException("Unable to parse source", e); } } }
package com.camillepradel.movierecommender.utils; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.sql.Connection; import java.sql.Date; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Statement; import java.util.Arrays; public class CsvToMySql { static final String pathToCsvFiles = "D:\\MovieRecommender\\src\\main\\java\\com\\camillepradel\\movierecommender\\utils\\"; static final String usersCsvFile = pathToCsvFiles + "users.csv"; static final String moviesCsvFile = pathToCsvFiles + "movies.csv"; static final String genresCsvFile = pathToCsvFiles + "genres.csv"; static final String movGenreCsvFile = pathToCsvFiles + "mov_genre.csv"; static final String ratingsCsvFile = pathToCsvFiles + "ratings.csv"; static final String friendsCsvFile = pathToCsvFiles + "friends.csv"; static final String cvsSplitBy = ","; private static void commitUsers(Connection connection) throws SQLException { System.out.println(usersCsvFile); // create table Statement statement = connection.createStatement(); statement.executeUpdate("CREATE TABLE IF NOT EXISTS users (\n" + " id int(11) NOT NULL AUTO_INCREMENT,\n" + " age int(11) NOT NULL,\n" + " sex varchar(1) NOT NULL,\n" + " occupation varchar(60) NOT NULL,\n" + " zip varchar(6) NOT NULL,\n" + " PRIMARY KEY (`id`)\n" + ");"); // populate table try (BufferedReader br = new BufferedReader(new FileReader(usersCsvFile))) { String insertQuery = "INSERT INTO users (id, age, sex, occupation, zip) VALUES (?, ?, ?, ?, ?)"; PreparedStatement insertUsers = null; try { connection.setAutoCommit(false); insertUsers = connection.prepareStatement(insertQuery); String line; br.readLine(); // skip first line while ((line = br.readLine()) != null) { String[] values = line.split(cvsSplitBy); insertUsers.setInt(1, Integer.parseInt(values[0])); insertUsers.setInt(2, Integer.parseInt(values[1])); insertUsers.setString(3, values[2]); insertUsers.setString(4, values[3]); insertUsers.setString(5, values[4]); insertUsers.executeUpdate(); } connection.commit(); } catch (SQLException e) { e.printStackTrace(); if (connection != null) { try { System.err.print("Transaction is being rolled back"); connection.rollback(); } catch (SQLException e2) { e2.printStackTrace(); } } } finally { if (insertUsers != null) { insertUsers.close(); } connection.setAutoCommit(true); } } catch (IOException e) { e.printStackTrace(); } } private static void commitMovies(Connection connection) throws SQLException { // movies.csv System.out.println(moviesCsvFile); // create table Statement statement = connection.createStatement(); statement.executeUpdate("CREATE TABLE IF NOT EXISTS movies (\n" + " id int(11) NOT NULL AUTO_INCREMENT,\n" + " title varchar(200) NOT NULL,\n" + " date date NOT NULL,\n" + " PRIMARY KEY (`id`)\n" + ");"); // populate table try (BufferedReader br = new BufferedReader(new FileReader(moviesCsvFile))) { String insertQuery = "INSERT INTO movies (id, title, date) VALUES (?, ?, ?)"; PreparedStatement insertMovies = null; try { connection.setAutoCommit(false); insertMovies = connection.prepareStatement(insertQuery); String line; br.readLine(); // skip first line while ((line = br.readLine()) != null) { String[] values = line.split(cvsSplitBy); int movieId = Integer.parseInt(values[0]); String title = String.join(",", Arrays.copyOfRange(values, 1, values.length - 1)); Date date = new Date(Long.parseLong(values[values.length - 1]) * 1000); insertMovies.setInt(1, movieId); insertMovies.setString(2, title); insertMovies.setDate(3, date); insertMovies.executeUpdate(); } connection.commit(); } catch (SQLException e) { e.printStackTrace(); if (connection != null) { try { System.err.print("Transaction is being rolled back"); connection.rollback(); } catch (SQLException e2) { e2.printStackTrace(); } } } finally { if (insertMovies != null) { insertMovies.close(); } connection.setAutoCommit(true); } } catch (IOException e) { e.printStackTrace(); } } private static void commitGenres(Connection connection) throws SQLException { // genres.csv System.out.println(genresCsvFile); // create table Statement statement = connection.createStatement(); statement.executeUpdate("CREATE TABLE IF NOT EXISTS genres (\n" + " name varchar(60) NOT NULL,\n" + " id int(11) NOT NULL AUTO_INCREMENT,\n" + " PRIMARY KEY (`id`)\n" + ");"); // necessary to make mySQL accept 0 as a valid id value for genre unknown statement.execute("SET SESSION sql_mode='<API key>';"); // populate table try (BufferedReader br = new BufferedReader(new FileReader(genresCsvFile))) { String insertQuery = "INSERT INTO genres (name, id) VALUES (?, ?)"; PreparedStatement insertGenres = null; try { connection.setAutoCommit(false); insertGenres = connection.prepareStatement(insertQuery); String line; br.readLine(); // skip first line while ((line = br.readLine()) != null) { String[] values = line.split(cvsSplitBy); String name = values[0]; int genreId = Integer.parseInt(values[1]); insertGenres.setString(1, name); insertGenres.setInt(2, genreId); insertGenres.executeUpdate(); } connection.commit(); } catch (SQLException e) { e.printStackTrace(); if (connection != null) { try { System.err.print("Transaction is being rolled back"); connection.rollback(); } catch (SQLException e2) { e2.printStackTrace(); } } } finally { if (insertGenres != null) { insertGenres.close(); } connection.setAutoCommit(true); } } catch (IOException e) { e.printStackTrace(); } } private static void commitMovieGenre(Connection connection) throws SQLException { // mov_genre.csv System.out.println(movGenreCsvFile); // create table Statement statement = connection.createStatement(); statement.executeUpdate("CREATE TABLE IF NOT EXISTS movie_genre (\n" + " movie_id int(11) NOT NULL,\n" + " genre_id int(11) NOT NULL,\n" + " KEY movie_id (movie_id),\n" + " KEY genre_id (genre_id)\n" + ");"); statement.executeUpdate("ALTER TABLE movie_genre\n" + " ADD CONSTRAINT <API key> FOREIGN KEY (movie_id) REFERENCES movies(id) ON DELETE CASCADE ON UPDATE CASCADE;\n"); statement.executeUpdate("ALTER TABLE movie_genre\n" + " ADD CONSTRAINT <API key> FOREIGN KEY (genre_id) REFERENCES genres(id) ON DELETE CASCADE ON UPDATE CASCADE;\n"); // populate table try (BufferedReader br = new BufferedReader(new FileReader(movGenreCsvFile))) { String insertQuery = "INSERT INTO movie_genre (movie_id, genre_id) VALUES (?, ?)"; PreparedStatement insertMovieGenre = null; try { connection.setAutoCommit(false); insertMovieGenre = connection.prepareStatement(insertQuery); String line; br.readLine(); // skip first line while ((line = br.readLine()) != null) { String[] values = line.split(cvsSplitBy); int movieId = Integer.parseInt(values[0]); int genreId = Integer.parseInt(values[1]); insertMovieGenre.setInt(1, movieId); insertMovieGenre.setInt(2, genreId); insertMovieGenre.executeUpdate(); } connection.commit(); } catch (SQLException e) { e.printStackTrace(); if (connection != null) { try { System.err.print("Transaction is being rolled back"); connection.rollback(); } catch (SQLException e2) { e2.printStackTrace(); } } } finally { if (insertMovieGenre != null) { insertMovieGenre.close(); } connection.setAutoCommit(true); } } catch (IOException e) { e.printStackTrace(); } } private static void commitRatings(Connection connection) throws SQLException { // ratings.csv System.out.println(ratingsCsvFile); // create table Statement statement = connection.createStatement(); statement.executeUpdate("CREATE TABLE IF NOT EXISTS ratings (\n" + " user_id int(11) NOT NULL,\n" + " movie_id int(11) NOT NULL,\n" + " rating int(11) NOT NULL,\n" + " date date NOT NULL,\n" + " KEY user_id (user_id),\n" + " KEY movie_id (movie_id)\n" + ");"); statement.executeUpdate("ALTER TABLE ratings\n" + " ADD CONSTRAINT ratings_to_user FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE ON UPDATE CASCADE;\n"); statement.executeUpdate("ALTER TABLE ratings\n" + " ADD CONSTRAINT ratings_to_movie FOREIGN KEY (movie_id) REFERENCES movies(id) ON DELETE CASCADE ON UPDATE CASCADE;\n"); statement.executeUpdate("ALTER TABLE ratings\n" + " ADD UNIQUE unique_index(user_id, movie_id);\n"); // populate table try (BufferedReader br = new BufferedReader(new FileReader(ratingsCsvFile))) { String insertQuery = "INSERT INTO ratings (user_id, movie_id, rating, date) VALUES (?, ?, ?, ?)"; PreparedStatement insertRatings = null; try { connection.setAutoCommit(false); insertRatings = connection.prepareStatement(insertQuery); String line; br.readLine(); // skip first line while ((line = br.readLine()) != null) { String[] values = line.split(cvsSplitBy); int userId = Integer.parseInt(values[0]); int movieId = Integer.parseInt(values[1]); int ratingValue = Integer.parseInt(values[2]); Date date = new Date(Long.parseLong(values[3]) * 1000); insertRatings.setInt(1, userId); insertRatings.setInt(2, movieId); insertRatings.setInt(3, ratingValue); insertRatings.setDate(4, date); insertRatings.executeUpdate(); } connection.commit(); } catch (SQLException e) { e.printStackTrace(); if (connection != null) { try { System.err.print("Transaction is being rolled back"); connection.rollback(); } catch (SQLException e2) { e2.printStackTrace(); } } } finally { if (insertRatings != null) { insertRatings.close(); } connection.setAutoCommit(true); } } catch (IOException e) { e.printStackTrace(); } } private static void commitFriends(Connection connection) throws SQLException { // friends.csv System.out.println(friendsCsvFile); // create table Statement statement = connection.createStatement(); statement.executeUpdate("CREATE TABLE IF NOT EXISTS friends (\n" + " user1_id int(11) NOT NULL,\n" + " user2_id int(11) NOT NULL,\n" + " KEY user1_id (user1_id),\n" + " KEY user2_id (user2_id)\n" + ");"); statement.executeUpdate("ALTER TABLE friends\n" + " ADD CONSTRAINT friends_to_user1 FOREIGN KEY (user1_id) REFERENCES users(id) ON DELETE CASCADE ON UPDATE CASCADE;\n"); statement.executeUpdate("ALTER TABLE friends\n" + " ADD CONSTRAINT friends_to_user2 FOREIGN KEY (user2_id) REFERENCES users(id) ON DELETE CASCADE ON UPDATE CASCADE;\n"); // populate table try (BufferedReader br = new BufferedReader(new FileReader(friendsCsvFile))) { String insertQuery = "INSERT INTO friends (user1_id, user2_id) VALUES (?, ?)"; PreparedStatement insertFriends = null; try { connection.setAutoCommit(false); insertFriends = connection.prepareStatement(insertQuery); String line; br.readLine(); // skip first line while ((line = br.readLine()) != null) { String[] values = line.split(cvsSplitBy); int user1Id = Integer.parseInt(values[0]); int user2Id = Integer.parseInt(values[1]); insertFriends.setInt(1, user1Id); insertFriends.setInt(2, user2Id); insertFriends.executeUpdate(); } connection.commit(); } catch (SQLException e) { e.printStackTrace(); if (connection != null) { try { System.err.print("Transaction is being rolled back"); connection.rollback(); } catch (SQLException e2) { e2.printStackTrace(); } } } finally { if (insertFriends != null) { insertFriends.close(); } connection.setAutoCommit(true); } } catch (IOException e) { e.printStackTrace(); } } public static void main(String[] args) { // load JDBC driver try { Class.forName("com.mysql.cj.jdbc.Driver"); } catch (<API key> e) { e.printStackTrace(); } // db connection info String url = "jdbc:mysql://localhost:3306" + "?<API key>=convertToNull&useUnicode=true&<API key>=true&<API key>=false&serverTimezone=UTC"; String login = "admin"; String password = "Q86PhnJRiEa7"; Connection connection = null; try { connection = DriverManager.getConnection(url, login, password); Statement statement = connection.createStatement(); // create database statement.executeUpdate("DROP DATABASE IF EXISTS movie_recommender;"); statement.executeUpdate("CREATE DATABASE movie_recommender;"); statement.executeUpdate("USE movie_recommender;"); commitUsers(connection); commitMovies(connection); commitGenres(connection); commitMovieGenre(connection); commitRatings(connection); commitFriends(connection); } catch (SQLException e) { e.printStackTrace(); } finally { if (connection != null) { try { connection.close(); } catch (SQLException ignore) { // exception occured while closing connexion -> nothing else can be done } } } System.out.println("done"); } }
package com.turlir.abakgists.allgists.view.listing; import androidx.recyclerview.widget.RecyclerView; import android.view.View; abstract class ModelViewHolder<T> extends RecyclerView.ViewHolder { ModelViewHolder(View itemView) { super(itemView); } abstract void bind(T model); }
package com.zuoqing.demo.entity; /** * http */ public class Result<T> { private Integer code; private String msg; private T data; public Integer getCode() { return code; } public void setCode(Integer code) { this.code = code; } public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public T getData() { return data; } public void setData(T data) { this.data = data; } }
package utils import java.io.{BufferedReader, File, InputStreamReader} import scala.io.Source object NextLine { type NextLine = () => String def fromSystemIn(): NextLine = { val bi = new BufferedReader(new InputStreamReader(System.in)) () => bi.readLine() } def fromFile(file: File): NextLine = { fromSeq(Source.fromFile(file).getLines().toSeq) } def fromSeq(seq: Seq[String]): NextLine = { var list = seq () => { val r = list.head list = list.tail r } } }
package com.eric.drools_demo; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Unit test for simple App. */ public class AppTest extends TestCase { /** * Create the test case * * @param testName name of the test case */ public AppTest( String testName ) { super( testName ); } /** * @return the suite of tests being tested */ public static Test suite() { return new TestSuite( AppTest.class ); } /** * Rigourous Test :-) */ public void testApp() { assertTrue( true ); } }
package com.cognitionis.nlp_files; import java.io.*; import java.util.regex.*; public class TreebankFile extends NLPFile { public TreebankFile(String filename) { super(filename); } @Override public Boolean isWellFormatted() { int par_level = 0; try { if (super.getFile()==null) { throw new Exception("No file loaded in NLPFile object"); } BufferedReader reader = new BufferedReader(new FileReader(this.f)); try { String line = null; int linen = 0; Pattern p = Pattern.compile("[\\(\\)]"); while ((line = reader.readLine()) != null) { linen++; //System.getProperty("line.separator") if (line.matches("\\s*[^\\(\\s].*")) { throw new Exception("Treebank format error: line " + linen + " not begining with \\s*("); } Matcher m = p.matcher(line); while (m.find()) { if (m.group().equals("(")) { par_level++; } else { par_level if (par_level < 0) { throw new Exception("Treebank format error: par_level lower than 0"); } } } //System.out.println(linen+": "+line+" - parlevel="+ par_level); } } finally { reader.close(); } if (par_level != 0) { throw new Exception("Treebank format error: positive unbalancement, par_level=" + par_level); } } catch (Exception e) { System.err.println("Errors found ("+this.getClass().getSimpleName()+"):\n\t" + e.toString() + "\n"); if(System.getProperty("DEBUG")!=null && System.getProperty("DEBUG").equalsIgnoreCase("true")){e.printStackTrace(System.err);} return false; } return true; } public String toPlain(String filename){ // one token, one space, one token, one space... (end of sentence -> \n) return this.getFile().toString(); } }