text:
namespace Figlut.Desktop.DataBox.AuxilaryUI
{
    partial class SelectParentDataBoxForm
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.mnuMain = new Figlut.Server.Toolkit.Winforms.CustomMainMenu();
            this.mnuSelect = new System.Windows.Forms.ToolStripMenuItem();
            this.mnuCancel = new System.Windows.Forms.ToolStripMenuItem();
            this.lstParentDataBoxes = new System.Windows.Forms.ListBox();
            this.pnlFormContent.SuspendLayout();
            this.mnuMain.SuspendLayout();
            this.SuspendLayout();
            //
            // pnlFormContent
            //
            this.pnlFormContent.Controls.Add(this.lstParentDataBoxes);
            this.pnlFormContent.Size = new System.Drawing.Size(313, 249);
            //
            // pnlFormRight
            //
            this.pnlFormRight.Location = new System.Drawing.Point(328, 21);
            this.pnlFormRight.Size = new System.Drawing.Size(15, 249);
            //
            // pnlFormLeft
            //
            this.pnlFormLeft.Size = new System.Drawing.Size(15, 249);
            //
            // lblFormTitle
            //
            this.lblFormTitle.Size = new System.Drawing.Size(343, 21);
            this.lblFormTitle.Text = "Select Parent DataBox ";
            this.lblFormTitle.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lstParentDataBoxes_MouseDown);
            this.lblFormTitle.MouseMove += new System.Windows.Forms.MouseEventHandler(this.lstParentDataBoxes_MouseMove);
            this.lblFormTitle.MouseUp += new System.Windows.Forms.MouseEventHandler(this.lstParentDataBoxes_MouseUp);
            //
            // statusMain
            //
            this.statusMain.Location = new System.Drawing.Point(0, 270);
            this.statusMain.Size = new System.Drawing.Size(343, 21);
            this.statusMain.Text = "Select parent DataBox.";
            //
            // mnuMain
            //
            this.mnuMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.mnuSelect,
            this.mnuCancel});
            this.mnuMain.Location = new System.Drawing.Point(15, 21);
            this.mnuMain.MenuStripGradientBegin = System.Drawing.Color.White;
            this.mnuMain.MenuStripGradientEnd = System.Drawing.Color.White;
            this.mnuMain.Name = "mnuMain";
            this.mnuMain.Size = new System.Drawing.Size(313, 24);
            this.mnuMain.TabIndex = 159;
            this.mnuMain.Text = "customMainMenu1";
            //
            // mnuSelect
            //
            this.mnuSelect.Name = "mnuSelect";
            this.mnuSelect.Size = new System.Drawing.Size(50, 20);
            this.mnuSelect.Text = "&Select";
            this.mnuSelect.Click += new System.EventHandler(this.mnuSelect_Click);
            //
            // mnuCancel
            //
            this.mnuCancel.Name = "mnuCancel";
            this.mnuCancel.Size = new System.Drawing.Size(55, 20);
            this.mnuCancel.Text = "&Cancel";
            this.mnuCancel.Click += new System.EventHandler(this.mnuCancel_Click);
            //
            // lstParentDataBoxes
            //
            this.lstParentDataBoxes.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.lstParentDataBoxes.FormattingEnabled = true;
            this.lstParentDataBoxes.Location = new System.Drawing.Point(0, 24);
            this.lstParentDataBoxes.Name = "lstParentDataBoxes";
            this.lstParentDataBoxes.Size = new System.Drawing.Size(313, 225);
            this.lstParentDataBoxes.TabIndex = 0;
            //
            // SelectParentDataBoxForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(343, 291);
            this.Controls.Add(this.mnuMain);
            this.FormTitle = "Select Parent DataBox";
            this.Name = "SelectParentDataBoxForm";
            this.ShowInTaskbar = false;
            this.Status = "Select parent DataBox.";
            this.Text = "Select Parent DataBox";
            this.Load += new System.EventHandler(this.SelectParentDataBoxForm_Load);
            this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.SelectParentDataBoxForm_KeyUp);
            this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lstParentDataBoxes_MouseDown);
            this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.lstParentDataBoxes_MouseMove);
            this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.lstParentDataBoxes_MouseUp);
            this.Controls.SetChildIndex(this.statusMain, 0);
            this.Controls.SetChildIndex(this.lblFormTitle, 0);
            this.Controls.SetChildIndex(this.pnlFormLeft, 0);
            this.Controls.SetChildIndex(this.pnlFormRight, 0);
            this.Controls.SetChildIndex(this.pnlFormContent, 0);
            this.Controls.SetChildIndex(this.mnuMain, 0);
            this.pnlFormContent.ResumeLayout(false);
            this.mnuMain.ResumeLayout(false);
            this.mnuMain.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private Server.Toolkit.Winforms.CustomMainMenu mnuMain;
        private System.Windows.Forms.ToolStripMenuItem mnuSelect;
        private System.Windows.Forms.ToolStripMenuItem mnuCancel;
        private System.Windows.Forms.ListBox lstParentDataBoxes;

    }
}


text:
<!DOCTYPE html>

  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="HandheldFriendly" content="true" />
  <link rel="shortcut icon" href="https://www.epa.gov/sites/all/themes/epa/favicon.ico" type="image/vnd.microsoft.icon" />
  <meta name="MobileOptimized" content="width" />
  <meta http-equiv="cleartype" content="on" />
  <meta http-equiv="ImageToolbar" content="false" />
  <meta name="viewport" content="width=device-width" />
  <meta name="version" content="20161218" />

  <meta name="DC.description" content="" />
  <meta name="DC.title" content="" />
  <title>
  Reagentless Field-Usable Fixed-Site and Portable Analyzer for Trihalomethane (THM) Concentrations in Drinking Water|

  Research Project Database | Grantee Research Project | ORD | US EPA</title>

  <meta name="keywords" content="" />
  <link rel="shortlink" href="" />
  <link rel="canonical" href="" />
  <meta name="DC.creator" content="" />
  <meta name="DC.language" content="en" />
  <meta name="DC.Subject.epachannel" content="" />
  <meta name="DC.type" content="" />
  <meta name="DC.date.created" content="" />
  <meta name="DC.date.modified" content="2010-05-06" />

  <link type="text/css" rel="stylesheet" href="https://www.epa.gov/misc/ui/jquery.ui.autocomplete.css" media="all" />
  <link type="text/css" rel="stylesheet" href="https://www.epa.gov/sites/all/themes/epa/css/lib/jquery.ui.theme.css" media="all" />
  <link type="text/css" rel="stylesheet" href="https://www.epa.gov/sites/all/libraries/template2/s.css" media="all" />

	<link rel="alternate" type="application/atom+xml" title="EPA.gov All Press Releases" href="https://www.epa.gov/newsreleases/search/rss" />
	<link rel="alternate" type="application/atom+xml" title="EPA.gov Headquarters Press Releases" href="https://www.epa.gov/newsreleases/search/rss/field_press_office/headquarters" />
	<link rel="alternate" type="application/atom+xml" title="Greenversations, EPA's Blog" href="https://blog.epa.gov/blog/feed/" />

Jump to main content

  <hgroup class="site-name-and-slogan">

US EPA

United States Environmental Protection Agency

  </hgroup>
  <form class="epa-search" method="get" action="https://search.epa.gov/epasearch/epasearch">
    Search
    <input class="form-text" placeholder="Search EPA.gov" name="querytext" id="search-box" value=""/>
    <button class="epa-search-button" id="search-button" type="submit" title="Search">Search</button>
    <input type="hidden" name="fld" value="" />
    <input type="hidden" name="areaname" value="" />
    <input type="hidden" name="areacontacts" value="" />
    <input type="hidden" name="areasearchurl" value="" />
    <input type="hidden" name="typeofsearch" value="epa" />
    <input type="hidden" name="result_template" value="2col.ftl" />
    <input type="hidden" name="filter" value="sample4filt.hts" />
  </form>

Contact Us

Project Research Results

Final Report

SBIR Phase I

                              | Final Report

                      1 publications for this project

Related Information

Research Grants

P3: Student Design Competition

Research Fellowships

Small Business Innovation Research (SBIR)

Grantee Research Project Results Search

      Reagentless Field-Usable Fixed-Site and Portable Analyzer for Trihalomethane (THM) Concentrations in Drinking Water

    EPA Contract Number: EPD10060

    Title: Reagentless Field-Usable Fixed-Site and Portable Analyzer for Trihalomethane (THM) Concentrations in Drinking Water

    Investigators:
     Findlay, Mel

    Small Business:

      KWJ Engineering, Inc.

    	EPA Contact:

           Manager, SBIR Program

        Phase: II

      Project Period:
      May 1, 2010 through
        April 30, 2012

        Project Amount:

          $224,713

      RFA:
      Small Business Innovation Research (SBIR) - Phase II (2010)

          Recipients Lists

      Research Category:

          Small Business Innovation Research (SBIR)
          ,
          SBIR - Water and Wastewater

Description:

U.S. Environmental Protection Agency (EPA) rules stipulate that corrective action be taken for drinking water distribution systems that exceed the maximum contaminant level (MCL) for total trihalomethanes (TTHMs), 80 μg/L. Currently, real-time or even periodic monitoring of drinking water is not economically feasible. Available methods use gas chromatography and are expensive and plagued with long delay times between sample collection and results. Laboratory analysis requires sample collection, packaging and shipping, tracking and recordkeeping, and disposal of samples. A sensor allowing rapid response, real-time measurement of TTHM concentrations in water systems would be ideal for identifying contaminant "hot spots" and allowing system operators to implement mitigation strategies and monitor changes.

A team including the principal investigator developed such a sensor in the 1990s--the RCI sensor. This sensor was fabricated from a mixture of rare-earth elements sintered in a silica matrix, a procedure very similar to that used for the heated metal oxide sensor (HMOS). Unlike HMOSs, this RCI sensor was extremely sensitive to chlorinated organic vapors and not at all sensitive to hydrocarbons. The sensor was very effective but relatively large and expensive. The goal of this project is to develop and demonstrate feasibility of a microelectromechanical systems (MEMS) version of this sensor, a prototype analyzer, and simple analytical method that can measure TTHM at concentrations below the EPA-regulated level of 80 μg/L in water. The MEMS approach will yield a modern sensor with a tiny economical footprint and high performance.

KWJ recently has developed a MEMS platform on which multiple classes of chemical sensors can be fabricated, including the RCI sensor, and there is opportunity to leverage this work with this SBIR project. In Phase I of this SBIR project, KWJ developed a MEMS planar sensor chip with the rare-earth sensory coating and demonstrated that it is responsive to THMs at low ppb levels. In Phase II, KWJ will integrate the sensor into an analyzer and develop a method for effective monitoring of TTHMs in drinking water that will save significant time and materials and provide a new field capability for environmental protection.

In Phase I, KWJ fabricated and tested a MEMS planar version of the sensor, demonstrating the ability to detect less than 5ppbv CHCl3, less than 15ppbv CHBr3 in gas phase, and less than 10 and 20 μg/L, respectively, in water without pre-concentration. The Phase II research effort will focus on optimizing the sensor and sampler design. KWJ will build, instrument, develop, and validate a simple sensor-method with a target of less than 1 μg/L for all THM species. The resulting analyzer will make analytical quality monitoring of drinking water for TTHMs possible virtually anywhere, at any time, on-the-spot, and at low cost. Additional applications made possible will include pool and spa as well as industrial water and groundwater monitoring.

Publications and Presentations:

        Publications have been submitted on this project: View all 1 publications for this project

Supplemental Keywords:

      small business, SBIR, EPA, drinking water, water monitoring, maximum contaminant level, MCL, trihalomethanes, THMs, rare-earth elements, sensor, heated metal oxide sensor, HMOS, chlorinated organic vapors, microelectromechanical systems, MEMS, analyzer, planar sensor chip, water pollution, groundwater, portable water analyzer,

Progress and Final Reports:

                Final Report

SBIR Phase I:

              Reagentless Field-Usable Fixed-Site and Portable Analyzer for Trihalomethane (THM) Concentrations in Drinking Water

               | Final Report

Top of Page

 The perspectives, information and conclusions conveyed in research project abstracts, progress reports, final reports, journal abstracts and journal publications convey the viewpoints of the principal investigator and may not represent the views and policies of ORD and EPA.  Conclusions drawn by the principal investigators have not been reviewed by the Agency.

Main menu

Environmental Topics

Laws & Regulations

About EPA

Discover.

Accessibility

EPA Administrator

Budget & Performance

Contracting

Grants

No FEAR Act Data

Privacy and Security

Connect.

Data.gov

Inspector General

Jobs

Newsroom

Open Government

Regulations.gov

Subscribe

USA.gov

White House

Ask.

Contact Us

Hotlines

FOIA Requests

Frequent Questions

Follow.

Facebook

Twitter

YouTube

Flickr

Instagram

Last updated on Thursday, May 6, 2010

redpajama_set_name: RedPajamaGithub


text:
'use strict';

/**
 * Module dependencies
 */
var kategorisPolicy = require('../policies/kategoris.server.policy'),
  kategoris = require('../controllers/kategoris.server.controller');

module.exports = function(app) {
  // Kategoris Routes
  app.route('/api/kategoris').all(kategorisPolicy.isAllowed)
    .get(kategoris.list)
    .post(kategoris.create);

  app.route('/api/kategoris/:kategoriId').all(kategorisPolicy.isAllowed)
    .get(kategoris.read)
    .put(kategoris.update)
    .delete(kategoris.delete);

  // Finish by binding the Kategori middleware
  app.param('kategoriId', kategoris.kategoriByID);
};


text:
Convex primitives library (e.g. hull, gjk, intersection) in plain C.

This is an extract of geometrical tools used in [Solfec] (https://github.com/tkoziara/solfec). The code includes:

* convex polytope intersection (cvi.h, tri.h)
* convex hull calculation (hul.h)
* GJK proximity tests for polytopes and ellipsoids (gjk.h)
* simplex integration (spx.h)
* approximate triangle-sphere intersection (tsi.h)
* axis aligned bounding box overlap detection (hyb.h)
* kd-tree (kdt.h)
* rb-tree based maps and sets (map.h, set.h)
* linked list sorting (lis.h)
* memory pool (mem.h)


text:
using Audiotica.Web.Extensions;
using Audiotica.Web.Models;
using NUnit.Framework;

namespace Audiotica.Web.Test
{
    [TestFixture]
    public class MatchSongExtensionsTest
    {
        [Test]
        public void SetNameAndArtistFromTitle()
        {
            var match = new MatchSong();
            match.SetNameAndArtistFromTitle("Childish Gambino - 3005", true);
            Assert.AreEqual(match.Title, "3005");
            Assert.AreEqual(match.Artist, "Childish Gambino");
        }
    }
}


text:
using System;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Core.Pipeline;
using Azure.ResourceManager.Sql.Models;

namespace Azure.ResourceManager.Sql
{
    internal partial class ManagedInstanceLongTermRetentionPoliciesRestOperations
    {
        private string subscriptionId;
        private Uri endpoint;
        private ClientDiagnostics _clientDiagnostics;
        private HttpPipeline _pipeline;

        /// <summary> Initializes a new instance of ManagedInstanceLongTermRetentionPoliciesRestOperations. </summary>
        /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param>
        /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param>
        /// <param name="subscriptionId"> The subscription ID that identifies an Azure subscription. </param>
        /// <param name="endpoint"> server parameter. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="subscriptionId"/> is null. </exception>
        public ManagedInstanceLongTermRetentionPoliciesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null)
        {
            if (subscriptionId == null)
            {
                throw new ArgumentNullException(nameof(subscriptionId));
            }
            endpoint ??= new Uri("https://management.azure.com");

            this.subscriptionId = subscriptionId;
            this.endpoint = endpoint;
            _clientDiagnostics = clientDiagnostics;
            _pipeline = pipeline;
        }

        internal HttpMessage CreateGetRequest(string resourceGroupName, string managedInstanceName, string databaseName, ManagedInstanceLongTermRetentionPolicyName policyName)
        {
            var message = _pipeline.CreateMessage();
            var request = message.Request;
            request.Method = RequestMethod.Get;
            var uri = new RawRequestUriBuilder();
            uri.Reset(endpoint);
            uri.AppendPath("/subscriptions/", false);
            uri.AppendPath(subscriptionId, true);
            uri.AppendPath("/resourceGroups/", false);
            uri.AppendPath(resourceGroupName, true);
            uri.AppendPath("/providers/Microsoft.Sql/managedInstances/", false);
            uri.AppendPath(managedInstanceName, true);
            uri.AppendPath("/databases/", false);
            uri.AppendPath(databaseName, true);
            uri.AppendPath("/backupLongTermRetentionPolicies/", false);
            uri.AppendPath(policyName.ToString(), true);
            uri.AppendQuery("api-version", "2018-06-01-preview", true);
            request.Uri = uri;
            request.Headers.Add("Accept", "application/json");
            return message;
        }

        /// <summary> Gets a managed database's long term retention policy. </summary>
        /// <param name="resourceGroupName"> The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. </param>
        /// <param name="managedInstanceName"> The name of the managed instance. </param>
        /// <param name="databaseName"> The name of the database. </param>
        /// <param name="policyName"> The policy name. Should always be Default. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/>, <paramref name="managedInstanceName"/>, or <paramref name="databaseName"/> is null. </exception>
        public async Task<Response<ManagedInstanceLongTermRetentionPolicy>> GetAsync(string resourceGroupName, string managedInstanceName, string databaseName, ManagedInstanceLongTermRetentionPolicyName policyName, CancellationToken cancellationToken = default)
        {
            if (resourceGroupName == null)
            {
                throw new ArgumentNullException(nameof(resourceGroupName));
            }
            if (managedInstanceName == null)
            {
                throw new ArgumentNullException(nameof(managedInstanceName));
            }
            if (databaseName == null)
            {
                throw new ArgumentNullException(nameof(databaseName));
            }

            using var message = CreateGetRequest(resourceGroupName, managedInstanceName, databaseName, policyName);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
            switch (message.Response.Status)
            {
                case 200:
                    {
                        ManagedInstanceLongTermRetentionPolicy value = default;
                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
                        value = ManagedInstanceLongTermRetentionPolicy.DeserializeManagedInstanceLongTermRetentionPolicy(document.RootElement);
                        return Response.FromValue(value, message.Response);
                    }
                default:
                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
            }
        }

        /// <summary> Gets a managed database's long term retention policy. </summary>
        /// <param name="resourceGroupName"> The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. </param>
        /// <param name="managedInstanceName"> The name of the managed instance. </param>
        /// <param name="databaseName"> The name of the database. </param>
        /// <param name="policyName"> The policy name. Should always be Default. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/>, <paramref name="managedInstanceName"/>, or <paramref name="databaseName"/> is null. </exception>
        public Response<ManagedInstanceLongTermRetentionPolicy> Get(string resourceGroupName, string managedInstanceName, string databaseName, ManagedInstanceLongTermRetentionPolicyName policyName, CancellationToken cancellationToken = default)
        {
            if (resourceGroupName == null)
            {
                throw new ArgumentNullException(nameof(resourceGroupName));
            }
            if (managedInstanceName == null)
            {
                throw new ArgumentNullException(nameof(managedInstanceName));
            }
            if (databaseName == null)
            {
                throw new ArgumentNullException(nameof(databaseName));
            }

            using var message = CreateGetRequest(resourceGroupName, managedInstanceName, databaseName, policyName);
            _pipeline.Send(message, cancellationToken);
            switch (message.Response.Status)
            {
                case 200:
                    {
                        ManagedInstanceLongTermRetentionPolicy value = default;
                        using var document = JsonDocument.Parse(message.Response.ContentStream);
                        value = ManagedInstanceLongTermRetentionPolicy.DeserializeManagedInstanceLongTermRetentionPolicy(document.RootElement);
                        return Response.FromValue(value, message.Response);
                    }
                default:
                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
            }
        }

        internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string managedInstanceName, string databaseName, ManagedInstanceLongTermRetentionPolicyName policyName, ManagedInstanceLongTermRetentionPolicy parameters)
        {
            var message = _pipeline.CreateMessage();
            var request = message.Request;
            request.Method = RequestMethod.Put;
            var uri = new RawRequestUriBuilder();
            uri.Reset(endpoint);
            uri.AppendPath("/subscriptions/", false);
            uri.AppendPath(subscriptionId, true);
            uri.AppendPath("/resourceGroups/", false);
            uri.AppendPath(resourceGroupName, true);
            uri.AppendPath("/providers/Microsoft.Sql/managedInstances/", false);
            uri.AppendPath(managedInstanceName, true);
            uri.AppendPath("/databases/", false);
            uri.AppendPath(databaseName, true);
            uri.AppendPath("/backupLongTermRetentionPolicies/", false);
            uri.AppendPath(policyName.ToString(), true);
            uri.AppendQuery("api-version", "2018-06-01-preview", true);
            request.Uri = uri;
            request.Headers.Add("Content-Type", "application/json");
            request.Headers.Add("Accept", "application/json");
            var content = new Utf8JsonRequestContent();
            content.JsonWriter.WriteObjectValue(parameters);
            request.Content = content;
            return message;
        }

        /// <summary> Sets a managed database's long term retention policy. </summary>
        /// <param name="resourceGroupName"> The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. </param>
        /// <param name="managedInstanceName"> The name of the managed instance. </param>
        /// <param name="databaseName"> The name of the database. </param>
        /// <param name="policyName"> The policy name. Should always be Default. </param>
        /// <param name="parameters"> The long term retention policy info. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/>, <paramref name="managedInstanceName"/>, <paramref name="databaseName"/>, or <paramref name="parameters"/> is null. </exception>
        public async Task<Response> CreateOrUpdateAsync(string resourceGroupName, string managedInstanceName, string databaseName, ManagedInstanceLongTermRetentionPolicyName policyName, ManagedInstanceLongTermRetentionPolicy parameters, CancellationToken cancellationToken = default)
        {
            if (resourceGroupName == null)
            {
                throw new ArgumentNullException(nameof(resourceGroupName));
            }
            if (managedInstanceName == null)
            {
                throw new ArgumentNullException(nameof(managedInstanceName));
            }
            if (databaseName == null)
            {
                throw new ArgumentNullException(nameof(databaseName));
            }
            if (parameters == null)
            {
                throw new ArgumentNullException(nameof(parameters));
            }

            using var message = CreateCreateOrUpdateRequest(resourceGroupName, managedInstanceName, databaseName, policyName, parameters);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
            switch (message.Response.Status)
            {
                case 200:
                case 202:
                    return message.Response;
                default:
                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
            }
        }

        /// <summary> Sets a managed database's long term retention policy. </summary>
        /// <param name="resourceGroupName"> The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. </param>
        /// <param name="managedInstanceName"> The name of the managed instance. </param>
        /// <param name="databaseName"> The name of the database. </param>
        /// <param name="policyName"> The policy name. Should always be Default. </param>
        /// <param name="parameters"> The long term retention policy info. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/>, <paramref name="managedInstanceName"/>, <paramref name="databaseName"/>, or <paramref name="parameters"/> is null. </exception>
        public Response CreateOrUpdate(string resourceGroupName, string managedInstanceName, string databaseName, ManagedInstanceLongTermRetentionPolicyName policyName, ManagedInstanceLongTermRetentionPolicy parameters, CancellationToken cancellationToken = default)
        {
            if (resourceGroupName == null)
            {
                throw new ArgumentNullException(nameof(resourceGroupName));
            }
            if (managedInstanceName == null)
            {
                throw new ArgumentNullException(nameof(managedInstanceName));
            }
            if (databaseName == null)
            {
                throw new ArgumentNullException(nameof(databaseName));
            }
            if (parameters == null)
            {
                throw new ArgumentNullException(nameof(parameters));
            }

            using var message = CreateCreateOrUpdateRequest(resourceGroupName, managedInstanceName, databaseName, policyName, parameters);
            _pipeline.Send(message, cancellationToken);
            switch (message.Response.Status)
            {
                case 200:
                case 202:
                    return message.Response;
                default:
                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
            }
        }

        internal HttpMessage CreateListByDatabaseRequest(string resourceGroupName, string managedInstanceName, string databaseName)
        {
            var message = _pipeline.CreateMessage();
            var request = message.Request;
            request.Method = RequestMethod.Get;
            var uri = new RawRequestUriBuilder();
            uri.Reset(endpoint);
            uri.AppendPath("/subscriptions/", false);
            uri.AppendPath(subscriptionId, true);
            uri.AppendPath("/resourceGroups/", false);
            uri.AppendPath(resourceGroupName, true);
            uri.AppendPath("/providers/Microsoft.Sql/managedInstances/", false);
            uri.AppendPath(managedInstanceName, true);
            uri.AppendPath("/databases/", false);
            uri.AppendPath(databaseName, true);
            uri.AppendPath("/backupLongTermRetentionPolicies", false);
            uri.AppendQuery("api-version", "2018-06-01-preview", true);
            request.Uri = uri;
            request.Headers.Add("Accept", "application/json");
            return message;
        }

        /// <summary> Gets a database's long term retention policy. </summary>
        /// <param name="resourceGroupName"> The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. </param>
        /// <param name="managedInstanceName"> The name of the managed instance. </param>
        /// <param name="databaseName"> The name of the database. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/>, <paramref name="managedInstanceName"/>, or <paramref name="databaseName"/> is null. </exception>
        public async Task<Response<ManagedInstanceLongTermRetentionPolicyListResult>> ListByDatabaseAsync(string resourceGroupName, string managedInstanceName, string databaseName, CancellationToken cancellationToken = default)
        {
            if (resourceGroupName == null)
            {
                throw new ArgumentNullException(nameof(resourceGroupName));
            }
            if (managedInstanceName == null)
            {
                throw new ArgumentNullException(nameof(managedInstanceName));
            }
            if (databaseName == null)
            {
                throw new ArgumentNullException(nameof(databaseName));
            }

            using var message = CreateListByDatabaseRequest(resourceGroupName, managedInstanceName, databaseName);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
            switch (message.Response.Status)
            {
                case 200:
                    {
                        ManagedInstanceLongTermRetentionPolicyListResult value = default;
                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
                        value = ManagedInstanceLongTermRetentionPolicyListResult.DeserializeManagedInstanceLongTermRetentionPolicyListResult(document.RootElement);
                        return Response.FromValue(value, message.Response);
                    }
                default:
                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
            }
        }

        /// <summary> Gets a database's long term retention policy. </summary>
        /// <param name="resourceGroupName"> The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. </param>
        /// <param name="managedInstanceName"> The name of the managed instance. </param>
        /// <param name="databaseName"> The name of the database. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/>, <paramref name="managedInstanceName"/>, or <paramref name="databaseName"/> is null. </exception>
        public Response<ManagedInstanceLongTermRetentionPolicyListResult> ListByDatabase(string resourceGroupName, string managedInstanceName, string databaseName, CancellationToken cancellationToken = default)
        {
            if (resourceGroupName == null)
            {
                throw new ArgumentNullException(nameof(resourceGroupName));
            }
            if (managedInstanceName == null)
            {
                throw new ArgumentNullException(nameof(managedInstanceName));
            }
            if (databaseName == null)
            {
                throw new ArgumentNullException(nameof(databaseName));
            }

            using var message = CreateListByDatabaseRequest(resourceGroupName, managedInstanceName, databaseName);
            _pipeline.Send(message, cancellationToken);
            switch (message.Response.Status)
            {
                case 200:
                    {
                        ManagedInstanceLongTermRetentionPolicyListResult value = default;
                        using var document = JsonDocument.Parse(message.Response.ContentStream);
                        value = ManagedInstanceLongTermRetentionPolicyListResult.DeserializeManagedInstanceLongTermRetentionPolicyListResult(document.RootElement);
                        return Response.FromValue(value, message.Response);
                    }
                default:
                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
            }
        }

        internal HttpMessage CreateListByDatabaseNextPageRequest(string nextLink, string resourceGroupName, string managedInstanceName, string databaseName)
        {
            var message = _pipeline.CreateMessage();
            var request = message.Request;
            request.Method = RequestMethod.Get;
            var uri = new RawRequestUriBuilder();
            uri.Reset(endpoint);
            uri.AppendRawNextLink(nextLink, false);
            request.Uri = uri;
            request.Headers.Add("Accept", "application/json");
            return message;
        }

        /// <summary> Gets a database's long term retention policy. </summary>
        /// <param name="nextLink"> The URL to the next page of results. </param>
        /// <param name="resourceGroupName"> The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. </param>
        /// <param name="managedInstanceName"> The name of the managed instance. </param>
        /// <param name="databaseName"> The name of the database. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="nextLink"/>, <paramref name="resourceGroupName"/>, <paramref name="managedInstanceName"/>, or <paramref name="databaseName"/> is null. </exception>
        public async Task<Response<ManagedInstanceLongTermRetentionPolicyListResult>> ListByDatabaseNextPageAsync(string nextLink, string resourceGroupName, string managedInstanceName, string databaseName, CancellationToken cancellationToken = default)
        {
            if (nextLink == null)
            {
                throw new ArgumentNullException(nameof(nextLink));
            }
            if (resourceGroupName == null)
            {
                throw new ArgumentNullException(nameof(resourceGroupName));
            }
            if (managedInstanceName == null)
            {
                throw new ArgumentNullException(nameof(managedInstanceName));
            }
            if (databaseName == null)
            {
                throw new ArgumentNullException(nameof(databaseName));
            }

            using var message = CreateListByDatabaseNextPageRequest(nextLink, resourceGroupName, managedInstanceName, databaseName);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
            switch (message.Response.Status)
            {
                case 200:
                    {
                        ManagedInstanceLongTermRetentionPolicyListResult value = default;
                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
                        value = ManagedInstanceLongTermRetentionPolicyListResult.DeserializeManagedInstanceLongTermRetentionPolicyListResult(document.RootElement);
                        return Response.FromValue(value, message.Response);
                    }
                default:
                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
            }
        }

        /// <summary> Gets a database's long term retention policy. </summary>
        /// <param name="nextLink"> The URL to the next page of results. </param>
        /// <param name="resourceGroupName"> The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. </param>
        /// <param name="managedInstanceName"> The name of the managed instance. </param>
        /// <param name="databaseName"> The name of the database. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="nextLink"/>, <paramref name="resourceGroupName"/>, <paramref name="managedInstanceName"/>, or <paramref name="databaseName"/> is null. </exception>
        public Response<ManagedInstanceLongTermRetentionPolicyListResult> ListByDatabaseNextPage(string nextLink, string resourceGroupName, string managedInstanceName, string databaseName, CancellationToken cancellationToken = default)
        {
            if (nextLink == null)
            {
                throw new ArgumentNullException(nameof(nextLink));
            }
            if (resourceGroupName == null)
            {
                throw new ArgumentNullException(nameof(resourceGroupName));
            }
            if (managedInstanceName == null)
            {
                throw new ArgumentNullException(nameof(managedInstanceName));
            }
            if (databaseName == null)
            {
                throw new ArgumentNullException(nameof(databaseName));
            }

            using var message = CreateListByDatabaseNextPageRequest(nextLink, resourceGroupName, managedInstanceName, databaseName);
            _pipeline.Send(message, cancellationToken);
            switch (message.Response.Status)
            {
                case 200:
                    {
                        ManagedInstanceLongTermRetentionPolicyListResult value = default;
                        using var document = JsonDocument.Parse(message.Response.ContentStream);
                        value = ManagedInstanceLongTermRetentionPolicyListResult.DeserializeManagedInstanceLongTermRetentionPolicyListResult(document.RootElement);
                        return Response.FromValue(value, message.Response);
                    }
                default:
                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
            }
        }
    }
}


text:
package me.chanjar.weixin.cp.bean.oa.wedrive;

import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;

import java.io.Serializable;

/**
 * 获取邀请链接.
 *
 * @author Wang_Wong
 */
@Data
public class WxCpSpaceShare extends WxCpBaseResp implements Serializable {
  private static final long serialVersionUID = -5028321625142879581L;

  @SerializedName("space_share_url")
  private String spaceShareUrl;

  /**
   * From json wx cp space share.
   *
   * @param json the json
   * @return the wx cp space share
   */
  public static WxCpSpaceShare fromJson(String json) {
    return WxCpGsonBuilder.create().fromJson(json, WxCpSpaceShare.class);
  }

  public String toJson() {
    return WxCpGsonBuilder.create().toJson(this);
  }

}


text:
function doProfile(%val)
{
   if (%val)
   {
      // key down -- start profile
      echo("Starting profile session...");
      profilerReset();
      profilerEnable(true);
   }
   else
   {
      // key up -- finish off profile
      echo("Ending profile session...");

      profilerDumpToFile("profilerDumpToFile" @ getSimTime() @ ".txt");
      profilerEnable(false);
   }
}

GlobalActionMap.bind(keyboard, "ctrl F3", doProfile);

//------------------------------------------------------------------------------
// Misc.
//------------------------------------------------------------------------------

GlobalActionMap.bindCmd(keyboard, "alt k", "cls();","");
GlobalActionMap.bindCmd(keyboard, "alt enter", "", "Canvas.attemptFullscreenToggle();");
GlobalActionMap.bindCmd(keyboard, "F1", "", "contextHelp();");
moveMap.bindCmd(keyboard, "n", "toggleNetGraph();", "");


text:
layout: page
title: Gamble International Party
date: 2016-05-24
author: Amanda English
tags: weekly links, java
status: published
summary: Etiam mollis erat lacus, at dictum.
banner: images/banner/wedding.jpg
booking:
  startDate: 11/11/2018
  endDate: 11/13/2018
  ctyhocn: TAMHSHX
  groupCode: GIP
published: true
---
Ut semper ultrices nisi, sit amet congue nibh. In sed elementum nisl. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec a fringilla turpis. Cras facilisis quam mi, ac feugiat tortor varius in. Pellentesque suscipit arcu arcu. Mauris pulvinar odio urna, non tincidunt orci molestie in. Aliquam erat volutpat. Nullam non risus quam. Donec dictum orci vulputate semper dignissim.

* Mauris lobortis dolor eget mi scelerisque dignissim
* Nam placerat enim vulputate nulla volutpat laoreet ac eget enim
* Maecenas consectetur mauris quis massa lacinia ultrices
* Proin nec magna ut est porttitor lobortis
* Sed facilisis lorem et purus sollicitudin, eu accumsan turpis semper.

Phasellus non tempus diam, eget posuere eros. Integer massa enim, iaculis sed odio vitae, imperdiet volutpat mi. Ut vitae ante nunc. Integer pellentesque purus ut libero fringilla, vitae posuere augue auctor. Fusce ornare sollicitudin risus quis fermentum. Nullam sed neque vitae nunc ornare pretium at at lectus. Sed placerat sed nibh in sollicitudin. Suspendisse id tortor ac erat tempus dictum.


text:
Architecture d'une application Zend
Définition des roles et principe :
    - index.php
    - application.ini
    - Bootstrap
    - Controller
    - Action
    - View

Contenu du Tag Stage 1:
- application.ini basique
- Controller
  - Error pour la gestion des erreurs
  - Index pour la premiére page (HomePage)

TD :
    Comment envoyer des données du controller à la vue
    Création de Mock

TP :
    Réaliser les pages additionnels pour le portfolio
      - Controller Formation
        - Action CRUD
      - Controller Contact
        - Action index
      - Controller Auth
        - Action login
        - Action Logout

Réfléchir aux process pour Formation Create / Update / Delete
Réfléchir aux process pour Auth Login / Logout

### Stage 2
  Ajout de fonctionnalité
    - Layout
    - Partials
    - Navigation
    - Formulaire

TD :
    Réalisation d'un formulaire Login

TP :
    Restructurer les pages en ajoutant les layouts et partials
      - Réaliser les formulaires

### Stage 3
    Ajout de fonctionnalité
     - Authentification
     - Gestion de BDD
     - Service

TP :
    Réaliser les élèments de BDD pour le model Formation
        - Faire un breadcrumb
        -

### Stage 4
    Ajout de fonctionnalité
     - ACL
     - Routes

    Bonus
     - ZF_Debug

TP : Terminer le projet


text:
package com.playground.osgi.integration.coverage.itests;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.configureConsole;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel;

import java.io.File;

import javax.inject.Inject;

import org.apache.karaf.features.FeaturesService;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.MethodSorters;
import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.CoreOptions;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.ProbeBuilder;
import org.ops4j.pax.exam.TestProbeBuilder;
import org.ops4j.pax.exam.junit.PaxExam;
import org.ops4j.pax.exam.karaf.options.KarafDistributionOption;
import org.ops4j.pax.exam.karaf.options.LogLevelOption;
import org.ops4j.pax.exam.options.MavenArtifactUrlReference;
import org.ops4j.pax.exam.options.MavenUrlReference;
import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
import org.ops4j.pax.exam.spi.reactors.PerClass;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.playground.osgi.integration.coverage.service.HelloService;

@RunWith(PaxExam.class)
@ExamReactorStrategy(PerClass.class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class KarafITest {

	private static final String KARAF_VERSION = "3.0.0";

	private static final Logger LOG = LoggerFactory.getLogger(KarafITest.class);

	@Inject
	private FeaturesService featuresService;

	@Inject
	private BundleContext bundleContext;

	@Inject
	private HelloService helloService;

	@ProbeBuilder
	public TestProbeBuilder probeConfiguration(TestProbeBuilder probe) {
		probe.setHeader(Constants.DYNAMICIMPORT_PACKAGE,
				"*,org.apache.felix.service.*;status=provisional");
		return probe;
	}

	@Configuration
	public Option[] config() {
		MavenArtifactUrlReference karafUrl = maven()
				.groupId("org.apache.karaf")
				.artifactId("apache-karaf")
				.version(KARAF_VERSION)
				.type("zip");

		MavenUrlReference karafStandardRepo = maven()
				.groupId("org.apache.karaf.features")
				.artifactId("standard")
				.classifier("features")
				.type("xml")
				.versionAsInProject();

		MavenUrlReference integrationCoverageFeatureRepo = maven()
				.groupId("com.playground.osgi")
				.artifactId("integration-coverage-features")
				.classifier("features")
				.type("xml").versionAsInProject();

		return new Option[] {
				//KarafDistributionOption.debugConfiguration("5005", true),
				karafDistributionConfiguration().frameworkUrl(karafUrl)
					.unpackDirectory(new File("target/exam")).useDeployFolder(false),
				keepRuntimeFolder(),
				KarafDistributionOption.features(karafStandardRepo, "standard"),
				KarafDistributionOption.features(karafStandardRepo, "spring"),
				KarafDistributionOption.features(karafStandardRepo, "spring-dm"),
				KarafDistributionOption.features(integrationCoverageFeatureRepo, "integration-coverage"),
//				mavenBundle().groupId("com.playground.osgi").artifactId("integration-coverage-service").versionAsInProject().start(),
				logLevel(LogLevelOption.LogLevel.INFO),
				configureConsole().ignoreLocalConsole(),
				KarafDistributionOption.editConfigurationFilePut(
						"etc/org.ops4j.pax.web.cfg", "org.osgi.service.http.port", "7050"),
				// Set Jacoco java agent
				CoreOptions.vmOption(System.getProperty("argLine"))
			};
	}

	@Test
	public void check1Provisioning() throws Exception {
		assertTrue(featuresService.isInstalled(featuresService.getFeature("integration-coverage")));
	}

	@Test
	public void check2Bundles() {
		checkBundle("com.playground.osgi.integration-coverage-service");
	}

	@Test
	public void check3Service() {
		for (int i = 0; i < 5; i++) {
			helloService.sayHello();
		}
	}

	private void checkBundle(String symbolicName) {
		LOG.info("Check that bundle " + symbolicName + " is ACTIVE");
		Bundle bundle = getInstalledBundle(symbolicName);
		assertNotNull(bundle);
		assertEquals("Expected bundle " + symbolicName + " to be ACTIVE",
				Bundle.ACTIVE, bundle.getState());
		LOG.info("Bundle " + symbolicName + " is ACTIVE");
	}

	private Bundle getInstalledBundle(String symbolicName) {
		for (Bundle b : bundleContext.getBundles()) {
			if (b.getSymbolicName().equals(symbolicName)) {
				return b;
			}
		}
		for (Bundle b : bundleContext.getBundles()) {
			LOG.error("Bundle: " + b.getSymbolicName());
		}
		throw new RuntimeException("Bundle " + symbolicName + " does not exist");
	}
}


text:
class WebRPC {
public:

	static std::atomic<int> ongoingCalls;

	class Job {
	public:
		Job() {};
		Job(const std::string &url, const std::string &data = "");
		~Job();
		bool isDone();
		int getReturnCode();
		std::string getData();
	//private:
		void urlCall(const std::string &url, const std::string &data = "");
		static size_t writeFunc(void *ptr, size_t size, size_t nmemb, void *userdata);
		//static size_t headerFunc(void *ptr, size_t size, size_t nmemb, void *userdata);

		std::mutex m;
		bool done;
		int returnCode;
		std::thread jobThread;
		std::string data;
	};

	WebRPC(const std::string &baseURL) ;
	Job* call(const std::string &method);

	void setErrorCallback(std::function<void(int code, const std::string &msg)> cb) {
		errorCallback = cb;
	}

	void call(const std::string &method, const std::unordered_map<std::string, std::string>, std::function<void(const std::string &result)>);

	void call(const std::string &method, std::function<void(const std::string &result)>);
	void post(const std::string &method, const std::string &data);
	void post(const std::string &method, const std::string &data, std::function<void(const std::string &result)>);

	static int inProgress() { return ongoingCalls; }

private:
	std::string baseUrl;
	std::function<void(int code, const std::string &msg)> errorCallback;
	std::atomic<int> counter;
	std::future<void> f[4];
};

#endif // WEBRPC_H


text:
package net.bytebuddy.utility;

import net.bytebuddy.test.utility.ObjectPropertyAssertion;
import org.junit.Test;

import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Iterator;

import static org.mockito.Mockito.mock;

public class JavaConstantMethodTypeDispatcherTest {

    @Test(expected = IllegalStateException.class)
    public void testLegacyVmReturnType() throws Exception {
        JavaConstant.MethodType.Dispatcher.ForLegacyVm.INSTANCE.returnType(mock(Object.class));
    }

    @Test(expected = IllegalStateException.class)
    public void testLegacyVmParameterArray() throws Exception {
        JavaConstant.MethodType.Dispatcher.ForLegacyVm.INSTANCE.parameterArray(mock(Object.class));
    }

    @Test
    public void testObjectProperties() throws Exception {
        final Iterator<Method> methods = Arrays.asList(Object.class.getDeclaredMethods()).iterator();
        ObjectPropertyAssertion.of(JavaConstant.MethodType.Dispatcher.ForJava7CapableVm.class).create(new ObjectPropertyAssertion.Creator<Method>() {
            @Override
            public Method create() {
                return methods.next();
            }
        }).apply();
        ObjectPropertyAssertion.of(JavaConstant.MethodType.Dispatcher.ForLegacyVm.class).apply();
    }
}


text:
// Visual Studio Shared Project
// Copyright(c) Microsoft Corporation
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the License); you may not use
// this file except in compliance with the License. You may obtain a copy of the
// License at http://www.apache.org/licenses/LICENSE-2.0
//
// THIS CODE IS PROVIDED ON AN  *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY
// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
// MERCHANTABLITY OR NON-INFRINGEMENT.
//
// See the Apache Version 2.0 License for specific language governing
// permissions and limitations under the License.

namespace Microsoft.VisualStudioTools.Project {
    public interface IPublishFile {
        /// <summary>
        /// Returns the source file that should be copied from.
        /// </summary>
        string SourceFile {
            get;
        }

        /// <summary>
        /// Returns the relative path for the destination file.
        /// </summary>
        string DestinationFile {
            get;
        }
    }
}


text:
Simple PHP script to restore S3 objects on the command line

To use:

1. Edit restore.php to enter your bucket name and region, prefix is optional.
2. Run `composer install`
3. Run `php restore.php`

A few notes:
* This script works by deleting Delete Markers so you'll need to have enabled [Versioning](http://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html) on your S3 bucket. If you haven't then this won't be able to help you, sorry.
* You'll need PHP and [Composer](https://getcomposer.org/) installed. Composer will install everything else
* Ensure ListBucketVersions is present in your AWS IAM Policy
* This will restore 1,000 objects each time it is run. If you have more than that then just keep running it until there are no more to restore. Alternatively modify the script to keep looping until there are no more delete markers. If you do modify this please send a pull request for issue #2


text:
                 ID
                 Status
                 Start Time
                 Duration

                    {{jobExecution.id}}

                {{jobExecution.status}}
                {{jobExecution.startTime}}
                {{jobExecution.duration}}


text:
<link rel="import" href="/_polymer/bower_components/polymer/polymer.html">
<link rel="import" href="/_polymer/bower_components/iron-ajax/iron-ajax.html">

<dom-module id="sky-ajax-thumbnails">

  <template>
    <iron-ajax
        id="skyThumbnails" auto
        handle-as="json"
        headers='{"Accept": "application/json"}'
        last-response="{{data}}"
        debounce-duration="300" />

      <template is="dom-repeat" items="{{data}}" as="row">

 <sky-html html="{{row.url}}"></sky-html>

Description description description...

      </template>

  </template>

</dom-module>


text:
package sobolan.projecteuler.problems;

/**
 * @author Radu Murzea
 *
 * @problemstatement
 * Starting with the number 1 and moving to the right in a clockwise direction a 5 by 5 spiral is formed as follows:
 * 21 22 23 24 25
 * 20  7  8  9 10
 * 19  6  1  2 11
 * 18  5  4  3 12
 * 17 16 15 14 13
 * It can be verified that the sum of the numbers on the diagonals is 101.
 * What is the sum of the numbers on the diagonals in a 1001 by 1001 spiral formed in the same way?
 */
public class ProjectEuler028 extends AbstractExecutableProblem
{
    private final int SPIRAL_SIZE = 1001;

    @Override
    public String getResult()
    {
        int oldRightDown = 3;
        int oldLeftDown = 5;
        int oldLeftUp = 7;
        int oldRightUp = 9;

        int sum = 1 + oldRightDown + oldLeftDown + oldLeftUp + oldRightUp;

        for (int i = 2; i <= (this.SPIRAL_SIZE - 1) / 2; i++) {
            int newRightDown = oldRightDown + 8 * (i - 1) + 2;
            int newLeftDown = oldLeftDown + 8 * (i - 1) + 4;
            int newLeftUp = oldLeftUp + 8 * (i - 1) + 6;
            int newRightUp = oldRightUp + 8 * (i - 1) + 8;

            sum += (newRightDown + newLeftDown + newLeftUp + newRightUp);

            oldRightDown = newRightDown;
            oldLeftDown = newLeftDown;
            oldLeftUp = newLeftUp;
            oldRightUp = newRightUp;
        }

        return Integer.toString(sum);
    }
}


text:
#pragma once

#include "geometry/point2d.hpp"

#include "base/string_utils.hpp"

#include "indexer/feature_altitude.hpp"
#include "indexer/feature_data.hpp"

#include "std/initializer_list.hpp"
#include "std/map.hpp"
#include "std/vector.hpp"

namespace routing
{
double constexpr kPointsEqualEpsilon = 1e-6;

/// The Junction class represents a node description on a road network graph
class Junction
{
public:
  Junction();
  Junction(m2::PointD const & point, feature::TAltitude altitude);
  Junction(Junction const &) = default;
  Junction & operator=(Junction const &) = default;

  inline bool operator==(Junction const & r) const { return m_point == r.m_point; }
  inline bool operator<(Junction const & r) const { return m_point < r.m_point; }

  inline m2::PointD const & GetPoint() const { return m_point; }
  inline feature::TAltitude GetAltitude() const { return m_altitude; }

private:
  friend string DebugPrint(Junction const & r);

  // Point of the junction
  m2::PointD m_point;
  feature::TAltitude m_altitude;
};

inline Junction MakeJunctionForTesting(m2::PointD const & point)
{
  return Junction(point, feature::kDefaultAltitudeMeters);
}

inline bool AlmostEqualAbs(Junction const & lhs, Junction const & rhs)
{
  return my::AlmostEqualAbs(lhs.GetPoint(), rhs.GetPoint(), kPointsEqualEpsilon);
}

/// The Edge class represents an edge description on a road network graph
class Edge
{
public:
  static Edge MakeFake(Junction const & startJunction, Junction const & endJunction);

  Edge() : m_forward(true), m_segId(0) {}
  Edge(FeatureID const & featureId, bool forward, uint32_t segId, Junction const & startJunction, Junction const & endJunction);
  Edge(Edge const &) = default;
  Edge & operator=(Edge const &) = default;

  inline FeatureID GetFeatureId() const { return m_featureId; }
  inline bool IsForward() const { return m_forward; }
  inline uint32_t GetSegId() const { return m_segId; }
  inline Junction const & GetStartJunction() const { return m_startJunction; }
  inline Junction const & GetEndJunction() const { return m_endJunction; }
  inline bool IsFake() const { return !m_featureId.IsValid(); }

  Edge GetReverseEdge() const;

  bool SameRoadSegmentAndDirection(Edge const & r) const;

  bool operator==(Edge const & r) const;
  bool operator<(Edge const & r) const;

private:
  friend string DebugPrint(Edge const & r);

  // Feature for which edge is defined.
  FeatureID m_featureId;

  // Is the feature along the road.
  bool m_forward;

  // Ordinal number of the segment on the road.
  uint32_t m_segId;

  // Start junction of the segment on the road.
  Junction m_startJunction;

  // End junction of the segment on the road.
  Junction m_endJunction;
};

class IRoadGraph
{
public:
  typedef vector<Junction> TJunctionVector;
  typedef vector<Edge> TEdgeVector;

  enum class Mode
  {
    ObeyOnewayTag,
    IgnoreOnewayTag,
  };

  /// This struct contains the part of a feature's metadata that is
  /// relevant for routing.
  struct RoadInfo
  {
    RoadInfo();
    RoadInfo(RoadInfo && ri);
    RoadInfo(bool bidirectional, double speedKMPH, initializer_list<Junction> const & points);
    RoadInfo(RoadInfo const &) = default;
    RoadInfo & operator=(RoadInfo const &) = default;

    buffer_vector<Junction, 32> m_junctions;
    double m_speedKMPH;
    bool m_bidirectional;
  };

  /// This class is responsible for loading edges in a cross.
  class ICrossEdgesLoader
  {
  public:
    ICrossEdgesLoader(Junction const & cross, IRoadGraph::Mode mode, TEdgeVector & edges)
      : m_cross(cross), m_mode(mode), m_edges(edges)
    {
    }

    virtual ~ICrossEdgesLoader() = default;

    void operator()(FeatureID const & featureId, RoadInfo const & roadInfo)
    {
      LoadEdges(featureId, roadInfo);
    }

  private:
    virtual void LoadEdges(FeatureID const & featureId, RoadInfo const & roadInfo) = 0;

  protected:
    template <typename TFn>
    void ForEachEdge(RoadInfo const & roadInfo, TFn && fn)
    {
      for (size_t i = 0; i < roadInfo.m_junctions.size(); ++i)
      {
        if (!my::AlmostEqualAbs(m_cross.GetPoint(), roadInfo.m_junctions[i].GetPoint(),
                                kPointsEqualEpsilon))
        {
          continue;
        }

        if (i + 1 < roadInfo.m_junctions.size())
        {
          // Head of the edge.
          // m_cross
          //     o------------>o
          fn(i, roadInfo.m_junctions[i + 1], true /* forward */);
        }
        if (i > 0)
        {
          // Tail of the edge.
          //                m_cross
          //     o------------>o
          fn(i - 1, roadInfo.m_junctions[i - 1], false /* backward */);
        }
      }
    }

    Junction const m_cross;
    IRoadGraph::Mode const m_mode;
    TEdgeVector & m_edges;
  };

  class CrossOutgoingLoader : public ICrossEdgesLoader
  {
  public:
    CrossOutgoingLoader(Junction const & cross, IRoadGraph::Mode mode, TEdgeVector & edges)
      : ICrossEdgesLoader(cross, mode, edges)
    {
    }

  private:
    // ICrossEdgesLoader overrides:
    virtual void LoadEdges(FeatureID const & featureId, RoadInfo const & roadInfo) override;
  };

  class CrossIngoingLoader : public ICrossEdgesLoader
  {
  public:
    CrossIngoingLoader(Junction const & cross, IRoadGraph::Mode mode, TEdgeVector & edges)
      : ICrossEdgesLoader(cross, mode, edges)
    {
    }

  private:
    // ICrossEdgesLoader overrides:
    virtual void LoadEdges(FeatureID const & featureId, RoadInfo const & roadInfo) override;
  };

  virtual ~IRoadGraph() = default;

  /// Finds all nearest outgoing edges, that route to the junction.
  void GetOutgoingEdges(Junction const & junction, TEdgeVector & edges) const;

  /// Finds all nearest ingoing edges, that route to the junction.
  void GetIngoingEdges(Junction const & junction, TEdgeVector & edges) const;

  /// Removes all fake turns and vertices from the graph.
  void ResetFakes();

  /// Adds fake edges from fake position rp to real vicinity
  /// positions.
  void AddFakeEdges(Junction const & junction, vector<pair<Edge, Junction>> const & vicinities);

  /// Returns RoadInfo for a road corresponding to featureId.
  virtual RoadInfo GetRoadInfo(FeatureID const & featureId) const = 0;

  /// Returns speed in KM/H for a road corresponding to featureId.
  virtual double GetSpeedKMPH(FeatureID const & featureId) const = 0;

  /// Returns speed in KM/H for a road corresponding to edge.
  double GetSpeedKMPH(Edge const & edge) const;

  /// Returns max speed in KM/H
  virtual double GetMaxSpeedKMPH() const = 0;

  /// Calls edgesLoader on each feature which is close to cross.
  virtual void ForEachFeatureClosestToCross(m2::PointD const & cross,
                                            ICrossEdgesLoader & edgesLoader) const = 0;

  /// Finds the closest edges to the point.
  /// @return Array of pairs of Edge and projection point on the Edge. If there is no the closest edges
  /// then returns empty array.
  virtual void FindClosestEdges(m2::PointD const & point, uint32_t count,
                                vector<pair<Edge, Junction>> & vicinities) const = 0;

  /// @return Types for the specified feature
  virtual void GetFeatureTypes(FeatureID const & featureId, feature::TypesHolder & types) const = 0;

  /// @return Types for the specified edge
  void GetEdgeTypes(Edge const & edge, feature::TypesHolder & types) const;

  /// @return Types for specified junction
  virtual void GetJunctionTypes(Junction const & junction, feature::TypesHolder & types) const = 0;

  virtual IRoadGraph::Mode GetMode() const = 0;

  /// Clear all temporary buffers.
  virtual void ClearState() {}

private:
  /// \brief Finds all outgoing regular (non-fake) edges for junction.
  void GetRegularOutgoingEdges(Junction const & junction, TEdgeVector & edges) const;
  /// \brief Finds all ingoing regular (non-fake) edges for junction.
  void GetRegularIngoingEdges(Junction const & junction, TEdgeVector & edges) const;
  /// \brief Finds all outgoing fake edges for junction.
  void GetFakeOutgoingEdges(Junction const & junction, TEdgeVector & edges) const;
  /// \brief Finds all ingoing fake edges for junction.
  void GetFakeIngoingEdges(Junction const & junction, TEdgeVector & edges) const;

  template <typename Fn>
  void ForEachFakeEdge(Fn && fn)
  {
    for (auto const & m : m_fakeIngoingEdges)
    {
      for (auto const & e : m.second)
        fn(e);
    }

    for (auto const & m : m_fakeOutgoingEdges)
    {
      for (auto const & e : m.second)
        fn(e);
    }
  }

  map<Junction, TEdgeVector> m_fakeIngoingEdges;
  map<Junction, TEdgeVector> m_fakeOutgoingEdges;
};

string DebugPrint(IRoadGraph::Mode mode);

IRoadGraph::RoadInfo MakeRoadInfoForTesting(bool bidirectional, double speedKMPH,
                                            initializer_list<m2::PointD> const & points);

inline void JunctionsToPoints(vector<Junction> const & junctions, vector<m2::PointD> & points)
{
  points.resize(junctions.size());
  for (size_t i = 0; i < junctions.size(); ++i)
    points[i] = junctions[i].GetPoint();
}

inline void JunctionsToAltitudes(vector<Junction> const & junctions, feature::TAltitudes & altitudes)
{
  altitudes.resize(junctions.size());
  for (size_t i = 0; i < junctions.size(); ++i)
    altitudes[i] = junctions[i].GetAltitude();
}
}  // namespace routing


text:
// Copyright ©2013 The bíogo.nn Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Package mnist provides a simple interface to access the MNIST database of handwritten digits.
// The mnist package does not come bundled with the database, but will attempt to download the
// data if it does not already exist in the package's root directory.
//
// More information on MNIST is provided at http://yann.lecun.com/exdb/mnist/.
package mnist

import (
	"compress/gzip"
	"crypto/md5"
	"encoding/binary"
	"errors"
	"fmt"
	"io"
	"log"
	"net/http"
	"net/url"
	"os"
	"path/filepath"
	"runtime"
)

const (
	xLAB int32 = 0x00000801
	xIMG int32 = 0x00000803
)

// If Logger is not nil, MNIST data retrieval will be logged.
var Logger *log.Logger = log.New(os.Stderr, "mnist: ", log.LstdFlags)

var (
	mnist = []struct {
		url    string
		local  string
		length int64
		md5    string
	}{
		/*
			TRAINING SET IMAGE FILE (train-images-idx3-ubyte):
			[offset] [type]          [value]          [description]
			0000     32 bit integer  0x00000803(2051) magic number
			0004     32 bit integer  60000            number of images
			0008     32 bit integer  28               number of rows
			0012     32 bit integer  28               number of columns
			0016     unsigned byte   ??               pixel
			0017     unsigned byte   ??               pixel
			........
			xxxx     unsigned byte   ??               pixel

			Pixels are organized row-wise. Pixel values are 0 to 255. 0 means background (white), 255 means foreground (black).
		*/
		{
			url:    "http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz",
			length: 9912422,
			md5:    "f68b3c2dcbeaaa9fbdd348bbdeb94873",
		},

		/*
			TRAINING SET LABEL FILE (train-labels-idx1-ubyte):
			[offset] [type]          [value]          [description]
			0000     32 bit integer  0x00000801(2049) magic number (MSB first)
			0004     32 bit integer  60000            number of items
			0008     unsigned byte   ??               label
			0009     unsigned byte   ??               label
			........
			xxxx     unsigned byte   ??               label

			The labels values are 0 to 9.
		*/
		{
			url:    "http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz",
			length: 28881,
			md5:    "d53e105ee54ea40749a09fcbcd1e9432",
		},

		/*
			TEST SET IMAGE FILE (t10k-images-idx3-ubyte):
			[offset] [type]          [value]          [description]
			0000     32 bit integer  0x00000803(2051) magic number
			0004     32 bit integer  10000            number of images
			0008     32 bit integer  28               number of rows
			0012     32 bit integer  28               number of columns
			0016     unsigned byte   ??               pixel
			0017     unsigned byte   ??               pixel
			........
			xxxx     unsigned byte   ??               pixel

			Pixels are organized row-wise. Pixel values are 0 to 255. 0 means background (white), 255 means foreground (black).
		*/
		{
			url:    "http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz",
			length: 1648877,
			md5:    "9fb629c4189551a2d022fa330f9573f3",
		},

		/*
			TEST SET LABEL FILE (t10k-labels-idx1-ubyte):
			[offset] [type]          [value]          [description]
			0000     32 bit integer  0x00000801(2049) magic number (MSB first)
			0004     32 bit integer  10000            number of items
			0008     unsigned byte   ??               label
			0009     unsigned byte   ??               label
			........
			xxxx     unsigned byte   ??               label

			The labels values are 0 to 9.
		*/
		{
			url:    "http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz",
			length: 4542,
			md5:    "ec29112dd5afa0611ce80d1b7f02629c",
		},
	}
)

func init() {
	_, path, _, ok := runtime.Caller(0)
	if !ok {
		if Logger != nil {
			Logger.Fatal("cannot get file location")
		}
		fmt.Fprintf(os.Stderr, "mnist: cannot get file location")
		os.Exit(1)
	}
	dir := filepath.Dir(path)

	if Logger != nil {
		Logger.Print("Checking for MNIST data...")
	}
	cl := &http.Client{}
	for i := range mnist {
		u, err := url.Parse(mnist[i].url)
		isNil(err)
		fn := filepath.Base(u.Path)
		mnist[i].local = filepath.Join(dir, fn)
		if f, err := os.Open(mnist[i].local); err == nil {
			if fs, err := f.Stat(); err == nil && fs.Size() == mnist[i].length {
				hash := md5.New()
				n, err := io.Copy(hash, f)
				isNil(err)
				s := hash.Sum(nil)
				if n == mnist[i].length && fmt.Sprintf("%x", s) == mnist[i].md5 {
					if Logger != nil {
						Logger.Printf(" %s: OK", fn)
					}
					continue
				}
			}
		}
		if Logger != nil {
			Logger.Printf(" %s: Downloading", fn)
		}
		res, err := cl.Get(mnist[i].url)
		isNil(err)
		f, err := os.Create(mnist[i].local)
		isNil(err)
		n, err := io.Copy(f, res.Body)
		if n != mnist[i].length {
			if Logger != nil {
				Logger.Fatalf("length mismatch %d != %d", n, mnist[i].length)
			}
			fmt.Fprintf(os.Stderr, "mnist: length mismatch %d != %d", n, mnist[i].length)
			os.Exit(1)
		}
		isNil(err)
		res.Body.Close()
		f.Close()
	}

	isNil(Train.read(mnist[0].local, mnist[1].local))
	isNil(Test.read(mnist[2].local, mnist[3].local))
}

func isNil(err error) {
	if err != nil {
		if Logger != nil {
			Logger.Fatal(err)
		}
		panic(fmt.Sprintf("mnist: %v", err))
	}
}

var (
	// Train contains the MNIST training set of 60,000 digits with labels.
	Train Set

	// Test contains the MNIST test set of 10,000 digits with labels.
	Test Set
)

// A Set contains a set of labelled digit images.
type Set struct {
	count      int32
	rows, cols int32
	matrix     []byte // count*rows*cols
	labels     []byte // count
}

// Rows returns the number of pixel rows in the images of the data set.
func (s *Set) Rows() int { return int(s.rows) }

// Cols returns the number of pixel columns in the images of the data set.
func (s *Set) Cols() int { return int(s.cols) }

// Len returns the number of labelled images in the data set.
func (s *Set) Len() int { return int(s.count) }

// Index returns the i'th label and image of the data set.
func (s *Set) Index(i int) (label byte, image []byte) {
	stride := int(s.rows * s.cols)
	return s.labels[i], s.matrix[i*stride : (i+1)*stride]
}

func (s *Set) read(images, labels string) error {
	err := s.readImages(images)
	if err != nil {
		return err
	}
	return s.readLabels(labels)
}

func (s *Set) readImages(file string) error {
	f, err := os.Open(file)
	if err != nil {
		return err
	}
	defer f.Close()
	z, err := gzip.NewReader(f)
	if err != nil {
		return err
	}
	defer z.Close()

	var magic int32
	err = binary.Read(z, binary.BigEndian, &magic)
	if err != nil {
		return err
	}
	if magic != xIMG {
		return fmt.Errorf("invalid magic number for images: %x", magic)
	}
	for _, v := range []*int32{&s.count, &s.rows, &s.cols} {
		err = binary.Read(z, binary.BigEndian, v)
		if err != nil {
			return err
		}
	}
	s.matrix = make([]byte, s.count*s.rows*s.cols)
	_, err = io.ReadFull(z, s.matrix)

	return err
}

func (s *Set) readLabels(file string) error {
	f, err := os.Open(file)
	if err != nil {
		return err
	}
	defer f.Close()
	z, err := gzip.NewReader(f)
	if err != nil {
		return err
	}
	defer z.Close()

	var magic int32
	err = binary.Read(z, binary.BigEndian, &magic)
	if err != nil {
		return err
	}
	if magic != xLAB {
		return fmt.Errorf("invalid magic number for labels: %x", magic)
	}
	var count int32
	err = binary.Read(z, binary.BigEndian, &count)
	if err != nil {
		return err
	}
	if count != s.count {
		return errors.New("mismatched number of labels and images")
	}
	s.labels = make([]byte, s.count)
	_, err = io.ReadFull(z, s.labels)

	return err
}


text:
import {BaseException, Type, isBlank, isPresent} from 'angular2/src/facade/lang';
import {List, ListWrapper, MapWrapper, StringMapWrapper} from 'angular2/src/facade/collection';

import {AbstractChangeDetector} from './abstract_change_detector';
import {ChangeDetectionUtil} from './change_detection_util';
import {DirectiveIndex, DirectiveRecord} from './directive_record';

import {ProtoRecord, RecordType} from './proto_record';

/**
 * The code generator takes a list of proto records and creates a function/class
 * that "emulates" what the developer would write by hand to implement the same
 * kind of behaviour.
 *
 * This code should be kept in sync with the Dart transformer's
 * `angular2.transform.template_compiler.change_detector_codegen` library. If you make updates
 * here, please make equivalent changes there.
*/
var ABSTRACT_CHANGE_DETECTOR = "AbstractChangeDetector";
var UTIL = "ChangeDetectionUtil";
var DISPATCHER_ACCESSOR = "this.dispatcher";
var PIPE_REGISTRY_ACCESSOR = "this.pipeRegistry";
var PROTOS_ACCESSOR = "this.protos";
var DIRECTIVES_ACCESSOR = "this.directiveRecords";
var CONTEXT_ACCESSOR = "this.context";
var IS_CHANGED_LOCAL = "isChanged";
var CHANGES_LOCAL = "changes";
var LOCALS_ACCESSOR = "this.locals";
var MODE_ACCESSOR = "this.mode";
var CURRENT_PROTO = "currentProto";
var ALREADY_CHECKED_ACCESSOR = "this.alreadyChecked";

export class ChangeDetectorJITGenerator {
  _localNames: List<string>;
  _changeNames: List<string>;
  _fieldNames: List<string>;
  _pipeNames: List<string>;

  constructor(public id: string, public changeDetectionStrategy: string,
              public records: List<ProtoRecord>, public directiveRecords: List<any>) {
    this._localNames = this._getLocalNames(records);
    this._changeNames = this._getChangeNames(this._localNames);
    this._fieldNames = this._getFieldNames(this._localNames);
    this._pipeNames = this._getPipeNames(this._localNames);
  }

  _getLocalNames(records: List<ProtoRecord>): List<string> {
    var index = 0;
    var names = records.map((r) => { return _sanitizeName(`${r.name}${index++}`); });
    return ["context"].concat(names);
  }

  _getChangeNames(_localNames: List<string>): List<string> {
    return _localNames.map((n) => `change_${n}`);
  }

  _getFieldNames(_localNames: List<string>): List<string> {
    return _localNames.map((n) => `this.${n}`);
  }

  _getPipeNames(_localNames: List<string>): List<string> {
    return _localNames.map((n) => `this.${n}_pipe`);
  }

  generate(): Function {
    var typeName = _sanitizeName(`ChangeDetector_${this.id}`);
    var classDefinition = `
      var ${typeName} = function ${typeName}(dispatcher, pipeRegistry, protos, directiveRecords) {
        ${ABSTRACT_CHANGE_DETECTOR}.call(this, ${JSON.stringify(this.id)});
        ${DISPATCHER_ACCESSOR} = dispatcher;
        ${PIPE_REGISTRY_ACCESSOR} = pipeRegistry;
        ${PROTOS_ACCESSOR} = protos;
        ${DIRECTIVES_ACCESSOR} = directiveRecords;
        ${LOCALS_ACCESSOR} = null;
        ${ALREADY_CHECKED_ACCESSOR} = false;
        ${this._genFieldDefinitions()}
      }

      ${typeName}.prototype = Object.create(${ABSTRACT_CHANGE_DETECTOR}.prototype);

      ${typeName}.prototype.detectChangesInRecords = function(throwOnChange) {
        if (!this.hydrated()) {
          ${UTIL}.throwDehydrated();
        }
        ${this._genLocalDefinitions()}
        ${this._genChangeDefinitions()}
        var ${IS_CHANGED_LOCAL} = false;
        var ${CURRENT_PROTO};
        var ${CHANGES_LOCAL} = null;

        context = ${CONTEXT_ACCESSOR};

        ${this.records.map((r) => this._genRecord(r)).join("\n")}

        ${ALREADY_CHECKED_ACCESSOR} = true;
      }

      ${typeName}.prototype.callOnAllChangesDone = function() {
        ${this._genCallOnAllChangesDoneBody()}
      }

      ${typeName}.prototype.hydrate = function(context, locals, directives) {
        ${MODE_ACCESSOR} = "${ChangeDetectionUtil.changeDetectionMode(this.changeDetectionStrategy)}";
        ${CONTEXT_ACCESSOR} = context;
        ${LOCALS_ACCESSOR} = locals;
        ${this._genHydrateDirectives()}
        ${this._genHydrateDetectors()}
        ${ALREADY_CHECKED_ACCESSOR} = false;
      }

      ${typeName}.prototype.dehydrate = function() {
        ${this._genPipeOnDestroy()}
        ${this._genFieldDefinitions()}
        ${LOCALS_ACCESSOR} = null;
      }

      ${typeName}.prototype.hydrated = function() {
        return ${CONTEXT_ACCESSOR} !== null;
      }

      return function(dispatcher, pipeRegistry) {
        return new ${typeName}(dispatcher, pipeRegistry, protos, directiveRecords);
      }
    `;
    return new Function('AbstractChangeDetector', 'ChangeDetectionUtil', 'protos',
                        'directiveRecords', classDefinition)(
        AbstractChangeDetector, ChangeDetectionUtil, this.records, this.directiveRecords);
  }

  _genGetDirectiveFieldNames(): List<string> {
    return this.directiveRecords.map(d => this._genGetDirective(d.directiveIndex));
  }

  _genGetDetectorFieldNames(): List<string> {
    return this.directiveRecords.filter(r => r.isOnPushChangeDetection())
        .map((d) => this._genGetDetector(d.directiveIndex));
  }

  _genGetDirective(d: DirectiveIndex) { return `this.directive_${d.name}`; }

  _genGetDetector(d: DirectiveIndex) { return `this.detector_${d.name}`; }

  _getNonNullPipeNames(): List<string> {
    var pipes = [];
    this.records.forEach((r) => {
      if (r.isPipeRecord()) {
        pipes.push(this._pipeNames[r.selfIndex]);
      }
    });
    return pipes;
  }

  _genFieldDefinitions() {
    var fields = [];
    fields = fields.concat(this._fieldNames);
    fields = fields.concat(this._getNonNullPipeNames());
    fields = fields.concat(this._genGetDirectiveFieldNames());
    fields = fields.concat(this._genGetDetectorFieldNames());
    return fields.map((n) => {
                   return n == CONTEXT_ACCESSOR ? `${n} = null;` :
                                                  `${n} = ${UTIL}.uninitialized();`;
                 })
        .join("\n");
  }

  _genHydrateDirectives(): string {
    var directiveFieldNames = this._genGetDirectiveFieldNames();
    var lines = ListWrapper.createFixedSize(directiveFieldNames.length);
    for (var i = 0, iLen = directiveFieldNames.length; i < iLen; ++i) {
      lines[i] =
          `${directiveFieldNames[i]} = directives.getDirectiveFor(${DIRECTIVES_ACCESSOR}[${i}].directiveIndex);`
    }
    return lines.join('\n');
  }

  _genHydrateDetectors(): string {
    var detectorFieldNames = this._genGetDetectorFieldNames();
    var lines = ListWrapper.createFixedSize(detectorFieldNames.length);
    for (var i = 0, iLen = detectorFieldNames.length; i < iLen; ++i) {
      lines[i] = `${detectorFieldNames[i]} =
          directives.getDetectorFor(${DIRECTIVES_ACCESSOR}[${i}].directiveIndex);`
    }
    return lines.join('\n');
  }

  _genPipeOnDestroy(): string {
    return this._getNonNullPipeNames().map((p) => `${p}.onDestroy();`).join("\n");
  }

  _genCallOnAllChangesDoneBody(): string {
    var notifications = [];
    var dirs = this.directiveRecords;

    for (var i = dirs.length - 1; i >= 0; --i) {
      var dir = dirs[i];
      if (dir.callOnAllChangesDone) {
        notifications.push(`${this._genGetDirective(dir.directiveIndex)}.onAllChangesDone();`);
      }
    }

    var directiveNotifications = notifications.join("\n");

    return `
      this.dispatcher.notifyOnAllChangesDone();
      ${directiveNotifications}
    `;
  }

  _genLocalDefinitions(): string { return this._localNames.map((n) => `var ${n};`).join("\n"); }

  _genChangeDefinitions(): string {
    return this._changeNames.map((n) => `var ${n} = false;`).join("\n");
  }

  _genRecord(r: ProtoRecord): string {
    var rec;
    if (r.isLifeCycleRecord()) {
      rec = this._genDirectiveLifecycle(r);
    } else if (r.isPipeRecord()) {
      rec = this._genPipeCheck(r);
    } else {
      rec = this._genReferenceCheck(r);
    }
    return `${rec}${this._maybeGenLastInDirective(r)}`;
  }

  _genDirectiveLifecycle(r: ProtoRecord) {
    if (r.name === "onCheck") {
      return this._genOnCheck(r);
    } else if (r.name === "onInit") {
      return this._genOnInit(r);
    } else if (r.name === "onChange") {
      return this._genOnChange(r);
    } else {
      throw new BaseException(`Unknown lifecycle event '${r.name}'`);
    }
  }

  _genPipeCheck(r: ProtoRecord): string {
    var context = this._localNames[r.contextIndex];
    var oldValue = this._fieldNames[r.selfIndex];
    var newValue = this._localNames[r.selfIndex];
    var change = this._changeNames[r.selfIndex];

    var pipe = this._pipeNames[r.selfIndex];
    var cdRef = "this.ref";

    var protoIndex = r.selfIndex - 1;
    var pipeType = r.name;

    return `
      ${CURRENT_PROTO} = ${PROTOS_ACCESSOR}[${protoIndex}];
      if (${pipe} === ${UTIL}.uninitialized()) {
        ${pipe} = ${PIPE_REGISTRY_ACCESSOR}.get('${pipeType}', ${context}, ${cdRef});
      } else if (!${pipe}.supports(${context})) {
        ${pipe}.onDestroy();
        ${pipe} = ${PIPE_REGISTRY_ACCESSOR}.get('${pipeType}', ${context}, ${cdRef});
      }

      ${newValue} = ${pipe}.transform(${context});
      if (${oldValue} !== ${newValue}) {
        ${newValue} = ${UTIL}.unwrapValue(${newValue});
        ${change} = true;
        ${this._genUpdateDirectiveOrElement(r)}
        ${this._genAddToChanges(r)}
        ${oldValue} = ${newValue};
      }
    `;
  }

  _genReferenceCheck(r: ProtoRecord): string {
    var oldValue = this._fieldNames[r.selfIndex];
    var newValue = this._localNames[r.selfIndex];

    var protoIndex = r.selfIndex - 1;
    var check = `
      ${CURRENT_PROTO} = ${PROTOS_ACCESSOR}[${protoIndex}];
      ${this._genUpdateCurrentValue(r)}
      if (${newValue} !== ${oldValue}) {
        ${this._changeNames[r.selfIndex]} = true;
        ${this._genUpdateDirectiveOrElement(r)}
        ${this._genAddToChanges(r)}
        ${oldValue} = ${newValue};
      }
    `;

    if (r.isPureFunction()) {
      var condition = r.args.map((a) => this._changeNames[a]).join(" || ");
      return `if (${condition}) { ${check} } else { ${newValue} = ${oldValue}; }`;
    } else {
      return check;
    }
  }

  _genUpdateCurrentValue(r: ProtoRecord): string {
    var context = (r.contextIndex == -1) ? this._genGetDirective(r.directiveIndex) :
                                           this._localNames[r.contextIndex];
    var newValue = this._localNames[r.selfIndex];
    var argString = r.args.map((arg) => this._localNames[arg]).join(", ");

    var rhs;
    switch (r.mode) {
      case RecordType.SELF:
        rhs = context;
        break;

      case RecordType.CONST:
        rhs = JSON.stringify(r.funcOrValue);
        break;

      case RecordType.PROPERTY:
        rhs = `${context}.${r.name}`;
        break;

      case RecordType.SAFE_PROPERTY:
        rhs = `${UTIL}.isValueBlank(${context}) ? null : ${context}.${r.name}`;
        break;

      case RecordType.LOCAL:
        rhs = `${LOCALS_ACCESSOR}.get('${r.name}')`;
        break;

      case RecordType.INVOKE_METHOD:
        rhs = `${context}.${r.name}(${argString})`;
        break;

      case RecordType.SAFE_INVOKE_METHOD:
        rhs = `${UTIL}.isValueBlank(${context}) ? null : ${context}.${r.name}(${argString})`;
        break;

      case RecordType.INVOKE_CLOSURE:
        rhs = `${context}(${argString})`;
        break;

      case RecordType.PRIMITIVE_OP:
        rhs = `${UTIL}.${r.name}(${argString})`;
        break;

      case RecordType.INTERPOLATE:
        rhs = this._genInterpolation(r);
        break;

      case RecordType.KEYED_ACCESS:
        rhs = `${context}[${this._localNames[r.args[0]]}]`;
        break;

      default:
        throw new BaseException(`Unknown operation ${r.mode}`);
    }
    return `${newValue} = ${rhs}`;
  }

  _genInterpolation(r: ProtoRecord): string {
    var res = "";
    for (var i = 0; i < r.args.length; ++i) {
      res += JSON.stringify(r.fixedArgs[i]);
      res += " + ";
      res += this._localNames[r.args[i]];
      res += " + ";
    }
    res += JSON.stringify(r.fixedArgs[r.args.length]);
    return res;
  }

  _genUpdateDirectiveOrElement(r: ProtoRecord): string {
    if (!r.lastInBinding) return "";

    var newValue = this._localNames[r.selfIndex];
    var oldValue = this._fieldNames[r.selfIndex];

    var br = r.bindingRecord;
    if (br.isDirective()) {
      var directiveProperty =
          `${this._genGetDirective(br.directiveRecord.directiveIndex)}.${br.propertyName}`;
      return `
        ${this._genThrowOnChangeCheck(oldValue, newValue)}
        ${directiveProperty} = ${newValue};
        ${IS_CHANGED_LOCAL} = true;
      `;
    } else {
      return `
        ${this._genThrowOnChangeCheck(oldValue, newValue)}
        ${DISPATCHER_ACCESSOR}.notifyOnBinding(${CURRENT_PROTO}.bindingRecord, ${newValue});
      `;
    }
  }

  _genThrowOnChangeCheck(oldValue: string, newValue: string): string {
    return `
      if(throwOnChange) {
        ${UTIL}.throwOnChange(${CURRENT_PROTO}, ${UTIL}.simpleChange(${oldValue}, ${newValue}));
      }
      `;
  }

  _genAddToChanges(r: ProtoRecord): string {
    var newValue = this._localNames[r.selfIndex];
    var oldValue = this._fieldNames[r.selfIndex];
    if (!r.bindingRecord.callOnChange()) return "";
    return `
      ${CHANGES_LOCAL} = ${UTIL}.addChange(
          ${CHANGES_LOCAL}, ${CURRENT_PROTO}.bindingRecord.propertyName,
          ${UTIL}.simpleChange(${oldValue}, ${newValue}));
    `;
  }

  _maybeGenLastInDirective(r: ProtoRecord): string {
    if (!r.lastInDirective) return "";
    return `
      ${CHANGES_LOCAL} = null;
      ${this._genNotifyOnPushDetectors(r)}
      ${IS_CHANGED_LOCAL} = false;
    `;
  }

  _genOnCheck(r: ProtoRecord): string {
    var br = r.bindingRecord;
    return `if (!throwOnChange) ${this._genGetDirective(br.directiveRecord.directiveIndex)}.onCheck();`;
  }

  _genOnInit(r: ProtoRecord): string {
    var br = r.bindingRecord;
    return `if (!throwOnChange && !${ALREADY_CHECKED_ACCESSOR}) ${this._genGetDirective(br.directiveRecord.directiveIndex)}.onInit();`;
  }

  _genOnChange(r: ProtoRecord): string {
    var br = r.bindingRecord;
    return `if (!throwOnChange && ${CHANGES_LOCAL}) ${this._genGetDirective(br.directiveRecord.directiveIndex)}.onChange(${CHANGES_LOCAL});`;
  }

  _genNotifyOnPushDetectors(r: ProtoRecord): string {
    var br = r.bindingRecord;
    if (!r.lastInDirective || !br.isOnPushChangeDetection()) return "";
    var retVal = `
      if(${IS_CHANGED_LOCAL}) {
        ${this._genGetDetector(br.directiveRecord.directiveIndex)}.markAsCheckOnce();
      }
    `;
    return retVal;
  }
}

function _sanitizeName(s: string): string {
  return s.replace(new RegExp("\\W", "g"), '');
}


text:
module FutureTripsHelper
end


text:
ADTypes = {
    flags : { typeFlag : 0x01, resolve: intArrayToByte },
    incompleteUUID16 : { typeFlag : 0x02, resolve: octetStringArrayToBuffer },
    completeUUID16 : { typeFlag : 0x03, resolve: octetStringArrayToBuffer },
    incompleteUUID32 : { typeFlag : 0x04, resolve: octetStringArrayToBuffer },
    completeUUID32 : { typeFlag : 0x05, resolve: octetStringArrayToBuffer },
    incompleteUUID128 : { typeFlag : 0x06, resolve: octetStringArrayToBuffer },
    completeUUID128 : { typeFlag : 0x07, resolve: octetStringArrayToBuffer },
    shortName : { typeFlag : 0x08, resolve: stringToBuffer },
    completeName : { typeFlag : 0x09, resolve: stringToBuffer },
    txPower : { typeFlag : 0x0A, resolve: signedIntToBuffer },
    deviceClass : { typeFlag : 0x0D, resolve: octectStringToBuffer },
    pairingHashC : { typeFlag : 0x0E, resolve: octectStringToBuffer },
    pairingRandomizerR : { typeFlag : 0x0F, resolve: octectStringToBuffer },
    deviceId : { typeFlag : 0x10, resolve: octectStringToBuffer },
    smOOBFlags : { typeFlag : 0x11, resolve: octectStringToBuffer },
    intervalRange : { typeFlag : 0x12, resolve: octetStringArrayToBuffer },
    solicitationUUID16 : { typeFlag : 0x14, resolve: octetStringArrayToBuffer },
    solicitationUUID32 : { typeFlag : 0x1F, resolve: octetStringArrayToBuffer },
    solicitationUUID128 : { typeFlag : 0x15, resolve: octetStringArrayToBuffer },
    serviceData : { typeFlag : 0x16, resolve: octetStringArrayToBuffer },
    publicAddress : { typeFlag : 0x17, resolve: octetStringArrayToBuffer },
    randomAddress : { typeFlag : 0x18, resolve: octetStringArrayToBuffer },
    appearance : { typeFlag : 0x19, resolve: arrayToBuffer },
    interval : { typeFlag : 0x1A, resolve: octetStringArrayToBuffer },
    deviceAddress : { typeFlag : 0x1B, resolve: octetStringArrayToBuffer },
    role : { typeFlag : 0x1C, resolve: arrayToBuffer },
    pairingHashC256 : { typeFlag : 0x1D, resolve: octetStringArrayToBuffer },
    pairingRandomizerR256 : { typeFlag : 0x1E, resolve: octetStringArrayToBuffer },
    serviceUUID32 : { typeFlag : 0x20, resolve: octetStringArrayToBuffer },
    serviceUUID128 : { typeFlag : 0x21, resolve: octetStringArrayToBuffer },
    _3dInfo : { typeFlag : 0x3D, resolve: arrayToBuffer },
    mfrData : { typeFlag : 0xFF, resolve: arrayToBuffer }
}

function intArrayToByte(data){
  var ret = 0;
  for (var i=0; i<data.length; i++){
    ret |= data[i];
  }
  return Buffer([ret]);
}

function stringToBuffer(data){
  return new Buffer(data);
}

function octectStringToBuffer(data){
  var numBytes = data.length/2;

  var buf = new Buffer(numBytes);

  if (numBytes % 2) {
    throw new Error("Invalid UUID" + data + ".");
  }

  for (var i = 0; i < numBytes; i++) {
    buf.writeUInt8(parseInt(data.substr((i*2), 2), 16), numBytes-i-1);
  }

  return buf;
}

function octetStringArrayToBuffer(data){
  var buffs = [];
  for (var i=0; i< data.length; i++){
    buffs.push(octectStringToBuffer(data[i]));
  }
  return Buffer.concat(buffs);
}

function signedIntToBuffer(data){
  var buf = new Buffer(1);
  buf.writeInt8(data, 0);
  return buf;
}

function arrayToBuffer(data){
  return new Buffer(data);
}

function serialize(advertisement){
  var buffs = [];
  Object.keys(advertisement).forEach(function(key){
    typeFlag = ADTypes[key].typeFlag;
    data = ADTypes[key].resolve(advertisement[key]);
    buffs.push(new Buffer([data.length+1, typeFlag]));
    buffs.push(data);
  });
  var ret = Buffer.concat(buffs);
  if (ret.length > 32){
    throw(new Error("Packet exceeds maximum length of 32 bytes"));
  } else {
    return ret;
  }
}

module.exports.serialize = serialize;


text:
from django.shortcuts import render, get_object_or_404, redirect
from django.utils import timezone
from .models import Post, Comment, Page, ApprovedEmail
from .forms import PostForm, CommentForm, PageForm
from django.contrib.auth.decorators import login_required

def post_list(request):
    posts = Post.objects.filter(published_date__lte=timezone.now()).order_by('published_date')
    return render(request, 'blog/post_list.html', {'posts': posts})

@login_required()
def post_new(request):
    if request.method == "POST":
        form = PostForm(request.POST)
        if form.is_valid():
            post = form.save(commit=False)
            post.author = request.user
            post.save()
            return redirect('blog:post_detail', pk=post.pk)
    else:
        form = PostForm()
    return render(request, 'blog/post_edit.html', {'form': form})

@login_required()
def post_edit(request, pk):
    post = get_object_or_404(Post, pk=pk)
    if request.method == "POST":
        form = PostForm(request.POST, instance=post)
        if form.is_valid():
            post = form.save(commit=False)
            post.author = request.user
            post.published_date = timezone.now()
            post.save()
            return redirect('blog:post_detail', pk=post.pk)
    else:
        form = PostForm(instance=post)
    return render(request, 'blog/post_edit.html', {'form': form})

@login_required()
def post_draft_list(request):
    posts = Post.objects.filter(published_date__isnull=True).order_by('created_date')
    return render(request, 'blog/post_draft_list.html', {'posts': posts})

@login_required()
def post_publish(request, pk):
    post = get_object_or_404(Post, pk=pk)
    post.publish()
    return redirect('blog:post_detail', pk=pk)

@login_required()
def post_remove(request, pk):
    post = get_object_or_404(Post, pk=pk)
    post.delete()
    return redirect('blog:post_list')

def post_detail(request, pk):
    post = get_object_or_404(Post, pk=pk)
    if 'viewed' in request.session and request.session['viewed']:
        request.session['has_commented'] = False
    if 'has_commented' in request.session:
        request.session['viewed'] = True
    if request.method == "POST":
        form = CommentForm(request.POST)
        if form.is_valid():
            comment = form.save(commit=False)
            comment.post = post
            comment.save()
            request.session['has_commented'] = True
            request.session['viewed'] = False
            if request.user.is_authenticated():
                comment.approve()
            if len(ApprovedEmail.objects.filter(email_address=comment.email_address)) > 0:
                request.session['preapproved'] = True
                comment.approve()
            return redirect('blog:post_detail', pk=post.pk)
    else:
        form = CommentForm()
    return render(request, 'blog/post_detail.html',
                  {'form': form, 'post': post})

@login_required
def comment_approve(request, pk):
    comment = get_object_or_404(Comment, pk=pk)
    approved_email = ApprovedEmail(email_address = comment.email_address)
    comment.approve()
    approved_email.save()
    return redirect('blog:post_detail', pk=comment.post.pk)

@login_required
def comment_remove(request, pk):
    comment = get_object_or_404(Comment, pk=pk)
    post_pk = comment.post.pk
    comment.delete()
    return redirect('blog:post_detail', pk=post_pk)

def page_detail(request, pk):
    page = get_object_or_404(Page, pk=pk)
    return render(request, 'blog/page_detail.html', {'page': page})

@login_required()
def page_edit(request, pk):
    page = get_object_or_404(Page, pk=pk)
    if request.method == "POST":
        form = PageForm(request.POST, instance=page)
        if form.is_valid():
            page = form.save()
            return redirect('blog:page_detail', pk=page.pk)
    else:
        form = PageForm(instance=page)
    return render(request, 'blog/page_edit.html', {'form': form})

@login_required()
def page_new(request):
    if request.method == "POST":
        form = PageForm(request.POST)
        if form.is_valid():
            page = form.save()
            return redirect('blog:page_detail', pk=page.pk)
    else:
        form = PageForm()
    return render(request, 'blog/page_edit.html', {'form': form})

@login_required()
def new_comments_list(request):
    comments = Comment.objects.filter(approved_comment=False).order_by('created_date')
    return render(request, 'blog/new_comments_list.html', {'comments': comments})

@login_required
def comment_approve_list(request, pk):
    comment = get_object_or_404(Comment, pk=pk)
    approved_email = ApprovedEmail(email_address = comment.email_address)
    comment.approve()
    approved_email.save()
    return redirect('blog:new_comments_list')

@login_required
def comment_remove_list(request, pk):
    comment = get_object_or_404(Comment, pk=pk)
    comment.delete()
    return redirect('blog:new_comments_list')