answer
stringlengths
15
1.25M
//initialization function declarations void setDelayTime(RobotState *robot); //initializaiton function definitions void initialize(RobotState *robot) { HTSPBsetupIO(HTSPB, 0xFF); while (externalBatteryAvg < 0 || <API key>(SMUX) || <API key>(SMUX2)){ HTSPBwriteIO(HTSPB, B3); PlaySound(soundBeepBeep); } HTSPBwriteIO(HTSPB, 0x00); memset(robot, 0, sizeof(robot)); motor[leftTread] = 0; motor[rightTread] = 0; servo[pawServo] = PAWSERVODOWN; servo[wrist] = WRISTOUT; servo[elbow] = ELBOWOUT; servo[stopper] = STOPPERIN; servo[flagServo] = FLAGSERVOIN; // Calibrate the gyro, make sure you hold the sensor still HTGYROstartCal(HTGYRO); // Initialize the accelerometer, it needs at least TRACK_PAST_N_VALUES*20 millisecs to do so StartTask(<API key>); wait1Msec(2*TRACK_PAST_N_VALUES*20); // not necessary b/c we're waiting 5 seconds below <API key>(); setDelayTime(robot); //wait1Msec(5000); servo[wrist] = 255; servo[elbow] = 10; } void setDelayTime(RobotState *robot) { eraseDisplay(); string time = robot->delayTime; nxtDisplayTextLine(3, "Delay Time:"); nxtDisplayTextLine(5, time); TNxtButtons oldButton = nNxtButtonPressed; while(nNxtButtonPressed != 3) { PlaySound(soundBlip); short nxtButtonChanged = oldButton ^ nNxtButtonPressed; oldButton = nNxtButtonPressed; if (nNxtButtonPressed == 1 && nxtButtonChanged) { robot->delayTime ++; time = robot->delayTime; nxtDisplayTextLine(5, time); } else if (nNxtButtonPressed == 2 && nxtButtonChanged) { robot->delayTime time = robot->delayTime; nxtDisplayTextLine(5, time); } } eraseDisplay(); }
<?php class Multiplicacao implements Expressao { private $esquerdo; private $direito; function __construct(Expressao $ladoEsquerdo, Expressao $ladoDireito) { $this->esquerdo = $ladoEsquerdo; $this->direito = $ladoDireito; } public function avalia() { $valorEsquerda = $this->esquerdo->avalia(); $valorDireita = $this->direito->avalia(); return $valorEsquerda * $valorDireita; } } ?>
using System; using Newtonsoft.Json; namespace CheapSharkMobile { public class Deal { public string InternalName { get; set; } public string Title { get; set; } public string MetacriticLink { get; set; } public string DealID { get; set; } public string StoreID { get; set; } public string GameID { get; set; } public Decimal SalePrice { get; set; } public Decimal NormalPrice { get; set; } public Decimal Savings { get; set; } public string MetacriticScore { get; set; } [JsonConverter (typeof(<API key>))] public DateTime ReleaseDate { get; set; } [JsonConverter (typeof(<API key>))] public DateTime LastChange { get; set; } public Double DealRating { get; set; } public string Thumb { get; set; } } }
<div class="post"> <h1 class="post-title">{{ post.name }}</h1> {% if not (post.is_special == "true") then %} <h5 class="subtitle">Created {{ post.cdate }} | Last modified {{ post.mdate }} at {{ post.mtime }} | <a href="{{ linkprefix }}/{{ post.raw_link }}">Source</a></h5> {% end %} {{ post.contents }} {% if not (post.is_special == "true") then %} {% end %} </div>
body { padding-top: 50px; } .titre-dashboard { padding: 30px 15px; text-align: center; } .indexcompteur { padding-top: 100px; font-family: 'Share Tech Mono'; font-weight: bolder; font-size: 4em; }
// UIButton+OKCategory #import <UIKit/UIKit.h> <API key> typedef void (^UIButtonBlock)(UIButton *button); //IB_DESIGNABLE @interface UIButton (OKCategory) //@property (nonatomic, copy) IBInspectable NSString *titleHexColor; @property (nonatomic, assign) UIEdgeInsets touchAreaInsets; /** * * * @param backgroundColor * @param state */ - (void)<API key>:(UIColor *)backgroundColor forState:(UIControlState)state; /** * title */ - (void)ok_showIndicator; /** * title */ - (void)ok_hideIndicator; - (void)ok_addAction:(UIButtonBlock)block; - (void)ok_addAction:(UIButtonBlock)block forControlEvents:(UIControlEvents)controlEvents; - (void)ok_startTime:(NSInteger)timeout title:(NSString *)tittle waitTittle:(NSString *)waitTittle; @end <API key>
'use strict'; module.exports = function( $scope, $q, $log, <API key> ) { // Controller instance var vm = this; // -- Data section // DATA, get settings vm.getSettings = function() { return <API key>.settings; }; };
class CreateAdhocs < ActiveRecord::Migration def change create_table :adhocs do |t| end end end
export module Query { export const OK:string = "OK"; export module ParamNames { export const ACTION:string = "action"; // String export const DEVICE:string = "device"; // Integer export const DEVICE_NUM:string = "DeviceNum"; // Integer export const ID:string = "id"; // String export const NAME:string = "name"; // String export const OUTPUT_FORMAT:string = "output_format"; // String export const ROOM:string = "room"; // Integer export const SCENE_ID:string = "scene"; // Integer export const SCENE_NUM:string = "SceneNum"; // Integer export const SERVICE_ID:string = "serviceId"; // Integer export const UDN:string = "UDN"; // String export const VALUE:string = "Value"; // String export const VARIABLE_NAME:string = "Variable"; // String export const CODE:string = "Code"; // String export const LOAD_TIME:string = "LoadTime"; export const DATA_VERSION:string = "DataVersion"; export const TIMEOUT:string = "timeout"; export const MINIMUM_DELAY:string = "minimumdelay"; } Object.freeze(ParamNames); export function translateParamName(from:string):string { var fromLC = from.toLowerCase(); for(var key of Object.keys(ParamNames)) { if(key.toLowerCase()==fromLC) return key; } return from; } export function translateParamNames(from:IUriComponentMap):IUriComponentMap { var result:IUriComponentMap = {}; for(var key of Object.keys(from)) { result[translateParamName(key)] = from[key]; } return result; } export module IDs { export const USER_DATA:string = "user_data"; export const USER_DATA2:string = "user_data2"; export const STATUS:string = "status"; export const S_DATA:string = "sdata"; export const ACTIONS:string = "actions"; export const ACTION:string = "action"; export const DEVICE:string = "device"; export const SCENE:string = "scene"; export const ROOM:string = "room"; export const FILE:string = "file"; export const VARIABLE_GET:string = "variableget"; export const VARIABLE_SET:string = "variableset"; export const FIND_DEVICE:string = "finddevice"; export const RELOAD:string = "reload"; export const ALIVE:string = "alive"; export const RESYNC:string = "resync"; export const INVOKE:string = "invoke"; } export module Actions { export const CREATE:string = "create"; export const RENAME:string = "rename"; export const DELETE:string = "delete"; export const LIST:string = "list"; export const RECORD:string = "record"; export const PAUSE:string = "pause"; export const STOP_RECORD:string = "stoprecord"; export const LIST_RECORD:string = "listrecord"; export const DELETE_RECORD:string = "deleterecord"; export const SAVE_RECORD:string = "saverecord"; export const RUN_SCENE:string = "RunScene"; export const RUN_LUA:string = "RunLua"; } Object.freeze(IDs); export module OutputFormats { export const XML:string = "xml"; export const JSON:string = "json"; } Object.freeze(OutputFormats); } Object.freeze(Query); export interface IRequestBase extends IUriComponentMap { outputFormat?:string } export interface IRequestParams extends IRequestBase { loadTime?:string, dataVersion?:string, timeout?:number, minimumDelay?:number } export interface IRequestById extends IUriComponentMap { id:string; } export interface <API key> extends IRequestById { action:string; }
using System; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; namespace Margeta.Extensions.Cli.Hosting { <summary> Builder for IConsoleHost. </summary> public interface IConsoleHostBuilder { <summary> Builds an IConsoleHost which hosts the console application. </summary> <returns></returns> IConsoleHost Build(); <summary> Adds a delegate for configuring the provided ILoggerFactory. </summary> <param name="configureLogging">The delegate that configures the ILoggerFactory.</param> <returns>The IConsoleHostBuilder.</returns> <remarks>This method may be called multiple times.</remarks> IConsoleHostBuilder ConfigureLogging(Action<ILoggerFactory> configureLogging); <summary> Specify the delegate that is used to configure the services of the console application. </summary> <param name="configureServices">The delegate that configures the IServiceCollection.</param> <returns>The IConsoleHostBuilder.</returns> IConsoleHostBuilder ConfigureServices(Action<IServiceCollection> configureServices); <summary> Gets the setting value from the configuration. </summary> <param name="key">The key of the setting to look up.</param> <returns>The value the setting currently contains.</returns> string GetSetting(string key); <summary> Specofy the ILoggerFactory to be used by the web host. </summary> <param name="loggerFactory">The ILoggerFactory to be used by the console host.</param> <returns>The IConsoleHostBuilder.</returns> IConsoleHostBuilder UseLoggerFactory(ILoggerFactory loggerFactory); <summary> Add or replace setting in the configuration. </summary> <param name="key">The key of te setting to add or replace.</param> <param name="value">The value of the setting to add or replace.</param> <returns>The IconsoleHostBuilder.</returns> IConsoleHostBuilder UseSetting(string key, string value); } }
<!DOCTYPE html> <!--[if IE]><![endif]--> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>Class <API key> | Lib.AspNetCore.Security </title> <meta name="viewport" content="width=device-width"> <meta name="title" content="Class <API key> | Lib.AspNetCore.Security "> <meta name="generator" content="docfx 2.56.6.0"> <link rel="shortcut icon" href="../resources/ico/favicon.ico"> <link rel="stylesheet" href="../styles/docfx.vendor.css"> <link rel="stylesheet" href="../styles/docfx.css"> <link rel="stylesheet" href="../styles/main.css"> <meta property="docfx:navrel" content="../toc.html"> <meta property="docfx:tocrel" content="toc.html"> </head> <body data-spy="scroll" data-target="#affix" data-offset="120"> <div id="wrapper"> <header> <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#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="../index.html"> <img id="logo" class="svg" src="../resources/svg/logo.svg" alt=""> </a> </div> <div class="collapse navbar-collapse" id="navbar"> <form class="navbar-form navbar-right" role="search" id="search"> <div class="form-group"> <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off"> </div> </form> </div> </div> </nav> </header> <div role="main" class="container body-content hide-when-search"> <div class="sidenav hide-when-search"> <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a> <div class="sidetoggle collapse" id="sidetoggle"> <div id="sidetoc"></div> </div> </div> <div class="article row grid-right"> <div class="col-md-12"> <article class="content wrap" id="_content" data-uid="Lib.AspNetCore.Security.<API key>"> <h1 id="<API key>" data-uid="Lib.AspNetCore.Security.<API key>" class="text-break">Class <API key> </h1> <div class="markdown level0 summary"><p>Middleware which provides support for targeted site data clearing.</p> </div> <div class="markdown level0 conceptual"></div> <div class="inheritance"> <h5>Inheritance</h5> <div class="level0"><span class="xref">System.Object</span></div> <div class="level1"><span class="xref"><API key></span></div> </div> <div class="inheritedMembers"> <h5>Inherited Members</h5> <div> <span class="xref">System.Object.Equals(System.Object)</span> </div> <div> <span class="xref">System.Object.Equals(System.Object, System.Object)</span> </div> <div> <span class="xref">System.Object.GetHashCode()</span> </div> <div> <span class="xref">System.Object.GetType()</span> </div> <div> <span class="xref">System.Object.MemberwiseClone()</span> </div> <div> <span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span> </div> <div> <span class="xref">System.Object.ToString()</span> </div> </div> <h6><strong>Namespace</strong>: <a class="xref" href="Lib.AspNetCore.Security.html">Lib.AspNetCore.Security</a></h6> <h6><strong>Assembly</strong>: Lib.AspNetCore.Security.dll</h6> <h5 id="<API key>">Syntax</h5> <div class="codewrapper"> <pre><code class="lang-csharp hljs">public class <API key></code></pre> </div> <h3 id="constructors">Constructors </h3> <a id="<API key>" data-uid="Lib.AspNetCore.Security.<API key>.#ctor*"></a> <h4 id="Lib_AspNetCore_Security_TargetedSiteDataClearingMiddleware__ctor_Microsoft_AspNetCore_Http_RequestDelegate_Microsoft_Extensions_Options_IOptions_Lib_AspNetCore_Security_TargetedSiteDataClearingOptions__" data-uid="Lib.AspNetCore.Security.<API key>.#ctor(Microsoft.AspNetCore.Http.RequestDelegate,Microsoft.Extensions.Options.IOptions{Lib.AspNetCore.Security.<API key>})"><API key>(RequestDelegate, IOptions&lt;<API key>&gt;)</h4> <div class="markdown level1 summary"><p>Instantiates a new <a class="xref" href="Lib.AspNetCore.Security.<API key>.html"><API key></a>.</p> </div> <div class="markdown level1 conceptual"></div> <h5 class="decalaration">Declaration</h5> <div class="codewrapper"> <pre><code class="lang-csharp hljs">public <API key>(RequestDelegate next, IOptions&lt;<API key>&gt; options)</code></pre> </div> <h5 class="parameters">Parameters</h5> <table class="table table-bordered table-striped table-condensed"> <thead> <tr> <th>Type</th> <th>Name</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><span class="xref">Microsoft.AspNetCore.Http.RequestDelegate</span></td> <td><span class="parametername">next</span></td> <td><p>The next middleware in the pipeline.</p> </td> </tr> <tr> <td><span class="xref">Microsoft.Extensions.Options.IOptions</span>&lt;<a class="xref" href="Lib.AspNetCore.Security.<API key>.html"><API key></a>&gt;</td> <td><span class="parametername">options</span></td> <td><p>An instance of the <a class="xref" href="Lib.AspNetCore.Security.<API key>.html"><API key></a> to configure the middleware.</p> </td> </tr> </tbody> </table> <h3 id="methods">Methods </h3> <a id="<API key>" data-uid="Lib.AspNetCore.Security.<API key>.Invoke*"></a> <h4 id="Lib_AspNetCore_Security_TargetedSiteDataClearingMiddleware_Invoke_Microsoft_AspNetCore_Http_HttpContext_" data-uid="Lib.AspNetCore.Security.<API key>.Invoke(Microsoft.AspNetCore.Http.HttpContext)">Invoke(HttpContext)</h4> <div class="markdown level1 summary"><p>Process an individual request.</p> </div> <div class="markdown level1 conceptual"></div> <h5 class="decalaration">Declaration</h5> <div class="codewrapper"> <pre><code class="lang-csharp hljs">public Task Invoke(HttpContext context)</code></pre> </div> <h5 class="parameters">Parameters</h5> <table class="table table-bordered table-striped table-condensed"> <thead> <tr> <th>Type</th> <th>Name</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><span class="xref">Microsoft.AspNetCore.Http.HttpContext</span></td> <td><span class="parametername">context</span></td> <td><p>The context.</p> </td> </tr> </tbody> </table> <h5 class="returns">Returns</h5> <table class="table table-bordered table-striped table-condensed"> <thead> <tr> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><span class="xref">System.Threading.Tasks.Task</span></td> <td><p>The task object representing the asynchronous operation.</p> </td> </tr> </tbody> </table> </article> </div> </div> </div> <footer> <div class="grad-bottom"></div> <div class="footer"> <div class="container"> <span class="pull-right"> <a href="#top">Back to top</a> </span> Copyright © 2016 - 2021 Tomasz Pęczek </div> </div> </footer> </div> <script type="text/javascript" src="../styles/docfx.vendor.js"></script> <script type="text/javascript" src="../styles/docfx.js"></script> <script type="text/javascript" src="../styles/main.js"></script> </body> </html>
import expect from 'expect'; import { fromJS } from 'immutable'; import <API key> from '../reducer'; describe('<API key>', () => { it('returns the initial state', () => { expect(<API key>(undefined, {})).toEqual(fromJS({})); }); });
Model.Root=<ol><li>{Champs.Base}<li>FormeJuridique : {FormeJuridique}</ol> FormeJuridique=Individu Nom={Nom.1} {Nom.3} M/Mme-Nom={M/Mme} {Nom} =[U/class/FR_ID.md]
<!DOCTYPE html PUBLIC "- <html xmlns='http: <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta> <title>1643-19-2.smi.png.html</title> </head> <body>ID1643-19-2<br/> <img border="0" src="1643-19-2.smi.png" alt="1643-19-2.smi.png"></img><br/> <br/> <table border="1"> <tr> <td></td><td>ID</td><td>Formula</td><td>FW</td><td>DSSTox_CID</td><td>DSSTox_RID</td><td>DSSTox_GSID</td><td>DSSTox_FileID_Sort</td><td>TS_ChemName</td><td><API key></td><td>TS_CASRN</td><td><API key></td><td>TS_Description</td><td>ChemNote</td><td>STRUCTURE_Shown</td><td>STRUCTURE_Formula</td><td>STRUCTURE_MW</td><td>STRUCTURE_ChemType</td><td><API key></td><td>STRUCTURE_IUPAC</td><td>STRUCTURE_SMILES</td><td><API key></td><td><API key></td></tr> <tr> <td>1643-19-2</td><td>10057</td><td>C16H36BrN</td><td>322.3677 (242.4632+79.9045)</td><td>24400</td><td>80201</td><td>44400</td><td>4883</td><td>Tetrabutylammonium bromide</td><td>1-Butanaminium, N,N,N-tributyl-, bromide</td><td>1643-19-2</td><td>primary</td><td>single chemical compound</td><td>ammonium; parent [10549-76-5]</td><td>tested chemical</td><td>C16H36BrN</td><td>322.3677</td><td>defined organic</td><td>salt</td><td>N,N,<API key> bromide</td><td>[Br-].CCCC[N+](CCCC)(CCCC)CCCC</td><td>CCCC[N+](CCCC)(CCCC)CCCC</td><td>20091116</td></tr> </table> <br/><br/><font size="-2">(Page generated on Wed Sep 17 04:00:08 2014 by <a href="http: </body></html>
<?php declare(strict_types = 1); namespace KoolKode\Async\EIO; use KoolKode\Async\Context; use KoolKode\Async\Stream\<API key>; use KoolKode\Async\Stream\StreamException; class WritableFileStream extends <API key> { protected $handle; protected $file; protected $resource; protected $size; protected $context; public function __construct(Context $context, Handle $handle, string $file, int $resource, int $size = 0) { $this->context = $context; $this->handle = $handle; $this->file = $file; $this->resource = $resource; $this->size = $size; } public function __destruct() { $this->close(); } /** * {@inheritdoc} */ public function close(?\Throwable $e = null): void { parent::close($e); if ($this->resource !== null) { $this->handle->closeFile($this->context, $this->resource, $this->file); $this->resource = null; $this->context = null; } } /** * {@inheritdoc} */ protected function writeBytes(Context $context, string $bytes): \Generator { return yield $this->handle->submit($context, 'eio_write', $this->resource, $bytes, \strlen($bytes), $this->size, \EIO_PRI_DEFAULT, function (int $result, $request): int { if ($result < 1) { throw new StreamException(\sprintf('Failed to write data to file "%s": %s', $this->file, \eio_get_last_error($request))); } $this->size += $result; return $result; }); } }
// <auto-generated> // This code was generated by a tool. // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> namespace DLaB.Xrm.Entities { [System.Runtime.Serialization.<API key>()] [System.CodeDom.Compiler.<API key>("CrmSvcUtil", "8.0.1.7297")] public enum <API key> { [System.Runtime.Serialization.EnumMemberAttribute()] Appointment = 2, [System.Runtime.Serialization.EnumMemberAttribute()] Email = 7, [System.Runtime.Serialization.EnumMemberAttribute()] EmailviaMailMerge = 8, [System.Runtime.Serialization.EnumMemberAttribute()] Fax = 5, [System.Runtime.Serialization.EnumMemberAttribute()] FaxviaMailMerge = 6, [System.Runtime.Serialization.EnumMemberAttribute()] Letter = 3, [System.Runtime.Serialization.EnumMemberAttribute()] LetterviaMailMerge = 4, [System.Runtime.Serialization.EnumMemberAttribute()] Other = 9, [System.Runtime.Serialization.EnumMemberAttribute()] Phone = 1, } }
#include <fstream> #include <iostream> #include <stdlib.h> #include <vector> #include "testing_common.hpp" template <typename T> hipblasStatus_t <API key>(const Arguments& argus) { bool FORTRAN = argus.fortran; auto <API key> = FORTRAN ? <API key><T, true> : <API key><T, false>; int N = argus.N; int incx = argus.incx; int lda = argus.lda; char char_uplo = argus.uplo_option; hipblasFillMode_t uplo = char2hipblas_fill(char_uplo); double stride_scale = argus.stride_scale; int batch_count = argus.batch_count; int abs_incx = incx < 0 ? -incx : incx; hipblasStride strideA = size_t(lda) * N * stride_scale; hipblasStride stridex = size_t(abs_incx) * N * stride_scale; size_t A_size = strideA * batch_count; size_t x_size = stridex * batch_count; hipblasLocalHandle handle(argus); // argument sanity check, quick return if input parameters are invalid before allocating invalid // memory bool invalid_size = N < 0 || !incx || lda < N || lda < 1 || batch_count < 0; if(invalid_size || !N || !batch_count) { hipblasStatus_t actual = <API key>( handle, uplo, N, nullptr, nullptr, incx, stridex, nullptr, lda, strideA, batch_count); <API key>( actual, (invalid_size ? <API key> : <API key>)); return actual; } // Naming: dK is in GPU (device) memory. hK is in CPU (host) memory host_vector<T> hA(A_size); host_vector<T> hA_cpu(A_size); host_vector<T> hA_host(A_size); host_vector<T> hA_device(A_size); host_vector<T> hx(x_size); device_vector<T> dA(A_size); device_vector<T> dx(x_size); device_vector<T> d_alpha(1); T h_alpha = argus.get_alpha<T>(); double gpu_time_used, hipblas_error_host, <API key>; // Initial Data on CPU hipblas_init_matrix( hA, argus, N, N, lda, strideA, batch_count, <API key>, true); hipblas_init_vector( hx, argus, N, abs_incx, stridex, batch_count, <API key>, false, true); hA_cpu = hA; // copy data from CPU to device CHECK_HIP_ERROR(hipMemcpy(dA, hA.data(), sizeof(T) * A_size, <API key>)); CHECK_HIP_ERROR(hipMemcpy(dx, hx.data(), sizeof(T) * x_size, <API key>)); CHECK_HIP_ERROR(hipMemcpy(d_alpha, &h_alpha, sizeof(T), <API key>)); if(argus.unit_check || argus.norm_check) { CHECK_HIPBLAS_ERROR(<API key>(handle, <API key>)); CHECK_HIPBLAS_ERROR(<API key>( handle, uplo, N, &h_alpha, dx, incx, stridex, dA, lda, strideA, batch_count)); CHECK_HIP_ERROR(hipMemcpy(hA_host.data(), dA, sizeof(T) * A_size, <API key>)); CHECK_HIP_ERROR(hipMemcpy(dA, hA.data(), sizeof(T) * A_size, <API key>)); CHECK_HIPBLAS_ERROR(<API key>(handle, <API key>)); CHECK_HIPBLAS_ERROR(<API key>( handle, uplo, N, d_alpha, dx, incx, stridex, dA, lda, strideA, batch_count)); CHECK_HIP_ERROR(hipMemcpy(hA_device.data(), dA, sizeof(T) * A_size, <API key>)); for(int b = 0; b < batch_count; b++) { cblas_syr<T>( uplo, N, h_alpha, hx.data() + b * stridex, incx, hA_cpu.data() + b * strideA, lda); } // enable unit check, notice unit check is not invasive, but norm check is, // unit check and norm check can not be interchanged their order if(argus.unit_check) { unit_check_general<T>(N, N, batch_count, lda, strideA, hA_cpu, hA_host); unit_check_general<T>(N, N, batch_count, lda, strideA, hA_cpu, hA_device); } if(argus.norm_check) { hipblas_error_host = norm_check_general<T>( 'F', N, N, lda, strideA, hA_cpu.data(), hA_host.data(), batch_count); <API key> = norm_check_general<T>( 'F', N, N, lda, strideA, hA_cpu.data(), hA_device.data(), batch_count); } } if(argus.timing) { CHECK_HIP_ERROR(hipMemcpy(dA, hA.data(), sizeof(T) * A_size, <API key>)); hipStream_t stream; CHECK_HIPBLAS_ERROR(hipblasGetStream(handle, &stream)); CHECK_HIPBLAS_ERROR(<API key>(handle, <API key>)); int runs = argus.cold_iters + argus.iters; for(int iter = 0; iter < runs; iter++) { if(iter == argus.cold_iters) gpu_time_used = get_time_us_sync(stream); CHECK_HIPBLAS_ERROR(<API key>( handle, uplo, N, d_alpha, dx, incx, stridex, dA, lda, strideA, batch_count)); } gpu_time_used = get_time_us_sync(stream) - gpu_time_used; ArgumentModel<e_N, e_alpha, e_incx, e_stride_x, e_lda, e_stride_a, e_batch_count>{} .log_args<T>(std::cout, argus, gpu_time_used, syr_gflop_count<T>(N), syr_gbyte_count<T>(N), hipblas_error_host, <API key>); } return <API key>; }
'use strict'; module.exports = { app: { title: 'DoorStep', description: 'Full-Stack JavaScript with MongoDB, Express, AngularJS, and Node.js', keywords: 'MongoDB, Express, AngularJS, Node.js' }, port: process.env.PORT || 3000, templateEngine: 'swig', sessionSecret: 'MEAN', sessionCollection: 'sessions', assets: { lib: { css: [ 'public/lib/bootstrap/dist/css/bootstrap.css', 'public/lib/bootstrap/dist/css/bootstrap-theme.css', ], js: [ 'public/lib/angular/angular.js', 'public/lib/angular-resource/angular-resource.js', 'public/lib/angular-cookies/angular-cookies.js', 'public/lib/angular-animate/angular-animate.js', 'public/lib/angular-touch/angular-touch.js', 'public/lib/angular-sanitize/angular-sanitize.js', 'public/lib/angular-ui-router/release/angular-ui-router.js', 'public/lib/angular-ui-utils/ui-utils.js', 'public/lib/angular-bootstrap/ui-bootstrap-tpls.js', 'public/lib/ngmap/build/scripts/ng-map.min.js' ] }, css: [ 'public/modulescss/*.css' ], js: [ 'public/config.js', 'public/application.js', 'public/modules/*/*.js', 'public/modules/*/*[!tests]*/*.js' ], tests: [ 'public/lib/angular-mocks/angular-mocks.js', 'public/modules/*/tests/*.js' ] } };
<?php namespace eXpansion\Bundle\Maps\Model; use eXpansion\Bundle\Maps\Model\Base\MapQuery as BaseMapQuery; /** * Skeleton subclass for performing query and update operations on the 'map' table. * * * * You should add additional methods to this class to meet the * application requirements. This class will only be generated as * long as it does not already exist in the output directory. * */ class MapQuery extends BaseMapQuery { }
'use strict' const joi = require('joi') module.exports = joi.string()
module Base64 %x{ var chars = '<API key>+/='; var encode, decode; // encoder encode = Opal.global.btoa || function (input) { var str = String(input); /* jshint ignore:start */ for ( // initialize result and counter var block, charCode, idx = 0, map = chars, output = ''; // if the next str index does not exist: // change the mapping table to "=" // check if d has no fractional digits str.charAt(idx | 0) || (map = '=', idx % 1); // "8 - idx % 1 * 8" generates the sequence 2, 4, 6, 8 output += map.charAt(63 & block >> 8 - idx % 1 * 8) ) { charCode = str.charCodeAt(idx += 3/4); if (charCode > 0xFF) { #{raise ArgumentError, 'invalid character (failed: The string to be encoded contains characters outside of the Latin1 range.)'}; } block = block << 8 | charCode; } return output; /* jshint ignore:end */ }; // decoder decode = Opal.global.atob || function (input) { var str = String(input).replace(/=+$/, ''); if (str.length % 4 == 1) { #{raise ArgumentError, 'invalid base64 (failed: The string to be decoded is not correctly encoded.)'}; } /* jshint ignore:start */ for ( // initialize result and counters var bc = 0, bs, buffer, idx = 0, output = ''; // get next character buffer = str.charAt(idx++); // character found in table? initialize bit storage and add its ascii value; ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, // and if not first of each 4 characters, // convert the first 8 bits to one ascii character bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0 ) { // try to find character in table (0-63, not found => -1) buffer = chars.indexOf(buffer); } return output; /* jshint ignore:end */ }; } def self.decode64(string) `decode(string.replace(/\r?\n/g, ''))` end def self.encode64(string) `encode(string).replace(/(.{60})/g, "$1\n").replace(/([^\n])$/g, "$1\n")` end def self.strict_decode64(string) `decode(string)` end def self.strict_encode64(string) `encode(string)` end def self.urlsafe_decode64(string) `decode(string.replace(/\-/g, '+').replace(/_/g, '/'))` end def self.urlsafe_encode64(string) `encode(string).replace(/\+/g, '-').replace(/\ end end
<?php namespace App\MediBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; /** * Area * * @ORM\Table() * @ORM\Entity(repositoryClass="App\MediBundle\Entity\AreaRepository") */ class Area { /** * @var integer * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @var string * * * @ORM\Column(name="nombre", type="string", length=255) * @Assert\NotNull(message = "Este campo no puede estar vacio") */ private $nombre; /** * @var string * * @ORM\Column(name="descripcion", type="string", length=255) * @Assert\NotNull(message = "Este campo no puede estar vacio") */ private $descripcion; /** * @ORM\ManyToOne(targetEntity="Empresa") * @ORM\JoinColumn(name="empresa_id", <API key>="id") * */ private $empresa; /** * @ORM\OneToMany(targetEntity="PermisosArea", mappedBy="area") */ private $permisos; /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Set nombre * * @param string $nombre * @return Area */ public function setNombre($nombre) { $this->nombre = $nombre; return $this; } /** * Get nombre * * @return string */ public function getNombre() { return $this->nombre; } /** * Set descripcion * * @param string $descripcion * @return Area */ public function setDescripcion($descripcion) { $this->descripcion = $descripcion; return $this; } /** * Get descripcion * * @return string */ public function getDescripcion() { return $this->descripcion; } /** * Set empresa * * @param integer $empresa * @return Empresa */ public function setEmpresa($empresa) { $this->empresa = $empresa; return $this; } /** * Get empresa * * @return integer */ public function getEmpresa() { return $this->empresa; } /** * Set permiso * * @param integer $permiso * @return Area */ public function setPermiso($permiso) { $this->permiso = $permiso; return $this; } /** * Get permiso * * @return integer */ public function getPermiso() { return $this->permiso; } }
<?php include 'resources/includes/PageCreator.php'; $page = new PageCreator(); $page->head = '<link rel="stylesheet" href="resources/css/specific/standard.css" type="text/css">'; $page->title = "Colofon"; $page->body = <<<CONTENT <div class="content"> <div class="menuSpacing"></div> <div class="indexImage"> <div class="row"> <div class="medium-12 medium-centered columns"> <div class="backgroundImage" style="background-image: url('resources/img/background.svg');"> </div> </div> </div> </div> <div class="row text water docFill" id="first"> <div class="medium-10 medium-centered columns"> <h5>Colofon</h1> <p> Hoewel deze website met veel zorg is samengesteld, aanvaarden auteur(s) noch uitgever enige aansprakelijkheid voor geleden schade ontstaan door eventuele fouten en/of onvolkomenheden op deze site. De links die verwijzen naar andere websites zijn ter informatie. CheckJeStress kan op geen enkele wijze hoe dan ook aansprakelijk gesteld worden voor de inhoud en de kwaliteit van deze website. Sommige teksten, afbeeldingen, tekens, logo's en andere op deze website gebruikte items worden auteursrechterlijk beschermd of zijn geregistreerde handelsmerken. Schriftelijke toestemming van desbetreffend uitgever en/of auteur is vereist om deze te verveelvoudigen en/of openbaar te maken. </p> <p> Indien u vragen en/op opmerkingen heeft n.a.v. deze site, neem dan a.u.b. <a href="contact/">contact</a> met ons op. </p> <p> Op alle diensten van CheckJeStress zijn algemene voorwaarden van toepassing. Wij hanteren de bepalingen en het <a href="http: klacht- en tuchtreglement</a> van de "Beroepscode van ABvC". </p> <p> CheckJeStress respecteert al uw persoonlijke gegevens die door u aan CheckJeStress verstrekt worden. Deze worden niet zonder uw toestemming doorgegeven aan derden en zullen met de grootste zorg worden behandeld en opgeslagen. De geheimhouding van uw persoonlijke gegevens heeft hierbij de hoogste prioriteit. Gegevens die mogelijk door de server van checkjestress.nl en/of <API key>.nl van uw computer worden ontvangen, worden uitsluitend gebruikt voor statistische doeleinden ten behoeve van het optimaliseren van de <API key> van checkjestress.nl en/of <API key>.nl. </p> <p> Uw naam, adres, telefoonnummer kunnen wij niet zonder meer inzien, tenzij u ons deze gegevens verstrekt per email. In dit geval zal CheckJeStress zoals eerder aangeveven, deze gegevens strikt vertrouwelijk behandelen. </p> </div> </div> </div> CONTENT; $page->create();
from .rpc import * from .pcic import *
package client.app.invoices.gui.def; import share.core.constants.Constants; public class GUIDeleteInvoice { public static final String PATH = Constants.GUI_BASE_PATH + "invoices/gui/xml/delete_invoice"; public enum Literals { ASK_DELETE } }
import { CommandResult, TakeoffCommand } from 'commands'; import { <API key> } from 'takeoff'; import { ExitCode } from 'task'; /** * Command for starting a project */ export = ({ opts, args, pathExists, printMessage, rcFile, runCommand }: <API key>): TakeoffCommand => ({ args: '<name> [service]', command: 'start', description: 'Starts the named project. Optionally a docker app name can be passed to only start individual services.', group: 'takeoff', options: [ { description: 'Detach the docker containers', option: '-d, --detach', }, ], handler(): CommandResult { const [project, app]: string[] = args.length > 0 ? args : ['default']; printMessage(`Starting project ${project}`); const envDir = `${rcFile.rcRoot}/projects/${project}`; if (!pathExists(envDir)) { return { code: ExitCode.Error, fail: `The project ${project} doesn't exist` }; } let cmd = `docker-compose -f docker/docker-compose.yml up`; if (opts['d'] || opts['deatch']) { cmd = `${cmd} -d`; } if (app) { cmd = `${cmd} ${app}`; } // We want to see the docker output in this command const runCmd = runCommand(cmd, envDir, true); return { code: runCmd.code, extra: runCmd.code === 0 ? runCmd.stdout : runCmd.stderr, fail: `Unable to start ${project} ${app || ''}`, success: `Successfully started ${project} ${app || ''}`, }; }, });
<!doctype html> <html> <head> <!-- build:css styles/vendor.css --> <!-- bower:css --> <!-- endbower --> <!-- endbuild --> <!-- build:css styles/main.css --> <link href="styles/main.css" rel="stylesheet"> <!-- endbuild --> </head> <body> <h1>'Allo, 'Allo!</h1> paus <!-- build:js scripts/vendor.js --> <!-- bower:js --> <script src="bower_components/jquery/jquery.js"></script> <script src="bower_components/lodash/dist/lodash.compat.js"></script> <!-- endbower --> <!-- endbuild --> <!-- build:js scripts/options.js --> <script src="scripts/options.js"></script> <!-- endbuild --> </body> </html>
<?php namespace Shopware\SwagMigration\Components\Normalizer; /** * Helper to normalize all WooCommerce data from DB */ class WooCommerce { /** * @var array */ private $productMapping = [ '_price' => 'net_price', '_weight' => 'weight', ]; /** * @var array */ private $ratingMapping = [ 'rating' => 'rating', 'verified' => 'active', ]; /** * @var array */ private $customerMapping = [ 'first_name' => 'firstname', 'last_name' => 'lastname', 'billing_first_name' => 'billing_firstname', 'billing_last_name' => 'billing_lastname', 'billing_city' => 'billing_city', 'billing_postcode' => 'billing_zipcode', 'billing_country' => 'billing_countryiso', 'billing_address_1' => 'billing_street', 'shipping_first_name' => 'shipping_firstname', 'shipping_last_name' => 'shipping_lastname', 'shipping_city' => 'shipping_city', 'shipping_postcode' => 'shipping_zipcode', 'shipping_country' => 'shipping_countryiso', 'shipping_address_1' => 'shipping_street', ]; /** * @var array */ private $orderMapping = [ '_customer_user' => 'customerID', '_order_key' => 'ordernumber', '_payment_method' => 'paymentID', '_billing_first_name' => 'billing_firstname', '_billing_last_name' => 'billing_lastname', '_billing_city' => 'billing_city', '_billing_postcode' => 'billing_zipcode', '_billing_country' => 'billing_countryiso', '_billing_address_1' => 'billing_street', '<API key>' => 'shipping_firstname', '_shipping_last_name' => 'shipping_lastname', '_shipping_city' => 'shipping_city', '_shipping_postcode' => 'shipping_zipcode', '_shipping_country' => 'shipping_countryiso', '_shipping_address_1' => 'shipping_street', '<API key>' => 'referer', '<API key>' => 'remote_addr', 'cost' => '<API key>', 'shipping_tax_amount' => 'shippingTax', 'tax_amount' => 'orderTaxRate', 'method_id' => 'dispatchID', ]; /** * @var array */ private $orderDetailMapping = [ '_qty' => 'quantity', '_product_id' => 'productID', '_line_tax' => 'taxID', '_line_total' => 'price', ]; /** * @param array $products * * @return array */ public function normalizeProducts($products) { $normalizedProducts = []; foreach ($products as $product) { if (!\array_key_exists($product['productID'], $normalizedProducts)) { $normalizedProducts[$product['productID']] = $product; } else { $normalizedProducts[$product['productID']][$this->mapArrayKey($product['meta_key'], $this->productMapping)] = $product['meta_value']; } } return $normalizedProducts; } /** * @param array $results * * @return array */ public function normalizeShops($results) { $shops = []; foreach ($results as $result) { $shops[$result['id']] = $result['name']; } return $shops; } /** * @param array $results * * @return array */ public function normalizeLanguages($results) { $languages = []; foreach ($results as $result) { $languages[] = $result['name']; } return $languages; } /** * @param string $key * @param array $array * * @return string|mixed */ public function mapArrayKey($key, $array) { if (\array_key_exists($key, $array)) { return $array[$key]; } return $key; } /** * @param array $orders * * @return array */ public function normalizeOrders($orders) { $normalizedOrders = []; foreach ($orders as $order) { if (!\array_key_exists($order['orderID'], $normalizedOrders)) { $order[$this->mapArrayKey($order['postMetaKey'], $this->orderMapping)] = $order['postMetaValue']; $order[$this->mapArrayKey($order['orderMetaKey'], $this->orderMapping)] = $order['orderMetaValue']; $normalizedOrders[$order['orderID']] = $order; } else { $normalizedOrders[$order['orderID']][$this->mapArrayKey($order['postMetaKey'], $this->orderMapping)] = $order['postMetaValue']; $normalizedOrders[$order['orderID']][$this->mapArrayKey($order['orderMetaKey'], $this->orderMapping)] = $order['orderMetaValue']; } } return $normalizedOrders; } /** * @param array $orderDetails * * @return array */ public function <API key>($orderDetails) { $<API key> = []; foreach ($orderDetails as $order) { if (!\array_key_exists($order['orderID'], $<API key>)) { $order[$this->mapArrayKey($order['metaKey'], $this->orderDetailMapping)] = $order['metaValue']; $<API key>[$order['orderID']] = $order; } else { $<API key>[$order['orderID']][$this->mapArrayKey($order['metaKey'], $this->orderDetailMapping)] = $order['metaValue']; } } return $<API key>; } /** * @param array $customers * * @return array */ public function normalizeCustomers($customers) { $normalizedCustomers = []; foreach ($customers as $customer) { if (!\array_key_exists($customer['customerID'], $normalizedCustomers)) { $normalizedCustomers[$customer['customerID']] = $customer; } else { $normalizedCustomers[$customer['customerID']][$this->mapArrayKey($customer['metaKey'], $this->customerMapping)] = $customer['metaValue']; } } foreach ($normalizedCustomers as $key => $customer) { if ($customer['firstname'] === '') { $normalizedCustomers[$key]['firstname'] = $customer['billing_firstname']; } if ($customer['lastname'] === '') { $normalizedCustomers[$key]['lastname'] = $customer['billing_lastname']; } $normalizedCustomers[$key]['salutation'] = 'mr'; $normalizedCustomers[$key]['shipping_salutation'] = 'mr'; $normalizedCustomers[$key]['billing_salutation'] = 'mr'; } return $normalizedCustomers; } /** * @param array $ratings * * @return array */ public function normalizeRatings($ratings) { $normalizedRatings = []; foreach ($ratings as $rating) { if (!\array_key_exists($rating['productID'], $normalizedRatings)) { $rating[$this->mapArrayKey($rating['metaKey'], $this->ratingMapping)] = $rating['metaValue']; $normalizedRatings[$rating['productID']] = $rating; } else { $normalizedRatings[$rating['productID']][$this->mapArrayKey($rating['metaKey'], $this->ratingMapping)] = $rating['metaValue']; } } return $normalizedRatings; } /** * @param array $variants * * @return array */ public function normalizeVariants($variants) { $normalizedVariants = []; foreach ($variants as $variant) { if (!\array_key_exists($variant['productID'], $normalizedVariants)) { $variant[$this->mapArrayKey($variant['metaKey'], $this->ratingMapping)] = $variant['metaValue']; $normalizedVariants[$variant['productID']] = $variant; } else { $normalizedVariants[$variant['productID']][$this->mapArrayKey($variant['metaKey'], $this->ratingMapping)] = $variant['metaValue']; } } return $normalizedVariants; } }
using UnityEngine; using System.Collections; public class ClickyThing : MonoBehaviour { public GameObject bomb; void Update () { if(Input.GetMouseButtonDown(0)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); //creates a ray and uses the mouse position to shoot it from the camera into the screen RaycastHit whatIHit; //stores the collider tnformation of what the raycast hit if(Physics.Raycast(ray, out whatIHit)) //creates a raycast using the ray information and pushes out the hit collider into whatIHit so we can access it { Debug.Log ("My name is " +whatIHit.collider.gameObject.name); Debug.Log (whatIHit.point); //.point returns the vector3 of where the ray intersects the collider GameObject ballClone = (GameObject)Instantiate(bomb, whatIHit.point, bomb.transform.rotation); //simple instantiation } } } }
'use strict'; /** * pratice Node.js project * * @author Zongmin Lei <leizongmin@gmail.com> */ import path from 'path'; import express from 'express'; import serveStatic from 'serve-static'; import bodyParser from 'body-parser'; import multipart from 'connect-multiparty'; import session from 'express-session'; import _RedisStore from 'connect-redis'; const redis = require("redis"); const RedisStore = _RedisStore(session); module.exports = function (done) { const debug = $.createDebug('init:express'); debug('initing Express...'); const app = express(); $.express = app; const redisClient = redis.createClient($.config.get('web.session.redis')); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({extended: false})); app.use(multipart()); app.use(session({ secret: $.config.get('web.session.secret'), store: new RedisStore({client: redisClient, ttl: 260}), // store: new RedisStore($.config.get('web.session.redis')), })); const router = express.Router(); const routerWrap = {}; ['get', 'head', 'post', 'put', 'del', 'delete'].forEach(method => { routerWrap[method] = function (path, ...fnList) { fnList = fnList.map(fn => { return function (req, res, next) { const ret = fn(req, res, next); if (ret && ret.catch) ret.catch(next); }; }); router[method](path, ...fnList); }; }); $.router = routerWrap; app.use(function (req, res, next) { res.apiSuccess = function (data) { res.json({success: true, result: data}); }; next(); }); app.use(router); app.use('/static', serveStatic(path.resolve(__dirname, '../../static'))); app.use('/api', function (err, req, res, next) { debug('API error: %s', err && err.stack || err); res.json({error: err.toString()}); }); if ($.config.get('web.port')) { app.listen($.config.get('web.port'), (err) => { done(err); }); } else { done(); } };
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using NBDD.Framework.Generator.Helpers; using System.Diagnostics; namespace NBDD.Framework.Generator.CSharp { public class <API key> : <API key>, StepsBuilder { #region Constants private static readonly char[] TrimmedHOlderEdges = new [] { '\'', '"', '[', ']', '{', '}', '/' }; #endregion #region Properties public Scenario Scenario { get; set; } #endregion public string ToClassDeclaration() { return string.Concat( "\tpublic class ", this.ToClassName(), " : StepsBase"); } public string ToClassName() { return string.Concat( this.Feature.Name.ToClassName(), "_", this.Scenario.Name.ToClassName(), "_Steps"); } public string ToMethodCall(string objectName, string statement) { if (string.IsNullOrWhiteSpace(statement)) { return string.Empty; } var signatureParams = new ParameterResolver(statement).Parameters; return string.Concat( objectName.TrimEnd(new[] { '.' }), ".", statement.ToMethodName(), "(", string.Join(", ", signatureParams.Select(d => d.Name)), ")"); } public string <API key>(int extraTabs) { var code = new StringBuilder(); code.Append(<API key>(extraTabs, this.Scenario.Statements.Given)); code.Append(<API key>(extraTabs, this.Scenario.Statements.When)); code.Append(<API key>(extraTabs, this.Scenario.Statements.Then)); return code.ToString(); } public override string ToCode() { var code = new StringBuilder(); code.Append(this.GenerateStepsTop()); code.Append(this.GenerateHeader()); code.Append(this.GenerateRegionsTop()); code.Append(this.GenerateStatements()); code.Append(this.<API key>()); code.Append(this.GenerateFooter()); code.Append(this.GenerateBottom()); return code.ToString(); } #region Main Generation private string GenerateStepsTop() { var nsFramework = "NBDD.Framework.Steps"; var nsAssets = string.Concat(this.RootNamespace, ".", "_Assets"); return this.GenerateTop( nsFramework, nsAssets); } private string GenerateHeader() { var builder = new StringBuilder(); builder.AppendLine(this.ToClassDeclaration()); builder.AppendLine("\t{"); return builder.ToString(); } private string GenerateRegionsTop() { return string.Join( Environment.NewLine, new[] { this.GenerateRegion("Fields"), }); } private string <API key>() { return string.Join( Environment.NewLine, new[] { this.GenerateRegion("Auxiliary"), }); } private string GenerateStatements() { var builder = new StringBuilder(); builder.AppendLine(); var treatedStatements = this.Scenario.<API key>(); builder.Append(<API key>("Given", treatedStatements.Given)); builder.Append(<API key>(this.Scenario.Statements.Given)); builder.Append(<API key>("When", treatedStatements.When)); builder.Append(<API key>(this.Scenario.Statements.When)); builder.Append(<API key>("Then", treatedStatements.Then)); builder.Append(<API key>(this.Scenario.Statements.Then)); return builder.ToString(); } #endregion #region Sub-Generation private string <API key>( string attribute, string normalizedStatement) { var builder = new StringBuilder(); builder.AppendLine(string.Format( "\t\t[{0}(\"{1}\")]", attribute, normalizedStatement)); return builder.ToString(); } private string GenerateRegion( string regionName) { var builder = new StringBuilder(); builder.AppendLine(string.Concat("\t\t#region ", regionName)); builder.AppendLine("\t\t#endregion"); return builder.ToString(); } private static string <API key>( string statement) { if (string.IsNullOrWhiteSpace(statement)) { return string.Empty; } var builder = new StringBuilder(); builder.Append(<API key>(statement)); builder.AppendLine("\t\t{"); builder.Append(<API key>()); builder.AppendLine("\t\t}"); builder.AppendLine(); return builder.ToString(); } private static string <API key>( string statement) { var builder = new StringBuilder(); builder.Append("\t\t"); builder.Append("public void "); builder.Append(statement.ToMethodName()); builder.Append("("); var signatureParams = new ParameterResolver(statement).Parameters; var first = true; foreach (var p in signatureParams) { if (!first) { builder.Append(", "); } else { first = false; } builder.Append(p); } builder.Append(")"); builder.Append(Environment.NewLine); return builder.ToString(); } private static string <API key>() { var builder = new StringBuilder(); builder.AppendLine("\t\t\tthrow new <API key>();"); return builder.ToString(); } private static string <API key>( int extraTabs, string statement) { if (string.IsNullOrWhiteSpace(statement)) { return string.Empty; } var signatureParams = new ParameterResolver(statement).Parameters; var totalTabs = 3 + extraTabs; var tabs = new string('\t', totalTabs); var code = new StringBuilder(); foreach (var p in signatureParams) { code.Append(tabs); code.Append("var "); code.Append(p.Name); code.Append(" = "); var holderValue = p.Holder.Trim(TrimmedHOlderEdges); if (p.Type == ParameterType.Regex) { code.Append("@\""); code.Append(holderValue); code.Append("\""); } else if (p.Type == ParameterType.String) { code.Append("\""); code.Append(holderValue); code.Append("\""); } else if (p.Type == ParameterType.Int) { var parsedDefault = string.Format("default({0})", p.Type.ToString().ToLowerInvariant()); var auxValue = default(int); if (int.TryParse(holderValue, out auxValue)) { code.Append(auxValue); } else { code.Append(holderValue); } } code.Append(string.Concat(";", Environment.NewLine)); } return code.ToString(); } #endregion } }
jQuery listSwap ============ ListSwap is a jQuery plugin that allows you to swap (add/remove) items between two drop-down lists. - jQuery suppport: 1.3+ - Browser support: All major browsers, IE8+ Usage: $('#source, #destination').listswap(); Default Options: truncate : false, //Set to true to disable word wrap height : null, //Set custom height is_scroll : false, //Show scroll label_add : 'Add', //Set add label (Can bet set to empty) label_remove : 'Remove', //Set remove label (Can bet set to empty) add_class : null, //Custom class for styling rtl : false, //RTL support Try it here http://phedde.github.io/listswap
<?php class ConceptoTipo { /** * @var int $Id * @access public */ public $Id = null; /** * @var string $Desc * @access public */ public $Desc = null; /** * @var string $FchDesde * @access public */ public $FchDesde = null; /** * @var string $FchHasta * @access public */ public $FchHasta = null; /** * @param int $Id * @param string $Desc * @param string $FchDesde * @param string $FchHasta * @access public */ public function __construct($Id, $Desc, $FchDesde, $FchHasta) { $this->Id = $Id; $this->Desc = $Desc; $this->FchDesde = $FchDesde; $this->FchHasta = $FchHasta; } }
// SYBViewController.h // SVGParse #import <UIKit/UIKit.h> @interface SYBViewController : UIViewController @end
package aesample import ( "fmt" "net/http" "github.com/mzimmerman/aesample/subpkga" "github.com/mzimmerman/aesample/util" ) func init() { http.HandleFunc("/", root) http.HandleFunc("/subpkga", subpkga.Root) util.Log("aesample init()") } func root(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, "Hello, you've reached aesample, the root package does nothing") }
<form [formGroup]="cartForm" (ngSubmit)="onSubmit(cartForm)"> <cart-item-list (onBookDeleted)="bookWasDeleted($event)" [books]="books"> </cart-item-list> <div class="field"> <label for="cardType">Card Type</label> <select name="cardType" id="cardType" [formControl]="cartForm.controls['cardType']"> <option *ngFor="let type of cards" [value]="type">{{type}}</option> </select> </div> <div class="field"> <label for="cardNoInput">Card Number</label> <input type="password" id="cardNoInput" placeholder="Card Number" [formControl]="cartForm.controls['cardNo']"> <div *ngIf="cartForm.controls['cardNo'].hasError('required') && cartForm.get('cardNo').touched" class="form-error is-visible"> Card Number is required </div> <div *ngIf="cartForm.hasError('invalidCardNo') && cartForm.get('cardNo').touched" class="form-error is-visible"> Card Number is Invalid </div> </div> <div class="field"> <label for="fullName">Full Name</label> <input type="text" id="fullName" placeholder="Full Name" [formControl]="cartForm.controls['fullName']"> <div *ngIf="!cartForm.controls['fullName'].valid && cartForm.get('fullName').touched" class="form-error is-visible"> Full Name should contain only letters and spaces </div> <div *ngIf="cartForm.controls['fullName'].hasError('required') && cartForm.get('fullName').touched" class="form-error is-visible"> Full Name is required </div> </div> <button type="submit" class="button alert" [disabled]="!cartForm.valid">Purchase</button> </form>
<div class="horizontal-scroll"> <table class="table table-bordered"> <thead> <tr> <th class="browser-icons align-center">Team logo</th> <th class="align-center">Team</th> <th class="align-center">Played</th> <th class="align-center">Won</th> <th class="align-center">Points</th> </tr> </thead> <tbody> <tr *ngFor="let item of teamPoints "> <!--<td><img src="{{ ( item.team | baAppPicture )}}" width="20" height="20"></td>--> <!--<td ngClass="nowrap">{{ item.team }}</td>--> <td> <img src="assets/images/teams/{{item.team}}.png"> </td> <td ngClass="nowrap">{{ item.teamAbbrev }}</td> <td class="align-center">{{ item.played }}</td> <td class="align-center">{{ item.won }}</td> <td class="align-center">{{ item.totalpoints }}</td> </tr> </tbody> </table> </div>
$LOAD_PATH.unshift(File.dirname(__FILE__)) $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require 'nikeplus_api' require 'spec' require 'spec/autorun' Spec::Runner.configure do |config| end
use libc::{c_void, size_t}; #[cfg(Py_3_4)] #[cfg(not(Py_LIMITED_API))] #[cfg_attr(windows, link(name="pythonXY"))] extern "C" { pub fn PyMem_RawMalloc(size: size_t) -> *mut c_void; #[cfg(Py_3_5)] pub fn PyMem_RawCalloc(nelem: size_t, elsize: size_t) -> *mut c_void; pub fn PyMem_RawRealloc(ptr: *mut c_void, new_size: size_t) -> *mut c_void; pub fn PyMem_RawFree(ptr: *mut c_void) -> (); } #[cfg_attr(windows, link(name="pythonXY"))] extern "C" { pub fn PyMem_Malloc(size: size_t) -> *mut c_void; #[cfg(Py_3_5)] pub fn PyMem_Calloc(nelem: size_t, elsize: size_t) -> *mut c_void; pub fn PyMem_Realloc(ptr: *mut c_void, new_size: size_t) -> *mut c_void; pub fn PyMem_Free(ptr: *mut c_void) -> (); } #[cfg(Py_3_4)] #[cfg(not(Py_LIMITED_API))] #[derive(Copy, Clone)] pub enum <API key> { PYMEM_DOMAIN_RAW, PYMEM_DOMAIN_MEM, PYMEM_DOMAIN_OBJ } #[derive(Copy, Clone)] #[cfg(all(Py_3_4, not(Py_3_5), not(Py_LIMITED_API)))] pub struct PyMemAllocator { pub ctx: *mut c_void, pub malloc: Option<extern "C" fn(ctx: *mut c_void, size: size_t) -> *mut c_void>, pub realloc: Option<extern "C" fn(ctx: *mut c_void, ptr: *mut c_void, new_size: size_t) -> *mut c_void>, pub free: Option<extern "C" fn(ctx: *mut c_void, ptr: *mut c_void) -> ()>, } #[derive(Copy, Clone)] #[cfg(all(Py_3_5, not(Py_LIMITED_API)))] pub struct PyMemAllocatorEx { pub ctx: *mut c_void, pub malloc: Option<extern "C" fn(ctx: *mut c_void, size: size_t) -> *mut c_void>, pub calloc: Option<extern "C" fn(ctx: *mut c_void, nelem: size_t, elsize: size_t) -> *mut c_void>, pub realloc: Option<extern "C" fn(ctx: *mut c_void, ptr: *mut c_void, new_size: size_t) -> *mut c_void>, pub free: Option<extern "C" fn(ctx: *mut c_void, ptr: *mut c_void) -> ()>, } #[cfg(Py_3_4)] #[cfg(not(Py_LIMITED_API))] #[cfg_attr(windows, link(name="pythonXY"))] extern "C" { #[cfg(not(Py_3_5))] pub fn PyMem_GetAllocator(domain: <API key>, allocator: *mut PyMemAllocator) -> (); #[cfg(not(Py_3_5))] pub fn PyMem_SetAllocator(domain: <API key>, allocator: *mut PyMemAllocator) -> (); #[cfg(Py_3_5)] pub fn PyMem_GetAllocator(domain: <API key>, allocator: *mut PyMemAllocatorEx) -> (); #[cfg(Py_3_5)] pub fn PyMem_SetAllocator(domain: <API key>, allocator: *mut PyMemAllocatorEx) -> (); pub fn <API key>() -> (); }
using System; using System.IO; using System.Xml.Schema; using ExtraStandard.Extra14; using ExtraStandard.DrvKomServer.Validation.Extra14.Dsv; using ExtraStandard.Validation; using Xunit; namespace ExtraStandard.Tests.Extra14 { public class TestDrvDsvMessages { [Theory] [InlineData("01-request.xml", ExtraMessageType.SupplyData)] [InlineData("02-request.xml", ExtraMessageType.GetProcessingResult)] [InlineData("03-request.xml", ExtraMessageType.<API key>)] public void TestRequests(string resourceName, ExtraMessageType messageType) { var data = LoadData(resourceName); var document = ExtraUtilities.Deserialize<<API key>>(data); Assert.NotNull(document); var validator = new DrvExtraValidator(messageType, <API key>.Request, false); var now = DateTimeOffset.Now; validator.Validate(data); Assert.True(now <= validator.<API key>); } [Theory] [InlineData("01-response.xml", ExtraMessageType.SupplyData)] [InlineData("02-response.xml", ExtraMessageType.GetProcessingResult)] [InlineData("03-response.xml", ExtraMessageType.<API key>)] [InlineData("01-response-fehler.xml", ExtraMessageType.SupplyData)] [InlineData("02-response-leer.xml", ExtraMessageType.GetProcessingResult)] [InlineData("03-response-fehler.xml", ExtraMessageType.<API key>)] public void TestResponses(string resourceName, ExtraMessageType messageType) { var data = LoadData(resourceName); var document = ExtraUtilities.Deserialize<<API key>>(data); Assert.NotNull(document); var validator = new DrvExtraValidator(messageType, <API key>.Response, false); var now = DateTimeOffset.Now; validator.Validate(data); Assert.True(now <= validator.<API key>); } private static byte[] LoadData(string resourceName) { var step = resourceName.Substring(0, 2); var asm = System.Reflection.Assembly.<API key>(); var resName = $"ExtraStandard.Tests.Resources.Extra14.Drv.Dsv._{step}.{resourceName}"; var output = new MemoryStream(); using (var input = asm.<API key>(resName)) { Assert.NotNull(input); input.CopyTo(output); } return output.ToArray(); } } }
#include <stdio.h> int main() { char caractere; //variaveis1 int x, y; //variaveis2 int altura = 0; int lado = 0; char rec; //variaveis3 int saida = 0; while (saida == 0) { //perguntas e respostas printf( "tamanho do lado: " ); scanf( "%d", &lado ); printf( "tamanho da altura: "); scanf( "%d", &altura ); printf( "caractere que deseja usar: "); scanf( " %c", &caractere ); printf( "Olá, meu nome é Gabriel e o rentangulo ficou assim:\n" ); for ( x = 0; x < altura; x++ ) { for( y = 0; y < lado; y++ ) { if( x == 0 || x == altura - 1 || y == 0 || y == lado - 1) { printf(" %c ", caractere); } else { printf(" "); } } printf( "\n" ); } printf( "deseja continuar (S/n)?" ); scanf( " %c", &rec ); if ( rec == 'n' ) { saida = 1; } } return 0; }
#include <boost/test/unit_test.hpp> #include <crave/ConstrainedRandom.hpp> #include <boost/format.hpp> #include <set> #include <iostream> // using namespace std; using namespace crave; using boost::format; <API key>(Distribution_t, Context_Fixture) <API key>(randv_dist_t1) { randv<int> v(NULL); Generator gen; gen(dist(v(), distribution<int>::create(range<int>(0, 5))(range<int>(50, 65))(range<int>(100, 125)))); std::map<int, int> s; int total = 100000; for (int i = 0; i < total; i++) { BOOST_REQUIRE(gen.next()); BOOST_REQUIRE((0 <= v && v <= 5) || (50 <= v && v <= 65) || (100 <= v && v <= 125)); ++s[v]; } int min = s[0], max = s[0]; for (int i = 1; i <= 200; i++) if (s.find(i) != s.end()) { if (s[i] < min) min = s[i]; if (s[i] > max) max = s[i]; } double avg = total / (6. + 16. + 26.); BOOST_REQUIRE_LT(100. * (avg - min) / avg, 5); BOOST_REQUIRE_LT(100. * (max - avg) / avg, 5); } <API key>(randv_dist_t2) { randv<int> v(NULL); Generator gen; BOOST_CHECK_THROW( gen(dist(v(), distribution<int>::create(range<int>(0, 10))(range<int>(50, 75))(range<int>(30, 51)))), std::runtime_error); } <API key>(randv_dist_t3) { randv<char> v(NULL); Generator gen; gen(dist(v(), distribution<char>::create(weighted_range<char>(1, 5, 50))(weighted_range<char>(10, 20, 20))( weighted_range<char>(-50, -50, 30)))); int cnt1 = 0, cnt2 = 0, cnt3 = 0; int total = 50000; for (int i = 0; i < total; i++) { BOOST_REQUIRE(gen.next()); BOOST_REQUIRE((1 <= v && v <= 5) || (10 <= v && v <= 20) || (v == -50)); if (1 <= v && v <= 5) cnt1++; if (10 <= v && v <= 20) cnt2++; if (v == -50) cnt3++; } double q = 50.0 / cnt1; BOOST_REQUIRE_LT(abs(cnt2 * q - 20), 0.2); BOOST_REQUIRE_LT(abs(cnt3 * q - 30), 0.2); } <API key>(randv_dist_t4) { randv<int> v(NULL); Generator gen; gen("x", dist(v(), distribution<int>::create(range<int>(0, 10))(range<int>(50, 75))(range<int>(100, 200)))); gen("y", dist(v(), distribution<int>::simple_range(5000, 6000))); gen.disableConstraint("x"); int total = 10000; for (int i = 0; i < total; i++) { BOOST_REQUIRE(gen.next()); BOOST_REQUIRE(5000 <= v && v <= 6000); } } <API key>() // Context // vim: ft=cpp:ts=2:sw=2:expandtab
module VagrantPlugins module G5K module Action class WaitInstance def initialize(app, env) @app = app end def call(env) job_id = env[:machine].id conn = env[:g5k_connection] conn.wait_for_vm(job_id) @app.call(env) end end end end end
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>Activity Panel Unit Tests</title> <link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-2.0.1.css"> <!-- Bootstrap core CSS --> <link href="./bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet"> <link href="./dashboard.css" rel="stylesheet"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script>window.jQuery || document.write('<script src="./bootstrap-3.3.7-dist/assets/js/vendor/jquery.min.js"><\/script>')</script> <script src="./bootstrap-3.3.7-dist/js/bootstrap.min.js"></script> </head> <body> <div id="qunit"></div> <div id="qunit-fixture"></div> <script src="https://code.jquery.com/qunit/qunit-2.0.1.js"></script> <script src="../../localmodels/hyb.js"></script> <script src="../../localmodels/activitypanel.js"></script> <script src="../../localmodels/learner.js"></script> <script src="../../data/mocklearner.js"></script> <script> QUnit.test( "Canary test", function( assert ) { assert.ok( 1 == "1", "Passed!" ); }); QUnit.test( "Get HYB (parent) object test", function( assert ) { var myHBY = HYB; assert.ok ( myHBY !== undefined, "HYB is defined" ); }); QUnit.test( "Get the activitypanel object ", function( assert ) { var myController = HYB.ActivityPanel; var theMenu = myController.ActivityPanel; assert.ok ( theMenu !== undefined, "activitypanel object is defined" ); }); QUnit.test( "Test of activitypanel init ", function( assert ) { var myController = HYB.ActivityPanel; var thePanel = myController.ActivityPanel; var isOK = thePanel.ActivityPanelInit(); assert.ok ( isOK !== true, "ActivityPanelInit is defined" ); }); </script> </body> </html>
<!DOCTYPE html> <head> <meta charset="UTF-8"> <title>A Parallel Algorithm for Polygon Rasterization: Implemtation</title> </head> <body> <div class="paragraph"> <h2>Integer vertices: Triangle traversal with bounding box.</h2> <canvas id="canvas1" width="256" height="256" style="border:1px solid #c3c3c3;"></canvas> <script> var canvas1 = document.getElementById("canvas1"); canvas1.style.backgroundColor = 'rgba(0, 0, 0, 1)'; var context1 = canvas1.getContext("2d"); context1.fillStyle = 'rgb(255, 255, 255)'; var w1 = canvas1.width; var h1 = canvas1.height; function triangle(p) { var minX = p[0].x, maxX = p[0].x, minY = p[0].y, maxY = p[0].y; for (var i = 0; i < p.length; i++) { if (p[i].x < minX) { minX = p[i].x; } if (p[i].x > maxX) { maxX = p[i].x; } if (p[i].y < minY) { minY = p[i].y; } if (p[i].y > maxY) { maxY = p[i].y; } } var edgeFunc12 = 0; var edgeFunc23 = 0; var edgeFunc31 = 0; for (var row = minY; row <= maxY; row++) { for (var col = minX; col <= maxX; col++) { var edge12 = edgeFunc12 + (col - p[0].x) * (p[1].y - p[0].y) - (row - p[0].y) * (p[1].x - p[0].x); var edge23 = edgeFunc23 + (col - p[1].x) * (p[2].y - p[1].y) - (row - p[1].y) * (p[2].x - p[1].x); var edge31 = edgeFunc31 + (col - p[2].x) * (p[0].y - p[2].y) - (row - p[2].y) * (p[0].x - p[2].x); if (edge12 >= 0 && edge23 >= 0 && edge31 >= 0) { context1.fillRect(col, h1 - 1 - row, 1, 1); } } } } setInterval(function() { context1.clearRect(0, 0, w1, h1); var x1 = Math.round(Math.random() * w1); var y1 = Math.round(Math.random() * h1); var x2 = Math.round(Math.random() * w1); var y2 = Math.round(Math.random() * h1); var x3 = Math.round(Math.random() * w1); var y3 = Math.round(Math.random() * h1); while ((x3 - x1) * (y2 - y1) - (y3 - y1) * (x2 - x1) <= 0) { x3 = Math.round(Math.random() * w1); y3 = Math.round(Math.random() * h1); } triangle([{x:x1, y:y1}, {x:x2, y:y2}, {x:x3, y:y3}]); }, 1000); </script> </div> <div class="paragraph"> <h2>Integer vertices: Convex polygon traversal with bounding box.</h2> <canvas id="canvas2" width="256" height="256" style="border:1px solid #c3c3c3;"></canvas> <script> var canvas2 = document.getElementById("canvas2"); canvas2.style.backgroundColor = 'rgba(0, 0, 0, 1)'; var context2 = canvas2.getContext("2d"); context2.fillStyle = 'rgb(255, 255, 255)'; var w2 = canvas2.width; var h2 = canvas2.height; var pi = 3.141592654; function randomConvexPolygon() { var vertices = []; var radius = 96; var current = Math.random() / 2 * pi; var totalRad = 0; do { var tmpX = Math.round(radius * Math.cos(current) + w2 / 2); var tmpY = Math.round(radius * Math.sin(current) + h2 / 2); vertices[vertices.length] = {x:tmpX, y:tmpY}; var offset = pi / 6 + Math.random() * pi / 2; current -= offset; totalRad += offset; } while (totalRad < 11 / 6 * pi); var tmp = vertices; console.log(tmp.length); var minX = vertices[0].x, maxX = vertices[0].x, minY = vertices[0].y, maxY = vertices[0].y; for (var i = 0; i < vertices.length; i++) { if (vertices[i].x < minX) { minX = vertices[i].x; } if (vertices[i].x > maxX) { maxX = vertices[i].x; } if (vertices[i].y < minY) { minY = vertices[i].y; } if (vertices[i].y > maxY) { maxY = vertices[i].y; } } var dXs = []; var dYs = []; var edgeFuncs = []; for (var i = 0; i < vertices.length; i++) { dXs[dXs.length] = vertices[(i + 1) % vertices.length].x - vertices[i].x; dYs[dYs.length] = vertices[(i + 1) % vertices.length].y - vertices[i].y; edgeFuncs[edgeFuncs.length] = 0; } edgeFuncs[edgeFuncs.length] = 0; for (var row = minY; row <= maxY; row++) { for (var col = minX; col <= maxX; col++) { for (var i = 0; i < vertices.length; i++) { edgeFuncs[i] = (col - vertices[i].x) * dYs[i] - (row - vertices[i].y) * dXs[i]; } var allOK = true; for (var i = 0; i < vertices.length; i++) { allOK = allOK && (edgeFuncs[i] >= 0); } if (allOK) { context2.fillRect(col, h2 - 1 - row, 1, 1); } } } } setInterval(function() { context2.clearRect(0, 0, w2, h2); randomConvexPolygon(); }, 1000); </script> </div> </body> </html>
package com.ychstudio.gui; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.scenes.scene2d.Stage; import com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle; import com.badlogic.gdx.utils.Disposable; import com.badlogic.gdx.utils.viewport.FitViewport; import com.kotcrab.vis.ui.widget.VisLabel; import com.kotcrab.vis.ui.widget.VisTable; import com.ychstudio.actors.Player; import com.ychstudio.gamesys.GM; public class InfoGUI implements Disposable { private final float screenWidth = Gdx.graphics.getWidth(); private final float screenHeight = Gdx.graphics.getHeight(); private SpriteBatch batch; private Stage stage; private FitViewport viewport; private BitmapFont font; private VisLabel fpsLabel; private VisLabel hpLabel; private Sprite bulletSprite; private Sprite grenadeSprite; private Sprite reloadSprite; private int playerHP; private int playerAmmo; private int playerMaxAmmo; private int playerGrenade; private int playerMaxGrenade; private float playerReloadTime; private float <API key>; public InfoGUI() { batch = new SpriteBatch(); viewport = new FitViewport(screenWidth, screenHeight); stage = new Stage(viewport, batch); font = new BitmapFont(Gdx.files.internal("fonts/Monofonto_32.fnt")); LabelStyle labelStyle = new LabelStyle(font, Color.WHITE); fpsLabel = new VisLabel("FPS:"); hpLabel = new VisLabel("HP:", labelStyle); hpLabel.setPosition(16f, screenHeight - 40f);; VisTable table = new VisTable(); table.setFillParent(true); table.bottom().left().padLeft(16f); table.add(fpsLabel); stage.addActor(hpLabel); stage.addActor(table); TextureAtlas textureAtlas = GM.getAssetManager().get("img/actors.pack", TextureAtlas.class); bulletSprite = new Sprite(new TextureRegion(textureAtlas.findRegion("Bullet"), 0, 0, 32, 32)); bulletSprite.setBounds(0, 0, 32f, 32f); grenadeSprite = new Sprite(new TextureRegion(textureAtlas.findRegion("Grenade"), 0, 0, 32, 32)); grenadeSprite.setBounds(0, 0, 32f, 32f); reloadSprite = new Sprite(new TextureRegion(textureAtlas.findRegion("Bar"), 0, 0, 32, 32)); } public void update() { fpsLabel.setText("FPS: " + Gdx.graphics.getFramesPerSecond()); hpLabel.setText("HP: " + playerHP); if (GM.getPlayer() != null) { Player player = GM.getPlayer(); playerAmmo = player.getAmmo(); playerMaxAmmo = player.getMaxAmmo(); playerReloadTime = player.getReloadTime(); <API key> = player.getReloadTimeLeft(); playerGrenade = player.getGrenade(); playerMaxGrenade = player.getMaxGrenade(); playerHP = player.getHP(); } else { playerAmmo = 0; playerMaxAmmo = 0; playerReloadTime = 0; <API key> = 0; playerGrenade = 0; playerMaxGrenade = 0; playerHP = 0; } } public void draw() { update(); batch.begin(); // draw ammo indication for (int i = 0; i < playerMaxAmmo; i++) { bulletSprite.setPosition(10f + 16f * i, screenHeight - 60f); if (i >= playerAmmo) { bulletSprite.setAlpha(0.3f); } else { bulletSprite.setAlpha(1.0f); } bulletSprite.draw(batch); } // draw reload indication if (playerReloadTime != 0) { reloadSprite.setBounds(18f, screenHeight - 48f, 128f * (1 - <API key> / playerReloadTime), 8f); reloadSprite.draw(batch); } // draw grenade indication for (int i = 0; i < playerMaxGrenade; i++) { grenadeSprite.setPosition(10f + 16f * i, screenHeight - 80f); if (i >= playerGrenade) { grenadeSprite.setAlpha(0.3f); } else { grenadeSprite.setAlpha(1f); } grenadeSprite.draw(batch); } batch.end(); stage.draw(); } @Override public void dispose() { font.dispose(); stage.dispose(); batch.dispose(); } }
import { defineType } from '../../ast' import { defineLiteral } from '../../syntax' const type = defineType({ type: 'Bool', constructor: function (value) { this.value = Boolean(value) this.print = () => { return this.value.toString() } this.inspect = () => { return 'Bool#' + (this.value ? 'true' : 'false') } } }) export default type export const literal = defineLiteral(type, /^(true|false)$/, token => token[0] === 'true')
module Muve # Muve models imitate some behavior that one may commonly expect of typical # models. There are mechanisms in place for creation, modification, retrieval # and the removal of resources. # In order to make this a flexible solution, models never take care of # handling the persisting of the resources they manange. That part of the # lifing is dispatched to the +Model::Store+ object which may be though of # as an adaptor. # TODO: Include ActiveRecord::Model instead of using this tedious # implementation module Model include Muve::Error include Muve::Helper def initialize(params={}) params = {} unless params params.each do |attr, value| next if invalid_attributes.include? attr.to_s self.public_send "#{attr}=", value end @new_record = true @destroyed = false end def reload self.send(:populate, extract(adaptor.get(self.class, id))) if id self end def self.included(base) base.extend ClassMethods end def ==(rival) return false unless rival.kind_of? self.class self.attributes == rival.attributes end # Initializes the +Muve::Model+ class. Use the +Muve::Model::init+ method # to set a adaptor to take care of the retrieval and storage of resources. def self.init(handler=nil) @handler = handler if handler end def self.handler @handler end # Returns a hash of the object and subsequently # containing objects that respond to #to_hash. # In order to avoid circular reference hell you # can set the limit. # By default on the the root object and its # children a explored. Everything beyond that # range is discarded. def to_hash(level=0, limit=1) hash = {} attributes.map { |k, v| if v.respond_to? :to_hash (hash[k.to_sym] = v.to_hash(level+1, limit)) if level < limit else #(raise AssocError, "#Associated #{v.class} for #{k} must respond to #to_hash or be a Hash") unless v.kind_of? Hash hash[k.to_sym] = v end } hash end # Save a resource and raises an SaveError on failure def save! raise ValidationError, "validation failed" unless valid? create_or_update rescue => e raise SaveError, "Save failed because #{e} was raised" end # Save a resource def save # TODO: be more verbose about the nature of the failure, if any (create_or_update if valid?) or false rescue => e false end # Destroy a resource def destroy if adaptor.delete(self.class, id) == true @destroyed = true end end # Returns true if the resource has recently been instantiated but not yet # written to the data store. def new_record? @new_record = true if @new_record.nil? @new_record end # Returns true if the resource is not newly instantiated or recently # destroyed. def persisted? !(new_record? || destroyed?) end # Returns true if the resource in question has been destroyed def destroyed? @destroyed end # Returns a true if the resource passes all validations def valid? false end # Returns true if the resource fails any validation def invalid? !valid? end def id @id end # The parameterized identifier of the resource def to_param id && id.to_s end def attributes=(data) Helper.symbolize_keys(data).each { |k, v| self.public_send("#{k}=", v) } self end # Returns a Hash of the attributes for the current resource. def attributes self.class.extract_attributes( resource: self, fields: fields, invalid_attributes: invalid_attributes, id: self.id ) end private # Reserved attributes. These keys are not available to the user because # they are used to handle plumbing (library internal operations). def invalid_attributes %w(id adaptor) end def populate(details) details = {} unless details @id = details[:id] if details.key? :id details.each do |attr, value| next if invalid_attributes.include? attr.to_s self.public_send "#{attr}=", value if fields.include? attr.to_sym end @new_record = false if details.key? :id end def <API key> hash = {} attributes.map { |k, v| hash[k] = convert(v) } hash end def create_or_update result = new_record? ? create(<API key>) : update(<API key>) self end # A manifest of the fields known to the model. The model logic seeks # counsel from this resource to determine which properties to write and # read from the repository. def fields [] end # Creates the record and performs the necessary housekeeping (e.g.: setting # the new id and un-marking the new_record? def create(attr) @id = adaptor.create(self.class, attr) # TODO: deal with unsuccessful #create @new_record = false end # TODO: Update the record and return the number of modified rows def update(attr) adaptor.update(self.class, id, attr) end def adaptor self.class.adaptor end def extract(storeable) self.class.extract(storeable) end def convert(resource) self.class.convert(resource) end # Class methods exposed to all Muve models module ClassMethods include Muve::Error # Configure the adaptor to take care of handling persistence for this # model. The adaptor should extend +Muve::Store+. # Adaptors provide an abstraction layer between Muve models and the actual # datastore. This provides some flexibility in design as one may exchange # an adaptor for another in order to support another database technology # (.e.g: swithing between document databases or relational databases) def adaptor=(adaptor) @adaptor = adaptor end # The adaptor currently set to handle persistence for all Muve::Model # classes and instances def adaptor raise NotConfigured, "the adaptor has not been set" unless (@adaptor || Model.handler) @adaptor or Model.handler end def extract(storeable) adaptor.formatter.<API key>(storeable) end def convert(resource) adaptor.formatter.<API key>(resource) end def connection Muve::Model.connection end def database Muve::Model.database end def model_name self.to_s.split("::").last end # The container (e.g.: collection, tablename or anything that is analogous # to this construct) of the resource def container raise Muve::Error::NotConfigured, "container not defined for #{self}" end # Returns a Hash of the attributes for the given resource # TODO: do we still need this? def extract_attributes(resource: self.new, fields: [], invalid_attributes: [], id: nil) data = {} fields.select{ |k| k != invalid_attributes }.each { |k| # TODO: confirm resource.respond_to? k prior to assigning data[k.to_sym] = resource.public_send(k) if resource.respond_to? k } if id data = data.merge id: id end data end # Finds a resource by id def find(id) result = self.new() result.send(:populate, extract(self.adaptor.get(self, id))) result end # Querries the resource repository for all resources that match the # specified parameters. def where(params) Enumerator.new do |item| (self.adaptor.get(self, nil, params) or []).each do |details| details result = self.new() result.send(:populate, extract(details)) item << result end end end # Counts the amount of records that match the parameters def count(params={}) self.adaptor.count(self, params) end # The +with_field+ helper allows one to declare a functioning model # with less lines of code. # Instead of declaring +attr_accessor :name, :age, :hat_size+ along with # the required private +#fields# method one may specify the known fields # of the resource with one line of code. def with_fields(*args) fields = self.new.send(:fields) # TODO: Fix this sloppy mess attr_accessor *args class_eval "def fields; #{Set.new(fields + args).to_a}; end" end # Creates a new resource and persists it to the datastore def create(attr) self.new(attr).save end def create!(attr) self.new(attr).save! end def destroy_all warn "Destroying of all entities for a resource is not implemented" end end end end
from django.apps import AppConfig class TestimonialsConfig(AppConfig): name = 'testimonials'
<?php include_once('<API key>.php'); Class Manager_Logistics extends <API key> { function __construct() { parent::__construct(); } function main() { $this->output($this->config->item('lg_dir') . 'manage_logistics/' . 'v_main'); } function lc2ec() { $this->load-> $this->output($this->config->item('lg_dir') . 'manage_logistics/v_lc2ec'); } function lc2ec_action() { $this->load->library('MY_upload'); //PHP //Configure upload. $this->upload->initialize(array( "upload_path" => "uploads/logistics_picture/" )); //Perform upload. if ($this->upload->do_multi_upload("files")) { //Code to run upon successful upload. } } function confirm_from_lc() { $this->output($this->config->item('lg_dir') . 'manage_logistics/v_cflc'); } function ec2lc() { $this->output($this->config->item('lg_dir') . 'manage_logistics/v_ec2lc'); } function confirm_from_ec() { $this->output($this->config->item('lg_dir') . 'manage_logistics/cfec'); } }
# Gems starting with i - [IMAPCleanse 1.2.0](https://github.com/docker-rubygem/IMAPCleanse) - [IPGlider-annotate 2.2.7](https://github.com/docker-rubygem/IPGlider-annotate) - [IamPersistent-tog 0.4.4](https://github.com/docker-rubygem/IamPersistent-tog) - [Ifd_Automation 1.9.2](https://github.com/docker-rubygem/Ifd_Automation) - [Ifd_Mobile 1.4.0](https://github.com/docker-rubygem/Ifd_Mobile) - [ImageText 1.0.1](https://github.com/docker-rubygem/ImageText) - [ImlRobolectricity 0.0.3](https://github.com/docker-rubygem/ImlRobolectricity) - [Impatient 1.0.0](https://github.com/docker-rubygem/Impatient) - [Indentinator 0.0.6](https://github.com/docker-rubygem/Indentinator) - [Informer 0.1.0](https://github.com/docker-rubygem/Informer) - [IniSearch 0.0.1](https://github.com/docker-rubygem/IniSearch) - [Ipinfo 1.0.0](https://github.com/docker-rubygem/Ipinfo) - [IsHealthyAgg 0.0.1](https://github.com/docker-rubygem/IsHealthyAgg) - [i15r 0.5.5](https://github.com/docker-rubygem/i15r) - [i18n-date 0.0.7](https://github.com/docker-rubygem/i18n-date) - [i18n-grep 0.1.0](https://github.com/docker-rubygem/i18n-grep) - [i18n-sync 0.8.0](https://github.com/docker-rubygem/i18n-sync) - [i18n-tasks 0.7.13](https://github.com/docker-rubygem/i18n-tasks) - [i18n-tasks-mongoid 0.0.1](https://github.com/docker-rubygem/i18n-tasks-mongoid) - [<API key> 0.2.8](https://github.com/docker-rubygem/<API key>) - [i18n-validator 0.0.1](https://github.com/docker-rubygem/i18n-validator) - [<API key> 0.1.1](https://github.com/docker-rubygem/<API key>) - [i18n_generator 1.0.0](https://github.com/docker-rubygem/i18n_generator) - [i18n_helper 0.0.4](https://github.com/docker-rubygem/i18n_helper) - [i18n_po_tools 0.10.0](https://github.com/docker-rubygem/i18n_po_tools) - [i18n_sync 0.5.1](https://github.com/docker-rubygem/i18n_sync) - [i18n_template 0.0.1](https://github.com/docker-rubygem/i18n_template) - [i18n_tyml 0.1.1](https://github.com/docker-rubygem/i18n_tyml) - [i18n_yaml_sorter 0.2.0](https://github.com/docker-rubygem/i18n_yaml_sorter) - [i18ndiff 0.1.0](https://github.com/docker-rubygem/i18ndiff) - [i2c-alpha_display 0.5.1](https://github.com/docker-rubygem/i2c-alpha_display) - [i2c-ss1602 0.0.2](https://github.com/docker-rubygem/i2c-ss1602) - [i2cssh 1.16.0](https://github.com/docker-rubygem/i2cssh) - [i3-ipc 0.2.0](https://github.com/docker-rubygem/i3-ipc) - [iCuke 0.4.12](https://github.com/docker-rubygem/iCuke) - [iGEL-shoulda 2.10.2](https://github.com/docker-rubygem/iGEL-shoulda) - [iStats 1.4.0](https://github.com/docker-rubygem/iStats) - [i_contact 0.1.0](https://github.com/docker-rubygem/i_contact) - [i_dig_sql 4.0.0](https://github.com/docker-rubygem/i_dig_sql) - [i_know_right 0.0.1](https://github.com/docker-rubygem/i_know_right) - [iamakimmer_game 1.0.0](https://github.com/docker-rubygem/iamakimmer_game) - [ian 0.5.3](https://github.com/docker-rubygem/ian) - [ianwhite-garlic 0.1.9](https://github.com/docker-rubygem/ianwhite-garlic) - [iarrogant 0.0.2](https://github.com/docker-rubygem/iarrogant) - [iated 0.0.1](https://github.com/docker-rubygem/iated) - [iauthu 0.0.2](https://github.com/docker-rubygem/iauthu) - [ib 0.2.10](https://github.com/docker-rubygem/ib) - [ib-ruby 0.7.12](https://github.com/docker-rubygem/ib-ruby) - [ibanomat 1.3.0](https://github.com/docker-rubygem/ibanomat) - [ibg 0.0.4](https://github.com/docker-rubygem/ibg) - [iblox 0.0.3](https://github.com/docker-rubygem/iblox) - [ibm_sbdtc_rest 0.1.0](https://github.com/docker-rubygem/ibm_sbdtc_rest) - [ibo_ipsum 0.0.3](https://github.com/docker-rubygem/ibo_ipsum) - [iboleto 0.0.4](https://github.com/docker-rubygem/iboleto) - [ibtoolTranslation 0.0.9](https://github.com/docker-rubygem/ibtoolTranslation) - [ic 0.0.1](https://github.com/docker-rubygem/ic) - [ical2gcal 0.5.2](https://github.com/docker-rubygem/ical2gcal) - [ical_punch 1.1.0](https://github.com/docker-rubygem/ical_punch) - [icapps-translations 0.2.2](https://github.com/docker-rubygem/icapps-translations) - [ice_and_fire_api 1.1.0](https://github.com/docker-rubygem/ice_and_fire_api) - [icebox 0.0.5](https://github.com/docker-rubygem/icebox) - [icebreaker 0.2.0](https://github.com/docker-rubygem/icebreaker) - [icemaker 0.1.1](https://github.com/docker-rubygem/icemaker) - [icepick 1.3.1](https://github.com/docker-rubygem/icepick) - [icersplicer 1.1.3](https://github.com/docker-rubygem/icersplicer) - [ichabod 0.0.2](https://github.com/docker-rubygem/ichabod) - [ichiban 1.0.13](https://github.com/docker-rubygem/ichiban) - [iching 0.1.3](https://github.com/docker-rubygem/iching) - [ichverstehe-gaze 0.1.3](https://github.com/docker-rubygem/ichverstehe-gaze) - [iciba 0.0.20](https://github.com/docker-rubygem/iciba) - [ickgg 0.0.10](https://github.com/docker-rubygem/ickgg) - [iclassify-interface 1.1.0](https://github.com/docker-rubygem/iclassify-interface) - [icloud-reader 1.0.0](https://github.com/docker-rubygem/icloud-reader) - [icmp4em 1.0.0](https://github.com/docker-rubygem/icmp4em) - [icns_sync 0.0.9](https://github.com/docker-rubygem/icns_sync) - [icomoon2sass 1.0.7](https://github.com/docker-rubygem/icomoon2sass) - [icomoon_as_well 1.2.2](https://github.com/docker-rubygem/icomoon_as_well) - [iconCreater 0.2.9](https://github.com/docker-rubygem/iconCreater) - [iconPlot 0.1.0](https://github.com/docker-rubygem/iconPlot) - [icon_generator 0.10.1](https://github.com/docker-rubygem/icon_generator) - [iconcutter 0.1.0](https://github.com/docker-rubygem/iconcutter) - [iconify 0.2.1](https://github.com/docker-rubygem/iconify) - [iconoclast 0.1.4](https://github.com/docker-rubygem/iconoclast) - [<API key> 0.0.4](https://github.com/docker-rubygem/<API key>) - [iconset 0.1.0](https://github.com/docker-rubygem/iconset) - [icouchbase 0.0.1](https://github.com/docker-rubygem/icouchbase) - [icsfilter 1.0.0](https://github.com/docker-rubygem/icsfilter) - [icwot 0.3.4](https://github.com/docker-rubygem/icwot) - [id3_tags 0.1.0](https://github.com/docker-rubygem/id3_tags) - [id3dit 1.1.2](https://github.com/docker-rubygem/id3dit) - [id3rename 1.0.4](https://github.com/docker-rubygem/id3rename) - [id_service 0.3.0](https://github.com/docker-rubygem/id_service) - [idata 1.2.12](https://github.com/docker-rubygem/idata) - [idb 2.9.1](https://github.com/docker-rubygem/idb) - [idclight 0.1.3](https://github.com/docker-rubygem/idclight) - [<API key> 0.2.4](https://github.com/docker-rubygem/<API key>) - [ideapad 0.1.2](https://github.com/docker-rubygem/ideapad) - [identicons 0.0.2](https://github.com/docker-rubygem/identicons) - [idhja22 2.0.1](https://github.com/docker-rubygem/idhja22) - [idid 0.1.0](https://github.com/docker-rubygem/idid) - [ididthis 0.1.2.2](https://github.com/docker-rubygem/ididthis) - [idigbio_client 0.1.2](https://github.com/docker-rubygem/idigbio_client) - [idiom 0.7.3](https://github.com/docker-rubygem/idiom) - [idl 1.0.0](https://github.com/docker-rubygem/idl) - [idl_erep 0.0.6](https://github.com/docker-rubygem/idl_erep) - [idle_whacker 0.0.2](https://github.com/docker-rubygem/idle_whacker) - [<API key> 0.1.2.2](https://github.com/docker-rubygem/<API key>) - [idler 0.1.0](https://github.com/docker-rubygem/idler) - [idonethis-cli 0.20.0](https://github.com/docker-rubygem/idonethis-cli) - [<API key> 0.1.3](https://github.com/docker-rubygem/<API key>) - [ids_please 2.2.5](https://github.com/docker-rubygem/ids_please) - [ids_rules_parser 0.2.1](https://github.com/docker-rubygem/ids_rules_parser) - [idt 0.1.8-x86_64-linux](https://github.com/docker-rubygem/idt) - [idzebra 0.2.0](https://github.com/docker-rubygem/idzebra) - [<API key> 1.0.0](https://github.com/docker-rubygem/<API key>) - [ies 0.1.1](https://github.com/docker-rubygem/ies) - [iesd 1.2.2](https://github.com/docker-rubygem/iesd) - [ievms-ruby 0.2.0](https://github.com/docker-rubygem/ievms-ruby) - [<API key> 0.2.14](https://github.com/docker-rubygem/<API key>) - [ifchanged 1.0.1](https://github.com/docker-rubygem/ifchanged) - [ifdef 0.0.1](https://github.com/docker-rubygem/ifdef) - [ifelse 0.6.0](https://github.com/docker-rubygem/ifelse) - [ifferte_studio_game 1.0.0](https://github.com/docker-rubygem/ifferte_studio_game) - [ifilter 0.2.4](https://github.com/docker-rubygem/ifilter) - [ifin24-client 1.3.0](https://github.com/docker-rubygem/ifin24-client) - [ifmapper 2.0.4](https://github.com/docker-rubygem/ifmapper) - [ifrb 1.0.0](https://github.com/docker-rubygem/ifrb) - [iftoc 0.1.9](https://github.com/docker-rubygem/iftoc) - [ig3cmd 0.2.1](https://github.com/docker-rubygem/ig3cmd) - [ig3tool 0.6.0](https://github.com/docker-rubygem/ig3tool) - [ig_markets 0.26](https://github.com/docker-rubygem/ig_markets) - [igg 0.0.10](https://github.com/docker-rubygem/igg) - [igist 0.1.0](https://github.com/docker-rubygem/igist) - [ign-mongo_mapper 0.8.6.2](https://github.com/docker-rubygem/ign-mongo_mapper) - [ignition-ign 0.0.7](https://github.com/docker-rubygem/ignition-ign) - [ignoramos 1.1.0](https://github.com/docker-rubygem/ignoramos) - [ignore 0.0.2](https://github.com/docker-rubygem/ignore) - [ignorify 1.1.1](https://github.com/docker-rubygem/ignorify) - [ignoring 1.0.2](https://github.com/docker-rubygem/ignoring) - [igor 0.0.1](https://github.com/docker-rubygem/igor) - [igp 0.0.3](https://github.com/docker-rubygem/igp) - [igros 0.1.4](https://github.com/docker-rubygem/igros) - [ihealth_bot 0.0.1](https://github.com/docker-rubygem/ihealth_bot) - [ihelp 0.4.5](https://github.com/docker-rubygem/ihelp) - [ii 0.1.0](https://github.com/docker-rubygem/ii) - [iij-dag 1.0.1](https://github.com/docker-rubygem/iij-dag) - [iijmio-cli 0.0.5](https://github.com/docker-rubygem/iijmio-cli) - [iisconfig 0.5.0](https://github.com/docker-rubygem/iisconfig) - [ijson 0.0.1](https://github.com/docker-rubygem/ijson) - [ikaros 0.0.2](https://github.com/docker-rubygem/ikaros) - [ikbis 0.2.0](https://github.com/docker-rubygem/ikbis) - [<API key> 0.0.12](https://github.com/docker-rubygem/<API key>) - [ikran 0.2.0](https://github.com/docker-rubygem/ikran) - [ileitch-hijack 0.1.9](https://github.com/docker-rubygem/ileitch-hijack) - [<API key> 0.1.3](https://github.com/docker-rubygem/<API key>) - [illusionist 0.0.2](https://github.com/docker-rubygem/illusionist) - [ilo-sdk 1.2.2](https://github.com/docker-rubygem/ilo-sdk) - [ilookup 0.0.6](https://github.com/docker-rubygem/ilookup) - [iloveck101 0.3.0](https://github.com/docker-rubygem/iloveck101) - [ilpomodoro 0.0.1](https://github.com/docker-rubygem/ilpomodoro) - [im-alive 0.1.1](https://github.com/docker-rubygem/im-alive) - [im-kayac 0.1.2](https://github.com/docker-rubygem/im-kayac) - [im_exporter 0.0.2](https://github.com/docker-rubygem/im_exporter) - [image-dumper 0.5.3.10](https://github.com/docker-rubygem/image-dumper) - [image-optimizer 0.2.3](https://github.com/docker-rubygem/image-optimizer) - [image-stitcher 0.0.1](https://github.com/docker-rubygem/image-stitcher) - [image2pdf 0.1.0](https://github.com/docker-rubygem/image2pdf) - [image_builder 0.0.12](https://github.com/docker-rubygem/image_builder) - [image_downloader 0.2.4](https://github.com/docker-rubygem/image_downloader) - [image_magick 0.1.9](https://github.com/docker-rubygem/image_magick) - [image_mover 0.0.1](https://github.com/docker-rubygem/image_mover) - [image_optim 0.24.1](https://github.com/docker-rubygem/image_optim) - [<API key> 0.0.4](https://github.com/docker-rubygem/<API key>) - [image_optimize 1.0.2](https://github.com/docker-rubygem/image_optimize) - [<API key> 1.0.1](https://github.com/docker-rubygem/<API key>) - [image_science 1.3.0](https://github.com/docker-rubygem/image_science) - [image_sizes 0.0.4](https://github.com/docker-rubygem/image_sizes) - [image_svd 0.1.7](https://github.com/docker-rubygem/image_svd) - [image_voodoo 0.8.8](https://github.com/docker-rubygem/image_voodoo) - [imagebin 1.0.6](https://github.com/docker-rubygem/imagebin) - [imagechan 0.2.3](https://github.com/docker-rubygem/imagechan) - [imagefilter 0.7.0](https://github.com/docker-rubygem/imagefilter) - [imagelib 0.0.1](https://github.com/docker-rubygem/imagelib) - [<API key> 6.8.7.5.1](https://github.com/docker-rubygem/<API key>) - [images_gallery 1.1.0](https://github.com/docker-rubygem/images_gallery) - [imagesite 1.0.1](https://github.com/docker-rubygem/imagesite) - [imagetooth 2.0.1](https://github.com/docker-rubygem/imagetooth) - [imagevenue 0.0.3](https://github.com/docker-rubygem/imagevenue) - [imaginizer 0.0.6](https://github.com/docker-rubygem/imaginizer) - [imagut 0.0.4](https://github.com/docker-rubygem/imagut) - [imap-backup 1.0.17](https://github.com/docker-rubygem/imap-backup) - [imap-feeder 0.2.2](https://github.com/docker-rubygem/imap-feeder) - [imap-filter 0.1.2](https://github.com/docker-rubygem/imap-filter) - [imap_archiver 0.0.8](https://github.com/docker-rubygem/imap_archiver) - [imap_clear 0.1.0](https://github.com/docker-rubygem/imap_clear) - [imap_notifier 0.2.9](https://github.com/docker-rubygem/imap_notifier) - [imap_processor 1.1.1](https://github.com/docker-rubygem/imap_processor) - [imap_tickler 0.0.1](https://github.com/docker-rubygem/imap_tickler) - [imap_to_rss 1.0.1](https://github.com/docker-rubygem/imap_to_rss) - [imapget 0.2.1](https://github.com/docker-rubygem/imapget) - [imapstore 0.5.2](https://github.com/docker-rubygem/imapstore) - [<API key> 0.1.4](https://github.com/docker-rubygem/<API key>) - [imba 0.0.2](https://github.com/docker-rubygem/imba) - [imbriaco-integrity 0.1.9.2.1](https://github.com/docker-rubygem/imbriaco-integrity) - [imbriaco-nanite 0.4.0.1](https://github.com/docker-rubygem/imbriaco-nanite) - [imdb 0.8.2](https://github.com/docker-rubygem/imdb) - [imdb_celebrity 0.0.3](https://github.com/docker-rubygem/imdb_celebrity) - [imdb_movies 1.0.11](https://github.com/docker-rubygem/imdb_movies) - [imdb_parser 1.0.3](https://github.com/docker-rubygem/imdb_parser) - [imedo-css_doc 0.0.5](https://github.com/docker-rubygem/imedo-css_doc) - [imei-scrapper 0.0.1](https://github.com/docker-rubygem/imei-scrapper) - [imessage 0.3.1](https://github.com/docker-rubygem/imessage) - [img-kit 1.3.9.1](https://github.com/docker-rubygem/img-kit) - [img-sort 0.2.0](https://github.com/docker-rubygem/img-sort) - [img_dl 0.0.4](https://github.com/docker-rubygem/img_dl) - [img_scripts 0.0.3](https://github.com/docker-rubygem/img_scripts) - [imgdiff 0.3.0](https://github.com/docker-rubygem/imgdiff) - [imgen 0.1.1](https://github.com/docker-rubygem/imgen) - [imggrabber 0.1.2](https://github.com/docker-rubygem/imggrabber) - [imgkit 1.3.10](https://github.com/docker-rubygem/imgkit) - [imgsrc 0.8.6](https://github.com/docker-rubygem/imgsrc) - [imgur-auto-uploader 0.0.3](https://github.com/docker-rubygem/imgur-auto-uploader) - [imgur2 1.2.1](https://github.com/docker-rubygem/imgur2) - [imgurr 1.0.0](https://github.com/docker-rubygem/imgurr) - [imine 0.1.3](https://github.com/docker-rubygem/imine) - [immigrada 0.2](https://github.com/docker-rubygem/immigrada) - [immortalize 0.2.4](https://github.com/docker-rubygem/immortalize) - [immunio 1.0.22](https://github.com/docker-rubygem/immunio) - [<API key> 0.1.0](https://github.com/docker-rubygem/<API key>) - [immutablebox 0.0.1](https://github.com/docker-rubygem/immutablebox) - [imp 0.2.3](https://github.com/docker-rubygem/imp) - [imp3 0.1.5](https://github.com/docker-rubygem/imp3) - [impact 0.1.0](https://github.com/docker-rubygem/impact) - [impatient 1.1.1](https://github.com/docker-rubygem/impatient) - [impl 1.2](https://github.com/docker-rubygem/impl) - [import_js 0.6.0](https://github.com/docker-rubygem/import_js) - [<API key> 0.0.18](https://github.com/docker-rubygem/<API key>) - [imposition 0.9.5.5.1](https://github.com/docker-rubygem/imposition) - [improvise 0.2.0](https://github.com/docker-rubygem/improvise) - [impulse-cube 0.1.7](https://github.com/docker-rubygem/impulse-cube) - [ims 0.8.2](https://github.com/docker-rubygem/ims) - [imsg 0.0.9](https://github.com/docker-rubygem/imsg) - [imsticker 0.1.7](https://github.com/docker-rubygem/imsticker) - [imuzer 0.0.4](https://github.com/docker-rubygem/imuzer) - [in-the-zone 0.0.3](https://github.com/docker-rubygem/in-the-zone) - [in_our_time 0.7.0](https://github.com/docker-rubygem/in_our_time) - [inaba 0.0.2](https://github.com/docker-rubygem/inaba) - [inari 0.1.1](https://github.com/docker-rubygem/inari) - [<API key> 0.0.2](https://github.com/docker-rubygem/<API key>) - [inboxer 0.0.1](https://github.com/docker-rubygem/inboxer) - [incept 0.1.0](https://github.com/docker-rubygem/incept) - [inception 0.1.0](https://github.com/docker-rubygem/inception) - [inception-server 0.3.0](https://github.com/docker-rubygem/inception-server) - [inch 0.5.10](https://github.com/docker-rubygem/inch) - [inch-badge 0.4.1](https://github.com/docker-rubygem/inch-badge) - [inch_ci-worker 0.3.10](https://github.com/docker-rubygem/inch_ci-worker) - [inci_score 2.2.1](https://github.com/docker-rubygem/inci_score) - [includer 0.1.2](https://github.com/docker-rubygem/includer) - [incodesert 0.1.0](https://github.com/docker-rubygem/incodesert) - [incoming 0.1.8](https://github.com/docker-rubygem/incoming) - [<API key> 0.0.2](https://github.com/docker-rubygem/<API key>) - [incsv 0.2.2](https://github.com/docker-rubygem/incsv) - [inde_struct 1.0.1](https://github.com/docker-rubygem/inde_struct) - [indent_code 0.1.5](https://github.com/docker-rubygem/indent_code) - [index_html 0.2.5](https://github.com/docker-rubygem/index_html) - [index_shotgun 0.3.0](https://github.com/docker-rubygem/index_shotgun) - [indexer 0.3.1](https://github.com/docker-rubygem/indexer) - [indexotron 0.0.0](https://github.com/docker-rubygem/indexotron) - [indicator_delcom 0.0.4](https://github.com/docker-rubygem/indicator_delcom) - [indirect-jekyll 0.5.4](https://github.com/docker-rubygem/indirect-jekyll) - [indis 0.1.3](https://github.com/docker-rubygem/indis) - [indoctrinatr-tools 0.14.0](https://github.com/docker-rubygem/indoctrinatr-tools) - [industrial_girl 0.0.3](https://github.com/docker-rubygem/industrial_girl) - [inesita 0.6.1](https://github.com/docker-rubygem/inesita) - [inews_client 0.1.4.1](https://github.com/docker-rubygem/inews_client) - [infect 1.0.0](https://github.com/docker-rubygem/infect) - [infinite-loop 0.1.0](https://github.com/docker-rubygem/infinite-loop) - [infinity2008 1.1.1](https://github.com/docker-rubygem/infinity2008) - [infinity_test 1.0.3](https://github.com/docker-rubygem/infinity_test) - [inflame 0.1.1](https://github.com/docker-rubygem/inflame) - [inflect 0.5.2](https://github.com/docker-rubygem/inflect) - [influence 0.0.6](https://github.com/docker-rubygem/influence) - [influxdb-cli 0.1.4](https://github.com/docker-rubygem/influxdb-cli) - [<API key> 0.2.1](https://github.com/docker-rubygem/<API key>) - [<API key> 0.0.1](https://github.com/docker-rubygem/<API key>) - [info_vault 0.0.4](https://github.com/docker-rubygem/info_vault) - [infoblocks 0.1.0](https://github.com/docker-rubygem/infoblocks) - [infoboxer 0.1.2.1](https://github.com/docker-rubygem/infoboxer) - [infobright-loader 0.0.1](https://github.com/docker-rubygem/infobright-loader) - [infod 0.0.3.6](https://github.com/docker-rubygem/infod) - [infopark-dcc 0.1.3](https://github.com/docker-rubygem/infopark-dcc) - [informer 0.2.0](https://github.com/docker-rubygem/informer) - [infostrada 0.1.28](https://github.com/docker-rubygem/infostrada) - [infowars 1.1.3](https://github.com/docker-rubygem/infowars) - [infra-ctrl 0.1.6](https://github.com/docker-rubygem/infra-ctrl) - [infractores 1.0.0](https://github.com/docker-rubygem/infractores) - [infraruby-core 4.0.0](https://github.com/docker-rubygem/infraruby-core) - [infraruby-init 4.0.0](https://github.com/docker-rubygem/infraruby-init) - [infrataster 0.1.13](https://github.com/docker-rubygem/infrataster) - [infunnel_cli 0.0.162](https://github.com/docker-rubygem/infunnel_cli) - [infused-dbf 1.0.9](https://github.com/docker-rubygem/infused-dbf) - [ing 0.2.7](https://github.com/docker-rubygem/ing) - [ingestor 0.1.9](https://github.com/docker-rubygem/ingestor) - [inimit 0.0.3](https://github.com/docker-rubygem/inimit) - [initiate 0.1.0](https://github.com/docker-rubygem/initiate) - [initium 0.0.1](https://github.com/docker-rubygem/initium) - [injection-helper 0.0.1](https://github.com/docker-rubygem/injection-helper) - [injectorize 0.0.1](https://github.com/docker-rubygem/injectorize) - [ink 0.1.3](https://github.com/docker-rubygem/ink) - [inkcite 1.12.1](https://github.com/docker-rubygem/inkcite) - [inkling 0.1.0](https://github.com/docker-rubygem/inkling) - [inkling_api 0.1.3](https://github.com/docker-rubygem/inkling_api) - [inkmake 0.1.2](https://github.com/docker-rubygem/inkmake) - [inko 0.0.5](https://github.com/docker-rubygem/inko) - [inkscape_merge 0.3.0](https://github.com/docker-rubygem/inkscape_merge) - [inline_encryption 2.0.0](https://github.com/docker-rubygem/inline_encryption) - [inline_forms 3.0.58](https://github.com/docker-rubygem/inline_forms) - [inline_image 1.0.1](https://github.com/docker-rubygem/inline_image) - [inliner 0.0.2](https://github.com/docker-rubygem/inliner) - [inmake 2.0.1](https://github.com/docker-rubygem/inmake) - [innodb_ruby 0.9.15](https://github.com/docker-rubygem/innodb_ruby) - [inochi 6.1.0](https://github.com/docker-rubygem/inochi) - [inplace 1.2.3](https://github.com/docker-rubygem/inplace) - [inploy 1.9.6](https://github.com/docker-rubygem/inploy) - [inprovise 0.2.23](https://github.com/docker-rubygem/inprovise) - [inqlude 0.10.0](https://github.com/docker-rubygem/inqlude) - [inquisitive_alex 0.2.1](https://github.com/docker-rubygem/inquisitive_alex) - [inquisitor 0.1.1](https://github.com/docker-rubygem/inquisitor) - [insanity 0.2.0](https://github.com/docker-rubygem/insanity) - [insertica 0.1.0](https://github.com/docker-rubygem/insertica) - [inspec 0.9.11](https://github.com/docker-rubygem/inspec) - [inspec-multi-server 0.0.1](https://github.com/docker-rubygem/inspec-multi-server) - [inspect 0.0.1](https://github.com/docker-rubygem/inspect) - [inspected_by 0.0.2](https://github.com/docker-rubygem/inspected_by) - [inspire 1.0.0](https://github.com/docker-rubygem/inspire) - [insrc-whenever 0.5.1](https://github.com/docker-rubygem/insrc-whenever) - [inst-jobs 0.11.6](https://github.com/docker-rubygem/inst-jobs) - [insta-monitis 0.1.8](https://github.com/docker-rubygem/insta-monitis) - [insta_readability 0.0.1](https://github.com/docker-rubygem/insta_readability) - [<API key> 1.0.1](https://github.com/docker-rubygem/<API key>) - [instadoc 0.0.1](https://github.com/docker-rubygem/instadoc) - [instafavs 0.0.5](https://github.com/docker-rubygem/instafavs) - [instagrab 0.1.0](https://github.com/docker-rubygem/instagrab) - [instaguard 0.0.1](https://github.com/docker-rubygem/instaguard) - [instalatron 0.1.8](https://github.com/docker-rubygem/instalatron) - [install_gem 0.0.1](https://github.com/docker-rubygem/install_gem) - [install_theme 0.8.2](https://github.com/docker-rubygem/install_theme) - [installr 0.0.1](https://github.com/docker-rubygem/installr) - [instamatic 0.1.1](https://github.com/docker-rubygem/instamatic) - [instance_accountant 0.0.4](https://github.com/docker-rubygem/instance_accountant) - [instance_selector 0.3.0](https://github.com/docker-rubygem/instance_selector) - [instapaper_download 1.0.1](https://github.com/docker-rubygem/instapaper_download) - [instapush-api 0.1.0](https://github.com/docker-rubygem/instapush-api) - [instapusher 0.0.34](https://github.com/docker-rubygem/instapusher) - [instapusher2 0.0.8](https://github.com/docker-rubygem/instapusher2) - [instigator 0.9.1](https://github.com/docker-rubygem/instigator) - [instiki 0.10.2](https://github.com/docker-rubygem/instiki) - [<API key> 0.0.3](https://github.com/docker-rubygem/<API key>) - [instrumental_tools 1.1.4](https://github.com/docker-rubygem/instrumental_tools) - [insulin 0.1.11](https://github.com/docker-rubygem/insulin) - [insult_clinic 0.1.1](https://github.com/docker-rubygem/insult_clinic) - [insult_generator 0.0.1](https://github.com/docker-rubygem/insult_generator) - [insup 0.1.2](https://github.com/docker-rubygem/insup) - [insurance 0.3](https://github.com/docker-rubygem/insurance) - [insxsync 1.1.0](https://github.com/docker-rubygem/insxsync) - [insync 0.0.2](https://github.com/docker-rubygem/insync) - [integra 0.0.4](https://github.com/docker-rubygem/integra) - [integrated_data 0.0.1](https://github.com/docker-rubygem/integrated_data) - [integrity 0.1.9.3](https://github.com/docker-rubygem/integrity) - [integrity-integrity 0.1.9.3](https://github.com/docker-rubygem/integrity-integrity) - [intelitiva-rugui 1.3.2](https://github.com/docker-rubygem/intelitiva-rugui) - [intent 0.3.0](https://github.com/docker-rubygem/intent) - [interactive_grep 0.0.5](https://github.com/docker-rubygem/interactive_grep) - [interactive_rspec 0.0.2](https://github.com/docker-rubygem/interactive_rspec) - [interactive_s3 0.0.6](https://github.com/docker-rubygem/interactive_s3) - [intercity 0.1.6](https://github.com/docker-rubygem/intercity) - [intercom_export 0.0.1](https://github.com/docker-rubygem/intercom_export) - [interfacelift 0.1.1](https://github.com/docker-rubygem/interfacelift) - [interferon 0.0.19](https://github.com/docker-rubygem/interferon) - [interleave 0.2.0](https://github.com/docker-rubygem/interleave) - [international 0.3.4](https://github.com/docker-rubygem/international) - [interneeee 0.0.5](https://github.com/docker-rubygem/interneeee) - [internet 0.1.2](https://github.com/docker-rubygem/internet) - [internet-sampler 0.2.3](https://github.com/docker-rubygem/internet-sampler) - [internet-wisdom 0.1.4](https://github.com/docker-rubygem/internet-wisdom) - [internet_box_logger 1.0.2](https://github.com/docker-rubygem/internet_box_logger) - [internet_near_me 0.1.2](https://github.com/docker-rubygem/internet_near_me) - [<API key> 0.2.0](https://github.com/docker-rubygem/<API key>) - [internet_tracer 1.0.0](https://github.com/docker-rubygem/internet_tracer) - [internethakai 0.2.6](https://github.com/docker-rubygem/internethakai) - [internode 1.1.0](https://github.com/docker-rubygem/internode) - [interpres 0.0.1](https://github.com/docker-rubygem/interpres) - [interrotron 0.0.5](https://github.com/docker-rubygem/interrotron) - [<API key> 0.0.7](https://github.com/docker-rubygem/<API key>) - [interspire 0.3.2](https://github.com/docker-rubygem/interspire) - [interstate 0.0.2.1](https://github.com/docker-rubygem/interstate) - [interu-backup 3.0.16](https://github.com/docker-rubygem/interu-backup) - [interval-quiz 0.0.1](https://github.com/docker-rubygem/interval-quiz) - [intranacht 0.1.0](https://github.com/docker-rubygem/intranacht) - [introspect 1.0.4](https://github.com/docker-rubygem/introspect) - [inu 0.0.0](https://github.com/docker-rubygem/inu) - [inventory-cli 0.1.1](https://github.com/docker-rubygem/inventory-cli) - [inventory-server 0.1.0](https://github.com/docker-rubygem/inventory-server) - [inverse_methods 0.0.1](https://github.com/docker-rubygem/inverse_methods) - [inversion 0.18.0](https://github.com/docker-rubygem/inversion) - [invim 0.0.2](https://github.com/docker-rubygem/invim) - [invisi 0.1.0](https://github.com/docker-rubygem/invisi) - [<API key> 0.3.5](https://github.com/docker-rubygem/<API key>) - [invo-sporknife 0.1.0.3](https://github.com/docker-rubygem/invo-sporknife) - [invoca_gems 0.1.0](https://github.com/docker-rubygem/invoca_gems) - [invoice 1.0.3](https://github.com/docker-rubygem/invoice) - [invoices 0.1.0](https://github.com/docker-rubygem/invoices) - [invoker 1.5.1](https://github.com/docker-rubygem/invoker) - [inwxupdate 0.3.0](https://github.com/docker-rubygem/inwxupdate) - [io-tail 0.0.3](https://github.com/docker-rubygem/io-tail) - [io_mailer 0.0.3](https://github.com/docker-rubygem/io_mailer) - [io_tools 0.2.5](https://github.com/docker-rubygem/io_tools) - [iocparser 0.0.1](https://github.com/docker-rubygem/iocparser) - [iode 0.0.4](https://github.com/docker-rubygem/iode) - [iodine 0.1.21](https://github.com/docker-rubygem/iodine) - [ioled 1.0.1](https://github.com/docker-rubygem/ioled) - [ionic_git_scripts 1.1.6](https://github.com/docker-rubygem/ionic_git_scripts) - [<API key> 0.2.3](https://github.com/docker-rubygem/<API key>) - [ioquatix-engines 2.1.0](https://github.com/docker-rubygem/ioquatix-engines) - [ios-box 0.2.4](https://github.com/docker-rubygem/ios-box) - [ios-contents-json 0.0.2](https://github.com/docker-rubygem/ios-contents-json) - [ios-deploy 1.5.0](https://github.com/docker-rubygem/ios-deploy) - [ios-png-check 1.1.0](https://github.com/docker-rubygem/ios-png-check) - [ios-portal 0.0.2](https://github.com/docker-rubygem/ios-portal) - [ios3 0.0.5](https://github.com/docker-rubygem/ios3) - [ios7crypt 0.3](https://github.com/docker-rubygem/ios7crypt) - [ios_analytics 0.0.6](https://github.com/docker-rubygem/ios_analytics) - [ios_android_toolbox 0.0.46](https://github.com/docker-rubygem/ios_android_toolbox) - [ios_app_installer 0.0.1](https://github.com/docker-rubygem/ios_app_installer) - [ios_build_kit 0.0.6](https://github.com/docker-rubygem/ios_build_kit) - [ios_ci 1.0.5](https://github.com/docker-rubygem/ios_ci) - [ios_dev_tools 0.1.6](https://github.com/docker-rubygem/ios_dev_tools) - [<API key> 0.0.2](https://github.com/docker-rubygem/<API key>) - [ios_icon_gen 0.0.2](https://github.com/docker-rubygem/ios_icon_gen) - [ios_localizer 0.0.1.2](https://github.com/docker-rubygem/ios_localizer) - [iosdeveloper 0.3.3](https://github.com/docker-rubygem/iosdeveloper) - [iosgen 1.1.0](https://github.com/docker-rubygem/iosgen) - [iostrust 1.0.0](https://github.com/docker-rubygem/iostrust) - [iot 1.0.2](https://github.com/docker-rubygem/iot) - [iota-rb 0.1.0](https://github.com/docker-rubygem/iota-rb) - [ip-world-map 1.0.1](https://github.com/docker-rubygem/ip-world-map) - [ip-wrangler 0.1.2](https://github.com/docker-rubygem/ip-wrangler) - [ip2cidr 0.0.4](https://github.com/docker-rubygem/ip2cidr) - [ip2country 0.0.2](https://github.com/docker-rubygem/ip2country) - [ip2kml 1.0.1](https://github.com/docker-rubygem/ip2kml) - [ip2l 0.1.0](https://github.com/docker-rubygem/ip2l) - [ip_auditor 0.0.2](https://github.com/docker-rubygem/ip_auditor) - [ip_frag 0.0.4](https://github.com/docker-rubygem/ip_frag) - [ip_tracker 0.0.2](https://github.com/docker-rubygem/ip_tracker) - [ipa-parser 0.0.4](https://github.com/docker-rubygem/ipa-parser) - [ipa_account_check 0.0.2](https://github.com/docker-rubygem/ipa_account_check) - [ipa_analyzer 0.1.0](https://github.com/docker-rubygem/ipa_analyzer) - [<API key> 0.2.0](https://github.com/docker-rubygem/<API key>) - [ipa_reader 0.7.1](https://github.com/docker-rubygem/ipa_reader) - [ipa_utilities 0.2.0](https://github.com/docker-rubygem/ipa_utilities) - [ipage 1.0.4](https://github.com/docker-rubygem/ipage) - [ipasend 0.0.8](https://github.com/docker-rubygem/ipasend) - [ipc_transit 0.0.3](https://github.com/docker-rubygem/ipc_transit) - [ipcad2squid 1.1.2](https://github.com/docker-rubygem/ipcad2squid) - [ipcauthpipe 0.2.9](https://github.com/docker-rubygem/ipcauthpipe) - [ipcountry 0.0.7](https://github.com/docker-rubygem/ipcountry) - [ipecache 0.0.12](https://github.com/docker-rubygem/ipecache) - [ipfixer_client 0.0.3](https://github.com/docker-rubygem/ipfixer_client) - [iphoneruby 0.1.2](https://github.com/docker-rubygem/iphoneruby) - [iphoto_backup 1.1.1](https://github.com/docker-rubygem/iphoto_backup) - [ipip 0.0.3](https://github.com/docker-rubygem/ipip) - [iplan-appsignal 1.1.6.mybeta.2](https://github.com/docker-rubygem/iplan-appsignal) - [iplayer-dl 0.1.20](https://github.com/docker-rubygem/iplayer-dl) - [ipod_db 0.2.13](https://github.com/docker-rubygem/ipod_db) - [ipodcastly 0.0.1](https://github.com/docker-rubygem/ipodcastly) - [ipparse 0.2.0](https://github.com/docker-rubygem/ipparse) - [ipreader 0.0.2](https://github.com/docker-rubygem/ipreader) - [ipscan 0.0.4](https://github.com/docker-rubygem/ipscan) - [ipscriptables 0.0.1](https://github.com/docker-rubygem/ipscriptables) - [ipswitch 0.1.0](https://github.com/docker-rubygem/ipswitch) - [iptables 0.0.1](https://github.com/docker-rubygem/iptables) - [iptables-ruby 0.2.5](https://github.com/docker-rubygem/iptables-ruby) - [iptables-web 0.3.5.pre8](https://github.com/docker-rubygem/iptables-web) - [ipvs_litmus 0.0.2](https://github.com/docker-rubygem/ipvs_litmus) - [iqeo-hostspec 0.1.1](https://github.com/docker-rubygem/iqeo-hostspec) - [ir_ptz 0.0.3](https://github.com/docker-rubygem/ir_ptz) - [iragsdale-rubydkim 0.3](https://github.com/docker-rubygem/iragsdale-rubydkim) - [irails 0.2.0](https://github.com/docker-rubygem/irails) - [irb-history 1.0.0](https://github.com/docker-rubygem/irb-history) - [irberize 0.0.1](https://github.com/docker-rubygem/irberize) - [irbthbound 0.0.3](https://github.com/docker-rubygem/irbthbound) - [irc-qik-bot 0.0.1](https://github.com/docker-rubygem/irc-qik-bot) - [irc_cat 0.2.0](https://github.com/docker-rubygem/irc_cat) - [irc_cat_clients 0.2.0](https://github.com/docker-rubygem/irc_cat_clients) - [irc_machine 0.0.1](https://github.com/docker-rubygem/irc_machine) - [ircbot 0.2.2](https://github.com/docker-rubygem/ircbot) - [irccat 0.4.2](https://github.com/docker-rubygem/irccat) - [irckitten 0.0.3](https://github.com/docker-rubygem/irckitten) - [ircnotify 0.0.3](https://github.com/docker-rubygem/ircnotify) - [irctc 0.0.1](https://github.com/docker-rubygem/irctc) - [irden 0.1.0](https://github.com/docker-rubygem/irden) - [irealb_parser 0.0.1](https://github.com/docker-rubygem/irealb_parser) - [irecorder 0.0.8](https://github.com/docker-rubygem/irecorder) - [iremocon_control 0.2.1](https://github.com/docker-rubygem/iremocon_control) - [irfsdash 0.1.5](https://github.com/docker-rubygem/irfsdash) - [irgat 0.0.6](https://github.com/docker-rubygem/irgat) - [irkit 0.1.0](https://github.com/docker-rubygem/irkit) - [iroki 0.0.29](https://github.com/docker-rubygem/iroki) - [iron-crawler 1.2.1](https://github.com/docker-rubygem/iron-crawler) - [iron_chef 0.0.14](https://github.com/docker-rubygem/iron_chef) - [iron_hammer 1.0.12](https://github.com/docker-rubygem/iron_hammer) - [iron_worker_ng 1.6.10](https://github.com/docker-rubygem/iron_worker_ng) - [ironment 1.0.2](https://github.com/docker-rubygem/ironment) - [ironnails 0.0.3](https://github.com/docker-rubygem/ironnails) - [irosi 0.0.3](https://github.com/docker-rubygem/irosi) - [irpack 0.2.7](https://github.com/docker-rubygem/irpack) - [irrc 0.2.0](https://github.com/docker-rubygem/irrc) - [irsh 0.2.3](https://github.com/docker-rubygem/irsh) - [irt 1.2.12](https://github.com/docker-rubygem/irt) - [iruby 0.1.13](https://github.com/docker-rubygem/iruby) - [irust 1.2.0](https://github.com/docker-rubygem/irust) - [isaac-deprec 1.99.32](https://github.com/docker-rubygem/isaac-deprec) - [isaac-malline 1.1.0](https://github.com/docker-rubygem/isaac-malline) - [isaac_toolbelt 0.1.6](https://github.com/docker-rubygem/isaac_toolbelt) - [isaacfeliu-aws-s3 0.4.1](https://github.com/docker-rubygem/isaacfeliu-aws-s3) - [iscale 0.0.1](https://github.com/docker-rubygem/iscale) - [ish_lib 0.0.8](https://github.com/docker-rubygem/ish_lib) - [ishuhui 0.1.1](https://github.com/docker-rubygem/ishuhui) - [isi 1.2.3](https://github.com/docker-rubygem/isi) - [isin_code_generator 0.0.2](https://github.com/docker-rubygem/isin_code_generator) - [isitfree 0.0.1](https://github.com/docker-rubygem/isitfree) - [islo 0.1.1](https://github.com/docker-rubygem/islo) - [iso4217-validator 0.0.2](https://github.com/docker-rubygem/iso4217-validator) - [isohunt-es 0.0.2](https://github.com/docker-rubygem/isohunt-es) - [isolate-scenarios 0.1.1](https://github.com/docker-rubygem/isolate-scenarios) - [<API key> 0.0.6](https://github.com/docker-rubygem/<API key>) - [isolated_server 0.4.11](https://github.com/docker-rubygem/isolated_server) - [isono 0.2.20](https://github.com/docker-rubygem/isono) - [isostatic-scraper 0.0.1](https://github.com/docker-rubygem/isostatic-scraper) - [ispector 0.1.0](https://github.com/docker-rubygem/ispector) - [isporn 0.2.1](https://github.com/docker-rubygem/isporn) - [ispunity 0.0.5](https://github.com/docker-rubygem/ispunity) - [ispusage 0.4.2](https://github.com/docker-rubygem/ispusage) - [isrcs2mb 0.1.0](https://github.com/docker-rubygem/isrcs2mb) - [issen 0.0.1](https://github.com/docker-rubygem/issen) - [isstempl 0.0.2](https://github.com/docker-rubygem/isstempl) - [issue-beaver 0.2.1](https://github.com/docker-rubygem/issue-beaver) - [issues 0.0.2](https://github.com/docker-rubygem/issues) - [issuesrc 0.0.5](https://github.com/docker-rubygem/issuesrc) - [isteel-rest-client 0.9.3.1](https://github.com/docker-rubygem/isteel-rest-client) - [isup 1.0](https://github.com/docker-rubygem/isup) - [it_tools 0.0.2](https://github.com/docker-rubygem/it_tools) - [ita2 0.1.3](https://github.com/docker-rubygem/ita2) - [itach 0.0.1](https://github.com/docker-rubygem/itach) - [itamae 1.9.10](https://github.com/docker-rubygem/itamae) - [itamae-mitsurin 0.48](https://github.com/docker-rubygem/itamae-mitsurin) - [itamae-node_env 0.0.8](https://github.com/docker-rubygem/itamae-node_env) - [<API key> 0.1.1](https://github.com/docker-rubygem/<API key>) - [<API key> 0.2.2](https://github.com/docker-rubygem/<API key>) - [itamae-secrets 0.2.2](https://github.com/docker-rubygem/itamae-secrets) - [itamae-skeleton 0.1.0](https://github.com/docker-rubygem/itamae-skeleton) - [itamae-sonar 1.0.1](https://github.com/docker-rubygem/itamae-sonar) - [itamae-template 0.1.4](https://github.com/docker-rubygem/itamae-template) - [itc 0.1.0](https://github.com/docker-rubygem/itc) - [itc-autoingest 1.0.2](https://github.com/docker-rubygem/itc-autoingest) - [itch 1.0.5](https://github.com/docker-rubygem/itch) - [itchy 0.2.8](https://github.com/docker-rubygem/itchy) - [itcss_cli 0.1.18](https://github.com/docker-rubygem/itcss_cli) - [itcsscli 0.1.10](https://github.com/docker-rubygem/itcsscli) - [itds 0.1.3](https://github.com/docker-rubygem/itds) - [iteraptor 0.3.5](https://github.com/docker-rubygem/iteraptor) - [iterm2-protocol 0.1.1](https://github.com/docker-rubygem/iterm2-protocol) - [iterm2-viewer 0.0.8](https://github.com/docker-rubygem/iterm2-viewer) - [iterm2guake 0.0.1](https://github.com/docker-rubygem/iterm2guake) - [iterm2mintty 0.0.4](https://github.com/docker-rubygem/iterm2mintty) - [itermwindow 0.4.0](https://github.com/docker-rubygem/itermwindow) - [itest 0.0.1](https://github.com/docker-rubygem/itest) - [itgwiki_mirror 1.0.4](https://github.com/docker-rubygem/itgwiki_mirror) - [itility 1.0.0](https://github.com/docker-rubygem/itility) - [itinerary 0.4](https://github.com/docker-rubygem/itinerary) - [itis 0.0.2](https://github.com/docker-rubygem/itis) - [itiscold 1.0.1](https://github.com/docker-rubygem/itiscold) - [itkrt2y 0.0.2](https://github.com/docker-rubygem/itkrt2y) - [itrp-export-monitor 1.0.6](https://github.com/docker-rubygem/itrp-export-monitor) - [<API key> 0.0.2](https://github.com/docker-rubygem/<API key>) - [itsy-btc 0.0.1](https://github.com/docker-rubygem/itsy-btc) - [itt 0.1.6](https://github.com/docker-rubygem/itt) - [ittan 0.1.4](https://github.com/docker-rubygem/ittan) - [ittayd-buildr 1.3.5](https://github.com/docker-rubygem/ittayd-buildr) - [ittf_points 0.1.1](https://github.com/docker-rubygem/ittf_points) - [itunes-cli 0.1.0](https://github.com/docker-rubygem/itunes-cli) - [itunes-connect 0.13.0](https://github.com/docker-rubygem/itunes-connect) - [itunes-controller 0.1.0](https://github.com/docker-rubygem/itunes-controller) - [itunes-web-frontend 0.1.0](https://github.com/docker-rubygem/itunes-web-frontend) - [itunes_csv 0.0.3](https://github.com/docker-rubygem/itunes_csv) - [<API key> 0.0.3](https://github.com/docker-rubygem/<API key>) - [<API key> 0.0.4](https://github.com/docker-rubygem/<API key>) - [<API key> 0.1.3](https://github.com/docker-rubygem/<API key>) - [itunes_track 0.0.1](https://github.com/docker-rubygem/itunes_track) - [<API key> 0.4.8](https://github.com/docker-rubygem/<API key>) - [itunestweet 0.1.1](https://github.com/docker-rubygem/itunestweet) - [iuid 0.0.4](https://github.com/docker-rubygem/iuid) - [iut 0.2.1](https://github.com/docker-rubygem/iut) - [iv-cli 0.0.6](https://github.com/docker-rubygem/iv-cli) - [ivanvc-dictionary 0.0.2](https://github.com/docker-rubygem/ivanvc-dictionary) - [ivanvc-pft 0.1.1](https://github.com/docker-rubygem/ivanvc-pft) - [ive 1.2.0](https://github.com/docker-rubygem/ive) - [ivebeen 0.2.0](https://github.com/docker-rubygem/ivebeen) - [ivey-longurl 0.1.7](https://github.com/docker-rubygem/ivey-longurl) - [ivy4r-jars 1.2.0](https://github.com/docker-rubygem/ivy4r-jars) - [iwatcher 0.0.2](https://github.com/docker-rubygem/iwatcher) - [ixyml 0.0.2](https://github.com/docker-rubygem/ixyml) - [iye 1.1.1](https://github.com/docker-rubygem/iye) - [izanami 0.20.0](https://github.com/docker-rubygem/izanami)
window.pdfMake = window.pdfMake || {}; window.pdfMake.fonts = {"EncodeSans":{"black":"EncodeSans-Black.ttf","bold":"EncodeSans-Bold.ttf","extrabold":"<API key>.ttf","extralight":"<API key>.ttf","light":"EncodeSans-Light.ttf","medium":"EncodeSans-Medium.ttf","normal":"EncodeSans-Regular.ttf","semibold":"EncodeSans-SemiBold.ttf","thin":"EncodeSans-Thin.ttf","italics":"EncodeSans-Regular.ttf","bolditalics":"EncodeSans-Bold.ttf"}};
class Ecm::Frontend::EventsController < Ecm::FrontendController def index @month = (params[:month] ||= Time.now.month).to_i @year = (params[:year] ||= Time.now.year).to_i # @time = DateTime.new(@year.to_i, @month.to_i).beginning_of_day.in_time_zone @time = DateTime.new(@year, @month).in_time_zone.beginning_of_day @events = ::Event.in_month(@year, @month).all @days = {} (1..Time.days_in_month(@month, @year)).each do |day| @days[day] = [] @events.each do |event| if event.begin_at_day(DateTime.new(@year, @month, day).in_time_zone) # if event.begin_at >= DateTime.new(@year, @month, day).in_time_zone.beginning_of_day and event.begin_at < DateTime.new(@year, @month, day).in_time_zone.end_of_day @days[day].push event end end end @days.sort end def show @event = ::Event.find(params[:id]) end end
*General Questions/ Issues* "For every HTTP request received by the server, the request callback function will be invoked with new req and res objects. Prior to the callback being triggered, Node will parse the request up through the HTTP headers and provide them as part of the req object. But Node doesn’t start parsing the body of the request until the callback has been fired. This is different from some server-side frameworks, like PHP, where both the headers and the body of the request are parsed before your application logic runs. Node provides this lower-level interface so you can handle the body data as it’s being parsed, if desired." (njia, 73) streams - req and res objects are streams Mime Types - We need mime types to be able to send and receive files with http - Mime types live in http headers
'use strict'; var test = require('tape').test; var _ = require('lodash'); var listMixin = require('../lib/listInterface'); test('Abstract List', function (t) { t.test('duck typing', function (t) { var toExtend = { storage: [] }; listMixin(toExtend, 'storage'); t.ok(_.isFunction(toExtend.add)); t.ok(_.isFunction(toExtend.get)); t.ok(_.isFunction(toExtend.remove)); t.ok(_.isFunction(toExtend.compare)); t.end(); }); t.test('add', function (t) { var toExtend = { storage: [] }; listMixin(toExtend, 'storage'); toExtend.add({ id: 11 }); t.equal(toExtend.storage.length, 1); toExtend.add({ id: 11 }); t.equal(toExtend.storage.length, 1, 'should ignore duplicates'); toExtend.add({ id: 31 }); t.equal(toExtend.storage.length, 2); t.end(); }); t.test('remove', function (t) { var toExtend = { storage: [{ id: 11 }] }; listMixin(toExtend, 'storage'); var removalResult = toExtend.remove(32); t.notOk(removalResult); t.equal(toExtend.storage.length, 1); // should cast id type removalResult = toExtend.remove('11'); t.ok(removalResult); t.equal(toExtend.storage.length, 0); t.end(); }); t.test('get', function (t) { var toExtend = { storage: [{ id: 11 }] }; listMixin(toExtend, 'storage'); var getResult = toExtend.get('31'); t.ok(_.isUndefined(getResult)); t.equal(toExtend.storage.length, 1); // erm... just to be sure :) getResult = toExtend.get('11'); // to ensure typecast t.deepEqual(getResult, { id: 11 }); t.equal(toExtend.storage.length, 1); t.end(); }); t.test('compare', function (t) { var toExtend = { storage: [{ id: 11 }] }; listMixin(toExtend, 'storage'); t.notOk(toExtend.compare(toExtend.storage[0]), 32); t.ok(toExtend.compare(toExtend.storage[0], 11)); t.end(); }); t.end(); });
<?php header("Content-Type: text/html; charset=utf-8"); require_once 'lib/lib_sql_func.php'; //Pour interdire certain caractere lors d'une inscription function isChar($ligne, $c){ for($i = 0; $i < count($ligne); $i++){ if($ligne[$i]==$c){return true;} } return false; } require "test/connexionBD.php"; foreach($_POST as $k => $v){ if($v==""){ header("Location: Inscription.php?error=3");exit;} } if(findUser($_POST['pseudo']) != false){ header("Location: Inscription.php?error=2");exit; }//verifie si le pseudo existe if($_POST['password'] != $_POST['password2']){ header("Location: Inscription.php?error=1");exit; }//verifie si le mot de passe et sa verification son pareil $_POST['password'] = sha1($_POST['password']); $champs = array('firstname','lastname','pseudo','mail','password'); <API key>($champs, $connexion, 'users'); session_start(); $user = findUser($_POST['pseudo']); $liste = array("id", "firstname", "lastname", "mail","pseudo"); for($i=0;$i<count($liste);$i++){$_SESSION[$liste[$i]] = $user[$liste[$i]];} header("Location: Accueil.php");exit; ?>
// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.synapse.models; import com.azure.core.util.Context; import com.azure.resourcemanager.synapse.fluent.models.WorkloadGroupInner; /** An immutable client-side representation of WorkloadGroup. */ public interface WorkloadGroup { /** * Gets the id property: Fully qualified resource Id for the resource. * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. * * @return the type value. */ String type(); /** * Gets the minResourcePercent property: The workload group minimum percentage resource. * * @return the minResourcePercent value. */ int minResourcePercent(); /** * Gets the maxResourcePercent property: The workload group cap percentage resource. * * @return the maxResourcePercent value. */ int maxResourcePercent(); /** * Gets the <API key> property: The workload group request minimum grant percentage. * * @return the <API key> value. */ double <API key>(); /** * Gets the <API key> property: The workload group request maximum grant percentage. * * @return the <API key> value. */ Double <API key>(); /** * Gets the importance property: The workload group importance level. * * @return the importance value. */ String importance(); /** * Gets the <API key> property: The workload group query execution timeout. * * @return the <API key> value. */ Integer <API key>(); /** * Gets the inner com.azure.resourcemanager.synapse.fluent.models.WorkloadGroupInner object. * * @return the inner object. */ WorkloadGroupInner innerModel(); /** The entirety of the WorkloadGroup definition. */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } /** The WorkloadGroup definition stages. */ interface DefinitionStages { /** The first stage of the WorkloadGroup definition. */ interface Blank extends WithParentResource { } /** The stage of the WorkloadGroup definition allowing to specify parent resource. */ interface WithParentResource { /** * Specifies resourceGroupName, workspaceName, sqlPoolName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sqlPoolName SQL pool name. * @return the next definition stage. */ WithCreate withExistingSqlPool(String resourceGroupName, String workspaceName, String sqlPoolName); } /** * The stage of the WorkloadGroup definition which contains all the minimum required properties for the resource * to be created, but also allows for any other optional properties to be specified. */ interface WithCreate extends DefinitionStages.<API key>, DefinitionStages.<API key>, DefinitionStages.<API key>, DefinitionStages.<API key>, DefinitionStages.WithImportance, DefinitionStages.<API key> { /** * Executes the create request. * * @return the created resource. */ WorkloadGroup create(); /** * Executes the create request. * * @param context The context to associate with this operation. * @return the created resource. */ WorkloadGroup create(Context context); } /** The stage of the WorkloadGroup definition allowing to specify minResourcePercent. */ interface <API key> { /** * Specifies the minResourcePercent property: The workload group minimum percentage resource.. * * @param minResourcePercent The workload group minimum percentage resource. * @return the next definition stage. */ WithCreate <API key>(int minResourcePercent); } /** The stage of the WorkloadGroup definition allowing to specify maxResourcePercent. */ interface <API key> { /** * Specifies the maxResourcePercent property: The workload group cap percentage resource.. * * @param maxResourcePercent The workload group cap percentage resource. * @return the next definition stage. */ WithCreate <API key>(int maxResourcePercent); } /** The stage of the WorkloadGroup definition allowing to specify <API key>. */ interface <API key> { /** * Specifies the <API key> property: The workload group request minimum grant * percentage.. * * @param <API key> The workload group request minimum grant percentage. * @return the next definition stage. */ WithCreate <API key>(double <API key>); } /** The stage of the WorkloadGroup definition allowing to specify <API key>. */ interface <API key> { /** * Specifies the <API key> property: The workload group request maximum grant * percentage.. * * @param <API key> The workload group request maximum grant percentage. * @return the next definition stage. */ WithCreate <API key>(Double <API key>); } /** The stage of the WorkloadGroup definition allowing to specify importance. */ interface WithImportance { /** * Specifies the importance property: The workload group importance level.. * * @param importance The workload group importance level. * @return the next definition stage. */ WithCreate withImportance(String importance); } /** The stage of the WorkloadGroup definition allowing to specify <API key>. */ interface <API key> { /** * Specifies the <API key> property: The workload group query execution timeout.. * * @param <API key> The workload group query execution timeout. * @return the next definition stage. */ WithCreate <API key>(Integer <API key>); } } /** * Begins update for the WorkloadGroup resource. * * @return the stage of resource update. */ WorkloadGroup.Update update(); /** The template for WorkloadGroup update. */ interface Update extends UpdateStages.<API key>, UpdateStages.<API key>, UpdateStages.<API key>, UpdateStages.<API key>, UpdateStages.WithImportance, UpdateStages.<API key> { /** * Executes the update request. * * @return the updated resource. */ WorkloadGroup apply(); /** * Executes the update request. * * @param context The context to associate with this operation. * @return the updated resource. */ WorkloadGroup apply(Context context); } /** The WorkloadGroup update stages. */ interface UpdateStages { /** The stage of the WorkloadGroup update allowing to specify minResourcePercent. */ interface <API key> { /** * Specifies the minResourcePercent property: The workload group minimum percentage resource.. * * @param minResourcePercent The workload group minimum percentage resource. * @return the next definition stage. */ Update <API key>(int minResourcePercent); } /** The stage of the WorkloadGroup update allowing to specify maxResourcePercent. */ interface <API key> { /** * Specifies the maxResourcePercent property: The workload group cap percentage resource.. * * @param maxResourcePercent The workload group cap percentage resource. * @return the next definition stage. */ Update <API key>(int maxResourcePercent); } /** The stage of the WorkloadGroup update allowing to specify <API key>. */ interface <API key> { /** * Specifies the <API key> property: The workload group request minimum grant * percentage.. * * @param <API key> The workload group request minimum grant percentage. * @return the next definition stage. */ Update <API key>(double <API key>); } /** The stage of the WorkloadGroup update allowing to specify <API key>. */ interface <API key> { /** * Specifies the <API key> property: The workload group request maximum grant * percentage.. * * @param <API key> The workload group request maximum grant percentage. * @return the next definition stage. */ Update <API key>(Double <API key>); } /** The stage of the WorkloadGroup update allowing to specify importance. */ interface WithImportance { /** * Specifies the importance property: The workload group importance level.. * * @param importance The workload group importance level. * @return the next definition stage. */ Update withImportance(String importance); } /** The stage of the WorkloadGroup update allowing to specify <API key>. */ interface <API key> { /** * Specifies the <API key> property: The workload group query execution timeout.. * * @param <API key> The workload group query execution timeout. * @return the next definition stage. */ Update <API key>(Integer <API key>); } } /** * Refreshes the resource to sync with Azure. * * @return the refreshed resource. */ WorkloadGroup refresh(); /** * Refreshes the resource to sync with Azure. * * @param context The context to associate with this operation. * @return the refreshed resource. */ WorkloadGroup refresh(Context context); }
#include "config/ConfigurationMode.h" using namespace ohmcomm; ConfigurationMode::ConfigurationMode() : audioConfig( {0} ), networkConfig( {0} ), processorNames(std::vector<std::string>(0)) { } ConfigurationMode::~ConfigurationMode() { } const std::pair<std::string, bool> ConfigurationMode::<API key>() const { if(!isConfigured()) { throw std::runtime_error("Configuration was not finished!"); } return std::make_pair(audioHandlerName, !<API key>); } const AudioConfiguration ConfigurationMode::<API key>() const { if(!isConfigured()) { throw std::runtime_error("Configuration was not finished!"); } return audioConfig; } const <API key> ConfigurationMode::<API key>() const { if(!isConfigured()) { throw std::runtime_error("Configuration was not finished!"); } return networkConfig; } const <API key> ConfigurationMode::<API key>() const { if(!isConfigured()) { throw std::runtime_error("Configuration was not finished!"); } <API key> rtcpConfig; rtcpConfig.localPort = networkConfig.localPort+1; rtcpConfig.remoteIPAddress = networkConfig.remoteIPAddress; rtcpConfig.remotePort = networkConfig.remotePort+1; return rtcpConfig; } bool ConfigurationMode::isConfigured() const { return isConfigurationDone; } bool ConfigurationMode::<API key>(std::vector<std::string>& processorNames) const { if(!isConfigured()) { throw std::runtime_error("Configuration was not finished!"); } processorNames.reserve(this->processorNames.size()); for(const std::string& procName : this->processorNames) { processorNames.push_back(procName); } return profileProcessors; } const std::pair<bool, std::string> ConfigurationMode::<API key>() const { if(!isConfigured()) { throw std::runtime_error("Configuration was not finished!"); } return std::pair<bool, std::string>(logToFile, logFileName); } short ConfigurationMode::getPayloadType() const { return payloadType; } void ConfigurationMode::<API key>(const AudioConfiguration& audioConfig) { this->audioConfig = audioConfig; } void ConfigurationMode::<API key>() { networkConfig.remoteIPAddress = "127.0.0.1"; networkConfig.localPort = <API key>; networkConfig.remotePort = <API key>; }
#include "KinectGrabberMSW.h" KinectGrabberMSW::KinectGrabberMSW(wxEvtHandler * handler, size_t deviceIndex) : KinectGrabberBase(handler) , m_DeviceIndex(deviceIndex) , m_Instance(NULL) { m_DepthBuffer = <API key>(); m_ColorBuffer = <API key>(); ResetEvents(); do { if(FAILED(<API key>( (int)m_DeviceIndex, &m_Instance))) break; if(FAILED(m_Instance->NuiInitialize( <API key> | <API key> | <API key>))) break; } while(false); } KinectGrabberMSW::~KinectGrabberMSW() { StopThread(); FreeDataBuffer(m_DepthBuffer); FreeDataBuffer(m_ColorBuffer); if(m_Instance) { m_Instance->NuiShutdown(); m_Instance->Release(); m_Instance = NULL; } } void KinectGrabberMSW::ResetEvents() { <API key> = NULL; <API key> = NULL; <API key> = NULL; } bool KinectGrabberMSW::CopyLocalBuffer(BYTE * src, BYTE * dst, size_t count) { do { if(!src) break; memcpy(dst, src, count); return true; } while(false); return false; } bool KinectGrabberMSW::GrabDepthFrame(unsigned char * data) { return CopyLocalBuffer(m_DepthBuffer, data, <API key>()); } bool KinectGrabberMSW::GrabColorFrame(unsigned char * data) { return CopyLocalBuffer(m_ColorBuffer, data, <API key>()); } kinect_data::SkeletonFrame * KinectGrabberMSW::GrabSkeletonFrame() { do { if(!GetThread() || !GetThread()->IsAlive() || !m_Instance || !<API key>) break; return &m_SkeletonFrame; } while(false); return NULL; } bool KinectGrabberMSW::Start() { do { if(!m_Instance) break; if(GetThread() && GetThread()->IsAlive()) break; if(CreateThread() != wxTHREAD_NO_ERROR) break; <API key> = CreateEvent( NULL, TRUE, FALSE, NULL ); <API key> = CreateEvent( NULL, TRUE, FALSE, NULL ); <API key> = CreateEvent( NULL, TRUE, FALSE, NULL ); if(FAILED(m_Instance->NuiImageStreamOpen( <API key>, <API key>, 0, //<API key>, 0, 3, <API key>, &m_DepthStreamHandle))) break; if(FAILED(m_Instance->NuiImageStreamOpen( <API key>, <API key>, 0, 4, <API key>, &m_ColorStreamHandle))) break; if(FAILED(m_Instance-><API key>( <API key>, 0))) break; GetThread()->Run(); return true; } while(false); return false; } bool KinectGrabberMSW::Stop() { do { StopThread(); memset(m_DepthBuffer, 0, <API key>()); memset(m_ColorBuffer, 0, <API key>()); CloseHandle(<API key>); CloseHandle(<API key>); CloseHandle(<API key>); ResetEvents(); return true; } while(false); return false; } bool KinectGrabberMSW::IsStarted() { return GetThread() != NULL && GetThread()->IsAlive(); } wxThread::ExitCode KinectGrabberMSW::Entry() { HANDLE eventHandles[3]; eventHandles[0] = <API key>; eventHandles[1] = <API key>; eventHandles[2] = <API key>; while(!GetThread()->TestDestroy()) { int mEventIndex = <API key>( _countof(eventHandles), eventHandles, FALSE, 100); switch(mEventIndex) { case 0: ReadDepthFrame(); break; case 1: ReadColorFrame(); break; case 2: ReadSkeletonFrame(); break; default: break; } } return NULL; } BYTE * KinectGrabberMSW::<API key>() { size_t length = <API key>(); BYTE * result = (BYTE*)CoTaskMemAlloc(length); memset(result, 0, length); return result; } BYTE * KinectGrabberMSW::<API key>() { size_t length = <API key>(); BYTE * result = (BYTE*)CoTaskMemAlloc(length); memset(result, 0, length); return result; } size_t KinectGrabberMSW::<API key>() { return m_DepthFrameSize.GetWidth() * m_DepthFrameSize.GetHeight() * 3; } size_t KinectGrabberMSW::<API key>() { return m_ColorFrameSize.GetWidth() * m_ColorFrameSize.GetHeight() * 3; } void KinectGrabberMSW::FreeDataBuffer(BYTE * data) { CoTaskMemFree((LPVOID)data); } void KinectGrabberMSW::StopThread() { if(GetThread()) { if(GetThread()->IsAlive()) { GetThread()->Delete(); } if(m_kind == wxTHREAD_JOINABLE) { if(GetThread()->IsAlive()) { GetThread()->Wait(); } wxDELETE(m_thread); } else { m_thread = NULL; } } wxYield(); } bool KinectGrabberMSW::ReadDepthFrame() { do { if(m_DeviceIndex < 0 || !m_Instance) break; const NUI_IMAGE_FRAME * pImageFrame; if(FAILED(<API key>( m_DepthStreamHandle, 200, &pImageFrame))) break; INuiFrameTexture * pTexture = pImageFrame->pFrameTexture; NUI_LOCKED_RECT LockedRect; pTexture->LockRect( 0, &LockedRect, NULL, 0 ); ReadDepthLockedRect(LockedRect, m_DepthFrameSize.GetWidth(), m_DepthFrameSize.GetHeight(), m_DepthBuffer); <API key>(m_DepthStreamHandle, pImageFrame); if(m_Handler) { wxCommandEvent e(<API key>, wxID_ANY); e.SetInt(m_DeviceIndex); m_Handler->AddPendingEvent(e); } return true; } while(false); return false; } bool KinectGrabberMSW::ReadColorFrame() { do { if(m_DeviceIndex < 0 || !m_Instance) break; const NUI_IMAGE_FRAME * pImageFrame; if(FAILED(<API key>( m_ColorStreamHandle, 200, &pImageFrame))) break; INuiFrameTexture * pTexture = pImageFrame->pFrameTexture; NUI_LOCKED_RECT LockedRect; pTexture->LockRect( 0, &LockedRect, NULL, 0 ); ReadColorLockedRect(LockedRect, m_ColorFrameSize.GetWidth(), m_ColorFrameSize.GetHeight(), m_ColorBuffer); <API key>(m_ColorStreamHandle, pImageFrame); if(m_Handler) { wxCommandEvent e(<API key>, wxID_ANY); e.SetInt(m_DeviceIndex); m_Handler->AddPendingEvent(e); } return true; } while(false); return false; } bool KinectGrabberMSW::ReadSkeletonFrame() { do { if(m_DeviceIndex < 0 || !m_Instance) break; NUI_SKELETON_FRAME skeletonFrame; if(FAILED(m_Instance-><API key>( 200, &skeletonFrame))) break; bool bFoundSkeleton = false; for ( int i = 0 ; i < NUI_SKELETON_COUNT ; i++ ) { if( skeletonFrame.SkeletonData[i].eTrackingState == <API key> || (skeletonFrame.SkeletonData[i].eTrackingState == <API key>)) { bFoundSkeleton = true; } } // no skeletons! if( !bFoundSkeleton ) { break; } // smooth out the skeleton data if ( FAILED(m_Instance->NuiTransformSmooth(&skeletonFrame,NULL))) { break; } ConvertFrame(skeletonFrame); if(m_Handler) { wxCommandEvent e(<API key>, wxID_ANY); e.SetInt(m_DeviceIndex); m_Handler->AddPendingEvent(e); } return true; } while(false); return false; } void KinectGrabberMSW::ConvertFrame(NUI_SKELETON_FRAME& skeletonFrame) { m_SkeletonFrame.dwFlags = skeletonFrame.dwFlags; m_SkeletonFrame.dwFrameNumber = skeletonFrame.dwFrameNumber; m_SkeletonFrame.liTimeStamp = skeletonFrame.liTimeStamp.QuadPart; m_SkeletonFrame.vFloorClipPlane.x = skeletonFrame.vFloorClipPlane.x; m_SkeletonFrame.vNormalToGravity.x = skeletonFrame.vNormalToGravity.x; m_SkeletonFrame.vFloorClipPlane.y = skeletonFrame.vFloorClipPlane.y; m_SkeletonFrame.vNormalToGravity.y = skeletonFrame.vNormalToGravity.y; m_SkeletonFrame.vFloorClipPlane.z = skeletonFrame.vFloorClipPlane.z; m_SkeletonFrame.vNormalToGravity.z = skeletonFrame.vNormalToGravity.z; m_SkeletonFrame.vFloorClipPlane.w = skeletonFrame.vFloorClipPlane.w; m_SkeletonFrame.vNormalToGravity.w = skeletonFrame.vNormalToGravity.w; for(int i = 0; i < NUI_SKELETON_COUNT; ++i) { kinect_data::SkeletonDataType& sd(m_SkeletonFrame.SkeletonData[i]); NUI_SKELETON_DATA sd_origin(skeletonFrame.SkeletonData[i]); sd.<API key> = sd_origin.dwEnrollmentIndex; sd.dwQualityFlags = sd_origin.dwQualityFlags; sd.dwTrackingID = sd_origin.dwTrackingID; sd.dwUserIndex = sd_origin.dwUserIndex; sd.eTrackingState = (kinect_data::<API key>)sd_origin.eTrackingState; for(int j = 0; j < <API key>; ++j) { sd.<API key>[j] = (kinect_data::<API key>)sd_origin.<API key>[j]; } sd.Position.x = sd_origin.Position.x; sd.Position.y = sd_origin.Position.y; sd.Position.z = sd_origin.Position.z; sd.Position.w = sd_origin.Position.w; for(int k = 0; k < <API key>; ++k){ sd.SkeletonPositions[k].x = sd_origin.SkeletonPositions[k].x; sd.SkeletonPositions[k].y = sd_origin.SkeletonPositions[k].y; sd.SkeletonPositions[k].z = sd_origin.SkeletonPositions[k].z; sd.SkeletonPositions[k].w = sd_origin.SkeletonPositions[k].w; } } } void KinectGrabberMSW::ReadDepthLockedRect(NUI_LOCKED_RECT & LockedRect, int w, int h, BYTE * data) { if( LockedRect.Pitch != 0 ) { BYTE * pBuffer = (BYTE*) LockedRect.pBits; USHORT * pBufferRun = (USHORT*) pBuffer; for( int y = 0 ; y < h ; y++ ) { for( int x = 0 ; x < w ; x++ ) { int offset = (w * y + x) * 3; data[offset + 0] = *pBufferRun >> 3 & 0xff; data[offset + 1] = *pBufferRun >> 11 & 0xf; data[offset + 2] = 0; pBufferRun++; } } } } void KinectGrabberMSW::ReadColorLockedRect(NUI_LOCKED_RECT & LockedRect, int w, int h, BYTE * data) { if( LockedRect.Pitch != 0 ) { BYTE * pBuffer = (BYTE*) LockedRect.pBits; for( int y = 0 ; y < h ; y++ ) { for( int x = 0 ; x < w ; x++ ) { RGBQUAD * quad = ((RGBQUAD*)pBuffer) + x; int offset = (w * y + x) * 3; data[offset + 0] = quad->rgbRed; data[offset + 1] = quad->rgbGreen; data[offset + 2] = quad->rgbBlue; } pBuffer += LockedRect.Pitch; } } } RGBQUAD KinectGrabberMSW::<API key>( USHORT s ) { USHORT RealDepth = (s & 0xfff8) >> 3; BYTE l = 255 - (BYTE)(256*RealDepth/0x0fff); l = RealDepth == 0 ? 0 : l; RGBQUAD q; q.rgbRed = q.rgbBlue = q.rgbGreen = l; return q; }
import { Injector } from '@angular/core'; import { Resource, RestService } from 'ng2-rest-service'; import { Config } from '../config/config'; @Resource({ baseUrl(): string { return this.config.apiEndpoint; }, headers: { 'Accept': 'application/json' } }) export abstract class <API key> extends RestService { constructor( injector: Injector, private config: Config ) { super(injector); } }
<!DOCTYPE html> <html> <head> <title>Demo Snippets 004</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"> <link rel="stylesheet" media="all" href="../docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <ul id="jump_to"> <li> <a class="large" href="javascript:void(0);">Jump To &hellip;</a> <a class="small" href="javascript:void(0);">+</a> <div id="jump_wrapper"> <div id="jump_page_wrapper"> <div id="jump_page"> <a class="source" href="canvas-001.html"> ./demo/canvas-001.js </a> <a class="source" href="canvas-002.html"> ./demo/canvas-002.js </a> <a class="source" href="canvas-003.html"> ./demo/canvas-003.js </a> <a class="source" href="canvas-004.html"> ./demo/canvas-004.js </a> <a class="source" href="canvas-005.html"> ./demo/canvas-005.js </a> <a class="source" href="canvas-006.html"> ./demo/canvas-006.js </a> <a class="source" href="canvas-007.html"> ./demo/canvas-007.js </a> <a class="source" href="canvas-008.html"> ./demo/canvas-008.js </a> <a class="source" href="canvas-009.html"> ./demo/canvas-009.js </a> <a class="source" href="canvas-010.html"> ./demo/canvas-010.js </a> <a class="source" href="canvas-011.html"> ./demo/canvas-011.js </a> <a class="source" href="canvas-012.html"> ./demo/canvas-012.js </a> <a class="source" href="canvas-013.html"> ./demo/canvas-013.js </a> <a class="source" href="canvas-014.html"> ./demo/canvas-014.js </a> <a class="source" href="canvas-015.html"> ./demo/canvas-015.js </a> <a class="source" href="canvas-015a.html"> ./demo/canvas-015a.js </a> <a class="source" href="canvas-016.html"> ./demo/canvas-016.js </a> <a class="source" href="canvas-017.html"> ./demo/canvas-017.js </a> <a class="source" href="canvas-018.html"> ./demo/canvas-018.js </a> <a class="source" href="canvas-019.html"> ./demo/canvas-019.js </a> <a class="source" href="canvas-019a.html"> ./demo/canvas-019a.js </a> <a class="source" href="canvas-020.html"> ./demo/canvas-020.js </a> <a class="source" href="canvas-021.html"> ./demo/canvas-021.js </a> <a class="source" href="canvas-022.html"> ./demo/canvas-022.js </a> <a class="source" href="canvas-023.html"> ./demo/canvas-023.js </a> <a class="source" href="canvas-024.html"> ./demo/canvas-024.js </a> <a class="source" href="canvas-025.html"> ./demo/canvas-025.js </a> <a class="source" href="canvas-026.html"> ./demo/canvas-026.js </a> <a class="source" href="canvas-027.html"> ./demo/canvas-027.js </a> <a class="source" href="canvas-028.html"> ./demo/canvas-028.js </a> <a class="source" href="canvas-029.html"> ./demo/canvas-029.js </a> <a class="source" href="canvas-030.html"> ./demo/canvas-030.js </a> <a class="source" href="canvas-031.html"> ./demo/canvas-031.js </a> <a class="source" href="canvas-032.html"> ./demo/canvas-032.js </a> <a class="source" href="canvas-033.html"> ./demo/canvas-033.js </a> <a class="source" href="canvas-034.html"> ./demo/canvas-034.js </a> <a class="source" href="canvas-035.html"> ./demo/canvas-035.js </a> <a class="source" href="canvas-036.html"> ./demo/canvas-036.js </a> <a class="source" href="canvas-037.html"> ./demo/canvas-037.js </a> <a class="source" href="canvas-038.html"> ./demo/canvas-038.js </a> <a class="source" href="canvas-039.html"> ./demo/canvas-039.js </a> <a class="source" href="canvas-040.html"> ./demo/canvas-040.js </a> <a class="source" href="canvas-041.html"> ./demo/canvas-041.js </a> <a class="source" href="canvas-042.html"> ./demo/canvas-042.js </a> <a class="source" href="canvas-043.html"> ./demo/canvas-043.js </a> <a class="source" href="canvas-044.html"> ./demo/canvas-044.js </a> <a class="source" href="canvas-045.html"> ./demo/canvas-045.js </a> <a class="source" href="canvas-046.html"> ./demo/canvas-046.js </a> <a class="source" href="canvas-047.html"> ./demo/canvas-047.js </a> <a class="source" href="canvas-048.html"> ./demo/canvas-048.js </a> <a class="source" href="canvas-049.html"> ./demo/canvas-049.js </a> <a class="source" href="canvas-050.html"> ./demo/canvas-050.js </a> <a class="source" href="canvas-051.html"> ./demo/canvas-051.js </a> <a class="source" href="canvas-052.html"> ./demo/canvas-052.js </a> <a class="source" href="canvas-053.html"> ./demo/canvas-053.js </a> <a class="source" href="canvas-054.html"> ./demo/canvas-054.js </a> <a class="source" href="canvas-055.html"> ./demo/canvas-055.js </a> <a class="source" href="canvas-056.html"> ./demo/canvas-056.js </a> <a class="source" href="canvas-057.html"> ./demo/canvas-057.js </a> <a class="source" href="canvas-058.html"> ./demo/canvas-058.js </a> <a class="source" href="canvas-059.html"> ./demo/canvas-059.js </a> <a class="source" href="canvas-060.html"> ./demo/canvas-060.js </a> <a class="source" href="canvas-061.html"> ./demo/canvas-061.js </a> <a class="source" href="canvas-062.html"> ./demo/canvas-062.js </a> <a class="source" href="core-001.html"> ./demo/core-001.js </a> <a class="source" href="delaunator-001.html"> ./demo/delaunator-001.js </a> <a class="source" href="delaunator-002.html"> ./demo/delaunator-002.js </a> <a class="source" href="dom-001.html"> ./demo/dom-001.js </a> <a class="source" href="dom-002.html"> ./demo/dom-002.js </a> <a class="source" href="dom-003.html"> ./demo/dom-003.js </a> <a class="source" href="dom-004.html"> ./demo/dom-004.js </a> <a class="source" href="dom-005.html"> ./demo/dom-005.js </a> <a class="source" href="dom-006.html"> ./demo/dom-006.js </a> <a class="source" href="dom-007.html"> ./demo/dom-007.js </a> <a class="source" href="dom-008.html"> ./demo/dom-008.js </a> <a class="source" href="dom-009.html"> ./demo/dom-009.js </a> <a class="source" href="dom-010.html"> ./demo/dom-010.js </a> <a class="source" href="dom-011.html"> ./demo/dom-011.js </a> <a class="source" href="dom-012.html"> ./demo/dom-012.js </a> <a class="source" href="dom-013.html"> ./demo/dom-013.js </a> <a class="source" href="dom-015.html"> ./demo/dom-015.js </a> <a class="source" href="dom-016.html"> ./demo/dom-016.js </a> <a class="source" href="filters-001.html"> ./demo/filters-001.js </a> <a class="source" href="filters-002.html"> ./demo/filters-002.js </a> <a class="source" href="filters-002a.html"> ./demo/filters-002a.js </a> <a class="source" href="filters-003.html"> ./demo/filters-003.js </a> <a class="source" href="filters-004.html"> ./demo/filters-004.js </a> <a class="source" href="filters-005.html"> ./demo/filters-005.js </a> <a class="source" href="filters-006.html"> ./demo/filters-006.js </a> <a class="source" href="filters-007.html"> ./demo/filters-007.js </a> <a class="source" href="filters-008.html"> ./demo/filters-008.js </a> <a class="source" href="filters-009.html"> ./demo/filters-009.js </a> <a class="source" href="filters-010.html"> ./demo/filters-010.js </a> <a class="source" href="filters-011.html"> ./demo/filters-011.js </a> <a class="source" href="filters-012.html"> ./demo/filters-012.js </a> <a class="source" href="filters-013.html"> ./demo/filters-013.js </a> <a class="source" href="filters-014.html"> ./demo/filters-014.js </a> <a class="source" href="filters-015.html"> ./demo/filters-015.js </a> <a class="source" href="filters-016.html"> ./demo/filters-016.js </a> <a class="source" href="filters-017.html"> ./demo/filters-017.js </a> <a class="source" href="filters-018.html"> ./demo/filters-018.js </a> <a class="source" href="filters-019.html"> ./demo/filters-019.js </a> <a class="source" href="filters-020.html"> ./demo/filters-020.js </a> <a class="source" href="filters-021.html"> ./demo/filters-021.js </a> <a class="source" href="filters-022.html"> ./demo/filters-022.js </a> <a class="source" href="filters-023.html"> ./demo/filters-023.js </a> <a class="source" href="filters-024.html"> ./demo/filters-024.js </a> <a class="source" href="filters-025.html"> ./demo/filters-025.js </a> <a class="source" href="filters-026.html"> ./demo/filters-026.js </a> <a class="source" href="filters-027.html"> ./demo/filters-027.js </a> <a class="source" href="filters-501.html"> ./demo/filters-501.js </a> <a class="source" href="filters-502.html"> ./demo/filters-502.js </a> <a class="source" href="filters-503.html"> ./demo/filters-503.js </a> <a class="source" href="filters-504.html"> ./demo/filters-504.js </a> <a class="source" href="filters-505.html"> ./demo/filters-505.js </a> <a class="source" href="mediapipe-001.html"> ./demo/mediapipe-001.js </a> <a class="source" href="mediapipe-002.html"> ./demo/mediapipe-002.js </a> <a class="source" href="mediapipe-003.html"> ./demo/mediapipe-003.js </a> <a class="source" href="modules-001.html"> ./demo/modules-001.js </a> <a class="source" href="modules-002.html"> ./demo/modules-002.js </a> <a class="source" href="modules-003.html"> ./demo/modules-003.js </a> <a class="source" href="modules-004.html"> ./demo/modules-004.js </a> <a class="source" href="packets-001.html"> ./demo/packets-001.js </a> <a class="source" href="packets-002.html"> ./demo/packets-002.js </a> <a class="source" href="particles-001.html"> ./demo/particles-001.js </a> <a class="source" href="particles-002.html"> ./demo/particles-002.js </a> <a class="source" href="particles-003.html"> ./demo/particles-003.js </a> <a class="source" href="particles-004.html"> ./demo/particles-004.js </a> <a class="source" href="particles-005.html"> ./demo/particles-005.js </a> <a class="source" href="particles-006.html"> ./demo/particles-006.js </a> <a class="source" href="particles-007.html"> ./demo/particles-007.js </a> <a class="source" href="particles-008.html"> ./demo/particles-008.js </a> <a class="source" href="particles-009.html"> ./demo/particles-009.js </a> <a class="source" href="particles-010.html"> ./demo/particles-010.js </a> <a class="source" href="particles-011.html"> ./demo/particles-011.js </a> <a class="source" href="particles-012.html"> ./demo/particles-012.js </a> <a class="source" href="particles-013.html"> ./demo/particles-013.js </a> <a class="source" href="particles-014.html"> ./demo/particles-014.js </a> <a class="source" href="particles-015.html"> ./demo/particles-015.js </a> <a class="source" href="particles-016.html"> ./demo/particles-016.js </a> <a class="source" href="rapier-001.html"> ./demo/rapier-001.js </a> <a class="source" href="snippets-001.html"> ./demo/snippets-001.js </a> <a class="source" href="snippets-002.html"> ./demo/snippets-002.js </a> <a class="source" href="snippets-003.html"> ./demo/snippets-003.js </a> <a class="source" href="snippets-004.html"> ./demo/snippets-004.js </a> <a class="source" href="snippets-005.html"> ./demo/snippets-005.js </a> <a class="source" href="temp-000.html"> ./demo/temp-000.js </a> <a class="source" href="temp-001.html"> ./demo/temp-001.js </a> <a class="source" href="temp-001a.html"> ./demo/temp-001a.js </a> <a class="source" href="temp-002.html"> ./demo/temp-002.js </a> <a class="source" href="temp-003.html"> ./demo/temp-003.js </a> <a class="source" href="temp-004.html"> ./demo/temp-004.js </a> <a class="source" href="temp-005.html"> ./demo/temp-005.js </a> <a class="source" href="temp-006.html"> ./demo/temp-006.js </a> <a class="source" href="temp-007.html"> ./demo/temp-007.js </a> <a class="source" href="temp-008.html"> ./demo/temp-008.js </a> <a class="source" href="temp-009.html"> ./demo/temp-009.js </a> <a class="source" href="temp-010.html"> ./demo/temp-010.js </a> <a class="source" href="temp-011.html"> ./demo/temp-011.js </a> <a class="source" href="temp-012.html"> ./demo/temp-012.js </a> <a class="source" href="temp-013.html"> ./demo/temp-013.js </a> <a class="source" href="temp-014.html"> ./demo/temp-014.js </a> <a class="source" href="temp-015.html"> ./demo/temp-015.js </a> <a class="source" href="temp-016.html"> ./demo/temp-016.js </a> <a class="source" href="temp-017.html"> ./demo/temp-017.js </a> <a class="source" href="temp-018.html"> ./demo/temp-018.js </a> <a class="source" href="temp-018a.html"> ./demo/temp-018a.js </a> <a class="source" href="temp-019.html"> ./demo/temp-019.js </a> <a class="source" href="temp-020.html"> ./demo/temp-020.js </a> <a class="source" href="temp-021.html"> ./demo/temp-021.js </a> <a class="source" href="temp-022.html"> ./demo/temp-022.js </a> <a class="source" href="temp-023.html"> ./demo/temp-023.js </a> <a class="source" href="temp-024.html"> ./demo/temp-024.js </a> <a class="source" href="temp-025.html"> ./demo/temp-025.js </a> <a class="source" href="temp-026.html"> ./demo/temp-026.js </a> <a class="source" href="temp-027.html"> ./demo/temp-027.js </a> <a class="source" href="temp-028.html"> ./demo/temp-028.js </a> <a class="source" href="temp-029.html"> ./demo/temp-029.js </a> <a class="source" href="temp-030.html"> ./demo/temp-030.js </a> <a class="source" href="temp-031.html"> ./demo/temp-031.js </a> <a class="source" href="temp-032.html"> ./demo/temp-032.js </a> <a class="source" href="temp-033.html"> ./demo/temp-033.js </a> <a class="source" href="temp-034.html"> ./demo/temp-034.js </a> <a class="source" href="temp-035.html"> ./demo/temp-035.js </a> <a class="source" href="temp-036.html"> ./demo/temp-036.js </a> <a class="source" href="temp-100.html"> ./demo/temp-100.js </a> <a class="source" href="temp-101.html"> ./demo/temp-101.js </a> <a class="source" href="temp-102.html"> ./demo/temp-102.js </a> <a class="source" href="temp-103.html"> ./demo/temp-103.js </a> <a class="source" href="temp-104.html"> ./demo/temp-104.js </a> <a class="source" href="<API key>.html"> ./demo/<API key>.js </a> <a class="source" href="temp-lottie.html"> ./demo/temp-lottie.js </a> <a class="source" href="tensorflow-001.html"> ./demo/tensorflow-001.js </a> <a class="source" href="tensorflow-002.html"> ./demo/tensorflow-002.js </a> <a class="source" href="utilities.html"> ./demo/utilities.js </a> </div> </div> </li> </ul> <ul class="sections"> <li id="section-1"> <div class="annotation"> <div class="sswrap "> <a class="ss" href="#section-1">&#x00a7;</a> </div> <h1 id="demo-snippets-004">Demo Snippets 004</h1> <p>Snippets included in the Scrawl-canvas Demo folder</p> <p>Related files:</p> <ul> <li><a href="./snippets/<API key>.html">Ripple effect snippet</a></li> </ul> <p><a href="../../demo/snippets-004.html">Run code</a></p> </div> </li> <li id="section-2"> <div class="annotation"> <div class="sswrap "> <a class="ss" href="#section-2">&#x00a7;</a> </div> <p>Import snippets</p> </div> <div class="content"><div class='highlight'><pre><span class="hljs-keyword">import</span> rippleEffect <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;./snippets/<API key>.js&#x27;</span>; <span class="hljs-title function_">rippleEffect</span>(<span class="hljs-variable language_">document</span>.<span class="hljs-title function_">getElementById</span>(<span class="hljs-string">&#x27;ripple-01&#x27;</span>)); <span class="hljs-title function_">rippleEffect</span>(<span class="hljs-variable language_">document</span>.<span class="hljs-title function_">querySelector</span>(<span class="hljs-string">&#x27;#ripple-02&#x27;</span>)); <span class="hljs-title function_">rippleEffect</span>(<span class="hljs-variable language_">document</span>.<span class="hljs-title function_">querySelector</span>(<span class="hljs-string">&#x27;#ripple-04&#x27;</span>)); <span class="hljs-title function_">rippleEffect</span>(<span class="hljs-variable language_">document</span>.<span class="hljs-title function_">querySelector</span>(<span class="hljs-string">&#x27;#ripple-03&#x27;</span>), { <span class="hljs-attr">backgroundColor</span>: <span class="hljs-string">&#x27;rgb(255, 170, 170)&#x27;</span>, <span class="hljs-attr">rippleColor</span>: <span class="hljs-string">&#x27;rgb(255, 220, 220)&#x27;</span>, }); <span class="hljs-keyword">import</span> greenBox <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;./snippets/green-box-snippet.js&#x27;</span>; <span class="hljs-keyword">let</span> greenBoxElements = <span class="hljs-variable language_">document</span>.<span class="hljs-title function_">querySelectorAll</span>(<span class="hljs-string">&#x27;.green-box&#x27;</span>); greenBoxElements.<span class="hljs-title function_">forEach</span>(<span class="hljs-function"><span class="hljs-params">el</span> =&gt;</span> <span class="hljs-title function_">greenBox</span>(el)); <span class="hljs-keyword">import</span> jazzyButton <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;./snippets/<API key>.js&#x27;</span>; <span class="hljs-keyword">let</span> jazzyButtonElements = <span class="hljs-variable language_">document</span>.<span class="hljs-title function_">querySelectorAll</span>(<span class="hljs-string">&#x27;.jazzy-button&#x27;</span>); jazzyButtonElements.<span class="hljs-title function_">forEach</span>(<span class="hljs-function"><span class="hljs-params">el</span> =&gt;</span> <span class="hljs-title function_">jazzyButton</span>(el)); <span class="hljs-keyword">import</span> spotlight <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;./snippets/<API key>.js&#x27;</span>; <span class="hljs-title function_">spotlight</span>(<span class="hljs-variable language_">document</span>.<span class="hljs-title function_">querySelector</span>(<span class="hljs-string">&#x27;#spotlight-01&#x27;</span>)); <span class="hljs-title function_">spotlight</span>(<span class="hljs-variable language_">document</span>.<span class="hljs-title function_">querySelector</span>(<span class="hljs-string">&#x27;#spotlight-02&#x27;</span>), { <span class="hljs-attr">backgroundColor</span>: <span class="hljs-string">&#x27;gold&#x27;</span>, <span class="hljs-attr">spotlightColor</span>: <span class="hljs-string">&#x27;yellow&#x27;</span>, }); <span class="hljs-keyword">import</span> pagePerformance <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;./snippets/<API key>.js&#x27;</span>; <span class="hljs-keyword">let</span> performanceElements = <span class="hljs-variable language_">document</span>.<span class="hljs-title function_">querySelectorAll</span>(<span class="hljs-string">&#x27;.page-performance&#x27;</span>); performanceElements.<span class="hljs-title function_">forEach</span>(<span class="hljs-function"><span class="hljs-params">el</span> =&gt;</span> <span class="hljs-title function_">pagePerformance</span>(el)); <span class="hljs-keyword">import</span> placeholder <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;./snippets/<API key>.js&#x27;</span>; <span class="hljs-keyword">let</span> placeholderElements = <span class="hljs-variable language_">document</span>.<span class="hljs-title function_">querySelectorAll</span>(<span class="hljs-string">&#x27;.placeholder&#x27;</span>); placeholderElements.<span class="hljs-title function_">forEach</span>(<span class="hljs-function"><span class="hljs-params">el</span> =&gt;</span> <span class="hljs-title function_">placeholder</span>(el)); <span class="hljs-keyword">import</span> wordHighlighter <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;./snippets/<API key>.js&#x27;</span>; <span class="hljs-variable language_">document</span>.<span class="hljs-title function_">querySelectorAll</span>(<span class="hljs-string">&#x27;.default-highlighter&#x27;</span>).<span class="hljs-title function_">forEach</span>(<span class="hljs-function"><span class="hljs-params">el</span> =&gt;</span> <span class="hljs-title function_">wordHighlighter</span>(el)); <span class="hljs-variable language_">document</span>.<span class="hljs-title function_">querySelectorAll</span>(<span class="hljs-string">&#x27;.<API key>&#x27;</span>).<span class="hljs-title function_">forEach</span>(<span class="hljs-function"><span class="hljs-params">el</span> =&gt;</span> <span class="hljs-title function_">wordHighlighter</span>(el, { <span class="hljs-attr">highlightColor</span>: <span class="hljs-string">&#x27;orange&#x27;</span>, <span class="hljs-attr">thickness</span>: <span class="hljs-number">6</span>, })); <span class="hljs-keyword">import</span> <API key> <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;./snippets/<API key>.js&#x27;</span>; <span class="hljs-variable language_">document</span>.<span class="hljs-title function_">querySelectorAll</span>(<span class="hljs-string">&#x27;.<API key>&#x27;</span>).<span class="hljs-title function_">forEach</span>(<span class="hljs-function"><span class="hljs-params">el</span> =&gt;</span> <span class="hljs-title function_"><API key></span>(el)); <span class="hljs-keyword">import</span> <API key> <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;./snippets/<API key>.js&#x27;</span>; <span class="hljs-variable language_">document</span>.<span class="hljs-title function_">querySelectorAll</span>(<span class="hljs-string">&#x27;.<API key>&#x27;</span>).<span class="hljs-title function_">forEach</span>(<span class="hljs-function"><span class="hljs-params">el</span> =&gt;</span> <span class="hljs-title function_"><API key></span>(el)); <span class="hljs-keyword">import</span> panImage <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;./snippets/pan-image-snippet.js&#x27;</span>; <span class="hljs-variable language_">document</span>.<span class="hljs-title function_">querySelectorAll</span>(<span class="hljs-string">&#x27;.pan-image&#x27;</span>).<span class="hljs-title function_">forEach</span>(<span class="hljs-function"><span class="hljs-params">el</span> =&gt;</span> <span class="hljs-title function_">panImage</span>(el));</pre></div></div> </li> </ul> </div> </body> </html>
#! /usr/bin/env python3 import numpy as np import sys def _quad_coeffs_hq(M, collocation_type, digits=20): if M == 1: x = np.array([0.0]) w = np.array([2.0]) elif collocation_type == "gauss_legendre": from sympy.integrals.quadrature import gauss_legendre x, w = gauss_legendre(M, digits) elif collocation_type == "gauss_lobatto": from sympy.integrals.quadrature import gauss_lobatto x, w = gauss_lobatto(M, digits) elif collocation_type == "gauss_hermite": from sympy.integrals.quadrature import gauss_hermite x, w = gauss_hermite(M, 30) x = np.array(x, dtype=float) w = np.array(w, dtype=float) elif collocation_type == "gauss_jacobi": from sympy.integrals.quadrature import gauss_jacobi x, w = gauss_jacobi(M, 0, 0, 30) x = np.array(x, dtype=float) w = np.array(w, dtype=float) elif collocation_type == "gauss_chebyshev_u": from sympy.integrals.quadrature import gauss_chebyshev_u x, w = gauss_chebyshev_u(M, 30) x = np.array(x, dtype=float) w = np.array(w, dtype=float) elif collocation_type == "gauss_chebyshev_t": from sympy.integrals.quadrature import gauss_chebyshev_t x, w = gauss_chebyshev_t(M, 30) x = np.array(x, dtype=float) w = np.array(w, dtype=float) else: raise Exception("Unknown collocation method '"+str(collocation_type)+"'") assert len(x) == M return x, w def quad_coeffs(M, collocation_type): if M == 1: x = np.array([0.0]) w = np.array([2.0]) elif collocation_type == "equidistant": x = np.linspace(0, 1, M, endpoint=True) w = np.ones(M)/(M-1) w[0] *= 0.5 w[-1] *= 0.5 elif collocation_type == "geometric": x = np.zeros(M) for i in range(M x[i] = -(2.0**-(i+1)) x[M-1-i] = (2.0**-(i+1)) w = None elif collocation_type in ["gauss_legendre", "gauss_lobatto", "gauss_hermite", "gauss_jacobi", "gauss_chebyshev_u", "gauss_chebyshev_t"]: x, w = _quad_coeffs_hq(M, collocation_type, digits=20) x = np.array(x, dtype=float) w = np.array(w, dtype=float) elif collocation_type == "<API key>": p = np.linspace(0, 1, M, endpoint=True) x = -np.cos(np.pi*p) w = np.zeros(M, dtype=float) w[:] = 1.0/(M+1) w[0] *= 0.5 w[-1] *= 0.5 else: raise Exception("Unknown collocation method '"+str(collocation_type)+"'") assert len(x) == M return x, w
<section class="left-side animated fadeInLeftBig"> <h1 class="main-header">{{season}}<span>events</span></h1> <article class="blue-box"> <p>{{quotes[0].quote}}</p> <p>{{quotes[0].person}}</p> </article> <article class="event-block kingman-moonlight"> <img src="assets/logos/kingman-moonlight.png"> <div class="event-info"> <h2><%= data.winter.kingmanFarm.title %></h2> <h3><%= data.winter.kingmanFarm.date %></h3> <h3><%= data.winter.kingmanFarm.starttime %></h3> <h4><%= data.winter.kingmanFarm.address %></br> <%= data.winter.kingmanFarm.address2 %></br> <%= data.winter.kingmanFarm.city %>, <%= data.winter.kingmanFarm.state %></h4> <a href="<API key>/"><button>click here for details</button></a> <h5>Photo Courtesy of <%= data.winter.kingmanFarm.photographer %></h5> </div> </article> <article class="event-block snowshoe-hullaballo"> <img src="assets/logos/hullaballo.png"> <div class="event-info"> <h2><%= data.winter.snowshoeHullabaloo.title %></h2> <h3><%= data.winter.snowshoeHullabaloo.date %></h3> <h3><%= data.winter.snowshoeHullabaloo.starttime %></h3> <h4><%= data.winter.snowshoeHullabaloo.address %></br> <%= data.winter.snowshoeHullabaloo.address2 %></br> <%= data.winter.snowshoeHullabaloo.city %>, <%= data.winter.snowshoeHullabaloo.state %></h4> <a href="<API key>/"><button>click here for details</button></a> <h5>Photo Courtesy of <%= data.winter.snowshoeHullabaloo.photographer %></h5> </div> </article> <article class="event-block suunto"> <img src="assets/logos/sunnto.jpg"> <div class="event-info"> <h2><%= data.suunto.title %></h2> <h3><%= data.suunto.copy %></h3> </div> </article> </section> <section class="right-side animated fadeInRightBig"> <article class="event-block sidehiller-event"> <img src="assets/logos/sidehiller.jpg"> <div class="event-info"> <h2><%= data.winter.sidehillerSnowshoe.title %></h2> <h3><%= data.winter.sidehillerSnowshoe.date %></h3> <h3><%= data.winter.sidehillerSnowshoe.starttime %></h3> <h4><%= data.winter.sidehillerSnowshoe.address %></br> <%= data.winter.sidehillerSnowshoe.address2 %></br> <%= data.winter.sidehillerSnowshoe.city %>, <%= data.winter.sidehillerSnowshoe.state %></h4> <a href="<API key>/"><button>click here for details</button></a> <h5>Photo Courtesy of <%= data.winter.sidehillerSnowshoe.photographer %></h5> </div> </article> <article class="blue-box"> <p>{{quotes[1].quote}}</p> <p>{{quotes[1].person}}</p> </article> <article class="event-block <API key>"> <img src="assets/logos/gssc.jpg"> <div class="event-info"> <h2><%= data.winter.<API key>.title %></h2> <h3><%= data.winter.<API key>.date %></h3> <h3><%= data.winter.<API key>.starttime %></h3> <h4><%= data.winter.<API key>.address %></br> <%= data.winter.<API key>.address2 %></br> <%= data.winter.<API key>.city %>, <%= data.winter.<API key>.state %></h4> <a href="<API key>/"><button>click here for details</button></a> <h5>Photo Courtesy of <%= data.winter.<API key>.photographer %></h5> </div> </article> </section>
import Inferno from 'inferno'; import { Link } from 'weave-router'; import { Head, Title } from 'weave-head'; export default () => <div> <Head> <Title>Index page</Title> </Head> <Link href="/hello">Go to hello</Link> </div>
// @flow import render from '../../common/render' import App from '../../../webapp/ttd2/containers/App' export default (state: any, location: string, title: string, style: string) => render(App, state, location, 'ttd2', title, style)
<div> <Badge overlap="circle" /> <Badge overlap="rectangle" /> <Badge classes={{ <API key>: 'className', <API key>: 'className', <API key>: 'className', <API key>: 'className', <API key>: 'className', <API key>: 'className', <API key>: 'className', }} /> </div>
package no.uio.ifi.qure.relation; import java.util.List; import java.util.ArrayList; import java.util.Set; import java.util.HashSet; import java.util.Map; import java.util.HashMap; import java.util.Arrays; import no.uio.ifi.qure.Config; import no.uio.ifi.qure.util.*; import no.uio.ifi.qure.traversal.*; import no.uio.ifi.qure.space.*; public class PartOf extends AtomicRelation { private final int a0, a1, r0, r1; public PartOf(int r0, int r1, int a0, int a1) { this.a0 = a0; this.a1 = a1; this.r0 = r0; this.r1 = r1; } public int getArity() { return 2; } public Set<Integer> getArguments() { Set<Integer> res = new HashSet<Integer>(); res.add(a0); res.add(a1); return res; } public int getArg(int a) { if (a == 0) { return a0; } else { return a1; } } public Integer getArgRole(Integer pos) { return (pos.equals(a0)) ? r0 : r1; } public boolean relatesArg(int arg) { return a0 == arg || a1 == arg; } public String toString() { return "po(<" + r0 + "," + a0 + ">, <" + r1 + "," + a1 + ">)"; } public String toBTSQL(String[] vals, Config config) { if (vals[a0] != null && vals[a1] == null) { return toBTSQL2(vals, config); } else { return toBTSQL1(vals, config); } } private String toBTSQL1Approx(String[] vals, Config config) { String[] selFroWhe = <API key>(config.btTableName, config.uriColumn, vals); String query = " SELECT DISTINCT " + selFroWhe[0] + ", T" + a0 + ".block\n"; query += " FROM " + selFroWhe[1] + "\n"; query += " WHERE "; if (!selFroWhe[2].equals("")) query += selFroWhe[2] + " AND\n"; query += " T" + a0 + ".role & " + (1 | (r0 << 1)) + " != 0 AND\n"; if (r1 != 0) query += " T" + a1 + ".role & " + (r1 << 1) + " != 0 AND\n"; query += " T" + a0 + ".block > (T" + a1 + ".block & (T" + a1 + ".block-1)) AND\n"; query += " T" + a0 + ".block <= (T" + a1 + ".block | (T" + a1 + ".block-1))"; return query; } private String toBTSQL1(String[] vals, Config config) { String[] selFroWhe = <API key>(config.btTableName, config.uriColumn, vals); String query = "WITH \n"; query += "possible AS (\n" + toBTSQL1Approx(vals, config) + "),\n"; query += "posGids AS (SELECT DISTINCT v" + a0 + ", v" + a1 + " FROM possible),\n"; query += "posBlocks AS (SELECT DISTINCT block FROM possible),\n"; query += "rem AS (\n"; query += " SELECT DISTINCT v" + a0 + ", v" + a1 + "\n"; query += " FROM (SELECT DISTINCT " + selFroWhe[0] + ", T" + a0 + ".block\n"; query += " FROM " + selFroWhe[1] + ", posGids AS Pos\n"; query += " WHERE T" + a0 + ".role & " + (1 | (r0 << 1)) + " != 0 AND Pos.v" + a0 + " = T" + a0 + ".gid) AS AllBlocks\n"; query += " LEFT OUTER JOIN posBlocks Approx ON (AllBlocks.block = Approx.block)\n"; query += " WHERE Approx.block IS NULL)\n"; query += "SELECT DISTINCT P.v" + Math.min(a0,a1) + ", P.v" + Math.max(a0,a1) + "\n"; query += "FROM posGids AS P LEFT OUTER JOIN rem AS R ON (P.v" + a0 + " = R.v" + a0 + " AND P.v" + a1 + " = R.v" + a1 + ")\n"; query += "WHERE R.v" + a0 + " IS NULL"; return query; } private String toBTSQL2Approx(String[] vals, Config config) { String[] selFroWhe = <API key>(config.btTableName, config.uriColumn, vals); String query = " SELECT DISTINCT T" + a1 + "." + config.uriColumn + " AS v" + a1 + ", T" + a0 + ".block\n"; query += " FROM " + selFroWhe[1] + ",\n"; query += " (" + makeValuesFrom(config) + ") AS V(n)\n"; query += " WHERE "; if (!selFroWhe[2].equals("")) query += selFroWhe[2] + " AND\n"; query += " T" + a0 + ".role & " + (1 | (r0 << 1)) + " != 0 AND\n"; if (r1 != 0) query += " T" + a1 + ".role & " + (r1 << 1) + " != 0 AND\n"; query += " (T" + a0 + ".block = T" + a1 + ".block OR\n"; query += " (T" + a0 + ".block != T" + a0 + ".block & ~(V.n-1) AND\n"; query += " T" + a1 + ".block = ((T" + a0 + ".block & ~(V.n-1)) | V.n)))"; return query; } private String toBTSQL2(String[] vals, Config config) { String[] selFroWhe = <API key>(config.btTableName, config.uriColumn, vals); String query = "WITH \n"; query += " possible AS (\n" + toBTSQL2Approx(vals, config) + "),\n"; query += " posGids AS (SELECT DISTINCT v" + a1 + " FROM possible),\n"; query += " allBlocks AS (SELECT DISTINCT block FROM " + config.btTableName + " WHERE gid = " + vals[a0] + " AND role & " + (1 | r0) + " != 0),\n"; query += " rem AS (\n"; query += " SELECT DISTINCT v" + a1 + "\n"; query += " FROM posGids AS Pos,\n"; query += " allBlocks AS AB\n"; query += " WHERE (Pos.v" + a1 + ", AB.block) NOT IN (SELECT * FROM possible))\n"; if (a0 < a1) { query += "SELECT DISTINCT " + vals[a0] + " AS v" + a0 + ", P.v" + a1 + "\n"; } else { query += "SELECT DISTINCT P.v" + a1 + ", " + vals[a0] + " AS v" + a0 + "\n"; } query += "FROM posGids AS P LEFT OUTER JOIN rem AS R ON (P.v" + a1 + " = R.v" + a1 + ")\n"; query += "WHERE R.v" + a1 + " IS NULL"; return query; } public String toGeoSQL(String[] vals, Config config, SpaceProvider sp) { return sp.toSQL(this, vals, config); } public boolean isIntrinsic(Integer[] tuple) { return tuple[a0] == tuple[a1] && stricterRole(r0, r1); } public Set<Map<Integer, Integer>> impliesNonEmpty(AtomicRelation r) { if (r.getArity() > 2 || (r instanceof Before)) { return null; } Set<Map<Integer, Integer>> unifiers = new HashSet<Map<Integer, Integer>>(); if (r instanceof Overlaps) { Overlaps ovr = (Overlaps) r; if (ovr.getArity() == 1) { Integer oRole = Utils.unpackSingleton(ovr.getRoles()); if (stricterRole(r0, oRole)) { Map<Integer, Integer> unifier = new HashMap<Integer, Integer>(); unifier.put(a0, 0); unifiers.add(unifier); } if (stricterRole(r1, oRole)) { Map<Integer, Integer> unifier = new HashMap<Integer, Integer>(); unifier.put(a1, 0); unifiers.add(unifier); } } else { // First argument must overlap one of the arguments, and // second argument must contain the other argument. // We only add one unifier between partOf and Overlaps, but expand before eval if (strictnessRelated(r0, ovr.getArgRole(a0)) && stricterRole(r1, ovr.getArgRole(a1))) { Map<Integer, Integer> unifier = new HashMap<Integer, Integer>(); unifier.put(new Integer(a0), new Integer(a0)); unifier.put(new Integer(a1), new Integer(a1)); unifiers.add(unifier); } else if (strictnessRelated(r0, ovr.getArgRole(a1)) && stricterRole(r1, ovr.getArgRole(a0))) { Map<Integer, Integer> unifier = new HashMap<Integer, Integer>(); unifier.put(new Integer(a0), new Integer(a1)); unifier.put(new Integer(a1), new Integer(a0)); unifiers.add(unifier); } } } else { PartOf pr = (PartOf) r; // First argument must be less strict than r's first argument, and // second argument must be stricter than r's other argument. if (stricterRole(pr.r0, r0) && stricterRole(r1, pr.r1)) { Map<Integer, Integer> unifier = new HashMap<Integer, Integer>(); unifier.put(new Integer(a0), new Integer(pr.a0)); unifier.put(new Integer(a1), new Integer(pr.a1)); } } return (unifiers.isEmpty()) ? null : unifiers; } @Override public boolean equals(Object o) { if (!(o instanceof PartOf)) return false; PartOf opo = (PartOf) o; return a0 == opo.a0 && a1 == opo.a1 && r0 == opo.r0 && r1 == opo.r1; } @Override public int hashCode() { return (r0+a0) + 2*(r1+a1); } public boolean eval(Space[] spaceArgs) { return spaceArgs[a0].partOf(spaceArgs[a1]); } public Set<AtomicRelation> <API key>() { Set<AtomicRelation> rels = new HashSet<AtomicRelation>(); if (a0 == a1) { rels.add(new PartOf(r0, r1, 0, 0)); } else { rels.add(new PartOf(r0, r1, 0, 1)); } return rels; } public Set<Integer> getRoles() { Set<Integer> rs = new HashSet<Integer>(); rs.add(r0); rs.add(r1); return rs; } public Table evalAll(SpaceProvider spaces) { return null; // Should never occur } public Table evalAll(SpaceProvider spaces, Table possible) { Table table = new Table(this); for (Integer[] tuple : possible.getTuples()) { if (eval(toSpaces(toSIDs(tuple), spaces))) { table.addTuple(tuple); } Integer[] rev = reverse(tuple); if (eval(toSpaces(toSIDs(rev), spaces))) { table.addTuple(rev); } } return table; } private Integer[] reverse(Integer[] tuple) { Integer[] res = new Integer[2]; res[0] = tuple[1]; res[1] = tuple[0]; return res; } }
// Configure accounts to require username instead of email. Accounts.ui.config({ <API key>: 'USERNAME_ONLY' }); Meteor.subscribe('userStatus'); Template.game.helpers({ spacebarState: function() { return Session.get('spacebarToggleState') ? 'true' : 'false'; }, mouseXState: function() { return Session.get('mouseX') * 10 || '0'; }, mouseYState: function() { return Session.get('mouseY') * 10 || '0'; }, reticleState: function() { return Session.get('spacebarToggleState') ? 'active' : ''; }, acceleration: function() { var accel = parseFloat(Session.get('acceleration')); return (accel < 0) ? 0.00 : parseInt(accel * 1000); }, players: function() { return Meteor.users.find(); } }); Template.player.helpers({ positionX: function() { if (this.profile.position) { return this.profile.position.x.toFixed(2); } return 0; }, positionY: function() { if (this.profile.position) { return this.profile.position.y.toFixed(2); } return 0; }, positionZ: function() { if (this.profile.position) { return this.profile.position.z.toFixed(2); } return 0; } }); UI.body.rendered = function() { // The global application namespace. window.App = window.App || {}; // Grab the main game container. App.container = $(document); // Initialize listeners for keyboard events. App.keyInit(); // Initialize easter egg. App.easterEgg.init(); // Initialize touchscreen gestures. App.hammerInit(); }; Template.<API key>.rendered = function() { App.container = App.container || $(document); App.triggerEvent('loginRendered'); }; Template.game.rendered = function() { // Another namespace to hold all the graphics stuff. App.three = App.THREEinit(); // Initialize player and camera. App.player = App.playerInit(); // Initialize stars. App.enviromentInit(); App.triggerEvent('gameRendered'); };
<?php require_once __DIR__ . "/exceptions.php"; <API key>(function ($type) { static $paths = array( 'greeny\twitch\api' => 'Api.php', 'greeny\twitch\helpers' => 'Helpers.php', 'greeny\twitch\logger' => 'Logger.php', 'greeny\twitch\entities\channel' => 'Entities/Channel.php', 'greeny\twitch\entities\emoticon' => 'Entities/Emoticon.php', 'greeny\twitch\entities\entity' => 'Entities/Entity.php', 'greeny\twitch\entities\featuredstream' => 'Entities/FeaturedStream.php', 'greeny\twitch\entities\game' => 'Entities/Game.php', 'greeny\twitch\entities\stream' => 'Entities/Stream.php', 'greeny\twitch\entities\team' => 'Entities/Team.php', 'greeny\twitch\entities\user' => 'Entities/User.php', 'greeny\twitch\entities\video' => 'Entities/Video.php', ); $type = ltrim(strtolower($type), '\\'); // PHP namespace bug #49143 if (isset($paths[$type])) { require_once __DIR__ . '/' . $paths[$type]; } });
using System; using System.Globalization; using System.Linq; using System.Text; using System.Web.Mvc; using MVCForum.Domain.Constants; using MVCForum.Domain.DomainModel; using MVCForum.Domain.Interfaces.Services; using MVCForum.Domain.Interfaces.UnitOfWork; using MVCForum.Utilities; using MVCForum.Website.Application; using MVCForum.Website.Areas.Admin.ViewModels; using MVCForum.Website.ViewModels.Mapping; namespace MVCForum.Website.Areas.Admin.Controllers { [Authorize(Roles = AppConstants.AdminRoleName)] public class SettingsController : BaseAdminController { private readonly IRoleService _roleService; private readonly IEmailService _emailService; public SettingsController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, <API key> localizationService, IMembershipService membershipService, IRoleService roleService, ISettingsService settingsService, IEmailService emailService) : base(loggingService, unitOfWorkManager, membershipService, localizationService, settingsService) { _roleService = roleService; _emailService = emailService; } public ActionResult Index() { using (UnitOfWorkManager.NewUnitOfWork()) { var currentSettings = SettingsService.GetSettings(); var settingViewModel = ViewModelMapping.<API key>(currentSettings); settingViewModel.<API key> = _roleService.GetRole(SettingsService.GetSettings().<API key>.Id).Id; settingViewModel.DefaultLanguage = LocalizationService.DefaultLanguage.Id; settingViewModel.Roles = _roleService.AllRoles().ToList(); settingViewModel.Languages = LocalizationService.AllLanguages.ToList(); return View(settingViewModel); } } [HttpPost] public ActionResult Index(<API key> settingsViewModel) { if (ModelState.IsValid) { using (var unitOfWork = UnitOfWorkManager.NewUnitOfWork()) { try { var existingSettings = SettingsService.GetSettings(); var updatedSettings = ViewModelMapping.<API key>(settingsViewModel, existingSettings); // Map over viewModel from if (settingsViewModel.<API key> != null) { updatedSettings.<API key> = _roleService.GetRole(settingsViewModel.<API key>.Value); } if (settingsViewModel.DefaultLanguage != null) { updatedSettings.DefaultLanguage = LocalizationService.Get(settingsViewModel.DefaultLanguage.Value); } var culture = new CultureInfo(updatedSettings.DefaultLanguage.LanguageCulture); unitOfWork.Commit(); // Set the culture session too Session["Culture"] = culture; } catch (Exception ex) { unitOfWork.Rollback(); LoggingService.Error(ex); } } // All good clear cache and get reliant lists using (UnitOfWorkManager.NewUnitOfWork()) { TempData[AppConstants.MessageViewBagName] = new <API key> { Message = "Settings Updated", MessageType = GenericMessages.success }; settingsViewModel.Themes = AppHelpers.GetThemeFolders(); settingsViewModel.Roles = _roleService.AllRoles().ToList(); settingsViewModel.Languages = LocalizationService.AllLanguages.ToList(); } } return View(settingsViewModel); } public ActionResult TestEmail() { return View(); } [HttpPost] public ActionResult SendTestEmail() { var sb = new StringBuilder(); sb.AppendFormat("<p>{0}</p>", string.Concat("This is a test email from ", SettingsService.GetSettings().ForumName)); var email = new Email { EmailFrom = SettingsService.GetSettings().AdminEmailAddress, EmailTo = SettingsService.GetSettings().AdminEmailAddress, NameTo = "Email Test Admin", Subject = string.Concat("Email Test From ", SettingsService.GetSettings().ForumName) }; email.Body = _emailService.EmailTemplate(email.NameTo, sb.ToString()); _emailService.SendMail(email); TempData[AppConstants.MessageViewBagName] = new <API key> { Message = "Test Email Sent", MessageType = GenericMessages.success }; return RedirectToAction("TestEmail"); } } }
/* these are from the standard bootstrap styling*/ input.button-red, a.button-red { color: #fff; background-color: #d9534f; display: inline-block; align-items: flex-start; padding: 6px 12px; margin: 1px; height: 25px; font-size: 12px; font-weight: 400; line-height: 1.42857143; text-align: center; white-space: nowrap; vertical-align: middle; -ms-touch-action: manipulation; touch-action: manipulation; cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; background-image: none; border: 1px solid transparent; border-color: black; border-radius: 4px; } input.button-blue, a.button-blue { color: #fff; background: steelblue; display: inline-block; padding: 6px 12px; align-items: flex-start; margin: 1px; height: 25px; font-size: 12px; font-weight: 400; line-height: 1.42857143; text-align: center; white-space: nowrap; vertical-align: middle; -ms-touch-action: manipulation; touch-action: manipulation; cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; background-image: none; border: 1px solid transparent; border-color: black; border-radius: 4px; } input.button-green, a.button-green { color: #fff; background: seagreen; display: inline-block; padding: 6px 12px; margin: 1px; font-size: 12px; height: 25px; font-weight: 400; line-height: 1.42857143; text-align: center; white-space: nowrap; vertical-align: middle; -ms-touch-action: manipulation; touch-action: manipulation; cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; background-image: none; border: 1px solid transparent; border-color: black; border-radius: 4px; } .button-green-xs { color: #fff; background: seagreen; display: inline-block; padding: 1px 1px; height: 15px; margin: 1px; font-size: 10px; font-weight: 400; text-align: center; white-space: nowrap; vertical-align: middle; -ms-touch-action: manipulation; touch-action: manipulation; cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; background-image: none; border: 1px solid transparent; border-color: black; border-radius: 4px; } input.button-orange, a.button-orange { color: #fff; background: #f0ad4e; display: inline-block; padding: 6px 12px; margin: 1px; height: 25px; font-size: 12px; font-weight: 400; align-items: flex-start; line-height: 1.42857143; text-align: center; white-space: nowrap; vertical-align: middle; -ms-touch-action: manipulation; touch-action: manipulation; cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; background-image: none; border: 1px solid transparent; border-color: black; border-radius: 4px; } input.button-grey, a.button-grey { color: navy; background-color: darkgrey; border-color: #ccc; display: inline-block; padding: 6px 12px; margin: 1px; height: 25px; font-size: 12px; font-weight: 400; align-items: flex-start; line-height: 1.42857143; text-align: center; white-space: nowrap; vertical-align: middle; -ms-touch-action: manipulation; touch-action: manipulation; cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; background-image: none; border: 1px solid transparent; border-color: black; border-radius: 4px; } .button-grey-xs { background-color: darkgrey; border-color: #ccc; margin-bottom: 1px; margin-right: 2px; font-size: 12px; height: 18px; color: navy; align-items: flex-start; font-weight: 400; line-height: 1.42857143; text-align: center; white-space: nowrap; vertical-align: middle; -ms-touch-action: manipulation; touch-action: manipulation; cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; background-image: none; border: 1px solid transparent; border-radius: 4px; }
#include "stringlib.h" char *join(char **splitted, const char *separator) { char *dest = 0; size_t idx = 0; size_t size = 0; size_t ssize = strlen(separator); while(splitted[idx]) { size += strlen(splitted[idx]) + ssize; idx++; } dest = Malloc(size + 1); if(!dest) { return NULL; } *dest = 0; idx = 0; while(splitted[idx]) { strcat(dest, splitted[idx]); idx++; if(splitted[idx]) { strcat(dest, separator); } } return dest; }
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> <title>Clock</title> <style> html, body { width: 100%; height: 100%; margin: 0; } canvas { border: 1px solid #eee; position: absolute; left: 50%; top: 50%; margin-top:-200px; margin-left:-200px; } </style> </head> <body> <canvas id="canvas" width="400" height="400"></canvas> <canvas id="clock" width="400" height="400"></canvas> </body> <script type="text/javascript"> var ctx = document.getElementById('canvas').getContext('2d'); ctx.save(); ctx.translate(200, 200); ctx.rotate(-Math.PI/2); //90x12 ctx.fillStyle = "#FFF"; ctx.beginPath(); ctx.arc(0, 0, 150, 0, Math.PI * 2, true); ctx.fill(); ctx.save(); for (var i = 0; i < 12; i++) { ctx.beginPath(); ctx.strokeStyle = '#000'; ctx.lineWidth = 3; ctx.rotate(Math.PI / 6); ctx.moveTo(140, 0); ctx.lineTo(120, 0); ctx.stroke(); } ctx.restore(); ctx.save(); ctx.beginPath(); for (i = 0; i < 60; i++) { if (i % 5 !== 0) { ctx.beginPath(); ctx.strokeStyle = '#000'; ctx.lineWidth = 2; ctx.moveTo(140, 0); ctx.lineTo(130, 0); ctx.stroke(); } ctx.rotate(Math.PI / 30); } ctx.restore(); ctx.save(); ctx.rotate(Math.PI/2); ctx.beginPath(); ctx.fillStyle = '#000'; ctx.font = '32px Microsoft yahei'; ctx.textAlign = 'center'; ctx.textBaseline = 'middle'; ctx.fillText('3', 100, 0); ctx.fillText('6', 0, 100); ctx.fillText('9', -100, 0); ctx.fillText('12', 0, -100); ctx.restore(); ctx.beginPath(); ctx.lineWidth = 7; var lingrad2 = ctx.<API key>(150, 0, -150, 0); lingrad2.addColorStop(0, '#adb9c5'); lingrad2.addColorStop(1, '#e9eced'); ctx.strokeStyle = lingrad2; ctx.arc(0,0,152,0,Math.PI*2,true); ctx.stroke(); ctx.restore(); var clock = document.getElementById('clock').getContext('2d'); clock.translate(200,200); clock.rotate(-Math.PI/2); //clock (function clockAnimate() { clock.clearRect(-200, -200, 400, 400); var now = new Date(), sec = now.getSeconds(), min = now.getMinutes(), hr = now.getHours(); hr = hr > 12 ? hr - 12 : hr; clock.save(); clock.rotate(hr * (Math.PI / 6) + min * (Math.PI / 360) + sec * (Math.PI / 21600)); clock.lineWidth = 10; clock.strokeStyle = '#000'; clock.beginPath(); clock.moveTo(0, 0); clock.lineTo(110, 0); clock.stroke(); clock.fillStyle = '#34434c'; clock.arc(102, 0, 3, 0, Math.PI * 2, true); clock.fill(); clock.restore(); clock.save(); clock.rotate(min * (Math.PI / 30) + sec * (Math.PI/1800)); clock.lineWidth = 6; clock.strokeStyle = '#000'; clock.beginPath(); clock.moveTo(0, 0); clock.lineTo(135, 0); clock.stroke(); clock.lineWidth = 3; clock.strokeStyle = '#34434c'; clock.beginPath(); clock.moveTo(130, 0); clock.lineTo(115, 0); clock.stroke(); clock.restore(); clock.save(); clock.rotate(sec * (Math.PI /30)); clock.beginPath(); clock.lineWidth = 4; clock.strokeStyle = '#000'; clock.moveTo(0, 0); clock.lineTo(141, 0); clock.stroke(); clock.beginPath(); clock.lineWidth = 12; clock.strokeStyle = '#000'; clock.moveTo(0, 0); clock.lineTo(-38, 0); clock.stroke(); clock.beginPath(); clock.fillStyle = '#000'; clock.arc(0, 0, 15, 0, Math.PI * 2, true); clock.fill(); clock.beginPath(); clock.strokeStyle = '#cdd2d5'; clock.lineWidth = 1; clock.arc(0, 0, 8, 0, Math.PI * 2, true); clock.stroke(); clock.restore(); window.<API key>(clockAnimate); })(); </script> </html>
export interface MediaItem { getOwnerId(): number; }
require 'minitest_helper' class TestScatter < Minitest::Test def <API key> refute_nil ::Scatter::VERSION end def <API key> assert false end end
namespace com.codename1.impl { class EditString : java.lang.Object, java.lang.Runnable { private global::com.codename1.ui.Component n1; private int n2; private int n3; private global::java.lang.String n4; private int n5; public EditString(global::com.codename1.ui.Component n1, int n2, int n3, global::java.lang.String n4, int n5) { this.n1 = n1; this.n2 = n2; this.n3 = n3; this.n4 = n4; this.n5 = n5; } public virtual void run() { com.codename1.ui.Display d = (com.codename1.ui.Display)com.codename1.ui.Display.getInstance(); d.editString(n1, n2, n3, n4, n5); ((com.codename1.ui.Form)n1.getComponentForm()).repaint(); } } }
// <API key>.h #import <Foundation/Foundation.h> #import "Tin.h" @interface <API key> : NSObject<TinAuthenticator> @property (nonatomic, retain) NSString *token; @property (nonatomic, retain) NSString *username; @property (nonatomic, retain) NSString *password; - (id)initWithUsername:(NSString*)username password:(NSString*)password; - (id)initWithToken:(NSString*)token; + (<API key>*)basic<API key>:(NSString*)username password:(NSString*)password; + (<API key>*)basic<API key>:(NSString *)token; @end
/* global before, describe, it */ 'use strict'; const emitter = require('events').EventEmitter; const assert = require('assert'); const pt = require('bindings')('<API key>'); function inherits(target, source) { // <API key> for (let k in source.prototype) { target.prototype[k] = source.prototype[k]; } } inherits(pt.PersonTracker, emitter); let obj; let personTracker; describe('PersonTracker API Test', function() { describe('API Existance', function() { before(function(done) { // <API key> no-invalid-this this.timeout(30000); let personTrackerConfig = {}; personTrackerConfig = { lying: { enable: true, maxTrackedPerson: 1, }, }; pt.createPersonTracker(personTrackerConfig).then((instance) => { personTracker = instance; obj = personTracker; done(); }); }); it('PersonTracker is exist', function() { assert.ok(typeof (obj) !== 'undefined'); }); it('PersonTracker type is correct', function() { assert.equal(typeof (obj), 'object'); }); it('PersonTracker object has the attribute state', function() { assert.ok(obj.state !== undefined); }); it('PersonTracker object has the string attribute state', function() { assert.equal(typeof (obj.state), 'string'); }); it('PersonTracker object has the readonly attribute state', function() { assert.throws(function() { obj.state = null; }); }); it('new PersonTracker object has a method .<API key>', function() { assert.equal(typeof (obj.<API key>), 'function'); }); it('new PersonTracker object has a method .<API key>', function() { assert.equal(typeof (obj.<API key>), 'function'); }); it('new PersonTracker object has a method .start', function() { assert.equal(typeof (obj.start), 'function'); }); it('new PersonTracker object has a method .stop', function() { assert.equal(typeof (obj.stop), 'function'); }); it('new PersonTracker object has a method .pause', function() { assert.equal(typeof (obj.pause), 'function'); }); it('new PersonTracker object has a method .resume', function() { assert.equal(typeof (obj.resume), 'function'); }); it('new PersonTracker object has a method .reset', function() { assert.equal(typeof (obj.reset), 'function'); }); it('PersonTracker object has the attribute faceRecognition', function() { assert.ok(obj.faceRecognition !== undefined); }); it('PersonTracker object has the object attribute faceRecognition', function() { assert.equal(typeof (obj.faceRecognition), 'object'); }); it('PersonTracker object has the readonly attribute faceRecognition', function() { assert.throws(function() { obj.faceRecognition = null; }); }); it('PersonTracker object has the attribute <API key>', function() { assert.ok(obj.<API key> !== undefined); }); it('PersonTracker object has the object attribute <API key>', function() { assert.equal(typeof (obj.<API key>), 'object'); }); it('PersonTracker object has the readonly attribute <API key>', function() { assert.throws(function() { obj.<API key> = null; }); }); it('PersonTracker object has the attribute personTracking', function() { assert.ok(obj.personTracking !== undefined); }); it('PersonTracker object has the object attribute personTracking', function() { assert.equal(typeof (obj.personTracking), 'object'); }); it('PersonTracker object has the readonly attribute personTracking', function() { assert.throws(function() { obj.personTracking = null; }); }); }); });
{{ The MIT License (MIT) SMARTGoalz - SMART Goals made easier http://smartgoalz.github.io Copyright (c) 2015 Prashant Shah <pshah.smartgoalz@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @extends('layouts.master') @section('head') <script type="text/javascript"> $(document).ready(function() { }); </script> @stop @section('breadcrumb-title', 'User Profile') @section('page-title', 'Profile') @section('content') {{ HTML::linkAction('UsersController@getEditprofile', 'Edit Profile', array(), array('class' => 'btn btn-primary')) }} {{ HTML::linkAction('UsersController@getChangepass', 'Change Password', array(), array('class' => 'btn btn-primary')) }} <br /> <br /> <table class="table borderless table-pad"> <tr> <td width="120px">Fullname</td><td class="colon">:</td><td>{{ $user->fullname }}</td> </tr> <tr> <td>Username</td><td class="colon">:</td><td>{{ $user->username }}</td> </tr> <tr> <td>Email</td><td class="colon">:</td><td>{{ $user->email }}</td> </tr> <tr> <td>Gender</td><td class="colon">:</td> <td> @if ($user->gender == 'M') {{ 'Male' }} @elseif ($user->gender == 'F') {{ 'Female' }} @elseif ($user->gender == 'U') {{ 'Undisclosed' }} @else {{ 'ERROR' }} @endif </td> </tr> <tr> <td>Date format</td><td class="colon">:</td> <td> @if ($user->dateformat_php == 'd-M-Y') {{ 'Day-Month-Year' }} @elseif ($user->dateformat_php == 'M-d-Y') {{ 'Month-Day-Year' }} @elseif ($user->dateformat_php == 'Y-M-d') {{ 'Year-Month-Day' }} @else {{ 'ERROR' }} @endif </td> </tr> <tr> <td>Date of birth</td><td class="colon">:</td><td>{{ $dob }}</td> </tr> <tr> <td>Timezone</td><td class="colon">:</td><td>{{ $timezone_options[$user->timezone] }}</td> </tr> <tr> <td>Last Login</td><td class="colon">:</td><td>{{ date_format(<API key>('Y-m-d H:i:s', $user->last_login), $user->dateformat_php . ' h:i A') }}</td> </tr> <tr> <td>Created On</td><td class="colon">:</td><td>{{ date_format(<API key>('Y-m-d H:i:s', $user->created_at), $user->dateformat_php . ' h:i A') }}</td> </tr> </table> @stop
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SteamAuth { public class Confirmation { public string ConfirmationID { get; private set; } public string ConfirmationKey { get; private set; } public string <API key> { get; private set; } public Confirmation(string id, string key, string description) { ConfirmationID = id; ConfirmationKey = key; <API key> = description; } } }
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Get Tomorrow Date or add a date to given date &#8211; Sagar R Kothari</title> <link rel="dns-prefetch" href="//maxcdn.bootstrapcdn.com"> <link rel="dns-prefetch" href="//cdnjs.cloudflare.com"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content="Passionate and enthusiastic iOS application developer having 8 years of experience."> <meta name="robots" content="all"> <meta name="author" content=""> <meta name="keywords" content="CodeSnippet"> <link rel="canonical" href="http://localhost:4000/2017/10/20/Get-Tomorrow-Date/"> <link rel="alternate" type="application/rss+xml" title="RSS Feed for Sagar R Kothari" href="/feed.xml" /> <!-- Custom CSS --> <link rel="stylesheet" href="/css/pixyll.css?201810231918" type="text/css"> <!-- Fonts --> <link href='//fonts.googleapis.com/css?family=Merriweather:900,900italic,300,300italic' rel='stylesheet' type='text/css'> <link href='//fonts.googleapis.com/css?family=Lato:900,300' rel='stylesheet' type='text/css'> <!-- MathJax --> <!-- Verifications --> <!-- Open Graph --> <meta property="og:locale" content=""> <meta property="og:type" content="article"> <meta property="og:title" content="Get Tomorrow Date or add a date to given date"> <meta property="og:description" content="Passionate and enthusiastic iOS application developer having 8 years of experience."> <meta property="og:url" content="http://localhost:4000/2017/10/20/Get-Tomorrow-Date/"> <meta property="og:site_name" content="Sagar R Kothari"> <!-- Twitter Card --> <meta name="twitter:card" content="summary" /> <meta name="twitter:title" content="Get Tomorrow Date or add a date to given date" /> <meta name="<TwitterConsumerkey>" content="Passionate and enthusiastic iOS application developer having 8 years of experience." /> <meta name="twitter:url" content="http://localhost:4000/2017/10/20/Get-Tomorrow-Date/" /> <!-- Icons --> <link rel="apple-touch-icon" sizes="57x57" href="/<API key>.png"> <link rel="apple-touch-icon" sizes="114x114" href="/<API key>.png"> <link rel="apple-touch-icon" sizes="72x72" href="/<API key>.png"> <link rel="apple-touch-icon" sizes="144x144" href="/<API key>.png"> <link rel="apple-touch-icon" sizes="60x60" href="/<API key>.png"> <link rel="apple-touch-icon" sizes="120x120" href="/<API key>.png"> <link rel="apple-touch-icon" sizes="76x76" href="/<API key>.png"> <link rel="apple-touch-icon" sizes="152x152" href="/<API key>.png"> <link rel="apple-touch-icon" sizes="180x180" href="/<API key>.png"> <link rel="icon" type="image/png" href="/favicon-192x192.png" sizes="192x192"> <link rel="icon" type="image/png" href="/favicon-160x160.png" sizes="160x160"> <link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96"> <link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16"> <link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32"> </head> <body class="site"> <div class="site-wrap"> <header class="site-header px2 px-responsive"> <div class="mt2 wrap"> <div class="measure"> <a href="http://localhost:4000" class="site-title">Sagar R Kothari</a> <nav class="site-nav"> <a href="/Archive/">Archive</a> <a href="/Categories/">Categories</a> <a href="/Tags/">Tags</a> <a href="/about/">About</a> </nav> <div class="clearfix"></div> </div> </div> </header> <div class="post p2 p-responsive wrap" role="main"> <div class="measure"> <div class="post-header mb2"> <h1>Get Tomorrow Date or add a date to given date</h1> <span class="post-meta">October 20, 2017</span><br> <span class="post-meta small"> 1 </span> </div> <article class="post-content"> <div class="language-swift highlighter-rouge"><pre class="highlight"><code><span class="kd">func</span> <span class="nf">getTomorrowDate</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">Date</span> <span class="p">{</span> <span class="k">let</span> <span class="nv">cal</span> <span class="o">=</span> <span class="kt">NSCalendar</span><span class="o">.</span><span class="n">current</span> <span class="k">let</span> <span class="nv">now</span> <span class="o">=</span> <span class="kt">Date</span><span class="p">()</span> <span class="k">let</span> <span class="nv">compSet</span> <span class="o">=</span> <span class="kt">Set</span><span class="p">(</span><span class="nv">arrayLiteral</span><span class="p">:</span><span class="kt">Calendar</span><span class="o">.</span><span class="kt">Component</span><span class="o">.</span><span class="n">day</span><span class="p">,</span> <span class="kt">Calendar</span><span class="o">.</span><span class="kt">Component</span><span class="o">.</span><span class="n">month</span><span class="p">,</span> <span class="kt">Calendar</span><span class="o">.</span><span class="kt">Component</span><span class="o">.</span><span class="n">year</span><span class="p">)</span> <span class="k">var</span> <span class="nv">comp</span> <span class="o">=</span> <span class="n">cal</span><span class="o">.</span><span class="nf">dateComponents</span><span class="p">(</span><span class="n">compSet</span> <span class="k">as</span> <span class="kt">Set</span><span class="o">&lt;</span><span class="kt">Calendar</span><span class="o">.</span><span class="kt">Component</span><span class="o">&gt;</span><span class="p">,</span> <span class="nv">from</span><span class="p">:</span> <span class="n">now</span><span class="p">)</span> <span class="n">comp</span><span class="o">.</span><span class="n">timeZone</span> <span class="o">=</span> <span class="kt">TimeZone</span><span class="o">.</span><span class="n">current</span> <span class="n">comp</span><span class="o">.</span><span class="n">day</span> <span class="o">=</span> <span class="n">comp</span><span class="o">.</span><span class="n">day</span><span class="o">!</span> <span class="o">+</span> <span class="mi">1</span> <span class="k">return</span> <span class="n">cal</span><span class="o">.</span><span class="nf">date</span><span class="p">(</span><span class="nv">from</span><span class="p">:</span> <span class="n">comp</span><span class="p">)</span><span class="o">!</span> <span class="p">}</span> </code></pre> </div> </article> <div id="disqus_thread"></div> <script type="text/javascript"> var disqus_shortname = 'sagarrkothari-com'; var disqus_identifier = '/2017/10/20/Get-Tomorrow-Date'; var disqus_title = "Get Tomorrow Date or add a date to given date"; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; (document.<API key>('head')[0] || document.<API key>('body')[0]).appendChild(dsq); })(); </script> <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> </div> </div> </div> <footer class="center"> <! <div class="measure"> <small> Theme crafted with &lt;3 by <a href="http: &lt;/&gt; available on <a href="https://github.com/johnotander/pixyll">GitHub</a>. </small> </div> </footer> </body> </html>
package weixin.guanjia.core.entity.common; public class Location { private Float lat; private Float lng; public Location() { // TODO Auto-generated constructor stub } public Location(Float lat, Float lng) { this.lat = lat; this.lng = lng; } public void setLat(Float lat) { this.lat = lat; } public Float getLat() { return lat; } public Float getLng() { return lng; } public void setLng(Float lng) { this.lng = lng; } }
require "test_helper" module TimeSpanner module TimeUnits class MicrosecondTest < TestCase it "initializes" do microsecond = Microsecond.new assert microsecond.is_a?(TimeUnit) assert_equal 12, microsecond.position assert_equal :microseconds, microsecond.plural_name end it "calculates" do from = Time.now to = Time.at(from.to_r, 2.0) duration = to.to_r - from.to_r microsecond = Microsecond.new microsecond.calculate duration assert_equal 2, microsecond.amount assert_equal 0, microsecond.rest end it "calculates with rest (999 nanoseconds in seconds)" do from = Time.now target_micros = Time.at(from.to_r, 2.0) to = Time.at(target_micros.to_r, 0.999) duration = to.to_r - from.to_r microsecond = Microsecond.new microsecond.calculate duration assert_equal 2, microsecond.amount assert_equal Rational(8998192055486251, <API key>), microsecond.rest end it "should not calculate amount of 2 although units equal" do from = Time.parse "2012-06-12 02:22:00" <API key> = Time.at(from.to_r, 2.0) to = Time.at <API key>.to_r, -0.001 duration = to.to_r - from.to_r microsecond = Microsecond.new microsecond.calculate duration, to assert_equal 1, microsecond.amount assert microsecond.rest > 0 end end end end
package com.bluesnap.androidapi.views.components; import android.content.Context; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import android.util.AttributeSet; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.widget.LinearLayout; import android.widget.TextView; import com.bluesnap.androidapi.Constants; import com.bluesnap.androidapi.R; import com.bluesnap.androidapi.models.ContactInfo; import com.bluesnap.androidapi.services.BlueSnapValidator; public class <API key> extends LinearLayout { public static final String TAG = <API key>.class.getSimpleName(); private TextView countryTextView, zipTextView, stateTextView, cityTextView, addressTextView, emailTextView, nameTextView; LinearLayout <API key>; LinearLayout <API key>; public <API key>(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); initControl(context); } public <API key>(Context context, @Nullable AttributeSet attrs) { super(context, attrs); initControl(context); } public <API key>(Context context) { super(context); initControl(context); } /** * Load component XML layout */ void initControl(Context context) { LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.<API key>); if (inflater == null) { Log.w(TAG, "inflater is null"); } else { inflater.inflate(R.layout.<API key>, this); } countryTextView = findViewById(R.id.countryTextView); zipTextView = findViewById(R.id.zipTextView); stateTextView = findViewById(R.id.stateTextView); cityTextView = findViewById(R.id.cityTextView); addressTextView = findViewById(R.id.addressTextView); emailTextView = findViewById(R.id.emailTextView); nameTextView = findViewById(R.id.nameTextView); <API key> = findViewById(R.id.<API key>); <API key> = findViewById(R.id.<API key>); } /** * update resource with details * * @param contactInfo - {@link ContactInfo} */ public void <API key>(@NonNull ContactInfo contactInfo) { <API key>(contactInfo.getFullName(), contactInfo.getAddress(), contactInfo.getCity(), contactInfo.getState(), contactInfo.getZip(), contactInfo.getCountry()); } /** * update resource with details * * @param fullName - fullName * @param address - address * @param state - state * @param zip - zip * @param country - country */ private void <API key>(String fullName, String address, String city, String state, String zip, String country) { fullName = stringify(fullName); address = stringify(address); city = stringify(city); state = stringify(state); zip = stringify(zip); country = stringify(country); if (!address.isEmpty()) address += ","; else if (city.isEmpty() && state.isEmpty()) <API key>.setVisibility(GONE); setCountryText(country); setZipText(zip); if (country.length() == 2) <API key>(country.toUpperCase()); setStateText(state); setCityText(city); setAddressText(address); setNameText(fullName); } private void setCountryText(String countryText) { this.countryTextView.setText(countryText.toUpperCase()); } private void setZipText(String zipText) { this.zipTextView.setText(zipText); } private void setStateText(String stateText) { this.stateTextView.setText(stateText.toUpperCase()); } private void setAddressText(String addressText) { this.addressTextView.setText(addressText); } private void setCityText(String cityText) { this.cityTextView.setText(cityText); } public void setEmailText(String emailText) { this.emailTextView.setText(emailText); } private void setNameText(String nameText) { this.nameTextView.setText(nameText); } public void setEmailVisibility(int visibility) { this.emailTextView.setVisibility(visibility); } /** * check if null, if so returns empty string * * @param s - String * @return same String or an empty one if String is Empty or null */ static String stringify(String s) { if (s == null || s.isEmpty()) return ""; else return s; } /** * change Zip Visibility According To <API key> {@link Constants} * * @param country - country upper case string ISO Alpha-2 */ void <API key>(String country) { if (!BlueSnapValidator.checkCountryHasZip(country)) { zipTextView.setVisibility(View.GONE); } else { zipTextView.setVisibility(View.VISIBLE); } } }
package com.zimbra.qa.selenium.framework.ui; import org.apache.log4j.*; import com.thoughtworks.selenium.SeleniumException; import com.zimbra.qa.selenium.framework.util.*; /** * The <code>AbsSeparateWindow</code> class is a base class that all * "separate window" objects can derive from. The main additional * functionality is the ability to switch focus between different windows * (i.e. the 'main' window and the 'separate' window) when * executing Selenium method calls. * <p> * All selenium methods (e.g. sClick(), sType()) must be redefined * in this class, with a wrapper to switch windows. * <p> * * @author Matt Rhoades * */ public abstract class AbsSeparateWindow extends AbsPage { protected static Logger logger = LogManager.getLogger(AbsSeparateWindow.class); public static boolean IsDebugging = false; /** * The Selenium ID for the separate window */ protected String DialogWindowID = null; /** * The Selenium ID for the main window ("null" by default) */ protected String MainWindowID = "null"; /** * The title bar text */ protected String DialogWindowTitle = null; /** * Whether or not to switch focus when working in the separate window */ protected boolean DoChangeWindowFocus = false; public AbsSeparateWindow(AbsApplication application) { super(application); logger.info("new " + AbsSeparateWindow.class.getCanonicalName()); DoChangeWindowFocus = false; } /* (non-Javadoc) * @see com.zimbra.qa.selenium.framework.ui.AbsSeleniumObject#sClick(java.lang.String) */ public void sClick(String locator) throws HarnessException { logger.info(myPageName() + " sClick("+ locator +")"); try { super.sSelectWindow(this.DialogWindowID); changeFocus(); super.sClick(locator); // Wait for the SOAP request to finish // zWaitForBusyOverlay(); SleepUtil.sleepVeryLong(); } finally { super.sSelectWindow(MainWindowID); super.sWindowFocus(); } } /** * Change focus to the separate window, if DoChangeWindowFocus = true * @throws HarnessException */ protected void changeFocus() throws HarnessException { if ( DoChangeWindowFocus ) { super.sWindowFocus(); } } /* (non-Javadoc) * @see com.zimbra.qa.selenium.framework.ui.AbsSeleniumObject#sType(java.lang.String, java.lang.String) */ public void sType(String locator, String value) throws HarnessException { logger.info(myPageName() + " sType("+ locator +", " + value +")"); try { super.sSelectWindow(this.DialogWindowID); changeFocus(); super.sType(locator, value); } finally { super.sSelectWindow(MainWindowID); super.sWindowFocus(); } } /* (non-Javadoc) * @see com.zimbra.qa.selenium.framework.ui.AbsSeleniumObject#sGetText(java.lang.String) */ public String sGetText(String locator) throws HarnessException { logger.info(myPageName() + " sGetText("+ locator +")"); String text = ""; try { super.sSelectWindow(this.DialogWindowID); changeFocus(); text = super.sGetText(locator); } finally { super.sSelectWindow(MainWindowID); super.sWindowFocus(); } return (text); } /* (non-Javadoc) * @see com.zimbra.qa.selenium.framework.ui.AbsSeleniumObject#sGetBodyText() */ public String sGetBodyText() throws HarnessException { logger.info(myPageName() + " sGetBodyText()"); String text = ""; try { super.sSelectWindow(this.DialogWindowID); changeFocus(); text = super.sGetBodyText(); } finally { super.sSelectWindow(MainWindowID); super.sWindowFocus(); } return (text); } public void sSelectFrame(String locator) throws HarnessException { logger.info(myPageName() + " sSelectFrame("+ locator +")"); try { super.sSelectWindow(this.DialogWindowID); changeFocus(); super.sSelectFrame(locator); } finally { super.sSelectWindow(MainWindowID); super.sWindowFocus(); } } public int sGetCssCount(String css) throws HarnessException { logger.info(myPageName() + " sGetCssCount("+ css +")"); Integer count = null; try { super.sSelectWindow(this.DialogWindowID); changeFocus(); count = super.sGetCssCount(css); } finally { super.sSelectWindow(MainWindowID); super.sWindowFocus(); } if ( count == null ) throw new HarnessException("Unable to determine CSS count"); logger.info("getCssCount(" + css + ") = " + count); return (count); } /** * Enter text from a different iframe * @param iframelocator * @param locator * @param value * @throws HarnessException * @throws HarnessException */ public void sType(String iframelocator, String locator, String value) throws HarnessException { try { super.sSelectWindow(this.DialogWindowID); changeFocus(); /* * To get the body contents, need to switch iframes */ try { super.sSelectFrame(iframelocator); super.sType(locator, value); } finally { // Make sure to go back to the original iframe this.sSelectFrame("relative=top"); } } finally { super.sSelectWindow(MainWindowID); super.sWindowFocus(); } } /** * Get text from a different iframe * @param iframelocator * @param locator * @return * @throws HarnessException */ public String sGetText(String iframelocator, String locator) throws HarnessException { String text = ""; try { super.sSelectWindow(this.DialogWindowID); changeFocus(); /* * To get the body contents, need to switch iframes */ try { super.sSelectFrame(iframelocator); text = super.zGetHtml(locator); logger.info("DisplayMail.zGetBody(" + iframelocator + ", "+ locator +") = " + text); } finally { // Make sure to go back to the original iframe this.sSelectFrame("relative=top"); } } finally { super.sSelectWindow(MainWindowID); super.sWindowFocus(); } return (text); } /* (non-Javadoc) * @see com.zimbra.qa.selenium.framework.ui.AbsSeleniumObject#sIsElementPresent(java.lang.String) */ public boolean sIsElementPresent(String locator) throws HarnessException { logger.info(myPageName() + " sIsElementPresent("+ locator +")"); boolean present = false; try { super.sSelectWindow(this.DialogWindowID); changeFocus(); present = super.sIsElementPresent(locator); } finally { super.sSelectWindow(MainWindowID); super.sWindowFocus(); } return (present); } /* (non-Javadoc) * @see com.zimbra.qa.selenium.framework.ui.AbsSeleniumObject#<API key>(java.lang.String, int, int) */ public boolean <API key>(String locator, int leftLimit, int topLimit) throws HarnessException { logger.info(myPageName() + " <API key>("+ locator +", "+ leftLimit +", "+ topLimit +")"); boolean present = false; try { super.sSelectWindow(this.DialogWindowID); changeFocus(); present = super.<API key>(locator, leftLimit, topLimit); } finally { super.sSelectWindow(MainWindowID); super.sWindowFocus(); } return (present); } /* (non-Javadoc) * @see com.zimbra.qa.selenium.framework.ui.AbsSeleniumObject#<API key>(java.lang.String) */ public int <API key>(String locator) throws HarnessException { logger.info(myPageName() + " <API key>("+ locator +")"); try { super.sSelectWindow(this.DialogWindowID); changeFocus(); int n = super.<API key>(locator); return (n); } finally { super.sSelectWindow(MainWindowID); super.sWindowFocus(); } } /* (non-Javadoc) * @see com.zimbra.qa.selenium.framework.ui.AbsSeleniumObject#<API key>(java.lang.String) */ public int <API key>(String locator) throws HarnessException { logger.info(myPageName() + " <API key>("+ locator +")"); try { super.sSelectWindow(this.DialogWindowID); changeFocus(); int n = super.<API key>(locator); return (n); } finally { super.sSelectWindow(MainWindowID); super.sWindowFocus(); } } /* (non-Javadoc) * @see com.zimbra.qa.selenium.framework.ui.AbsSeleniumObject#sFocus(java.lang.String) */ public void sFocus(String locator) throws HarnessException { logger.info(myPageName() + " sFocus("+ locator +")"); try { super.sSelectWindow(this.DialogWindowID); changeFocus(); super.sFocus(locator); } finally { super.sSelectWindow(MainWindowID); super.sWindowFocus(); } } /* (non-Javadoc) * @see com.zimbra.qa.selenium.framework.ui.AbsSeleniumObject#sMouseDown(java.lang.String) */ public void sMouseDown(String locator) throws HarnessException { logger.info(myPageName() + " sMouseDown("+ locator +")"); try { super.sSelectWindow(this.DialogWindowID); changeFocus(); super.sMouseDown(locator); } finally { super.sSelectWindow(MainWindowID); super.sWindowFocus(); } } /* (non-Javadoc) * @see com.zimbra.qa.selenium.framework.ui.AbsSeleniumObject#sMouseUp(java.lang.String) */ public void sMouseUp(String locator) throws HarnessException { logger.info(myPageName() + " sMouseUp("+ locator +")"); try { super.sSelectWindow(this.DialogWindowID); changeFocus(); super.sMouseUp(locator); } finally { super.sSelectWindow(MainWindowID); super.sWindowFocus(); } } /* (non-Javadoc) * @see com.zimbra.qa.selenium.framework.ui.AbsSeleniumObject#zClickAt(java.lang.String, java.lang.String) */ public void zClickAt(String locator, String coord) throws HarnessException { logger.info(myPageName() + " zClickAt("+ locator +", "+ coord +")"); try { super.sSelectWindow(this.DialogWindowID); changeFocus(); if ( !super.sIsElementPresent(locator) ) throw new HarnessException("locator not present: "+ locator); super.sMouseDownAt(locator, coord); super.sMouseUpAt(locator, coord); } finally { super.sSelectWindow(MainWindowID); super.sWindowFocus(); } } /** * Type characters in the separate window * @param characters * @throws HarnessException */ public void zTypeCharacters(String characters) throws HarnessException { logger.info(myPageName() + " zTypeCharacters()"); try { super.sSelectWindow(this.DialogWindowID); super.sWindowFocus(); // Must focus into the separate window super.zKeyboard.zTypeCharacters(characters); } finally { super.zSelectWindow(MainWindowID); super.sWindowFocus(); } } /** * Type characters in the separate window * @param characters * @throws HarnessException */ public void zKeyDown(String keyCode) throws HarnessException { logger.info(myPageName() + " zKeyDown()"); try { super.sSelectWindow(this.DialogWindowID); super.sWindowFocus(); // Must focus into the separate window super.zKeyDown(keyCode); } finally { super.zSelectWindow(MainWindowID); super.sWindowFocus(); } } /** * Close the separate window (DefaultSelenium.close()) * @throws HarnessException */ public void zCloseWindow() throws HarnessException { logger.info(myPageName() + " zCloseWindow()"); try { // Make sure the separate window was initialized if ( this.DialogWindowID == null || this.DialogWindowID.equals("null") ) { // Window was never opened/found. Don't close anything. // This may leave an extra window open, but if we can't // find that window, there is no way to close it. return; } // Select the window try { super.sSelectWindow(this.DialogWindowID); } catch (SeleniumException e) { logger.warn("In zCloseWindow(), unable to locate DialogWindowID. Assume already closed.", e); return; } // Close the window super.sClose(); } finally { super.zSelectWindow(MainWindowID); } } public void zWaitForBusyOverlay() throws HarnessException { logger.info(myPageName() + " zWaitForBusyOverlay()"); try { super.sSelectWindow(this.DialogWindowID); super.sWaitForCondition("selenium.browserbot.getUserWindow().top.appCtxt.getShell().getBusy()==false"); } finally { super.zSelectWindow(MainWindowID); } } /** * Used to locate the window. Window title is "Zimbra: <subject>" * @param title A partial string that must be contained in the window title */ public void zSetWindowTitle(String title) throws HarnessException { DialogWindowTitle = title; } /** * Used to locate the window. Normally, the full browser 'title' is used, * but the Selenium ID and Selenium Name are also valid. * @param id The window ID */ public void zSetWindowID(String id) throws HarnessException { this.DialogWindowID = id; } /** * Set the Selenium Window ID based on partial window title * @param title * @return true if found, false otherwise */ protected boolean zSetWindowIdByTitle(String title) throws HarnessException { if ( IsDebugging ) { // Helpful for debugging, log all the names, titles, names for (String name: super.sGetAllWindowIds()) { logger.info("Window ID: "+ name); } for (String name: super.sGetAllWindowNames()) { logger.info("Window name: "+ name); } for (String t: super.sGetAllWindowTitles()) { logger.info("Window title: "+ t); } } for (String t : super.sGetAllWindowTitles()) { logger.info("Window title: "+ t); if ( t.toLowerCase().contains(title.toLowerCase()) ) { DialogWindowID = title; return (true); } } return (false); } public boolean zIsClosed(String windowName) throws HarnessException { logger.info(myPageName() + " zIsClosed()"); return <API key>(windowName); } public boolean zIsActive() throws HarnessException { logger.info(myPageName() + " zIsActive()"); if ( this.DialogWindowTitle == null ) throw new HarnessException("Window Title is null. Use zSetWindowTitle() first."); for (String title : super.sGetAllWindowTitles()) { logger.info("Window title: "+ title); if ( title.toLowerCase().contains(DialogWindowTitle.toLowerCase()) ) { DialogWindowID = title; logger.info("zIsActive() = true ... title = "+ DialogWindowID); return (true); } } logger.info("zIsActive() = false"); return (false); } }
import { <API key> } from '../interfaces/<API key>.interface'; /** * Test changelog entry for change (commit) * * @param <API key> - Changelog line / entry * @param commit - Commit * @param repositoryUrl - Repository URL */ export function testChangelogChange( <API key>: string, commit: <API key>, repositoryUrl: string ): void { const commitMessage: string = `* **${ commit.scope }:** ${ commit.message }`; const commitLink: string = `([${ commit.hash }](${ repositoryUrl }/commit/${ commit.hash }))`; expect( <API key> ).toBe( `${ commitMessage } ${ commitLink }` ); }
using System; namespace Magnesium.Vulkan { [Flags] internal enum VkMemoryHeapFlags : uint { <API key> = 0x1, } }
// Imports repositories import { IClientRepository } from './../repositories/client'; // Imports models import { Client } from './../entities/client'; import { Role } from './../entities/role'; import { RoleGroup } from './../entities/role-group'; export class ClientService { constructor(private clientRepository: IClientRepository) { } public async list(username: string): Promise<Client[]> { return this.clientRepository.listByUsername(username); } public async find(username: string, id: string): Promise<Client> { const client: Client = await this.clientRepository.find(id); if (!client) { throw new Error('Invalid Client Id'); } if (!client.isOwner(username)) { throw new Error('You are not the owner of this Client Id'); } return client; } public async create(username: string, name: string): Promise<Client> { if (!name) { throw new Error('Invalid Client Name'); } const client: Client = new Client(name, this.generateToken(), this.generateToken(), [], [], false, false, username, null); await this.clientRepository.create(client); return client; } public async update(username: string, id: string, name: string, allowForgotPassword: boolean, allowRegister: boolean, roleName: string, roleGroupName: string): Promise<Client> { const client: Client = await this.clientRepository.find(id); if (!client) { throw new Error('Invalid Client Id'); } if (!client.isOwner(username)) { throw new Error('You are not the owner of this Client Id'); } if (roleName && !roleGroupName) { throw new Error('Invalid Role'); } client.name = name; client.allowForgot<API key>; client.allowRegister = allowRegister; client.role = roleName ? new Role(roleName, new RoleGroup(roleGroupName), []) : null; await this.clientRepository.update(client); return client; } public async addScope(username: string, id: string, name: string): Promise<Client> { if (!name) { throw new Error('Invalid Scope Name'); } const client: Client = await this.clientRepository.find(id); if (!client) { throw new Error('Invalid Client Id'); } if (!client.isOwner(username)) { throw new Error('You are not the owner of this Client Id'); } if (client.allowedScopes.find((x) => x === name)) { throw new Error('Scope already exist'); } client.allowedScopes.push(name); await this.clientRepository.update(client); return client; } public async removeScope(username: string, id: string, name: string): Promise<Client> { const client: Client = await this.clientRepository.find(id); if (!client) { throw new Error('Invalid Client Id'); } if (!client.isOwner(username)) { throw new Error('You are not the owner of this Client Id'); } if (!client.allowedScopes.find((x) => x === name)) { throw new Error('Scope does not exist'); } client.allowedScopes.splice(client.allowedScopes.indexOf(name), 1); await this.clientRepository.update(client); return client; } public async addRedirectUri(username: string, id: string, uri: string): Promise<Client> { const client: Client = await this.clientRepository.find(id); if (!client) { throw new Error('Invalid Client Id'); } if (!client.isOwner(username)) { throw new Error('You are not the owner of this Client Id'); } client.redirectUris.push(uri); await this.clientRepository.update(client); return client; } public async removeRedirectUri(username: string, id: string, uri: string): Promise<Client> { const client: Client = await this.clientRepository.find(id); if (!client) { throw new Error('Invalid Client Id'); } if (!client.isOwner(username)) { throw new Error('You are not the owner of this Client Id'); } client.redirectUris.splice(client.redirectUris.indexOf(uri), 1); await this.clientRepository.update(client); return client; } private generateToken() { let text = ""; const chars = "<API key>"; for (let i = 0; i < 20; i++) { text += chars.charAt(Math.floor(Math.random() * chars.length)); } return text; } }
<!DOCTYPE html PUBLIC "- <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title></title> <link rel="stylesheet" type="text/css" href="http://db.cec.gov.tw/votehist.css"> <script type="text/javascript"> function AddToFaves_hp() { var is_4up = parseInt(navigator.appVersion); var is_mac = navigator.userAgent.toLowerCase().indexOf("mac")!=-1; var is_ie = navigator.userAgent.toLowerCase().indexOf("msie")!=-1; var thePage = location.href; if (thePage.lastIndexOf(' thePage = thePage.substring(0,thePage.lastIndexOf(' if (is_ie && is_4up && !is_mac) window.external.AddFavorite(thePage,document.title); else if (is_ie || document.images) booker_hp = window.open(thePage,'booker_','menubar,width=325,height=100,left=140,top=60'); //booker_hp.focus(); } </script> </head> <body class="frame"> <!DOCTYPE html PUBLIC "- <div style="width: 100%; height: 56px; margin: 0px 0px 0px 0px; border-style: solid; border-width: 0px 0px 1px 0px; border-color: black;"> <div style="float: left;"> <img src="http://db.cec.gov.tw/images/main_title.gif" /> </div> <div style="width: 100%; height: 48px;"> <div style="text-align: center;"> <img src="http://db.cec.gov.tw/images/small_ghost.gif" /> <span style="height: 30px; font-size: 20px;"> <a href="http: style="text-decoration: none;"></a> </span> </div> </div> <div style="width: 100%; height: 8px; background-color: #fde501;"> </div> </div> <!DOCTYPE html PUBLIC "- <div style="width: 100%; height: 29px; background-image: url('http://db.cec.gov.tw/images/tab_background.gif'); background-repeat: repeat-x;"> <div style="text-align: center;"> <a href="histMain.jsp"><img border="0" src="http://db.cec.gov.tw/images/tab_01.gif" /></a> <a href="histCand.jsp"><img border="0" src="http://db.cec.gov.tw/images/tab_02.gif" /></a> <!-- <a href=""><img border="0" src="images/tab_03.gif" /></a> --> <!-- <a href=""><img border="0" src="images/tab_04.gif" /></a> --> <a href="histQuery.jsp?voteCode=20120101T1A2&amp;qryType=ctks&amp;prvCode=04&amp;cityCode=000&amp;areaCode=02&amp;deptCode=025&amp;liCode=0409 <a href="mailto:info@cec.gov.tw;ytlin@cec.gov.tw"><img border="0" src="http://db.cec.gov.tw/images/tab_06.gif" /></a> </div> </div> <div style="width: 100%; height: 22px; background-image: url('http://db.cec.gov.tw/images/tab_separator.gif'); background-repeat: repeat-x;"> </div> <div class="query"> <!DOCTYPE html PUBLIC "- <!DOCTYPE html PUBLIC "- <div class="titlebox"> <div class="title"> <div class="head"> 08 &nbsp;</div> <div class="date">1010114</div> <div class="separator"></div> </div> </div> <!DOCTYPE html PUBLIC "- <link rel="stylesheet" type="text/css" href="http://db.cec.gov.tw/qryCtks.css" /> <table class="ctks" width="950" height="22" border=1 cellpadding="0" cellspacing="0" > <tr class="title"> <td nowrap align="center"></td> <td nowrap align="center"></td> <td nowrap align="center"></td> <td nowrap align="center"></td> <td nowrap align="center"></td> </tr> <tr class="data"> <td nowrap rowspan=4 align=center>020602</td> <td nowrap align="center"></td> <td nowrap align="center">1</td> <td nowrap align="right">277</td> <td nowrap align="right"> 75.89%</td> </tr> <tr class="data"> <td nowrap align="center"></td> <td nowrap align="center">2</td> <td nowrap align="right">4</td> <td nowrap align="right"> 1.09%</td> </tr> <tr class="data"> <td nowrap align="center"></td> <td nowrap align="center">3</td> <td nowrap align="right">9</td> <td nowrap align="right"> 2.46%</td> </tr> <tr class="data"> <td nowrap align="center"></td> <td nowrap align="center">4</td> <td nowrap align="right">75</td> <td nowrap align="right"> 20.54%</td> </tr> </table> <!DOCTYPE html PUBLIC "- <div style="width: 100%; height: 20px; margin: 30px 0px 0px 0px; text-align: center; "> <span> <img src="http://db.cec.gov.tw/images/leave_arrow_left.gif" /> </span> <span style="margin: 0px 10px 0px 10px; "> <a style="text-decoration: none; font-size: 15px; " href="histPrint"></a> </span> <span> <img src="http://db.cec.gov.tw/images/leave_arrow_right.gif" /> </span> <span style="margin-right: 100px;">&nbsp;</span> <span> <img src="http://db.cec.gov.tw/images/leave_arrow_left.gif" /> </span> <span style="margin: 0px 10px 0px 10px; "> <a style="text-decoration: none; font-size: 15px; " href="histMain.jsp"></a> </span> <span> <img src="http://db.cec.gov.tw/images/leave_arrow_right.gif" /> </span> </div> </div> </body> </html>
from colossus.game import Route def test_route_step(): route = Route(100.0, 1) route.add_packet() dmg = route.update(10.0) assert dmg <= 0.0 dmg = 0.0 dmg += route.update(100000.0) dmg += route.update(100000.0) assert dmg > 0.0 def <API key>(): route = Route(1.0, 1) route.add_packet() assert route.packet_count() == 1 route.update(100.0) assert route.packet_count() == 0
namespace <API key>.Services { using global::System; using global::System.Net.Http; using global::System.Threading.Tasks; using global::Windows.Storage; public interface IEpisodeDownloader { Task SaveUrlAsync(StorageFolder folder, HttpClient client, string path); Task<StorageFolder> <API key>(); } }
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Threading; using Microsoft.AspNet.SignalR.Client; using Microsoft.Owin.Hosting; namespace SignalR_Ipc { public class Server { private readonly List<Process> _clients; private readonly int _numClients; public Server(int numClients) { _numClients = numClients; _clients = new List<Process>(numClients); } public void Run() { // start SignalR listening using (WebApp.Start<Startup>("http://+:8080/")) { // connect to the hub with the special server SignalR connection var hubConnection = new HubConnection("http://localhost:8080/"); var proxy = hubConnection.CreateHubProxy("IpcHub"); proxy.On("ShutDown", () => Console.WriteLine("Shutdown order received")); hubConnection.Start().Wait(); // Spin up some client processes for (var i = 0; i < _numClients; i++) { var startInfo = new ProcessStartInfo(Assembly.<API key>().ManifestModule.Name) { Arguments = i.ToString() }; var p1 = new Process { StartInfo = startInfo }; Console.WriteLine("Starting client " + i); p1.Start(); _clients.Add(p1); } // wait a bit Thread.Sleep(5000); // Request the names from the client processes for (var i = 0; i < _numClients; i++) { Console.WriteLine("Getting Name from client " + i); Console.WriteLine(proxy.Invoke<string>("GetName", i).Result); } // Spin down the clients after the user presses enter Console.WriteLine("Press enter to shutdown..."); Console.ReadLine(); proxy.Invoke("ShutDown"); while (_clients.Any(p => !p.HasExited)) { Thread.Sleep(100); } Console.WriteLine("Press enter to exit..."); Console.ReadLine(); } } } }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>JogAmp's MovieCube - GLMediaPlayer Demo 01 (NApplet)</title> </head> <body BGCOLOR="#ffffff"> <P> JogAmp's MovieCube - GLMediaPlayer Demo 01 </P> <P> <object classid="clsid:<API key>" width="800" height="600"> <param name="code" value="com.jogamp.newt.awt.applet.JOGLNewtApplet1Run"> <param name="archive" value="jar/gluegen-rt.jar, jar/joal.jar, jar/jogl-all.jar, jar/jogl-test.jar"> <param name="<API key>" value="com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieCube"> <param name="gl_profile" value="GL2ES2"> <param name="gl_swap_interval" value="1"> <param name="gl_debug" value="false"> <param name="gl_trace" value="false"> <comment> <embed code="com.jogamp.newt.awt.applet.JOGLNewtApplet1Run" width="800" height="600" type="application/x-java-applet;version=1.6" pluginspage="http://java.sun.com/javase/downloads/ea.jsp" archive="jar/gluegen-rt.jar, jar/joal.jar, jar/jogl-all.jar, jar/jogl-test.jar" codebase_lookup" value="false" <API key>="com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieCube" gl_profile="GL2ES2" gl_swap_interval="1" gl_debug="false" gl_trace="false"> <noembed>Sorry, no Java support detected.</noembed> </embed> </comment> </object> </P> <P> MovieCube Keys:<br> <ul> <li> BWD / FWD: <ul> <li> 01s - Cursor left/right</li> <li> 10s - Cursor down/up</li> <li> 30s - Page down/up</li> </ul></li> <li> Speed: <ul> <li> Pause - Space bar</li> <li> Half - Keypad minus</li> <li> Double - Keypad plus</li> <li> Reset - Keypad multiply</li> </ul></li> <li> Mute - M</li> </ul> </P> <P> JOGL NEWT JNLP Applet Runner Special Keys:<br> <ul> <li> d - toggle decoration </li> <li> f - toggle fullscreen </li> <li> r - in/out browser window </li> <li> a - on/off always-on-top </li> <li> c - change mouse pointer </li> <li> i - invisible mouse pointer </li> <li> w - warp mouse pointer to center </li> </ul> </P> </body> </html>
using System.Collections; using ModestTree; using UnityEngine; using UnityEngine.TestTools; using Zenject.Tests.Factories.PrefabFactory; namespace Zenject.Tests.Factories { public class TestPrefabFactory : <API key> { string <API key> { get { return "TestPrefabFactory/Foo"; } } GameObject FooPrefab { get { return FixtureUtil.GetPrefab(<API key>); } } string <API key> { get { return "TestPrefabFactory/Foo2"; } } GameObject Foo2Prefab { get { return FixtureUtil.GetPrefab(<API key>); } } [UnityTest] public IEnumerator Test1() { PreInstall(); Container.BindFactory<Object, Foo, Foo.Factory>().FromFactory<PrefabFactory<Foo>>(); Container.Bind<IInitializable>().To<Runner>().AsSingle().WithArguments(FooPrefab); PostInstall(); yield break; } [UnityTest] public IEnumerator Test2() { PreInstall(); Container.BindFactory<Object, string, Foo2, Foo2.Factory>().FromFactory<PrefabFactory<string, Foo2>>(); Container.Bind<IInitializable>().To<Runner2>().AsSingle().WithArguments(Foo2Prefab); PostInstall(); yield break; } [UnityTest] public IEnumerator TestResource1() { PreInstall(); Container.BindFactory<string, Foo, Foo.Factory2>().FromFactory<<API key><Foo>>(); Container.Bind<IInitializable>().To<Runner3>().AsSingle().WithArguments(<API key>); PostInstall(); yield break; } [UnityTest] public IEnumerator TestResource2() { PreInstall(); Container.BindFactory<string, string, Foo2, Foo2.Factory2>().FromFactory<<API key><string, Foo2>>(); Container.Bind<IInitializable>().To<Runner4>().AsSingle().WithArguments(<API key>); PostInstall(); yield break; } public class Runner : IInitializable { readonly GameObject _prefab; readonly Foo.Factory _fooFactory; public Runner( Foo.Factory fooFactory, GameObject prefab) { _prefab = prefab; _fooFactory = fooFactory; } public void Initialize() { var foo = _fooFactory.Create(_prefab); Assert.That(foo.WasInitialized); } } public class Runner2 : IInitializable { readonly GameObject _prefab; readonly Foo2.Factory _fooFactory; public Runner2( Foo2.Factory fooFactory, GameObject prefab) { _prefab = prefab; _fooFactory = fooFactory; } public void Initialize() { var foo = _fooFactory.Create(_prefab, "asdf"); Assert.IsEqual(foo.Value, "asdf"); } } public class Runner3 : IInitializable { readonly string _prefabPath; readonly Foo.Factory2 _fooFactory; public Runner3( Foo.Factory2 fooFactory, string prefabPath) { _prefabPath = prefabPath; _fooFactory = fooFactory; } public void Initialize() { var foo = _fooFactory.Create(_prefabPath); Assert.That(foo.WasInitialized); } } public class Runner4 : IInitializable { readonly string _prefabPath; readonly Foo2.Factory2 _fooFactory; public Runner4( Foo2.Factory2 fooFactory, string prefabPath) { _prefabPath = prefabPath; _fooFactory = fooFactory; } public void Initialize() { var foo = _fooFactory.Create(_prefabPath, "asdf"); Assert.IsEqual(foo.Value, "asdf"); } } } }
using System; using System.Collections.Generic; #if !NOT_UNITY3D using UnityEngine; #endif using ModestTree; namespace Zenject { [NoReflectionBaking] public class FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> : <API key> { public FactoryFromBinder( DiContainer container, BindInfo bindInfo, FactoryBindInfo factoryBindInfo) : base(container, typeof(TContract), bindInfo, factoryBindInfo) { } public <API key> FromMethod( #if !NET_4_6 && !NET_STANDARD_2_0 ModestTree.Util. #endif Func<DiContainer, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> method) { ProviderFunc = (container) => new <API key><TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>(method); return this; } // Shortcut for FromIFactory and also for backwards compatibility public <API key> FromFactory<TSubFactory>() where TSubFactory : IFactory<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> { return this.FromIFactory(x => x.To<TSubFactory>().AsCached()); } public <API key><TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> <API key>() { return <API key>(null); } public <API key><TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> <API key>(object subIdentifier) { return new <API key><TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>( BindContainer, BindInfo, FactoryBindInfo, subIdentifier); } } // These methods have to be extension methods for the UWP build (with .NET backend) to work correctly // When these are instance methods it takes a really long time then fails with <API key> public static class <API key> { public static <API key> FromIFactory<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>( this FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> fromBinder, Action<<API key><IFactory<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>>> <API key>) { Guid factoryId; <API key>( fromBinder.<API key><IFactory<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>>(out factoryId)); fromBinder.ProviderFunc = (container) => { return new IFactoryProvider<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>(container, factoryId); }; return new <API key>(fromBinder.BindInfo); } public static <API key> <API key><TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>( this FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> fromBinder) // Unfortunately we have to pass the same contract in again to satisfy the generic // constraints below where TContract : IPoolable<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, IMemoryPool> { return fromBinder.<API key><TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>(x => {}); } public static <API key> <API key><TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>( this FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> fromBinder, Action<<API key><TContract>> poolBindGenerator) // Unfortunately we have to pass the same contract in again to satisfy the generic // constraints below where TContract : IPoolable<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, IMemoryPool> { return fromBinder.<API key><TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract, PoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, IMemoryPool, TContract>>(poolBindGenerator); } #if !NOT_UNITY3D public static <API key> <API key><TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>( this FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> fromBinder) // Unfortunately we have to pass the same contract in again to satisfy the generic // constraints below where TContract : Component, IPoolable<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, IMemoryPool> { return fromBinder.<API key><TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>(x => {}); } public static <API key> <API key><TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>( this FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> fromBinder, Action<<API key><TContract>> poolBindGenerator) // Unfortunately we have to pass the same contract in again to satisfy the generic // constraints below where TContract : Component, IPoolable<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, IMemoryPool> { return fromBinder.<API key><TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract, <API key><TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, IMemoryPool, TContract>>(poolBindGenerator); } #endif public static <API key> <API key><TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract, TMemoryPool>( this FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> fromBinder) // Unfortunately we have to pass the same contract in again to satisfy the generic // constraints below where TContract : IPoolable<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, IMemoryPool> where TMemoryPool : MemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, IMemoryPool, TContract> { return fromBinder.<API key><TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract, TMemoryPool>(x => {}); } public static <API key> <API key><TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract, TMemoryPool>( this FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> fromBinder, Action<<API key><TContract>> poolBindGenerator) // Unfortunately we have to pass the same contract in again to satisfy the generic // constraints below where TContract : IPoolable<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, IMemoryPool> where TMemoryPool : MemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, IMemoryPool, TContract> { Assert.IsEqual(typeof(TContract), typeof(TContract)); // Use a random ID so that our provider is the only one that can find it and so it doesn't // conflict with anything else var poolId = Guid.NewGuid(); // Important to use NoFlush otherwise the binding will be finalized early var binder = fromBinder.BindContainer.<API key><TContract, TMemoryPool, TMemoryPool>() .WithId(poolId); // Always make it non lazy by default in case the user sets an InitialSize binder.NonLazy(); poolBindGenerator(binder); fromBinder.ProviderFunc = (container) => { return new <API key><TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract, TMemoryPool>(container, poolId); }; return new <API key>(fromBinder.BindInfo); } } }
import Vue from 'vue' import DarkMixin from '../../mixins/dark.js' import ListenersMixin from '../../mixins/listeners.js' import { slot } from '../../utils/slot.js' export default Vue.extend({ name: 'QTimeline', mixins: [ DarkMixin, ListenersMixin ], provide () { return { __timeline: this } }, props: { color: { type: String, default: 'primary' }, side: { type: String, default: 'right', validator: v => ['left', 'right'].includes(v) }, layout: { type: String, default: 'dense', validator: v => ['dense', 'comfortable', 'loose'].includes(v) } }, computed: { classes () { return `q-timeline--${this.layout} q-timeline--${this.layout}--${this.side}` + (this.isDark === true ? ' q-timeline--dark' : '') } }, render (h) { return h('ul', { staticClass: 'q-timeline', class: this.classes, on: { ...this.qListeners } }, slot(this, 'default')) } })
<?php class <API key> extends <API key> { /** * <API key> constructor. */ public function __construct() { parent::__construct(); // Set some defaults for our grid $this->setDefaultSort('id'); $this->setId('id'); $this->setDefaultDir('asc'); } /** * Collection class; * * @return string */ protected function _getCollectionClass() { // This is the model we are using for the grid return 'ddg_automation/wishlist_collection'; } /** * Prepare the grid collection. * * @return <API key> */ protected function _prepareCollection() { // Get and set our collection for the grid $collection = Mage::getResourceModel($this->_getCollectionClass()); $this->setCollection($collection); return parent::_prepareCollection(); } /** * Prepare the grid collumns. * * @return <API key> * @throws Exception */ protected function _prepareColumns() { $this->addColumn( 'wishlist_id', array( 'header' => Mage::helper('ddg')->__('Wishlist ID'), 'align' => 'left', 'width' => '50px', 'index' => 'wishlist_id', 'type' => 'number', 'escape' => true ) )->addColumn( 'customer_id', array( 'header' => Mage::helper('ddg')->__('Customer ID'), 'align' => 'left', 'width' => '50px', 'index' => 'customer_id', 'type' => 'number', 'escape' => true ) )->addColumn( 'item_count', array( 'header' => Mage::helper('ddg')->__('Item Count'), 'align' => 'left', 'width' => '50px', 'index' => 'item_count', 'type' => 'number', 'escape' => true ) )->addColumn( 'wishlist_imported', array( 'header' => Mage::helper('ddg')->__( 'Wishlist Imported' ), 'align' => 'center', 'width' => '50px', 'index' => 'wishlist_imported', 'type' => 'options', 'escape' => true, 'renderer' => 'ddg_automation/<API key>', 'options' => Mage::getModel( 'ddg_automation/<API key>' )->getOptions(), '<API key>' => array($this, '<API key>') ) )->addColumn( 'wishlist_modified', array( 'header' => Mage::helper('ddg')->__( 'Wishlist Modified' ), 'align' => 'center', 'width' => '50px', 'index' => 'wishlist_modified', 'type' => 'options', 'escape' => true, 'renderer' => 'ddg_automation/<API key>', 'options' => Mage::getModel( 'ddg_automation/<API key>' )->getOptions(), '<API key>' => array($this, '<API key>') ) )->addColumn( 'created_at', array( 'header' => Mage::helper('ddg')->__('Created At'), 'width' => '50px', 'align' => 'center', 'index' => 'created_at', 'type' => 'datetime', 'escape' => true, ) )->addColumn( 'updated_at', array( 'header' => Mage::helper('ddg')->__('Updated At'), 'width' => '50px', 'align' => 'center', 'index' => 'updated_at', 'type' => 'datetime', 'escape' => true, ) ); return parent::_prepareColumns(); } /** * Callback action for the imported subscribers/contacts. * * @param $collection * @param $column */ public function <API key>($collection, $column) { $field = $column->getFilterIndex() ? $column->getFilterIndex() : $column->getIndex(); $value = $column->getFilter()->getValue(); if ($value == 'null') { $collection->addFieldToFilter($field, array('null' => true)); } else { $collection->addFieldToFilter($field, array('notnull' => true)); } } }
using NQuery.Text; namespace NQuery.Authoring.Outlining { public struct OutliningRegionSpan { public OutliningRegionSpan(TextSpan span, string text) { Span = span; Text = text; } public TextSpan Span { get; } public string Text { get; } } }
require 'test_helper' module HotenticEngine class PageTest < ActiveSupport::TestCase # test "the truth" do # assert true # end end end
# coding: utf-8 require "operating_report/tracker/api/toggl" module OperatingReport module Exec module Create class Base def initialize(args) @t = args[:datetime] @tog = OperatingReport::Tracker::Api::Toggl.new( 'token' => OperatingReport::config['tracker']['api']['token'] ) @map = {} end def run() start_date = _get_start_date(@t) end_date = _get_end_date(@t) body, total_time = _get_entries(start_date, end_date) printf ": %s\n", _generate_title(start_date, end_date) printf ": %.2fh\n", total_time.quo(60 * 60) output_body(body, total_time) end def _get_entries(start_date, end_date) response = @tog.get_time_entries(start_date, end_date) if response.count == 100 then abort "[\e[31mError\e[0m] The record number in the period is possibly over 100." end body = {} total_time = 0 pids = [] response.each do |r| pid = r['pid'] || 0; pids << pid if pid != 0 desc = r['description'] || '' body[pid] = {items:{}, duration:0} unless body[pid] body[pid][:items][desc] = {duration:0, tags:[]} unless body[pid][:items][desc] body[pid][:items][desc][:tags].concat(r['tags']) if r['tags'] body[pid][:items][desc][:duration] += r['duration'].to_i body[pid][:duration] += r['duration'].to_i total_time += r['duration'].to_i end pids.uniq! _store_project_map(pids) data = {} body.each do |pid, d| cid = 0 if @map[:pid][pid] && @map[:pid][pid]['cid'] cid = @map[:pid][pid]['cid'] end data[cid] = {duration:0, items:{}} unless data[cid] data[cid][:items][pid] = d data[cid][:duration] += d[:duration] end return data, total_time end def _get_project_name(pid) return '' if pid == 0 return @map[:pid][pid]['name'] end def _get_client_name(cid) return '' if cid == 0 return @map[:cid][cid]['name'] end def _store_project_map(pids) cids = [] pids.each do |pid| next if pid == 0 response = @tog.get_project_data(pid.to_s) @map[:pid] = {} unless @map[:pid] @map[:pid][pid] = response['data'] cids << response['data']['cid'] if response['data']['cid'] end _store_client_map(cids) end def _store_client_map(cids) cids.each do |cid| next if cid == 0 response = @tog.get_client_data(cid.to_s) @map[:cid] = {} unless @map[:cid] @map[:cid][cid] = response['data'] end end def _get_title() abort("Undefined method.") end def _get_start_date() abort("Undefined method.") end def _get_end_date() abort("Undefined method.") end def _get_formated_date(t) t.strftime('%Y/%m/%d') end end end end end