text:
define(function(require) {
    'use strict';
    var Backbone = require('lib/backbone'),
        optionCollections = require('collections/options'),
        $ = require('lib/jquery'),
        OptionView = require('views/optionv'),
        CONFIG = require('util/config'),
        send = require('util/send'),
        SelectView;
    SelectView = Backbone.View.extend({
        className: 'col-md-6 form-group',
        template: _.template($('#template-select').html()),
        hasOptions: false,
        isHide: true,
        initialize: function() {
            this.listenTo(optionCollections, 'add', this.addOption);
            this.listenTo(optionCollections, 'reset', this.clearOption);
            Backbone.on('reFillOption', this.reFillOption, this);
            Backbone.on('controlDisplay', this.controlDisplay, this);
            this.$el.on('click', 'button', this.model, this.optionList.bind(this));
        },
        render: function() {
            this.$el.html(this.template(this.model.toJSON()));
            this.$optionContainer = $('.dropdown-menu', this.$el);
            this.$select = $('.dropdown', this.$el);
            this.$button = $('button label', this.$el).eq(0);
            return this;
        },
        controlDisplay: function(cfg) {
            if (cfg) {
                this.isHide = !cfg.isHide;
            }
            if (this.isHide) {
                this.isHide = false;
                this.$select.addClass('open');
            } else {
                this.isHide = true;
                this.$select.removeClass('open');
            }
        },
        optionList: function(e) {
            this.controlDisplay();
            if (!this.hasOptions) {
                var configData = optionCollections.getSelectedList(),
                    currentLevel = parseInt(e.data.get('level')),
                    sendData = JSON.stringify({
                        filters: configData,
                        step: currentLevel
                    });
                send({
                    url: CONFIG.optionsUrl,
                    data: sendData,
                    success: function(dataList) {
                        var len = dataList.list.length,
                            i = 0,
                            repeatOption = optionCollections.getSelectedByLevel(currentLevel);
                        for (; i < len; i++) {
                            if (repeatOption.get('fid') === dataList.list[i].fid) {
                                continue;
                            } else {
                                dataList.list[i].selected = false;
                                this.addOption(dataList.list[i]);
                            }
                        }
                        this.hasOptions = true;
                    }.bind(this),
                    error: function(data) {
                        console.log(data);
                    }
                });
            }
        },
        addOption: function(item) {
            var currentLevel;
            //确认添加的item对象是否backbone的item还是object对象
            if (item.get) {
                currentLevel = item.get('level');
            } else {
                currentLevel = item.level;
            }
            //排除level为1的属性节点
            if (currentLevel && this.model.get('level') !== currentLevel) {
                return;
            }
            var optionview = new OptionView({
                model: item
            });
            this.$optionContainer.append(optionview.render().el);
        },
        reFillOption: function(data) {
            // var i, len, list;
            // list = optionCollections.getSelectedListGreaterByLevel(cfg.step);
            // len = list.length;
            // for (; i < len; i++) {
            //     optionCollections.remove(list[i]);
            // }
            optionCollections.reset();
            this.fillOptions(data);
        },
        fillOptions: function(fillData) {
            var len = fillData.length,
                i = 0;
            for (; i < len; i++) {
                optionCollections.add(fillData[i]);
                if (!this.$button.attr('value') && this.$select.data('level') === fillData[i].level) {
                    this.$button.attr('value', fillData[i].id);
                    this.$button.text(fillData[i].name);
                }
            };
        },
        clearOption: function() {
            this.hasOptions = false;
            this.$optionContainer.html('');
        }
    });
    return SelectView;
});


text:
from molecule import logger
from molecule.driver import base

from molecule import util

LOG = logger.get_logger(__name__)

class kvm(base.Base):
    """
    The class responsible for managing `KVM`_ instances.  `KVM`_
    is `not` the default driver used in Molecule.

    .. code-block:: yaml

        driver:
          name: kvm

    .. code-block:: bash

        $ sudo pip install shade

    Change the options passed to the ssh client.

    .. code-block:: yaml

        driver:
          name: openstack
          ssh_connection_options:
            -o ControlPath=~/.ansible/cp/%r@%h-%p

    .. important::

        Molecule does not merge lists, when overriding the developer must
        provide all options.

    Provide the files Molecule will preserve upon each subcommand execution.

    .. code-block:: yaml

        driver:
          name: ec2
          safe_files:
            - foo
            - .molecule/bar

    .. _`OpenStack`: https://www.openstack.org
    """

    def __init__(self, config):
        super(kvm, self).__init__(config)
        self._name = 'kvm'

    @property
    def name(self):
        return self._name

    @name.setter
    def name(self, value):
        self._name = value

    @property
    def login_cmd_template(self):
        connection_options = ' '.join(self.ssh_connection_options)

        return ('ssh {{address}} '
                '-l {{user}} '
                '-p {{port}} '
                '{}').format(connection_options)

    @property
    def default_safe_files(self):
        return [
            self.instance_config,
        ]

    @property
    def default_ssh_connection_options(self):
        return self._get_ssh_connection_options()

    def login_options(self, instance_name):
        d = {'instance': instance_name}

        return self._config.merge_dicts(
            d, self._get_instance_config(instance_name))

    def ansible_connection_options(self, instance_name):
        try:
            d = self._get_instance_config(instance_name)

            return {
                'ansible_user': d['user'],
                'ansible_host': d['address'],
                'ansible_port': d['port'],
                'connection': 'ssh',
                'ansible_ssh_common_args':
                ' '.join(self.ssh_connection_options),
            }
        except StopIteration:
            return {}
        except IOError:
            # Instance has yet to be provisioned , therefore the
            # instance_config is not on disk.
            return {}

    def _get_instance_config(self, instance_name):
        instance_config_dict = util.safe_load_file(
            self._config.driver.instance_config)

        return next(item for item in instance_config_dict
                    if item['instance'] == instance_name)

redpajama_set_name: RedPajamaGithub


text:
// ******************************************
// Gauge for reporting
// Each scenario has a score
// We use a gauge to indicate the trust level
// ******************************************
var gauge = function(container) {
  var that = {};
  var config = {
    size						: 150,
    clipWidth					: 250,
    clipHeight					: 100,
    ringInset					: 20,
    ringWidth					: 40,

    pointerWidth				: 7,
    pointerTailLength			: 5,
    pointerHeadLengthPercent	: 0.8,

    minValue					: 0,
    maxValue					: 100,

    minAngle					: -90,
    maxAngle					: 90,

    transitionMs				: 4000,

    majorTicks					: 7,
    labelFormat					: d3.format(',g'),
    labelInset					: 10,

    arcColorFn					: d3.interpolateHsl(d3.rgb('#ff0000'), d3.rgb('#00ff00'))
  };

var range = undefined;
var r = undefined;
var pointerHeadLength = undefined;
var value = 0;

var svg = undefined;
var arc = undefined;
var scale = undefined;
var ticks = undefined;
var tickData = undefined;
var pointer = undefined;

var donut = d3.layout.pie();

function deg2rad(deg) {
  return deg * Math.PI / 180;
}

function newAngle(d) {
  var ratio = scale(d);
  var newAngle = config.minAngle + (ratio * range);
  return newAngle;
}

function configure() {
  range = config.maxAngle - config.minAngle;
  r = config.size / 2;
  pointerHeadLength = Math.round(r * config.pointerHeadLengthPercent);

  // a linear scale that maps domain values to a percent from 0..1
  scale = d3.scale.linear()
    .range([0,1])
    .domain([config.minValue, config.maxValue]);

  ticks = scale.ticks(config.majorTicks);
  tickData = d3.range(config.majorTicks).map(function() {return 1/config.majorTicks;});

  arc = d3.svg.arc()
    .innerRadius(r - config.ringWidth - config.ringInset)
    .outerRadius(r - config.ringInset)
    .startAngle(function(d, i) {
      var ratio = d * i;
      return deg2rad(config.minAngle + (ratio * range));
    })
    .endAngle(function(d, i) {
      var ratio = d * (i+1);
      return deg2rad(config.minAngle + (ratio * range));
    });
}
that.configure = configure;

function centerTranslation() {
  return 'translate('+r +','+ r +')';
}

function isRendered() {
  return (svg !== undefined);
}
that.isRendered = isRendered;

function render(newValue) {
  svg = d3.select(container)
    .append('svg:svg')
      .attr('class', 'gauge')
      .attr('width', config.clipWidth)
      .attr('height', config.clipHeight);

  var centerTx = centerTranslation();

  var arcs = svg.append('g')
      .attr('class', 'arc')
      .attr('transform', centerTx);

  arcs.selectAll('path')
      .data(tickData)
    .enter().append('path')
      .attr('fill', function(d, i) {
        return config.arcColorFn(d * i);
      })
      .attr('d', arc);

  var lg = svg.append('g')
      .attr('class', 'label')
      .attr('transform', centerTx);
  lg.selectAll('text')
      .data(ticks)
    .enter().append('text')
      .attr('transform', function(d) {
        var ratio = scale(d);
        var newAngle = config.minAngle + (ratio * range);
        return 'rotate(' +newAngle +') translate(0,' +(config.labelInset - r) +')';
      })
      .text(config.labelFormat);

  var lineData = [ [config.pointerWidth / 2, 0],
          [0, -pointerHeadLength],
          [-(config.pointerWidth / 2), 0],
          [0, config.pointerTailLength],
          [config.pointerWidth / 2, 0] ];
  var pointerLine = d3.svg.line().interpolate('monotone');
  var pg = svg.append('g').data([lineData])
      .attr('class', 'pointer')
      .attr('transform', centerTx);

  pointer = pg.append('path')
    .attr('d', pointerLine/*function(d) { return pointerLine(d) +'Z';}*/ )
    .attr('transform', 'rotate(' +config.minAngle +')');

  update(newValue === undefined ? 0 : newValue);
}
that.render = render;

function update(newValue, newConfiguration) {
  if ( newConfiguration  !== undefined) {
    configure(newConfiguration);
  }
  var ratio = scale(newValue);
  var newAngle = config.minAngle + (ratio * range);
  pointer.transition()
    .duration(config.transitionMs)
    .ease('elastic')
    .attr('transform', 'rotate(' +newAngle +')');
}
that.update = update;

configure();

render();

return that;
};


text:
include ../../../Makefile.cfg

data: backgrnd.tim font.tim music.raw bomb.raw apple.raw

backgrnd.tim: backgrnd.bmp
	bmp2tim backgrnd.bmp backgrnd.tim 16 -org=320,0

font.tim: font.bmp
	bmp2tim font.bmp font.tim 4 -org=640,0

music.raw: music.wav
	wav2vag music.wav music.raw -L -raw

bomb.raw: bomb.wav
	wav2vag bomb.wav bomb.raw -raw

apple.raw: apple.wav
	wav2vag apple.wav apple.raw -raw

clean:
	rm -f *.tim *.raw


text:
<?php

namespace Chamilo\Application\Weblcms\Bridge\LearningPath\Assignment\Service\Entity;

/**
 * @package Chamilo\Application\Weblcms\Bridge\LearningPath\Assignment\Service\Entity
 *
 * @author Sven Vanpoucke - Hogeschool Gent
 */
class EntityServiceManager
{
    /**
     * @var \Chamilo\Application\Weblcms\Bridge\LearningPath\Assignment\Service\Entity\EntityServiceInterface[]
     */
    protected $entityServicesByType;

    /**
     * EntityServiceManager constructor.
     */
    public function __construct()
    {
        $this->entityServicesByType = [];
    }

    /**
     * @param int $entityType
     *
     * @param \Chamilo\Application\Weblcms\Bridge\LearningPath\Assignment\Service\Entity\EntityServiceInterface $entityService
     */
    public function addEntityService($entityType, EntityServiceInterface $entityService)
    {
        $this->entityServicesByType[$entityType] = $entityService;
    }

    /**
     * @param int $entityType
     *
     * @return \Chamilo\Application\Weblcms\Bridge\LearningPath\Assignment\Service\Entity\EntityServiceInterface|mixed
     */
    public function getEntityServiceByType($entityType)
    {
        if(!array_key_exists($entityType, $this->entityServicesByType))
        {
            throw new \InvalidArgumentException(sprintf('The given entityType %s is not supported', $entityType));
        }

        return $this->entityServicesByType[$entityType];
    }
}


text:
namespace Envoy {

class TestSingleton {
public:
  virtual ~TestSingleton() = default;

  virtual void addOne() {
    Thread::LockGuard lock(lock_);
    ++value_;
  }

  virtual int value() {
    Thread::LockGuard lock(lock_);
    return value_;
  }

protected:
  Thread::MutexBasicLockable lock_;
  int value_{0};
};

class EvilMathSingleton : public TestSingleton {
public:
  EvilMathSingleton() { value_ = -50; }
  void addOne() override {
    Thread::LockGuard lock(lock_);
    ++value_;
    ++value_;
  }
};

class AddTen {
public:
  AddTen() {
    thread_ = Thread::threadFactoryForTest().createThread([this]() -> void { threadRoutine(); });
  }
  ~AddTen() {
    thread_->join();
    thread_.reset();
  }

private:
  void threadRoutine() {
    auto& singleton = ThreadSafeSingleton<TestSingleton>::get();
    for (int i = 0; i < 10; ++i) {
      singleton.addOne();
    }
  }
  Thread::ThreadPtr thread_;
};

TEST(ThreadSafeSingleton, BasicCreationAndMutation) {
  auto& singleton = ThreadSafeSingleton<TestSingleton>::get();
  EXPECT_EQ(&singleton, &ThreadSafeSingleton<TestSingleton>::get());
  EXPECT_EQ(0, singleton.value());
  singleton.addOne();
  EXPECT_EQ(1, singleton.value());

  {
    AddTen ten;
    AddTen twenty;
    AddTen thirty;
  }
  EXPECT_EQ(31, singleton.value());
}

TEST(ThreadSafeSingleton, Injection) {
  EvilMathSingleton evil_singleton;

  // Sanity check that other tests didn't cause the main singleton to overflow.
  int latched_value = ThreadSafeSingleton<TestSingleton>::get().value();
  ASSERT_GE(latched_value, 0);

  {
    TestThreadsafeSingletonInjector<TestSingleton> override(&evil_singleton);
    auto& evil_math_reference = ThreadSafeSingleton<TestSingleton>::get();
    EXPECT_NE(latched_value, evil_math_reference.value());
    EXPECT_EQ(-50, evil_math_reference.value());
    evil_math_reference.addOne();
    EXPECT_EQ(-48, evil_math_reference.value());
  }
  EXPECT_EQ(latched_value, ThreadSafeSingleton<TestSingleton>::get().value());
}

} // namespace Envoy


text:
This sample demonstrates how to create and delete a table. You can use either a `TableServiceClient` or a `TableClient` to create a table based on your needs. To get started, you'll need access to either a Storage or Cosmos DB account.

## Create a `TableServiceClient`
A `TableServiceClient` performs account-level operations like creating and deleting tables, so it is ideal for dealing with multiple tables. To create a `TableServiceClient`, you will need a SAS URI, an endpoint and `TableSharedKeyCredential`, or a connection string.

In the sample below, we will use a Storage account and authenticate with an endpoint and `TableSharedKeyCredential`, which requires an account name and an account key. You can set `accountName` and `storageAccountKey` with an environment variable, configuration setting, or any way that works for your application.

```C# Snippet:TablesSample1CreateClient
// Construct a new <see cref="TableServiceClient" /> using a <see cref="TableSharedKeyCredential" />.

var serviceClient = new TableServiceClient(
    new Uri(storageUri),
    new TableSharedKeyCredential(accountName, storageAccountKey));
```
## Create a `TableClient`
A `TableClient` is needed to perform table-level operations like inserting and deleting entities within the table, so it is ideal for dealing with only a specific table. There are two ways to get a `TableClient`:
- Call `GetTableClient` from the `TableServiceClient` with the table name.

```C# Snippet:TablesSample1GetTableClient
tableName = "OfficeSupplies1p2";
var tableClient = serviceClient.GetTableClient(tableName);
```

- Create a `TableClient` with a SAS URI, an endpoint and `TableSharedKeyCredential`, or a connection string.

```C# Snippet:TablesSample1CreateTableClient
tableClient = new TableClient(
    new Uri(storageUri),
    tableName,
    new TableSharedKeyCredential(accountName, storageAccountKey));
```

## Create a table
A table requires a [unique table name](https://docs.microsoft.com/rest/api/storageservices/understanding-the-table-service-data-model#table-names)

### Using `TableServiceClient`
To create a table, invoke `CreateTable` with the table name.

```C# Snippet:TablesSample1CreateTable
// Create a new table. The <see cref="TableItem" /> class stores properties of the created table.

TableItem table = serviceClient.CreateTable(tableName);
Console.WriteLine($"The created table's name is {table.TableName}.");
```
### Using `TableClient`
To create a table, invoke `Create` with the table name.

```C# Snippet:TablesSample1TableClientCreateTable
tableClient.Create();
```

## Delete a table
### Using `TableServiceClient`
To delete the table, invoke `DeleteTable` with the table name.

```C# Snippet:TablesSample1DeleteTable
// Deletes the table made previously.

serviceClient.DeleteTable(tableName);
```

### Using `TableClient`
To delete the table, invoke `Delete` with the table name.

```C# Snippet:TablesSample1TableClientDeleteTable
tableClient.Delete();
```

## Handle errors
To get more information from a thrown exception when creating and deleting tables, use a try/catch statement to print out the exception.

```C# Snippet:TablesSample1CreateExistingTable
try
{
    // Creates a table.
    serviceClient.CreateTable(tableName);

    // Second attempt to create table with the same name should throw exception.
    serviceClient.CreateTable(tableName);
}
catch (RequestFailedException e)
{
    Console.WriteLine("Create existing table throws the following exception:");
    Console.WriteLine(e.Message);
}
```
---
To see the full example source files, see:
- [Synchronous CreateDeleteTable](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/tables/Azure.Data.Tables/tests/samples/Sample1_CreateDeleteTable.cs)
- [Asynchronous CreateDeleteTable](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/tables/Azure.Data.Tables/tests/samples/Sample1_CreateDeleteTableAsync.cs)
- [CreateDeleteTableErrors](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/tables/Azure.Data.Tables/tests/samples/Sample1_CreateDeleteTableErrors.cs)


text:
package org.apache.storm.nimbus;

import java.util.Map;

/**
 * A plugin interface that gets invoked any time there is an action for a topology.
 */
public interface ITopologyActionNotifierPlugin {
    /**
     * Called once during nimbus initialization.
     * @param StormConf
     */
    void prepare(Map<String, Object> StormConf);

    /**
     * When a new actions is executed for a topology, this method will be called.
     * @param topologyName
     * @param action
     */
    void notify(String topologyName, String action);

    /**
     * called during shutdown.
     */
    void cleanup();
}


text:
FROM ibmcom/websphere-liberty:kernel-java8-openj9-ubi

# Add my app and config
COPY --chown=1001:0  server.xml /config/
COPY --chown=1001:0  server.env /config/

# Default setting for the verbose option
ARG VERBOSE=true

# Optional functionality
ARG TLS=true
# trust certificates from well known CA's
ENV SEC_TLS_TRUSTDEFAULTCERTS=true
# trust certificates from within the cluster, such as Red Hat SSO.
ENV SEC_IMPORT_K8S_CERTS=true

# Enable single sign on app security using an OIDC provider and Github.
# Further configuration is deferred until image deployment.
ARG SEC_SSO_PROVIDERS="oidc github"

# copy secured app
COPY --chown=1001:0 formlogin.war /config/apps
# copy another app
RUN mkdir -p /config/dropins
COPY --chown=1001:0 URLchecker.war /config/dropins

# This script will add the requested XML snippets and grow image to be fit-for-purpose.
RUN configure.sh


text:
#include <xpd_pwr.h>
#include <xpd_rcc.h>
#include <xpd_utils.h>

/** @addtogroup PWR
 * @{ */

#define PWR_BKPREG_TIMEOUT          1000
#define PWR_VOSRDY_TIMEOUT          1000
#define PWR_OVERDRIVE_TIMEOUT       1000
#define PWR_UNDERDRIVE_TIMEOUT      1000

/** @addtogroup PWR_Core
 * @{ */

/** @defgroup PWR_Exported_Functions PWR Exported Functions
 * @{ */

/**
 * @brief Enters Sleep mode.
 * @note  In Sleep mode, all I/O pins keep the same state as in Run mode.
 * @param eWakeUpOn: Specifies if SLEEP mode is exited with WFI or WFE instruction
 *           This parameter can be one of the following values:
 *            @arg REACTION_IT: enter SLEEP mode with WFI instruction
 *            @arg REACTION_EVENT: enter SLEEP mode with WFE instruction
 */
void PWR_vSleepMode(ReactionType eWakeUpOn)
{
    /* Clear SLEEPDEEP bit of Cortex System Control Register */
    SCB->SCR.b.SLEEPDEEP = 0;

    if (eWakeUpOn == REACTION_IT)
    {
        /* Request Wait For Interrupt */
        __WFI();
    }
    else
    {
        /* Request Wait For Event */
        __SEV();
        __WFE();
        __WFE();
    }
}

/**
 * @brief Enters STOP mode.
 * @note  In Stop mode, all I/O pins keep the same state as in Run mode.
 * @note  When exiting Stop mode by issuing an interrupt or a wakeup event,
 *         the HSI RC oscillator is selected as system clock.
 * @note  When the voltage regulator operates in low power mode (Stop 1), an additional
 *         startup delay is incurred when waking up from Stop mode.
 *         By keeping the internal regulator ON during Stop mode (Stop 0), the consumption
 *         is higher although the startup time is reduced.
 * @param eWakeUpOn: Specifies if STOP mode is exited with WFI or WFE instruction
 *           This parameter can be one of the following values:
 *            @arg REACTION_IT: enter SLEEP mode with WFI instruction
 *            @arg REACTION_EVENT: enter SLEEP mode with WFE instruction
 * @param eRegulator: Specifies the regulator state in STOP mode
 * @note  Using Underdrive mode, the 1.2V domain is preserved in reduced leakage mode. This
 *        mode is only available when the main regulator or the low power regulator
 *        is in low voltage mode
 */
void PWR_vStopMode(ReactionType eWakeUpOn, PWR_RegulatorType eRegulator)
{
#ifdef PWR_CR_UDEN
    /* Enable the Under-drive Mode when selected */
    if (eRegulator & (PWR_CR_LPUDS | PWR_CR_MRUDS) != 0)
    {
        uint32_t ulTimeout = PWR_UNDERDRIVE_TIMEOUT;

        /* Clear Under-drive flag */
        PWR_REG_BIT(CSR,UDSWRDY) = 0;

        /* Enable the Under-drive */
        PWR_REG_BIT(CR,UDEN) = 1;

        /* If Underdrive setting is successful, set STOP mode with underdrive */
        if (XPD_OK == XPD_eWaitForMatch(&RCC->CR.w,
                PWR_CSR_UDSWRDY, PWR_CSR_UDSWRDY, &ulTimeout))
        {
            MODIFY_REG(PWR->CR.w, PWR_CR_LPUDS | PWR_CR_MRUDS, eRegulator);
        }
    }
#endif
    /* Clear PDDS bit */
    PWR_REG_BIT(CR,PDDS) = 0;

    /* Set LPDS bit according to Regulator value */
    PWR_REG_BIT(CR,LPDS) = eRegulator;

    /* Set SLEEPDEEP bit of Cortex System Control Register */
    SCB->SCR.b.SLEEPDEEP = 1;

    /* Select STOP mode entry */
    if (eWakeUpOn == REACTION_IT)
    {
        /* Request Wait For Interrupt */
        __WFI();
    }
    else
    {
        /* Request Wait For Event */
        __SEV();
        __WFE();
        __WFE();
    }

    /* Reset SLEEPDEEP bit of Cortex System Control Register */
    SCB->SCR.b.SLEEPDEEP = 0;
}

/**
 * @brief Enters STANDBY mode.
 * @note  In Standby mode, all I/O pins are high impedance except for:
 *          - Reset pad (still available),
 *          - RTC alternate function pins if configured for tamper, time-stamp, RTC
 *            Alarm out, or RTC clock calibration out,
 *          - WKUP pins if enabled.
 */
void PWR_vStandbyMode(void)
{
    /* Select STANDBY mode */
    PWR_REG_BIT(CR,PDDS) = 1;

    /* Set SLEEPDEEP bit of Cortex System Control Register */
    SCB->SCR.b.SLEEPDEEP = 1;

    /* This option is used to ensure that store operations are completed */
#if defined ( __CC_ARM)
    __force_stores();
#endif
    /* Request Wait For Interrupt */
    __WFI();
}

/**
 * @brief Sets the Backup Regulator state.
 * @param eNewState: the new backup regulator state to set
 * @return ERROR if backup access is locked, TIMEOUT when setting timed out, OK when successful
 */
XPD_ReturnType XPD_PWR_BackupRegulatorCtrl(FunctionalState eNewState)
{
    XPD_ReturnType eResult = XPD_ERROR;

    /* BRE can only be written when backup access is enabled */
    if (PWR_REG_BIT(CR,DBP) != 0)
    {
        uint32_t ulTimeout = PWR_BKPREG_TIMEOUT;

        PWR_REG_BIT(CSR,BRE) = eNewState;

        eResult = XPD_eWaitForMatch(&PWR->CSR.w,
                PWR_CSR_BRR, PWR_CSR_BRR * eNewState, &ulTimeout);
    }
    return eResult;
}

/**
 * @brief Enables the WakeUp PINx functionality.
 * @param ucWakeUpPin: Specifies the Power Wake-Up pin to enable.
 */
void PWR_vWakeUpPin_Enable(uint8_t ucWakeUpPin)
{
    switch (ucWakeUpPin)
    {
        case 1:
#ifdef PWR_CSR_EWUP1
            PWR_REG_BIT(CSR, EWUP1) = 1;
#else
            PWR_REG_BIT(CSR, EWUP) = 1;
#endif
            break;
#if defined(PWR_CSR_EWUP2)
        case 2:
            PWR_REG_BIT(CSR, EWUP2) = 1;
            break;
#endif
#if defined(PWR_CSR_EWUP3)
        case 3:
            PWR_REG_BIT(CSR, EWUP3) = 1;
            break;
#endif
    }
}

/**
 * @brief Disables the WakeUp PINx functionality.
 * @param ucWakeUpPin: Specifies the Power Wake-Up pin to disable.
 */
void PWR_vWakeUpPin_Disable(uint8_t ucWakeUpPin)
{
    switch (ucWakeUpPin)
    {
        case 1:
#if defined(PWR_CSR_EWUP1)
            PWR_REG_BIT(CSR, EWUP1) = 0;
#else
            PWR_REG_BIT(CSR, EWUP) = 0;
#endif
            break;
#if defined(PWR_CSR_EWUP2)
        case 2:
            PWR_REG_BIT(CSR, EWUP2) = 0;
            break;
#endif
#if defined(PWR_CSR_EWUP3)
        case 3:
            PWR_REG_BIT(CSR, EWUP3) = 0;
            break;
#endif
    }
}

#ifdef PWR_CSR_WUPP
/**
 * @brief Sets the WakeUp Pin polarity.
 * @param ucWakeUpPin: Specifies the Wake-Up pin to configure.
 * @param eRisingOrFalling: the polarity. Permitted values:
             @arg @ref EdgeType::EDGE_RISING
             @arg @ref EdgeType::EDGE_FALLING
 */
void PWR_vWakeUpPin_SetPolarity(uint8_t ucWakeUpPin, EdgeType eRisingOrFalling)
{
    if (eRisingOrFalling == EDGE_FALLING)
    {
        PWR_REG_BIT(CSR,WUPP) = 1;
    }
    else
    {
        PWR_REG_BIT(CSR,WUPP) = 0;
    }
}
#endif

/** @} */

/** @} */

#ifdef PWR_CR_VOS
/** @addtogroup PWR_Regulator_Voltage_Scaling
 * @{ */

/** @defgroup PWR_Regulator_Voltage_Scaling_Exported_Functions PWR Regulator Voltage Scaling Exported Functions
 * @{ */

/**
 * @brief Sets the new Regulator Voltage Scaling configuration.
 * @param eScaling the new scaling value
 * @return ERROR if operation is blocked, TIMEOUT if setting fails, OK when successful
 */
XPD_ReturnType PWR_eVoltageScaleConfig(PWR_RegVoltScaleType eScaling)
{
    XPD_ReturnType eResult;
    uint32_t ulTimeout = PWR_VOSRDY_TIMEOUT;

#ifdef PWR_CR_VOS_1
    /* Check if the PLL is used as system clock or not */
    if (RCC->CFGR.b.SWS == PLL)
    {
        eResult = XPD_ERROR;
    }
    else
#endif
    {
#ifdef PWR_CR_VOS_1
        bool bPllOn = RCC_REG_BIT(CR,PLLRDY);

        if (bPllOn)
        {
            /* disable the main PLL. */
            RCC_REG_BIT(CR,PLLON) = 0;

            /* wait until PLL is disabled */
            eResult = XPD_eWaitForMatch(&RCC->CR.w,
                    RCC_CR_PLLRDY, 0, RCC_PLL_TIMEOUT);
            if (eResult != XPD_OK)
            {
                return eResult;
            }
        }
#endif
        PWR->CR.b.VOS = eScaling;

#ifdef PWR_CR_VOS_1
        if (bPllOn)
        {
            /* enable the main PLL. */
            RCC_REG_BIT(CR,PLLON) = 1;

            /* wait until PLL is enabled */
            eResult = XPD_eWaitForMatch(&RCC->CR.w,
                    RCC_CR_PLLRDY, RCC_CR_PLLRDY, RCC_PLL_TIMEOUT);
            if (eResult != XPD_OK)
            {
                return eResult;
            }
        }
#endif
        eResult = XPD_eWaitForMatch(&PWR->CSR.w,
                PWR_CSR_VOSRDY, PWR_CSR_VOSRDY, &ulTimeout);
    }
    return eResult;
}

#if defined(PWR_CR_MRLVDS) && defined(PWR_CR_LPLVDS)
/**
 * @brief Sets the low voltage mode for the selected regulator.
 * @param eRegulator: the regulator to configure
 * @param eNewState: the low voltage mode state to set
 */
void PWR_vRegLowVoltageConfig(PWR_RegulatorType eRegulator, FunctionalState eNewState)
{
    if (eRegulator == PWR_MAINREGULATOR)
    {
        PWR_REG_BIT(CR,MRLVDS) = eNewState;
    }
    else
    {
        PWR_REG_BIT(CR,LPLVDS) = eNewState;
    }
}
#endif

/** @} */

/** @} */
#endif /* PWR_CR_VOS */

#ifdef PWR_CR_ODEN

/** @addtogroup PWR_OverDrive_Mode
 * @{ */

/** @defgroup PWR_OverDrive_Mode_Exported_Functions PWR OverDrive Mode Exported Functions
 * @{ */

/**
 * @brief  Activates the Over-Drive mode, allowing the CPU and the core logic to operate at a higher frequency
 *         than the normal mode for a given voltage scaling (scale 1, scale 2 or scale 3).
 * @note   It is recommended to enter or exit Over-drive mode when the application is not running
 *         critical tasks and when the system clock source is either HSI or HSE.
 *         During the Over-drive switch activation, no peripheral clocks should be enabled.
 * @retval TIMEOUT if setting fails, OK when successful
 */
XPD_ReturnType PWR_vOverDrive_Enable(void)
{
    XPD_ReturnType eResult;
    uint32_t ulTimeout = PWR_OVERDRIVE_TIMEOUT;

    /* Enable the Overdrive to extend the clock frequency to 180 Mhz */
    PWR_REG_BIT(CR, ODEN) = 1;

    /* Wait until Overdrive is ready */
    eResult = XPD_eWaitForMatch(&RCC->CR.w,
            PWR_CSR_ODRDY, PWR_CSR_ODRDY, &ulTimeout);

    if (eResult == XPD_OK)
    {
        /* Enable the Overdrive switch */
        PWR_REG_BIT(CR, ODSWEN) = 1;

        /* Wait until Overdrive SW is ready */
        eResult = XPD_eWaitForMatch(&RCC->CR.w,
                PWR_CSR_ODSWRDY, PWR_CSR_ODSWRDY, &ulTimeout);
    }

    return eResult;
}

/**
 * @brief  Deactivates the Over-Drive mode.
 * @note   It is recommended to enter or exit Over-drive mode when the application is not running
 *         critical tasks and when the system clock source is either HSI or HSE.
 *         During the Over-drive switch activation, no peripheral clocks should be enabled.
 * @retval TIMEOUT if setting fails, OK when successful
 */
XPD_ReturnType PWR_vOverDrive_Disable(void)
{
    XPD_ReturnType eResult;
    uint32_t ulTimeout = PWR_OVERDRIVE_TIMEOUT;

    /* Disable the Over-drive switch */
    PWR_REG_BIT(CR, ODSWEN) = 0;

    /* Wait until Overdrive SW is not ready */
    eResult = XPD_eWaitForMatch(&RCC->CR.w,
            PWR_CSR_ODSWRDY, 0, &ulTimeout);

    if (eResult == XPD_OK)
    {
        /* Disable the Over-drive switch */
        PWR_REG_BIT(CR, ODEN) = 0;

        /* Wait until Overdrive is not ready */
        eResult = XPD_eWaitForMatch(&RCC->CR.w,
                PWR_CSR_ODRDY, 0, &ulTimeout);
    }

    return eResult;
}

/** @} */

/** @} */
#endif /* PWR_CR_ODEN */

/** @} */


text:
FROM paugamo/pod

#
# - install jdk8 from oracle
#
RUN apt-get install -y python-software-properties software-properties-common
RUN add-apt-repository ppa:webupd8team/java
RUN apt-get update
RUN echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections
RUN apt-get update && apt-get install -y oracle-java8-installer

#
# - setup zk 3.4.6 straight from their mirror
#
RUN apt-get -y install wget
RUN wget -q -O - http://apache.mirrors.pair.com/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz | tar -C /opt -xz
RUN mkdir /var/lib/zookeeper

#
# - add our spiffy pod script
# - add the zookeeper supervisor config file
# - start supervisor
#
ADD resources/pod /opt/zookeeper-3.4.6/pod
ADD resources/supervisor /etc/supervisor/conf.d
CMD /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf


text:
import torch

from detectron2.modeling import PROPOSAL_GENERATOR_REGISTRY
from detectron2.modeling.proposal_generator.rpn import RPN
from detectron2.structures import ImageList

@PROPOSAL_GENERATOR_REGISTRY.register()
class TridentRPN(RPN):
    """
    Trident RPN subnetwork.
    """

    def __init__(self, cfg, input_shape):
        super(TridentRPN, self).__init__(cfg, input_shape)

        self.num_branch = cfg.MODEL.TRIDENT.NUM_BRANCH
        self.trident_fast = cfg.MODEL.TRIDENT.TEST_BRANCH_IDX != -1

    def forward(self, images, features, gt_instances=None):
        """
        See :class:`RPN.forward`.
        """
        num_branch = self.num_branch if self.training or not self.trident_fast else 1
        # Duplicate images and gt_instances for all branches in TridentNet.
        all_images = ImageList(
            torch.cat([images.tensor] * num_branch), images.image_sizes * num_branch
        )
        all_gt_instances = gt_instances * num_branch if gt_instances is not None else None

        return super(TridentRPN, self).forward(all_images, features, all_gt_instances)


text:
package io.cloudslang.content.jclouds.execute;

import io.cloudslang.content.jclouds.entities.inputs.ListRegionsInputs;
import io.cloudslang.content.jclouds.entities.outputs.Outputs;
import io.cloudslang.content.jclouds.factory.ComputeFactory;
import io.cloudslang.content.jclouds.services.ComputeService;
import org.jclouds.rest.ResourceNotFoundException;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.Spy;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;

/**
 * Created by persdana on 7/7/2015.
 */
@RunWith(PowerMockRunner.class)
@PrepareForTest({ListRegionsExecutor.class, ComputeFactory.class})
public class ListRegionsExecutorTest {
    private static final String INVALID_ENDPOINT_EXCEPTION_MESSAGE = "invalid endpoint";
    private static final String DELIMITER = ";;";
    private static final String DEFAULT_DELIMITER = ";\n";

    @Rule
    public ExpectedException exception = ExpectedException.none();

    @Spy
    private ListRegionsExecutor toTest = new ListRegionsExecutor();

    @Mock
    ComputeService computeServiceMock;

    /**
     * Tests the execute method. Positive scenario.
     * @throws Exception
     */
    @Test
    public void testExecute() throws Exception {
        ListRegionsInputs inputs = Inputs.getListRegionsInputsForAmazon();
        PowerMockito.mockStatic(ComputeFactory.class);
        PowerMockito.doReturn(computeServiceMock).when(ComputeFactory.class, "getComputeService", inputs);
        Set<String> regions = new HashSet<>();
        regions.add("reg1");
        regions.add("reg2");
        Mockito.doReturn(regions).when(computeServiceMock).listRegions();

        Map<String, String> result = toTest.execute(inputs);

        Assert.assertEquals(result.get(Outputs.RETURN_CODE), "0");
        Assert.assertEquals(result.get(Outputs.RETURN_RESULT), "reg1" + DELIMITER + "reg2");
        verify(computeServiceMock).listRegions();
        verifyNoMoreInteractions(computeServiceMock);
    }

    @Test
    public void testExecuteNegativeScenario() throws Exception {
        exception.expect(ResourceNotFoundException.class);
        exception.expectMessage(INVALID_ENDPOINT_EXCEPTION_MESSAGE);

        ListRegionsInputs intputs = Inputs.getListRegionsInputsForAmazon();
        PowerMockito.mockStatic(ComputeFactory.class);
        PowerMockito.doReturn(computeServiceMock).when(ComputeFactory.class, "getComputeService", intputs);
        ResourceNotFoundException toThrow = new ResourceNotFoundException(INVALID_ENDPOINT_EXCEPTION_MESSAGE);
        Mockito.doThrow(toThrow).when(computeServiceMock).listRegions();

        toTest.execute(intputs);
    }
}


text:
[![Angular 2 Style Guide](https://mgechev.github.io/angular2-style-guide/images/badge.svg)](https://angular.io/styleguide)
[![Build Status](https://travis-ci.org/mgechev/angular2-seed.svg?branch=master)](https://travis-ci.org/mgechev/angular2-seed)
[![Build Status](https://ci.appveyor.com/api/projects/status/github/mgechev/angular2-seed?svg=true)](https://ci.appveyor.com/project/mgechev/angular2-seed)
[![Join the chat at https://gitter.im/mgechev/angular2-seed](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mgechev/angular2-seed?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)
[![Dependency Status](https://david-dm.org/mgechev/angular2-seed.svg)](https://david-dm.org/mgechev/angular2-seed)
[![devDependency Status](https://david-dm.org/mgechev/angular2-seed/dev-status.svg)](https://david-dm.org/mgechev/angular2-seed#info=devDependencies)

Provides fast, reliable and extensible starter for the development of Angular 2 projects.

`angular2-seed` provides the following features:

- Allows you to painlessly update the seed tasks of your already existing project.
- Out of the box ServiceWorkers and AppCache support thanks to the integration with [angular/mobile-toolkit](https://github.com/angular/mobile-toolkit).
- Ready to go, statically typed build system using gulp for working with TypeScript.
- Production and development builds.
- Sample unit tests with Jasmine and Karma including code coverage via [istanbul](https://gotwarlost.github.io/istanbul/).
- End-to-end tests with Protractor.
- Development server with Livereload.
- Following the [best practices](https://angular.io/styleguide).
- Manager of your type definitions using [typings](https://github.com/typings/typings).
- Has autoprefixer and css-lint support.

# How to start

**Note** that this seed project requires node v4.x.x or higher and npm 2.14.7.

**Here is how to [speed-up the build on Windows](https://github.com/mgechev/angular2-seed/wiki/Speed-up-the-build-on-Windows)**.

In order to start the seed use:

```bash
git clone --depth 1 https://github.com/mgechev/angular2-seed.git
cd angular2-seed
# install the project's dependencies
npm install
# watches your files and uses livereload by default
npm start
# api document for the app
# npm run build.docs

# dev build
npm run build.dev
# prod build
npm run build.prod
```

_Does not rely on any global dependencies._

# Table of Content

- [Introduction](#introduction)
- [How to start](#how-to-start)
- [Table of Content](#table-of-content)
- [Configuration](#configuration)
- [Tools documentation](#tools-documentation)
- [How to extend?](#how-to-extend)
- [Running tests](#running-tests)
- [Progressive Web Apps](#progressive-web-apps)
- [Contributing](#contributing)
- [Advanced Seed Option](#advanced-seed-option)
- [Examples](#examples)
- [Directory Structure](#directory-structure)
- [Contributors](#contributors)
- [Change Log](#change-log)
- [License](#license)

# Configuration

Default application server configuration

```javascript
var PORT             = 5555;
var LIVE_RELOAD_PORT = 4002;
var DOCS_PORT        = 4003;
var APP_BASE         = '/';
```

Configure at runtime

```bash
npm start -- --port 8080 --reload-port 4000 --base /my-app/
```

# Tools documentation

A documentation of the provided tools can be found in [tools/README.md](tools/README.md).

# How to extend?

Visit the [Wiki page](https://github.com/mgechev/angular2-seed/wiki) of the project.

# Running tests

```bash
npm test

# Debug - In two different shell windows
npm run build.test.watch      # 1st window
npm run karma.start           # 2nd window

# code coverage (istanbul)
# auto-generated at the end of `npm test`
# view coverage report:
npm run serve.coverage

# e2e (aka. end-to-end, integration) - In three different shell windows
# Make sure you don't have a global instance of Protractor

# npm run webdriver-update <- You will need to run this the first time
npm run webdriver-start
npm run serve.e2e
npm run e2e

# e2e live mode - Protractor interactive mode
# Instead of last command above, you can use:
npm run e2e.live
```
You can learn more about [Protractor Interactive Mode here](https://github.com/angular/protractor/blob/master/docs/debugging.md#testing-out-protractor-interactively)

<!-- # Progressive Web Apps

`angular2-seed` supports progressive web apps with [angular/mobile-toolkit](https://github.com/angular/mobile-toolkit).

The seed can generate a file `manifest.appcache` which lists all files included in a project's output, along with SHA1 hashes of all file contents. This file can be used directly as an AppCache manifest (for now, `index.html` must be manually edited to set this up).

The manifest is also annotated for use with `angular2-service-worker`. Some manual operations are currently required to enable this usage. The package must be installed, and `worker.js` manually copied into the project src directory:

```bash
cp node_modules/angular2-service-worker/dist/worker.js src/client
```

In order to generate the manifest file run:

```bash
# ENV can be both prod or dev
npm run generate.manifest -- --env ENV
```

Then, the commented snippet in `main.ts` must be uncommented to register the worker script as a service worker. -->

# Contributing

Please see the [CONTRIBUTING](https://github.com/mgechev/angular2-seed/blob/master/.github/CONTRIBUTING.md) file for guidelines.

# Advanced Seed Option

An [advanced option to this seed exists here](https://github.com/NathanWalker/angular2-seed-advanced) which mirrors the latest changes here but adds core support for:

- [ngrx/store](https://github.com/ngrx/store) RxJS powered state management, inspired by **Redux**
- [ngrx-store-router](https://github.com/CodeSequence/ngrx-store-router) middleware for syncing state with Angular 2 Router.
- [ng2-translate](https://github.com/ocombe/ng2-translate) for i18n
- [lodash](https://lodash.com/) Helps reduce blocks of code down to single lines and enhances readability
- [NativeScript](https://www.nativescript.org/) cross platform mobile (w/ native UI) apps.
- More coming in the future...

You may use it to learn how to extend this seed for your own use cases or use the advanced seed if your project needs those features.

# Examples

Forks of this project demonstrate how to extend and integrate with other libraries:

 - https://github.com/archfirst/angular2-seed-sass - integration with [Sass](http://sass-lang.com/)
 - https://github.com/DeviantJS/angular2-seed-postcss - Extending PostCSS with precss / cssnext for Sass-like features.
 - https://github.com/DeviantJS/angular2-seed-material2 - integration with [Angular2-Material](https://github.com/angular/material2)
 - https://github.com/AngularShowcase/angular2-sample-app - sample Angular 2 application
 - https://github.com/AngularShowcase/ng2-bootstrap-sbadmin - ng2-bootstrap-sbadmin
 - https://github.com/AngularShowcase/angular2-seed-ng2-highcharts - Simple application including a [Highcharts](http://www.highcharts.com) graph.
 - https://github.com/tarlepp/angular-sailsjs-boilerplate-frontend-angular2 - Example application for [Sails.js](http://sailsjs.org/) integration.
 - https://github.com/ludohenin/ng2-wp-blog - Angular 2 application using Wordpress [JSON-API](http://v2.wp-api.org) backend.
 - https://github.com/AngularShowcase/angular2-seed-example-mashup - Angular 2 application demonstrating the use of [Redux](http://redux.js.org/), [D3](https://github.com/mbostock/d3), [socket io](https://github.com/socketio), [Google Charts](https://developers.google.com/chart/), and [RxJs](https://github.com/Reactive-Extensions/RxJS)

# Change Log

You can follow the [Angular 2 change log here](https://github.com/angular/angular/blob/master/CHANGELOG.md).

# License

MIT


text:
<resources>
    <!-- Add your shop URL here in the form '<myshop>.myshopify.com' -->
    <string name="shop_url">TODO-xamarinbindingexample.myshopify.com</string>

    <!-- Add your Shopify API key here -->
    <string name="shopify_api_key">TODO-API-KEY</string>

    <!-- Add your Channel ID here -->
    <string name="channel_id">TODO-CHANNEL-ID</string>

    <!-- Application and Activity Names -->
    <string name="app_name">Mobile Buy Sample</string>

    <!-- UI -->
    <string name="please_wait">Please wait</string>
    <string name="loading_data">Loading data from store...</string>
    <string name="syncing_data">Syncing data with Checkout API...</string>
    <string name="error">Error! See logcat for details.</string>
    <string name="shop_error">Error! Could not load shop. ProductDetailsActivity will not work.</string>

    <string name="choose_collection">Choose Collection</string>
    <string name="all_products">All Products</string>

    <string name="choose_product">Choose Product</string>
    <string name="demo_product_details_activity">Demo ProductDetailsActivity</string>
    <string name="theme_style">Theme Style</string>
    <string name="shows_product_image_bg">Shows Product Image BG</string>
    <string name="yes">YES</string>
    <string name="no">NO</string>
    <string name="dark">DARK</string>
    <string name="light">LIGHT</string>
    <string name="choose_accent_color">Choose Accent Color</string>

    <string name="choose_shipping_rate">Choose Shipping Rate</string>
    <string name="no_shipping_rates">Product can\'t be shipped to your address.</string>

    <string name="apply_discounts">Apply Discounts</string>
    <string name="apply_discount">Apply Discount</string>
    <string name="apply_gift_card">Apply Gift Card</string>
    <string name="enter_discount_code">Enter Discount Code</string>
    <string name="enter_gift_card_code">Enter Gift Card Code</string>
    <string name="discount_code">Discount Code</string>
    <string name="gift_card_code">Gift Card Code</string>
    <string name="checkout">Checkout</string>
    <string name="discount_error">Could not apply discount code %s</string>
    <string name="gift_card_error">Could not apply gift card code %s</string>

    <string name="native_checkout">Checkout with Fake Credit Card</string>
    <string name="web_checkout">Web Checkout</string>
    <string name="completing_checkout">Completing checkout...</string>
    <string name="getting_checkout_status">Getting checkout status...</string>
    <string name="checkout_complete">Checkout complete!</string>
    <string name="checkout_error">Could not complete checkout</string>

    <string name="line_item_price">Line Item Price</string>
    <string name="discount">Discount</string>
    <string name="gift_card">Gift Card</string>
    <string name="shipping">Shipping</string>
    <string name="taxes">Taxes</string>
    <string name="total">Total</string>

    <!-- Custom URL Scheme -->
    <string name="web_return_to_scheme">mobilebuysample</string>
    <string name="web_return_to_url">"mobilebuysample://"</string>
    <string name="web_return_to_label">"Return to Mobile Buy Sample</string>
</resources>


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>tesseract: /home/stweil/src/github/tesseract-ocr/tesseract/unittest/intsimdmatrix_test.cc File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

tesseract
    4.0.0-beta.1-59-g2cc4

Namespaces

intsimdmatrix_test.cc File Reference

#include "intsimdmatrix.h"

#include <memory>

#include "genericvector.h"

#include "include_gunit.h"

#include "intsimdmatrixavx2.h"

#include "intsimdmatrixsse.h"

#include "simddetect.h"

#include "tprintf.h"

Go to the source code of this file.

Namespaces

  	tesseract

Variable Documentation

◆ base_

          IntSimdMatrix base_

protected

Definition at line 77 of file intsimdmatrix_test.cc.

◆ random_

          TRand random_

protected

Definition at line 76 of file intsimdmatrix_test.cc.

unittest

intsimdmatrix_test.cc

Generated on Wed Mar 28 2018 20:00:40 for tesseract by

     1.8.13


text:
package org.codeartisans.staticlet.core.http;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.codeartisans.staticlet.core.EarlyHttpStatusException;

public enum HttpVersion
{

    HTTP_1_0( "HTTP/1.0" ),
    HTTP_1_1( "HTTP/1.1" );
    String protocol;

    private HttpVersion( String protocol )
    {
        this.protocol = protocol;
    }

    public String protocol()
    {
        return protocol;
    }

    public static HttpVersion fromRequestProtocol( HttpServletRequest httpRequest )
            throws EarlyHttpStatusException
    {
        String requestProtocol = httpRequest.getProtocol();
        if ( HTTP_1_1.protocol.equals( requestProtocol ) ) {
            return HTTP_1_1;
        } else if ( HTTP_1_0.protocol.equals( requestProtocol ) ) {
            return HTTP_1_0;
        }
        throw new EarlyHttpStatusException( HttpServletResponse.SC_BAD_REQUEST, "Unknown HTTP protocol: " + requestProtocol );
    }

}


text:
package cn.ac.ict.acs.netflow.load.master

import akka.serialization.Serialization

import cn.ac.ict.acs.netflow._
import cn.ac.ict.acs.netflow.ha._

class ZKRecoveryModeFactory(conf: NetFlowConf, serializer: Serialization)
    extends RecoveryModeFactory(conf, serializer) {

  def createPersistenceEngine() = new LoadMasterZKPersistenceEngine(conf, serializer)

  def createLeaderElectionAgent(master: LeaderElectable) =
    new ZooKeeperLeaderElectionAgent(master, conf)
}

class LoadMasterZKPersistenceEngine(conf: NetFlowConf, serialization: Serialization)
  extends ZooKeeperPersistenceEngine(conf, serialization) with MasterPersistenceEngine

class LoadMasterBHPersistenceEngine extends BlackHolePersistenceEngine with MasterPersistenceEngine


text:
// Licensed to Cloudera, Inc. under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  Cloudera, Inc. licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.cloudera.api.model;

import com.cloudera.api.ApiUtils;
import com.google.common.base.Objects;

import java.util.List;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;

/** Detailed information about an HBase snapshot command. */
@XmlRootElement(name = "hbaseSnapshotResult")
public class ApiHBaseSnapshotResult {
  // TODO: For now, the list based information is populated only in full view.
  // But given the scaling issues we have had with replication, should consider
  // if separate API with paging support should be added for them.

  private Integer processedTableCount;
  private List<String> processedTables;
  private Integer unprocessedTableCount;
  private List<String> unprocessedTables;
  private Integer createdSnapshotCount;
  private List<ApiHBaseSnapshot> createdSnapshots;
  private Integer deletedSnapshotCount;
  private List<ApiHBaseSnapshot> deletedSnapshots;
  private Integer creationErrorCount;
  private List<ApiHBaseSnapshotError> creationErrors;
  private Integer deletionErrorCount;
  private List<ApiHBaseSnapshotError> deletionErrors;

  /** Number of processed tables. */
  @XmlElement
  public Integer getProcessedTableCount() {
    return processedTableCount;
  }

  public void setProcessedTableCount(Integer processedTableCount) {
    this.processedTableCount = processedTableCount;
  }

  /**
   * The list of processed tables.
   *

   * This is only available in the full view.
   */
  @XmlElementWrapper
  public List<String> getProcessedTables() {
    return processedTables;
  }

  public void setProcessedTables(List<String> tables) {
    this.processedTables = tables;
  }

  /** Number of unprocessed tables. */
  @XmlElement
  public Integer getUnprocessedTableCount() {
    return unprocessedTableCount;
  }

  public void setUnprocessedTableCount(Integer unprocessedTableCount) {
    this.unprocessedTableCount = unprocessedTableCount;
  }

  /**
   * The list of unprocessed tables. Note that tables that are currently being
   * processed will also be included in this list.
   *

   * This is only available in the full view.
   */
  @XmlElementWrapper
  public List<String> getUnprocessedTables() {
    return unprocessedTables;
  }

  public void setUnprocessedTables(List<String> tables) {
    this.unprocessedTables = tables;
  }

  /** Number of snapshots created. */
  @XmlElement
  public Integer getCreatedSnapshotCount() {
    return createdSnapshotCount;
  }

  public void setCreatedSnapshotCount(Integer createdSnapshotCount) {
    this.createdSnapshotCount = createdSnapshotCount;
  }

  /**
   * List of snapshots created.
   *

   * This is only available in the full view.
   */
  @XmlElementWrapper
  public List<ApiHBaseSnapshot> getCreatedSnapshots() {
    return createdSnapshots;
  }

  public void setCreatedSnapshots(List<ApiHBaseSnapshot> createdSnapshots) {
    this.createdSnapshots = createdSnapshots;
  }

  /** Number of snapshots deleted. */
  @XmlElement
  public Integer getDeletedSnapshotCount() {
    return deletedSnapshotCount;
  }

  public void setDeletedSnapshotCount(Integer deletedSnapshotCount) {
    this.deletedSnapshotCount = deletedSnapshotCount;
  }

  /**
   * List of snapshots deleted.
   *

   * This is only available in the full view.
   */
  @XmlElementWrapper
  public List<ApiHBaseSnapshot> getDeletedSnapshots() {
    return deletedSnapshots;
  }

  public void setDeletedSnapshots(List<ApiHBaseSnapshot> deletedSnapshots) {
    this.deletedSnapshots = deletedSnapshots;
  }

  /** Number of errors detected when creating snapshots. */
  @XmlElement
  public Integer getCreationErrorCount() {
    return creationErrorCount;
  }

  public void setCreationErrorCount(Integer creationErrorCount) {
    this.creationErrorCount = creationErrorCount;
  }

  /**
   * List of errors encountered when creating snapshots.
   *

   * This is only available in the full view.
   */
  @XmlElementWrapper
  public List<ApiHBaseSnapshotError> getCreationErrors() {
    return creationErrors;
  }

  public void setCreationErrors(List<ApiHBaseSnapshotError> creationErrors) {
    this.creationErrors = creationErrors;
  }

  /** Number of errors detected when deleting snapshots. */
  @XmlElement
  public Integer getDeletionErrorCount() {
    return deletionErrorCount;
  }

  public void setDeletionErrorCount(Integer deletionErrorCount) {
    this.deletionErrorCount = deletionErrorCount;
  }

  /**
   * List of errors encountered when deleting snapshots.
   *

   * This is only available in the full view.
   */
  @XmlElementWrapper
  public List<ApiHBaseSnapshotError> getDeletionErrors() {
    return deletionErrors;
  }

  public void setDeletionErrors(List<ApiHBaseSnapshotError> deletionErrors) {
    this.deletionErrors = deletionErrors;
  }

  @Override
  public boolean equals(Object o) {
    ApiHBaseSnapshotResult that = ApiUtils.baseEquals(this, o);
    return this == that || (that != null &&
        Objects.equal(processedTableCount, that.getProcessedTableCount()) &&
        Objects.equal(processedTables, that.getProcessedTables()) &&
        Objects.equal(unprocessedTableCount, that.getUnprocessedTableCount()) &&
        Objects.equal(unprocessedTables, that.getUnprocessedTables()) &&
        Objects.equal(createdSnapshotCount, that.getCreatedSnapshotCount()) &&
        Objects.equal(createdSnapshots, that.getCreatedSnapshots()) &&
        Objects.equal(deletedSnapshotCount, that.getDeletedSnapshotCount()) &&
        Objects.equal(deletedSnapshots, that.getDeletedSnapshots()) &&
        Objects.equal(creationErrorCount, that.getCreationErrorCount()) &&
        Objects.equal(creationErrors, that.getCreationErrors()) &&
        Objects.equal(deletionErrorCount, that.getDeletionErrorCount()) &&
        Objects.equal(deletionErrors, that.getDeletionErrors()));
  }

  @Override
  public int hashCode() {
    return Objects.hashCode(processedTableCount, processedTables,
        unprocessedTableCount, unprocessedTables, createdSnapshotCount,
        createdSnapshots, deletedSnapshotCount, deletedSnapshots,
        creationErrorCount, creationErrors, deletionErrorCount,
        deletionErrors);
  }

  @Override
  public String toString() {
    return Objects.toStringHelper(this)
        .add("processedTableCount", processedTableCount)
        .add("processedTables", processedTables)
        .add("unprocessedTableCount", unprocessedTableCount)
        .add("unprocessedTables", unprocessedTables)
        .add("createdSnapshotCount", createdSnapshotCount)
        .add("createdSnapshots", createdSnapshots)
        .add("deletedSnapshotCount", deletedSnapshotCount)
        .add("deletedSnapshots", deletedSnapshots)
        .add("creationErrorCount", creationErrorCount)
        .add("creationErrors", creationErrors)
        .add("deletionErrorCount", deletionErrorCount)
        .add("deletionErrors", deletionErrors)
        .toString();
  }
}


text:
<?php
// include function files for this application
require_once('book_sc_fns.php');
session_start();

do_html_header('Adding a book');
if (check_admin_user()) {
  if (filled_out($_POST)) {
    $isbn = $_POST['isbn'];
    $title = $_POST['title'];
    $author = $_POST['author'];
    $catid = $_POST['catid'];
    $price = $_POST['price'];
    $description = $_POST['description'];
    if(insert_book($isbn, $title, $author, $catid, $price, $description)){
      echo "Book '".stripslashes($title)."' was added to the database.
";
    } else {
      echo "Book '".stripslashes($title).
           "' could not be added to the database.
";
    }
  } else {
    echo 'You have not filled out the form.  Please try again.';
  }
  do_html_url('admin.php', 'Back to administration menu');
} else {
  echo 'You are not authorised to view this page.';
}
do_html_footer();

?>


text:
@echo off

rem Author:   Andrey Dibrov (andry at inbox dot ru)

rem Description:
rem   Script to export common project environment variables into the file to
rem   import them later in another project in the build pipeline.

rem Examples:
rem 1. call export_build_vars.bat c:\_b\MyProject\build\vars\build.vars

setlocal

set "EXPORT_VARS_FILE=%~1"

rem Drop last error level
call;

call "%%~dp0__init__.bat" || exit /b

call :WRITE_VAR_FILE SOLUTION_BRANCH_ROOT           "%%EXPORT_VARS_FILE%%" || exit /b

call :WRITE_VAR_FILE PROJECT_NAME                   "%%EXPORT_VARS_FILE%%" || exit /b
call :WRITE_VAR_FILE PROJECT_ROOT                   "%%EXPORT_VARS_FILE%%" || exit /b
call :WRITE_VAR_FILE PROJECT_TRUNK_ROOT             "%%EXPORT_VARS_FILE%%" || exit /b
call :WRITE_VAR_FILE PROJECT_BRANCH_ROOT            "%%EXPORT_VARS_FILE%%" || exit /b

call :WRITE_VAR_FILE BUILD_SCM_BRANCH               "%%EXPORT_VARS_FILE%%" || exit /b

call :WRITE_VAR_FILE PROJECT_BUILD_DATE             "%%EXPORT_VARS_FILE%%" || exit /b
call :WRITE_VAR_FILE PROJECT_BUILD_TIME             "%%EXPORT_VARS_FILE%%" || exit /b

call :WRITE_VAR_FILE APP_BUILD_DATE                 "%%EXPORT_VARS_FILE%%" || exit /b
call :WRITE_VAR_FILE APP_BUILD_TIME                 "%%EXPORT_VARS_FILE%%" || exit /b

call :WRITE_VAR_FILE BUILD_DEV_COMPILER             "%%EXPORT_VARS_FILE%%" || exit /b
call :WRITE_VAR_FILE BUILD_DEV_COMPILER_DIR         "%%EXPORT_VARS_FILE%%" || exit /b
call :WRITE_VAR_FILE BUILD_DEV_ADDRESS_MODEL        "%%EXPORT_VARS_FILE%%" || exit /b

call :WRITE_VAR_FILE PROJECT_SRCS_ROOT              "%%EXPORT_VARS_FILE%%" || exit /b
call :WRITE_VAR_FILE PROJECT_LIBS_ROOT              "%%EXPORT_VARS_FILE%%" || exit /b
call :WRITE_VAR_FILE PROJECT_INCLUDES_ROOT          "%%EXPORT_VARS_FILE%%" || exit /b

call :WRITE_VAR_FILE PROJECT_STAGE_BUILD_ROOT       "%%EXPORT_VARS_FILE%%" || exit /b
call :WRITE_VAR_FILE PROJECT_STAGE_POSTBUILD_ROOT   "%%EXPORT_VARS_FILE%%" || exit /b

call :WRITE_VAR_FILE PROJECT_STAGE_BUILD_ROOT.INSTALL_DIR "%%EXPORT_VARS_FILE%%" || exit /b

call :WRITE_VAR_FILE PROJECT_STAGE_BUILD_ROOT.BIN_DIR     "%%EXPORT_VARS_FILE%%" || exit /b
call :WRITE_VAR_FILE PROJECT_STAGE_BUILD_ROOT.PDB_DIR     "%%EXPORT_VARS_FILE%%" || exit /b
call :WRITE_VAR_FILE PROJECT_STAGE_BUILD_ROOT.LIB_DIR     "%%EXPORT_VARS_FILE%%" || exit /b
call :WRITE_VAR_FILE PROJECT_STAGE_BUILD_ROOT.GEN_DIR     "%%EXPORT_VARS_FILE%%" || exit /b
call :WRITE_VAR_FILE PROJECT_STAGE_BUILD_ROOT.VAR_DIR     "%%EXPORT_VARS_FILE%%" || exit /b
call :WRITE_VAR_FILE PROJECT_STAGE_POSTBUILD_ROOT.BIN_DIR "%%EXPORT_VARS_FILE%%" || exit /b
call :WRITE_VAR_FILE PROJECT_STAGE_POSTBUILD_ROOT.PDB_DIR "%%EXPORT_VARS_FILE%%" || exit /b
call :WRITE_VAR_FILE PROJECT_STAGE_POSTBUILD_ROOT.LIB_DIR "%%EXPORT_VARS_FILE%%" || exit /b
call :WRITE_VAR_FILE PROJECT_STAGE_POSTBUILD_ROOT.GEN_DIR "%%EXPORT_VARS_FILE%%" || exit /b
call :WRITE_VAR_FILE PROJECT_STAGE_POSTBUILD_ROOT.VAR_DIR "%%EXPORT_VARS_FILE%%" || exit /b

call :WRITE_VAR_FILE PUBLISH_BUILDS_ROOT            "%%EXPORT_VARS_FILE%%" || exit /b
call :WRITE_VAR_FILE PUBLISH_APP_ROOT               "%%EXPORT_VARS_FILE%%" || exit /b
call :WRITE_VAR_FILE PUBLISH_APP_DIR                "%%EXPORT_VARS_FILE%%" || exit /b
call :WRITE_VAR_FILE PUBLISH_APP_DIR_BUILD_TOKEN    "%%EXPORT_VARS_FILE%%" || exit /b
call :WRITE_VAR_FILE PUBLISH_APP_DIR_USER_TOKEN     "%%EXPORT_VARS_FILE%%" || exit /b

call :WRITE_VAR_FILE APP_ROOT                       "%%EXPORT_VARS_FILE%%" || exit /b
call :WRITE_VAR_FILE APP_DIR                        "%%EXPORT_VARS_FILE%%" || exit /b

call :WRITE_VAR_FILE APP_TARGET_NAME                "%%EXPORT_VARS_FILE%%" || exit /b
call :WRITE_VAR_FILE TARGET_NAME                    "%%EXPORT_VARS_FILE%%" || exit /b
call :WRITE_VAR_FILE PROJECT_TYPE                   "%%EXPORT_VARS_FILE%%" || exit /b

call :WRITE_VAR_FILE PARENT.PRODUCT_VERSION         "%%EXPORT_VARS_FILE%%" || exit /b
call :WRITE_VAR_FILE PARENT.BUILD_NUMBER            "%%EXPORT_VARS_FILE%%" || exit /b

call :WRITE_VAR_FILE PRODUCT_VERSION                "%%EXPORT_VARS_FILE%%" || exit /b
call :WRITE_VAR_FILE PRODUCT_VERSION_FILE_SUFFIX    "%%EXPORT_VARS_FILE%%" || exit /b
call :WRITE_VAR_FILE BUILD_NUMBER                   "%%EXPORT_VARS_FILE%%" || exit /b

for /F "usebackq eol= tokens=1,* delims==" %%i in (`@set "F_DISABLE_" 2^>nul`) do (
  call :WRITE_VAR_FILE "%%i" "%%EXPORT_VARS_FILE%%" || exit /b
)

for /F "usebackq eol= tokens=1,* delims==" %%i in (`@set "F_ENABLE_" 2^>nul`) do (
  call :WRITE_VAR_FILE "%%i" "%%EXPORT_VARS_FILE%%" || exit /b
)

exit /b 0

:WRITE_VAR_FILE
call "%%CONTOOLS_BUILD_TOOLS_ROOT%%/write_var_to_file.bat" %%* || exit /b
exit /b 0


text:
module.exports = OclockApp;
function OclockApp(router, config) {
    router.get('/initial', function (req, res) {
        return res.json(config);
    });
}


text:
package org.asciidoctor.jruby.ast.impl;

import java.util.Arrays;
import java.util.List;

import org.asciidoctor.ast.Block;
import org.jruby.RubyArray;
import org.jruby.runtime.builtin.IRubyObject;

public class BlockImpl extends StructuralNodeImpl implements Block {

    public BlockImpl(IRubyObject blockDelegate) {
        super(blockDelegate);
    }

    @Override
    @Deprecated
    public List<String> lines() {
        return getLines();
    }

    @Override
    public List<String> getLines() {
        return getList("lines", String.class);
    }

    @Override
    public void setLines(List<String> lines) {
        RubyArray newLines = getRuntime().newArray(lines.size());
        for (String s: lines) {
            newLines.add(getRuntime().newString(s));
        }
        setRubyProperty("lines", newLines);
    }

    @Override
    @Deprecated
    public String source() {
        return getSource();
    }

    @Override
    public String getSource() {
        return getString("source");
    }

    @Override
    public void setSource(String source) {
        setLines(Arrays.asList(source.split("\n")));
    }
}


text:
package tictactoe.tddjava;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;

/**
 * Created by Stephen West on 28/11/2018.
 */
public class TicTacToeSpec {

    private final char X = 'X';
    private final char O = 'O';

    private TicTacToe ticTacToe;

    @BeforeEach
    public final void before() {
        ticTacToe = new TicTacToe();
    }
    @Test
    public void whenXOutsideBoardThenRuntimeException() {
        Assertions.assertThrows(RuntimeException.class,()-> ticTacToe.play(5, 2));
        Assertions.assertThrows(RuntimeException.class,()-> ticTacToe.play(0, 2));
    }

    @Test
    public void whenYOutsideBoardThenRuntimeException() {
        Assertions.assertThrows(RuntimeException.class,()-> ticTacToe.play(2, 5));
        Assertions.assertThrows(RuntimeException.class,()-> ticTacToe.play(2, 0));
    }

    @Test
    public void whenOccupiedThenRuntimeException() {
        ticTacToe.play(2, 1);
        Assertions.assertThrows(RuntimeException.class,()-> ticTacToe.play(2, 1));
    }

    @Test
    public void giveFirstTurnWhenNextPlayerShouldBeX(){
        assertEquals(X,ticTacToe.nextPlayer());
    }

    @Test
    public void giveLastTurnWasXTheNextTurnShouldBeO(){
        ticTacToe.play(2,2);
        assertEquals(O,ticTacToe.nextPlayer());
    }

    @Test
    public void givenLastTurnWasOTheNextTurnShouldBeX(){
        ticTacToe.play(2,2);
        ticTacToe.play(1,1);
        assertEquals(X,ticTacToe.nextPlayer());
    }

    @Test
    public void givenEightMoveThatWillNotLeadToAWinningConditions(){
        int[][] moves = {{2,2},{1,2},{2,3},{2,1},{1,1},{3,3},{3,1},{1,3}};
        for (int[] move : moves){
            assertEquals("No Winner", ticTacToe.play(move[0],move[1]));
        }
    }

    @Test
    public void giveAWinningHorizontalLineShouldBeAXWin(){

        int[][] moves = {{2,2},{1,2},{2,3},{1,1},{2,1}};
        for (int[] move : moves){
            if (move[0] == 2 && move[1] == 3){
                assertEquals("X Wins", ticTacToe.play(move[0],move[1]));
            }else{
                assertEquals("No Winner", ticTacToe.play(move[0],move[1]));
            }
        }

    }
    @Test

    public void giveAWinningHVerticalLineShouldBeAXWin(){
        int[][] moves = {{1,1},{2,2},{1,2},{2,1},{3,3},{2,3}};
        for (int[] move : moves){
            if (move[0] == 2 && move[1]==3){
                assertEquals("O Wins", ticTacToe.play(move[0],move[1]));
            }else{
                assertEquals("No Winner", ticTacToe.play(move[0],move[1]));
            }

        }
    }

    @Test
    public void giveAWinningDiagonalLineShouldBeAXWin(){
        int[][] moves = {{2,2},{1,2},{1,1},{1,3},{3,3}};
        for (int[] move : moves){
            if (move[0] == 3 && move[1]== 3){
                assertEquals("X Wins", ticTacToe.play(move[0],move[1]));
            }else{
                assertEquals("No Winner", ticTacToe.play(move[0],move[1]));
            }
        }
    }
}


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class c_authentication extends CI_Controller {

	public function __construct(){
		parent::__construct();
		$this->load->model('m_authentication');
	}

	public function index(){
		if($this->session->userdata('status') != "login"){
			$this->load->view('login');
		} else {
			$hakakses = $this->session->userdata('hakakses');

			if ($hakakses == 'dokter'){
				redirect(base_url('c_dokter'));
			} elseif ($hakakses == 'pendaftaran') {
				redirect(base_url('c_petugaspendaftaran'));
			} elseif ($hakakses == 'logistik') {
				redirect(base_url('c_logistik'));
			}

		}
	}

	public function authenticate(){
		$username = $this->input->post('username');
		$password = $this->input->post('password');

		$where = array(
			'username_user' => $username,
			'password_user' => md5($password));

		$jmlbaris = $this->m_authentication->data_login('t_user',$where)->num_rows();

		if ($jmlbaris > 0){
			$query = $this->m_authentication->data_login('t_user',$where)->result();
			$pengguna = '';
			foreach($query as $data){
				$hakakses = $data->level_user;
				if($hakakses == 'dokter'){
					$pengguna = $this->m_authentication->get_nama_dokter($username);
				}else{
					$pengguna = $data->username_user;
				}

			}

			$data_session = array(
								'id' => $username,
								'nama' => $pengguna,
								'status' => 'login',
								'hakakses' => $hakakses);

			$this->session->set_userdata($data_session);

			if ($hakakses == 'pendaftaran'){
				redirect(base_url('c_petugaspendaftaran'));
			} elseif ($hakakses == 'dokter'){
				redirect(base_url('c_dokter'));
			} elseif ($hakakses == 'logistik'){
				redirect(base_url('c_logistik'));
			}

		} else {
			$this->load->view('login');
		}

	}

	public function logout(){
		$this->session->sess_destroy();
		redirect(base_url());
	}

}


text:
<?php

namespace Diversity;

class ConfigurationException extends \RuntimeException {}


text:
<?php
use Biosciences as Biosciences;
// $page converted to $pagina because wordpress steals $page

$pagina = new Biosciences\Base();
$menus = array('primary', 'footer_left', 'footer_center', 'footer_right');
$pagina->find_menus($menus);

$pagina->get_current_post('video');

$taxs = wp_get_post_tags( $pagina->context['video']->ID );

if ( $taxs ) {
    $tax_ids = array();
    foreach( $taxs as $individual_tax ) { $tax_ids[] = $individual_tax->term_id; }
    $queryArgs = array(
    	'post_type'           => 'videos',
        'tag__in'             => $tax_ids,
        'post__not_in'        => array( $post->ID ),
        'showposts'           => 5,
        'ignore_sticky_posts' => 1
    );
    $pagina->find_posts_as('rel_videos', $queryArgs);
}

$pagina->render_page('videos/single.twig');


text:
using System;
using System.Data;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Linq;
using System.Net;
using System.Net.Mail;
using System.Web.Http;
using System.Web.Http.Description;
using UIBuildIt.Common;
using UIBuildIt.Common.Authentication;

namespace UIBuildIt.WebService.Controllers.API.Authentication
{
    /// <summary>
    /// Used to recover user credentials
    /// </summary>
    public class RecoverController : LoginControllerBase
    {
        // PUT api/Login/5
        public IHttpActionResult Put(int id, User user)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != user.Id)
            {
                return BadRequest();
            }

            db.Entry(user).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!UserExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }

        // POST api/Login
        [ResponseType(typeof(string))]
        public IHttpActionResult Post(User user)
        {
            if (string.IsNullOrEmpty(user.Email))
            {
                return BadRequest(ModelState);
            }

            var us = (from u in db.Users
                     where u.Email == user.Email
                     select u).FirstOrDefault();

            if(us == null)
            {
                return Content<string>(HttpStatusCode.BadRequest, "Failed to find user with email address " + user.Email);
            }

            try
            {
                string Subject = "UIBuildIt password recovery",
                Body = "This is how to restore you password: go to the http://www.vrigar.com/app/#/set-new-password and paste {0} into the verification box and set a new password.",
                ToEmail = user.Email;

                string SMTPUser = "uibuildit@vrigar.com", SMTPPassword = "vr1gars0nuibuildit";

                //Now instantiate a new instance of MailMessage
                MailMessage mail = new MailMessage();

                //set the sender address of the mail message
                mail.From = new System.Net.Mail.MailAddress(SMTPUser, "UIBuildIt Team");

                //set the recepient addresses of the mail message
                mail.To.Add(ToEmail);

                //set the subject of the mail message
                mail.Subject = Subject;

                //set the body of the mail message
                mail.Body = String.Format(Body, us.Password);

                //leave as it is even if you are not sending HTML message
                mail.IsBodyHtml = true;

                //set the priority of the mail message to normal
                mail.Priority = System.Net.Mail.MailPriority.Normal;

                //instantiate a new instance of SmtpClient
                SmtpClient smtp = new SmtpClient();

                //if you are using your smtp server, then change your host like "smtp.yourdomain.com"
                smtp.Host = "smtp.gmail.com";

                //chnage your port for your host
                smtp.Port = 25; //or you can also use port# 587

                //provide smtp credentials to authenticate to your account
                smtp.Credentials = new System.Net.NetworkCredential(SMTPUser, SMTPPassword);

                //if you are using secure authentication using SSL/TLS then "true" else "false"
                smtp.EnableSsl = true;

                smtp.Send(mail);
            }
            catch (SmtpException ex)
            {
                //catched smtp exception
                return Content<Exception>(HttpStatusCode.BadRequest, ex);
            }
            catch (Exception ex)
            {
                return Content<Exception>(HttpStatusCode.BadRequest, ex);
            }

            return Content<string>(HttpStatusCode.OK, "Mail with the instructions was sent to your email address");
        }
    }
}


text:
from .case import UnauthenticatedViewTestCase
from . import setUpModule, tearDownModule

class RootFactoryTestCase(UnauthenticatedViewTestCase):

    def test_get_acl_admin(self):
        from pyshop.security import RootFactory
        root = RootFactory(self.create_request())
        self.assertEqual(set(root.__acl__),
                         set([# all rights
                              (u'Allow', u'admin', u'admin_view'),
                              (u'Allow', u'admin', u'download_releasefile'),
                              (u'Allow', u'admin', u'upload_releasefile'),
                              (u'Allow', u'admin', u'user_view'),

                              # installer can download packages
                              (u'Allow', u'installer', u'download_releasefile'),

                              # installer can download/upload packages,
                              # and browse packages
                              (u'Allow', u'developer', u'download_releasefile'),
                              (u'Allow', u'developer', u'upload_releasefile'),
                              (u'Allow', u'developer', u'user_view'),
                              ]))

class GroupFinderTestCase(UnauthenticatedViewTestCase):

    def test_admin_groups(self):
        from pyshop.security import groupfinder
        self.assertEqual(set(groupfinder(u'admin', self.create_request())),
                         set([u'admin']))

    def test_installer_groups(self):
        from pyshop.security import groupfinder
        self.assertEqual(set(groupfinder(u'pip', self.create_request())),
                         set([u'installer']))

    def test_dev_groups(self):
        from pyshop.security import groupfinder
        self.assertEqual(set(groupfinder(u'local_user', self.create_request())),
                         set([u'developer']))


text:
require File.dirname(__FILE__) + '/../spec_helpers/spec_helper'
require File.dirname(__FILE__) + '/../spec_helpers/rtc_spec_helper'

include RTCSpecHelper
include YetiTestUtils

# RTC Links are used for parent-child relationships

describe 'Link Field Handler Tests' do

  # a link looks like:
  #  "rtc_cm:com.ibm.team.workitem.linktype.parentworkitem.parent":[
  #      {
  #        "rtc_cm:com.ibm.team.workitem.linktype.relatedworkitem.related":[]
  #        "rtc_cm:com.ibm.team.workitem.linktype.schedulePredecessor.predecessor":[]
  #        "rtc_cm:com.ibm.team.filesystem.workitems.change_set.com.ibm.team.scm.ChangeSet":[]
  #        "rtc_cm:com.ibm.team.workitem.linktype.blocksworkitem.dependsOn":[]
  #        "calm:relatedTestPlan":[]
  #        "rtc_cm:com.ibm.team.workitem.linktype.textualReference.textuallyReferenced":[]
  #        "rtc_cm:com.ibm.team.apt.attribute.complexity":{
  #          "rdf:resource":"https:\/\/dev2developer.aetna.com\/ccm\/oslc\/enumerations\/_NHtogaDCEeSNq699yfGkFw\/complexity\/0"
  #        }
  #        "rtc_cm:com.ibm.team.workitem.linktype.copiedworkitem.copies":[]
  #        "calm:relatedTestCase":[]
  #        "calm:relatedRequirement":[]
  #        "rtc_cm:archived":false
  #        "rtc_cm:plannedFor":null
  #        "rtc_cm:resolvedBy":{"rdf:resource":"https:\/\/dev2developer.aetna.com\/jts\/users\/unassigned"}
  #        "rtc_cm:com.ibm.team.workitem.linktype.schedulePredecessor.successor":[]
  #        "rtc_cm:com.ibm.team.workitem.linktype.relatedartifact.relatedArtifact":[]
  #        "rtc_cm:ProjectSR":{"rdf:resource":"https:\/\/dev2developer.aetna.com\/ccm\/oslc\/enumerations\/_NHtogaDCEeSNq699yfGkFw\/projectSR\/projectSR.literal.l2"}
  #        "rtc_cm:comments":[]
  #        "oslc_cm:severity":{"rdf:resource":"https:\/\/dev2developer.aetna.com\/ccm\/oslc\/enumerations\/_NHtogaDCEeSNq699yfGkFw\/severity\/severity.literal.l3"}
  #        "rtc_cm:resolved":null
  #        "calm:relatedTestScript":[]
  #        "dc:creator":{"rdf:resource":"https:\/\/dev2developer.aetna.com\/jts\/users\/N741973"}
  #        "dc:subject":""
  #        "rtc_cm:com.ibm.team.enterprise.promotion.linktype.promotionBuildResult.promotionBuildResult":[]
  #        "rtc_cm:progressTracking":{"rdf:resource":"https:\/\/dev2developer.aetna.com\/ccm\/oslc\/workitems\/_jWpSgKaZEeSTofGV7u1HVg\/progressTracking"}
  #        "rtc_cm:contextId":"_NHtogaDCEeSNq699yfGkFw"
  #        "rtc_cm:com.ibm.team.connector.ccbridge.common.ver2wi.s":[]
  #        "rtc_cm:startDate":null
  #        "calm:tracksChanges":[]
  #        "calm:tracksRequirement":[]
  #        "rtc_cm:com.ibm.team.workitem.linktype.parentworkitem.parent":[]
  #        "rtc_cm:com.ibm.team.build.linktype.includedDeployments.com.ibm.team.build.common.link.includedInDeployment":[]
  #        "rtc_cm:com.ibm.team.enterprise.promotion.linktype.promotionDefinition.promotionDefinition":[]
  #        "oslc_cm:label":"158883: This is a feature"
  #        "rdf:resource":"https:\/\/dev2developer.aetna.com\/ccm\/resource\/itemName\/com.ibm.team.workitem.WorkItem\/158883"
  #        "dc:type":{"rdf:resource":"https:\/\/dev2developer.aetna.com\/ccm\/oslc\/types\/_NHtogaDCEeSNq699yfGkFw\/Feature"}
  #        "calm:relatedTestSuite":[]
  #        "calm:relatedExecutionRecord":[]
  #        "rtc_cm:estimate":null
  #        "rtc_cm:resolution":null
  #        "oslc_cm:trackedWorkItem":[]
  #        "dc:modified":"2015-01-28T03:00:31.596Z"
  #        "rtc_cm:com.ibm.team.connector.scm.common.linkType.importerDependency.t":[]
  #        "rtc_cm:ownedBy":{"rdf:resource":"https:\/\/dev2developer.aetna.com\/jts\/users\/unassigned"}
  #        "rtc_cm:com.ibm.team.apt.attribute.acceptance":""
  #        "rtc_cm:filedAgainst":{"rdf:resource":"https:\/\/dev2developer.aetna.com\/ccm\/resource\/itemOid\/com.ibm.team.workitem.Category\/_ohx7gKDDEeSNq699yfGkFw"}
  #        "rtc_cm:com.ibm.team.workitem.linktype.duplicateworkitem.duplicates":[]
  #        "oslc_pl:schedule":{"rdf:resource":"https:\/\/dev2developer.aetna.com\/ccm\/oslc\/workitems\/_jWpSgKaZEeSTofGV7u1HVg\/schedule"}
  #        "rtc_cm:com.ibm.team.enterprise.deployment.linktype.deploymentBuildResult.packageBuildResult":[]
  #        "rtc_cm:com.ibm.team.enterprise.promotion.linktype.resultWorkItem.promoted":[]
  #        "rtc_cm:com.ibm.team.scm.svn.linkType.workItem.s":[]
  #        "rtc_cm:com.ibm.team.workitem.linktype.duplicateworkitem.duplicateOf":[]
  #        "rtc_cm:jirakey":"F319"
  #        "dc:description":""
  #        "rtc_cm:due":null
  #        "dc:identifier":158883
  #        "rtc_cm:com.ibm.team.build.linktype.includedPackages.com.ibm.team.build.common.link.includedInPackages":[]
  #        "rtc_cm:com.ibm.team.workitem.linktype.resolvesworkitem.resolvedBy":[]
  #        "rtc_cm:com.ibm.team.enterprise.promotion.linktype.promotedChangeSets.promotedChangeSets":[]
  #        "rtc_cm:release":{"rdf:resource":"https:\/\/dev2developer.aetna.com\/ccm\/oslc\/enumerations\/_NHtogaDCEeSNq699yfGkFw\/release\/release.literal.l2"}
  #        "rtc_cm:com.ibm.team.enterprise.packaging.linktype.resultWorkItem.promoted":[]
  #        "rtc_cm:com.ibm.team.workitem.linktype.parentworkitem.children":[{"rdf:resource":"https:\/\/dev2developer.aetna.com\/ccm\/resource\/itemName\/com.ibm.team.workitem.WorkItem\/158881"
  #        "oslc_cm:label":"158881: I am a new item"}]
  #        "oslc_cm:tracksWorkItem":[]
  #        "calm:implementsRequirement":[]
  #        "rtc_cm:subscribers":[{"rdf:resource":"https:\/\/dev2developer.aetna.com\/jts\/users\/N741973"}]
  #        "rtc_cm:com.ibm.team.enterprise.promotion.linktype.promotedBuildMaps.promotedBuildMaps":[]
  #        "rtc_cm:com.ibm.team.connector.scm.common.linkType.tracksUcmObject.t":[]
  #        "dc:title":"This is a feature"
  #        "rtc_cm:state":{"rdf:resource":"https:\/\/dev2developer.aetna.com\/ccm\/oslc\/workflows\/_NHtogaDCEeSNq699yfGkFw\/states\/com.ibm.team.apt.epic.workflow\/com.ibm.team.apt.epic.workflow.state.s1"}
  #        "rtc_cm:timeSheet":{"rdf:resource":"https:\/\/dev2developer.aetna.com\/ccm\/oslc\/workitems\/_jWpSgKaZEeSTofGV7u1HVg\/rtc_cm:timeSheet"}
  #        "rtc_cm:com.ibm.team.build.linktype.includedWorkItems.com.ibm.team.build.common.link.includedInBuilds":[]
  #        "calm:testedByTestCase":[]
  #        "rtc_cm:solution":""
  #        "rtc_cm:com.ibm.team.connector.ccbridge.common.act2wi.s":[]
  #        "rtc_cm:timeSpent":null
  #        "rtc_cm:com.ibm.team.enterprise.promotion.linktype.resultWorkItem.result":[]
  #        "oslc_cm:relatedChangeManagement":[]
  #        "rtc_cm:modifiedBy":{"rdf:resource":"https:\/\/dev2developer.aetna.com\/jts\/users\/N741973"}
  #        "calm:elaboratedByArchitectureElement":[]
  #        "rtc_cm:teamArea":{"rdf:resource":"https:\/\/dev2developer.aetna.com\/ccm\/oslc\/teamareas\/_O4JO4aDDEeSNq699yfGkFw"}
  #        "rtc_cm:com.ibm.team.workitem.linktype.blocksworkitem.blocks":[]
  #        "rtc_cm:com.ibm.team.workitem.linktype.attachment.attachment":[]
  #        "rtc_cm:com.ibm.team.enterprise.package.linktype.packageDefinition.packageDefinition":[]
  #        "rtc_cm:com.ibm.team.workitem.linktype.copiedworkitem.copiedFrom":[]
  #        "oslc_cm:priority":{"rdf:resource":"https:\/\/dev2developer.aetna.com\/ccm\/oslc\/enumerations\/_NHtogaDCEeSNq699yfGkFw\/priority\/priority.literal.l01"}
  #        "rtc_cm:com.ibm.team.enterprise.packaging.linktype.resultWorkItem.result":[]
  #        "rtc_cm:com.ibm.team.enterprise.package.linktype.packageBuildResult.packageBuildResult":[]
  #        "rtc_cm:projectArea":{"rdf:resource":"https:\/\/dev2developer.aetna.com\/ccm\/oslc\/projectareas\/_NHtogaDCEeSNq699yfGkFw"}
  #        "rtc_cm:foundIn":null
  #        "calm:blocksTestExecutionRecord":[]
  #        "rtc_cm:correctedEstimate":null
  #        "calm:affectsPlanItem":[]
  #        "rtc_cm:com.ibm.team.workitem.linktype.resolvesworkitem.resolves":[]
  #        "rtc_cm:com.ibm.team.enterprise.deployment.linktype.deploymentDefinition.packageDefinition":[]
  #        "rtc_cm:com.ibm.team.build.linktype.reportedWorkItems.com.ibm.team.build.common.link.reportedAgainstBuilds":[]
  #        "dc:created":"2015-01-28T03:00:31.542Z"
  #        "calm:affectsExecutionResult":[]
  #        "calm:affectedByDefect":[]
  #      }]

  mapped_field_name = "rtc_cm:com.ibm.team.workitem.linktype.parentworkitem.parent"
  referenced_field_name = "rtc_cm:jirakey"

  fieldhandler_config = "
  <RTCLinkFieldHandler>
    <FieldName>#{mapped_field_name}</FieldName> <!-- the field on the story -->
    <ReferencedFieldLookupID>#{referenced_field_name}</ReferencedFieldLookupID>  <!-- the field on the thing that's at the other end of the reference pointer -->
  </RTCLinkFieldHandler>"

  before(:each) do
    @connection = RTC_connect(RTCSpecHelper::RTC_STATIC_CONFIG)
    @unique_number = Time.now.strftime("%Y%m%d%H%M%S") + '-' + Time.now.usec.to_s
  end

  after(:all) do
#    @connection.disconnect() if !@connection.nil?
  end

  it "should return nil if there is no value to transform_out" do
    item = {'dc:title' => 'test title'}

    root = YetiTestUtils::load_xml(fieldhandler_config).root
    fh = RallyEIF::WRK::FieldHandlers::RTCLinkFieldHandler.new
    fh.connection = @connection
    fh.read_config(root)
    expect( fh.transform_out(item) ).to be_nil
  end

  it "should return nil if there the transform_out value is an empty string" do
    item = {'dc:title' => 'test title', mapped_field_name => '' }

    root = YetiTestUtils::load_xml(fieldhandler_config).root
    fh = RallyEIF::WRK::FieldHandlers::RTCLinkFieldHandler.new
    fh.connection = @connection
    fh.read_config(root)
    expect( fh.transform_out(item) ).to be_nil
  end

  it "should return nil if there the transform_out value is an empty array" do
    item = {'dc:title' => 'test title', mapped_field_name => [] }

    root = YetiTestUtils::load_xml(fieldhandler_config).root
    fh = RallyEIF::WRK::FieldHandlers::RTCLinkFieldHandler.new
    fh.connection = @connection
    fh.read_config(root)
    expect( fh.transform_out(item) ).to be_nil
  end

  it "should throw exception on transform_in" do
    root = YetiTestUtils::load_xml(fieldhandler_config).root
    fh = RallyEIF::WRK::FieldHandlers::RTCLinkFieldHandler.new
    fh.read_config(root)
    expect { fh.transform_in("") }.to raise_error(/Not Implemented/)
  end

  it "should correctly transform_out if there is a value to transform" do
    field_value = [{
        "rdf:resource"=>"https://#{TestConfig::RTC_URL}/ccm/oslc/whatever/whatever",
        "dc:title" => "Wilma",
        referenced_field_name => "Fred"
    }]

    item = {'dc:title' => 'test title', mapped_field_name => field_value }

    root = YetiTestUtils::load_xml(fieldhandler_config).root
    fh = RallyEIF::WRK::FieldHandlers::RTCLinkFieldHandler.new
    fh.connection = @connection
    fh.read_config(root)
    expect( fh.transform_out(item) ).to eq("Fred")
  end

  it "should transform_out a nil if cannot find item with the reference field" do
    field_value = [{
        "rdf:resource"=>"https://#{TestConfig::RTC_URL}/ccm/oslc/teamareas/ARNOLD"
    }]

    item = {'dc:title' => 'test title', mapped_field_name => field_value }

    root = YetiTestUtils::load_xml(fieldhandler_config).root
    fh = RallyEIF::WRK::FieldHandlers::RTCLinkFieldHandler.new
    fh.connection = @connection
    fh.read_config(root)
    expect( fh.transform_out(item) ).to be_nil
  end

  # "dc:type"=>{"rdf:resource"=>"https://dev2developer.aetna.com/ccm/oslc/types/_MUR1YWxJEeSXtYeYHu-AxQ/com.ibm.team.apt.workItemType.story"},
  it "should not transform_out when the other item is a story" do
      field_value = [{
          "rdf:resource"=>"https://#{TestConfig::RTC_URL}/ccm/oslc/whatever/whatever",
          "dc:title" => "Wilma",
          "dc:type"=>{"rdf:resource"=>"https://dev2developer.aetna.com/ccm/oslc/types/_MUR1YWxJEeSXtYeYHu-AxQ/com.ibm.team.apt.workItemType.story"},
          referenced_field_name => "Fred"
      }]

      item = {'dc:title' => 'test title', mapped_field_name => field_value }

      root = YetiTestUtils::load_xml(fieldhandler_config).root
      fh = RallyEIF::WRK::FieldHandlers::RTCLinkFieldHandler.new
      fh.connection = @connection
      fh.read_config(root)
      expect( fh.transform_out(item) ).to be_nil
    end

  it "should transform_out when the other item says it's a feature" do
        field_value = [{
            "rdf:resource"=>"https://#{TestConfig::RTC_URL}/ccm/oslc/whatever/whatever",
            "dc:title" => "Wilma",
            "dc:type"  => {"rdf:resource" => "https://dev2developer.aetna.com/ccm/oslc/types/_NHtogaDCEeSNq699yfGkFw/Feature"},
            referenced_field_name => "Fred"
        }]

        item = {'dc:title' => 'test title', mapped_field_name => field_value }

        root = YetiTestUtils::load_xml(fieldhandler_config).root
        fh = RallyEIF::WRK::FieldHandlers::RTCLinkFieldHandler.new
        fh.connection = @connection
        fh.read_config(root)
        expect( fh.transform_out(item) ).to eq("Fred")
      end
end


text:
<@pp.dropOutputFile />

<#list logicalTypes.logicalAggrTypes as aggrtype>
<@pp.changeOutputFile name="/com/dremio/exec/expr/fn/impl/gaggr/${aggrtype.className}Functions.java" />

<#include "/@includes/license.ftl" />

<#-- A utility class that is used to generate java code for aggr functions bit_and / bit_or -->

/*
 * This class is automatically generated from AggrBitwiseLogicalTypes.tdd using FreeMarker.
 */

package com.dremio.exec.expr.fn.impl.gaggr;

import com.dremio.exec.expr.AggrFunction;
import com.dremio.exec.expr.annotations.FunctionTemplate;
import com.dremio.exec.expr.annotations.FunctionTemplate.NullHandling;
import com.dremio.exec.expr.annotations.FunctionTemplate.FunctionScope;
import com.dremio.exec.expr.annotations.Output;
import com.dremio.exec.expr.annotations.Param;
import com.dremio.exec.expr.annotations.Workspace;
import org.apache.arrow.vector.holders.BigIntHolder;
import org.apache.arrow.vector.holders.NullableBigIntHolder;
import org.apache.arrow.vector.holders.IntHolder;
import org.apache.arrow.vector.holders.NullableIntHolder;

@SuppressWarnings("unused")

public class ${aggrtype.className}Functions {
  static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(${aggrtype.className}Functions.class);

<#list aggrtype.types as type>

<#if aggrtype.aliasName == "">
@FunctionTemplate(name = "${aggrtype.funcName}", scope = FunctionTemplate.FunctionScope.POINT_AGGREGATE)
<#else>
@FunctionTemplate(names = {"${aggrtype.funcName}", "${aggrtype.aliasName}"}, scope = FunctionTemplate.FunctionScope.POINT_AGGREGATE)
</#if>
public static class ${type.inputType}${aggrtype.className} implements AggrFunction{

  @Param ${type.inputType}Holder in;
  @Workspace ${type.outputType}Holder inter;
  @Workspace BigIntHolder nonNullCount;
  @Output ${type.outputType}Holder out;

  public void setup() {
    inter = new ${type.outputType}Holder();
    nonNullCount = new BigIntHolder();
    nonNullCount.value = 0;

    // Initialize the workspace variables
  <#if aggrtype.funcName == "bit_and">
    inter.value = ${type.maxval}.MAX_VALUE;
    <#elseif aggrtype.funcName == "bit_or">
    inter.value = 0;
  </#if>
  }

  @Override
  public void add() {
  <#if type.inputType?starts_with("Nullable")>
    sout: {
    if (in.isSet == 0) {
     // processing nullable input and the value is null, so don't do anything...
     break sout;
    }
  </#if>
    nonNullCount.value = 1;
  <#if aggrtype.funcName == "bit_and">
    inter.value = <#if type.extraCast ??>(${type.extraCast})</#if>(inter.value & in.value);
    <#elseif aggrtype.funcName == "bit_or">
    inter.value = <#if type.extraCast ??>(${type.extraCast})</#if>(inter.value | in.value);
  </#if>

    <#if type.inputType?starts_with("Nullable")>
    } // end of sout block
    </#if>
  }

  @Override
  public void output() {
    if (nonNullCount.value > 0) {
      out.isSet = 1;
      <#if aggrtype.funcName == "bit_and">
        out.value = inter.value;
        <#elseif aggrtype.funcName == "bit_or">
        out.value = inter.value;
      </#if>
    } else {
      out.isSet = 0;
    }
  }

  @Override
  public void reset() {
    nonNullCount.value = 0;
    <#if aggrtype.funcName == "bit_and">
      inter.value = ${type.maxval}.MAX_VALUE;
      <#elseif aggrtype.funcName == "bit_or">
      inter.value = 0;
    </#if>
  }
}

</#list>
}
</#list>


text:
It is a simple React Redux application which wrote by Elm-way.

## Requirements
- [node][node-install] (recommended install by [nvm][nvm-install])
  > look minimal node version in `package.json`
- [yarn][yarn-install]

## Installation
```bash
yarn install
```

## Developing
```bash
yarn dev
```

Open [localhost:8080](http://localhost:8080/) in your browser.

[node-install]: https://nodejs.org/en/download/
[nvm-install]: https://github.com/creationix/nvm#installation
[yarn-install]: https://yarnpkg.com/en/docs/install


text:
package releaser

import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
	"os"
	"strings"
)

var (
	gitHubCommitsAPI      = "https://api.github.com/repos/gohugoio/REPO/commits/%s"
	gitHubRepoAPI         = "https://api.github.com/repos/gohugoio/REPO"
	gitHubContributorsAPI = "https://api.github.com/repos/gohugoio/REPO/contributors"
)

type gitHubAPI struct {
	commitsAPITemplate      string
	repoAPI                 string
	contributorsAPITemplate string
}

func newGitHubAPI(repo string) *gitHubAPI {
	return &gitHubAPI{
		commitsAPITemplate:      strings.Replace(gitHubCommitsAPI, "REPO", repo, -1),
		repoAPI:                 strings.Replace(gitHubRepoAPI, "REPO", repo, -1),
		contributorsAPITemplate: strings.Replace(gitHubContributorsAPI, "REPO", repo, -1),
	}
}

type gitHubCommit struct {
	Author  gitHubAuthor `json:"author"`
	HTMLURL string       `json:"html_url"`
}

type gitHubAuthor struct {
	ID        int    `json:"id"`
	Login     string `json:"login"`
	HTMLURL   string `json:"html_url"`
	AvatarURL string `json:"avatar_url"`
}

type gitHubRepo struct {
	ID           int    `json:"id"`
	Name         string `json:"name"`
	Description  string `json:"description"`
	HTMLURL      string `json:"html_url"`
	Stars        int    `json:"stargazers_count"`
	Contributors []gitHubContributor
}

type gitHubContributor struct {
	ID            int    `json:"id"`
	Login         string `json:"login"`
	HTMLURL       string `json:"html_url"`
	Contributions int    `json:"contributions"`
}

func (g *gitHubAPI) fetchCommit(ref string) (gitHubCommit, error) {
	var commit gitHubCommit

	u := fmt.Sprintf(g.commitsAPITemplate, ref)

	req, err := http.NewRequest("GET", u, nil)
	if err != nil {
		return commit, err
	}

	err = doGitHubRequest(req, &commit)

	return commit, err
}

func (g *gitHubAPI) fetchRepo() (gitHubRepo, error) {
	var repo gitHubRepo

	req, err := http.NewRequest("GET", g.repoAPI, nil)
	if err != nil {
		return repo, err
	}

	err = doGitHubRequest(req, &repo)
	if err != nil {
		return repo, err
	}

	var contributors []gitHubContributor
	page := 0
	for {
		page++
		var currPage []gitHubContributor
		url := fmt.Sprintf(g.contributorsAPITemplate+"?page=%d", page)

		req, err = http.NewRequest("GET", url, nil)
		if err != nil {
			return repo, err
		}

		err = doGitHubRequest(req, &currPage)
		if err != nil {
			return repo, err
		}
		if len(currPage) == 0 {
			break
		}

		contributors = append(contributors, currPage...)

	}

	repo.Contributors = contributors

	return repo, err

}

func doGitHubRequest(req *http.Request, v interface{}) error {
	addGitHubToken(req)

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		return err
	}
	defer resp.Body.Close()

	if isError(resp) {
		b, _ := ioutil.ReadAll(resp.Body)
		return fmt.Errorf("GitHub lookup failed: %s", string(b))
	}

	return json.NewDecoder(resp.Body).Decode(v)
}

func isError(resp *http.Response) bool {
	return resp.StatusCode < 200 || resp.StatusCode > 299
}

func addGitHubToken(req *http.Request) {
	gitHubToken := os.Getenv("GITHUB_TOKEN")
	if gitHubToken != "" {
		req.Header.Add("Authorization", "token "+gitHubToken)
	}
}