text:
Konfigurationsempfehlungen für die Teilnahme am NTP Pool

 Der Support auf
 support.ntp.org verfügt über
 eine Menge nützlicher Informationen bezüglich des NTP-Protokolls.

 Wenn Sie den NTP Pool lediglich benutzen möchten, lesen Sie bitte
 die Wie benutze ich den NTP Pool? Seite.

 Als eine weitere Anlaufstelle dient die comp.protocols.time.ntp
  Newsgruppe. Dort wird Ihnen beim Einsatz der NTP Sofware selbst geholfen.

 Im Folgenden werden einige relevante Informationen für den Betrieb Ihres
 Zeitservers im NTP Pool beschrieben.

Management queries

Make the default configuration be to not allow "management queries". For ntpd this will be adding the "noquery" option to the default "restrict" lines, for example:

[% INCLUDE "join/configuration/restrict-default.html" %]

To allow commands like "ntpq -c pe" to work from localhost you can add:

[% INCLUDE "join/configuration/restrict-localhost.html" %]

Setup für etwa 5 Server

 Um einwandfrei funktionieren zu können, benötigt der
 ntpd-Dienst mindestens drei eingetragene Zeitserver ("Mit einer Uhr
 weiß man wie spät es ist. Mit zweien ist man sich nicht mehr
 sicher").

 Server im NTP Pool müssen mindestens vier und dürfen maximal sieben
 Zeitserver zur Synchronisation einsetzen.

Benutzen Sie nicht *.pool.ntp.org als Zeitserver

 Um die Qualität der Zeitsynchronisation zu halten, sollten Sie
 ironischerweise keine der <tt>*.pool.ntp.org</tt> Adressen in Ihrer
 Konfiguration benutzen.

 Für einen robusten und gesunden Pool ist es das Beste, Sie wählen den
 für Sie am besten funktionierenden Zeitserver in Ihrer Umgebung. Das
 NTP.org Wiki hat dafür eine Liste öffentlicher
 Server.

Benutzen Sie den Standard NTPd-Dienst

 Softwarealternativen sind prinzipiell etwas Gutes, jedoch hat sich
 herausgestellt, das der Großteil der aufgetretenen Problem durch den
 Einsatz des Standard <tt>ntpd</tt>-Dienst behoben werden konnte.

 Benutzen können Sie den NTP Pool mit jeder Software, die das NTP Protokoll
 integriert hat. Zum Betrieb eines Servers empfehlen wir Ihnen jedoch den
 offiziellen ntpd.

 Sie können den Pool mit jedem Programm, das NTP spricht, benutzen,
 wollen Sie dem Pool aber beitreten, empfehlen wir den Einsatz des
 ntpd.

Nutzen Sie nicht die lokale Uhrzeit

 Server im NTP Pool sollten auf den Einsatz der lokalen Uhrzeit verzichten.


text:
require 'rails_helper'

RSpec.describe BankAccount, type: :model do
  describe "associations" do
    it{ is_expected.to belong_to :user }
  end

  describe "Validations" do
    it{ is_expected.to validate_presence_of(:bank_id) }
    it{ is_expected.to validate_presence_of(:agency) }
    it{ is_expected.to validate_presence_of(:account) }
    it{ is_expected.to validate_presence_of(:account_digit) }
    it{ is_expected.to validate_presence_of(:owner_name) }
    it{ is_expected.to validate_presence_of(:owner_document) }
  end
end

redpajama_set_name: RedPajamaGithub


text:
This SEO library allows for the management of and injection of dynamic data into HTML tags for the purpose of Search Engine Optimisation. Using the [QOR Admin](https://github.com/qor/admin) interface, an administrator can easily manage the content of an HTML page's title, description, and meta tags.

[![GoDoc](https://godoc.org/github.com/qor/seo?status.svg)](https://godoc.org/github.com/qor/seo)

## Definition

Define SEO settings struct with `Site-wide Settings` and `Page Related Settings`, for example:

```go
type SEO struct {
  gorm.Model
  SiteName     string  // Site-wide Settings
  SiteHost     string  // Site-wide Settings
  HomePage     seo.Setting
  ProductPage  seo.Setting `seo:"ProductName,ProductCode"` // Page Related Variables [ProductName, ProductCode]
  CategoryPage seo.Setting `seo:"CategoryName"` // Page Related Variables [CategoryName]
}

// The `SEO` struct is a normal GORM-backend model, need to run migration before using it
db.AutoMigrate(&SEO{})

// Add `SEO` to QOR Admin Interface
Admin.AddResource(&SEO{})
```

[Online SEO Setting Demo For Qor Example](http://demo.getqor.com/admin/seo_setting)

## Usage

```go
var SEOSetting SEO
db.First(&SEOSetting)

// render home page's meta tags
SEOSetting.HomePage.Render(SEOSetting)

// render product page's meta tags
var product Product
db.First(&product, "code = ?", "L1212")
SEOSetting.ProductPage.Render(SEOSetting, product)
```

## Structured Data

```go
// micro search
seo.MicroSearch{
  URL:    "http://demo.getqor.com",
  Target: "http://demo.getqor.com/search?q=",
}.Render()

// micro contact
seo.MicroContact{
  URL:         "http://demo.getqor.com",
  Telephone:   "080-0012-3232",
  ContactType: "Customer Service",
}.Render()

// micro product
seo.MicroProduct{
  Name: "Kenmore White 17 Microwave",
  Image: "http://getqor.com/source/images/qor-logo.png",
  Description: "0.7 cubic feet countertop microwave. Has six preset cooking categories and convenience features like Add-A-Minute and Child Lock."
  BrandName: "ThePlant",
  SKU: "L1212",
  PriceCurrency: "USD",
  Price: 100,
  SellerName: "ThePlant",
}.Render()
```


text:
package hudson.plugins.warnings;

import javax.annotation.CheckForNull;
import java.util.List;

import org.apache.commons.lang.StringUtils;
import org.kohsuke.stapler.StaplerRequest;

import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.Run;
import hudson.plugins.analysis.core.AbstractProjectAction;
import hudson.plugins.analysis.core.BuildHistory;
import hudson.plugins.analysis.core.NullBuildHistory;
import hudson.plugins.analysis.graph.BuildResultGraph;
import hudson.plugins.analysis.graph.DefaultGraphConfigurationView;
import hudson.plugins.analysis.graph.GraphConfigurationView;
import hudson.plugins.analysis.graph.UserGraphConfigurationView;
import hudson.plugins.warnings.parser.ParserRegistry;

/**
 * Entry point to visualize the warnings trend graph in the project screen.
 * Drawing of the graph is delegated to the associated
 * {@link WarningsResultAction}.
 *
 * @author Ulli Hafner
 */
public class WarningsProjectAction extends AbstractProjectAction<WarningsResultAction> {
    private final String parser;

    /**
     * Returns all the graphs.
     *
     * @return the graphs
     */
    public static List<BuildResultGraph> getAllGraphs() {
        return new WarningsProjectAction(null, null).getAvailableGraphs();
    }

    /**
     * Creates a new instance of {@link WarningsProjectAction}.
     *
     * @param project
     *            the project that owns this action
     * @param group
     *            the group of the parsers that share this action
     */
    public WarningsProjectAction(final AbstractProject<?, ?> project, final String group) {
        super(project, WarningsResultAction.class,
                ParserRegistry.getParser(group).getLinkName(), ParserRegistry.getParser(group).getTrendName(),
                WarningsDescriptor.getProjectUrl(group),
                ParserRegistry.getParser(group).getSmallImage(),
                WarningsDescriptor.getResultUrl(group));
        parser = group;
    }

    @Override
    protected GraphConfigurationView createUserConfiguration(final StaplerRequest request) {
        return new UserGraphConfigurationView(
                createConfiguration(getAvailableGraphs()), getProject(),
                WarningsDescriptor.getProjectUrl(parser), WarningsDescriptor.getProjectUrl(null),
                request.getCookies(), createBuildHistory());
    }

    @Override
    protected GraphConfigurationView createDefaultConfiguration() {
        return new DefaultGraphConfigurationView(
                createConfiguration(getAvailableGraphs()), getProject(),
                WarningsDescriptor.getProjectUrl(parser),
                createBuildHistory(), WarningsDescriptor.getProjectUrl(null));
    }

    /**
     * Returns whether the specified parser is the parser group of this action.
     *
     * @param group
     *            the group to check
     * @return true if the parser is in the same group,
     *         false otherwise
     */
    public boolean isInGroup(@CheckForNull final String group) {
        return StringUtils.equals(parser, group);
    }

    @Override
    protected WarningsResultAction getResultAction(final AbstractBuild<?, ?> lastBuild) {
        return createHistory(lastBuild).getResultAction((Run<?, ?>) lastBuild);
    }

    /**
     * Creates the build history.
     *
     * @return build history
     */
    @Override
    protected BuildHistory createBuildHistory() {
        AbstractBuild<?, ?> lastFinishedBuild = getLastFinishedBuild();
        if (lastFinishedBuild == null) {
            return new NullBuildHistory();
        }
        else {
            return createHistory(lastFinishedBuild);
        }
    }

    private WarningsBuildHistory createHistory(final AbstractBuild<?, ?> build) {
        return new WarningsBuildHistory(build, parser, false, false);
    }
}


text:
package com.andhikasrimadeva.myapp;

import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.preference.DialogPreference;
import android.util.AttributeSet;

import com.google.firebase.auth.FirebaseAuth;

/**
 * Created by Andhika on 13/06/2017.
 */

public class AccountSettingsPreference extends DialogPreference {

    private FirebaseAuth mAuth;

    public AccountSettingsPreference(Context context, AttributeSet attrs) {
        super(context, attrs);
        mAuth = FirebaseAuth.getInstance();

        setDialogLayoutResource(R.layout.account_settings_dialog);
        setPositiveButtonText("LOGOUT");
        setNegativeButtonText("CANCEL");
    }

    @Override
    protected void onDialogClosed(boolean positiveResult) {
        super.onDialogClosed(positiveResult);
        if(positiveResult){
            FirebaseAuth.getInstance().signOut();
            Intent intent = new Intent(getContext(), LoginActivity.class);
            intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
            getContext().startActivity(intent);
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#3F51B5</color>
    <color name="colorPrimaryDark">#303F9F</color>
    <color name="colorAccent">#FF4081</color>
    <color name="light_gray">#DDDDDD</color>
    <color name="goods_count_bg_color">#F24444</color>
</resources>


text:
package org.iot.raspberry.grovepi.devices;

import java.io.IOException;
import org.iot.raspberry.grovepi.GroveDigitalPin;
import org.iot.raspberry.grovepi.GroveIO;
import org.iot.raspberry.grovepi.GrovePi;
import static org.iot.raspberry.grovepi.GrovePiCommands.*;

@GroveDigitalPin
public class GroveLed {

  public static int MAX_BRIGTHNESS = 255;

  private final GrovePi grovePi;
  private final int pin;

  public GroveLed(GrovePi grovePi, int pin) throws IOException {
    this.grovePi = grovePi;
    this.pin = pin;
    grovePi.execVoid((GroveIO io) -> io.write(pMode_cmd, pin, pMode_out_arg, unused));
    set(false);
  }

  public final void set(boolean value) throws IOException {
    int val = value ? 1 : 0;
    grovePi.execVoid((GroveIO io) -> io.write(dWrite_cmd, pin, val, unused));
  }

  public final void set(int value) throws IOException {
    final int val = ((value > 255) ? 255 : (value < 0 ? 0 : value));
    grovePi.execVoid((GroveIO io) -> io.write(aWrite_cmd, pin, val, unused));
  }

}


text:
<?php

namespace Functional;

use Functional\Exceptions\InvalidArgumentException;
use Traversable;

/**
 * flat_map works applying a function (callback) that returns a sequence for each element in a collection,
 * and flattening the results into the resulting array.
 *
 * flat_map(...) differs from flatten(map(...)) because it only flattens one level of nesting,
 * whereas flatten will recursively flatten nested collections.
 *
 * For example if map(collection, callback) returns [[],1,[2,3],[[4]]]
 * then flat_map(collection, callback) will return [1,2,3,[4]]
 * while flatten(map(collection, callback)) will return [1,2,3,4]
 *
 * @param Traversable|array $collection
 * @param callable $callback
 * @return array
 * @no-named-arguments
 */
function flat_map($collection, callable $callback)
{
    InvalidArgumentException::assertCollection($collection, __FUNCTION__, 1);

    $flattened = [];

    foreach ($collection as $index => $element) {
        $result = $callback($element, $index, $collection);

        if (\is_array($result) || $result instanceof Traversable) {
            foreach ($result as $item) {
                $flattened[] = $item;
            }
        } elseif ($result !== null) {
            $flattened[] = $result;
        }
    }

    return $flattened;
}


text:
package gov.hhs.fha.nhinc.patientdiscovery.configuration.jmx;

import gov.hhs.fha.nhinc.configuration.IConfiguration.serviceEnum;
import gov.hhs.fha.nhinc.patientdiscovery._10.gateway.ws.EntityPatientDiscoveryUnsecured;
import gov.hhs.fha.nhinc.patientdiscovery._10.gateway.ws.NhinPatientDiscovery;
import gov.hhs.fha.nhinc.patientdiscovery.inbound.InboundPatientDiscovery;
import gov.hhs.fha.nhinc.patientdiscovery.outbound.OutboundPatientDiscovery;

import javax.servlet.ServletContext;

/**
 * The Class PatientDiscovery10WebServices.
 *
 * @author msw
 */
public class PatientDiscovery10WebServices extends AbstractPDWebServicesMXBean {

    private final serviceEnum serviceName = serviceEnum.PatientDiscovery;
    /**
     * Instantiates a new patient discovery10 web services.
     *
     * @param sc the sc
     */
    public PatientDiscovery10WebServices(ServletContext sc) {
        super(sc);
    }

    /*
     * (non-Javadoc)
     *
     * @see gov.hhs.fha.nhinc.configuration.jmx.WebServicesMXBean#isInboundPassthru()
     */
    @Override
    public boolean isInboundPassthru() {
        boolean isPassthru = false;
        NhinPatientDiscovery nhinPD = retrieveBean(NhinPatientDiscovery.class, getNhinBeanName());
        InboundPatientDiscovery inboundPatientDiscovery = nhinPD.getInboundPatientDiscovery();
        if (compareClassName(inboundPatientDiscovery, DEFAULT_INBOUND_PASSTHRU_IMPL_CLASS_NAME)) {
            isPassthru = true;
        }
        return isPassthru;
    }

    /*
     * (non-Javadoc)
     *
     * @see gov.hhs.fha.nhinc.configuration.jmx.WebServicesMXBean#isOutboundPassthru()
     */
    @Override
    public boolean isOutboundPassthru() {
        boolean isPassthru = false;
        EntityPatientDiscoveryUnsecured entityPD = retrieveBean(EntityPatientDiscoveryUnsecured.class,
                getEntityUnsecuredBeanName());
        OutboundPatientDiscovery outboundPatientDiscovery = entityPD.getOutboundPatientDiscovery();
        if (compareClassName(outboundPatientDiscovery, DEFAULT_OUTBOUND_PASSTHRU_IMPL_CLASS_NAME)) {
            isPassthru = true;
        }
        return isPassthru;
    }

    /**
     * Configure inbound implementation. The inbound orchestration implementation provided via the className param is
     * set on the Nhin interface bean. This method uses specific types and passes them to the generic
     * {@link gov.hhs.fha.nhinc.configuration.jmx.AbstractWebServicesMXBean#retrieveBean(Class, String)} and
     * {@link gov.hhs.fha.nhinc.configuration.jmx.AbstractWebServicesMXBean#retrieveDependency(Class, String)} methods.
     *
     * @param className the class name
     * @throws InstantiationException the instantiation exception
     * @throws IllegalAccessException the illegal access exception
     * @throws ClassNotFoundException the class not found exception
     * @see gov.hhs.fha.nhinc.configuration.jmx.AbstractWebServicesMXBean#configureInboundImplementation(java.lang.String)
     */
    @Override
    public void configureInboundStdImpl() throws InstantiationException,
            IllegalAccessException, ClassNotFoundException {
        NhinPatientDiscovery nhinPD = null;
        InboundPatientDiscovery inboundPD = null;

        nhinPD = retrieveBean(NhinPatientDiscovery.class, getNhinBeanName());
        inboundPD = retrieveBean(InboundPatientDiscovery.class, getStandardInboundBeanName());

        nhinPD.setInboundPatientDiscovery(inboundPD);
    }

    @Override
    public void configureInboundPtImpl() throws InstantiationException,
            IllegalAccessException, ClassNotFoundException {
        NhinPatientDiscovery nhinPD = null;
        InboundPatientDiscovery inboundPD = null;

        nhinPD = retrieveBean(NhinPatientDiscovery.class, getNhinBeanName());
        inboundPD = retrieveBean(InboundPatientDiscovery.class, getPassthroughInboundBeanName());

        nhinPD.setInboundPatientDiscovery(inboundPD);
    }

    /**
     * Configure outbound implementation. The outbound orchestration implementation provided via the className param is
     * set on the Nhin interface bean. This method uses specific types and passes them to the generic
     * {@link gov.hhs.fha.nhinc.configuration.jmx.AbstractWebServicesMXBean#retrieveBean(Class, String)} and
     * {@link gov.hhs.fha.nhinc.configuration.jmx.AbstractWebServicesMXBean#retrieveDependency(Class, String)} methods.
     *
     * @param className the class name
     * @throws InstantiationException the instantiation exception
     * @throws IllegalAccessException the illegal access exception
     * @throws ClassNotFoundException the class not found exception
     * @see gov.hhs.fha.nhinc.configuration.jmx.AbstractWebServicesMXBean#configureOutboundImplementation(java.lang.String)
     */
    @Override
    public void configureOutboundStdImpl() throws InstantiationException,
            IllegalAccessException, ClassNotFoundException {
        EntityPatientDiscoveryUnsecured entityPD = null;
        OutboundPatientDiscovery outboundPD = null;

        entityPD = retrieveBean(EntityPatientDiscoveryUnsecured.class, getEntityUnsecuredBeanName());
        outboundPD = retrieveBean(OutboundPatientDiscovery.class, getStandardOutboundBeanName());

        entityPD.setOutboundPatientDiscovery(outboundPD);
    }

    @Override
    public void configureOutboundPtImpl() throws InstantiationException,
            IllegalAccessException, ClassNotFoundException {
        EntityPatientDiscoveryUnsecured entityPD = null;
        OutboundPatientDiscovery outboundPD = null;

        entityPD = retrieveBean(EntityPatientDiscoveryUnsecured.class, getEntityUnsecuredBeanName());
        outboundPD = retrieveBean(OutboundPatientDiscovery.class, getPassthroughOutboundBeanName());

        entityPD.setOutboundPatientDiscovery(outboundPD);
    }

    @Override
    public serviceEnum getServiceName() {
        return this.serviceName;
    }

    @Override
    public boolean isOutboundStandard() {
        boolean isStandard = false;
        EntityPatientDiscoveryUnsecured entityPD = retrieveBean(EntityPatientDiscoveryUnsecured.class,
                getEntityUnsecuredBeanName());
        OutboundPatientDiscovery outboundPatientDiscovery = entityPD.getOutboundPatientDiscovery();
        if (compareClassName(outboundPatientDiscovery, DEFAULT_OUTBOUND_STANDARD_IMPL_CLASS_NAME)) {
            isStandard = true;
        }
        return isStandard;
    }

    @Override
    public boolean isInboundStandard() {
        boolean isStandard = false;
        NhinPatientDiscovery nhinPD = retrieveBean(NhinPatientDiscovery.class,
                getNhinBeanName());
        InboundPatientDiscovery inboundPatientDiscovery = nhinPD.getInboundPatientDiscovery();
        if (compareClassName(inboundPatientDiscovery, DEFAULT_INBOUND_STANDARD_IMPL_CLASS_NAME)) {
            isStandard = true;
        }
        return isStandard;
    }

}


text:
import binascii
import os
from textwrap import dedent

from pyramid.compat import native_

from pyramid.scaffolds.template import Template # API

class PyramidTemplate(Template):
    """
     A class that can be used as a base class for Pyramid scaffolding
     templates.
    """
    def pre(self, command, output_dir, vars):
        """ Overrides :meth:`pyramid.scaffolds.template.Template.pre`, adding
        several variables to the default variables list (including
        ``random_string``, and ``package_logger``).  It also prevents common
        misnamings (such as naming a package "site" or naming a package
        logger "root".
        """
        if vars['package'] == 'site':
            raise ValueError('Sorry, you may not name your package "site". '
                             'The package name "site" has a special meaning in '
                             'Python.  Please name it anything except "site".')
        vars['random_string'] = native_(binascii.hexlify(os.urandom(20)))
        package_logger = vars['package']
        if package_logger == 'root':
            # Rename the app logger in the rare case a project is named 'root'
            package_logger = 'app'
        vars['package_logger'] = package_logger
        return Template.pre(self, command, output_dir, vars)

    def post(self, command, output_dir, vars): # pragma: no cover
        """ Overrides :meth:`pyramid.scaffolds.template.Template.post`, to
        print "Welcome to Pyramid.  Sorry for the convenience." after a
        successful scaffolding rendering."""

        separator = "=" * 79
        msg = dedent(
            """
            %(separator)s
            Tutorials: http://docs.pylonsproject.org/projects/pyramid_tutorials
            Documentation: http://docs.pylonsproject.org/projects/pyramid

            Twitter (tips & updates): http://twitter.com/pylons
            Mailing List: http://groups.google.com/group/pylons-discuss

            Welcome to Pyramid.  Sorry for the convenience.
            %(separator)s
        """ % {'separator': separator})

        self.out(msg)
        return Template.post(self, command, output_dir, vars)

    def out(self, msg): # pragma: no cover (replaceable testing hook)
        print(msg)

class StarterProjectTemplate(PyramidTemplate):
    _template_dir = 'starter'
    summary = 'Pyramid starter project'

class ZODBProjectTemplate(PyramidTemplate):
    _template_dir = 'zodb'
    summary = 'Pyramid ZODB project using traversal'

class AlchemyProjectTemplate(PyramidTemplate):
    _template_dir = 'alchemy'
    summary = 'Pyramid SQLAlchemy project using url dispatch'


text:
package org.ujorm.orm.ao;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.ujorm.core.annot.PackagePrivate;
import org.ujorm.orm.metaModel.*;
import org.ujorm.tools.Check;

/** Database meta index model builder with a user ordered columns support.
 * Two columns of a database composite index can be ordered according a number
 * at the end of a index name separated by the character {@code '#'}.
 * Two index columns with the same order value are sorted according
 * to the natural order of the Keys in the {@link Ujo} class.
 * The default order value (with no number in the index name) is 10.
 *

 * See the next example to create a composite index with two columns in a reverted order:
 *

 *   private static final String IDX_STATE_COUNT = "idx_state_count";
 *
 *   @Column(index = IDX_STATE_COUNT + "#30")
 *   public static final Key<XOrder, State> STATE = newKey();
 *
 *   @Column(index = IDX_STATE_COUNT + "#20")
 *   public static final Key<XOrder, Integer> COUNT = newKey();
 *

 *
 * The builder class can be changed by the parameter {@link MetaParams#INDEX_MODEL_BUILDER}
 * in time of building a meta-model according the next example:
 *
 *

 *   MetaParams params = new MetaParams();
 *   params.set(MetaParams.INDEX_MODEL_BUILDER, IndexModelOrderedBuilder.class);
 *   ormHandler.config(params);
 *

 *
 * @see MetaParams#INDEX_MODEL_BUILDER
 */
public class IndexModelOrderedBuilder extends IndexModelBuilder {

    /** Order separator in the column name */
    @PackagePrivate static final char ORDER_SEPARATOR = '#';
    /** The default index column value is 10 */
    protected static final Integer DEFAULT_ORDER = 10;

    /** Index columns */
    private final Map<String, List<OrderedColumn>> idxMap = new HashMap<>();

    /** Returns a separator of the column order from an index name.
     * @return The default value is {@code '#'}
     * @see #DEFAULT_ORDER
     */
    protected char getOrderSerparator() {
        return ORDER_SEPARATOR;
    }

    /** Add the column model to the column model from the IndexMap
     * according the column name (case insensitive)
     * @param indexName Case sensitive column name
     * @param column Column model
     * @param unique Unique column request */
    @Override
    protected void addIndex
        ( String indexName
        , final MetaColumn column
        , final boolean unique) {

        if (Check.isEmpty(indexName)) {
            return;
        }
        if (MetaColumn.AUTO_INDEX_NAME.equals(indexName)) {
            indexName = unique
                    ? nameProvider.getUniqueConstraintName(column)
                    : nameProvider.getIndexName(column);
        }
        final int iSep = indexName.lastIndexOf(getOrderSerparator());
        final String indexNameShort = iSep > 0 ? indexName.substring(0, iSep) : indexName;
        final String indexKey = indexNameShort.toUpperCase();
        final Integer columnOrder = iSep > 0 ? Integer.parseInt(indexName.substring(1 + iSep)) : DEFAULT_ORDER;
        //
        List<OrderedColumn> columns = idxMap.get(indexKey);
        if (columns == null) {
            columns = new ArrayList<>();
            idxMap.put(indexKey, columns);
        }
        final MetaColumn lastCol = columns.isEmpty()
                ? null
                : columns.get(columns.size() - 1).column;
        if (column != lastCol) {
            columns.add(new OrderedColumn
                 ( indexNameShort
                 , column
                 , columnOrder
                 , unique));
        }
    }

    /** Returns all indexes of the current table
     * @return Collection of the Index model */
    @Override
    public Collection<MetaIndex> getIndexModels() {
        super.addColumnsToIndex();

        final List<MetaIndex> result = new ArrayList<>();
        for (List<OrderedColumn> columns : idxMap.values()) {
            addToResult(columns, result);
        }
        return result;
    }

    /** Add the column to the result index list */
    protected void addToResult(List<OrderedColumn> columns, final List<MetaIndex> result) {
        Collections.sort(columns);
        MetaIndex mIndex = new MetaIndex(columns.get(0).indexName, metaTable);
        result.add(mIndex);
        for (OrderedColumn column : columns) {
            MetaIndex.COLUMNS.addItem(mIndex, column.column);
            if (!column.unique) {
               MetaIndex.UNIQUE.setValue(mIndex, column.unique);
            }
        }
    }

    /** Container for the Index model with an order request */
    protected static class OrderedColumn implements Comparable<OrderedColumn>{
        private final String indexName;
        private final MetaColumn column;
        private final Integer order;
        private final Boolean unique;

        public OrderedColumn(String indexName, MetaColumn column, Integer order, Boolean unique) {
            this.indexName = indexName;
            this.column = column;
            this.order = order;
            this.unique = unique;
        }

        @Override
        public int compareTo(final OrderedColumn o) {
            return order.compareTo(o.order);
        }
    }
}


text:
begin
  require 'berkshelf'
rescue LoadError
  raise ChefSpec::Error::GemLoadError.new(gem: 'berkshelf', name: 'Berkshelf')
end

module ChefSpec
  class Berkshelf
    class << self
      extend Forwardable
      def_delegators :instance, :setup!, :teardown!
    end

    include Singleton

    def initialize
      @tmpdir = Dir.mktmpdir
    end

    #
    # Setup and install the necessary dependencies in the temporary directory.
    #
    def setup!
      # Get the list of Berkshelf options
      opts = RSpec.configuration.berkshelf_options
      if !opts.is_a?(Hash)
        raise InvalidBerkshelfOptions(value: opts.inspect)
      end

      berksfile = ::Berkshelf::Berksfile.from_file('Berksfile', opts)

      # Grab a handle to tmpdir, since Berkshelf 2 modifies it a bit
      tmpdir = File.join(@tmpdir, 'cookbooks')

      ::Berkshelf.ui.mute do
        if ::Berkshelf::Berksfile.method_defined?(:vendor)
          # Berkshelf 3.0 requires the directory to not exist
          FileUtils.rm_rf(tmpdir)
          berksfile.vendor(tmpdir)
        else
          berksfile.install(path: tmpdir)
        end
      end

      filter = Coverage::BerkshelfFilter.new(berksfile)
      Coverage.add_filter(filter)

      ::RSpec.configure { |config| config.cookbook_path = tmpdir }
    end

    #
    # Destroy the installed Berkshelf at the temporary directory.
    #
    def teardown!
      FileUtils.rm_rf(@tmpdir) if File.exist?(@tmpdir)
    end
  end
end

RSpec.configure do |config|
  config.before(:suite) { ChefSpec::Berkshelf.setup! }
  config.after(:suite)  { ChefSpec::Berkshelf.teardown! }
end


text:
// This file is automatically generated.

package adila.db;

/*
 * Prestige PRO8D
 *
 * DEVICE: PRO8D
 * MODEL: PRO8D
 */
final class pro8d_pro8d {
    public static final String DATA = "Prestige|PRO8D|";
}


text:
try:
    import simplejson as json
except ImportError:
    import json

def tabularize(data):
    result = "
"
    d = data if isinstance(data, dict) else json.loads(data)
    for key, value in d.iteritems():
        if isinstance(value, dict):
            v = tabularize(value)
            result += "
{0}	{1}
".format(key, v)
        elif isinstance(value, list):
            v = "
".join(map(tabularize, value))
            result += "
{0}	{1}
".format(key, v)
        else:
            result += "
{0}	{1}
".format(key, value)
    return result + "
"


text:
from django.db import models
from django.utils import timezone

class LiveSweepManager(models.Manager):
    """
    Manager that returns sweeps with status = LIVE_STATUS.
    """
    def get_query_set(self):
        return super(LiveSweepManager, self).get_query_set().filter(status=self.model.LIVE_STATUS)

class Sweep(models.Model):
    LIVE_STATUS = 1
    DRAFT_STATUS = 2
    HIDDEN_STATUS = 3
    STATUS_CHOICES = (
        (LIVE_STATUS, 'Live'),
        (DRAFT_STATUS, 'Draft'),
        (HIDDEN_STATUS, 'Hidden'),
    )

    objects = models.Manager()
    live = LiveSweepManager()

    title = models.CharField(max_length=200)
    created = models.DateTimeField(default=timezone.now)
    closed = models.DateTimeField(null=True, blank=True)
    closed_message = models.TextField(blank=True)
    slug = models.SlugField(unique=True, max_length=128)
    status = models.IntegerField(choices=STATUS_CHOICES, default=DRAFT_STATUS)
    source_type = models.CharField(max_length=50, blank=True)
    source_id = models.CharField(max_length=50, blank=True)
    brand_id = models.CharField(max_length=50, blank=True)
    list_id = models.CharField(max_length=50, blank=True)
    acquisition_partner_id = models.CharField(max_length=50, blank=True)

    class Meta:
        ordering = ["-created"]

    def __unicode__(self):
        return self.title

    @models.permalink
    def get_absolute_url(self):
        return ('vodkamartinisweeps_sweep_detail', (), {'slug': self.slug})

class SweepEntry(models.Model):
    MALE_GENDER = 1
    FEMALE_GENDER = 2
    GENDER_CHOICES = [
        (MALE_GENDER, 'Male'),
        (FEMALE_GENDER, 'Female'),
    ]

    sweep = models.ForeignKey(Sweep)
    first_name = models.CharField(max_length=30, blank=True)
    last_name = models.CharField(max_length=30, blank=True)
    email = models.EmailField()
    date_of_birth = models.DateField(blank=True)
    zip_code = models.CharField(max_length=10, blank=True)
    gender = models.IntegerField(choices=GENDER_CHOICES, default=FEMALE_GENDER)
    receive_email = models.BooleanField(default=False)
    created = models.DateTimeField(default=timezone.now)

    class Meta:
        ordering = ["-created"]
        verbose_name_plural = "Sweep Entries"

    def __unicode__(self):
        return "%s %s <%s>" % (self.first_name, self.last_name, self.email)


text:
#include "IRremoteNec.h"
#include "IRremoteInt.h"

// Provides ISR
#include <avr/interrupt.h>

volatile irparams_t irparams;

IRrecv::IRrecv(int recvpin)
{
  irparams.recvpin = recvpin;
  irparams.blinkflag = 0;
}

// initialization
void IRrecv::enableIRIn() {
  cli();
  // setup pulse clock timer interrupt
  //Prescale /8 (16M/8 = 0.5 microseconds per tick)
  // Therefore, the timer interval can range from 0.5 to 128 microseconds
  // depending on the reset value (255 to 0)
  TIMER_CONFIG_NORMAL();

  //Timer2 Overflow Interrupt Enable
  TIMER_ENABLE_INTR;

  TIMER_RESET;

  sei();  // enable interrupts

  // initialize state machine variables
  irparams.rcvstate = STATE_IDLE;
  irparams.rawlen = 0;

  // set pin modes
  pinMode(irparams.recvpin, INPUT);
}

// enable/disable blinking of pin 13 on IR processing
void IRrecv::blink13(int blinkflag)
{
  irparams.blinkflag = blinkflag;
  if (blinkflag)
    pinMode(BLINKLED, OUTPUT);
}

// TIMER2 interrupt code to collect raw data.
// Widths of alternating SPACE, MARK are recorded in rawbuf.
// Recorded in ticks of 50 microseconds.
// rawlen counts the number of entries recorded so far.
// First entry is the SPACE between transmissions.
// As soon as a SPACE gets long, ready is set, state switches to IDLE, timing of SPACE continues.
// As soon as first MARK arrives, gap width is recorded, ready is cleared, and new logging starts
ISR(TIMER_INTR_NAME)
{
  TIMER_RESET;

  uint8_t irdata = (uint8_t)digitalRead(irparams.recvpin);

  irparams.timer++; // One more 50us tick
  if (irparams.rawlen >= RAWBUF) {
    // Buffer overflow
    irparams.rcvstate = STATE_STOP;
  }
  switch(irparams.rcvstate) {
  case STATE_IDLE: // In the middle of a gap
    if (irdata == MARK) {
      if (irparams.timer < GAP_TICKS) {
        // Not big enough to be a gap.
        irparams.timer = 0;
      }
      else {
        // gap just ended, record duration and start recording transmission
        irparams.rawlen = 0;
        irparams.rawbuf[irparams.rawlen++] = irparams.timer;
        irparams.timer = 0;
        irparams.rcvstate = STATE_MARK;
      }
    }
    break;
  case STATE_MARK: // timing MARK
    if (irdata == SPACE) {   // MARK ended, record time
      irparams.rawbuf[irparams.rawlen++] = irparams.timer;
      irparams.timer = 0;
      irparams.rcvstate = STATE_SPACE;
    }
    break;
  case STATE_SPACE: // timing SPACE
    if (irdata == MARK) { // SPACE just ended, record it
      irparams.rawbuf[irparams.rawlen++] = irparams.timer;
      irparams.timer = 0;
      irparams.rcvstate = STATE_MARK;
    }
    else { // SPACE
      if (irparams.timer > GAP_TICKS) {
        // big SPACE, indicates gap between codes
        // Mark current code as ready for processing
        // Switch to STOP
        // Don't reset timer; keep counting space width
        irparams.rcvstate = STATE_STOP;
      }
    }
    break;
  case STATE_STOP: // waiting, measuring gap
    if (irdata == MARK) { // reset gap timer
      irparams.timer = 0;
    }
    break;
  }

  if (irparams.blinkflag) {
    if (irdata == MARK) {
      BLINKLED_ON();  // turn pin 13 LED on
    }
    else {
      BLINKLED_OFF();  // turn pin 13 LED off
    }
  }
}

void IRrecv::resume() {
  irparams.rcvstate = STATE_IDLE;
  irparams.rawlen = 0;
}

// Decodes the received IR message
// Returns 0 if no data ready, 1 if data ready.
// Results of decoding are stored in results
int IRrecv::decode(decode_results *results) {
  results->rawbuf = irparams.rawbuf;
  results->rawlen = irparams.rawlen;
  if (irparams.rcvstate != STATE_STOP) {
    return ERR;
  }

  if (decodeNEC(results)) {
    return DECODED;
  }

  if (decodeSony(results)) {
    return DECODED;
  }

  // decodeHash returns a hash on any input.
  // Thus, it needs to be last in the list.
  // If you add any decodes, add them before this.
  if (decodeHash(results)) {
    return DECODED;
  }
  // Throw away and start over
  resume();
  return ERR;
}

// NECs have a repeat only 4 items long
long IRrecv::decodeNEC(decode_results *results) {
  long data = 0;
  int offset = 1; // Skip first space
  // Initial mark
  if (!MATCH_MARK(results->rawbuf[offset], NEC_HDR_MARK)) {
    return ERR;
  }
  offset++;
  // Check for repeat
  if (irparams.rawlen == 4 &&
    MATCH_SPACE(results->rawbuf[offset], NEC_RPT_SPACE) &&
    MATCH_MARK(results->rawbuf[offset+1], NEC_BIT_MARK)) {
    results->bits = 0;
    results->value = REPEAT;
    results->decode_type = NEC;
    return DECODED;
  }
  if (irparams.rawlen < 2 * NEC_BITS + 4) {
    return ERR;
  }
  // Initial space
  if (!MATCH_SPACE(results->rawbuf[offset], NEC_HDR_SPACE)) {
    return ERR;
  }
  offset++;
  for (int i = 0; i < NEC_BITS; i++) {
    if (!MATCH_MARK(results->rawbuf[offset], NEC_BIT_MARK)) {
      return ERR;
    }
    offset++;
    if (MATCH_SPACE(results->rawbuf[offset], NEC_ONE_SPACE)) {
      data = (data << 1) | 1;
    }
    else if (MATCH_SPACE(results->rawbuf[offset], NEC_ZERO_SPACE)) {
      data <<= 1;
    }
    else {
      return ERR;
    }
    offset++;
  }
  // Success
  results->bits = NEC_BITS;
  results->value = data;
  results->decode_type = NEC;
  return DECODED;
}

long IRrecv::decodeSony(decode_results *results) {
  long data = 0;
  if (irparams.rawlen < 2 * SONY_BITS + 2) {
    return ERR;
  }
  int offset = 0; // Dont skip first space, check its size

  // Some Sony's deliver repeats fast after first
  // unfortunately can't spot difference from of repeat from two fast clicks
  if (results->rawbuf[offset] < SONY_DOUBLE_SPACE_USECS) {
    // Serial.print("IR Gap found: ");
    results->bits = 0;
    results->value = REPEAT;
    results->decode_type = SANYO;
    return DECODED;
  }
  offset++;

  // Initial mark
  if (!MATCH_MARK(results->rawbuf[offset], SONY_HDR_MARK)) {
    return ERR;
  }
  offset++;

  while (offset + 1 < irparams.rawlen) {
    if (!MATCH_SPACE(results->rawbuf[offset], SONY_HDR_SPACE)) {
      break;
    }
    offset++;
    if (MATCH_MARK(results->rawbuf[offset], SONY_ONE_MARK)) {
      data = (data << 1) | 1;
    }
    else if (MATCH_MARK(results->rawbuf[offset], SONY_ZERO_MARK)) {
      data <<= 1;
    }
    else {
      return ERR;
    }
    offset++;
  }

  // Success
  results->bits = (offset - 1) / 2;
  if (results->bits < 12) {
    results->bits = 0;
    return ERR;
  }
  results->value = data;
  results->decode_type = SONY;
  return DECODED;
}

/* -----------------------------------------------------------------------
 * hashdecode - decode an arbitrary IR code.
 * Instead of decoding using a standard encoding scheme
 * (e.g. Sony, NEC, RC5), the code is hashed to a 32-bit value.
 *
 * The algorithm: look at the sequence of MARK signals, and see if each one
 * is shorter (0), the same length (1), or longer (2) than the previous.
 * Do the same with the SPACE signals.  Hszh the resulting sequence of 0's,
 * 1's, and 2's to a 32-bit value.  This will give a unique value for each
 * different code (probably), for most code systems.
 *
 * http://arcfn.com/2010/01/using-arbitrary-remotes-with-arduino.html
 */

// Compare two tick values, returning 0 if newval is shorter,
// 1 if newval is equal, and 2 if newval is longer
// Use a tolerance of 20%
int IRrecv::compare(unsigned int oldval, unsigned int newval) {
  if (newval < oldval * .8) {
    return 0;
  }
  else if (oldval < newval * .8) {
    return 2;
  }
  else {
    return 1;
  }
}

// Use FNV hash algorithm: http://isthe.com/chongo/tech/comp/fnv/#FNV-param
#define FNV_PRIME_32 16777619
#define FNV_BASIS_32 2166136261

/* Converts the raw code values into a 32-bit hash code.
 * Hopefully this code is unique for each button.
 * This isn't a "real" decoding, just an arbitrary value.
 */
long IRrecv::decodeHash(decode_results *results) {
  // Require at least 6 samples to prevent triggering on noise
  if (results->rawlen < 6) {
    return ERR;
  }
  long hash = FNV_BASIS_32;
  for (int i = 1; i+2 < results->rawlen; i++) {
    int value =  compare(results->rawbuf[i], results->rawbuf[i+2]);
    // Add value into the hash
    hash = (hash * FNV_PRIME_32) ^ value;
  }
  results->value = hash;
  results->bits = 32;
  results->decode_type = UNKNOWN;
  return DECODED;
}


text:
<?xml version="1.0" encoding="UTF-8" ?>
<docblox>
  <target>output</target>
  <extensions>
    <extension>php</extension>
    <extension>php3</extension>
    <extension>phtml</extension>
  </extensions>
  <logging>
    <level>warn</level>
    <paths>
      <default>log/{DATE}.log</default>
      <errors>log/{DATE}.errors.log</errors>
    </paths>
  </logging>
  <markers>
    <item>TODO</item>
    <item>FIXME</item>
  </markers>
  <transformation>
    <writer>xslt</writer>
  </transformation>
</docblox>


text:
"""FeedParser - An email feed parser.

The feed parser implements an interface for incrementally parsing an email
message, line by line.  This has advantages for certain applications, such as
those reading email messages off a socket.

FeedParser.feed() is the primary interface for pushing new data into the
parser.  It returns when there's nothing more it can do with the available
data.  When you have no more data to push into the parser, call .close().
This completes the parsing and returns the root message object.

The other advantage of this parser is that it will never raise a parsing
exception.  Instead, when it finds something unexpected, it adds a 'defect' to
the current message.  Defects are just instances that live on the message
object's .defects attribute.
"""

__all__ = ['FeedParser']

import re

from email import errors
from email import message

NLCRE = re.compile('\r\n|\r|\n')
NLCRE_bol = re.compile('(\r\n|\r|\n)')
NLCRE_eol = re.compile('(\r\n|\r|\n)\Z')
NLCRE_crack = re.compile('(\r\n|\r|\n)')
# RFC 2822 $3.6.8 Optional fields.  ftext is %d33-57 / %d59-126, Any character
# except controls, SP, and ":".
headerRE = re.compile(r'^(From |[\041-\071\073-\176]{1,}:|[\t ])')
EMPTYSTRING = ''
NL = '\n'

NeedMoreData = object()

class BufferedSubFile(object):
    """A file-ish object that can have new data loaded into it.

    You can also push and pop line-matching predicates onto a stack.  When the
    current predicate matches the current line, a false EOF response
    (i.e. empty string) is returned instead.  This lets the parser adhere to a
    simple abstraction -- it parses until EOF closes the current message.
    """
    def __init__(self):
        # Chunks of the last partial line pushed into this object.
        self._partial = []
        # The list of full, pushed lines, in reverse order
        self._lines = []
        # The stack of false-EOF checking predicates.
        self._eofstack = []
        # A flag indicating whether the file has been closed or not.
        self._closed = False

    def push_eof_matcher(self, pred):
        self._eofstack.append(pred)

    def pop_eof_matcher(self):
        return self._eofstack.pop()

    def close(self):
        # Don't forget any trailing partial line.
        self.pushlines(''.join(self._partial).splitlines(True))
        self._partial = []
        self._closed = True

    def readline(self):
        if not self._lines:
            if self._closed:
                return ''
            return NeedMoreData
        # Pop the line off the stack and see if it matches the current
        # false-EOF predicate.
        line = self._lines.pop()
        # RFC 2046, section 5.1.2 requires us to recognize outer level
        # boundaries at any level of inner nesting.  Do this, but be sure it's
        # in the order of most to least nested.
        for ateof in self._eofstack[::-1]:
            if ateof(line):
                # We're at the false EOF.  But push the last line back first.
                self._lines.append(line)
                return ''
        return line

    def unreadline(self, line):
        # Let the consumer push a line back into the buffer.
        assert line is not NeedMoreData
        self._lines.append(line)

    def push(self, data):
        """Push some new data into this object."""
        # Crack into lines, but preserve the linesep characters on the end of each
        parts = data.splitlines(True)

        if not parts or not parts[0].endswith(('\n', '\r')):
            # No new complete lines, so just accumulate partials
            self._partial += parts
            return

        if self._partial:
            # If there are previous leftovers, complete them now
            self._partial.append(parts[0])
            parts[0:1] = ''.join(self._partial).splitlines(True)
            del self._partial[:]

        # If the last element of the list does not end in a newline, then treat
        # it as a partial line.  We only check for '\n' here because a line
        # ending with '\r' might be a line that was split in the middle of a
        # '\r\n' sequence (see bugs 1555570 and 1721862).
        if not parts[-1].endswith('\n'):
            self._partial = [parts.pop()]
        self.pushlines(parts)

    def pushlines(self, lines):
        # Reverse and insert at the front of the lines.
        self._lines[:0] = lines[::-1]

    def is_closed(self):
        return self._closed

    def __iter__(self):
        return self

    def next(self):
        line = self.readline()
        if line == '':
            raise StopIteration
        return line

class FeedParser:
    """A feed-style parser of email."""

    def __init__(self, _factory=message.Message):
        """_factory is called with no arguments to create a new message obj"""
        self._factory = _factory
        self._input = BufferedSubFile()
        self._msgstack = []
        self._parse = self._parsegen().next
        self._cur = None
        self._last = None
        self._headersonly = False

    # Non-public interface for supporting Parser's headersonly flag
    def _set_headersonly(self):
        self._headersonly = True

    def feed(self, data):
        """Push more data into the parser."""
        self._input.push(data)
        self._call_parse()

    def _call_parse(self):
        try:
            self._parse()
        except StopIteration:
            pass

    def close(self):
        """Parse all remaining data and return the root message object."""
        self._input.close()
        self._call_parse()
        root = self._pop_message()
        assert not self._msgstack
        # Look for final set of defects
        if root.get_content_maintype() == 'multipart' \
               and not root.is_multipart():
            root.defects.append(errors.MultipartInvariantViolationDefect())
        return root

    def _new_message(self):
        msg = self._factory()
        if self._cur and self._cur.get_content_type() == 'multipart/digest':
            msg.set_default_type('message/rfc822')
        if self._msgstack:
            self._msgstack[-1].attach(msg)
        self._msgstack.append(msg)
        self._cur = msg
        self._last = msg

    def _pop_message(self):
        retval = self._msgstack.pop()
        if self._msgstack:
            self._cur = self._msgstack[-1]
        else:
            self._cur = None
        return retval

    def _parsegen(self):
        # Create a new message and start by parsing headers.
        self._new_message()
        headers = []
        # Collect the headers, searching for a line that doesn't match the RFC
        # 2822 header or continuation pattern (including an empty line).
        for line in self._input:
            if line is NeedMoreData:
                yield NeedMoreData
                continue
            if not headerRE.match(line):
                # If we saw the RFC defined header/body separator
                # (i.e. newline), just throw it away. Otherwise the line is
                # part of the body so push it back.
                if not NLCRE.match(line):
                    self._input.unreadline(line)
                break
            headers.append(line)
        # Done with the headers, so parse them and figure out what we're
        # supposed to see in the body of the message.
        self._parse_headers(headers)
        # Headers-only parsing is a backwards compatibility hack, which was
        # necessary in the older parser, which could raise errors.  All
        # remaining lines in the input are thrown into the message body.
        if self._headersonly:
            lines = []
            while True:
                line = self._input.readline()
                if line is NeedMoreData:
                    yield NeedMoreData
                    continue
                if line == '':
                    break
                lines.append(line)
            self._cur.set_payload(EMPTYSTRING.join(lines))
            return
        if self._cur.get_content_type() == 'message/delivery-status':
            # message/delivery-status contains blocks of headers separated by
            # a blank line.  We'll represent each header block as a separate
            # nested message object, but the processing is a bit different
            # than standard message/* types because there is no body for the
            # nested messages.  A blank line separates the subparts.
            while True:
                self._input.push_eof_matcher(NLCRE.match)
                for retval in self._parsegen():
                    if retval is NeedMoreData:
                        yield NeedMoreData
                        continue
                    break
                msg = self._pop_message()
                # We need to pop the EOF matcher in order to tell if we're at
                # the end of the current file, not the end of the last block
                # of message headers.
                self._input.pop_eof_matcher()
                # The input stream must be sitting at the newline or at the
                # EOF.  We want to see if we're at the end of this subpart, so
                # first consume the blank line, then test the next line to see
                # if we're at this subpart's EOF.
                while True:
                    line = self._input.readline()
                    if line is NeedMoreData:
                        yield NeedMoreData
                        continue
                    break
                while True:
                    line = self._input.readline()
                    if line is NeedMoreData:
                        yield NeedMoreData
                        continue
                    break
                if line == '':
                    break
                # Not at EOF so this is a line we're going to need.
                self._input.unreadline(line)
            return
        if self._cur.get_content_maintype() == 'message':
            # The message claims to be a message/* type, then what follows is
            # another RFC 2822 message.
            for retval in self._parsegen():
                if retval is NeedMoreData:
                    yield NeedMoreData
                    continue
                break
            self._pop_message()
            return
        if self._cur.get_content_maintype() == 'multipart':
            boundary = self._cur.get_boundary()
            if boundary is None:
                # The message /claims/ to be a multipart but it has not
                # defined a boundary.  That's a problem which we'll handle by
                # reading everything until the EOF and marking the message as
                # defective.
                self._cur.defects.append(errors.NoBoundaryInMultipartDefect())
                lines = []
                for line in self._input:
                    if line is NeedMoreData:
                        yield NeedMoreData
                        continue
                    lines.append(line)
                self._cur.set_payload(EMPTYSTRING.join(lines))
                return
            # Create a line match predicate which matches the inter-part
            # boundary as well as the end-of-multipart boundary.  Don't push
            # this onto the input stream until we've scanned past the
            # preamble.
            separator = '--' + boundary
            boundaryre = re.compile(
                '(?P<sep>' + re.escape(separator) +
                r')(?P<end>--)?(?P<ws>[ \t]*)(?P<linesep>\r\n|\r|\n)?$')
            capturing_preamble = True
            preamble = []
            linesep = False
            while True:
                line = self._input.readline()
                if line is NeedMoreData:
                    yield NeedMoreData
                    continue
                if line == '':
                    break
                mo = boundaryre.match(line)
                if mo:
                    # If we're looking at the end boundary, we're done with
                    # this multipart.  If there was a newline at the end of
                    # the closing boundary, then we need to initialize the
                    # epilogue with the empty string (see below).
                    if mo.group('end'):
                        linesep = mo.group('linesep')
                        break
                    # We saw an inter-part boundary.  Were we in the preamble?
                    if capturing_preamble:
                        if preamble:
                            # According to RFC 2046, the last newline belongs
                            # to the boundary.
                            lastline = preamble[-1]
                            eolmo = NLCRE_eol.search(lastline)
                            if eolmo:
                                preamble[-1] = lastline[:-len(eolmo.group(0))]
                            self._cur.preamble = EMPTYSTRING.join(preamble)
                        capturing_preamble = False
                        self._input.unreadline(line)
                        continue
                    # We saw a boundary separating two parts.  Consume any
                    # multiple boundary lines that may be following.  Our
                    # interpretation of RFC 2046 BNF grammar does not produce
                    # body parts within such double boundaries.
                    while True:
                        line = self._input.readline()
                        if line is NeedMoreData:
                            yield NeedMoreData
                            continue
                        mo = boundaryre.match(line)
                        if not mo:
                            self._input.unreadline(line)
                            break
                    # Recurse to parse this subpart; the input stream points
                    # at the subpart's first line.
                    self._input.push_eof_matcher(boundaryre.match)
                    for retval in self._parsegen():
                        if retval is NeedMoreData:
                            yield NeedMoreData
                            continue
                        break
                    # Because of RFC 2046, the newline preceding the boundary
                    # separator actually belongs to the boundary, not the
                    # previous subpart's payload (or epilogue if the previous
                    # part is a multipart).
                    if self._last.get_content_maintype() == 'multipart':
                        epilogue = self._last.epilogue
                        if epilogue == '':
                            self._last.epilogue = None
                        elif epilogue is not None:
                            mo = NLCRE_eol.search(epilogue)
                            if mo:
                                end = len(mo.group(0))
                                self._last.epilogue = epilogue[:-end]
                    else:
                        payload = self._last.get_payload()
                        if isinstance(payload, basestring):
                            mo = NLCRE_eol.search(payload)
                            if mo:
                                payload = payload[:-len(mo.group(0))]
                                self._last.set_payload(payload)
                    self._input.pop_eof_matcher()
                    self._pop_message()
                    # Set the multipart up for newline cleansing, which will
                    # happen if we're in a nested multipart.
                    self._last = self._cur
                else:
                    # I think we must be in the preamble
                    assert capturing_preamble
                    preamble.append(line)
            # We've seen either the EOF or the end boundary.  If we're still
            # capturing the preamble, we never saw the start boundary.  Note
            # that as a defect and store the captured text as the payload.
            # Everything from here to the EOF is epilogue.
            if capturing_preamble:
                self._cur.defects.append(errors.StartBoundaryNotFoundDefect())
                self._cur.set_payload(EMPTYSTRING.join(preamble))
                epilogue = []
                for line in self._input:
                    if line is NeedMoreData:
                        yield NeedMoreData
                        continue
                self._cur.epilogue = EMPTYSTRING.join(epilogue)
                return
            # If the end boundary ended in a newline, we'll need to make sure
            # the epilogue isn't None
            if linesep:
                epilogue = ['']
            else:
                epilogue = []
            for line in self._input:
                if line is NeedMoreData:
                    yield NeedMoreData
                    continue
                epilogue.append(line)
            # Any CRLF at the front of the epilogue is not technically part of
            # the epilogue.  Also, watch out for an empty string epilogue,
            # which means a single newline.
            if epilogue:
                firstline = epilogue[0]
                bolmo = NLCRE_bol.match(firstline)
                if bolmo:
                    epilogue[0] = firstline[len(bolmo.group(0)):]
            self._cur.epilogue = EMPTYSTRING.join(epilogue)
            return
        # Otherwise, it's some non-multipart type, so the entire rest of the
        # file contents becomes the payload.
        lines = []
        for line in self._input:
            if line is NeedMoreData:
                yield NeedMoreData
                continue
            lines.append(line)
        self._cur.set_payload(EMPTYSTRING.join(lines))

    def _parse_headers(self, lines):
        # Passed a list of lines that make up the headers for the current msg
        lastheader = ''
        lastvalue = []
        for lineno, line in enumerate(lines):
            # Check for continuation
            if line[0] in ' \t':
                if not lastheader:
                    # The first line of the headers was a continuation.  This
                    # is illegal, so let's note the defect, store the illegal
                    # line, and ignore it for purposes of headers.
                    defect = errors.FirstHeaderLineIsContinuationDefect(line)
                    self._cur.defects.append(defect)
                    continue
                lastvalue.append(line)
                continue
            if lastheader:
                # XXX reconsider the joining of folded lines
                lhdr = EMPTYSTRING.join(lastvalue)[:-1].rstrip('\r\n')
                self._cur[lastheader] = lhdr
                lastheader, lastvalue = '', []
            # Check for envelope header, i.e. unix-from
            if line.startswith('From '):
                if lineno == 0:
                    # Strip off the trailing newline
                    mo = NLCRE_eol.search(line)
                    if mo:
                        line = line[:-len(mo.group(0))]
                    self._cur.set_unixfrom(line)
                    continue
                elif lineno == len(lines) - 1:
                    # Something looking like a unix-from at the end - it's
                    # probably the first line of the body, so push back the
                    # line and stop.
                    self._input.unreadline(line)
                    return
                else:
                    # Weirdly placed unix-from line.  Note this as a defect
                    # and ignore it.
                    defect = errors.MisplacedEnvelopeHeaderDefect(line)
                    self._cur.defects.append(defect)
                    continue
            # Split the line on the colon separating field name from value.
            i = line.find(':')
            if i < 0:
                defect = errors.MalformedHeaderDefect(line)
                self._cur.defects.append(defect)
                continue
            lastheader = line[:i]
            lastvalue = [line[i+1:].lstrip()]
        # Done with all the lines, so handle the last header.
        if lastheader:
            # XXX reconsider the joining of folded lines
            self._cur[lastheader] = EMPTYSTRING.join(lastvalue).rstrip('\r\n')


text:
if(!internal) {
    if (!me || me.id != this.ownerId && !me.isAdmin) {
        cancel('Only owner or admin can edit game');
    }

    protect("playCount");
    protect("forkCount");
    protect("versionCount");
    protect("likedCount");
    protect("lastVersionId");
    protect("mixedFromGameIds");
    protect("mixedToGameIds");
    protect("screenshot");
    protect("animation");
    protect("description");
}

protect("ownerId");
protect("parentId");
protect("createdTime");


text:
namespace meisterwerk {
    namespace core {

        class entity;
        class baseapp;

        class msgregister {
            public:
            // members
            entity *      pEnt;         // instance object pointer to derived object instance
            unsigned long minMicroSecs; // intervall in micro seconds the loop method
                                        // should be called. 0 means never (used for
                                        // messaging only entities)
            T_PRIO priority;            // Priority MW_PRIORITY_*

            // methods
            msgregister( entity *pEnt, unsigned long minMicroSecs, T_PRIO priority )
                : pEnt{pEnt}, minMicroSecs{minMicroSecs}, priority{priority} {
            }
        };

        class entity {
            friend class baseapp;

            public:
            enum T_LOGLEVEL { ERR, WARN, INFO, DBG, VER1, VER2, VER3 };
            // members
            String     entName;                     // Instance name
            T_LOGLEVEL logLevel = T_LOGLEVEL::INFO; // Logging level

            // methods
            entity( String name, unsigned long minMicroSecs, T_PRIO priority = PRIORITY_NORMAL ) : entName( name ) {
                msgregister reg( this, minMicroSecs, priority );
                message::send( message::MSG_DIRECT, entName.c_str(), "register", &reg, sizeof( reg ) );
            }

            virtual ~entity(){};

            bool setSchedulerParams( unsigned long minMicroSecs = 0, T_PRIO priority = PRIORITY_NORMAL ) {
                msgregister reg( this, minMicroSecs, priority );
                if ( message::send( message::MSG_DIRECT, entName.c_str(), "update", &reg, sizeof( reg ) ) ) {
                    return true;
                }
                DBG( "entity::setSchedulerParams, sendMessage failed for " + entName );
                return false;
            }

            bool publish( const char *topic, const char *msg ) const {
                if ( message::send( message::MSG_PUBLISH, entName.c_str(), topic, msg ) ) {
                    return true;
                }
                DBG( "entity::publish, sendMessage failed for " + entName );
                return false;
            }

            bool publish( const String &topic, const String &msg ) const {
                return publish( topic.c_str(), msg.c_str() );
            }

            bool publish( const char *topic ) const {
                if ( message::send( message::MSG_PUBLISH, entName.c_str(), topic, nullptr ) ) {
                    return true;
                }
                DBG( "entity::publish, sendMessage failed for " + entName );
                return false;
            }

            bool publish( const String &topic ) const {
                return publish( topic.c_str() );
            }

            bool subscribe( const char *topic ) const {
                if ( message::send( message::MSG_SUBSCRIBE, entName.c_str(), topic, nullptr, 0 ) ) {
                    return true;
                }
                DBG( "entity::subscribe, sendMessage failed for " + entName );
                return false;
            }

            bool subscribe( const String &topic ) const {
                return subscribe( topic.c_str() );
            }

            bool unsubscribe( const char *topic ) const {
                if ( message::send( message::MSG_UNSUBSCRIBE, entName.c_str(), topic, nullptr, 0 ) ) {
                    return true;
                }
                DBG( "entity::unsubscribe, sendMessage failed for " + entName );
                return false;
            }

            bool unsubscribe( const String &topic ) const {
                return unsubscribe( topic.c_str() );
            }

            void setLogLevel( T_LOGLEVEL lclass ) {
                logLevel = lclass;
            }

            void log( T_LOGLEVEL lclass, String msg, String logtopic = "" ) {
                if ( lclass > logLevel ) {
                    return;
                }
                if ( logtopic == "" ) {
                    logtopic = entName;
                }
                String cstr = "";
                String icon = "";
                switch ( lclass ) {
                case T_LOGLEVEL::ERR:
                    cstr = "Error";
                    icon = "🛑";
                    break;
                case T_LOGLEVEL::WARN:
                    cstr = "Warning";
                    icon = "⚠";
                    break;
                case T_LOGLEVEL::INFO:
                    cstr = "Info";
                    icon = "ℹ";
                    break;
                case T_LOGLEVEL::DBG:
                    cstr = "Debug";
                    icon = "🗒";
                    break;
                default:
                    cstr = "Debug";
                    icon = "🐞";
                    break;
                }
                // XXX: Json-in-message escaping, is that the best way:
                msg.replace( "\\", "/" );
                msg.replace( "\"", "'" );

                String tpc    = "log/" + cstr + "/" + entName;
                String logmsg = "{\"time\":\"" + util::msgtime::ISOnowMillis() + "\",\"severity\":\"" + cstr +
                                "\",\"icon\":\"" + icon + "\",\"topic\":\"" + logtopic + "\",\"msg\":\"" + msg + "\"}";
                publish( tpc, logmsg );
                DBG( icon + "  " + tpc + " | " + logmsg );
            }

            // callbacks
            public:
            virtual void setup() {
            }

            virtual void loop() {
            }

            virtual void receive( const char *origin, const char *topic, const char *msg ) {
            }

            private:
            entity( String name ) : entName{name} {
                // special constructor only for baseapp
            }
        };
    } // namespace core
} // namespace meisterwerk


text:
package Google::Ads::GoogleAds::V12::Enums::CustomerStatusEnum;

use strict;
use warnings;

use Const::Exporter enums => [
  UNSPECIFIED => "UNSPECIFIED",
  UNKNOWN     => "UNKNOWN",
  ENABLED     => "ENABLED",
  CANCELED    => "CANCELED",
  SUSPENDED   => "SUSPENDED",
  CLOSED      => "CLOSED"
];

1;


text:
Business License

Everyone who operates a business in the City needs to register with the City's Finance department for a business license. This is an annual requirement that the City uses to track who makes up our business community and what they are doing.

The fees for this are $145.15 plus employees fees of $2.55, $4.95, or $7.40 for each employee depending on your type of business. It's important to remember that you'll be responsible for this fee even if you conduct business for a single day (the fee will be pro-rated).

You are exempt from the fee if your business is a registered nonprofit organization.

Fees for your business license are used to support general city services, including police and fire protection, as well as for the services supplied by the City's Finance, Planning and Community Development Staff and other City Administrative Functions.

After you register with the City, we'll sent a once a year renewal letter to you.

  <% if (answers.CIC_industry_subindustry) { %>

You've told us that your business is a <%= answers.CIC_industry_subindustry %> (code <%= answers.CIC_code %>).

    <form>

        What type of business is this?

<input type="radio" name="business_type_class" value="class-a"> Retail, wholesale, contract, construction, or manufacturing

<input type="radio" name="business_type_class" value="class-b"> Services, hotels and motels, apartment houses, commercial property renting or leasing, recreation and entertainment services and facilities

<input type="radio" name="business_type_class" value="nothing"> Professions including, but not limited to, accountants, architects, attorneys, auctioneers, chiropractors, dentists, engineers, insurance brokers, medical/health professions, physicians, real estate brokers, security brokers, and veterinarians

        How many employees do you have?
        <input type="text" name="employee_count" value="<%= answers.employee_count %>">

    </form>

The fee for the business license will be:

We’ll need this additional information to get you registered for a business license:

  <form>

      Business Name

<input type="text" name="business_name" value="<%= answers.business_name %>">

      Business Physical Address

<input type="text" name="business_physical_address_street" value="<%= answers.business_physical_address_street %>">

      Suite or Office Number

<input type="text" name="business_physical_address_detail" value="<%= answers.business_physical_address_detail %>">

      City

<input type="text" name="business_physical_address_city" value="<%= answers.business_physical_address_city %>">

      State

<input type="text" name="business_physical_address_state" value="<%= answers.business_physical_address_state %>">

      ZIP

<input type="text" name="business_physical_address_zip" value="<%= answers.business_physical_address_zip %>">

      Your Business’s Phone Number

<input type="text" name="business_phone" placeholder="(###) ###-####" value="<%= answers.business_phone %>">

      Applicant First Name

<input type="text" name="applicant_first_name" value="<%= answers.applicant_first_name %>">

      Applicant Last Name

<input type="text" name="applicant_last_name" value="<%= answers.applicant_last_name %>">

      Applicant Address

<input type="text" name="applicant_physical_address_street" value="<%= answers.applicant_physical_address_street %>">

      Suite or Office Number

<input type="text" name="applicant_physical_address_detail" value="<%= answers.applicant_physical_address_street %>">

      Applicant City

<input type="text" name="applicant_physical_address_city" value="<%= answers.applicant_physical_address_city %>">

      Applicant State

<input type="text" name="applicant_physical_address_state" value="<%= answers.applicant_physical_address_state %>">

      Applicant ZIP

<input type="text" name="applicant_physical_address_zip" value="<%= answers.applicant_physical_address_zip %>">

      Applicant Phone

<input type="text" name="applicant_phone" value="<%= answers.applicant_phone %>">

      Applicant email

<input type="text" name="applicant_email" value="<%= answers.applicant_email %>">

      Co-Applicant  Name

<input type="text" name="coapplicant_name" value="<%= answers.coapplicant_name %>">

      Co-Applicant Address

<input type="text" name="coapplicant_physical_address_street" value="<%= answers.coapplicant_physical_address_street %>">

      Suite or Office Number

<input type="text" name="coapplicant_physical_address_detail" value="<%= answers.coapplicant_physical_address_street %>">

      City

<input type="text" name="coapplicant_physical_address_city" value="<%= answers.coapplicant_physical_address_city %>">

      State

<input type="text" name="coapplicant_physical_address_state" value="<%= answers.coapplicant_physical_address_state %>">

      ZIP

<input type="text" name="coapplicant_physical_address_zip" value="<%= answers.coapplicant_physical_address_zip %>">

      Co-Applicant Phone

<input type="text" name="coapplicant_phone" value="<%= answers.coapplicant_phone %>">

      Co-Applicant Email

<input type="text" name="coapplicant_email" value="<%= answers.coapplicant_email %>">

      Emergency Contact

<input type="text" name="emergency_contact" value="<%= answers.emergency_contact %>">

      Business Structure

<input type="text" name="business_structure" value="<%= answers.business_structure %>">

      Business Type / Use Code

<input type="text" name="CIC_code" value="<%= answers.CIC_code %>">

      Business Category

<input type="text" name="CIC_industry_subindustry" value="<%= answers.CIC_industry_subindustry %>">

      Start Date

<input type="text" name="business_date_of_occupancy" value="<%= answers.business_date_of_occupancy %>">

      Number of Units (for rental properties)

<input type="text" name="business_number_of_units" value="<%= answers.business_number_of_units %>">

      Building Square Footage

<input type="text" name="building_square_footage_ground" value="<%= answers.building_square_footage_ground %>">

      Assessors Parcel Number

<input type="text" name="APN" value="<%= answers.apn %>">

  <% } %>

    <a href="<%= nextRequirementHref %>" class="btn btn-large btn-info"><%= nextRequirementName %> →


text:
package com.google.api.gax.httpjson;

import com.google.api.client.http.HttpTransport;
import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.core.BetaApi;
import com.google.api.core.InternalExtensionOnly;
import com.google.api.gax.core.ExecutorProvider;
import com.google.api.gax.rpc.FixedHeaderProvider;
import com.google.api.gax.rpc.HeaderProvider;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.mtls.MtlsProvider;
import com.google.auth.Credentials;
import com.google.common.annotations.VisibleForTesting;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.KeyStore;
import java.util.Map;
import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;

/**
 * InstantiatingHttpJsonChannelProvider is a TransportChannelProvider which constructs a {@link
 * ManagedHttpJsonChannel} with a number of configured inputs every time getChannel(...) is called.
 * These inputs include a port, a service address, and credentials.
 *
 *
The credentials can either be supplied directly (by providing a FixedCredentialsProvider to
 * Builder.setCredentialsProvider()) or acquired implicitly from Application Default Credentials (by
 * providing a GoogleCredentialsProvider to Builder.setCredentialsProvider()).
 *
 *
The client lib header and generator header values are used to form a value that goes into the
 * http header of requests to the service.
 */
@BetaApi
@InternalExtensionOnly
public final class InstantiatingHttpJsonChannelProvider implements TransportChannelProvider {

  private final Executor executor;
  private final HeaderProvider headerProvider;
  private final HttpJsonInterceptorProvider interceptorProvider;
  private final String endpoint;
  private final HttpTransport httpTransport;
  private final MtlsProvider mtlsProvider;

  private InstantiatingHttpJsonChannelProvider(
      Executor executor,
      HeaderProvider headerProvider,
      HttpJsonInterceptorProvider interceptorProvider,
      String endpoint,
      HttpTransport httpTransport,
      MtlsProvider mtlsProvider) {
    this.executor = executor;
    this.headerProvider = headerProvider;
    this.interceptorProvider = interceptorProvider;
    this.endpoint = endpoint;
    this.httpTransport = httpTransport;
    this.mtlsProvider = mtlsProvider;
  }

  /**
   * @deprecated If executor is not set, this channel provider will create channels with default
   *     executor defined in {@link ManagedHttpJsonChannel}.
   */
  @Deprecated
  @Override
  public boolean needsExecutor() {
    return executor == null;
  }

  @Deprecated
  @Override
  public TransportChannelProvider withExecutor(ScheduledExecutorService executor) {
    return withExecutor((Executor) executor);
  }

  @Override
  public TransportChannelProvider withExecutor(Executor executor) {
    return toBuilder().setExecutor(executor).build();
  }

  @Override
  public boolean needsHeaders() {
    return headerProvider == null;
  }

  @Override
  public TransportChannelProvider withHeaders(Map<String, String> headers) {
    return toBuilder().setHeaderProvider(FixedHeaderProvider.create(headers)).build();
  }

  @Override
  public boolean needsEndpoint() {
    return endpoint == null;
  }

  @Override
  public TransportChannelProvider withEndpoint(String endpoint) {
    return toBuilder().setEndpoint(endpoint).build();
  }

  /** @deprecated REST transport channel doesn't support channel pooling */
  @Deprecated
  @Override
  public boolean acceptsPoolSize() {
    return false;
  }

  /** @deprecated REST transport channel doesn't support channel pooling */
  @Deprecated
  @Override
  public TransportChannelProvider withPoolSize(int size) {
    throw new UnsupportedOperationException(
        "InstantiatingHttpJsonChannelProvider doesn't allow pool size customization");
  }

  @Override
  public String getTransportName() {
    return HttpJsonTransportChannel.getHttpJsonTransportName();
  }

  @Override
  public HttpJsonTransportChannel getTransportChannel() throws IOException {
    if (needsHeaders()) {
      throw new IllegalStateException("getTransportChannel() called when needsHeaders() is true");
    } else {
      try {
        return createChannel();
      } catch (GeneralSecurityException e) {
        throw new IOException(e);
      }
    }
  }

  @Override
  public boolean needsCredentials() {
    return false;
  }

  @Override
  public TransportChannelProvider withCredentials(Credentials credentials) {
    throw new UnsupportedOperationException(
        "InstantiatingHttpJsonChannelProvider doesn't need credentials");
  }

  HttpTransport createHttpTransport() throws IOException, GeneralSecurityException {
    if (mtlsProvider.useMtlsClientCertificate()) {
      KeyStore mtlsKeyStore = mtlsProvider.getKeyStore();
      if (mtlsKeyStore != null) {
        return new NetHttpTransport.Builder().trustCertificates(null, mtlsKeyStore, "").build();
      }
    }
    return null;
  }

  private HttpJsonTransportChannel createChannel() throws IOException, GeneralSecurityException {
    HttpTransport httpTransportToUse = httpTransport;
    if (httpTransportToUse == null) {
      httpTransportToUse = createHttpTransport();
    }

    ManagedHttpJsonChannel channel =
        ManagedHttpJsonChannel.newBuilder()
            .setEndpoint(endpoint)
            .setExecutor(executor)
            .setHttpTransport(httpTransportToUse)
            .build();

    HttpJsonClientInterceptor headerInterceptor =
        new HttpJsonHeaderInterceptor(headerProvider.getHeaders());

    channel = new ManagedHttpJsonInterceptorChannel(channel, headerInterceptor);
    if (interceptorProvider != null && interceptorProvider.getInterceptors() != null) {
      for (HttpJsonClientInterceptor interceptor : interceptorProvider.getInterceptors()) {
        channel = new ManagedHttpJsonInterceptorChannel(channel, interceptor);
      }
    }

    return HttpJsonTransportChannel.newBuilder().setManagedChannel(channel).build();
  }

  /** The endpoint to be used for the channel. */
  public String getEndpoint() {
    return endpoint;
  }

  @Override
  public boolean shouldAutoClose() {
    return true;
  }

  public Builder toBuilder() {
    return new Builder(this);
  }

  public static Builder newBuilder() {
    return new Builder();
  }

  public static final class Builder {

    private Executor executor;
    private HeaderProvider headerProvider;
    private HttpJsonInterceptorProvider interceptorProvider;
    private String endpoint;
    private HttpTransport httpTransport;
    private MtlsProvider mtlsProvider = new MtlsProvider();

    private Builder() {}

    private Builder(InstantiatingHttpJsonChannelProvider provider) {
      this.executor = provider.executor;
      this.headerProvider = provider.headerProvider;
      this.endpoint = provider.endpoint;
      this.httpTransport = provider.httpTransport;
      this.mtlsProvider = provider.mtlsProvider;
      this.interceptorProvider = provider.interceptorProvider;
    }

    /**
     * Sets the Executor for this TransportChannelProvider.
     *
     *
This is optional; if it is not provided, needsExecutor() will return true, meaning that an
     * Executor must be provided when getChannel is called on the constructed
     * TransportChannelProvider instance. Note: InstantiatingHttpJsonChannelProvider will
     * automatically provide its own Executor in this circumstance when it calls getChannel.
     */
    public Builder setExecutor(Executor executor) {
      this.executor = executor;
      return this;
    }

    /** @deprecated Please use {@link #setExecutor(Executor)}. */
    @Deprecated
    public Builder setExecutorProvider(ExecutorProvider executorProvider) {
      return setExecutor((Executor) executorProvider.getExecutor());
    }

    /**
     * Sets the HeaderProvider for this TransportChannelProvider.
     *
     *
This is optional; if it is not provided, needsHeaders() will return true, meaning that
     * headers must be provided when getChannel is called on the constructed
     * TransportChannelProvider instance.
     */
    public Builder setHeaderProvider(HeaderProvider headerProvider) {
      this.headerProvider = headerProvider;
      return this;
    }

    /**
     * Sets the GrpcInterceptorProvider for this TransportChannelProvider.
     *
     *
The provider will be called once for each underlying gRPC ManagedChannel that is created.
     * It is recommended to return a new list of new interceptors on each call so that interceptors
     * are not shared among channels, but this is not required.
     */
    public Builder setInterceptorProvider(HttpJsonInterceptorProvider interceptorProvider) {
      this.interceptorProvider = interceptorProvider;
      return this;
    }

    /** Sets the endpoint used to reach the service, eg "localhost:8080". */
    public Builder setEndpoint(String endpoint) {
      this.endpoint = endpoint;
      return this;
    }

    /** Sets the HTTP transport to be used. */
    public Builder setHttpTransport(HttpTransport httpTransport) {
      this.httpTransport = httpTransport;
      return this;
    }

    public String getEndpoint() {
      return endpoint;
    }

    @VisibleForTesting
    Builder setMtlsProvider(MtlsProvider mtlsProvider) {
      this.mtlsProvider = mtlsProvider;
      return this;
    }

    public InstantiatingHttpJsonChannelProvider build() {
      return new InstantiatingHttpJsonChannelProvider(
          executor, headerProvider, interceptorProvider, endpoint, httpTransport, mtlsProvider);
    }
  }
}


text:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>experimental::coro::async_resume (2 of 2 overloads)</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../boost_asio.html" title="Boost.Asio">
<link rel="up" href="../async_resume.html" title="experimental::coro::async_resume">
<link rel="prev" href="overload1.html" title="experimental::coro::async_resume (1 of 2 overloads)">
<link rel="next" href="../cancel.html" title="experimental::coro::cancel">

Home
Libraries
People
FAQ
More

experimental::coro::async_resume
          (2 of 2 overloads)

template<
    typename CompletionToken,
    detail::convertible_to< input_type > T>
auto async_resume(
    T && ip,
    CompletionToken && token);

Copyright © 2003-2021 Christopher
      M. Kohlhoff

        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


text:
/*
 * import_registration_impl.c
 *
 *  \date       Oct 14, 2011
 *  \author    	Apache Celix Project Team
 *  \copyright	Apache License, Version 2.0
 */

#include <stdlib.h>

#include <apr_strings.h>

#include <constants.h>

#include "celix_errno.h"

#include "import_registration_impl.h"
#include "remote_service_admin_impl.h"
#include "remote_proxy.h"
#include "service_tracker.h"
#include "bundle_context.h"
#include "bundle.h"

celix_status_t importRegistration_proxyFactoryAdding(void * handle, service_reference_pt reference, void **service);
celix_status_t importRegistration_proxyFactoryAdded(void * handle, service_reference_pt reference, void *service);
celix_status_t importRegistration_proxyFactoryModified(void * handle, service_reference_pt reference, void *service);
celix_status_t importRegistration_proxyFactoryRemoved(void * handle, service_reference_pt reference, void *service);

celix_status_t importRegistration_create(apr_pool_t *pool, endpoint_description_pt endpoint, remote_service_admin_pt rsa, 	sendToHandle sendToCallback, bundle_context_pt context, import_registration_pt *registration) {
	celix_status_t status = CELIX_SUCCESS;
	apr_pool_t *mypool = NULL;
	apr_pool_create(&mypool, pool);

	*registration = apr_palloc(mypool, sizeof(**registration));
	if (!*registration) {
		status = CELIX_ENOMEM;
	} else {
		(*registration)->pool = mypool;
		(*registration)->context = context;
		(*registration)->closed = false;
		(*registration)->endpointDescription = endpoint;
		(*registration)->rsa = rsa;
		(*registration)->sendToCallback = sendToCallback;
		(*registration)->reference = NULL;
		(*registration)->importReference = NULL;
	}

	return status;
}

celix_status_t importRegistration_destroy(import_registration_pt registration)
{
	return CELIX_SUCCESS;
}

celix_status_t importRegistrationFactory_create(apr_pool_t *pool, char* serviceName, bundle_context_pt context, import_registration_factory_pt *registration_factory) {
	celix_status_t status = CELIX_SUCCESS;
	apr_pool_t *mypool = NULL;
	apr_pool_create(&mypool, pool);

	*registration_factory = calloc(1, sizeof(**registration_factory));
	if (!*registration_factory) {
		status = CELIX_ENOMEM;
	} else {
		(*registration_factory)->serviceName = strdup(serviceName);
		(*registration_factory)->pool = mypool;
		(*registration_factory)->context = context;
		(*registration_factory)->bundle = NULL;
		arrayList_create(&(*registration_factory)->registrations);
	}

	return status;
}

celix_status_t importRegistrationFactory_destroy(import_registration_factory_pt* registration_factory) {
	celix_status_t status = CELIX_SUCCESS;

	if (*registration_factory != NULL)
	{
		free((*registration_factory)->serviceName);
		arrayList_destroy((*registration_factory)->registrations);

		free(*registration_factory);
	}

	return status;
}

celix_status_t importRegistrationFactory_open(import_registration_factory_pt registration_factory)
{
	celix_status_t status = CELIX_SUCCESS;

	char *bundleStore = NULL;
	bundleContext_getProperty(registration_factory->context, BUNDLE_STORE_PROPERTY_NAME, &bundleStore);

	if (bundleStore == NULL) {
		bundleStore = DEFAULT_BUNDLE_STORE;
	}

	char *name = apr_pstrcat(registration_factory->pool, bundleStore, "/", registration_factory->serviceName, "_proxy.zip", NULL);
	status = bundleContext_installBundle(registration_factory->context, name, &registration_factory->bundle);

	if (status == CELIX_SUCCESS) {
		status = bundle_start(registration_factory->bundle);
		if (status == CELIX_SUCCESS) {
			printf("%s sucessfully started\n", name);
		}
	}
	else
	{

		printf("%s could not be installed.\n", name);
	}

	return status;
}

celix_status_t importRegistrationFactory_close(import_registration_factory_pt registration_factory)
{
	celix_status_t status = CELIX_SUCCESS;

	if (registration_factory->bundle != NULL) {
		bundle_stop(registration_factory->bundle);
		bundle_uninstall(registration_factory->bundle);
	}

	return status;
}

celix_status_t importRegistration_createProxyFactoryTracker(import_registration_factory_pt registration_factory, service_tracker_pt *tracker) {
	celix_status_t status = CELIX_SUCCESS;
	service_tracker_customizer_pt customizer = NULL;

	status = serviceTrackerCustomizer_create(registration_factory, importRegistration_proxyFactoryAdding, importRegistration_proxyFactoryAdded, importRegistration_proxyFactoryModified, importRegistration_proxyFactoryRemoved, &customizer);

	if (status == CELIX_SUCCESS) {
		char *filter = apr_pstrcat(registration_factory->pool, "(&(", OSGI_FRAMEWORK_OBJECTCLASS, "=", OSGI_RSA_REMOTE_PROXY_FACTORY,")(proxy.interface=", registration_factory->serviceName, "))", NULL);
		status = serviceTracker_createWithFilter(registration_factory->context, filter, customizer, tracker);

		if (status == CELIX_SUCCESS)
		{
			serviceTracker_open(*tracker);
		}
	}

	return status;
}

celix_status_t importRegistration_proxyFactoryAdding(void * handle, service_reference_pt reference, void **service) {
	celix_status_t status = CELIX_SUCCESS;
	import_registration_factory_pt registration_factory = (import_registration_factory_pt) handle;

	bundleContext_getService(registration_factory->context, reference, service);

	return status;
}

celix_status_t importRegistration_proxyFactoryAdded(void * handle, service_reference_pt reference, void *service) {
	celix_status_t status = CELIX_SUCCESS;

	import_registration_factory_pt registration_factory = (import_registration_factory_pt) handle;
	registration_factory->trackedFactory = (remote_proxy_factory_service_pt) service;

	return status;
}

celix_status_t importRegistration_proxyFactoryModified(void * handle, service_reference_pt reference, void *service) {
	celix_status_t status = CELIX_SUCCESS;
	import_registration_factory_pt registration_factory = (import_registration_factory_pt) handle;

	return status;
}

celix_status_t importRegistration_proxyFactoryRemoved(void * handle, service_reference_pt reference, void *service) {
	celix_status_t status = CELIX_SUCCESS;
	import_registration_pt registration = handle;

	import_registration_factory_pt registration_factory = (import_registration_factory_pt) handle;
	registration_factory->trackedFactory = NULL;

	return status;
}

celix_status_t importRegistrationFactory_install(apr_pool_t *pool, char* serviceName, bundle_context_pt context, import_registration_factory_pt *registration_factory)
{
	celix_status_t status = CELIX_SUCCESS;

	if ( (status = importRegistrationFactory_create(pool, serviceName, context, registration_factory)) != CELIX_SUCCESS)
	{
		printf("remoteServiceAdmin_importService: error while creating importRegistrationFactory\n");
	}
	else if ((status = importRegistrationFactory_open(*registration_factory)) != CELIX_SUCCESS)
	{
		printf("remoteServiceAdmin_importService: cannot open registration_factory for %s \n  ", serviceName);
		importRegistrationFactory_destroy(registration_factory);
	}
	else
	{
		importRegistration_createProxyFactoryTracker(*registration_factory, &((*registration_factory)->proxyFactoryTracker));
		printf("remoteServiceAdmin_importService: new registration_factory added for %s at %p\n  ", serviceName, (*registration_factory)->proxyFactoryTracker);
	}

	return status;
}

celix_status_t importRegistration_getException(import_registration_pt registration) {
	celix_status_t status = CELIX_SUCCESS;
	return status;
}

celix_status_t importRegistration_getImportReference(import_registration_pt registration, import_reference_pt *reference) {
	celix_status_t status = CELIX_SUCCESS;

	if (registration->importReference == NULL) {
		registration->importReference = apr_palloc(registration->pool, sizeof(*registration->importReference));
		if (registration->importReference == NULL) {
			status = CELIX_ENOMEM;
		} else {
			registration->importReference->endpoint = registration->endpointDescription;
			registration->importReference->reference = registration->reference;
		}
	}

	*reference = registration->importReference;

	return status;
}


text:
<?php

namespace app\controllers;

use Yii;
use yii\filters\AccessControl;
use yii\web\Controller;
use yii\filters\VerbFilter;
use app\models\LoginForm;
use app\models\ContactForm;
use yii\web\Session;
use app\models\Masuser;
use app\models\Privilege;

class SiteController extends Controller {

    public $layout = "admin-lte";

    /*
      public function behaviors() {
      return [
      'access' => [
      'class' => AccessControl::className(),
      'only' => ['logout'],
      'rules' => [
      [
      'actions' => ['logout'],
      'allow' => true,
      'roles' => ['@'],
      ],
      ],
      ],
      'verbs' => [
      'class' => VerbFilter::className(),
      'actions' => [
      'logout' => ['post'],
      ],
      ],
      ];
      }

      public function actions() {
      return [
      'error' => [
      'class' => 'yii\web\ErrorAction',
      ],
      'captcha' => [
      'class' => 'yii\captcha\CaptchaAction',
      'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null,
      ],
      ];
      }
     *
     *
     */

    public function actionIndex() {
        return $this->render('index');
    }

    public function actionLogin() {
        $Model = new Masuser();

        $request = \Yii::$app->request;
        $username = $request->post('username');
        $passwordInput = $request->post('password');

        $Auth = $Model->Auth($username);
        if (!empty($Auth)) {
            if ($Auth['password'] == $passwordInput) {
                \Yii::$app->session['username'] = $username;
                \Yii::$app->session['userId'] = $Auth['id'];
                \Yii::$app->session['user'] = true;

                //Set Privilege In Session
                $Privilege = new Privilege();
                $Privilege->getPrivilege($Auth['id']);

                $flag = "1";
            } else {
                $flag = "0";
            }
        } else {
            $flag = "0";
        }
    }

    public function actionLogout() {
        \Yii::$app->user->logout();
        $session = \Yii::$app->session;
        $session->destroy();
        $this->redirect(['site/index'],302);
        //\Yii::$app->uns
    }

    public function actionContact() {
        $model = new ContactForm();
        if ($model->load(Yii::$app->request->post()) && $model->contact(Yii::$app->params['adminEmail'])) {
            Yii::$app->session->setFlash('contactFormSubmitted');

            return $this->refresh();
        }
        return $this->render('contact', [
                    'model' => $model,
        ]);
    }

    public function actionAbout() {
        return $this->render('about');
    }

}


text:
package cmd

import (
	"encoding/json"
	"log"

	"golang.org/x/net/context"

	"github.com/codegangsta/cli"
)

var cmdZonesDetails = cli.Command{
	Name:      "details",
	Usage:     "print zone details",
	ArgsUsage: "<zone-id>",
	Action: func(c *cli.Context) {
		if len(c.Args()) == 0 {
			log.Fatal("Usage error: zone id is required to print details.")
		}

		zone, err := client(c).Zones.Details(context.Background(), c.Args().First())
		if err != nil {
			log.Fatal(err)
		}

		body, err := json.MarshalIndent(zone, "", "  ")
		if err != nil {
			log.Fatal(err)
		}

		log.Printf("%s", body)
	},
}


text:
<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace Core\Component;

/**
 * Description of SearchComponents
 *
 * @author lucas
 */
use Core\Component\ConfigComponent;

class SearchComponent extends ConfigComponent
{

    //put your code here
    public function __construct()
    {
        parent::__construct();
    }

    public function prepare()
    {
        if ($this->request->isMethod('post')) {
            $this->redirect(['?' => $this->request->data]);
        }
    }
}


text:
using Lemonstand.Domain.Entities;
using Lemonstand.Domain.Interfaces;
using Newtonsoft.Json;

namespace Lemonstand.Domain.Base
{
    public class LemonstandResponseObject
    {
        [JsonProperty("meta")]
        public Meta MetaObject { get; set; }

        [JsonProperty("data")]
        public ILemonstandDataObject DataObject { get; set; }

        public LemonstandResponseObject(Discount data)
        {
            DataObject = data;
        }
    }
}


text:
module Integration
  class Payment < Base

    attr_reader :object

    def initialize(config, object)
      @object = object.with_indifferent_access
      super(config)
    end

    def upsert!(payment)
      payment_service.upsert!(payment_params(payment), order_id, email)
    end

    def import!
      look_up('payments').each { |p| upsert!(p) }
    end

    def order_id
      look_up('id')
    end

    def email
      look_up('email')
    end

    def look_up(what)
      object[what]
    end

    def payment_params(payment)
      Integration::Builder::Payment.new(payment).build
    end

  end
end