text:
package info.meoblast001.seallyracing.network.messages;

import com.jme3.network.AbstractMessage;
import com.jme3.network.serializing.Serializable;

/**
 * Message telling clients that the game is starting and information about the
 * game.
 */
@Serializable
public class GameStartMessage extends AbstractMessage {
  public int totalPlayers;
  public int playerIdx;

  public GameStartMessage() {
    // Empty constructor.
  }

  public GameStartMessage(int totalPlayers, int playerIdx) {
    this.totalPlayers = totalPlayers;
    this.playerIdx = playerIdx;
  }
}


text:
<?php

use yii\helpers\Html;
use common\vendor\AppLabels;

/* @var $this yii\web\View */
/* @var $model backend\models\WorkAccident */
/* @var $powerPlantModel backend\models\PowerPlant */
/* @var $title string */
/* @var $wat string */

$this->title = sprintf("%s %s", AppLabels::BTN_ADD,  $title);
$this->params['breadcrumbs'][] = ['label' => sprintf("Form %s", $title), 'url' => ['index', '_ppId' => $powerPlantModel->id, 'wat' => $wat]];
$this->params['breadcrumbs'][] = $this->title;
?>

<?= Html::encode($this->title) ?>

    <?= $this->render('_form', [
        'model' => $model,
        'powerPlantModel' => $powerPlantModel,
        'title' => $title,
    ]) ?>

redpajama_set_name: RedPajamaGithub


text:
package com.devolta.dailyremind;

import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.helper.ItemTouchHelper;

import com.devolta.dailyremind.Interfaces.ItemTouchHelperAdapter;

class ItemTouchHelperCallback extends ItemTouchHelper.Callback {

    private final ItemTouchHelperAdapter mAdapter;

    ItemTouchHelperCallback(ItemTouchHelperAdapter adapter) {
        mAdapter = adapter;
    }

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

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

    @Override
    public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
        int dragFlags = ItemTouchHelper.UP | ItemTouchHelper.DOWN;
        int swipeFlags = ItemTouchHelper.START | ItemTouchHelper.END;
        return makeMovementFlags(dragFlags, swipeFlags);
    }

    @Override
    public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder,
                          RecyclerView.ViewHolder target) {
        mAdapter.onItemMove(viewHolder.getAdapterPosition(), target.getAdapterPosition());
        return true;
    }

    @Override
    public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
        mAdapter.onItemDismiss(viewHolder.getAdapterPosition());
    }

}


text:
__author__ = 'Krivenko'
from model.group import Group

class GroupHelper:

    def __init__(self,app):
        self.app=app

    def Open_groups_page(self):
        wd = self.app.wd
        if not( wd.current_url.endswith("/group.php") and len(wd.find_elements_by_name("new"))>0):
            wd.find_element_by_link_text("groups").click()

    def change_field_val(self,field_name,text):
        wd = self.app.wd
        if text is not None:
            wd.find_element_by_name(field_name).click()
            wd.find_element_by_name(field_name).clear()
            wd.find_element_by_name(field_name).send_keys(text)

    def fill_group_form(self, group):
        wd = self.app.wd
        self.change_field_val("group_name",group.name)
        self.change_field_val("group_header",group.header)
        self.change_field_val("group_footer",group.footer)

    def create(self,group):
        wd = self.app.wd
        self.Open_groups_page()
        # init group creation
        wd.find_element_by_name("new").click()
        self.fill_group_form(group)
        # submit group creation
        wd.find_element_by_name("submit").click()
        self.return_groups_page()
        self.group_cache=None

    def delete_first_group(self):
        self.delete_group_by_index(0)

    def delete_group_by_index(self,index):
        wd = self.app.wd
        self.Open_groups_page()
        self.select_group_by_index(index)
        # submit deletion group
        wd.find_element_by_name("delete").click()
        self.return_groups_page()
        self.group_cache=None

    def select_first_group(self):
        wd = self.app.wd
        wd.find_element_by_name("selected[]").click()

    def select_group_by_index(self,index):
        wd = self.app.wd
        wd.find_elements_by_name("selected[]")[index].click()

    def modify_first_group(self,new_group_data):
        self.modify_group_by_index(0)

    def modify_group_by_index(self,index,new_group_data):
        wd = self.app.wd
       # self.Open_groups_page()
        self.select_group_by_index(index)
        #open modification form
        wd.find_element_by_name("edit").click()
        self.fill_group_form(new_group_data)
        # update group
        wd.find_element_by_name("update").click()
        # back to groups page
        self.return_groups_page()
        self.group_cache=None

    def modify_group_by_id(self,id,new_group_data):
        wd = self.app.wd
       # self.Open_groups_page()
        self.select_group_by_id(id)
        #open modification form
        wd.find_element_by_name("edit").click()
        self.fill_group_form(new_group_data)
        # update group
        wd.find_element_by_name("update").click()
        # back to groups page
        self.return_groups_page()
        self.group_cache=None

    def return_groups_page(self):
        wd = self.app.wd
        wd.find_element_by_link_text("group page").click()

    def count(self):
        wd = self.app.wd
        self.Open_groups_page()
        return len(wd.find_elements_by_name("selected[]"))

    group_cache=None

    def get_group_list (self):
        wd=self.app.wd
        self.Open_groups_page()
        if self.group_cache is None:
            self.group_cache=[]
            for element in wd.find_elements_by_css_selector("span.group"):
                text=element.text
                id=element.find_element_by_name("selected[]").get_attribute("value")
                self.group_cache.append(Group(name=text,id=id))
        return list(self.group_cache)

    def delete_group_by_id(self,id):
        wd = self.app.wd
        self.Open_groups_page()
        self.select_group_by_id(id)
        # submit deletion group
        wd.find_element_by_name("delete").click()
        self.return_groups_page()
        self.group_cache=None

    def select_group_by_id(self,id):
        wd = self.app.wd
        wd.find_element_by_css_selector("input[value='%s']" % id).click()


text:
package org.apache.tajo.engine.planner;

import org.apache.tajo.engine.planner.logical.*;

import java.util.Stack;

public interface LogicalPlanVisitor<CONTEXT, RESULT> {
  RESULT visitRoot(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, LogicalRootNode node,
                   Stack<LogicalNode> stack) throws PlanningException;

  RESULT visitProjection(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, ProjectionNode node,
                         Stack<LogicalNode> stack) throws PlanningException;

  RESULT visitLimit(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, LimitNode node,
                    Stack<LogicalNode> stack) throws PlanningException;

  RESULT visitSort(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, SortNode node,
                   Stack<LogicalNode> stack) throws PlanningException;

  RESULT visitHaving(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, HavingNode node,
                      Stack<LogicalNode> stack) throws PlanningException;

  RESULT visitGroupBy(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, GroupbyNode node,
                      Stack<LogicalNode> stack) throws PlanningException;

  RESULT visitFilter(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, SelectionNode node,
                     Stack<LogicalNode> stack) throws PlanningException;

  RESULT visitJoin(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, JoinNode node,
                   Stack<LogicalNode> stack) throws PlanningException;

  RESULT visitUnion(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, UnionNode node,
                    Stack<LogicalNode> stack) throws PlanningException;

  RESULT visitExcept(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, ExceptNode node,
                     Stack<LogicalNode> stack) throws PlanningException;

  RESULT visitIntersect(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, IntersectNode node,
                        Stack<LogicalNode> stack) throws PlanningException;

  RESULT visitTableSubQuery(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, TableSubQueryNode node,
                            Stack<LogicalNode> stack) throws PlanningException;

  RESULT visitScan(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, ScanNode node,
                   Stack<LogicalNode> stack) throws PlanningException;

  RESULT visitPartitionedTableScan(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block,
                                   PartitionedTableScanNode node, Stack<LogicalNode> stack) throws PlanningException;

  RESULT visitStoreTable(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, StoreTableNode node,
                         Stack<LogicalNode> stack) throws PlanningException;

  RESULT visitInsert(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, InsertNode node,
                     Stack<LogicalNode> stack) throws PlanningException;

  RESULT visitCreateDatabase(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, CreateDatabaseNode node,
                          Stack<LogicalNode> stack) throws PlanningException;

  RESULT visitDropDatabase(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, DropDatabaseNode node,
                             Stack<LogicalNode> stack) throws PlanningException;

  RESULT visitCreateTable(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, CreateTableNode node,
                          Stack<LogicalNode> stack) throws PlanningException;

  RESULT visitDropTable(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, DropTableNode node,
                        Stack<LogicalNode> stack) throws PlanningException;

  RESULT visitAlterTablespace(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, AlterTablespaceNode node,
                          Stack<LogicalNode> stack) throws PlanningException;

  RESULT visitAlterTable(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, AlterTableNode node,
                         Stack<LogicalNode> stack) throws PlanningException;
}


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

    <title>RED TEAM</title>
    <meta name="description" content="Blog de Seguridad Informática" />

    <meta name="HandheldFriendly" content="True" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <link rel="shortcut icon" href="//camilo28.github.io/themes/Roon/favicon.ico">

    <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Merriweather:400,700,400italic,700italic|Open+Sans:400italic,700italic,700,400">
    <link rel="stylesheet" type="text/css" href="//camilo28.github.io/themes/Roon/assets/css/screen.css?v=1.0.0" />

    <link rel="canonical" href="https://camilo28.github.io" />
    <link rel="prev" href="https://camilo28.github.io/" />
    <link rel="next" href="https://camilo28.github.io/page/3/" />
    <meta name="generator" content="Ghost ?" />
    <link rel="alternate" type="application/rss+xml" title="RED TEAM" href="https://camilo28.github.io/rss" />
    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/default.min.css">

RED TEAM

        <time datetime="2016-04-14">April 14, 2016</time>

Introducción a la seguridad física

Una parte importante de todo plan de seguridad es la seguridad física, puede que tengamos un sofisticado sistema para la protección de la red, hardening en las maquinas y un plan de entrenamiento eficiente para el personal pero si no contamos con un plan de

        Continue Reading

        <time datetime="2016-04-13">April 13, 2016</time>

MITM

Man in the middle es una técnica usada por atacantes con el fin de capturar, monitorizar, analizar y manipular  el trafico que se genera en la red, esto con el fin de conseguir datos importantes de la victima como sus credenciales de usuario o tratar

        Continue Reading

        <time datetime="2016-04-13">April 13, 2016</time>

Ambientes de prueba

En algunas ocasiones hemos hablado de como a veces es necesario  crear entornos aislados en donde se puedan probar las nuevas configuraciones, actualizaciones o el comportamiento de una aplicación, antes de ser puestas en el ambiente real.  Son muchos los casos donde se han tenido

        Continue Reading

        <time datetime="2016-04-13">April 13, 2016</time>

Administración Remota

Como lo vimos anteriormente en empresas de TI podemos tener ambientes virtuales y físicos, y cada uno de ellos implica ciertos parámetros, pero independiente del tipo de ambiente una cosa muy importante en ambos es la administración, la administración de TI implica muchas cosas entre

        Continue Reading

        <time datetime="2016-04-12">April 12, 2016</time>

un poco sobre Metasploit

Metasploit es una de las herramientas más importantes en el mundo de la seguridad informática, esto se debe principalmente a que este tiene una variedad de modulos que podemos usar para diagnosticar la seguridad de nuestras aplicaciones o sistemas, es por eso que en esta

        Continue Reading

        <time datetime="2016-04-12">April 12, 2016</time>

Eficiencia de algoritmos parte III, Algoritmos voraces

Asumamos que tenemos la tarea de encontrar el menor número que se pueda formar  con lo siguientes dígitos 9 | 1 | 2 | 5 | 4 Aunque la respuesta es obvia, si lo hiciéramos paso lo que deberíamos hacer es seguir el siguiente algoritmo. Escoger el menor número

        Continue Reading

        ← Newer Posts
    Page 2 of 10
        Older Posts →

RED TEAM

                https://camilo28.github.io

                Published with HubPress

                Blog de Seguridad Informática

            RED TEAM


text:
namespace {

const CXFA_Node::PropertyData kCaptionPropertyData[] = {
    {XFA_Element::Margin, 1, 0}, {XFA_Element::Para, 1, 0},
    {XFA_Element::Font, 1, 0},   {XFA_Element::Value, 1, 0},
    {XFA_Element::Extras, 1, 0},
};

const CXFA_Node::AttributeData kCaptionAttributeData[] = {
    {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr},
    {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr},
    {XFA_Attribute::Reserve, XFA_AttributeType::Measure, (void*)L"-1un"},
    {XFA_Attribute::Presence, XFA_AttributeType::Enum,
     (void*)XFA_AttributeValue::Visible},
    {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr},
    {XFA_Attribute::Placement, XFA_AttributeType::Enum,
     (void*)XFA_AttributeValue::Left},
};

}  // namespace

CXFA_Caption::CXFA_Caption(CXFA_Document* doc, XFA_PacketType packet)
    : CXFA_Node(doc,
                packet,
                (XFA_XDPPACKET_Template | XFA_XDPPACKET_Form),
                XFA_ObjectType::Node,
                XFA_Element::Caption,
                kCaptionPropertyData,
                kCaptionAttributeData,
                pdfium::MakeUnique<CJX_Node>(this)) {}

CXFA_Caption::~CXFA_Caption() = default;

bool CXFA_Caption::IsVisible() {
  auto value = JSObject()->TryEnum(XFA_Attribute::Presence, true);
  return !value.has_value() || value.value() == XFA_AttributeValue::Visible;
}

bool CXFA_Caption::IsHidden() {
  auto value = JSObject()->TryEnum(XFA_Attribute::Presence, true);
  return !value.has_value() || value.value() == XFA_AttributeValue::Hidden;
}

XFA_AttributeValue CXFA_Caption::GetPlacementType() {
  auto value = JSObject()->TryEnum(XFA_Attribute::Placement, true);
  return value.value_or(XFA_AttributeValue::Left);
}

float CXFA_Caption::GetReserve() const {
  return JSObject()->GetMeasureInUnit(XFA_Attribute::Reserve, XFA_Unit::Pt);
}

CXFA_Margin* CXFA_Caption::GetMarginIfExists() {
  return GetChild<CXFA_Margin>(0, XFA_Element::Margin, false);
}

CXFA_Font* CXFA_Caption::GetFontIfExists() {
  return GetChild<CXFA_Font>(0, XFA_Element::Font, false);
}

CXFA_Value* CXFA_Caption::GetValueIfExists() {
  return GetChild<CXFA_Value>(0, XFA_Element::Value, false);
}


text:
"use strict";
/**
 * Erick Ponce Leão <erickponceleao@gmail.com>
 */
var _ = require("underscore");
var querystring = require("querystring");
var crypto = require("crypto");
var Token = (function () {
    function Token(key, secret) {
        this.key = key;
        this.secret = secret;
    }
    Token.prototype.sign = function (request) {
        request.sign(this);
    };
    return Token;
}());
exports.Token = Token;
var Request = (function () {
    function Request(method, path, query) {
        var _this = this;
        this.queryDict = {};
        this.authDict = {};
        this.signed = false;
        if (typeof path != 'string')
            throw new Error('Expected string');
        if (typeof query != 'object')
            throw new Error('Expected object');
        _.forEach(query, function (value, key) {
            var keyLower = key.toLowerCase();
            if (keyLower.search('auth_') >= 0) {
                _this.authDict[keyLower] = value.trim();
            }
            else {
                if (_.isArray(value)) {
                    _.forEach(value, function (v, idx) {
                        value[idx] = v.trim();
                    });
                    _this.queryDict[keyLower + '[]'] = value;
                } else if (_.isObject(value)) {
                    _this.queryDict[keyLower] = value;
                } else {
                    _this.queryDict[keyLower] = value.trim();
                }

            }
        });
        this.method = method.toUpperCase();
        this.path = path;
    }
    Request.prototype.getAuthField = function (field) {
        var authFieldKey = 'auth_' + field;
        if (authFieldKey in this.authDict) {
            return this.authDict[authFieldKey];
        }
        else {
            throw new Error('Missing parameter: ' + field);
        }
    };
    Request.prototype.sign = function (token) {
        this.authDict = {
            auth_version: Request.AUTH_VERSION,
            auth_key: token.key,
            auth_timestamp: Math.floor(new Date().getTime() / 1000)
        };
        this.authDict['auth_signature'] = this.signature(token);
        this.signed = true;
        return this.authDict;
    };
    Request.prototype.authenticate = function (token, raiseException, timeMsGrace) {
        if (raiseException === void 0) { raiseException = true; }
        if (timeMsGrace === void 0) { timeMsGrace = 600; }
        if (!token.secret)
            throw new Error('Provided token is missing secret');
        try {
            this.validateVersion();
            this.validateTimestamp(timeMsGrace);
            this.validateSignature(token);
        }
        catch (e) {
            if (raiseException)
                throw new Error(e.message);
            else
                return false;
        }
        return true;
    };
    Request.prototype.getAuthDict = function () {
        if (!this.signed)
            throw new Error('Request not signed');
        return this.authDict;
    };
    Request.prototype.signedParams = function () {
        return _.extend(this.queryDict, this.authDict);
    };
    Request.prototype.sortObj = function (obj) {
        var ordered = {};
        Object.keys(obj).sort().forEach(function (key) {
            ordered[key] = obj[key];
        });
        return ordered;
    };
    Request.prototype.parameterString = function () {
        var paramDict = this.signedParams() || {};
        var paramDictLower = {};
        _.forEach(paramDict, function (value, key) {
            paramDictLower[key.toLowerCase()] = value;
        });
        delete paramDictLower['auth_signature'];
        var stringifyed = querystring.stringify(this.sortObj(paramDictLower));
        return querystring.unescape(stringifyed);
    };
    Request.prototype.stringToSign = function () {
        return [this.method, this.path, this.parameterString()].join('\n');
    };
    Request.prototype.signature = function (token) {
        return crypto.createHmac('sha256', token.secret).update(this.stringToSign()).digest('hex');
    };
    Request.prototype.validateVersion = function () {
        if (this.getAuthField('version') != Request.AUTH_VERSION)
            throw new Error('Version not supported');
    };
    Request.prototype.validateTimestamp = function (timeMsGrace) {
        if (!timeMsGrace)
            return true;
        var timeMs = this.getAuthField('timestamp');
        var now = Math.floor(new Date().getTime() / 1000);
        var error = (now - timeMs);
        if (error >= timeMsGrace) {
            var errorMsg = 'Timestamp expired: Given timestamp '
                + '(' + timeMs + ') not within ' + timeMsGrace
                + ' of server time (' + now + ')';
            throw new Error(errorMsg);
        }
        return true;
    };
    Request.prototype.validateSignature = function (token) {
        var authSignature = this.getAuthField('signature');
        var sig = this.signature(token);
        if (authSignature != sig) {
            var errorMsg = 'Invalid signature: you should have '
                + 'sent HmacSHA256Hex(' + this.stringToSign() + ', your_secret_key)'
                + ', but you sent ' + authSignature;
            throw new Error(errorMsg);
        }
        return true;
    };
    Request.ISO8601 = new Date().toISOString();
    Request.AUTH_VERSION = '1.0';
    return Request;
}());
exports.Request = Request;
//# sourceMappingURL=signature.js.map


text:
<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Profile Summary For GitHub</title>
        <link rel="icon" href="/favicon.png">
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="Github Profile Summary is a GitHub visualization tool written in Kotlin">
        <meta property="og:title" content="Github Profile Summary - Visualize your GitHub profile">
        <meta property="og:site_name" content="Github Profile Summary">
        <meta property="og:url" content="https://profile-summary-for-github.com">
        <meta property="og:description" content="Github Profile Summary is a GitHub visualization tool written in Kotlin">
        <meta property="og:image" content="https://user-images.githubusercontent.com/1521451/33957306-8e1d8af0-e041-11e7-8e04-3de9e32868ba.PNG">
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
        <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Barlow+Semi+Condensed">
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/load-awesome@1.1.0/css/square-jelly-box.min.css">
        <script src="https://cdn.jsdelivr.net/npm/chart.js@2.8.0/dist/Chart.min.js"></script>
        <script src="https://cdn.jsdelivr.net/npm/axios@0.19.0/dist/axios.min.js"></script>
        <script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js"></script>
        <script src="https://cdn.jsdelivr.net/npm/moment@2.24.0/min/moment.min.js"></script>
        <script src="https://cdn.jsdelivr.net/npm/js-cookie@2/src/js.cookie.min.js"></script>
        @componentRegistration
    </head>
    <body>
        <main id="main-vue" class="content" v-cloak>
            @routeComponent
        </main>
        <script>
            new Vue({el: "#main-vue"});
        </script>
    </body>
</html>


text:
#include "binlog_api.h"
#include <gtest/gtest.h>
#include <iostream>
#include <stdlib.h>

class TestBinaryLog : public ::testing::Test {
 protected:
  TestBinaryLog() {
    // You can do set-up work for each test here.
  }

  virtual ~TestBinaryLog() {
    // You can do clean-up work that doesn't throw exceptions here.
  }

  // If the constructor and destructor are not enough for setting up
  // and cleaning up each test, you can define the following methods:

  virtual void SetUp() {
    // Code here will be called immediately after the constructor (right
    // before each test).
  }

  virtual void TearDown() {
    // Code here will be called immediately after each test (right
    // before the destructor).
  }

};

TEST_F(TestBinaryLog, ConnectTo_Bogus)
{
  using mysql::system::create_transport;
  mysql::Binary_log *binlog=
  new mysql::Binary_log(create_transport("bogus-url"));
  EXPECT_GT(binlog->connect(), 0);
  delete(binlog);
}

TEST_F(TestBinaryLog, ConnectTo_TcpIp)
{
  using mysql::system::create_transport;
  mysql::Binary_log *binlog=
  new mysql::Binary_log(create_transport("mysql://root@127.0.0.1:13000"));
  EXPECT_EQ(binlog->connect(),0);
  delete binlog;
}

TEST_F(TestBinaryLog, Connected_TcpIp)
{
  using mysql::system::create_transport;
  mysql::Binary_log *binlog=
  new mysql::Binary_log(create_transport("mysql://root@127.0.0.1:13000"));
  EXPECT_EQ(binlog->connect(),0);
  mysql::Binary_log_event *event;
  binlog->wait_for_next_event(&event);
  EXPECT_TRUE(event->get_event_type() == mysql::ROTATE_EVENT);
  delete event;
  binlog->wait_for_next_event(&event);
  EXPECT_TRUE(event->get_event_type() == mysql::FORMAT_DESCRIPTION_EVENT);
  delete event;
}

TEST_F(TestBinaryLog, SetPosition)
{
  using mysql::system::create_transport;
  mysql::Binary_log_event *event;
  mysql::Binary_log *binlog=
  new mysql::Binary_log(create_transport("mysql://root@127.0.0.1:13000"));
  EXPECT_EQ(binlog->connect(),0);
  std::string filename;
  unsigned long position= binlog->get_position(filename);
  int result= binlog->set_position(filename,4);
  EXPECT_EQ(result,ERR_OK);
  position= binlog->get_position();
  EXPECT_EQ(position, 4);

  binlog->wait_for_next_event(&event);
}

int main(int argc, char **argv) {
  ::testing::InitGoogleTest(&argc, argv);

  // TODO require that the connection string is passed as an argument to the
  // test suite.
  std::cout << "Important: Make sure that the MySQL server is started using "
    "'mysql-test-run --mysqld=--log_bin=searchbin --mysqld=--binlog_format=row"
    " --start alias' and that the server is listening on IP 127.0.0.1 and port"
    " 13000." << std::endl;
  return RUN_ALL_TESTS();
}


text:
var jquery = require("jquery")
,   isArray = require("isarray")
,   duct = {
        nowModules:     null
    ,   onloadModules:  null
    ,   $:              jquery
    ,   doc:            document
    ,   conf:           null
    }
;

function extractConfiguration () {
    if (duct.conf) return;
    duct.conf = {};
    try {
        jquery("script[type='application/duct+json']")
            .each(function () {
                jquery.extend(duct.conf, JSON.parse($(this).text()));
            });
    }
    catch (e) {
        // XXX error
    }
}

function runPipe (pipe) {
    var step = 0
    ,   doNext = function () {
            if (step === pipe.length) return;
            step++;
            try {
                pipe[step - 1](duct, doNext);
            }
            catch (e) {
                // XXX error
            }
        }
    ;
    doNext();
}

// these get run ASAP (e.g. to avoid FOUC)
//  the DOM may not be available
exports.now = function (mods) {
    if (!mods) return;
    duct.nowModules = isArray(mods) ? mods : [mods];
    extractConfiguration();
    runPipe(duct.nowModules);
};

// these get run at load
exports.onload = function (mods) {
    if (!mods) return;
    duct.onloadModules = isArray(mods) ? mods : [mods];
};

jquery(function () {
    extractConfiguration();
    runPipe(duct.onloadModules);
});


text:
package org.sql4j;

/**
 *
 * @author George Aristy
 */
public class ColumnConstraint {
  private ColumnConstraint() {
  }

  public static ColumnConstraintSpec constraint(String constraintName){
    return new ColumnConstraintSpec(constraintName);
  }

  public static class ColumnConstraintSpec {
    private final SqlBuilder builder;

    private ColumnConstraintSpec(String constraintName) {
      this.builder = new SqlBuilder();

      if(constraintName != null){
        this.builder.append("CONSTRAINT ").append(constraintName).append(" ");
      }
    }

    public FinalizedColumnConstraint notNull(){
      builder.append("NOT NULL");
      return new FinalizedColumnConstraint(builder);
    }

    public FinalizedColumnConstraint unique(){
      builder.append("UNIQUE");
      return new FinalizedColumnConstraint(builder);
    }

    public FinalizedColumnConstraint primaryKey(){
      builder.append("PRIMARY KEY");
      return new FinalizedColumnConstraint(builder);
    }
  }

  public static class FinalizedColumnConstraint {
    private final SqlBuilder builder;

    private FinalizedColumnConstraint(SqlBuilder builder) {
      this.builder = builder;
    }

    String getConstraintString(){
      return builder.getSql();
    }
  }
}


text:
using UnityEngine;
using System.Collections;

public class Glue : MonoBehaviour
{
    //Set through Unity
    public LevelMng LeveMng;
    public Camera MainCamera;

    public GameObject PlayerPrefab;
    public GameObject DogPrefab;

    public ActionMenu ActionMenu;
    public InputManager InputManager;

    public StatInt HealthStat;
    public StatInt StaminaStat;

    public ItemData[] PlayerTestBuild;

    public int Seed;

    //

	void Start ()
    {
        Random.seed = Seed;

        ActionExecutor.Instance.ResetGameTime();

//        DebugStart();

        var dungeon = LevelSettings.GenerateDungeon();
        this.LeveMng.LoadLevel(dungeon);

        SetupPlayer(dungeon.PlayerStartPos, /* LevelSettings.PlayerBuild */ this.PlayerTestBuild);

        LevelMng.Instance.ActivateRoom(dungeon.Rooms[0]);
	}

    void SetupPlayer(Point playerStartPos, ItemData[] build)
    {
        var playerGo = (GameObject)Instantiate(this.PlayerPrefab);
        this.MainCamera.transform.SetParent(playerGo.transform);
        var player = playerGo.GetComponent<Player>();
        player.Build = build;
        this.LeveMng.AddCharacterOnPos(player as Character, playerStartPos);
        playerGo.transform.localPosition = Vector3.zero;
        player.ActionMenu = this.ActionMenu;
        player.HealthStat = this.HealthStat;
        player.StaminaStat = this.StaminaStat;
        this.InputManager.Player = player;
    }

    void DebugStart()
    {
        var lvlGen = new BSPGenerator();
        var genOpts = new GenOptions() {
            DUN_WIDTH = 50,
            DUN_HEIGHT = 50,
            MAX_LEAF_AREA = 650,
            MIN_LEAF_SIDE = 10,
            MIN_ROOM_SIDE = 6
        };
        Dungeon dungeon = lvlGen.GenDungeon(genOpts);
        this.LeveMng.LoadLevel(dungeon);

        SetupPlayer(dungeon.PlayerStartPos, this.PlayerTestBuild);
        //        Room room = dungeon.Rooms[0];
        //        Point dogStartPos = dungeon.PlayerStartPos;
        //        dogStartPos.Y++;dogStartPos.Y++;dogStartPos.Y++;
        ////        while(true)
        ////        {
        ////            dogStartPos = room.GetRandomPointInsideRoom(1);
        ////            if (dogStartPos != dungeon.PlayerStartPos)
        ////            {
        ////                break;
        ////            }
        ////        }
        for (int i = 0; i < dungeon.Rooms.Count; i++)
        {
            var room = dungeon.Rooms[i];
            var dogGo = (GameObject)Instantiate(this.DogPrefab);
            var dog = dogGo.GetComponent<Monster>();
            this.LeveMng.AddCharacterOnPos(dog as Character, room.GetRandomPointInsideRoom(2));
        }
        LevelMng.Instance.ActivateRoom(dungeon.Rooms[0]);
    }
}


text:
namespace SnowFur.DAL.Migrations
{
    using System;
    using System.Data.Entity.Migrations;

    public partial class InitialCreate : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.PersonalProfiles",
                c => new
                    {
                        Id = c.Int(nullable: false),
                        FirstName = c.String(),
                        LastName = c.String(),
                        Address = c.String(),
                        ZipCode = c.String(),
                        City = c.String(),
                        State = c.String(),
                        Adult = c.Boolean(nullable: false),
                        IsDeleted = c.Boolean(nullable: false),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.AspNetUsers", t => t.Id)
                .Index(t => t.Id);

            CreateTable(
                "dbo.AspNetUsers",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        AdditionalInfo = c.String(),
                        IsDeleted = c.Boolean(nullable: false),
                        Email = c.String(maxLength: 256),
                        EmailConfirmed = c.Boolean(nullable: false),
                        PasswordHash = c.String(),
                        SecurityStamp = c.String(),
                        PhoneNumber = c.String(),
                        PhoneNumberConfirmed = c.Boolean(nullable: false),
                        TwoFactorEnabled = c.Boolean(nullable: false),
                        LockoutEndDateUtc = c.DateTime(),
                        LockoutEnabled = c.Boolean(nullable: false),
                        AccessFailedCount = c.Int(nullable: false),
                        UserName = c.String(nullable: false, maxLength: 256),
                    })
                .PrimaryKey(t => t.Id)
                .Index(t => t.UserName, unique: true, name: "UserNameIndex");

            CreateTable(
                "dbo.AspNetUserClaims",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        UserId = c.Int(nullable: false),
                        ClaimType = c.String(),
                        ClaimValue = c.String(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.AspNetUsers", t => t.UserId)
                .Index(t => t.UserId);

            CreateTable(
                "dbo.AspNetUserLogins",
                c => new
                    {
                        LoginProvider = c.String(nullable: false, maxLength: 128),
                        ProviderKey = c.String(nullable: false, maxLength: 128),
                        UserId = c.Int(nullable: false),
                    })
                .PrimaryKey(t => new { t.LoginProvider, t.ProviderKey, t.UserId })
                .ForeignKey("dbo.AspNetUsers", t => t.UserId)
                .Index(t => t.UserId);

            CreateTable(
                "dbo.RoomMateOffers",
                c => new
                    {
                        Id = c.Int(nullable: false),
                        MessageForReceiver = c.String(),
                        IsConfirmed = c.Boolean(nullable: false),
                        ReceiverId = c.Int(nullable: false),
                        SenderId = c.Int(nullable: false),
                        User_Id = c.Int(),
                        User_Id1 = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.AspNetUsers", t => t.Id)
                .ForeignKey("dbo.AspNetUsers", t => t.User_Id)
                .ForeignKey("dbo.AspNetUsers", t => t.User_Id1)
                .Index(t => t.Id)
                .Index(t => t.User_Id)
                .Index(t => t.User_Id1);

            CreateTable(
                "dbo.AspNetUserRoles",
                c => new
                    {
                        UserId = c.Int(nullable: false),
                        RoleId = c.Int(nullable: false),
                    })
                .PrimaryKey(t => new { t.UserId, t.RoleId })
                .ForeignKey("dbo.AspNetUsers", t => t.UserId)
                .ForeignKey("dbo.AspNetRoles", t => t.RoleId)
                .Index(t => t.UserId)
                .Index(t => t.RoleId);

            CreateTable(
                "dbo.AspNetRoles",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Name = c.String(nullable: false, maxLength: 256),
                    })
                .PrimaryKey(t => t.Id)
                .Index(t => t.Name, unique: true, name: "RoleNameIndex");

            CreateTable(
                "dbo.RoomReservations",
                c => new
                    {
                        Id = c.Int(nullable: false),
                        IsPayed = c.Boolean(nullable: false),
                        Day1 = c.Boolean(nullable: false),
                        Day2 = c.Boolean(nullable: false),
                        Day3 = c.Boolean(nullable: false),
                        Day4 = c.Boolean(nullable: false),
                        Note = c.String(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.AspNetUsers", t => t.Id)
                .Index(t => t.Id);

        }

        public override void Down()
        {
            DropForeignKey("dbo.RoomReservations", "Id", "dbo.AspNetUsers");
            DropForeignKey("dbo.AspNetUserRoles", "RoleId", "dbo.AspNetRoles");
            DropForeignKey("dbo.PersonalProfiles", "Id", "dbo.AspNetUsers");
            DropForeignKey("dbo.RoomMateOffers", "User_Id1", "dbo.AspNetUsers");
            DropForeignKey("dbo.AspNetUserRoles", "UserId", "dbo.AspNetUsers");
            DropForeignKey("dbo.RoomMateOffers", "User_Id", "dbo.AspNetUsers");
            DropForeignKey("dbo.RoomMateOffers", "Id", "dbo.AspNetUsers");
            DropForeignKey("dbo.AspNetUserLogins", "UserId", "dbo.AspNetUsers");
            DropForeignKey("dbo.AspNetUserClaims", "UserId", "dbo.AspNetUsers");
            DropIndex("dbo.RoomReservations", new[] { "Id" });
            DropIndex("dbo.AspNetRoles", "RoleNameIndex");
            DropIndex("dbo.AspNetUserRoles", new[] { "RoleId" });
            DropIndex("dbo.AspNetUserRoles", new[] { "UserId" });
            DropIndex("dbo.RoomMateOffers", new[] { "User_Id1" });
            DropIndex("dbo.RoomMateOffers", new[] { "User_Id" });
            DropIndex("dbo.RoomMateOffers", new[] { "Id" });
            DropIndex("dbo.AspNetUserLogins", new[] { "UserId" });
            DropIndex("dbo.AspNetUserClaims", new[] { "UserId" });
            DropIndex("dbo.AspNetUsers", "UserNameIndex");
            DropIndex("dbo.PersonalProfiles", new[] { "Id" });
            DropTable("dbo.RoomReservations");
            DropTable("dbo.AspNetRoles");
            DropTable("dbo.AspNetUserRoles");
            DropTable("dbo.RoomMateOffers");
            DropTable("dbo.AspNetUserLogins");
            DropTable("dbo.AspNetUserClaims");
            DropTable("dbo.AspNetUsers");
            DropTable("dbo.PersonalProfiles");
        }
    }
}


text:
import React from 'react';
import RaisedButton from 'material-ui/RaisedButton';
import {Popover, PopoverAnimationVertical} from 'material-ui/Popover';
import Menu from 'material-ui/Menu';
import MenuItem from 'material-ui/MenuItem';

export default class PopoverExampleAnimation extends React.Component {

  constructor(props) {
    super(props);

    this.state = {
      open: false,
    };
  }

  handleTouchTap = (event) => {
    // This prevents ghost click.
    event.preventDefault();
    this.setState({
      open: true,
      anchorEl: event.currentTarget,
    });
  };

  handleRequestClose = () => {
    this.setState({
      open: false,
    });
  };

  render() {
    return (
      <div>
        <RaisedButton
          onTouchTap={this.handleTouchTap}
          label="Click me"
        />
        <Popover
          open={this.state.open}
          anchorEl={this.state.anchorEl}
          anchorOrigin={{horizontal: 'left', vertical: 'bottom'}}
          targetOrigin={{horizontal: 'left', vertical: 'top'}}
          onRequestClose={this.handleRequestClose}
          animation={PopoverAnimationVertical}
        >
          <Menu>
            <MenuItem primaryText="Refresh" />
            <MenuItem primaryText="Help & feedback" />
            <MenuItem primaryText="Settings" />
            <MenuItem primaryText="Sign out" />
          </Menu>
        </Popover>
      </div>
    );
  }
}


text:
#include "../stdafx.h"
#include "fso.generated.h"

#define DEFINE_TRIVIAL_IMPLEMENTATIONS(x) x::~x(){} void x::rollback_deserialization(){}

DEFINE_TRIVIAL_IMPLEMENTATIONS(Sha256Digest)
DEFINE_TRIVIAL_IMPLEMENTATIONS(Guid)
DEFINE_TRIVIAL_IMPLEMENTATIONS(FileSystemObject)
DEFINE_TRIVIAL_IMPLEMENTATIONS(DirectoryishFso)
DEFINE_TRIVIAL_IMPLEMENTATIONS(DirectoryFso)
DEFINE_TRIVIAL_IMPLEMENTATIONS(DirectorySymlinkFso)
DEFINE_TRIVIAL_IMPLEMENTATIONS(JunctionFso)
DEFINE_TRIVIAL_IMPLEMENTATIONS(FilishFso)
DEFINE_TRIVIAL_IMPLEMENTATIONS(RegularFileFso)
DEFINE_TRIVIAL_IMPLEMENTATIONS(FileHardlinkFso)
DEFINE_TRIVIAL_IMPLEMENTATIONS(FileSymlinkFso)
DEFINE_TRIVIAL_IMPLEMENTATIONS(FileReparsePointFso)
DEFINE_TRIVIAL_IMPLEMENTATIONS(ArchiveMetadata)
DEFINE_TRIVIAL_IMPLEMENTATIONS(VersionManifest)
DEFINE_TRIVIAL_IMPLEMENTATIONS(OpaqueTimestamp)
DEFINE_TRIVIAL_IMPLEMENTATIONS(BackupStream)
DEFINE_TRIVIAL_IMPLEMENTATIONS(UnmodifiedStream)
DEFINE_TRIVIAL_IMPLEMENTATIONS(FullStream)


text:
  <bread-crumbs class="bread-crumbs--navbar" omit-current-page="true"></bread-crumbs>
  <kbn-top-nav name="devtools" config="kbnDevToolsApp.topNavConfig">

        {{::item.display}}

  </kbn-top-nav>


text:
if [ -z "$1" ]; then
	echo "Usage: TableContentsValidator.sh VERSION";
	exit 1;
fi

VERSION=$1;
DB_PATH=../../DBL/3prepared/${VERSION}.db;

sqlite3 ${DB_PATH} <<END_SQL
select lastChapter + chapterRowId from tableContents where code='REV';
END_SQL

echo 'Response should be 1255'


text:
module LiquidPlanner
  module Resources
    class Task < Leaf
    end
  end
end


text:
'use strict';

import { getDataMongo } from './dbWrapper/getDataMongo';
import { postDataMongo } from './dbWrapper/postDataMongo';
import { connect } from './dbWrapper/connectMongo';

import uriUtil from 'mongodb-uri';

import render from './lib/render';
var request = require('request');
var express = require('express');
var bodyParser = require('body-parser')

var app = express();

var db = connect();

//var db = 1;

app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());

app.listen(3000, function () {
  console.log('listening on 3000')
})

app.get('/', function (rez, res) {
  var loginDetails = {
    'username': 'c0f45@example.com',
    'password': 'foobar'
  };

  var options = {
    url: 'http://193.226.51.18:8888/api/V2/auth',
    method: 'POST',
    body: JSON.stringify(loginDetails),
    headers: {
      "Content-Type": "application/json",
    },
  };
  request(options, function (error, response, body) {
    //request well done aici ai ce intoarce apiu facultatii
    console.log(body)
    console.log('Autentificare in auth!!')
    res.send(body);
  });
})
//END Auth

app.get('/gettest', (req, res) => {
  console.log(req.body);
  getDataMongo(app, db);
  res.send(results);
});

app.post('/posttest', (req, res) => {
  console.log(req.body);
  postDataMongo(app, db);
  res.send("Success");
});


text:
<?php
class Education extends CI_Controller {

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

		public function getDepartments(){
			$deparments = $this->Education_model->get_departments();
			echo json_encode($deparments);
		}

}
?>


text:
<!DOCTYPE html>
<html>
<!--
Copyright 2012 The Closure Library Authors. All Rights Reserved.

Use of this source code is governed by the Apache License, Version 2.0.
See the COPYING file for details.
-->
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Closure Unit Tests - goog.testing.proto2</title>
<script src="../../base.js"></script>
<script>
  goog.require('goog.testing.jsunit');
  goog.require('goog.testing.proto2');
  goog.require('proto2.TestAllTypes');
</script>
</head>
<body>
<script>

function testAssertEquals() {
  var assertProto2Equals = goog.testing.proto2.assertEquals;
  assertProto2Equals(new proto2.TestAllTypes, new proto2.TestAllTypes);
  assertProto2Equals(new proto2.TestAllTypes, new proto2.TestAllTypes, 'oops');

  var ex = assertThrows(goog.partial(assertProto2Equals,
      new proto2.TestAllTypes, new proto2.TestAllTypes.NestedMessage));
  assertEquals(
      'Message type mismatch: TestAllTypes != TestAllTypes.NestedMessage',
      ex.message);

  var message = new proto2.TestAllTypes;
  message.setOptionalInt32(1);
  ex = assertThrows(goog.partial(assertProto2Equals,
      new proto2.TestAllTypes, message));
  assertEquals('optional_int32 should not be present', ex.message);

  ex = assertThrows(goog.partial(assertProto2Equals,
      new proto2.TestAllTypes, message, 'oops'));
  assertEquals('oops\noptional_int32 should not be present', ex.message);
}

function testFindDifferences_EmptyMessages() {
  assertEquals('', goog.testing.proto2.findDifferences_(
      new proto2.TestAllTypes, new proto2.TestAllTypes, ''));
}

function testFindDifferences_FieldNotPresent() {
  var message = new proto2.TestAllTypes;
  message.setOptionalInt32(0);
  var empty = new proto2.TestAllTypes;
  assertEquals('optional_int32 should not be present',
      goog.testing.proto2.findDifferences_(empty, message, ''));
  assertEquals('optional_int32 should be present',
      goog.testing.proto2.findDifferences_(message, empty, ''));
  assertEquals('path/optional_int32 should be present',
      goog.testing.proto2.findDifferences_(message, empty, 'path'));
}

function testFindDifferences_IntFieldDiffers() {
  var message1 = new proto2.TestAllTypes;
  message1.setOptionalInt32(1);
  var message2 = new proto2.TestAllTypes;
  message2.setOptionalInt32(2);
  assertEquals('optional_int32 should be 1, but was 2',
      goog.testing.proto2.findDifferences_(message1, message2, ''));
}

function testFindDifferences_NestedIntFieldDiffers() {
  var message1 = new proto2.TestAllTypes;
  var nested1 = new proto2.TestAllTypes.NestedMessage();
  nested1.setB(1);
  message1.setOptionalNestedMessage(nested1);
  var message2 = new proto2.TestAllTypes;
  var nested2 = new proto2.TestAllTypes.NestedMessage();
  nested2.setB(2);
  message2.setOptionalNestedMessage(nested2);
  assertEquals('optional_nested_message/b should be 1, but was 2',
      goog.testing.proto2.findDifferences_(message1, message2, ''));
}

function testFindDifferences_RepeatedFieldLengthDiffers() {
  var message1 = new proto2.TestAllTypes;
  message1.addRepeatedInt32(1);
  var message2 = new proto2.TestAllTypes;
  message2.addRepeatedInt32(1);
  message2.addRepeatedInt32(2);
  assertEquals('repeated_int32 should have 1 items, but has 2',
      goog.testing.proto2.findDifferences_(message1, message2, ''));
}

function testFindDifferences_RepeatedFieldItemDiffers() {
  var message1 = new proto2.TestAllTypes;
  message1.addRepeatedInt32(1);
  var message2 = new proto2.TestAllTypes;
  message2.addRepeatedInt32(2);
  assertEquals('repeated_int32[0] should be 1, but was 2',
      goog.testing.proto2.findDifferences_(message1, message2, ''));
}

function testFindDifferences_RepeatedNestedMessageDiffers() {
  var message1 = new proto2.TestAllTypes;
  var nested1 = new proto2.TestAllTypes.NestedMessage();
  nested1.setB(1);
  message1.addRepeatedNestedMessage(nested1);
  var message2 = new proto2.TestAllTypes;
  var nested2 = new proto2.TestAllTypes.NestedMessage();
  nested2.setB(2);
  message2.addRepeatedNestedMessage(nested2);
  assertEquals('repeated_nested_message[0]/b should be 1, but was 2',
      goog.testing.proto2.findDifferences_(message1, message2, ''));
}

function testJsonToProto() {
  var nested = new proto2.TestAllTypes.NestedMessage();
  nested.setB(1);
  var message = new proto2.TestAllTypes;
  message.addRepeatedNestedMessage(nested);
  message.setOptionalInt32(2);
  // Successfully deserializes simple as well as message fields.
  assertObjectEquals(
      message,
      goog.testing.proto2.jsonToProto(proto2.TestAllTypes, {
        'optional_int32': 2,
        'repeated_nested_message': [{'b': 1}]
      }));
  // Fails if the field name is not recognized.
  assertThrows(function() {
    goog.testing.proto2.jsonToProto(proto2.TestAllTypes, {'unknown': 1});
  });
  // Fails if the value type is wrong in the JSON object.
  assertThrows(function() {
    goog.testing.proto2.jsonToProto(proto2.TestAllTypes,
        {'optional_int32': '1'});
  });
}

</script>
</body>
</html>


text:
using System;
using System.Linq;
using System.Reflection;
using System.Collections.Generic;
using System.Text.RegularExpressions;

namespace Cradle
{
	[Serializable]
	public struct StoryVar
	{
		public static bool StrictMode = false;
		internal object Value;

		public struct MemberLookup
		{
			public string MemberName;

			public MemberLookup(string memberName)
			{
				MemberName = memberName;
			}

			public StoryVar this[StoryVar parent]
			{
				get { return parent.GetMember (MemberName); }
				set { parent.SetMember (MemberName, value); }
			}
		}

		public StoryVar(object value)
		{
			this.Value = GetInnerValue(value, true);
		}

		public Type InnerType
		{
			get
			{
				object val = GetInnerValue(this);
				return val == null ? null : val.GetType();
			}
		}

		public object InnerValue
		{
			get { return GetInnerValue(this); }
		}

		public static StoryVar Empty
		{
			get { return new StoryVar(null); }
		}

		private static object GetInnerValue(object obj, bool duplicate = false)
		{
			var twVar = default(StoryVar);
			while (obj is StoryVar)
			{
				twVar = (StoryVar)obj;
				obj = twVar.Value;
			}

			// When a duplicate is needed, duplicate only the last twine var in the chain
			if (duplicate && twVar.Value != null)
				obj = twVar.Duplicate().Value;

			return obj;
		}

		public override int GetHashCode()
		{
			if (Value == null)
				return 0;

			int hash = 17;
			hash = hash * 31 + Value.GetType().GetHashCode();
			hash = hash * 31 + Value.GetHashCode();
			return hash;
		}

		public override string ToString()
		{
			string result;
			if (!TryConvertTo<string>(this.Value, out result))
				result = string.Empty;

			return result;
		}

		public override bool Equals(object obj)
		{
			return Compare(Operator.Equals, this, obj);
		}

		// ..............
		// TYPE SERVICES

		static Dictionary<Type, IVarTypeService> _typeServices = new Dictionary<Type, IVarTypeService>();

		public static void RegisterTypeService<T>(IVarTypeService service)
		{
			_typeServices[typeof(T)] = service;
		}

		public static VarTypeService<T> GetTypeService<T>(bool throwException = false)
		{
			var service = (VarTypeService<T>)GetTypeService(typeof(T));
			if (service == null)
				throw new StoryException(string.Format("UnityTwine is missing a TwineTypeService for {0}. Did you mess with something you shouldn't have?", typeof(T).FullName));

			return service;
		}

		public static IVarTypeService GetTypeService(Type t)
		{
			IVarTypeService service = null;
			_typeServices.TryGetValue(t, out service);
			return service;
		}

		// ..............
		// MEMBERS

		public StoryVar this[StoryVar memberName]
		{
			get
			{
				return GetMember(memberName);
			}
			set
			{
				SetMember(memberName, value);
			}
		}

		public MemberLookup AsMemberOf
		{
			get { return new MemberLookup (this); }
		}

		public StoryVar GetMember(StoryVar member)
		{
			if (Value == null)
				throw new VarTypeMemberException("Cannot get members of an empty story variable.");

			if (member.Value == null)
				throw new VarTypeMemberException("Cannot treat an empty variable as a member.");

			IVarTypeService service = GetTypeService(this.Value.GetType());
			if (service != null)
				return service.GetMember(this.Value, member);

			if (this.Value is IVarType)
				return ((IVarType)this.Value).GetMember(member);

			throw new VarTypeMemberException(string.Format("Cannot get member of a story variable of type {0}.", this.Value.GetType().Name));
		}

		public void SetMember(StoryVar member, StoryVar val)
		{
			if (Value == null)
				throw new VarTypeMemberException("Cannot set member of empty story variable.");

			IVarTypeService service = GetTypeService(this.Value.GetType());
			if (service != null)
			{
				service.SetMember(this.Value, member, val);
				return;
			}

			if (this.Value is IVarType)
			{
				((IVarType)this.Value).SetMember(member, val);
				return;
			}

			throw new VarTypeMemberException(string.Format("Cannot set member of a story variable of type {0}.", this.Value.GetType().Name));
		}

		public void RemoveMember(StoryVar member)
		{
			if (Value == null)
				throw new VarTypeMemberException("Cannot remove member of empty story variable.");

			IVarTypeService service = GetTypeService(this.Value.GetType());
			if (service != null)
			{
				service.RemoveMember(this.Value, member);
				return;
			}

			if (this.Value is IVarType)
			{
				((IVarType)this.Value).RemoveMember(member);
				return;
			}

			throw new VarTypeMemberException(string.Format("Cannot remove member of a story variable of type {0}.", this.Value.GetType().Name));
		}

		// ..............
		// OBJECT

		public static bool Compare(Operator op, object left, object right)
		{
			object a = GetInnerValue(left);
			object b = GetInnerValue(right);

			if (a == null && b == null)
				return true;

			bool result;
			IVarTypeService service;

			if (a != null && _typeServices.TryGetValue(a.GetType(), out service) && service.Compare(op, a, b, out result))
				return result;

			if (a is IVarType)
			{
				if ((a as IVarType).Compare(op, b, out result))
					return result;
			}

			return false;
		}

		public static bool TryCombine(Operator op, object left, object right, out StoryVar result)
		{
			object a = GetInnerValue(left);
			object b = GetInnerValue(right);

			if (a != null || b != null)
			{
				IVarTypeService service;
				if (a == null && b != null)
				{
					// Handle uninitialized left operand - use the right operand's type to convert (fix for issue #39)
					object aConverted;
					if (
						_typeServices.TryGetValue(b.GetType(), out service) &&
						service.ConvertFrom(a, out aConverted, StoryVar.StrictMode) &&
						service.Combine(op, aConverted, b, out result)
					)
						return true;
				}
				// Handle other combinations
				else if (a != null && _typeServices.TryGetValue(a.GetType(), out service) && service.Combine(op, a, b, out result))
					return true;
			}

			// No type service managed to covert so try the var type method directly, if available
			if (a is IVarType)
			{
				if ((a as IVarType).Combine(op, b, out result))
					return true;
			}

			result = default(StoryVar);
			return false;
		}

		public static StoryVar Combine(Operator op, object left, object right)
		{
			object a = GetInnerValue(left);
			object b = GetInnerValue(right);

			StoryVar result;
			if (TryCombine(op, a, b, out result))
				return result;
			else
				throw new VarTypeException(string.Format("Cannot combine {0} with {1} using {2}",
					a == null ? "null" : a.GetType().Name,
					b == null ? "null" : b.GetType().Name,
					op
				));
		}

		public static StoryVar Unary(Operator op, object obj)
		{
			object a = GetInnerValue(obj);

			IVarTypeService service;

			StoryVar result;
			if (a != null && _typeServices.TryGetValue(a.GetType(), out service) && service.Unary(op, a, out result))
				return result;

			if (a is IVarType)
			{
				if ((a as IVarType).Unary(op, out result))
					return result;
			}

			throw new VarTypeException(string.Format("Cannot use {0} with {1}", op, a.GetType().Name ?? "null"));
		}

		public static bool TryConvertTo(object obj, Type t, out object result, bool strict)
		{
			object val = GetInnerValue(obj);

			// Source conversion
			if (val != null)
			{
				// Same type
				if (t.IsAssignableFrom(val.GetType()))
				{
					result = val;
					return true;
				}

				// Service type
				IVarTypeService service = GetTypeService(val.GetType());
				if (service != null && service.ConvertTo(val, t, out result, strict))
					return true;

				// Var type
				if (val is IVarType)
				{
					if ((val as IVarType).ConvertTo(t, out result, strict))
						return true;
				}
			}

			// Target converion
			IVarTypeService targetService = GetTypeService(t);
			if (targetService != null && targetService.ConvertFrom(val, out result, strict))
				return true;

			result = null;
			return false;
		}

		public static bool TryConvertTo(object obj, Type t, out object result)
		{
			return TryConvertTo(obj, t, out result, StoryVar.StrictMode);
		}

		public static bool TryConvertTo<T>(object obj, out T result, bool strict)
		{
			object r;
			if (TryConvertTo(obj, typeof(T), out r, strict))
			{
				result = (T)r;
				return true;
			}
			else
			{
				result = default(T);
				return false;
			}
		}

		public static bool TryConvertTo<T>(object obj, out T result)
		{
			return TryConvertTo<T>(obj, out result, StoryVar.StrictMode);
		}

		public static T ConvertTo<T>(object obj, bool strict)
		{
			obj = GetInnerValue(obj);

			T result;
			if (TryConvertTo<T>(obj, out result, strict))
				return result;
			else
				throw new VarTypeException(string.Format("Cannot convert {0} to {1}", obj == null ? "null" : obj.GetType().FullName, typeof(T).FullName));
		}

		public static T ConvertTo<T>(object obj)
		{
			return ConvertTo<T>(obj, StoryVar.StrictMode);
		}

		public StoryVar ConvertTo<T>()
		{
			return new StoryVar(StoryVar.ConvertTo<T>(this.Value));
		}

		public T ConvertValueTo<T>()
		{
			return StoryVar.ConvertTo<T>(this.Value);
		}

		public StoryVar Duplicate()
		{
			object val;
			if (this.Value == null || this.Value.GetType().IsValueType)
			{
				val = this.Value;
			}
			else
			{
				// Service type
				IVarTypeService service = GetTypeService(this.Value.GetType());
				if (service != null)
					val = service.Duplicate(this.Value);

				// Var type
				else if (this.Value is IVarType)
					val = (this.Value as IVarType).Duplicate();

				val = this.Value;
			}

			return new StoryVar(val);
		}

		public bool Contains(object obj)
		{
			return Compare(Operator.Contains, this, obj);
		}

		public bool ContainedBy(object obj)
		{
			return Compare(Operator.Contains, obj, this);
		}

		public void PutInto(ref StoryVar varRef)
		{
			varRef = this;
		}

		#region Operators
		// ------------------------

		public static StoryVar operator++(StoryVar val)
		{
			return Unary(Operator.Increment, val.Value);
		}

		public static StoryVar operator--(StoryVar val)
		{
			return Unary(Operator.Decrement, val.Value);
		}

		public static bool operator==(StoryVar a, object b)
		{
			return Compare(Operator.Equals, a, b);
		}

		public static bool operator!=(StoryVar a, object b)
		{
			return !(a == b);
		}

		public static bool operator >(StoryVar a, object b)
		{
			return Compare(Operator.GreaterThan, a, b);
		}

		public static bool operator >=(StoryVar a, object b)
		{
			return Compare(Operator.GreaterThanOrEquals, a, b);
		}

		public static bool operator <(StoryVar a, object b)
		{
			return Compare(Operator.LessThan, a, b);
		}

		public static bool operator <=(StoryVar a, object b)
		{
			return Compare(Operator.LessThanOrEquals, a, b);
		}

		public static StoryVar operator +(StoryVar a, object b)
		{
			return Combine(Operator.Add, a, b);
		}

		public static StoryVar operator -(StoryVar a, object b)
		{
			return Combine(Operator.Subtract, a, b);
		}

		public static StoryVar operator *(StoryVar a, object b)
		{
			return Combine(Operator.Multiply, a, b);
		}

		public static StoryVar operator /(StoryVar a, object b)
		{
			return Combine(Operator.Divide, a, b);
		}

		public static StoryVar operator %(StoryVar a, object b)
		{
			return Combine(Operator.Modulo, a, b);
		}

		public static StoryVar operator &(StoryVar a, StoryVar b)
		{
			return Combine(Operator.LogicalAnd, a, b);
		}

		public static StoryVar operator |(StoryVar a, StoryVar b)
		{
			return Combine(Operator.LogicalOr, a, b);
		}

		public static implicit operator StoryVar(string val)
		{
			return new StoryVar(val);
		}

		public static implicit operator StoryVar(double val)
		{
			return new StoryVar(val);
		}

		public static implicit operator StoryVar(int val)
		{
			return new StoryVar(val);
		}

		public static implicit operator StoryVar(bool val)
		{
			return new StoryVar(val);
		}

		public static implicit operator StoryVar(VarType val)
		{
			return new StoryVar(val);
		}

		public static implicit operator string(StoryVar val)
		{
			return ConvertTo<string>(val);
		}

		public static implicit operator double(StoryVar val)
		{
			return ConvertTo<double>(val);
		}

		public static implicit operator int(StoryVar val)
		{
			return ConvertTo<int>(val);
		}

		public static implicit operator bool(StoryVar val)
		{
			return ConvertTo<bool>(val);
		}

		public static bool operator true(StoryVar val)
		{
			return ConvertTo<bool>(val);
		}

		public static bool operator false(StoryVar val)
		{
			return !ConvertTo<bool>(val);
		}
		// ------------------------
		#endregion
	}
}


text:
// Boost.Bimap
//
// Copyright (c) 2006-2007 Matias Capeletto
//
// 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)

/// \file relation/pair_layout.hpp
/// \brief Tags for pair layouts

#ifndef BOOST_BIMAP_RELATION_PAIR_LAYOUT_HPP
#define BOOST_BIMAP_RELATION_PAIR_LAYOUT_HPP

#if defined(_MSC_VER) && (_MSC_VER>=1200)
#pragma once
#endif

#include <boost/config.hpp>

namespace pdalboost {} namespace boost = pdalboost; namespace pdalboost {
namespace bimaps {
namespace relation {

//@{

/// \brief Tag for normal layout. ( A,B -> A,B )

struct normal_layout {};

/// \brief Tag for mirror layout. ( A,B -> B,A )

struct mirror_layout {};

//@}

/** \struct pdalboost::bimaps::relation::inverse_layout
\brief Metafunction to obtain the inverse of a layout.

\code
template< class Layout >
struct inverse_layout
{
    typedef {InverseLayout} type;
};
\endcode

See also normal_layout, mirror_layout.
                                                                    **/

#ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES

template< class Layout >
struct inverse_layout
{
    typedef normal_layout type;
};

template<>
struct inverse_layout< normal_layout >
{
    typedef mirror_layout type;
};

#endif // BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES

} // namespace relation
} // namespace bimaps
} // namespace pdalboost

#endif // BOOST_BIMAP_RELATION_DETAIL_PAIR_LAYOUT_HPP


text:
package org.arquillian.cube.docker.impl.client.containerobject.dsl;

import org.arquillian.cube.docker.impl.client.config.IPAM;
import org.arquillian.cube.docker.impl.client.config.IPAMConfig;

import java.util.ArrayList;
import java.util.List;

/**
 * Builder to create a network object.
 */
public class NetworkBuilder {

    private static final String DEFAULT_NETWORK_DRIVER = "bridge";

    private String id;
    private String networkDriver;

    private NetworkBuilder(String id, String networkDriver) {
        this.networkDriver = networkDriver;
        this.id = id;
    }

    public static NetworkBuilder withDefaultDriver(String networkId) {
        return new NetworkBuilder(networkId, DEFAULT_NETWORK_DRIVER);
    }

    public static NetworkBuilder withDriver(String networkId, String driver) {
        return new NetworkBuilder(networkId, driver);
    }

    public IpamBuilder withIpam(String driver) {
        return new IpamBuilder(driver);
    }

    public Network build() {
        final org.arquillian.cube.docker.impl.client.config.Network network = new org.arquillian.cube.docker.impl.client.config.Network();
        network.setDriver(this.networkDriver);
        return new Network(this.id, network);

    }

    private Network build(IPAM ipam) {
        final org.arquillian.cube.docker.impl.client.config.Network network = new org.arquillian.cube.docker.impl.client.config.Network();
        network.setDriver(this.networkDriver);
        network.setIpam(ipam);
        return new Network(this.id, network);
    }

    public class IpamBuilder {

        private IPAM ipam = new IPAM();
        private List<IPAMConfig> configs = new ArrayList<>();

        public IpamBuilder(String driver) {
            ipam.setDriver(driver);
        }

        public IpamConfigurationBuilder withIpamConfiguration() {
            return new IpamConfigurationBuilder(this);
        }

        public Network build() {
            if (! configs.isEmpty()) {
                ipam.setIpamConfigs(configs);
            }

            return NetworkBuilder.this.build(ipam);
        }

    }

    public class IpamConfigurationBuilder {
        private IPAMConfig ipamConfig = new IPAMConfig();
        private IpamBuilder ipamBuilder;

        public IpamConfigurationBuilder(IpamBuilder ipamBuilder) {
            this.ipamBuilder = ipamBuilder;
        }

        public IpamConfigurationBuilder withSubnet(String subnet) {
            ipamConfig.setSubnet(subnet);
            return this;
        }

        public IpamConfigurationBuilder withGateway(String gateway) {
            ipamConfig.setGateway(gateway);
            return this;
        }

        public IpamConfigurationBuilder withIpRange(String ipRange) {
            ipamConfig.setIpRange(ipRange);
            return this;
        }

        public IpamBuilder add() {
            this.ipamBuilder.configs.add(this.ipamConfig);
            return this.ipamBuilder;
        }
    }

}


text:
class MembersShowHooks  < Redmine::Hook::ViewListener
  def view_projects_show_right(context = { })
    project = context[:project]

    if  OverviewBlock.find_by_project_id_and_name(project, 'members')
      if context[:hook_caller].respond_to?(:render)
        context[:hook_caller].send(:render, {:locals => context, :partial => '/projects/members'})
      elsif context[:controller].is_a?(ActionController::Base)
        context[:controller].send(:render_to_string, {:locals => context, :partial => '/projects/members'})
      end
    end
  end
end


text:
例外の処理と、そのロギングの手法を学びます。
ロギング用の関数は用意しているので、例外を処理してその内容を出力してみてください。

```python
from logging import getLogger, StreamHandler, DEBUG

def create_logger(name, log_level):
    """create logger"""
    logger = getLogger(name if name else __file__)
    handler = StreamHandler()
    handler.setLevel(log_level)
    logger.setLevel(log_level)
    logger.addHandler(handler)
    return logger

def main():
    """show how to handle and log the exception"""

    logger = create_logger("my_logger", DEBUG)
    logger.info("Now try to open file that does not exist!")

    #WRITE YOUR CODE HERE: below script will cause the Exception!
        with open("not_exist_file.txt") as f:
            lines = f.readlines()

    #WRITE YOUR CODE HERE: handle the exception

if __name__ == "__main__":
    main()

```

## Point

**[Exception](https://docs.python.jp/3/tutorial/errors.html)**

* Pythonでは、`try` ~ `except`により、例外の検出とハンドリングを行います。
* なお、例外を発生させる場合は`raise`を使用します。
* `Exception`クラスを継承することで、カスタムの例外クラスを作成することができます。

**[logging](https://docs.python.jp/3/library/logging.html)**

* Pythonにはデフォルトでログ用のパッケージが用意されていますが、これをそのまま利用するのは好ましくありません。
* `logging`はイメージとしてはグローバルインスタンスのような存在で、エラーレベルの設定などを変えるとそれを使用している全依存ライブラリにも影響します。
* そのため、`getLogger`により個別のロギング用インスタンスを作成することが好ましいです。
* なお、`import logging`を行うとうっかりグローバルな`logging`を使ってしまいそうになるので、素のimportは控えた方が賢明です。この点については、[こちらの記事](http://qiita.com/amedama/items/b856b2f30c2f38665701)に詳しく記載されています。


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <title>Homepage 2</title>

  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="A blog about the beer scene in Ballard, Washington">
  <meta name="author" content="Ryan Stewart">
  <meta name="generator" content="Hugo 0.83.1" />

  <link rel="stylesheet" href="https://www.ballardbeerblog.com/plugins/bootstrap/bootstrap.min.css ">

  <link rel="stylesheet" href="https://www.ballardbeerblog.com/plugins/slick/slick.css ">

  <link rel="stylesheet" href="https://www.ballardbeerblog.com/plugins/themify-icons/themify-icons.css ">

  <link rel="stylesheet" href="https://www.ballardbeerblog.com/css/style.min.css" media="screen">

  <link rel="shortcut icon" href="https://www.ballardbeerblog.com/images/favicon.png " type="image/x-icon">
  <link rel="icon" href="https://www.ballardbeerblog.com/images/favicon.png " type="image/x-icon">

  <meta property="og:title" content="Homepage 2" />
<meta property="og:description" content="" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://www.ballardbeerblog.com/homepage/home-2/" /><meta property="article:section" content="homepage" />

    <button class="navbar-toggler border-0" type="button" data-toggle="collapse" data-target="#navogation"
      aria-controls="navogation" aria-expanded="false" aria-label="Toggle navigation">

    </button>

          Home

          About

          Contact

      <form class="form-inline position-relative ml-lg-4" action="https://www.ballardbeerblog.com/search/">
        <input class="form-control px-0 w-100" type="search" placeholder="Search" id="search-query" name="s">
        <button class="search-icon" type="submit"></button>
      </form>

Welcome

to Ryan Stewart Blog

A tech and beer nerd living in Ballard.

        Follow me :

Jun 10, 2021

 read

Reuben's Brews Summer IPA Review

Summer in Seattle is better than any season in any other part of the country.

            Continue...

Jun 05, 2021

 read

Fair Isle Franz Meredith Review

One of my favorite things about living in a place with numerous breweries that are generally doing creative things is that I get exposed to a number of rare or historic beer styles.

            Continue...

May 14, 2021

 read

Stoup Neck Tats Double IPA Review

Stoup’s Neck Tats Double IPA is one of my favorite Ballard beers and also one of the best named.

            Continue...

About

Made with love and beer in Ballard, Washington, USA

Contact Info

Email : ryan@ballardbeerblog.com

Follow

Copyright © 2021 Ryan Stewart | Theme by themefisher.com

	This site uses cookies. By continuing to use this website, you agree to their use. I Accept


text:
define(function() {
    return function() {
        $('#menu > li').on("click", function() {
            $(this).addClass("specli").siblings().removeClass("specli");
            //$(this).addClass("specli").siblings().removeClass("specli");
            $("#nav-zone > li").eq($(this).index()).addClass("specli").siblings().removeClass("specli");
        });
        $("#nav-zone > li").on("click", function() {
            $(this).addClass("specli").siblings().removeClass("specli");
            //$(this).addClass("specli").siblings().removeClass("specli");
            $("#menu > li").eq($(this).index()).addClass("specli").siblings().removeClass("specli");
        });
        $('#menu').find("a[href*='#']").each(function(e) {
            var location = window.location.hash;
            if (location == $(this).attr('href')) {
                $(this).parents('li').addClass('specli').siblings().removeClass('specli');
                //console.log(location);
            }
        });
    }
});


text:
var express = require('express');
var fhForms = require('fh-forms');
var fhmbaasMiddleware = require('fh-mbaas-middleware');
var log = fhmbaasMiddleware.logger();

var router = express.Router({
  mergeParams: true
});

//Authentication for apps.
router.use(fhmbaasMiddleware.auth.app);

//Getting The Relevant Environment Database.
router.use(fhmbaasMiddleware.envMongoDb.getEnvironmentDatabase);

router.use(fhForms.middleware.parseMongoConnectionOptions);

//Get Forms Associated With The project
//The association between projects and forms are stored in the core database.
router.get('/forms', fhForms.middleware.formProjects.getFormIds, fhForms.middleware.forms.listDeployedForms);

//Get A Single Form
router.get('/forms/:id', fhForms.middleware.formProjects.getFormIds, fhmbaasMiddleware.appformsMiddleware.checkFormAssociation, fhForms.middleware.forms.get);

//Searching For Forms
router.post('/forms/search', fhForms.middleware.formProjects.getFormIds, fhForms.middleware.forms.search);

//Submit Form Data For A Project
router.post('/forms/:id/submitFormData', fhForms.middleware.forms.submitFormData);

//Get Theme Associated With A Project
//At the moment, the full definition is in the core database.
//If themes gets lifecycle, the definition will be obtained from the environemnt database.
router.get('/themes', fhForms.middleware.formProjects.getFullTheme);

//Get Config Associated With A Project
router.get('/config', fhForms.middleware.formProjects.getConfig);

//Submit A Base64 File To A Submission
//This will decode the file to a binary string before streaming to the mongo database.
router.post('/submissions/:id/fields/:fieldid/files/:fileid/base64', fhForms.middleware.submissions.getRequestFileParameters, fhForms.middleware.submissions.submitFormFileBase64);

//Submit A File To A Submission
router.post('/submissions/:id/fields/:fieldid/files/:fileid', fhForms.middleware.submissions.getRequestFileParameters, fhForms.middleware.submissions.submitFormFile);

//Verify Submission And Mark As Complete
router.post('/submissions/:id/complete', fhForms.middleware.submissions.completeSubmission, fhmbaasMiddleware.appformsMiddleware.notifySubmissionComplete);

//Get The Current Submission Status
router.get('/submissions/:id/status', fhForms.middleware.submissions.status);

//Listing All Submissions
router.get('/submissions', fhForms.middleware.submissions.listProjectSubmissions);

//Search For Submissions
router.post('/submissions/search', fhForms.middleware.submissions.listProjectSubmissions);

//Get A Single Submission
router.get('/submissions/:id', fhForms.middleware.submissions.get);

//Get A Single File Contained In A Submission.
//This will be streamed to the response.
router.get('/submissions/files/:fileId', fhForms.middleware.submissions.getSubmissionFile, fhForms.middleware.submissions.processFileResponse);

/**
 * Error Handling Middleware
 */
router.use(function(err, req, res, next){//jshint unused:false
  logger.trace('Error Performing Forms Operation ', err);
  res.status(500).json({err: err});
});

/**
 * Response Handler Middleware.
 */
router.use(function(req, res){
  req.appformsResultPayload = req.appformsResultPayload || {};
  if(req.appformsResultPayload.data){
    return res.status(200).json(req.appformsResultPayload.data);
  } else {
    return res.status(204);
  }
});

module.exports = router;


text:
import React, { FC } from 'react';
import { List } from '@material-ui/core';

import { useStepsStyles } from './styles/ScenarioComponentsStyles';
import Step from 'models/Step';
import StepScreenshot from './StepScreenshot';
import ScenarioStep from './ScenarioStep';

interface Props {
  scenarioId: string;
  title: string;
  steps: Step[];
}

const ScenarioSteps: FC<Props> = ({ scenarioId, title, steps }) => {
  const classes = useStepsStyles();

  return (

{title}

      <List>
        {steps.map(step => (

            <ScenarioStep scenarioId={scenarioId} step={step} />
            {step.embeddings && step.embeddings.map(embedding => <StepScreenshot key={embedding} screenshotPath={embedding} />)}

        ))}
      </List>

  );
};

export default ScenarioSteps;


text:
if [ ! -e ".provisioned" ]; then
	# Tools you can't live without
	apt-get update
	apt-get install -y build-essential git vim libtool autoconf

	# I can't stand emacs
	echo 'set -o vi' | sudo tee /etc/profile.d/vishell.sh

	touch .provisioned
fi


text:
'use strict';

const argv = require('minimist')(process.argv.slice(2));

const swm = require('./swm.js');
const config = require('./config.js');
const usage = require('./usage.js');

const postCmd = argv.postCmd || config.postCmd;
const profile = argv.profile || argv.p;

function connectionStatus(device) {
    return device.connected ? 'Connected' : 'Disconnected';
}

if (argv.help || argv.h) {
    console.log(usage);
    return;
} else if (argv.list || argv.l) {
    const devices = swm.getDevices((err, devices) => {
        if (err) {
            throw new Error(err);
        }
        console.log('Detected devices:\n');
        Object.keys(devices)
            .sort(key => !devices[key].connected)
            .forEach(key => console.log(key + ':', connectionStatus(devices[key])));
    });
} else {
    let selectedMonitors = argv._;

    if (profile) {
        if (!config.profiles[profile]) {
            console.error('profile', profile, 'not found in config');
            process.exit(1);
        }
        selectedMonitors = config.profiles[profile];
        console.log('Using profile', profile);
    }

    console.log('Switching on', selectedMonitors.length ? selectedMonitors : 'all connected monitors');

    swm.getDevices((err, devices) => {
        if (err) {
            throw new Error(err);
        }
        const xrandrOptions = swm.generateXrandrOptions(selectedMonitors, devices);
        swm.switchDevices(xrandrOptions);
        swm.executePostCmd(postCmd);
    });
}


text:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:sp="http://schemas.android.com/apk/res/com.weiwend.fooldelivery"
    android:layout_width="fill_parent"
    android:layout_height="match_parent"
    android:background="@color/white"
    android:orientation="vertical">

    <include layout="@layout/activity_title"/>

     <com.weiwend.fooldelivery.customviews.MyTitleTabView
          android:id="@+id/mTitleTabView"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_marginTop="@dimen/address_manager_title_margin_top"/>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <Button
	        android:id="@+id/mAddressAddBtn"
	        android:layout_alignParentBottom="true"
	        android:layout_width="match_parent"
	        android:layout_height="wrap_content"
	        android:text="@string/address_recipient_add"
	        android:textColor="@color/black"
	        android:textSize="@dimen/textsize_bigger"
	        android:visibility="gone"/>
        <com.handmark.pulltorefresh.library.PullToRefreshScrollView
	        xmlns:ptr="http://schemas.android.com/apk/res-auto"
	        android:id="@+id/mRefreshScrollview"
	        android:layout_width="fill_parent"
	        android:layout_height="fill_parent"
	        ptr:ptrAnimationStyle="flip">
	        <FrameLayout
	            android:layout_width="match_parent"
	            android:layout_height="match_parent"
	            android:layout_above="@id/mAddressAddBtn">
		        <com.weiwend.fooldelivery.customviews.DelSlideListView
					android:id="@+id/mSendAddressListView"
			        android:layout_width="match_parent"
			        android:layout_height="match_parent"
			        android:cacheColorHint="@color/listview_cache_color_hint"
			        android:drawSelectorOnTop="false"
			        android:listSelector="@null"
			        android:divider="@color/divider_line"
			        android:dividerHeight="@dimen/listview_divider_height"/>
			   <com.weiwend.fooldelivery.customviews.DelSlideListView
			        android:id="@+id/mRecipientAddressListView"
			        android:layout_width="match_parent"
			        android:layout_height="match_parent"
			        android:cacheColorHint="@color/listview_cache_color_hint"
			        android:divider="@color/divider_line"
			        android:dividerHeight="@dimen/listview_divider_height"/>
	        </FrameLayout>
	    </com.handmark.pulltorefresh.library.PullToRefreshScrollView>

    </RelativeLayout>

</LinearLayout>


text:
using Cauldron.UnitTest.Interceptors;
using Cauldron.UnitTest.Interceptors.Property;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace Cauldron.UnitTest.AssemblyValidation.TestClasses.Property
{
    public class Property_InvokeTest_Base : IProperty_Interceptor_Invoke
    {
        public bool OnExceptionInvoked { get; set; }
        public bool OnExitInvoked { get; set; }
        public bool OnGetInvoked { get; set; }
        public bool OnSetInvoked { get; set; }

        [TestCleanup]
        public void CleanUp()
        {
            this.OnExceptionInvoked = false;
            this.OnGetInvoked = false;
            this.OnSetInvoked = false;
            this.OnExitInvoked = false;
        }

        public void OnException(Exception e)
        {
            this.OnExceptionInvoked = true;
        }

        public void OnExit()
        {
            this.OnExitInvoked = true;
        }

        public void OnGet(string name, object value)
        {
            this.OnGetInvoked = true;
        }

        public void OnSet(string name, object oldValue, object newValue)
        {
            this.OnSetInvoked = true;
        }

        protected void AssertException(Action action)
        {
            try
            {
                action();
            }
            catch (InvokedException)
            {
                Assert.IsTrue(this.OnExceptionInvoked, "The exception was not invoked");
            }

            Assert.IsTrue(this.OnExitInvoked, "The exit was not invoked");
            Assert.IsFalse(this.OnGetInvoked, "onget was invoked");
            Assert.IsFalse(this.OnSetInvoked, "onset was invoked");
        }

        protected void AssertException<T>(Func<T> action)
        {
            try
            {
                T value = action();
            }
            catch (InvokedException)
            {
                Assert.IsTrue(this.OnExceptionInvoked, "The exception was not invoked");
            }

            Assert.IsTrue(this.OnExitInvoked, "The exit was not invoked");
            Assert.IsFalse(this.OnGetInvoked, "onget was invoked");
            Assert.IsFalse(this.OnSetInvoked, "onset was invoked");
        }

        protected void AssertGetter()
        {
            Assert.IsTrue(this.OnGetInvoked, "on get was not invoked");
            Assert.IsTrue(this.OnExitInvoked, "The exit was not invoked");
            Assert.IsFalse(this.OnExceptionInvoked, "The exception was invoked");
            Assert.IsFalse(this.OnSetInvoked, "onset was invoked");
        }

        protected void AssertNoSetter<T>(Func<T> propertyGet, Action<T> propertySet, T value)
        {
            var oldValue = propertyGet();
            propertySet(value);

            Assert.IsTrue(this.OnGetInvoked, "on get was not invoked");
            Assert.IsTrue(this.OnSetInvoked, "on get was not invoked");
            Assert.IsTrue(this.OnExitInvoked, "The exit was not invoked");
            Assert.IsFalse(this.OnExceptionInvoked, "The exception was invoked");

            Assert.AreNotEqual(oldValue, value);
        }

        protected void AssertSetter()
        {
            Assert.IsTrue(this.OnSetInvoked, "on get was not invoked");
            Assert.IsTrue(this.OnExitInvoked, "The exit was not invoked");
            Assert.IsFalse(this.OnExceptionInvoked, "The exception was invoked");
            Assert.IsFalse(this.OnGetInvoked, "onget was invoked");
        }
    }
}


text:
% ReadSegyFast : Reads a SEG Y rev 1 formatted file, without header values (faster than ReadSegy)
%
% Call :
% [Data]=ReadSegyFast(filename);
% and equivalent to :
% [Data]=ReadSegy(filename);
%
%
% Read only the data of a SegFile - NOT Their headers.
% Much faster than ReadSegy
%
% 'minmax', 'skip'
%

% Implemented using the syntax of the SEG-Y revised format :
% SEGY-Y rev 0, SEG-Y rev 1 as described in
% http://seg.org/publications/tech-stand/
%
% Extended Textual Header is not yet tested
% If you would like it implemented, please send me an SEGY file with
% that sort of information, as well as a description of the segy file
%
%
% (C) 2001, Thomas Mejer Hansen, thomas@cultpenguin.com
%
%    This program is free software; you can redistribute it and/or modify
%    it under the terms of the GNU General Public License as published by
%    the Free Software Foundation; either version 2 of the License, or
%    (at your option) any later version.
%
%    This program is distributed in the hope that it will be useful,
%    but WITHOUT ANY WARRANTY; without even the implied warranty of
%    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%    GNU General Public License for more details.
%
%    You should have received a copy of the GNU General Public License
%    along with this program; if not, write to the Free Software
%    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
%
%
%
%
function [Data]=ReadSegyFast(filename,varargin);

  mfilename='ReadSegyFast';

  if nargin==0,
    SegymatVerbose([mfilename,' : ', filename,' does not exist !'])
    Data=[];SegyTraceHeaders=[];SegyHeader=[];HeaderInfo=[];
    return
  end

  % Initialize varargin values
  dsf=[];
  revision=[];
  endian_tight=[];
  tmin=[];tmax=[];
  headermin=[];headermax=[];header=[];
  jump=[];
  SegyHeader=[];

  segyid = fopen(filename,'r','b');   % ALL DISK FILES ARE IN BIG
                                    % ENDIAN FORMAT, ACCORDING TO SEG
                                    % Y rev 1

  fseek(segyid,0,'eof');
  BytesInFile = ftell(segyid);
  fseek(segyid,0,'bof');

ninput=nargin;
% NEXT TWO LINES TO ENUSRE THAT VARARGIN CAN BE PASSED TO FUNCTION
if ninput==2
    % CALL USING VARARGIN
    ninput=1+length(varargin{1});
    varargin=varargin{1};
else
    % DIRECT CALL
    ninput=length(varargin);
end

% TRANSFORM VARARGING INTO PARAMETERS
cargin=1;
while (cargin<ninput)

    if strcmp(varargin{cargin},'jump')
       cargin=cargin+1;
       eval(['jump=',num2str(varargin{cargin}),';']);
       SegymatVerbose(['JUMP : Read only every ',num2str(jump),'th trace'])
    end

    if strcmp(varargin{cargin},'minmax')
       cargin=cargin+1;
       eval(['header=''',varargin{cargin},''';']);
       cargin=cargin+1;
       eval(['headermin=',num2str(varargin{cargin}),';']);
       cargin=cargin+1;
       eval(['headermax=',num2str(varargin{cargin}),';']);
       SegymatVerbose(['MIN MAX : Using header ',header,' from ',num2str(headermin),' to ',num2str(headermax)])
    end

    if strcmp(varargin{cargin},'trange')
       cargin=cargin+1;
       eval(['tmin=',num2str(varargin{cargin}),';']);
       cargin=cargin+1;
       eval(['tmax=',num2str(varargin{cargin}),';']);
       SegymatVerbose(['TRANGE : tmin=',num2str(tmin),' tmax=',num2str(tmax)])
    end

    if strcmp(varargin{cargin},'revision')
       cargin=cargin+1;
       eval(['revision=',num2str(varargin{cargin}),';']);
       SegymatVerbose(['USING REVISION : rev=',num2str(revision)])
    end

    if strcmp(varargin{cargin},'dsf')
       cargin=cargin+1;
       eval(['dsf=',num2str(varargin{cargin}),';']);
       SegymatVerbose(['USING Data Sample Format : dsf=',num2str(dsf)])
    end

    if strcmp(varargin{cargin},'SegyHeader')
       cargin=cargin+1;
       SegyHeader=varargin{cargin};
       SegymatVerbose(['USING LOADED SEGYHEADER'])
    end

    cargin=cargin+1;

end

% SKIP DATA SEEMS OUTDATED, COMMENTING OUT 2003-10-24

%if exist('SkipData')==0,
%    SkipData=0; % [0] READ ONLY HEADER VALUES, [1] READ IN ALL DATA
%end%%
%
%if SkipData==1, SegymatVerbose(['Not reading data - headers only']), end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% BINARY HEADERS
if isempty(SegyHeader)==1,
  SegyHeader=GetSegyHeader(segyid);
else
  SegymatVerbose([mfilename,' - Using supplied SegyHeader'])
end

% APPLY CHANGES TO SEGY HEADER IF NEEDE
if isempty(revision)==0,
  SegyHeader.SegyFormatRevisionNumber=revision;
  SegymatVerbose([mfilename,' - Manually set SEG-Y revision to ',num2str(revision)])
end
if isempty(dsf)==0,
  SegyHeader.DataSampleFormat=dsf;
end

% JUST SOME INFORMATION TO WRITE TO SCREEN :

Revision=SegyHeader.SegyFormatRevisionNumber;
if Revision>0, Revision=1; end
FormatName=SegyHeader.Rev(Revision+1).DataSampleFormat(SegyHeader.DataSampleFormat).name;
Format=SegyHeader.Rev(Revision+1).DataSampleFormat(SegyHeader.DataSampleFormat).format;
BPS=SegyHeader.Rev(Revision+1).DataSampleFormat(SegyHeader.DataSampleFormat).bps;
txt=['SegyRevision ',sprintf('%0.4g',Revision),', ',FormatName,'(',num2str(SegyHeader.DataSampleFormat),')'];

ns=SegyHeader.ns;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% READ TEXTURAL FILE HEADER EXTENSION IF NEEDED
%if SegyHeader.NumberOfExtTextualHeaders~=0
%  SegymatVerbose(['---------------------------------------------------'])
%  SegymatVerbose(['extendeD textual file headers are not supported yet'])
%  SegymatVerbose(['They are simply skipped'])
%  SegymatVerbose(['---------------------------------------------------'])
%end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% READ DATA
%Segy=fread(segyid,4000,'float32');
fseek(segyid,0,'eof'); DataEnd=ftell(segyid);

DataStart=3600+3200*SegyHeader.NumberOfExtTextualHeaders;
fseek(segyid,DataStart,'bof');       % Go to the beginning of the file

ntraces=(DataEnd-DataStart)./(240+(SegyHeader.ns)*(BPS/8));

SegymatVerbose(['Number of Samples Per Trace=',num2str(SegyHeader.ns)])
SegymatVerbose(['Number of Traces=',num2str(ntraces)])

% Set Format :
Revision=SegyHeader.SegyFormatRevisionNumber;
if Revision>0, Revision=1; end
Format=SegyHeader.Rev(Revision+1).DataSampleFormat(SegyHeader.DataSampleFormat).format;
bitpersample=SegyHeader.Rev(Revision+1).DataSampleFormat(SegyHeader.DataSampleFormat).bps;
bytepersample=bitpersample/8;
ntraceheader=240/bytepersample;

Data=fread(segyid,[ns+ntraceheader ntraces],Format);
Data=Data([ntraceheader+1:1:ns+ntraceheader],:);
%SegymatVerbose(['Now=',num2str(ftell(segyid)),' END=',num2str(DataEnd)])

% THE FOLLOWING DOES NOT WORK FOR OCTAVE (uint32)
if (strcmp(Format,'uint32')==1), % IBM FLOATING POINT
        % CONVERT FROM FLOATING POINT
        verbose=1;
        if verbose>1, SegymatVerbose([mfilename,'Converting from IBM, DataFormat :',SegyHeader.DataFormat]); end
        Data=ibm2num(uint32(Data));
end;

existJump=1-isempty(jump);
existHeader=1-isempty(header);
existTmin=1-isempty(tmin);
existTmax=1-isempty(tmax);

if existJump
  usetraces=[jump:jump:ntraces];
  ntraces=length(usetraces);
  Data=Data(:,usetraces);
end

if (existTmin==1)&(existTmax==1)
  SegymatVerbose('TRANGE')
  % NEXT LINE SHOULD CONSIDER THAT ns in Trace and Segy Header could vary !!!
  origtrange=[1:1:SegyHeader.ns].*SegyHeader.dt.*1e-6;
  gooddata=find(origtrange>tmin & origtrange<tmax);
  Data=Data(gooddata,:);
end


text:
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.flatpages import views
from django.contrib.auth.decorators import login_required as auth
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from links.views import HomeListView, SearchJaryanaks
from links.views import LinkCreateView, LinkDetailView, LinkUpdateView, LinkDeleteView
from links.views import TextCreateView, TextDetailView, TextUpdateView, TextDeleteView
from links.views import JaryanakCreateView, JaryanakListView, JaryanakUpdateView, JaryanakDetailView, JReportsView
from links.views import UserProfileDetailView, UserProfileEditView, UserProfileInvitations, UserProfileReports, FollowView
from links.views import AllReportsView

from links.models import Link, Text
from comments.models import ThreadedComment
# from votes.views import vote_on_object, vote_on_comment

urlpatterns = [
    url(r'^$', HomeListView.as_view(), name='home'),

    url(r'^admin/', include(admin.site.urls)),
    url(r'^manageeallreports/$', auth(AllReportsView.as_view()), name='all_reports_manager'),

    url(r'^accounts/', include('registration.backends.simple.urls')),
    url(r'^users/(?P<slug>\w+)/$', UserProfileDetailView.as_view(), name="profile"),
    url(r'^profile/edit/$', auth(UserProfileEditView.as_view()), name="edit_profile"),
    url(r'^profile/(?P<slug>\w+)/invitations/$', auth(UserProfileInvitations.as_view()), name="profile_invites"),
    url(r'^profile/(?P<slug>\w+)/reports/$', auth(UserProfileReports.as_view()), name="profile_reports"),

    url(r'^login/$', "django.contrib.auth.views.login", {"template_name": "login.html"}, name="login"),
    url(r'^logout/$', "django.contrib.auth.views.logout_then_login", name="logout"),

    url(r'^j/list/$', JaryanakListView.as_view(), name='jaryanak'),
    url(r'^j/create/$', auth(JaryanakCreateView.as_view()), name='jaryanak_create'),
    url(r'^j/(?P<pk>\d+)/(?P<slug>[-\w\d\_]+)/$', JaryanakDetailView.as_view(), name='jaryanak_detail'),
    url(r'^j/update/(?P<pk>\d+)/$', auth(JaryanakUpdateView.as_view()), name='jaryanak_update'),
    url(r'^j/(?P<pk>\d+)/reports$', auth(JReportsView.as_view()), name='j_reports'),

    url(r'^links/create/$', auth(LinkCreateView.as_view()), name='link_create'),
    url(r'^links/(?P<pk>\d+)/(?P<slug>[-\w\d\_]+)/$', LinkDetailView.as_view(), name='link_detail'),
    url(r'^links/update/(?P<pk>\d+)/$', auth(LinkUpdateView.as_view()), name='link_update'),
    url(r'^links/delete/(?P<pk>\d+)/$', auth(LinkDeleteView.as_view()), name='link_delete'),

    url(r'^texts/create/$', auth(TextCreateView.as_view()), name='text_create'),
    url(r'^texts/(?P<pk>\d+)/(?P<slug>[-\w\d\_]+)/$', TextDetailView.as_view(), name='text_detail'),
    url(r'^texts/update/(?P<pk>\d+)/$', auth(TextUpdateView.as_view()), name='text_update'),
    url(r'^texts/delete/(?P<pk>\d+)/$', auth(TextDeleteView.as_view()), name='text_delete'),

    # url(r'^vote/$', vote_on_object, name='vote_link'),
    # url(r'^texts/(?P<object_id>\d+)/(?P<direction>up|down|clear)vote/?$', vote_on_object, text_dict, name='vote_text'),
    # url(r'^comments/(?P<object_id>\d+)/(?P<direction>up|down|clear)vote/?$', vote_on_comment, comment_dict, name='comment-vote'),
    # url(r'^vote/$', vote_on_object, widget_dict, name='vote'),
    # url(r'^vote/$', auth(VoteFormView.as_view()), {"template_name": None}, name='vote'),

    url(r'^invite/', include('invitations.urls')),
    url(r'^comments/', include('comments.urls')),
    url(r'^report/', include('flags.urls')),
    url(r'^vote/', include('votes.urls')),
    url(r'^follow/jaryank/(?P<pk>\d+)/(?P<slug>[-\w\d\_]+)/$', FollowView, name='follow'),

    url(r'^blog/', include('blog.urls')),
    url(r'^markdown/', include('django_markdown.urls')),
    url(r'^search/$', SearchJaryanaks, name='search'),

    url(r'^about/$', views.flatpage, {'url': '/about/'}, name='about'),
    url(r'^rules/$', views.flatpage, {'url': '/rules/'}, name='rules'),

    # url(r'^tags/$', TagsListView.as_view(), name='tags'),
    # url(r'^tag/(?P<slug>[-\w\d]+)/$', TagsDetailView.as_view(), name='tag_detail'),
    # url(r'^category/(?P<slug>[-\w\d]+)/$', CategoryDetailView.as_view(), name='category_detail'),
]

urlpatterns += staticfiles_urlpatterns()
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

# link_dict = {
#     'model': Link,
# }

# text_dict = {
#     'model': Text,
#     'template_object_name': None,
#     'allow_xmlhttprequest': True,
# }

# comment_dict = {
#     'model': ThreadedComment,
#     'template_object_name': 'home',
#     'allow_xmlhttprequest': True,
# }


text:
//
//  This file was auto-generated using the ChilliConnect SDK Generator.
//
//  The MIT License (MIT)
//
//  Copyright (c) 2015 Tag Games Ltd
//
//  Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to deal
//  in the Software without restriction, including without limitation the rights
//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//  copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
//
//  The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
//
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.
//

@import Foundation;

#import "ForwardDeclarations.h"

NS_ASSUME_NONNULL_BEGIN

/*!
 A mutable description of a CCGetCurrencyBalanceRequest.

 This is not thread-safe and should typically only be used to create new instances
 of CCGetCurrencyBalanceRequest.
 */
@interface CCGetCurrencyBalanceRequestDesc : NSObject

/// An array list of currency Keys to return balances for. If empty the players
/// balance will be returned for each currency in the economy.
@property (nonatomic, nullable) NSArray *keys;

/*!
 A convenience factory method for creating new instances of CCGetCurrencyBalanceRequestDesc.

 @return The new instance.
 */
+ (instancetype)getCurrencyBalanceRequestDesc;

/*!
 Initialises the description.

 @return The initialised description.
 */
- (instancetype)init NS_DESIGNATED_INITIALIZER;

@end

NS_ASSUME_NONNULL_END