text:
<!DOCTYPE html>

<html lang="en" ng-app="myApp" class="no-js">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>My AngularJS App</title>
  <meta name="description" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="bower_components/html5-boilerplate/css/normalize.css">
  <link rel="stylesheet" href="bower_components/html5-boilerplate/css/main.css">
  <link rel="stylesheet" href="app.css">
  <link rel="stylesheet" href="blog.css">
  <script src="bower_components/html5-boilerplate/js/vendor/modernizr-2.6.2.min.js"></script>
</head>
<body>
  <div ng-view></div>

  <script src="bower_components/angular/angular.js"></script>
  <script src="http://code.angularjs.org/1.2.6/angular.js"></script>
  <script src="bower_components/angular-route/angular-route.js"></script>
<script src="https://cdn.firebase.com/js/client/2.0.4/firebase.js"></script>
  <script src="https://cdn.firebase.com/js/simple-login/1.6.2/firebase-simple-login.js"></script>
<script src="https://cdn.firebase.com/libs/angularfire/0.9.0/angularfire.min.js"></script>
  <script src="app.js"></script>
  <script src="home/home.js"></script>
  <script src="register/register.js"></script>
  <script src="welcome/welcome.js"></script>
  <script src="addPost/addPost.js"></script>
  <script src="components/version/version.js"></script>
  <script src="components/version/version-directive.js"></script>
  <script src="components/version/interpolate-filter.js"></script>
</body>
</html>


text:
#include "UEPyIStructureDetailsView.h"

#if WITH_EDITOR

#include "Editor/PropertyEditor/Public/PropertyEditorModule.h"
#include "UEPySWidget.h"
#include "Editor/PropertyEditor/Public/IDetailsView.h"

static PyObject *ue_PyIStructureDetailsView_str(ue_PyIStructureDetailsView *self)
{
#if PY_MAJOR_VERSION >= 3
	return PyUnicode_FromFormat("<unreal_engine.%s '%p' (slate ref count: %d, py ref count: %d)>",
		TCHAR_TO_UTF8(*self->istructure_details_view->GetWidget()->GetTypeAsString()),
		self->istructure_details_view->GetWidget().Get(),
		self->istructure_details_view->GetWidget().GetSharedReferenceCount(),
		self->ob_base.ob_refcnt);
#else
	return PyUnicode_FromFormat("<unreal_engine.%s '%p' (slate ref count: %d)>",
		TCHAR_TO_UTF8(*self->istructure_details_view->GetWidget()->GetTypeAsString()),
		self->istructure_details_view->GetWidget().Get(),
		self->istructure_details_view->GetWidget().GetSharedReferenceCount());
#endif
}

static PyObject *py_ue_istructure_details_view_set_structure_data(ue_PyIStructureDetailsView *self, PyObject * args, PyObject *kwargs)
{
	PyObject *py_object = nullptr;
	PyObject *py_force_refresh = nullptr;

	char *kwlist[] = {
		(char *)"struct_data",
		(char *)"force_refresh",
		nullptr
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|O:set_structure_data", kwlist, &py_object, &py_force_refresh))
	{
		return nullptr;
	}

	ue_PyUScriptStruct *ue_py_struct = py_ue_is_uscriptstruct(py_object);
	if (!ue_py_struct)
	{
		return PyErr_Format(PyExc_Exception, "argument is not a UScriptStruct");
	}

	Py_XDECREF(self->ue_py_struct);
	self->ue_py_struct = ue_py_struct;
	Py_INCREF(self->ue_py_struct);
	TSharedPtr<FStructOnScope> struct_scope = MakeShared<FStructOnScope>(ue_py_struct->u_struct, ue_py_struct->u_struct_ptr);
	FPropertyEditorModule& PropertyEditorModule = FModuleManager::GetModuleChecked<FPropertyEditorModule>("PropertyEditor");
	self->istructure_details_view->SetStructureData(struct_scope);

#if ENGINE_MINOR_VERSION > 17
	if (py_force_refresh && PyObject_IsTrue(py_force_refresh))
	{
		self->istructure_details_view->GetDetailsView()->ForceRefresh();
}
#endif

	Py_RETURN_NONE;
}

static PyObject *py_ue_istructure_details_view_get_widget(ue_PyIStructureDetailsView *self, PyObject * args)
{

	TSharedPtr<SWidget> ret_widget = self->istructure_details_view->GetWidget();
	if (!ret_widget.IsValid())
	{
		return PyErr_Format(PyExc_Exception, "unable to create SingleProperty widget");
	}

	return (PyObject *)py_ue_new_swidget<ue_PySWidget>(ret_widget->AsShared(), &ue_PySWidgetType);

	Py_RETURN_NONE;
}

static PyMethodDef ue_PyIStructureDetailsView_methods[] = {
#pragma warning(suppress: 4191)
	{ "set_structure_data", (PyCFunction)py_ue_istructure_details_view_set_structure_data, METH_VARARGS | METH_KEYWORDS, "" },
	{ "get_widget", (PyCFunction)py_ue_istructure_details_view_get_widget, METH_VARARGS, "" },
	{ NULL }  /* Sentinel */
};

static void ue_PyIStructureDetailsView_dealloc(ue_PyIStructureDetailsView *self)
{
#if defined(UEPY_MEMORY_DEBUG)
	UE_LOG(LogPython, Warning, TEXT("Destroying ue_PyIStructureDetailsView %p mapped to IStructureDetailsView %p"), self, self->istructure_details_view.Get());
#endif
	Py_DECREF(self->ue_py_struct);
	Py_TYPE(self)->tp_free((PyObject *)self);
}

PyTypeObject ue_PyIStructureDetailsViewType = {
	PyVarObject_HEAD_INIT(NULL, 0)
	"unreal_engine.IStructureDetailsView", /* tp_name */
	sizeof(ue_PyIStructureDetailsView), /* tp_basicsize */
	0,                         /* tp_itemsize */
	(destructor)ue_PyIStructureDetailsView_dealloc,       /* tp_dealloc */
	0,                         /* tp_print */
	0,                         /* tp_getattr */
	0,                         /* tp_setattr */
	0,                         /* tp_reserved */
	0,                         /* tp_repr */
	0,                         /* tp_as_number */
	0,                         /* tp_as_sequence */
	0,                         /* tp_as_mapping */
	0,                         /* tp_hash  */
	0,                         /* tp_call */
	(reprfunc)ue_PyIStructureDetailsView_str,                         /* tp_str */
	0,                         /* tp_getattro */
	0,                         /* tp_setattro */
	0,                         /* tp_as_buffer */
	Py_TPFLAGS_DEFAULT,        /* tp_flags */
	"Unreal Engine IStructureDetailsView",           /* tp_doc */
	0,                         /* tp_traverse */
	0,                         /* tp_clear */
	0,                         /* tp_richcompare */
	0,                         /* tp_weaklistoffset */
	0,                         /* tp_iter */
	0,                         /* tp_iternext */
	ue_PyIStructureDetailsView_methods,             /* tp_methods */
};

static int ue_py_istructure_details_view_init(ue_PyIStructureDetailsView *self, PyObject *args, PyObject *kwargs)
{

	PyObject *py_object = nullptr;

	PyObject *py_allow_search = nullptr;
	PyObject *py_update_from_selection = nullptr;
	PyObject *py_lockable = nullptr;
	char     *py_name_area_settings = nullptr;
	PyObject *py_hide_selection_tip = nullptr;
	PyObject *py_search_initial_key_focus = nullptr;

	char *kwlist[] = {
		(char*)"struct_data",
		(char *)"allow_search",
		(char *)"update_from_selection",
		(char *)"lockable",
		(char *)"name_area_settings",
		(char *)"hide_selection_tip",
		(char *)"search_initial_key_focus",
		nullptr };

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OOOOsOO:__init__", kwlist,
		&py_object, &py_allow_search, &py_update_from_selection, &py_lockable, &py_name_area_settings, &py_hide_selection_tip, &py_search_initial_key_focus))
	{
		return -1;
	}

	ue_PyUScriptStruct *ue_py_struct = py_ue_is_uscriptstruct(py_object);
	if (!ue_py_struct)
	{
		PyErr_SetString(PyExc_Exception, "argument is not a UScriptStruct");
		return -1;
	}

	FDetailsViewArgs view_args;
	view_args.bAllowSearch = (py_allow_search) ? PyObject_IsTrue(py_allow_search) : view_args.bAllowSearch;
	view_args.bUpdatesFromSelection = (py_update_from_selection) ? PyObject_IsTrue(py_update_from_selection) : view_args.bUpdatesFromSelection;
	view_args.bLockable = (py_lockable) ? PyObject_IsTrue(py_lockable) : view_args.bLockable;
	view_args.bHideSelectionTip = (py_hide_selection_tip) ? PyObject_IsTrue(py_hide_selection_tip) : view_args.bHideSelectionTip;
	view_args.bSearchInitialKeyFocus = (py_search_initial_key_focus) ? PyObject_IsTrue(py_search_initial_key_focus) : view_args.bSearchInitialKeyFocus;

	FString name_area_string = py_name_area_settings ? FString(UTF8_TO_TCHAR(py_name_area_settings)) : FString();
	view_args.NameAreaSettings = [&name_area_string]() {
		if (FCString::Stricmp(*name_area_string, TEXT("HideNameArea")) == 0) { return FDetailsViewArgs::ENameAreaSettings::HideNameArea; }
		else if (FCString::Stricmp(*name_area_string, TEXT("ObjectsUseNameArea")) == 0) { return FDetailsViewArgs::ENameAreaSettings::ObjectsUseNameArea; }
		else if (FCString::Stricmp(*name_area_string, TEXT("ActorsUseNameArea")) == 0) { return FDetailsViewArgs::ENameAreaSettings::ActorsUseNameArea; }
		else if (FCString::Stricmp(*name_area_string, TEXT("ComponentsAndActorsUseNameArea")) == 0) { return FDetailsViewArgs::ENameAreaSettings::ComponentsAndActorsUseNameArea; }
		else { return FDetailsViewArgs::ENameAreaSettings::ActorsUseNameArea; }
	}();
	FStructureDetailsViewArgs struct_view_args;
	{
		struct_view_args.bShowObjects = true;
		struct_view_args.bShowAssets = true;
		struct_view_args.bShowClasses = true;
		struct_view_args.bShowInterfaces = true;
	}
	new(&self->istructure_details_view) TSharedPtr<IStructureDetailsView>(nullptr);

	self->ue_py_struct = ue_py_struct;
	Py_INCREF(self->ue_py_struct);
	TSharedPtr<FStructOnScope> struct_scope = MakeShared<FStructOnScope>(ue_py_struct->u_struct, ue_py_struct->u_struct_ptr);
	FPropertyEditorModule& PropertyEditorModule = FModuleManager::GetModuleChecked<FPropertyEditorModule>("PropertyEditor");
	new(&self->istructure_details_view) TSharedRef<IStructureDetailsView>(PropertyEditorModule.CreateStructureDetailView(view_args, struct_view_args, struct_scope));

	return 0;
}

void ue_python_init_istructure_details_view(PyObject *ue_module)
{
	ue_PyIStructureDetailsViewType.tp_new = PyType_GenericNew;

	ue_PyIStructureDetailsViewType.tp_init = (initproc)ue_py_istructure_details_view_init;

	ue_PyIStructureDetailsViewType.tp_getattro = PyObject_GenericGetAttr;
	ue_PyIStructureDetailsViewType.tp_setattro = PyObject_GenericSetAttr;

	if (PyType_Ready(&ue_PyIStructureDetailsViewType) < 0)
		return;

	Py_INCREF(&ue_PyIStructureDetailsViewType);
	PyModule_AddObject(ue_module, "IStructureDetailsView", (PyObject *)&ue_PyIStructureDetailsViewType);
}

ue_PyIStructureDetailsView *py_ue_is_istructure_details_view(PyObject *obj)
{
	if (!PyObject_IsInstance(obj, (PyObject *)&ue_PyIStructureDetailsViewType))
		return nullptr;
	return (ue_PyIStructureDetailsView *)obj;
}
#endif

redpajama_set_name: RedPajamaGithub


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

namespace AutomatedLab
{
    /// <summary>
    /// This validator makes sure the required ISOs are present
    /// Azure DevOps Server 2019	Azure SQL Database, SQL Server 2017, SQL Server 2019,  SQL Server 2016 (minimum SP1)
    /// TFS 2018	SQL Server 2017
    /// SQL Server 2016 (minimum SP1)
    /// TFS 2017 Update 1	SQL Server 2016 (minimum SP1)
    /// SQL Server 2014
    /// TFS 2017	SQL Server 2016
    /// SQL Server 2014
    /// TFS 2015 Update 3	SQL Server 2016
    /// SQL Server 2014
    /// SQL Server 2012 (minimum SP1)
    /// TFS 2015	SQL Server 2014
    /// SQL Server 2012 (minimum SP1)
    /// </summary>
    public class TfsSqlIsosExist : LabValidator, IValidate
    {
        public TfsSqlIsosExist()
        {
            messageContainer = RunValidation();
        }

        public override IEnumerable<ValidationMessage> Validate()
        {
            var devopsRoles = ((Roles[])Enum.GetValues(typeof(AutomatedLab.Roles))).Where(r => Regex.IsMatch(r.ToString(), @"Tfs\d{4}|AzDevOps"));

            foreach (var role in devopsRoles)
            {
                var machines = lab.Machines.Where(m => m.Roles.Where(r => r.Name == role).Count() > 0 && !m.SkipDeployment);
                if (machines.Count() == 0) continue;

                List<string> sqlmachines = new List<string>();
                List<string> requiredRoles = new List<string>();
                switch (role)
                {
                    case Roles.Tfs2015:
                        requiredRoles.Add("2014");
                        sqlmachines.AddRange(lab.Machines.Where(m => m.Roles.Where(r => r.Name == Roles.SQLServer2014).Count() > 0).Select(m => m.Name));
                        break;
                    case Roles.Tfs2017:
                        requiredRoles.Add("2014");
                        requiredRoles.Add("2016");
                        sqlmachines.AddRange(lab.Machines.Where(m => m.Roles.Where(r => r.Name == Roles.SQLServer2014 || r.Name == Roles.SQLServer2016).Count() > 0).Select(m => m.Name));
                        break;
                    case Roles.Tfs2018:
                        requiredRoles.Add("2017");
                        sqlmachines.AddRange(lab.Machines.Where(m => m.Roles.Where(r => r.Name == Roles.SQLServer2017).Count() > 0).Select(m => m.Name));
                        break;
                    case Roles.AzDevOps:
                        requiredRoles.Add("2017");
                        requiredRoles.Add("2019");
                        sqlmachines.AddRange(lab.Machines.Where(m => m.Roles.Where(r => r.Name == Roles.SQLServer2017 || r.Name == Roles.SQLServer2019).Count() > 0).Select(m => m.Name));
                        break;
                    default:
                        break;
                }

                if (sqlmachines.Count() == 0)
                {
                    yield return new ValidationMessage
                    {
                        Message = string.Format("There is no fitting SQL server for TFS/DevOps server role '{0}' defined. {0} requires SQL roles {1}", role.ToString(), string.Join(",", requiredRoles.ToArray())),
                        Type = MessageType.Error,
                        TargetObject = role.ToString()
                    };
                }
            }
        }
    }
}


text:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model common\models\ticket\Order */
/* @var $form yii\widgets\ActiveForm */
?>

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'TicketID')->textInput() ?>

    <?= $form->field($model, 'UserID')->textInput() ?>

    <?= $form->field($model, 'Count')->textInput() ?>

    <?= $form->field($model, 'Sum')->textInput() ?>

    <?= $form->field($model, 'Name')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'LastName')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'Email')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'Phone')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'Street')->textarea(['rows' => 6]) ?>

    <?= $form->field($model, 'House')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'Apartment')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'Note')->textarea(['rows' => 6]) ?>

    <?= $form->field($model, 'DateTime')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'Unviewed')->textInput() ?>

        <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>

    <?php ActiveForm::end(); ?>


text:
ALTER TABLE pipelines ADD COLUMN var_sources text,
                      ADD COLUMN nonce text;


text:
using System.Xml;
using UAOOI.Configuration.Core;

namespace UAOOI.Configuration.DataBindings.UnitTest
{
  /// <summary>
  /// Class NodeDescriptor provides test implementation of the <see cref="INodeDescriptor"/>
  /// </summary>
  internal class NodeDescriptor : NodeDescriptorBase
  {

    /// <summary>
    /// Gets the test instance.
    /// </summary>
    /// <returns>NodeDescriptor.</returns>
    internal static NodeDescriptor GetTestInstance()
    {
      return new NodeDescriptor()
      {
        NodeIdentifier = GetDefaultNodeIdentifier(),
        BindingDescription = "BindingDescription",
        DataType = new XmlQualifiedName("DataType", "NameSpace"),
        InstanceDeclaration = false,
        NodeClass = InstanceNodeClassesEnum.Object,

      };
    }
    internal static XmlQualifiedName GetDefaultNodeIdentifier()
    {
      return new XmlQualifiedName("NodeIdentifier", "NodeIdentifierNS");
    }

    private NodeDescriptor() { }

  }
}


text:
/* ----------------------------------------------------------------------------
 * "THE BEER-WARE LICENSE" (Revision 42) (by Poul-Henning Kamp):
 * <joerg@FreeBSD.ORG> wrote this file.  As long as you retain this notice you
 * can do whatever you want with this stuff. If we meet some day, and you think
 * this stuff is worth it, you can buy me a beer in return.        Joerg Wunsch
 * ----------------------------------------------------------------------------
 *
 * $FreeBSD$
 */

#include <stdint.h>
#include <libusb20.h>

const char *usb_error(enum libusb20_error r);
void print_formatted(uint8_t *buf, uint32_t len);


text:
'use strict';

var _inherits = require('babel-runtime/helpers/inherits')['default'];

var _classCallCheck = require('babel-runtime/helpers/class-call-check')['default'];

var _extends = require('babel-runtime/helpers/extends')['default'];

var _objectWithoutProperties = require('babel-runtime/helpers/object-without-properties')['default'];

var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default'];

exports.__esModule = true;

var _classnames = require('classnames');

var _classnames2 = _interopRequireDefault(_classnames);

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _warning = require('warning');

var _warning2 = _interopRequireDefault(_warning);

var ResponsiveEmbed = (function (_React$Component) {
  _inherits(ResponsiveEmbed, _React$Component);

  function ResponsiveEmbed() {
    _classCallCheck(this, ResponsiveEmbed);

    _React$Component.apply(this, arguments);
  }

  ResponsiveEmbed.prototype.render = function render() {
    var _props = this.props;
    var bsClass = _props.bsClass;
    var className = _props.className;
    var a16by9 = _props.a16by9;
    var a4by3 = _props.a4by3;
    var children = _props.children;

    var props = _objectWithoutProperties(_props, ['bsClass', 'className', 'a16by9', 'a4by3', 'children']);

    process.env.NODE_ENV !== 'production' ? _warning2['default'](!(!a16by9 && !a4by3), '`a16by9` or `a4by3` attribute must be set.') : undefined;
    process.env.NODE_ENV !== 'production' ? _warning2['default'](!(a16by9 && a4by3), 'Either `a16by9` or `a4by3` attribute can be set. Not both.') : undefined;

    var aspectRatio = {
      'embed-responsive-16by9': a16by9,
      'embed-responsive-4by3': a4by3
    };

    return _react2['default'].createElement(
      'div',
      { className: _classnames2['default'](bsClass, aspectRatio) },
      _react.cloneElement(children, _extends({}, props, {
        className: _classnames2['default'](className, 'embed-responsive-item')
      }))
    );
  };

  return ResponsiveEmbed;
})(_react2['default'].Component);

ResponsiveEmbed.defaultProps = {
  bsClass: 'embed-responsive',
  a16by9: false,
  a4by3: false
};

ResponsiveEmbed.propTypes = {
  /**
   * bootstrap className
   * @private
   */
  bsClass: _react.PropTypes.string,
  /**
   * This component accepts only one child element
   */
  children: _react.PropTypes.element.isRequired,
  /**
   * 16by9 aspect ratio
   */
  a16by9: _react.PropTypes.bool,
  /**
   * 4by3 aspect ratio
   */
  a4by3: _react.PropTypes.bool
};

exports['default'] = ResponsiveEmbed;
module.exports = exports['default'];


text:
package org.eclipse.test.internal.performance.results.utils;

/**
 * Interface to define all constants used for performances.
 */
public interface IPerformancesConstants {
    public static final String PLUGIN_ID = "org.eclipse.test.performance.ui"; //$NON-NLS-1$

	public static final String PREFIX = PLUGIN_ID + "."; //$NON-NLS-1$

	// State constants
    public static final String PRE_FILTER_BASELINE_BUILDS = PREFIX + "filter.baseline.builds"; //$NON-NLS-1$
    public static final String PRE_FULL_LINE_SELECTION  = PREFIX + "full.line.selection"; //$NON-NLS-1$
    public static final String PRE_WRITE_RESULTS_DIR = PREFIX + "write.results.dir"; //$NON-NLS-1$

	// Preference constants
    public static final String PRE_ECLIPSE_VERSION = PREFIX + "eclipse.version"; //$NON-NLS-1$
    public static final String PRE_DATABASE_CONNECTION = PREFIX + "database.connection"; //$NON-NLS-1$
    public static final String PRE_DATABASE_LOCAL = PREFIX + "local"; //$NON-NLS-1$
    public static final String PRE_DATABASE_LOCATION = PREFIX + "database.location"; //$NON-NLS-1$
    public static final String PRE_LOCAL_DATA_DIR = PREFIX + "local.data.dir"; //$NON-NLS-1$
    public static final String PRE_RESULTS_GENERATION_DIR = PREFIX + "results.generation.dir"; //$NON-NLS-1$
    public static final String PRE_CONFIG_DESCRIPTOR_NAME = PREFIX + "config.descriptor.name"; //$NON-NLS-1$
    public static final String PRE_CONFIG_DESCRIPTOR_DESCRIPTION = PREFIX + "config.descriptor.description"; //$NON-NLS-1$
    public static final String PRE_LAST_BUILD = PREFIX + "last.build"; //$NON-NLS-1$
    public static final String PRE_DEFAULT_DIMENSION = PREFIX + "default.dimension"; //$NON-NLS-1$
    public static final String PRE_RESULTS_DIMENSION = PREFIX + "results.dimension"; //$NON-NLS-1$
    public static final String PRE_MILESTONE_BUILDS = PREFIX + "milestone.builds"; //$NON-NLS-1$
    public static final String PRE_STATUS_COMMENT_PREFIX = PREFIX + "status.comment"; //$NON-NLS-1$
    public static final String PRE_FILTER_ADVANCED_SCENARIOS = PREFIX + "filter.non.fingerprints.scenarios"; //$NON-NLS-1$
    public static final String PRE_FILTER_OLD_BUILDS = PREFIX + "filter.non.milestones.builds"; //$NON-NLS-1$
    public static final String PRE_FILTER_NIGHTLY_BUILDS = PREFIX + "filter.nightly.builds"; //$NON-NLS-1$
    public static final String PRE_FILTER_LAST_BUILDS = PREFIX + "filter.last.builds"; //$NON-NLS-1$

	// Other constants
	public static final int ECLIPSE_MAINTENANCE_VERSION = 35;
	public static final int ECLIPSE_DEVELOPMENT_VERSION = 36;

	// Default values
	public static final String DATABASE_NAME_PREFIX = "perfDb";
	public static final String NETWORK_DATABASE_LOCATION = "net://minsky.ottawa.ibm.com:1528";
	public static final int DEFAULT_ECLIPSE_VERSION = ECLIPSE_DEVELOPMENT_VERSION;
	public static final boolean DEFAULT_FILTER_ADVANCED_SCENARIOS = true;
	public static final boolean DEFAULT_FILTER_OLD_BUILDS = false;
	public static final boolean DEFAULT_FILTER_LAST_BUILDS = false;
	public static final boolean DEFAULT_FILTER_NIGHTLY_BUILDS = false;
	public static final boolean DEFAULT_DATABASE_CONNECTION = false;
	public static final boolean DEFAULT_DATABASE_LOCAL = false;

	// Status
    public static final String PRE_WRITE_STATUS = PREFIX + "write.status"; //$NON-NLS-1$
	public static final int STATUS_BUILDS_NUMBER_MASK= 0x00FF;
	public static final int DEFAULT_BUILDS_NUMBER = 3;
	public static final int STATUS_VALUES = 0x0100;
	public static final int STATUS_ERROR_NONE = 0x0200;
	public static final int STATUS_ERROR_NOTICEABLE = 0x0400;
	public static final int STATUS_ERROR_SUSPICIOUS = 0x0600;
	public static final int STATUS_ERROR_WEIRD = 0x0800;
	public static final int STATUS_ERROR_INVALID = 0x0A00;
	public static final int STATUS_ERROR_LEVEL_MASK = 0x0E00;
	public static final int STATUS_SMALL_VALUE_BUILD = 0x1000;
	public static final int STATUS_SMALL_VALUE_DELTA = 0x2000;
	public static final int STATUS_SMALL_VALUE_MASK = 0x3000;
	public static final int STATUS_STATISTICS_ERRATIC = 0x4000;
	public static final int STATUS_STATISTICS_UNSTABLE = 0x8000;
	public static final int STATUS_STATISTICS_MASK = 0xC000;
	public static final int DEFAULT_WRITE_STATUS = STATUS_ERROR_NONE | DEFAULT_BUILDS_NUMBER;

	// Default milestones nowadays
	public static final String[] V36_MILESTONES = new String[] {
		"M1-200908060100",
		"M2-200909170100",
		"M3-200910301201",
		"M4-200912101301",
		"M5-201001291300",
		"M6-201003121448",
	};
	public static final String[] V35_MILESTONES = new String[] {
		        "M1-200808071402",
		        "M2-200809180100",
		        "M3-200810301917",
		        "M4-200812111908",
		        "M5-200902021535",
		        "M6-200903130100",
		        "M7-200904302300",
		        "RC1-200905151143",
		        "RC2-200905221710",
		        "RC3-200905282000",
		        "RC4-200906051444",
		        "R3_5-200906111540"
	};
	/** @deprecated */
	public static final String[] V34_MILESTONES = new String[] {
		        "M1-200708091105",
		        "M2-200709210919",
		        "M3-200711012000",
		        "M4-200712131700",
		        "M5-200802071530",
		        "M6a-200804091425",
		        "M7-200805020100",
		        "RC1-200805161333",
		        "RC2-200805230100",
		        "RC3-200805301730",
		        "RC4-200806091311",
		        "R3_4-200806172000"
	};
	/** @deprecated */
	public static final String[] V33_MILESTONES = new String[] {
		        "M1-200608101230",
		        "M2-200609220010",
		        "M3-200611021715",
		        "M4-200612141445",
		        "M5-200702091006",
		        "M5eh-200702220951",
		        "M6-200703231616",
		        "M7-200705031400",
		        "RC1-200705171700",
		        "RC2-200705251350",
		        "RC3-200706011539",
		        "RC4-200706081718",
		        "R3_3-200706251500",
		        "R3_3_1-200709211145",
		        "R3_3_2-200802211800"
	};

}


text:
import { MongooseModule, ModelTypeFromTypeSchemaFunction, ItemTypeFromTypeSchemaFunction, ReplaceModelReturnType } from "../helpers";
export declare function ActionLogModule(mongoose: MongooseModule): Promise<import("mongoose").Model<import("mongoose").Document & Record<string, unknown> & {
    _id: import("bson").ObjectID;
    departmentId: string;
    email: string;
    userId: string;
    action: string;
    object: any;
    before: any;
    after: any;
    delta: any;
    createdAt: string;
    modified_unix_date: number;
}, {}> & {
    __methods?: unknown;
}>;
export interface ActionLog extends ItemTypeFromTypeSchemaFunction<typeof ActionLogModule> {
}
export interface ActionLogModel extends ModelTypeFromTypeSchemaFunction<ActionLog> {
}
declare const _default: ReplaceModelReturnType<typeof ActionLogModule, ActionLogModel>;
export default _default;
//# sourceMappingURL=action-log.d.ts.map


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *     http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';

import { TicketService } from '@zeppelin/services';

@Component({
  selector: 'zeppelin-login',
  templateUrl: './login.component.html',
  styleUrls: ['./login.component.less'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class LoginComponent implements OnInit {
  userName: string;
  password: string;
  loading = false;
  private returnUrl: string | undefined;

  login() {
    this.loading = true;
    this.ticketService.login(this.userName, this.password).subscribe(
      () => {
        this.loading = false;
        this.cdr.markForCheck();
        this.router.navigateByUrl(this.returnUrl || '/');
      },
      () => {
        this.loading = false;
        this.cdr.markForCheck();
      }
    );
  }

  constructor(
    private ticketService: TicketService,
    private cdr: ChangeDetectorRef,
    private router: Router,
    private route: ActivatedRoute
  ) {
    route.queryParams.subscribe(params => {
      this.returnUrl = params.returnUrl;
    });
  }

  ngOnInit() {}
}


text:
package com

import "reflect"

// ServerObject is the structure for serving Go objects.
type ServerObject struct {
	VirtualTable   *interface{}
	ReferenceCount int32
	InterfaceID    *GUID
	Interface      interface{}
	FunctionMap    map[string]int32
}

// Service creates COM server reference object.
func Service(obj *interface{}, vt *interface{}, interfaceID *GUID) (*ServerObject, error) {
	rv := reflect.ValueOf(obj).Elem()
	if rv.Type().Kind() == reflect.Struct {
		service := &ServerObject{}
		service.VirtualTable = vt
		service.Interface = obj
		service.InterfaceID = interfaceID
		return service, nil
	}

	return nil, NewError(InvalidArgumentErrorCode)
}


text:
namespace content {
struct ContextMenuParams;
class RenderWidgetHostViewAura;

// An implementation of |TouchSelectionControllerClient| to be used in Aura's
// implementation of touch selection for contents.
class CONTENT_EXPORT TouchSelectionControllerClientAura
    : public ui::TouchSelectionControllerClient,
      public ui::TouchSelectionMenuClient {
 public:
  explicit TouchSelectionControllerClientAura(RenderWidgetHostViewAura* rwhva);
  ~TouchSelectionControllerClientAura() override;

  // Called when |rwhva_|'s window is moved, to update the quick menu's
  // position.
  void OnWindowMoved();

  // Called on first touch down/last touch up to hide/show the quick menu.
  void OnTouchDown();
  void OnTouchUp();

  // Called when touch scroll starts/completes to hide/show touch handles and
  // the quick menu.
  void OnScrollStarted();
  void OnScrollCompleted();

  // Gives an opportunity to the client to handle context menu request and show
  // the quick menu instead, if appropriate. Returns |true| to indicate that no
  // further handling is needed.
  // TODO(mohsen): This is to match Chrome on Android behavior. However, it is
  // better not to send context menu request from the renderer in this case and
  // instead decide in the client about showing the quick menu in response to
  // selection events. (http://crbug.com/548245)
  bool HandleContextMenu(const ContextMenuParams& params);

 private:
  friend class TestTouchSelectionControllerClientAura;
  class EnvPreTargetHandler;

  bool IsQuickMenuAvailable() const;
  void ShowQuickMenu();
  void UpdateQuickMenu();

  // ui::TouchSelectionControllerClient:
  bool SupportsAnimation() const override;
  void SetNeedsAnimate() override;
  void MoveCaret(const gfx::PointF& position) override;
  void MoveRangeSelectionExtent(const gfx::PointF& extent) override;
  void SelectBetweenCoordinates(const gfx::PointF& base,
                                const gfx::PointF& extent) override;
  void OnSelectionEvent(ui::SelectionEventType event) override;
  std::unique_ptr<ui::TouchHandleDrawable> CreateDrawable() override;

  // ui::TouchSelectionMenuClient:
  bool IsCommandIdEnabled(int command_id) const override;
  void ExecuteCommand(int command_id, int event_flags) override;
  void RunContextMenu() override;

  // Not owned, non-null for the lifetime of this object.
  RenderWidgetHostViewAura* rwhva_;

  base::Timer quick_menu_timer_;
  bool quick_menu_requested_;
  bool touch_down_;
  bool scroll_in_progress_;
  bool handle_drag_in_progress_;

  bool show_quick_menu_immediately_for_test_;

  // A pre-target event handler for aura::Env which deactivates touch selection
  // on mouse and keyboard events.
  std::unique_ptr<EnvPreTargetHandler> env_pre_target_handler_;

  DISALLOW_COPY_AND_ASSIGN(TouchSelectionControllerClientAura);
};

}  // namespace content

#endif  // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_SELECTION_CONTROLLER_CLIENT_AURA_H_


text:
layout: static
title: Energy Access Toolbox Electricity Markets Data
---
Members: Eric Munsing, Michaelangelo Tabone, Anna Schneider, and Peter Alstone

<http://electricitymapper.appspot.com/>

<https://github.com/WattTime/pyiso>

## Goals
- Make peoples' energy analysis work more accessible.
- API functions, hooks, and vis for energy markets
- Collect and process data from energy markets for wholesale electrcity prices, particularly focused on historical data for researchers.

Potential outcomes:
 - R and python codebases / packages
 - Own API?
 - Weather and buildings data.

## Data and tools in hand
- Weather data -- based on Sam's code for wunderground.  forecast.io also available.
- Hosting the data?
- Census
- Household characteristics
- CAISO API hooks (from peter)
real-time streams / DB type (SMAP database)?
Watttime: what they've done: (pyso on github)
	- Scrapers for all of the ISO for real-time generation mix
	- pyiso
	- see [repositories for more...](https://github.com/WattTime)
## plan for semester
A stack of software to get / serve / visualize electricity market data.


text:
namespace grpc_core {

Sleep::Sleep(Timestamp deadline) : state_(new State(deadline)) {
  GRPC_CLOSURE_INIT(&state_->on_timer, &OnTimer, state_, nullptr);
}

Sleep::~Sleep() {
  if (state_ == nullptr) return;
  {
    MutexLock lock(&state_->mu);
    switch (state_->stage) {
      case Stage::kInitial:
        state_->Unref();
        break;
      case Stage::kStarted:
        grpc_timer_cancel(&state_->timer);
        break;
      case Stage::kDone:
        break;
    }
  }
  state_->Unref();
}

void Sleep::OnTimer(void* arg, grpc_error_handle) {
  auto* state = static_cast<State*>(arg);
  Waker waker;
  {
    MutexLock lock(&state->mu);
    state->stage = Stage::kDone;
    waker = std::move(state->waker);
  }
  waker.Wakeup();
  state->Unref();
}

Poll<absl::Status> Sleep::operator()() {
  MutexLock lock(&state_->mu);
  switch (state_->stage) {
    case Stage::kInitial:
      if (state_->deadline <= ExecCtx::Get()->Now()) {
        return absl::OkStatus();
      }
      state_->stage = Stage::kStarted;
      grpc_timer_init(&state_->timer, state_->deadline, &state_->on_timer);
      break;
    case Stage::kStarted:
      break;
    case Stage::kDone:
      return absl::OkStatus();
  }
  state_->waker = Activity::current()->MakeNonOwningWaker();
  return Pending{};
}

}  // namespace grpc_core


text:
var BackgroundCover = require('../index.js');
debugger

var body = document.getElementsByTagName('body')[0];
body.style.position = 'absolute';
body.style.overflow = 'hidden';
body.style.width = '100%';
body.style.height = '100%';
body.style.margin = 0;

var video = document.createElement('video');
video.src = 'tests/assets/test.webm';
video.preload = 'auto';
video.muted = 'true';
video.autoplay = 'true';
video.style.visibility = 'hidden';

body.appendChild(video);

var setCover = function () {
  BackgroundCover(video, body);
  video.style.visibility = 'visible';
};

video.addEventListener('loadedmetadata', setCover);
window.addEventListener('resize', setCover);


text:
package emr.colour.colourlist;

import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;

public class CompoundColourList
{
	private List<String> order;
	private Map<String,ColourList> lists;
	private int bits;

	public CompoundColourList()
	{
		order = new ArrayList<>();
		lists = new HashMap<>();
	}

	public void setOrder( List<String> order )
	{
		this.order = order;
	}

	public void setBits( int bits )
	{
		this.bits = bits;
	}

	public void addColourList( String id , ColourList list )
	{
		lists.put( id , list );
	}

	public int getBits()
	{
		return bits;
	}

	public List<String> getOrder()
	{
		return order;
	}

	public Map<String,ColourList> getLists()
	{
		return lists;
	}

	@Override
	public String toString()
	{
		StringBuilder sb = new StringBuilder();
		sb.append( "bits: " + bits + "#" );
		sb.append( "order: " );
		for( String item : order )
		{
			sb.append( item + "," );
		}
		sb.deleteCharAt( sb.length() - 1 );
		sb.append( "#" );
		for( Map.Entry< String , ColourList > entry : lists.entrySet() )
		{
			sb.append( entry.getKey() + "#" + entry.getValue().toString() );
		}
		return sb.toString();
	}

	public List<Colour> getCompoundColourList()
	{
		ArrayList<Colour> list = new ArrayList<>();
		for( String id : order )
		{
			list.addAll( lists.get( id ).getColourList( bits ) );
		}
		return list;
	}
}


text:
package com.strato.hidrive.api.connection.httpgateway.request;

import java.io.InputStream;
import java.util.List;

import com.strato.hidrive.api.connection.httpgateway.interfaces.HttpRequestParamsVisitor;
import com.strato.hidrive.api.connection.httpgateway.visitors.HttpGetRequestParamsVisitor;

public abstract class BaseInputStreamRequest extends Request {

	private InputStream inputStream;
	private long streamLength;

	public BaseInputStreamRequest(Method method) {
		super(method);
	}

	public BaseInputStreamRequest(String methodName) {
		super(methodName);
	}

	public BaseInputStreamRequest(String methodName, List<BaseParam<?>> params) {
		super(methodName, params);
	}

	public BaseInputStreamRequest(String methodName, BaseParam<?>... params) {
		super(methodName, params);
	}

	public InputStream getInputStream() {
		return inputStream;
	}

	public void setInputStream(InputStream inputStream, long streamLength) {
		this.inputStream = inputStream;
		this.streamLength = streamLength;
	}

	public long getStreamLength() {
		return streamLength;
	}

	@Override
	protected HttpRequestParamsVisitor<?> createVisitor() {
		return new HttpGetRequestParamsVisitor();
	}

}


text:
@extends('laravel-authentication-acl::admin.layouts.base-2cols')

@section('title')
Admin area: {{ trans('contact::contact_admin.page_list') }}
@stop

@section('content')

 {!! $request->all() ? trans('contact::contact_admin.page_search') : trans('contact::contact_admin.page_list') !!}

                <?php $message = Session::get('message'); ?>
                @if( isset($message) )

{!! $message !!}

                @endif

                @if($errors && ! $errors->isEmpty() )
                @foreach($errors->all() as $error)

{!! $error !!}

                @endforeach
                @endif

                    @include('contact::contact.admin.contact_item')

            @include('contact::contact.admin.contact_search')

@stop

@section('footer_scripts')

@stop


text:
import * as chai from "chai";
import { AbstractCollection } from "../../../main/typesome/util/AbstractCollection";
import { Iterator } from "../../../main/typesome/util/Iterator";
import { ArrayList } from "../../../main/typesome/util/list/ArrayList";

export class AbstractCollectionMock<T> extends AbstractCollection<T> {

	public collection: AbstractCollection<T>;

	constructor() {
		super();
		this.collection = new ArrayList<T>();
	}

	public add(value: T): void {
		this.collection.add(value);
	}
	public remove(value: T): void {
		this.collection.remove(value);
	}
	public contains(value: T): boolean {
		return this.collection.contains(value);
	}
	public clear(): void {
		this.collection.clear();
	}
	public size(): number {
		return this.collection.size();
	}
	public iterate(): Iterator<T> {
		return this.collection.iterate();
	}
	public toArray(): T[] {
		return this.collection.toArray();
	}

}


text:
#include <linux/kernel.h>
#include <linux/of_mtd.h>
#include <linux/mtd/nand.h>
#include <linux/export.h>

/**
 * It maps 'enum nand_ecc_modes_t' found in include/linux/mtd/nand.h
 * into the device tree binding of 'nand-ecc', so that MTD
 * device driver can get nand ecc from device tree.
 */
static const char *nand_ecc_modes[] = {
	[NAND_ECC_NONE]		= "none",
	[NAND_ECC_SOFT]		= "soft",
	[NAND_ECC_HW]		= "hw",
	[NAND_ECC_HW_SYNDROME]	= "hw_syndrome",
	[NAND_ECC_HW_OOB_FIRST]	= "hw_oob_first",
	[NAND_ECC_SOFT_BCH]	= "soft_bch",
};

/**
 * of_get_nand_ecc_mode - Get nand ecc mode for given device_node
 * @np:	Pointer to the given device_node
 *
 * The function gets ecc mode string from property 'nand-ecc-mode',
 * and return its index in nand_ecc_modes table, or errno in error case.
 */
int of_get_nand_ecc_mode(struct device_node *np)
{
	const char *pm;
	int err, i;

	err = of_property_read_string(np, "nand-ecc-mode", &pm);
	if (err < 0)
		return err;

	for (i = 0; i < ARRAY_SIZE(nand_ecc_modes); i++)
		if (!strcasecmp(pm, nand_ecc_modes[i]))
			return i;

	return -ENODEV;
}
EXPORT_SYMBOL_GPL(of_get_nand_ecc_mode);

/**
 * of_get_nand_bus_width - Get nand bus witdh for given device_node
 * @np:	Pointer to the given device_node
 *
 * return bus width option, or errno in error case.
 */
int of_get_nand_bus_width(struct device_node *np)
{
	u32 val;

	if (of_property_read_u32(np, "nand-bus-width", &val))
		return 8;

	switch(val) {
	case 8:
	case 16:
		return val;
	default:
		return -EIO;
	}
}
EXPORT_SYMBOL_GPL(of_get_nand_bus_width);

/**
 * of_get_nand_on_flash_bbt - Get nand on flash bbt for given device_node
 * @np:	Pointer to the given device_node
 *
 * return true if present false other wise
 */
bool of_get_nand_on_flash_bbt(struct device_node *np)
{
	return of_property_read_bool(np, "nand-on-flash-bbt");
}
EXPORT_SYMBOL_GPL(of_get_nand_on_flash_bbt);


text:
**2019-11-26**

New version: 1.1.0 (based on v1.1.0)

- introduced `PreferenceFragmentCompatMasterSwitch` that can be used as a switch's additional screen for settings; see the sample for details
- Added `pref_disableMessagePaddingFix` attribute to the `EditTextPreference` that can be used to disable the dialog message padding fix.
- `EditText` does not receive all attributes from `EditTextPreference` from now, only the following: `inputType`, `textAllCaps`, `lines`, `minLines`, `maxLines`, `ems`, `minEms`, `maxEms`
- `AutoSummaryEditTextPreference` is now deprecated, use an appropriate `SummaryProvider` with the `EditTextPreference`

**2018-05-11**

New version: 27.1.1.1 (based on v27.1.1)

- No support preferences related changes in the support library.
- Bug fixes (#153, #149, #155, #152).

**2018-04-10**

New version: 27.1.1.0 (based on v27.1.1)

- No support preferences related changes in the support library.
- Some bug fixes (see #147 for more info).

**2018-02-28**

New version: 27.1.0.0 (based on v27.1.0)

- According to bug fixes section of the [changelog](https://developer.android.com/topic/libraries/support-library/revisions.html#27-1-0) of revision 27.1.0: _Preferences library uses attributes that will not work on old versions of Android_ has been fixed.
- Some bug fixes.

**2017-12-01**

New version: 27.0.2.0 (based on v27.0.2)

- Added [`AutoSummaryEditTextPreference`](https://github.com/Gericop/Android-Support-Preference-V7-Fix/wiki/Preference-types#autosummaryedittextpreference) that shows the entered text automatically in the summary.
- Added [`SimpleMenuPreference`](https://github.com/Gericop/Android-Support-Preference-V7-Fix/wiki/Preference-types#simplemenupreference) that shows a nicely animated popup menu for displaying entries on API 21+, and a `ListPreference` on pre-Lollipop devices.
- Removed obsolete (pre-v14) resources.
- Small bug fixes.

**2017-11-13**

New version: 27.0.1.0 (based on v27.0.1)

- No support preferences related changes.

**2017-10-27**

New version: 27.0.0.0 (based on v27.0.0)

- `PreferenceCategory`'s text color can be set from code (`setColor(...)` or `setColorResource(...)`) and XML (`app:pref_categoryColor` attribute)
- Added `PreferenceActivityResultListener` that can be used for handling click events by starting an `Activity` for result and receiving the results
- Enabled scrollbars on the preference list

**2017-10-24**

New version: 26.1.0.3 (based on v26.1.0)

- The attribute names use the `pref_` prefix in order to avoid name collision with other libraries
- The custom preferences call their change listeners
- Custom preferences extending `DialogPreference` can be added using `PreferenceFragmentCompat.addDialogPreference(...)`

**2017-09-24**

New version: 26.1.0.2 (based on v26.1.0)

- Quick fix: the app won't crash if the preference XML couldn't be inflated (but it will still display as an empty screen)

**2017-09-24**

New version: 26.1.0.1 (based on v26.1.0)

- Bug fix: crash on API 26 when using dividers and preferences with widgets together
- Bug fix: `ColorPickerPreference`'s column number defaults to auto (0) instead of 3
- `PreferenceCategory`'s title view gets hidden (including its dimensions) when the title is empty (the dividers will be drawn as if the title was not hidden)
- Added 2 new flags to the custom dividers: `DIVIDER_NO_BEFORE_FIRST` and `DIVIDER_NO_AFTER_LAST`

**2017-09-17**

New version: 26.1.0.0 (based on v26.1.0)

- No official support preferences related changes.
- Added new preference type:
  - [`ColorPickerPreference`](https://github.com/Gericop/Android-Support-Preference-V7-Fix/wiki/Preference-types#colorpickerpreference)
- [`RingtonePreference`](https://github.com/Gericop/Android-Support-Preference-V7-Fix/wiki/Preference-types#ringtonepreference) has a new attribute: `app:summaryHasRingtone` that can be used to display the name of the selected ringone.

- **BREAKING CHANGE** in attribute and method names (and behavior) for summary handling of `DatePickerPreference` and `TimePickerPreference`.
  - The previous `summaryNoXXX` no longer exists. Use the normal `summary` instead for showing summary if no pick is made.
  - The new attribute is `summaryHasXXX` which is going to be displayed if the picker has a picked value. If this is not set, the `summary` will be used instead.

**2017-08-31**

New version: 26.0.2.0 (based on v26.0.2)

- No support preferences related changes.
- Added new preference types:
  - [`RingtonePreference`](https://github.com/Gericop/Android-Support-Preference-V7-Fix/wiki/Preference-types#ringtonepreference)
  - [`DatePickerPreference`](https://github.com/Gericop/Android-Support-Preference-V7-Fix/wiki/Preference-types#datepickerpreference)
  - [`TimePickerPreference`](https://github.com/Gericop/Android-Support-Preference-V7-Fix/wiki/Preference-types#timepickerpreference)

See the wiki / Preference types page for more details.

**2017-08-09**

New version: 26.0.1.0 (based on v26.0.1)

- No support preferences related changes.

**2017-08-04**

New version: 26.0.0.1 (based on v26.0.0)

- Bug fix for "Cannot call this method while RecyclerView is computing a layout or scrolling" in caused by `SwitchPreferenceCompat`:
  - removed `SwitchPreferenceCompat` because the official implementation fixed the problem of not animating the toggle on older platforms
  - removed `SwitchPreferenceCompatViewHolder` as it's not needed anymore

**2017-07-25**

New version: 26.0.0.0 (based on v26.0.0)

- This is the new release based on the now final v26.0.0 support library.

**2017-06-14**

New version: 26.0.0.0-beta2 (based on v26.0.0-beta2)

- Support preferences v7 has some new interesting features, such as [icon space reservation](https://developer.android.com/reference/android/support/v7/preference/Preference.html#attr_android:iconSpaceReserved), [single line titles](https://developer.android.com/reference/android/support/v7/preference/Preference.html#attr_android:singleLineTitle), and the [`PreferenceDataStore`](https://developer.android.com/reference/android/support/v7/preference/PreferenceDataStore.html) interface. For details, check out the [25.4.0 -> 26.0.0-beta2 diff specification](https://developer.android.com/sdk/support_api_diff/26.0.0-beta2/changes/pkg_android.support.v7.preference.html).

**2017-06-09**

New version: 25.4.0.3 (based on v25.4.0)
*25.4.0.0 - 25.4.0.2 wouldn't work due to a bug in the used artifact creator*

- No support preferences v7 related changes.

**2017-05-19**

New version: 25.3.1.1 (based on v25.3.1)

- Removed old, deprecated classes from the `android.support.v7.preference` package: `EditTextPreferenceDialogFragmentCompatFix`, `EditTextPreferenceFix`, `PreferenceCategoryFix`, `PreferenceFragmentCompatDividers` (note that this is from the old package, not the _new_ one), `PreferenceFragmentCompatFix`

**2017-03-29**

New version: 25.3.1.0 (based on v25.3.1)

- `SwitchPreferenceCompat` is available on API 9-13 devices again.

**2017-03-14**

New version: 25.3.0.0 (based on v25.3.0)

- No support preferences v7 related changes.

**2017-02-23**

New version: 25.2.0.0 (based on v25.2.0)

- No support preferences v7 related changes.

**2017-01-31**

New version: 25.1.1.0 (based on v25.1.1)

- No support preferences v7 related changes.

**2017-01-24**

New version: 25.1.0.2 (based on v25.1.0)

Two bugfixes:

- added proguard files
- bugfix for duplicate annotations (*issue #40 - [Android Studio] Crash IDE due to duplicate annotation*)

**2017-01-16**

New version: 25.1.0.1 (based on v25.1.0)

Fixed the message style in the dialog of `EditTextPreference`. It is customizable, make sure you check out the guide in **Customizations**.

**2017-01-15**

New version: 25.1.0.0 (based on v25.1.0)

Google added [`SeekBarPreference`](https://developer.android.com/reference/android/support/v7/preference/SeekBarPreference.html) to the mix but it has some design related issues ([issue 230920](https://code.google.com/p/android/issues/detail?id=230920), [issue 230922](https://code.google.com/p/android/issues/detail?id=230922)). This library fixes its design flaws on all supported devices. *A minor issue is present on API 7-13 devices since the fragment list has padding instead of the elements which means the seek bar cannot be aligned to the title text as it would clip the thumb, but it's still fully functional now.*

**2016-11-15**

No support preferences v7 related changes in v25.0.1.

**2016-11-07**

New version: 25.0.0.1
Possible fix for issue #44. The `SwitchPreferenceCompat` now has got a new method called `setCheckedAnimated(boolean)` instead of overriding the default `setChecked(boolean)` behavior. This can be called to animate the `Switch`'s state change.

**2016-10-29**

Annotated some methods' params with `@Nullable` in order to allow people usage of the lib in Kotlin.
No support preferences v7 related changes in v25.0.0.

**2016-09-25**

No support preferences v7 related changes in v24.2.1.

**2016-08-18**

Wow! The Google guys worked so hard, they finally released bugfix-like things! Here's the list of things were modified by them:

- No more need for `preference_accent`, just define your `colorAccent` attribute in your theme and that's it! This also means that from now on you can set different accent colors for different theme variations.
- The `ListPreference`'s items use the accent color on all API levels, so the bug is gone finally (there's a small quirk on API 10 and probably all levels below 14 are affected by it: the first time the user opens the dialog, the first item's radio button is not colored properly, but it goes away after the user selects an option).
- If you are targeting API 14+ but still using the v7 for compatibility reasons, `MultiSelectListPreference` is now available for use! (*It won't work on API 7-13!*)

And these are the support lib fix changes:
- As it was mentioned before, `preference_accent` is not used anymore. If you relied solely on this value's behavior, now you'll have to define the `colorAccent` attribute in your theme.
- Several unnecessary styles (`Dialog` and `AlertDialog` related) has been removed. It shouldn't affect anyone, unless these styles were used as parents of custom styles. In this case simply use `@style/Theme.AppCompat.Dialog` and/or `@style/Theme.AppCompat.Dialog.Alert` as the custom styles' parents.

**2016-07-29**

Bugfix for divider settings reset ([issue #34](https://github.com/Gericop/Android-Support-Preference-V7-Fix/issues/34)).

**2016-07-23**

- Updated the preference libs to 24.1.1 from 24.1.0.
- The previous bugfix didn't work, so in case the reflection would not work, it just falls back to the original implementation. This means that if the fallback happens, the padding fix will not be available (only devices below API 21 are affected by the padding bug). This `NullPointerException` causing *bug* was reported only once on a device that had Xposed on it, but couldn't reproduce it using the same make and model of that device, thus most users will still see the bugfixed (i.e. the padding fixed) version of the preferences.

**2016-07-21**

There was a reflection related bug on a device and 24.1.0.1 tries to overcome this, but the bugfix is not confirmed yet.

**2016-07-19**

Updated the preference libs to 24.1.0 from 24.0.0. No further changes.

**2016-07-09**

- some found the preference category's bottom margin too big, so now you can change it from the styles by setting the `preferenceCategory_marginBottom` value in your theme, for example: `<item name="preferenceCategory_marginBottom">0dp</item>`
- removed some unnecessary code
- the sample app has been updated with an inner `PreferenceScreen` so the behavior can be tested against it as well


text:
title: Scratch 4 Arduino
---

Scratch 4 Arduino is a custom version of scratch that makes it super easy to get up and running with Arduino programming. This worksheet is going to show you how to get set up and start making your first programs using S4A.

![S4A Logo](../img/S4A logo.png "S4A Logo")

For a great little introduction to S4A, check out the first 10 pages or so of this presentation.

When you first launch the program, if you don't have your Arduino connected your stage (the bit at the top right of your screen) will look like this :

![S4A Searching](../img/S4A searchingBoard.png "S4A Searching")

When you connect the Arduino, the "Searching..." message should disappear and the numbers on the analog pins should start jumping around

![S4A Found](../img/S4A foundBoard.png "S4A Found")

Up in the top left of your screen are all the different categories of Scratch blocks for making your program. If you've used the original version of scratch before, this should be very familiar, apart from the additional section that comes with s4a, a blue one titled "Motion":

![S4A Categories](../img/S4A categories.png "S4A Categories")

If you go to the blue "Motion" section, you should see all of S4A's special Arduino blocks. We will look at all of these over the coming weeks, but to start off with, we are going to concentrate on using these two :

![block_digitalPinOn](../img/block_digitalPinOn.png "block_digitalPinOn")
![block_digitalPinOff](../img/block_digitalPinOff.png "block_digitalPinOff")

These let us turn pins 10-13 on or off. It just so happens that the Arduino has an LED light already attached to pin 13. Try dragging these blocks into your workspace, clicking on them to turn the LED on and off and see if you can spot where it is on the board.

# Controlling the onboard LED

There are a whole bunch of different ways we can control stuff in Scratch. Let's look at a few interesting ways of turning our light on and off.

### Looping
This script will blink your LED on and off every second (with S4A the fastest this can be is every 0.7 seconds)
![LED blink](../img/LED blink.png "LED blink")

### Mouse Control
This script turns the LED on whenever your mouse button is pressed
![LED mouse](../img/LED mouse.png "LED mouse")

### Keyboard Control
These scripts turn the LED on when you press the left arrow key, and off when you press the right arrow key.
![LED keyboard](../img/LED keyboard.png "LED keyboard")

So Scratch's onboard LED is OK, but it's not the brightest LED in the world, and we have no way of putting it where we want, or changing it's colour. Knowing how to use external LEDs is a super useful thing (especially with robots - colourful blinky light sare a must have!) This circuit shows you how to attach an external LED to pin 13. Just make sure that the longer leg goes into pin 13.

Because this is on the same pin as the onboard LED, we don't have to change any of our scripts for this to work :)


text:
class Admin::TagsController < Admin::AdminController
  before_action :require_sysadmin
  before_action :find_tags, only: [:index]
  before_action :find_tag, only: [:edit, :update, :destroy]
  before_action :build_tag, only: [:new, :create]
  before_action :destroy_tag, only: [:destroy]

  def index
    respond_to do |format|
      format.html
    end
  end

  def new
    respond_to do |format|
      format.html
    end
  end

  def create
    if @tag.save
      redirect_to_index_url notice: :tag_created
    else
      respond_to do |format|
        format.html { render :new }
      end
    end
  end

  def edit
    respond_to do |format|
      format.html
    end
  end

  def update
    if @tag.update(tag_params)
      redirect_to_index_url notice: :tag_updated
    else
      respond_to do |format|
        format.html { render :edit }
      end
    end
  end

  def destroy
    redirect_to_index_url notice: :tag_deleted
  end

  private

  def find_tags
    @tags = Tag.search(params)
  end

  def find_tag
    @tag = Tag.find(params[:id])
  end

  def build_tag
    @tag = Tag.new(tag_params)
  end

  def destroy_tag
    @tag.destroy
  end

  def tag_params
    if params.key?(:tag)
      params.require(:tag).permit(:name, :description)
    else
      {}
    end
  end

  def index_url
    admin_tags_url(params.slice(:q))
  end

  def redirect_to_index_url(options = {})
    redirect_to index_url, options
  end
end


text:
using namespace std;
#include <iostream>
#include <vector>
#include <cassert>
template<typename T>
class Matrix
{
	//Proxy class for notconstant referring
	template<typename M, typename L>
	class Row
	{
		public:
			//Constructor of class Row. Row - is number of current row.
			// matrix - link to object of Matrix class
			Row(size_t row, M& matrix)
			: cur_row(row), matrix_obj(matrix) {}
			//Get the link to the element with the specified column from this row
			L& operator[](size_t column) {
				//Check if the index is out of range
				if (column >= matrix_obj.columns) {
					assert(!"columns' index out of range");
				}
				//Find the index of the element and return it
				return matrix_obj.data[cur_row * matrix_obj.columns + column];
			}
			private:
				// Which row we are processing
				size_t cur_row;
				// With which object of class Matrix we are working
				M& matrix_obj;
	};
	public:
		//Constructor of class Matrix. Row_nums is number of rows,
		//columns_rows - number of columns
		Matrix(size_t row_num, size_t column_num)
		: rows(row_num), columns(column_num)
		{
			//We reserve place for all elements of Matrix
			data.resize(row_num * column_num);
			//Assign to zero all the elements of vector
			for(size_t i = 0; i < row_num * column_num; i++){
				data[i] = 0;
			}
		}
		//Function for returning number of rows
		size_t row_number(){
			return rows;
		}
		//Function for returning number of columns
		size_t column_number(){
			return columns;
		}
		//Function returns the object of proxy class, used for processing
		//operator [][]
		Row<Matrix, T> operator[] (size_t row){
			//Check if the index is out of range
			if(row >= rows){
				assert(!"rows' index out of range");
			}
			return Row<Matrix, T>(row, *this);
		}
		//Multiplicate matrix and vector
		Matrix operator* (const vector<T> vect) {
			//Check if we can multiplicate
			if(vect.size() != columns && vect.size() != rows){
				assert(!"size of vector doesn't match neither number of columns, nor number of rows");
			}
			//If we multiplicate the vector as matrix * vector
			if(vect.size() == columns){
				//Create new Matrix for assigning result to it
				Matrix res(rows, 1);
				//Get result based on the rules of multiplication of matrix and vector
				for (size_t i = 0; i < rows; i++) {
					for(size_t j = 0; j < columns; j++){
						res.data[j] += data[i * columns + j] * vect[j];
					}
				}
				//Return new object of Matrix class
				return res;
			} else{
				//Create new Matrix for assigning result to it
				Matrix res(1, columns);
				//Get result based on the rules of multiplication of matrix and vector
				for (size_t i = 0; i < rows; i++) {
					for(size_t j = 0; j < columns; j++){
						res.data[i] += data[i * columns + j] * vect[j];
					}
				}
				//Return new object of Matrix class
				return res;
			}

		}
		//Multiplicate matrix and vector and apply result to this matrix
		Matrix& operator*= (const vector<T> vect) {
			//Check if we can multiplicate
			if(vect.size() != columns && vect.size() != rows){
				assert(!"size of vector doesn't match neither number of columns, nor number of rows");
			}
			//Create temporary vector for data
			vector<T> tmp;
			//If we multiplicate the vector as matrix * vector
			if(vect.size() == columns){
				//The size of tmp is rows
				tmp.resize(rows);
				for(int i = 0; i < rows; i++){
					tmp[i] = 0;
				}
				//Get result based on the rules of multiplication of matrix and vector
				for (size_t i = 0; i < rows; i++) {
					for(size_t j = 0; j < columns; j++){
						tmp[i] += data[i * columns + j] * vect[j];
					}
				}
				//Now the number of columns is 1
				columns = 1;
				//Then we move the values from the tmp array to data array
				data.resize(rows);
				for(int i = 0; i < rows; i++){
					data[i] = tmp[i];
				}
			} else{ //If we multiplicate vector as vector*matrix
				tmp.resize(columns);
				for(int i = 0; i < columns; i++){
					tmp[i] = 0;
				}
				//Get result based on the rules of multiplication of matrix and vector
				for (size_t i = 0; i < rows; i++) {
					for(size_t j = 0; j < columns; j++){
						tmp[j] += data[i * columns + j] * vect[j];
					}
				}
				//Then we move the values from the tmp array to data array
				data.resize(columns);
				//Now number of rows is 1
				rows = 1;
				for(size_t i = 0; i < columns; i++){
					data[i] = tmp[i];
				}
			}
			//Return this object of Matrix class
			return *this;
		}
		//Multiplicate matrix and number
		Matrix operator* (T x){
			//Create new Matrix for assigning result to it
			Matrix res(rows, columns);
			//Just multiplicate every element to x
			for (size_t i = 0; i < data.size(); i++) {
				res.data[i] = x * data[i];
			}
			//Return new object of Matrix class
			return res;
		}
		//Multiplicate matrix and number and apply to this matrix
		Matrix& operator*= (T x){
			//Just multiplicate every element to x
			for (size_t i = 0; i < data.size(); i++) {
				data[i] *= x;
			}
			//Return current object
			return *this;
		}
		//Function for checking matrixes on equality
		bool operator== (Matrix &m){
			//If matrixes are different sizes, they couldn't be equal
			if(rows != m.row_number() || columns != m.column_number()){
				return 0;
			}
			for(size_t i = 0; i < rows; i++){
				for(size_t j = 0; j < columns; j++){
					//If one elements isn't equal, matrixes aren't equal
					if(data[i * columns + j] != m[i][j]){
						return 0;
					}
				}
			}
			return 1;
		}
		//Function for checking matrixes on inequality
		bool operator!= (Matrix &m){
			return !(*this == m);
		}
		//This function copies the Matrix object
		//Matrix m1
		//Matrix m2 = m1
		Matrix(const Matrix& m) {
			rows = m.rows;
			columns = m.columns;
			data.resize(rows * columns);
			for (size_t i = 0; i < rows * columns; i++) {
				data[i] = m.data[i];
			}
		}
		//This function copies the Matrix object
		//Matrix m1
		//Matrix m2
		//m2 = m1
		Matrix& operator=(const Matrix& m) {
			//To avoid the situation when we copy the same objects
			if(this == &m)
				return *this;
			rows = m.rows;
			columns = m.columns;
			data.resize(rows * columns);
			for (size_t i = 0; i < rows * columns; i++) {
				data[i] = m.data[i];
			}
			return *this;
		}
		//This function moves the Matrix object
		//Matrix m1
		//Matrix m2 = std::move(m2)
		Matrix(Matrix&& m) {
			rows = m.rows;
			columns = m.columns;
			data = m.data;
			m.data.clear();
		}

		//This function moves the Matrix object
		//Matrix m1
		//Matrix m2
		//m2 = std::move(m1)
		Matrix& operator=(Matrix&& m) {
			if(this == &m)
				return *this;
			rows = m.rows;
			columns = m.columns;
			data = m.data;
			m.data.clear();
			return *this;
		}
		//Function for printing matrix
		void print_matrix(){
			for(size_t i = 0; i < rows; i++){
				for(size_t j = 0; j < columns; j++){
					cout << data[i * columns + j] << " ";
				}
				cout << std::endl;
			}
		}
		//Function for checking if the size of data is really zero
		bool checkzero(){
			return data.size() == 0;
		}
	private:
		//In this vector elements of matrix are stored
		//(Matrix in flattened form)
		vector <T> data;
		//Number of rows and columns of matrix
		size_t rows, columns;
};


text:
from __future__ import unicode_literals

from django.db import migrations
import forum.models

class Migration(migrations.Migration):

    dependencies = [
        ('forum', '0005_auto_20171006_1336'),
    ]

    operations = [
        migrations.AlterField(
            model_name='post',
            name='body',
            field=forum.models.MarkdownField(help_text='We use a slightly-customized version of Markdown for formatting.'),
        ),
    ]


text:
require 'google/protobuf'

Google::Protobuf::DescriptorPool.generated_pool.build do
  add_file("google/ads/googleads/v12/enums/asset_source.proto", :syntax => :proto3) do
    add_message "google.ads.googleads.v12.enums.AssetSourceEnum" do
    end
    add_enum "google.ads.googleads.v12.enums.AssetSourceEnum.AssetSource" do
      value :UNSPECIFIED, 0
      value :UNKNOWN, 1
      value :ADVERTISER, 2
      value :AUTOMATICALLY_CREATED, 3
    end
  end
end

module Google
  module Ads
    module GoogleAds
      module V12
        module Enums
          AssetSourceEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v12.enums.AssetSourceEnum").msgclass
          AssetSourceEnum::AssetSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v12.enums.AssetSourceEnum.AssetSource").enummodule
        end
      end
    end
  end
end


text:
import wx
from functools import reduce

from gooey.gui.components.widgets.core.text_input import MultilineTextInput
from gooey.gui.components.widgets.textfield import TextField
from gooey.gui.components.widgets.bases import TextContainer
from gooey.gui import formatters

class Textarea(TextContainer):

    def getWidget(self, parent, *args, **options):
        widgetHeight = self._options.get('height', -1)
        return wx.TextCtrl(
            parent=parent,
            size=(-1, widgetHeight),
            style=self.getModifiers()
        )

    def getModifiers(self):
        readonly = (wx.TE_READONLY
                    if self._options.get('readonly', False)
                    # using TE_MUTLI as a safe OR-able no-op value
                    else wx.TE_MULTILINE)
        return reduce(lambda acc, val: acc | val, [wx.TE_MULTILINE, readonly])

    def getWidgetValue(self):
        return self.widget.GetValue()

    def setValue(self, value):
        self.widget.Clear()
        self.widget.AppendText(str(value))
        self.widget.SetInsertionPoint(0)

    def formatOutput(self, metatdata, value):
        return formatters.general(metatdata, value)


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.3.xsd">
    <changeSet author="scottfrazer" id="db_schema_other_table_alldb">
        <createTable tableName="WORKFLOW_EXECUTION">
            <column autoIncrement="true" name="WORKFLOW_EXECUTION_ID" type="INT">
                <constraints primaryKey="true" primaryKeyName="PK_WORKFLOW_EXECUTION"/>
            </column>
            <column name="WORKFLOW_EXECUTION_UUID" type="VARCHAR(100)">
                <constraints nullable="false"/>
            </column>
            <column name="WDL_URI" type="VARCHAR(255)">
                <constraints nullable="false"/>
            </column>
            <column name="STATUS" type="VARCHAR(50)">
                <constraints nullable="false"/>
            </column>
            <column name="START_DT" type="datetime">
                <constraints nullable="false"/>
            </column>
            <column name="END_DT" type="datetime"/>
        </createTable>

        <createTable tableName="EXECUTION">
            <column autoIncrement="true" name="EXECUTION_ID" type="INT">
                <constraints primaryKey="true" primaryKeyName="PK_EXECUTION"/>
            </column>
            <column name="WORKFLOW_EXECUTION_ID" type="INT">
                <constraints nullable="false"/>
            </column>
            <column name="CALL_FQN" type="VARCHAR(255)">
                <constraints nullable="false"/>
            </column>
            <column name="STATUS" type="VARCHAR(255)">
                <constraints nullable="false"/>
            </column>
        </createTable>

        <createTable tableName="JES_JOB">
            <column autoIncrement="true" name="JES_JOB_ID" type="INT">
                <constraints primaryKey="true" primaryKeyName="PK_JES_JOB"/>
            </column>
            <column name="EXECUTION_ID" type="INT">
                <constraints nullable="false"/>
            </column>
            <column name="JES_ID" type="INT">
                <constraints nullable="false"/>
            </column>
            <column name="JES_STATUS" type="VARCHAR(100)">
                <constraints nullable="false"/>
            </column>
        </createTable>

        <createTable tableName="LOCAL_JOB">
            <column autoIncrement="true" name="LOCAL_JOB_ID" type="INT">
                <constraints primaryKey="true" primaryKeyName="PK_LOCAL_JOB"/>
            </column>
            <column name="EXECUTION_ID" type="INT">
                <constraints nullable="false"/>
            </column>
            <column name="PID" type="INT">
                <constraints nullable="false"/>
            </column>
            <column name="COMMAND" type="TEXT">
                <constraints nullable="false"/>
            </column>
            <column name="RC" type="INT"/>
        </createTable>

        <modifySql dbms="mysql">
            <append value=" ENGINE=INNODB"/>
        </modifySql>
    </changeSet>

    <changeSet id="db_schema_symbol_table_mysql" author="scottfrazer" dbms="mysql">
        <createTable tableName="SYMBOL">
            <column autoIncrement="true" name="SYMBOL_ID" type="INT">
                <constraints primaryKey="true" primaryKeyName="PK_SYMBOL"/>
            </column>
            <column name="WORKFLOW_EXECUTION_ID" type="INT">
                <constraints nullable="false"/>
            </column>
            <column name="SCOPE" type="VARCHAR(255)">
                <constraints nullable="false"/>
            </column>
            <column name="NAME" type="VARCHAR(100)">
                <constraints nullable="false"/>
            </column>
            <column name="ITERATION" type="INT">
                <constraints nullable="false"/>
            </column>
            <column name="IO" type="ENUM('INPUT', 'OUTPUT')">
                <constraints nullable="false"/>
            </column>
            <column name="WDL_TYPE" type="VARCHAR(100)">
                <constraints nullable="false"/>
            </column>
            <column name="WDL_VALUE" type="TEXT"/>
        </createTable>

        <modifySql>
            <append value=" ENGINE=INNODB"/>
        </modifySql>
    </changeSet>

    <changeSet id="db_schema_symbol_table_otherdb" author="scottfrazer" dbms="!mysql">
        <createTable tableName="SYMBOL">
            <column autoIncrement="true" name="SYMBOL_ID" type="INT">
                <constraints primaryKey="true" primaryKeyName="PK_SYMBOL"/>
            </column>
            <column name="WORKFLOW_EXECUTION_ID" type="INT">
                <constraints nullable="false"/>
            </column>
            <column name="SCOPE" type="VARCHAR(255)">
                <constraints nullable="false"/>
            </column>
            <column name="NAME" type="VARCHAR(100)">
                <constraints nullable="false"/>
            </column>
            <column name="ITERATION" type="INT">
                <constraints nullable="false"/>
            </column>
            <column name="IO" type="VARCHAR(6)">
                <constraints nullable="false"/>
            </column>
            <column name="WDL_TYPE" type="VARCHAR(100)">
                <constraints nullable="false"/>
            </column>
            <column name="WDL_VALUE" type="TEXT"/>
        </createTable>
    </changeSet>

    <changeSet author="scottfrazer" id="db_schema_constraints">
        <createIndex indexName="STATUS_IDX"
                     tableName="WORKFLOW_EXECUTION" unique="false">
            <column name="STATUS"/>
        </createIndex>

        <addForeignKeyConstraint constraintName="FK_SYMBOL_WORKFLOW_EXECUTION_ID"
                                 baseTableName="SYMBOL" baseColumnNames="WORKFLOW_EXECUTION_ID"
                                 referencedTableName="WORKFLOW_EXECUTION"
                                 referencedColumnNames="WORKFLOW_EXECUTION_ID"/>

        <addForeignKeyConstraint constraintName="FK_EXECUTION_WORKFLOW_EXECUTION_ID"
                                 baseTableName="EXECUTION" baseColumnNames="WORKFLOW_EXECUTION_ID"
                                 referencedTableName="WORKFLOW_EXECUTION"
                                 referencedColumnNames="WORKFLOW_EXECUTION_ID"/>

        <addForeignKeyConstraint constraintName="FK_JES_JOB_EXECUTION_ID"
                                 baseTableName="JES_JOB" baseColumnNames="EXECUTION_ID"
                                 referencedTableName="EXECUTION" referencedColumnNames="EXECUTION_ID"/>

        <addForeignKeyConstraint constraintName="FK_LOCAL_JOB_EXECUTION_ID"
                                 baseTableName="LOCAL_JOB" baseColumnNames="EXECUTION_ID"
                                 referencedTableName="EXECUTION" referencedColumnNames="EXECUTION_ID"/>
    </changeSet>
</databaseChangeLog>


text:
from oslo_config import cfg
from oslo_log import log as logging
import six

from sahara import conductor as c
from sahara.i18n import _
from sahara.plugins import provisioning as p
from sahara.plugins import utils
from sahara.swift import swift_helper as swift
from sahara.topology import topology_helper as topology
from sahara.utils import files as f
from sahara.utils import types as types
from sahara.utils import xmlutils as x

conductor = c.API
LOG = logging.getLogger(__name__)
CONF = cfg.CONF

CORE_DEFAULT = x.load_hadoop_xml_defaults(
    'plugins/spark/resources/core-default.xml')

HDFS_DEFAULT = x.load_hadoop_xml_defaults(
    'plugins/spark/resources/hdfs-default.xml')

SWIFT_DEFAULTS = swift.read_default_swift_configs()

XML_CONFS = {
    "HDFS": [CORE_DEFAULT, HDFS_DEFAULT, SWIFT_DEFAULTS]
}

_default_executor_classpath = ":".join(
    ['/usr/lib/hadoop/lib/jackson-core-asl-1.8.8.jar',
     '/usr/lib/hadoop/hadoop-swift.jar'])

HADOOP_CONF_DIR = "/opt/hadoop/etc/hadoop"

ENV_CONFS = {
    "HDFS": {
        'Name Node Heap Size': 'HADOOP_NAMENODE_OPTS=\\"-Xmx%sm\\"',
        'Data Node Heap Size': 'HADOOP_DATANODE_OPTS=\\"-Xmx%sm\\"'
    }
}

ENABLE_DATA_LOCALITY = p.Config('Enable Data Locality', 'general', 'cluster',
                                config_type="bool", priority=1,
                                default_value=True, is_optional=True)

ENABLE_SWIFT = p.Config('Enable Swift', 'general', 'cluster',
                        config_type="bool", priority=1,
                        default_value=True, is_optional=False)

# Default set to 1 day, which is the default Keystone token
# expiration time. After the token is expired we can't continue
# scaling anyway.
DECOMMISSIONING_TIMEOUT = p.Config('Decommissioning Timeout', 'general',
                                   'cluster', config_type='int', priority=1,
                                   default_value=86400, is_optional=True,
                                   description='Timeout for datanode'
                                               ' decommissioning operation'
                                               ' during scaling, in seconds')

HIDDEN_CONFS = ['fs.defaultFS', 'dfs.namenode.name.dir',
                'dfs.datanode.data.dir']

CLUSTER_WIDE_CONFS = ['dfs.block.size', 'dfs.permissions', 'dfs.replication',
                      'dfs.replication.min', 'dfs.replication.max',
                      'io.file.buffer.size']

PRIORITY_1_CONFS = ['dfs.datanode.du.reserved',
                    'dfs.datanode.failed.volumes.tolerated',
                    'dfs.datanode.max.xcievers', 'dfs.datanode.handler.count',
                    'dfs.namenode.handler.count']

# for now we have not so many cluster-wide configs
# lets consider all of them having high priority
PRIORITY_1_CONFS += CLUSTER_WIDE_CONFS

def _initialise_configs():
    configs = []
    for service, config_lists in XML_CONFS.iteritems():
        for config_list in config_lists:
            for config in config_list:
                if config['name'] not in HIDDEN_CONFS:
                    cfg = p.Config(config['name'], service, "node",
                                   is_optional=True, config_type="string",
                                   default_value=str(config['value']),
                                   description=config['description'])
                    if cfg.default_value in ["true", "false"]:
                        cfg.config_type = "bool"
                        cfg.default_value = (cfg.default_value == 'true')
                    elif types.is_int(cfg.default_value):
                        cfg.config_type = "int"
                        cfg.default_value = int(cfg.default_value)
                    if config['name'] in CLUSTER_WIDE_CONFS:
                        cfg.scope = 'cluster'
                    if config['name'] in PRIORITY_1_CONFS:
                        cfg.priority = 1
                    configs.append(cfg)

    for service, config_items in ENV_CONFS.iteritems():
        for name, param_format_str in config_items.iteritems():
            configs.append(p.Config(name, service, "node",
                                    default_value=1024, priority=1,
                                    config_type="int"))

    configs.append(DECOMMISSIONING_TIMEOUT)
    configs.append(ENABLE_SWIFT)
    if CONF.enable_data_locality:
        configs.append(ENABLE_DATA_LOCALITY)

    return configs

# Initialise plugin Hadoop configurations
PLUGIN_CONFIGS = _initialise_configs()

def get_plugin_configs():
    return PLUGIN_CONFIGS

def get_config_value(service, name, cluster=None):
    if cluster:
        for ng in cluster.node_groups:
            if (ng.configuration().get(service) and
                    ng.configuration()[service].get(name)):
                return ng.configuration()[service][name]

    for configs in PLUGIN_CONFIGS:
        if configs.applicable_target == service and configs.name == name:
            return configs.default_value

    raise RuntimeError(_("Unable to get parameter '%(param_name)s' from "
                         "service %(service)s"),
                       {'param_name': name, 'service': service})

def generate_cfg_from_general(cfg, configs, general_config,
                              rest_excluded=False):
    if 'general' in configs:
        for nm in general_config:
            if nm not in configs['general'] and not rest_excluded:
                configs['general'][nm] = general_config[nm]['default_value']
        for name, value in configs['general'].items():
            if value:
                cfg = _set_config(cfg, general_config, name)
                LOG.debug("Applying config: {name}".format(name=name))
    else:
        cfg = _set_config(cfg, general_config)
    return cfg

def _get_hostname(service):
    return service.hostname() if service else None

def generate_xml_configs(configs, storage_path, nn_hostname, hadoop_port):
    if hadoop_port is None:
        hadoop_port = 8020

    cfg = {
        'fs.defaultFS': 'hdfs://%s:%s' % (nn_hostname, str(hadoop_port)),
        'dfs.namenode.name.dir': extract_hadoop_path(storage_path,
                                                     '/dfs/nn'),
        'dfs.datanode.data.dir': extract_hadoop_path(storage_path,
                                                     '/dfs/dn'),
        'hadoop.tmp.dir': extract_hadoop_path(storage_path,
                                              '/dfs'),
        'dfs.hosts': '/opt/hadoop/etc/hadoop/dn.incl',
        'dfs.hosts.exclude': '/opt/hadoop/etc/hadoop/dn.excl'
    }

    # inserting user-defined configs
    for key, value in extract_hadoop_xml_confs(configs):
        cfg[key] = value

    # Add the swift defaults if they have not been set by the user
    swft_def = []
    if is_swift_enabled(configs):
        swft_def = SWIFT_DEFAULTS
        swift_configs = extract_name_values(swift.get_swift_configs())
        for key, value in six.iteritems(swift_configs):
            if key not in cfg:
                cfg[key] = value

    # invoking applied configs to appropriate xml files
    core_all = CORE_DEFAULT + swft_def

    if CONF.enable_data_locality:
        cfg.update(topology.TOPOLOGY_CONFIG)
        # applying vm awareness configs
        core_all += topology.vm_awareness_core_config()

    xml_configs = {
        'core-site': x.create_hadoop_xml(cfg, core_all),
        'hdfs-site': x.create_hadoop_xml(cfg, HDFS_DEFAULT)
    }

    return xml_configs

def generate_spark_executor_classpath():
    return " --driver-class-path {0}".format(_default_executor_classpath)

def extract_hadoop_environment_confs(configs):
    """Returns environment specific Hadoop configurations.

    :returns list of Hadoop parameters which should be passed via environment
    """

    lst = []
    for service, srv_confs in configs.items():
        if ENV_CONFS.get(service):
            for param_name, param_value in srv_confs.items():
                for cfg_name, cfg_format_str in ENV_CONFS[service].items():
                    if param_name == cfg_name and param_value is not None:
                        lst.append(cfg_format_str % param_value)
    return lst

def extract_hadoop_xml_confs(configs):
    """Returns xml specific Hadoop configurations.

    :returns list of Hadoop parameters which should be passed into general
    configs like core-site.xml
    """

    lst = []
    for service, srv_confs in configs.items():
        if XML_CONFS.get(service):
            for param_name, param_value in srv_confs.items():
                for cfg_list in XML_CONFS[service]:
                    names = [cfg['name'] for cfg in cfg_list]
                    if param_name in names and param_value is not None:
                        lst.append((param_name, param_value))
    return lst

def generate_hadoop_setup_script(storage_paths, env_configs):
    script_lines = ["#!/bin/bash -x"]
    script_lines.append("echo -n > /tmp/hadoop-env.sh")
    for line in env_configs:
        if 'HADOOP' in line:
            script_lines.append('echo "%s" >> /tmp/hadoop-env.sh' % line)
    script_lines.append("cat /opt/hadoop/etc/hadoop/hadoop-env.sh >> /tmp/hadoop-env.sh")
    script_lines.append("cp /tmp/hadoop-env.sh /opt/hadoop/etc/hadoop/hadoop-env.sh")

    hadoop_log = storage_paths[0] + "/log/hadoop/\$USER/"
    script_lines.append('sed -i "s,export HADOOP_LOG_DIR=.*,'
                        'export HADOOP_LOG_DIR=%s," /opt/hadoop/etc/hadoop/hadoop-env.sh'
                        % hadoop_log)

    hadoop_log = storage_paths[0] + "/log/hadoop/hdfs"
    script_lines.append('sed -i "s,export HADOOP_SECURE_DN_LOG_DIR=.*,'
                        'export HADOOP_SECURE_DN_LOG_DIR=%s," '
                        '/opt/hadoop/etc/hadoop/hadoop-env.sh' % hadoop_log)

    for path in storage_paths:
        script_lines.append("chown -R hadoop:hadoop %s" % path)
        script_lines.append("chmod -R 755 %s" % path)
    return "\n".join(script_lines)

def generate_job_cleanup_config(cluster):
    args = {
        'minimum_cleanup_megabytes': 4096,
        'minimum_cleanup_seconds': 86400,
        'maximum_cleanup_seconds': 1209600
    }
    job_conf = {'valid': (args['maximum_cleanup_seconds'] > 0 and
                          (args['minimum_cleanup_megabytes'] > 0
                           and args['minimum_cleanup_seconds'] > 0))}
    if job_conf['valid']:
        job_conf['cron'] = f.get_file_text(
            'plugins/spark/resources/spark-cleanup.cron'),
        job_cleanup_script = f.get_file_text(
            'plugins/spark/resources/tmp-cleanup.sh.template')
        job_conf['script'] = job_cleanup_script.format(**args)
    return job_conf

def extract_name_values(configs):
    return {cfg['name']: cfg['value'] for cfg in configs}

def make_hadoop_path(base_dirs, suffix):
    return [base_dir + suffix for base_dir in base_dirs]

def extract_hadoop_path(lst, hadoop_dir):
    if lst:
        return ",".join(make_hadoop_path(lst, hadoop_dir))

def _set_config(cfg, gen_cfg, name=None):
    if name in gen_cfg:
        cfg.update(gen_cfg[name]['conf'])
    if name is None:
        for name in gen_cfg:
            cfg.update(gen_cfg[name]['conf'])
    return cfg

def _get_general_config_value(conf, option):
    if 'general' in conf and option.name in conf['general']:
        return conf['general'][option.name]
    return option.default_value

def _get_general_cluster_config_value(cluster, option):
    return _get_general_config_value(cluster.cluster_configs, option)

def is_data_locality_enabled(cluster):
    if not CONF.enable_data_locality:
        return False
    return _get_general_cluster_config_value(cluster, ENABLE_DATA_LOCALITY)

def is_swift_enabled(configs):
    return _get_general_config_value(configs, ENABLE_SWIFT)

def get_decommissioning_timeout(cluster):
    return _get_general_cluster_config_value(cluster, DECOMMISSIONING_TIMEOUT)

def get_port_from_config(service, name, cluster=None):
    address = get_config_value(service, name, cluster)
    return utils.get_port_from_address(address)


text:
#include "config.h"
#include "SetPrototype.h"

#include "CachedCall.h"
#include "Error.h"
#include "ExceptionHelpers.h"
#include "GetterSetter.h"
#include "JSCJSValueInlines.h"
#include "JSFunctionInlines.h"
#include "JSSet.h"
#include "MapData.h"

namespace JSC {

const ClassInfo SetPrototype::s_info = { "Set", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(SetPrototype) };

static EncodedJSValue JSC_HOST_CALL setProtoFuncAdd(ExecState*);
static EncodedJSValue JSC_HOST_CALL setProtoFuncClear(ExecState*);
static EncodedJSValue JSC_HOST_CALL setProtoFuncDelete(ExecState*);
static EncodedJSValue JSC_HOST_CALL setProtoFuncForEach(ExecState*);
static EncodedJSValue JSC_HOST_CALL setProtoFuncHas(ExecState*);

static EncodedJSValue JSC_HOST_CALL setProtoFuncSize(ExecState*);

void SetPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject)
{
    VM& vm = exec->vm();

    Base::finishCreation(vm);
    ASSERT(inherits(info()));
    vm.prototypeMap.addPrototype(this);

    JSC_NATIVE_FUNCTION(vm.propertyNames->add, setProtoFuncAdd, DontEnum, 0);
    JSC_NATIVE_FUNCTION(vm.propertyNames->clear, setProtoFuncClear, DontEnum, 1);
    JSC_NATIVE_FUNCTION(vm.propertyNames->deleteKeyword, setProtoFuncDelete, DontEnum, 1);
    JSC_NATIVE_FUNCTION(vm.propertyNames->forEach, setProtoFuncForEach, DontEnum, 1);
    JSC_NATIVE_FUNCTION(vm.propertyNames->has, setProtoFuncHas, DontEnum, 1);

    GetterSetter* accessor = GetterSetter::create(exec);
    JSFunction* function = JSFunction::create(exec, globalObject, 0, vm.propertyNames->size.string(), setProtoFuncSize);
    accessor->setGetter(exec->vm(), function);
    putDirectAccessor(exec, vm.propertyNames->size, accessor, DontEnum | Accessor);
}

ALWAYS_INLINE static MapData* getMapData(CallFrame* callFrame, JSValue thisValue)
{
    if (!thisValue.isObject()) {
        throwVMError(callFrame, createNotAnObjectError(callFrame, thisValue));
        return 0;
    }
    JSSet* set = jsDynamicCast<JSSet*>(thisValue);
    if (!set) {
        throwTypeError(callFrame, ASCIILiteral("Set operation called on non-Set object"));
        return 0;
    }
    return set->mapData();
}

EncodedJSValue JSC_HOST_CALL setProtoFuncAdd(CallFrame* callFrame)
{
    MapData* data = getMapData(callFrame, callFrame->thisValue());
    if (!data)
        return JSValue::encode(jsUndefined());
    data->set(callFrame, callFrame->argument(0), callFrame->argument(0));
    return JSValue::encode(callFrame->thisValue());
}

EncodedJSValue JSC_HOST_CALL setProtoFuncClear(CallFrame* callFrame)
{
    MapData* data = getMapData(callFrame, callFrame->thisValue());
    if (!data)
        return JSValue::encode(jsUndefined());
    data->clear();
    return JSValue::encode(jsUndefined());
}

EncodedJSValue JSC_HOST_CALL setProtoFuncDelete(CallFrame* callFrame)
{
    MapData* data = getMapData(callFrame, callFrame->thisValue());
    if (!data)
        return JSValue::encode(jsUndefined());
    return JSValue::encode(jsBoolean(data->remove(callFrame, callFrame->argument(0))));
}

EncodedJSValue JSC_HOST_CALL setProtoFuncForEach(CallFrame* callFrame)
{
    MapData* data = getMapData(callFrame, callFrame->thisValue());
    if (!data)
        return JSValue::encode(jsUndefined());
    JSValue callBack = callFrame->argument(0);
    CallData callData;
    CallType callType = getCallData(callBack, callData);
    if (callType == CallTypeNone)
        return JSValue::encode(throwTypeError(callFrame, WTF::ASCIILiteral("Set.prototype.forEach called without callback")));
    JSValue thisValue = callFrame->argument(1);
    VM* vm = &callFrame->vm();
    if (callType == CallTypeJS) {
        JSFunction* function = jsCast<JSFunction*>(callBack);
        CachedCall cachedCall(callFrame, function, 1);
        for (auto ptr = data->begin(), end = data->end(); ptr != end && !vm->exception(); ++ptr) {
            cachedCall.setThis(thisValue);
            cachedCall.setArgument(0, ptr.key());
            cachedCall.call();
        }
    } else {
        for (auto ptr = data->begin(), end = data->end(); ptr != end && !vm->exception(); ++ptr) {
            MarkedArgumentBuffer args;
            args.append(ptr.key());
            JSC::call(callFrame, callBack, callType, callData, thisValue, args);
        }
    }
    return JSValue::encode(jsUndefined());
}

EncodedJSValue JSC_HOST_CALL setProtoFuncHas(CallFrame* callFrame)
{
    MapData* data = getMapData(callFrame, callFrame->thisValue());
    if (!data)
        return JSValue::encode(jsUndefined());
    return JSValue::encode(jsBoolean(data->contains(callFrame, callFrame->argument(0))));
}

EncodedJSValue JSC_HOST_CALL setProtoFuncSize(CallFrame* callFrame)
{
    MapData* data = getMapData(callFrame, callFrame->thisValue());
    if (!data)
        return JSValue::encode(jsUndefined());
    return JSValue::encode(jsNumber(data->size(callFrame)));
}

}


text:
"""The Hash Table module."""

class HashTable(object):
    """Implementation of a hash table."""

    def __init__(self, size, hash_type='naive'):
        """Initializes the hash table based on Key Word arg.

        Methods:

        get(key):Return the value stored with the given key.
        set(key, val):Store the given val using the given key.
        _naive(key):Hash the key provided naively. A basic hash algorithm.
        _bernstein(string): Hash the key using bernstein's method.
        fun_chooser(key):Control which hash method to use.

        """
        if hash_type not in ('bern', 'naive'):
            raise NameError("Hash type must be 'naive' or 'bern'.")
        self.hash_type = hash_type
        self.size = size
        self.hash_table = [[] for i in range(size)]

    def get(self, key):
        """Return the value stored with the given key."""
        hash_key = self.fun_chooser(key) % self.size
        value = self.hash_table[hash_key]
        for val, a_key in value:
            if a_key == key:
                return val

    def set(self, key, val):
        """Store the given val using the given key."""
        if type(key) is not str:
            raise TypeError("Hashes need to be in string format.")
        hash_key = self.fun_chooser(key) % self.size
        self.hash_table[hash_key].append((val, key))

    def _naive(self, key):
        """Hash the key provided naively."""
        hash_key = 0
        for letter in key:
            hash_key += ord(letter)
        return hash_key

    def _bernstein(self, string):
        """Hash the key using bernstein's method."""
        h = 3313  # arbitrary prime number
        for char in string:
            h = ((h << 5) + h) + ord(char)
        return int(int(h) % int(self.size))

    def fun_chooser(self, key):
        """Control which hash method to use."""
        if self.hash_type == 'naive':
            return self._naive(key)
        else:
            return self._bernstein(key)


text:
package com.eitax.recall.yahoo.auction.boot;

import java.io.IOException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.orm.jpa.EntityScan;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.http.client.ClientHttpResponse;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.stereotype.Component;
import org.springframework.web.client.DefaultResponseErrorHandler;
import org.springframework.web.client.HttpServerErrorException;
import org.springframework.web.client.ResponseErrorHandler;
import org.springframework.web.client.RestTemplate;

import com.eitax.recall.dao.impl.RecallDAOImpl;
import com.eitax.recall.yahoo.auction.rest.category.xsd.ChildCategory;
import com.eitax.recall.yahoo.auction.rest.category.xsd.Result;
import com.eitax.recall.yahoo.auction.rest.category.xsd.ResultSet;
import com.eitax.recall.yahoo.dao.impl.YahooCategoryDAOImpl;
import com.eitax.recall.yahoo.model.Category;

@EnableScheduling
@SpringBootApplication
@ComponentScan(basePackages="com.eitan.recall.service")
@EnableJpaRepositories(basePackages="com.eitan.recall.repository")
@EntityScan(basePackages="com.eitan.recall.model")
public class CategoryTreeClient {
    @Autowired
    private YahooCategoryDAOImpl yahooCategoryService;

    private static final Logger log = LoggerFactory.getLogger(CategoryTreeClient.class);

    public static void main(String args[]) throws Exception{
        try (ConfigurableApplicationContext ctx = SpringApplication.run(CategoryTreeClient.class, args)) {
        	CategoryTreeClient m = ctx.getBean(CategoryTreeClient.class);
            m.invoke();
        }
//        SpringApplication.run(CategoryTreeClient.class);
    }

    private void register(Integer categoryId) throws InterruptedException{
    	try{
	    	StringBuffer sb = new StringBuffer();
	    	sb.append("http://auctions.yahooapis.jp/AuctionWebService/V2/categoryTree");
	    	sb.append("?");
	    	sb.append("appid=");
	    	sb.append(System.getProperty("appid"));
	    	sb.append("&");
	    	sb.append("adf=1");
	    	sb.append("&");
	    	sb.append("category=");
	    	sb.append(categoryId);
	    	RestTemplate restTemplate = new RestTemplate();
	//        restTemplate.setErrorHandler(new ResponseErrorHandler(){
	//
	//			@Override
	//			public boolean hasError(ClientHttpResponse response) throws IOException {
	//				// TODO Auto-generated method stub
	//				Thread.sleep(10000);
	//				return false;
	//			}
	//
	//			@Override
	//			public void handleError(ClientHttpResponse response) throws IOException {
	//				// TODO Auto-generated method stub
	//
	//			}
	//        });
	        ResultSet resultSet = restTemplate.getForObject(sb.toString(), ResultSet.class);
	        Result result = resultSet.getResult();
	        if (!result.getIsLeaf()){
	        	for (ChildCategory child : result.getChildCategory()){
		        	Integer yCategoryId = child.getCategoryId();
		        	Boolean isLeaf = child.getIsLeaf();
					Thread.sleep(500);
		        	if (isLeaf){
			        	yahooCategoryService.deleteByYCategoryId(yCategoryId);
			        	Category category = new Category();
			        	category.setCategoryName(child.getCategoryName());
			        	category.setCategoryPath(child.getCategoryPath());
			        	category.setNumOfAuctions(child.getNumOfAuctions());
			        	category.setParentCategoryId(child.getParentCategoryId());
			        	category.setYCategoryId(yCategoryId);
			        	yahooCategoryService.save(category);
		        	}
		        	else{
		        		register(yCategoryId);
		        	}
		        }
	        }
    	}
    	catch(HttpServerErrorException e){
    		e.printStackTrace();
			Thread.sleep(10000);
    		register(categoryId);
    	}
    }

    public void invoke() throws Exception {
    	register(0);
//        for (child childCategory : rootResult.getChildCategory()){
//        	Integer yCategoryId = childCategory.getCategoryId();
//        	System.out.println(yCategoryId);
//        	yahooCategoryService.deleteByYCategoryId(yCategoryId);
//        	Category category = new Category();
//        	category.setCategoryName(childCategory.getCategoryName());
//        	category.setCategoryPath(childCategory.getCategoryPath());
//        	category.setNumOfAuctions(childCategory.getNumOfAuctions());
//        	category.setParentCategoryId(childCategory.getParentCategoryId());
//        	category.setYCategoryId(yCategoryId);
//        	yahooCategoryService.save(category);
//        	StringBuffer sb = new StringBuffer();
//        	sb.append("http://auctions.yahooapis.jp/AuctionWebService/V2/categoryTree");
//        	sb.append("?");
//        	sb.append("appid=");
//        	sb.append(System.getProperty("appid"));
//        	sb.append("&");
//        	sb.append("adf=1");
//        	sb.append("&");
//        	sb.append("category=");
//        	sb.append(yCategoryId);
//            ResultSet resultSet = restTemplate.getForObject(sb.toString(), ResultSet.class);
//            Result result = resultSet.getResult();
//            for (ChildCategory childCategory : result.getChildCategory()){
//
//            }
//        }

//        log.info(rootResultSet.toString());
//        System.out.println("########");
    }
}