text:
////////////////////////////////////////////////////////////////////////////////
// checkstyle: Checks Java source code for adherence to a set of rules.
// Copyright (C) 2001-2015 the original author or authors.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
////////////////////////////////////////////////////////////////////////////////

package com.puppycrawl.tools.checkstyle.checks.coding;

import com.puppycrawl.tools.checkstyle.Utils;
import com.puppycrawl.tools.checkstyle.api.DetailAST;
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
import com.puppycrawl.tools.checkstyle.checks.DescendantTokenCheck;

/**
 *

 * Checks that classes (except abstract one) define a ctor and don't rely
 * on the default one.
 *

 *

 * An example of how to configure the check is:
 *

 *

 * <module name="MissingCtor"/>
 *

 *
 * @author o_sukhodolsky
 */
public class MissingCtorCheck extends DescendantTokenCheck {

    /**
     * A key is pointing to the warning message text in "messages.properties"
     * file.
     */
    public static final String MSG_KEY = "missing.ctor";

    /** Creates new instance of the check. */
    public MissingCtorCheck() {
        setLimitedTokens(Utils.getTokenName(TokenTypes.CTOR_DEF));
        setMinimumNumber(1);
        setMaximumDepth(2);
        setMinimumMessage(MSG_KEY);
    }

    @Override
    public int[] getDefaultTokens() {
        return new int[]{TokenTypes.CLASS_DEF};
    }

    @Override
    public int[] getAcceptableTokens() {
        return getDefaultTokens();
    }

    @Override
    public int[] getRequiredTokens() {
        return getDefaultTokens();
    }

    @Override
    public void visitToken(DetailAST ast) {
        final DetailAST modifiers = ast.findFirstToken(TokenTypes.MODIFIERS);
        if (!modifiers.branchContains(TokenTypes.ABSTRACT)) {
            super.visitToken(ast);
        }
    }
}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Cake.Core;

namespace Cake.Common.Build.AppVeyor.Data
{
    /// <summary>
    /// Provides AppVeyor tag information for a current build.
    /// </summary>
    public sealed class AppVeyorTagInfo : AppVeyorInfo
    {
        /// <summary>
        /// Gets a value indicating whether build was started by pushed tag.
        /// </summary>
        /// <value>
        ///   <c>true</c> if build was started by pushed tag; otherwise, <c>false</c>.
        /// </value>
        public bool IsTag => GetEnvironmentBoolean("APPVEYOR_REPO_TAG");

        /// <summary>
        /// Gets the name for builds started by tag; otherwise this variable is undefined.
        /// </summary>
        /// <value>
        ///   The name of the tag.
        /// </value>
        public string Name => GetEnvironmentString("APPVEYOR_REPO_TAG_NAME");

        /// <summary>
        /// Initializes a new instance of the <see cref="AppVeyorTagInfo"/> class.
        /// </summary>
        /// <param name="environment">The environment.</param>
        public AppVeyorTagInfo(ICakeEnvironment environment)
            : base(environment)
        {
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using Aga.Controls.Tree.NodeControls;
using System.Drawing.Imaging;
using System.Threading;

namespace Aga.Controls.Tree
{
	public partial class TreeViewAdv
	{
		#region Keys

		protected override bool IsInputChar(char charCode)
		{
			return true;
		}

		protected override bool IsInputKey(Keys keyData)
		{
			if (((keyData & Keys.Up) == Keys.Up)
				|| ((keyData & Keys.Down) == Keys.Down)
				|| ((keyData & Keys.Left) == Keys.Left)
				|| ((keyData & Keys.Right) == Keys.Right))
				return true;
			else
				return base.IsInputKey(keyData);
		}

		internal void ChangeInput()
		{
			if ((ModifierKeys & Keys.Shift) == Keys.Shift)
			{
				if (!(Input is InputWithShift))
					Input = new InputWithShift(this);
			}
			else if ((ModifierKeys & Keys.Control) == Keys.Control)
			{
				if (!(Input is InputWithControl))
					Input = new InputWithControl(this);
			}
			else
			{
				if (!(Input.GetType() == typeof(NormalInputState)))
					Input = new NormalInputState(this);
			}
		}

		protected override void OnKeyDown(KeyEventArgs e)
		{
			base.OnKeyDown(e);
			if (!e.Handled)
			{
				if (e.KeyCode == Keys.ShiftKey || e.KeyCode == Keys.ControlKey)
					ChangeInput();
				Input.KeyDown(e);
				if (!e.Handled)
				{
					foreach (NodeControlInfo item in GetNodeControls(CurrentNode))
					{
						item.Control.KeyDown(e);
						if (e.Handled)
							break;
					}
				}
			}
		}

		protected override void OnKeyUp(KeyEventArgs e)
		{
			base.OnKeyUp(e);
			if (!e.Handled)
			{
				if (e.KeyCode == Keys.ShiftKey || e.KeyCode == Keys.ControlKey)
					ChangeInput();
				if (!e.Handled)
				{
					foreach (NodeControlInfo item in GetNodeControls(CurrentNode))
					{
						item.Control.KeyUp(e);
						if (e.Handled)
							return;
					}
				}
			}
		}

		protected override void OnKeyPress(KeyPressEventArgs e)
		{
			base.OnKeyPress(e);
			if (!e.Handled)
				_search.Search(e.KeyChar);
		}

		#endregion

		#region Mouse

		private TreeNodeAdvMouseEventArgs CreateMouseArgs(MouseEventArgs e)
		{
			TreeNodeAdvMouseEventArgs args = new TreeNodeAdvMouseEventArgs(e);
			args.ViewLocation = new Point(e.X + OffsetX,
				e.Y + _rowLayout.GetRowBounds(FirstVisibleRow).Y - ColumnHeaderHeight);
			args.ModifierKeys = ModifierKeys;
			args.Node = GetNodeAt(e.Location);
			NodeControlInfo info = GetNodeControlInfoAt(args.Node, e.Location);
			args.ControlBounds = info.Bounds;
			args.Control = info.Control;
			return args;
		}

		protected override void OnMouseWheel(MouseEventArgs e)
		{
			_search.EndSearch();
			if (SystemInformation.MouseWheelScrollLines > 0)
			{
				int lines = e.Delta / 120 * SystemInformation.MouseWheelScrollLines;
				int newValue = _vScrollBar.Value - lines;
				newValue = Math.Min(_vScrollBar.Maximum - _vScrollBar.LargeChange + 1, newValue);
				newValue = Math.Min(_vScrollBar.Maximum, newValue);
				_vScrollBar.Value = Math.Max(_vScrollBar.Minimum, newValue);
			}
			base.OnMouseWheel(e);
		}

		protected override void OnMouseDown(MouseEventArgs e)
		{
			if (CurrentEditorOwner != null)
			{
				CurrentEditorOwner.EndEdit(true);
				return;
			}

			if (!Focused)
				Focus();

			_search.EndSearch();
			if (e.Button == MouseButtons.Left)
			{
				TreeColumn c;
				c = GetColumnDividerAt(e.Location);
				if (c != null)
				{
					Input = new ResizeColumnState(this, c, e.Location);
					return;
				}
				c = GetColumnAt(e.Location);
				if (c != null)
				{
					Input = new ClickColumnState(this, c, e.Location);
					UpdateView();
					return;
				}
			}

			ChangeInput();
			TreeNodeAdvMouseEventArgs args = CreateMouseArgs(e);

			if (args.Node != null && args.Control != null)
				args.Control.MouseDown(args);

			if (!args.Handled)
				Input.MouseDown(args);

			base.OnMouseDown(e);
		}

		protected override void OnMouseClick(MouseEventArgs e)
		{
			//TODO: Disable when click on plusminus icon
			TreeNodeAdvMouseEventArgs args = CreateMouseArgs(e);
			if (args.Node != null)
				OnNodeMouseClick(args);

			base.OnMouseClick(e);
		}

		protected override void OnMouseDoubleClick(MouseEventArgs e)
		{
			TreeNodeAdvMouseEventArgs args = CreateMouseArgs(e);

			if (args.Node != null && args.Control != null)
				args.Control.MouseDoubleClick(args);

			if (!args.Handled)
			{
				if (args.Node != null)
					OnNodeMouseDoubleClick(args);
				else
					Input.MouseDoubleClick(args);

				if (!args.Handled)
				{
					if (args.Node != null && args.Button == MouseButtons.Left)
						args.Node.IsExpanded = !args.Node.IsExpanded;
				}
			}

			base.OnMouseDoubleClick(e);
		}

		protected override void OnMouseUp(MouseEventArgs e)
		{
			TreeNodeAdvMouseEventArgs args = CreateMouseArgs(e);
			if (Input is ResizeColumnState)
				Input.MouseUp(args);
			else
			{
				if (args.Node != null && args.Control != null)
					args.Control.MouseUp(args);
				if (!args.Handled)
					Input.MouseUp(args);

				base.OnMouseUp(e);
			}
		}

		protected override void OnMouseMove(MouseEventArgs e)
		{
			if (Input.MouseMove(e))
				return;

			base.OnMouseMove(e);
			SetCursor(e);
			UpdateToolTip(e);
			if (ItemDragMode && Dist(e.Location, ItemDragStart) > ItemDragSensivity
				&& CurrentNode != null && CurrentNode.IsSelected)
			{
				ItemDragMode = false;
				_toolTip.Active = false;
				OnItemDrag(e.Button, Selection.ToArray());
			}
		}

		protected override void OnMouseLeave(EventArgs e)
		{
			_hotColumn = null;
			UpdateHeaders();
			base.OnMouseLeave(e);
		}

		private void SetCursor(MouseEventArgs e)
		{
			TreeColumn col;
			col = GetColumnDividerAt(e.Location);
			if (col == null)
				_innerCursor = null;
			else
			{
				if (col.Width == 0)
					_innerCursor = ResourceHelper.DVSplitCursor;
				else
					_innerCursor = Cursors.VSplit;
			}

			col = GetColumnAt(e.Location);
			if (col != _hotColumn)
			{
				_hotColumn = col;
				UpdateHeaders();
			}
		}

		internal TreeColumn GetColumnAt(Point p)
		{
			if (p.Y > ColumnHeaderHeight)
				return null;

			int x = -OffsetX;
			foreach (TreeColumn col in Columns)
			{
				if (col.IsVisible)
				{
					Rectangle rect = new Rectangle(x, 0, col.Width, ColumnHeaderHeight);
					x += col.Width;
					if (rect.Contains(p))
						return col;
				}
			}
			return null;
		}

		internal int GetColumnX(TreeColumn column)
		{
			int x = -OffsetX;
			foreach (TreeColumn col in Columns)
			{
				if (col.IsVisible)
				{
					if (column == col)
						return x;
					else
						x += col.Width;
				}
			}
			return x;
		}

		internal TreeColumn GetColumnDividerAt(Point p)
		{
			if (p.Y > ColumnHeaderHeight)
				return null;

			int x = -OffsetX;
			TreeColumn prevCol = null;
			Rectangle left, right;
			foreach (TreeColumn col in Columns)
			{
				if (col.IsVisible)
				{
					if (col.Width > 0)
					{
						left = new Rectangle(x, 0, DividerWidth / 2, ColumnHeaderHeight);
						right = new Rectangle(x + col.Width - (DividerWidth / 2), 0, DividerWidth / 2, ColumnHeaderHeight);
						if (left.Contains(p) && prevCol != null)
							return prevCol;
						else if (right.Contains(p))
							return col;
					}
					prevCol = col;
					x += col.Width;
				}
			}

			left = new Rectangle(x, 0, DividerWidth / 2, ColumnHeaderHeight);
			if (left.Contains(p) && prevCol != null)
				return prevCol;

			return null;
		}

		TreeColumn _tooltipColumn;
		private void UpdateToolTip(MouseEventArgs e)
		{
			TreeColumn col = GetColumnAt(e.Location);
			if (col != null)
			{
				if (col != _tooltipColumn)
					SetTooltip(col.TooltipText);
			}
			else
				DisplayNodesTooltip(e);
			_tooltipColumn = col;
		}

		TreeNodeAdv _hotNode;
		NodeControl _hotControl;
		private void DisplayNodesTooltip(MouseEventArgs e)
		{
			if (ShowNodeToolTips)
			{
				TreeNodeAdvMouseEventArgs args = CreateMouseArgs(e);
				if (args.Node != null && args.Control != null)
				{
					if (args.Node != _hotNode || args.Control != _hotControl)
						SetTooltip(GetNodeToolTip(args));
				}
				else
					_toolTip.SetToolTip(this, null);

				_hotControl = args.Control;
				_hotNode = args.Node;
			}
			else
				_toolTip.SetToolTip(this, null);
		}

		private void SetTooltip(string text)
		{
			if (!String.IsNullOrEmpty(text))
			{
				_toolTip.Active = false;
				_toolTip.SetToolTip(this, text);
				_toolTip.Active = true;
			}
			else
				_toolTip.SetToolTip(this, null);
		}

		private string GetNodeToolTip(TreeNodeAdvMouseEventArgs args)
		{
			string msg = args.Control.GetToolTip(args.Node);

			BaseTextControl btc = args.Control as BaseTextControl;
			if (btc != null && btc.DisplayHiddenContentInToolTip && String.IsNullOrEmpty(msg))
			{
				Size ms = btc.GetActualSize(args.Node, _measureContext);
				if (ms.Width > args.ControlBounds.Size.Width || ms.Height > args.ControlBounds.Size.Height
					|| args.ControlBounds.Right - OffsetX > DisplayRectangle.Width)
					msg = btc.GetLabel(args.Node);
			}

			if (String.IsNullOrEmpty(msg) && DefaultToolTipProvider != null)
				msg = DefaultToolTipProvider.GetToolTip(args.Node, args.Control);

			return msg;
		}

		#endregion

		#region DragDrop

		private bool _dragAutoScrollFlag = false;
		private Bitmap _dragBitmap = null;
		private System.Threading.Timer _dragTimer;

		private void StartDragTimer()
		{
			if (_dragTimer == null)
				_dragTimer = new System.Threading.Timer(new TimerCallback(DragTimerTick), null, 0, 100);
		}

		private void StopDragTimer()
		{
			if (_dragTimer != null)
			{
				_dragTimer.Dispose();
				_dragTimer = null;
			}
		}

		private void SetDropPosition(Point pt)
		{
			TreeNodeAdv node = GetNodeAt(pt);
			OnDropNodeValidating(pt, ref node);
			_dropPosition.Node = node;
			if (node != null)
			{
				Rectangle first = _rowLayout.GetRowBounds(FirstVisibleRow);
				Rectangle bounds = _rowLayout.GetRowBounds(node.Row);
				float pos = (pt.Y + first.Y - ColumnHeaderHeight - bounds.Y) / (float)bounds.Height;
				if (pos < TopEdgeSensivity)
					_dropPosition.Position = NodePosition.Before;
				else if (pos > (1 - BottomEdgeSensivity))
					_dropPosition.Position = NodePosition.After;
				else
					_dropPosition.Position = NodePosition.Inside;
			}
		}

		private void DragTimerTick(object state)
		{
			_dragAutoScrollFlag = true;
		}

		private void DragAutoScroll()
		{
			_dragAutoScrollFlag = false;
			Point pt = PointToClient(MousePosition);
			if (pt.Y < 20 && _vScrollBar.Value > 0)
				_vScrollBar.Value--;
			else if (pt.Y > Height - 20 && _vScrollBar.Value <= _vScrollBar.Maximum - _vScrollBar.LargeChange)
				_vScrollBar.Value++;
		}

		public void DoDragDropSelectedNodes(DragDropEffects allowedEffects)
		{
			if (SelectedNodes.Count > 0)
			{
				TreeNodeAdv[] nodes = new TreeNodeAdv[SelectedNodes.Count];
				SelectedNodes.CopyTo(nodes, 0);
				DoDragDrop(nodes, allowedEffects);
			}
		}

		private void CreateDragBitmap(IDataObject data)
		{
			if (UseColumns || !DisplayDraggingNodes)
				return;

			TreeNodeAdv[] nodes = data.GetData(typeof(TreeNodeAdv[])) as TreeNodeAdv[];
			if (nodes != null && nodes.Length > 0)
			{
				Rectangle rect = DisplayRectangle;
				Bitmap bitmap = new Bitmap(rect.Width, rect.Height);
				using (Graphics gr = Graphics.FromImage(bitmap))
				{
					gr.Clear(BackColor);
					DrawContext context = new DrawContext();
					context.Graphics = gr;
					context.Font = Font;
					context.Enabled = true;
					int y = 0;
					int maxWidth = 0;
					foreach (TreeNodeAdv node in nodes)
					{
						if (node.Tree == this)
						{
							int x = 0;
							int height = _rowLayout.GetRowBounds(node.Row).Height;
							foreach (NodeControl c in NodeControls)
							{
								Size s = c.GetActualSize(node, context);
								if (!s.IsEmpty)
								{
									int width = s.Width;
									rect = new Rectangle(x, y, width, height);
									x += (width + 1);
									context.Bounds = rect;
									c.Draw(node, context);
								}
							}
							y += height;
							maxWidth = Math.Max(maxWidth, x);
						}
					}

					if (maxWidth > 0 && y > 0)
					{
						_dragBitmap = new Bitmap(maxWidth, y, PixelFormat.Format32bppArgb);
						using (Graphics tgr = Graphics.FromImage(_dragBitmap))
							tgr.DrawImage(bitmap, Point.Empty);
						BitmapHelper.SetAlphaChanelValue(_dragBitmap, 150);
					}
					else
						_dragBitmap = null;
				}
			}
		}

		protected override void OnDragOver(DragEventArgs drgevent)
		{
			ItemDragMode = false;
			Point pt = PointToClient(new Point(drgevent.X, drgevent.Y));
			if (_dragAutoScrollFlag)
				DragAutoScroll();
			SetDropPosition(pt);
			UpdateView();
			base.OnDragOver(drgevent);
		}

		protected override void OnDragEnter(DragEventArgs drgevent)
		{
			_search.EndSearch();
			DragMode = true;
			CreateDragBitmap(drgevent.Data);
			base.OnDragEnter(drgevent);
		}

		protected override void OnDragLeave(EventArgs e)
		{
			DragMode = false;
			UpdateView();
			base.OnDragLeave(e);
		}

		protected override void OnDragDrop(DragEventArgs drgevent)
		{
			DragMode = false;
			UpdateView();
			base.OnDragDrop(drgevent);
		}

		#endregion
	}
}


text:
<!DOCTYPE html>

    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title></title>
    <link rel="Stylesheet" href="../css/analysis.css" />

Udled nye steder

Med dette værktøj udledes nye objekter i dit undersøgelsesområde, der opfylder en række kriterier, som du har angivet. Kriterierne kan være baseret på attribut-forespørgsler (f.eks. ledige parceller) og rumlige forespørgsler (f.eks. parceller inden for oversvømmelseszoner).

Hvis feltet  Brug aktuel kortudstrækning er markeret, er det kun objekterne, der er synlige inden for den aktuelle kortudstrækning, der analyseres. Hvis det ikke er markeret, analyseres alle objekter, selv om de er uden for den aktuelle kortudstrækning.

Udled nye steder, der matcher følgende udtryk

Klik på knappen  Tilføj udtryk for at definere et udtryk. Du kan tilføje flere udtryk. Når du har angivet udtrykkene og klikket på knappen Kør analyse, filtreres objekterne i dit analyselag gennem hvert udtryk. Den del af objekterne, der opfylder alle udtryk, skrives til resultatlaget.

Der er to grundlæggende typer udtryk, du kan oprette: attribut og rumlig. Attributudtryk er forespørgsler om feltværdier, f.eks.  hvor navn er "San Francisco". Der er fire typer spatiale udtryk:

 inden for en afstand på: dele af en feature inden for en afstand af en feature i et andet lag. F.eks. find den andel af parceller, der ligger inden for 500 meter fra Los Angeles River.

 indeholder alle: objektet skal indeholde alle dele af et objekt i et andet lag. F.eks. find vandskel, der indeholder alle dele af parceller angivet til industriel brug. Ingen del af parcellen må ligge uden for vandskellet.

 helt omgivet: objektet skal være helt omgivet af et objekt i et andet lag. F.eks. find skoledistrikter, der er helt omgivet af en bygrænse. Ingen del af skoledistriktet må ligge uden for bygrænsen.

 gennemskærer: objektet eller dele af objektet skal overlappe eller gennemskære et objekt i et andet lag. Find f.eks. områder med brændt vegetation efter flere brande i en nationalpark. Afbrændte områder uden for parkens grænser medtages ikke.

Hvert rumligt udtryk har en tilsvarende negation (nægtelse);  ikke inden for en afstand af, indeholder ikke alle, ikke helt omgivet og gennemskærer ikke.

Navn på resultatlag

Dette er navnet på det lag, som oprettes i  Mit indhold og føjes til kortet. Standardnavnet er baseret på navnet på værktøjet og navnet på inputlaget. Hvis laget allerede findes, vil du blive bedt om at angive et andet navn.

Ved hjælp af rullelisten  Gem resultat i kan du angive navnet på en mappe i Mit indhold, hvor resultatet skal gemmes.


text:
  <md-content class="md-padding" layout="column">

Display a set of items as chips.

    <md-chips input-aria-label="Favorite Sports" input-aria-describedby="staticChipsNote">
      <md-chip>Baseball</md-chip>
      <md-chip>Hockey</md-chip>
      <md-chip>Lacrosse</md-chip>

      <md-chip>{{ctrl.chipText}}</md-chip>
    </md-chips>

      Static chips cannot be selected, removed or edited, and are not part of any model.

      If no ng-model is provided, there are no input elements in md-chips.

  </md-content>


text:
<?php
/*
Purpose: This file will call the initialisation file for the Autorium in case where the DB settings file is not
found, or the file is corrupted.
*/
file_put_contents('autorium.init.log',"\n\n*****************************\n",FILE_APPEND);
file_put_contents('autorium.init.log',"Autorium Init Log: " . date('Y-m-d H:i:s') . "\n",FILE_APPEND);
file_put_contents('autorium.init.log',"Starting Init routine for Autorium\n",FILE_APPEND);
// Rename the DB file if it exists
if(file_exists('autorium.settings.db')){
    file_put_contents('autorium.init.log',"Settings DB file already exists. Renaming it to avoid conflict\n",FILE_APPEND);
    rename('autorium.settings.db',date('YmdHis') . ".autorium.settings.db");
}

// Create the DB
file_put_contents('autorium.init.log',"Creating new settings DB file\n",FILE_APPEND);
$init_db  = new SQLite3('autorium.settings.db');
$init_query = "CREATE TABLE autorium_settings (
    settingsId integer PRIMARY KEY,
    autoriumId text,
    aquariumShape integer,
    aquariumWidth integer,
    aquariumLength integer,
    aquariumHeight integer,
    aquariumDiameter integer,
    maxWaterLevel integer,
    minWaterLevel integer,
    autoriumOperationMode integer,
    waterLevel integer,
    minTemperature integer,
    maxTemperature integer
   );";
$init_result = $init_db->query($init_query);

// Get the RPI serial number
file_put_contents('autorium.init.log',"Fetching Autorium serial number\n",FILE_APPEND);
$autoriumId = `cat /proc/cpuinfo | grep Serial | cut -d ' ' -f 2`;
$autoriumId =  trim($autoriumId);

// Store it in the settings DB
file_put_contents('autorium.init.log',"Storing Autorium serial number {$autoriumId} in DB\n",FILE_APPEND);
$init_result = $init_db->query("Insert into autorium_settings(settingsId, autoriumId, autoriumOperationMode, minTemperature, maxTemperature) values(1,'$autoriumId',0,20,32)");

// Register the autorium instance on the server
file_put_contents('autorium.init.log',"Registering Autorium on the server\n",FILE_APPEND);
//$autoriumRegisterData = file_get_contents("https://autorium.in/register.php?action=register&autorium_id=$autoriumId");
$autoriumRegisterData = file_get_contents("https://gorillastudios.in/autorium/?action=register&autorium_id=$autoriumId");
if($autoriumRegisterData===false){
    // Unable to contact server. Reverse back all the changes
    file_put_contents('autorium.init.log',"Unable to register Autorium on the server. Reverting back the changes and exiting init routine\n",FILE_APPEND);
    unlink('autorium.settings.db');
    die();
}
$autoriumJsonObj = json_decode($autoriumRegisterData);
file_put_contents('autorium.init.log',"Autorium Registration result -> " . $autoriumJsonObj->{'status_code'} . " \n",FILE_APPEND);

$init_db->close();

// Set Autorium init status to 2
if($autoriumJsonObj->{'status_code'}==0){
    $autoriumInit = 2;
    file_put_contents('autorium.init.log',"Autorium Registration successful\n",FILE_APPEND);
}else{
    file_put_contents('autorium.init.log',"Autorium Registration not successful: " . $autoriumJsonObj->{'status_code'} . "\n",FILE_APPEND);
}
file_put_contents('autorium.init.log',"Basic initialisation of Autorium complete on " . date('Y-m-d H:i:s') . ". Please configure further settings through App or web console to activate Autorium\n",FILE_APPEND);
// Note: Values for the DB needs to filled through app or web. The app needs to exit now and wait for complete configuration.
?>


text:
"use strict";
exports.__esModule = true;
//# sourceMappingURL=fields.js.map


text:
'''
Units
=====

The Units provide a set of classes to manage units and unit conversion.

'''

class UnitList:
    '''A class to manage units and to convert values.
    '''
    def __init__(self, baseUnitAbbr, baseUnitName):
        self.baseUnitAbbr = baseUnitAbbr
        self.baseUnitName = baseUnitName
        self.units = {}
        self.units[baseUnitAbbr] = [baseUnitName, 1]

    def add_unit(self, unitAbbr, unitName, unitFactor = 1):
        self.units[unitAbbr] = [unitName, unitFactor]

    def get_factor(self, unitAbbr):
        return self.units[unitAbbr][1]

    def convert_to_unit(self, value, from_unit, to_unit):
        convertedValue = value * self.get_factor(from_unit) / self.get_factor(to_unit)
        return float(convertedValue)

class BaseUnits:
    '''A class use to be herited to convert value
    '''

    @classmethod
    def convert_unit(self, value, from_unit, to_unit):
        """
        @param value: the value to convert
        @type value: float
        @param from_unit: the unit of the value
        @type from_unit: unicode
        @param to_unit: the unit to get
        @type to_unit: unicode"""
        raise NotImplementedError("""You must implement convert_unit's
            %s method""" % type(self).__name__)

class LengthUnits(BaseUnits):
    '''A class use to convert length (only the metric system)
    It handles µm, mm, cm and m.
    '''
    unitList = UnitList('m', 'metter')
    unitList.add_unit('cm', 'centimetter', 0.01)
    unitList.add_unit('mm', 'millimetter', 0.001)
    unitList.add_unit(u'µm', 'micrometter', 0.000001)

    @classmethod
    def convert_unit(cls, value, from_unit, to_unit):
        '''Convert the value from an unit to another unit
        @param value: the value to convert
        @type value: float
        @param from_unit: the unit of the value
        @type from_unit: unicode
        @param to_unit: the unit to get
        @type to_unit: unicode
        @return: the value converted
        @rtype: float'''
        val = cls.unitList.convert_to_unit(value, from_unit, to_unit)
        return float(val)

class PressureUnits(BaseUnits):
    '''A class use to convert pressure.
    It handles pa, mbar, bar and psi.
    '''
    unitList = UnitList('pa', 'pascal')
    unitList.add_unit('bar', 'bar',  100000.0)
    unitList.add_unit('mbar', 'millibar',  100.0)
    unitList.add_unit('psi', 'psi', 6894.8)

    @classmethod
    def convert_unit(cls, value, from_unit, to_unit):
        '''Convert the value from an unit to another unit
        @param value: the value to convert
        @type value: float
        @param from_unit: the unit of the value
        @type from_unit: unicode
        @param to_unit: the unit to get
        @type to_unit: unicode
        @return: the value converted
        @rtype: float'''
        val = cls.unitList.convert_to_unit(value, from_unit, to_unit)
        return float(val)

class TimeUnits(BaseUnits):
    '''A class use to convert time.
    It handles s, min and h.
    '''
    unitList = UnitList('s','seconde')
    unitList.add_unit('min','minute', 60.0)
    unitList.add_unit('h','hour', 3600.0)

    @classmethod
    def convert_unit(cls, value, from_unit, to_unit):
        '''Convert the value from an unit to another unit
        @param value: the value to convert
        @type value: float
        @param from_unit: the unit of the value
        @type from_unit: unicode
        @param to_unit: the unit to get
        @type to_unit: unicode
        @return: the value converted
        @rtype: float'''
        val = cls.unitList.convert_to_unit(value, from_unit, to_unit)
        return float(val)

class ConcentrationUnits(BaseUnits):
    '''A class use to convert concentration.
    It handles g/L and mg/L.
    '''
    unitList = UnitList('g/L','gramm per litter')
    unitList.add_unit('mg/L','milligram per litter', 0.001)

    @classmethod
    def convert_unit(cls, value, from_unit, to_unit):
        '''Convert the value from an unit to another unit
        @param value: the value to convert
        @type value: float
        @param from_unit: the unit of the value
        @type from_unit: unicode
        @param to_unit: the unit to get
        @type to_unit: unicode
        @return: the value converted
        @rtype: float'''
        val = cls.unitList.convert_to_unit(value, from_unit, to_unit)
        return float(val)

class MolConcentrationUnits(BaseUnits):
    '''A class use to convert molar concentration.
    It handles mol/L and mmol/L.
    '''
    unitList = UnitList('mol/L','mol per litter')
    unitList.add_unit('mmol/L','millimol per litter', 0.001)

    @classmethod
    def convert_unit(cls, value, from_unit, to_unit):
        '''Convert the value from an unit to another unit
        @param value: the value to convert
        @type value: float
        @param from_unit: the unit of the value
        @type from_unit: unicode
        @param to_unit: the unit to get
        @type to_unit: unicode
        @return: the value converted
        @rtype: float'''
        val = cls.unitList.convert_to_unit(value, from_unit, to_unit)
        return float(val)

class MolWeightUnits(BaseUnits):
    '''A class use to convert molar weight.
    It handles g/mol and mg/mol.
    '''
    unitList = UnitList('g/mol','gramm per mol')
    unitList.add_unit('mg/mol','milligram per mol', 0.001)

    @classmethod
    def convert_unit(cls, value, from_unit, to_unit):
        '''Convert the value from an unit to another unit
        @param value: the value to convert
        @type value: float
        @param from_unit: the unit of the value
        @type from_unit: unicode
        @param to_unit: the unit to get
        @type to_unit: unicode
        @return: the value converted
        @rtype: float'''
        val = cls.unitList.convert_to_unit(value, from_unit, to_unit)
        return float(val)

class VoltUnits(BaseUnits):
    '''A class use to convert the volt familly.
    It handles V, mV and KV.
    '''
    unitList = UnitList('V','Volt')
    unitList.add_unit('mV','millivolt', 0.001)
    unitList.add_unit('KV','kilovolt', 1000)

    @classmethod
    def convert_unit(cls, value, from_unit, to_unit):
        '''Convert the value from an unit to another unit
        @param value: the value to convert
        @type value: float
        @param from_unit: the unit of the value
        @type from_unit: unicode
        @param to_unit: the unit to get
        @type to_unit: unicode
        @return: the value converted
        @rtype: float'''
        val = cls.unitList.convert_to_unit(value, from_unit, to_unit)
        return float(val)

if __name__ == "__main__":
    print(LengthUnits.convert_unit(1000, u'µm', 'm'))
    print(LengthUnits.convert_unit(100, 'cm', u'µm'))
    print(PressureUnits.convert_unit(3, 'psi', 'pa'))
    print(PressureUnits.convert_unit(1, 'bar', 'pa'))
    print(TimeUnits.convert_unit(30, 's', 'min'))
    print(ConcentrationUnits.convert_unit(42, 'mg/L', 'g/L'))


text:
  Back to List
  <course [authorsCandidates]="authorsCandidates"
          [isBlank]="true"
          (add)="addCourse($event)">
  </course>


text:
[![Build Status](https://travis-ci.org/ikr/tv4-formats.svg?branch=master)](https://travis-ci.org/ikr/tv4-formats)

# About

Provides the implementation of common [JSON Schema](http://json-schema.org/) string format
constraints in the form of
[tv4 validator callbacks.](https://github.com/geraintluff/tv4#addformatformat-validationfunction)
Thus, it's a plug-in for [tv4.](https://github.com/geraintluff/tv4)

# Usage

First, install it, together with tv4 itself, via Node.js'es [npm](https://www.npmjs.org/) into your
project

    $ npm install --save tv4 tv4-formats

Then, in the code

```javascript
var tv4 = require('tv4'),
    formats = require('tv4-formats'),
    assert = require('assert'),
    validator = tv4.freshApi(),
    schema = {type: 'string', format: 'date'};

validator.addFormat(formats);
assert(validator.validate('2014-02-11', schema));  // Valid ISO 8601 date
assert(!validator.validate('2014-02-29', schema)); // Invalid. Only 28 days in this February
assert(!validator.validate('11.02.2014', schema)); // Invalid. Wrong date format
```

Here, the `format: 'date'` part of the schema validation is provided by `tv4-formats` package.

# Supported formats

* date (YYYY-MM-DD)
* date-time (for example, 2014-05-02T12:59:29+00:00)
* email
* uri
* url
* credit-card-number
* [duration](http://en.wikipedia.org/wiki/Iso8601#Durations) (for example, P1DT12H for 1.5 days)


text:
//
// requirement - Code Requirement Blob description
//
#ifndef _H_REQUIREMENT
#define _H_REQUIREMENT

#include <security_utilities/blob.h>
#include <security_utilities/superblob.h>
#include <security_utilities/hashing.h>
#include <Security/CodeSigning.h>
#include "codedirectory.h"
#include <map>

namespace Security {
namespace CodeSigning {

//
// Single requirement.
// This is a contiguous binary blob, starting with this header
// and followed by binary expr-code. All links within the blob
// are offset-relative to the start of the header.
// This is designed to be a binary stable format. Note that we restrict
// outselves to 4GB maximum size (4 byte size/offset), and we expect real
// Requirement blobs to be fairly small (a few kilobytes at most).
//
// The "kind" field allows for adding different kinds of Requirements altogether
// in the future. We expect to stay within the framework of "opExpr" requirements,
// but it never hurts to have a way out.
//
class Requirement: public Blob<Requirement, 0xfade0c00> {
public:
	class Maker;				// makes Requirement blobs
	class Context;				// evaluation context
	class Reader;				// structured reader
	class Interpreter;			// evaluation engine

	// different forms of Requirements. Right now, we only support exprForm ("opExprs")
	enum Kind {
		exprForm = 1			// prefix expr form
	};

	void kind(Kind k) { mKind = k; }
	Kind kind() const { return Kind(uint32_t(mKind)); }

	// validate this requirement against a code context
	void validate(const Context &ctx, OSStatus failure = errSecCSReqFailed) const;	// throws on all failures
	bool validates(const Context &ctx, OSStatus failure = errSecCSReqFailed) const;	// returns on clean miss

	// certificate positions (within a standard certificate chain)
	static const int leafCert = 0;		// index for leaf (first in chain)
	static const int anchorCert = -1;	// index for anchor (last in chain)

	// the SHA1 hash of the canonical "Apple Anchor", i.e. the X509 Anchor
	// that is considered "Apple's anchor certificate", as defined by hashOfCertificate().
#if defined(TEST_APPLE_ANCHOR)
	static const char testAppleAnchorEnv[];
	static const SHA1::Digest &testAppleAnchorHash();
#endif //TEST_APPLE_ANCHOR

	// common alignment rule for all requirement forms
	static const size_t baseAlignment = sizeof(uint32_t); // (we might as well say "four")

    // canonical (source) names of Requirement types (matched to SecRequirementType in CSCommon.h)
    static const char *const typeNames[];

	IFDUMP(void dump() const);

private:
	Endian<uint32_t> mKind;			// expression kind
};

//
// An interpretation context
//
class Requirement::Context {
protected:
	Context()
		: certs(NULL), info(NULL), entitlements(NULL), identifier(""), directory(NULL) { }

public:
	Context(CFArrayRef certChain, CFDictionaryRef infoDict, CFDictionaryRef entitlementDict,
			const std::string &ident, const CodeDirectory *dir)
		: certs(certChain), info(infoDict), entitlements(entitlementDict), identifier(ident), directory(dir) { }

	CFArrayRef certs;								// certificate chain
	CFDictionaryRef info;							// Info.plist
	CFDictionaryRef entitlements;					// entitlement plist
	std::string identifier;						// signing identifier
	const CodeDirectory *directory;				// CodeDirectory

	SecCertificateRef cert(int ix) const;			// get a cert from the cert chain (NULL if not found)
	unsigned int certCount() const;				// length of cert chain (including root)
};

//
// exprForm opcodes.
//
// Opcodes are broken into flags in the (HBO) high byte, and an opcode value
// in the remaining 24 bits. Note that opcodes will remain fairly small
// (almost certainly <60000), so we have the third byte to play around with
// in the future, if needed. For now, small opcodes effective reserve this byte
// as zero.
// The flag byte allows for limited understanding of unknown opcodes. It allows
// the interpreter to use the known opcode parts of the program while semi-creatively
// disregarding the parts it doesn't know about. An unrecognized opcode with zero
// flag byte causes evaluation to categorically fail, since the semantics of such
// an opcode cannot safely be predicted.
//
enum {
	// semantic bits or'ed into the opcode
	opFlagMask =	 0xFF000000,	// high bit flags
	opGenericFalse = 0x80000000,	// has size field; okay to default to false
	opGenericSkip =  0x40000000,	// has size field; skip and continue
};

enum ExprOp {
	opFalse,						// unconditionally false
	opTrue,							// unconditionally true
	opIdent,						// match canonical code [string]
	opAppleAnchor,					// signed by Apple as Apple's product
	opAnchorHash,					// match anchor [cert hash]
	opInfoKeyValue,					// *legacy* - use opInfoKeyField [key; value]
	opAnd,							// binary prefix expr AND expr [expr; expr]
	opOr,							// binary prefix expr OR expr [expr; expr]
	opCDHash,						// match hash of CodeDirectory directly [cd hash]
	opNot,							// logical inverse [expr]
	opInfoKeyField,					// Info.plist key field [string; match suffix]
	opCertField,					// Certificate field [cert index; field name; match suffix]
	opTrustedCert,					// require trust settings to approve one particular cert [cert index]
	opTrustedCerts,					// require trust settings to approve the cert chain
	opCertGeneric,					// Certificate component by OID [cert index; oid; match suffix]
	opAppleGenericAnchor,			// signed by Apple in any capacity
	opEntitlementField,				// entitlement dictionary field [string; match suffix]
	opCertPolicy,					// Certificate policy by OID [cert index; oid; match suffix]
	opNamedAnchor,					// named anchor type
	opNamedCode,					// named subroutine
	exprOpCount						// (total opcode count in use)
};

// match suffix opcodes
enum MatchOperation {
	matchExists,					// anything but explicit "false" - no value stored
	matchEqual,						// equal (CFEqual)
	matchContains,					// partial match (substring)
	matchBeginsWith,				// partial match (initial substring)
	matchEndsWith,					// partial match (terminal substring)
	matchLessThan,					// less than (string with numeric comparison)
	matchGreaterThan,				// greater than (string with numeric comparison)
	matchLessEqual,					// less or equal (string with numeric comparison)
	matchGreaterEqual,				// greater or equal (string with numeric comparison)
};

//
// We keep Requirement groups in SuperBlobs, indexed by SecRequirementType
//
typedef SuperBlob<0xfade0c01> Requirements;

//
// Byte order flippers
//
inline CodeSigning::ExprOp h2n(CodeSigning::ExprOp op)
{
	uint32_t intOp = (uint32_t) op;
	return (CodeSigning::ExprOp) ::h2n(intOp);
}

inline CodeSigning::ExprOp n2h(CodeSigning::ExprOp op)
{
	uint32_t intOp = (uint32_t) op;
	return (CodeSigning::ExprOp) ::n2h(intOp);
}

inline CodeSigning::MatchOperation h2n(CodeSigning::MatchOperation op)
{
	return CodeSigning::MatchOperation(::h2n((uint32_t) op));
}

inline CodeSigning::MatchOperation n2h(CodeSigning::MatchOperation op)
{
	return CodeSigning::MatchOperation(::n2h((uint32_t) op));
}

}	// CodeSigning
}	// Security

#endif //_H_REQUIREMENT


text:
namespace arrow {
namespace ir {

struct TypeString : TypePointer {
  TypeString() : Node(nullptr), TypePointer(nullptr, make<ir::TypeInteger>(true, 8)) {
  }

  virtual ~TypeString() noexcept;
};

}  // namespace ir
}  // namespace arrow

#endif  // ARROW_IR_TYPE_STRING_H


text:
exports.config = {
    seleniumAddress: "http://localhost:4444/wd/hub",
    capabilities: {
        browserName: "chrome"
    },
    specs: ["*_spec.js"],
    baseUrl: "http://localhost:9002/",
    framework: "jasmine",
    jasmineNodeOpts: {
        showColors: true
    }
}


text:
package com.dongguk.bus;

public class AvailableRoute {
	private int routeId;
	private String routeName;

	public AvailableRoute(int routeId, String routeName) {
		super();
		this.routeId = routeId;
		this.routeName = routeName;
	}

	public int getRouteId() {
		return routeId;
	}
	public void setRouteId(int routeId) {
		this.routeId = routeId;
	}
	public String getRouteName() {
		return routeName;
	}
	public void setRouteName(String routeName) {
		this.routeName = routeName;
	}

	public String toString()
	{
		String str = "";
		str += routeId;
		str += routeName;
		return str;
	}
}


text:
using Microsoft.AspNetCore.Http;
using OrchardCore.Security.Options;

namespace OrchardCore.Security.Services
{
    public abstract class HeaderPolicyProvider : IHeaderPolicyProvider
    {
        public SecurityHeadersOptions Options { get; set; }

        public virtual void InitializePolicy()
        {
            // This is intentionally empty, only header policy provider(s) that need an initialization should override this
        }

        public abstract void ApplyPolicy(HttpContext httpContext);
    }
}


text:
package org.apache.flink.python.api.functions.util;

import org.apache.flink.api.common.functions.MapFunction;
import org.apache.flink.python.api.streaming.util.SerializationUtils;
import org.apache.flink.python.api.streaming.util.SerializationUtils.Serializer;

/**
 * Utility function to serialize values, usually directly from data sources.
 */
public class SerializerMap<IN> implements MapFunction<IN, byte[]> {
	private transient Serializer<IN> serializer;

	@Override
	@SuppressWarnings("unchecked")
	public byte[] map(IN value) throws Exception {
		if (serializer == null) {
			serializer = SerializationUtils.getSerializer(value);
		}
		return serializer.serialize(value);
	}
}


text:
package org.fcrepo.test.api;

import static junit.framework.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import java.io.File;
import java.util.HashMap;
import java.util.Map;

import javax.xml.ws.soap.SOAPFaultException;

import junit.framework.JUnit4TestAdapter;

import org.apache.commons.io.FileUtils;
import org.custommonkey.xmlunit.NamespaceContext;
import org.custommonkey.xmlunit.SimpleNamespaceContext;
import org.custommonkey.xmlunit.XMLUnit;
import org.fcrepo.client.FedoraClient;
import org.fcrepo.common.Constants;
import org.fcrepo.server.access.FedoraAPIA;
import org.fcrepo.server.management.FedoraAPIM;
import org.fcrepo.server.types.gen.ComparisonOperator;
import org.fcrepo.server.types.gen.Condition;
import org.fcrepo.server.types.gen.FieldSearchQuery;
import org.fcrepo.server.types.gen.FieldSearchResult;
import org.fcrepo.server.types.gen.ObjectFactory;
import org.fcrepo.server.utilities.TypeUtility;
import org.fcrepo.test.FedoraServerTestCase;
import org.fcrepo.test.TemplatedResourceIterator;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.JUnitCore;

/**
 * Test APIM based on templating of resource files
 * These tests also use the non-MTOM WS client
 *
 * @author Stephen Bayliss
 * @version $Id$
 */
public class TestAPIM2
        extends FedoraServerTestCase
        implements Constants {

    private static FedoraClient s_client;
    private FedoraAPIM apim;
    private FedoraAPIA apia;

    @BeforeClass
    public static void bootStrap() throws Exception {
        s_client = getFedoraClient();
        ingestImageCollectionDemoObjects(s_client);
    }

    @AfterClass
    public static void cleanUp() throws Exception {
        purgeDemoObjects(s_client);
        s_client.shutdown();
    }

    @Before
    public void setUp() throws Exception {
        apim = s_client.getAPIM();
        apia = s_client.getAPIA();

        Map<String, String> nsMap = new HashMap<String, String>();
        nsMap.put("oai_dc", "http://www.openarchives.org/OAI/2.0/oai_dc/");
        nsMap.put("dc", "http://purl.org/dc/elements/1.1/");
        nsMap.put("foxml", "info:fedora/fedora-system:def/foxml#");
        NamespaceContext ctx = new SimpleNamespaceContext(nsMap);
        XMLUnit.setXpathNamespaceContext(ctx);

        // not really necessary, but will cope with any junk left from other tests
        purgeDemoObjects(s_client);

    }

    @After
    public void tearDown() throws Exception {
        // assumes all our test objects are in the demo namespace
        purgeDemoObjects(s_client);

        XMLUnit.setXpathNamespaceContext(SimpleNamespaceContext.EMPTY_CONTEXT);
    }

    @Test
    public void testIngest() throws Exception {

        String resourceDirName = "src/test/resources/APIM2/foxml/";
        String[] resourceFilenames = new File(resourceDirName).list();

        // ingest resources, substituting from file "values"
        int count = 0; // count ingested objects
        for (String resourceFilename : resourceFilenames) {
            File resourceFile = new File(resourceDirName + resourceFilename);
            if (resourceFile.isFile()) {
                String resource = FileUtils.readFileToString(resourceFile, "UTF-8");
                TemplatedResourceIterator tri = new TemplatedResourceIterator(resource, "src/test/resources/APIM2/values");
                while (tri.hasNext()) {
                    byte[] foxml = tri.next().getBytes("UTF-8");
                    apim.ingest(foxml, FOXML1_1.uri,"ingesting new foxml object");
                    count++;
                }
            }
        }

        assertEquals("Ingested object count", count, getDemoObjects(s_client).size());

        // ingest resources, substituting from file "valuesplain"
        for (String resourceFilename : resourceFilenames) {
            File resourceFile = new File(resourceDirName + resourceFilename);
            if (resourceFile.isFile()) {
                String resource = FileUtils.readFileToString(resourceFile, "UTF-8");
                TemplatedResourceIterator tri = new TemplatedResourceIterator(resource, "src/test/resources/APIM2/valuesplain");
                while (tri.hasNext()) {
                    byte[] foxml = tri.next().getBytes("UTF-8");
                    apim.ingest(foxml, FOXML1_1.uri,"ingesting new foxml object");
                    count++;
                }
            }
        }

        assertEquals("Ingested object count", count, getDemoObjects(s_client).size());

    }

    @Test
    public void testFieldSearch() throws Exception {

        // get some sample objects ingested
        String resourceDirName = "src/test/resources/APIM2/foxml/";
        String[] resourceFilenames = new File(resourceDirName).list();

        for (String resourceFilename : resourceFilenames) {
            File resourceFile = new File(resourceDirName + resourceFilename);
            if (resourceFile.isFile()) {
                String resource = FileUtils.readFileToString(resourceFile, "UTF-8");
                TemplatedResourceIterator tri = new TemplatedResourceIterator(resource, "src/test/resources/APIM2/valuesplain");
                while (tri.hasNext()) {
                    byte[] foxml = tri.next().getBytes("UTF-8");
                    apim.ingest(foxml, FOXML1_1.uri,"ingesting new foxml object");
                }
            }
        }

        String[] resultFields = {"pid", "title"};
        java.math.BigInteger maxResults = new java.math.BigInteger("100");

        String termsTemplate = "$value$";
        TemplatedResourceIterator tri = new TemplatedResourceIterator(termsTemplate, "src/test/resources/APIM2/searchvalues");
        while (tri.hasNext()) {
            String terms = tri.next();
            FieldSearchQuery query;
            // using conditions
            FieldSearchQuery.Conditions conds = new FieldSearchQuery.Conditions();
            Condition c = new Condition();
            c.setProperty("pid");
            c.setOperator(ComparisonOperator.fromValue("eq"));
            c.setValue(tri.getAttributeValue("value"));
            conds.getCondition().add(c);
            query = new FieldSearchQuery();
            ObjectFactory factory = new ObjectFactory();
            query.setConditions(factory.createFieldSearchQueryConditions(conds));
            try {
                apia.findObjects(TypeUtility.convertStringtoAOS(resultFields), maxResults, query);
                fail("Query should not have succeeded with SQL");
            } catch (SOAPFaultException e) {
                // expected
                String expected = "Query cannot contain the ' character.";
                assertTrue(
                        "\"" + e.getCause().getMessage() + "\" did not contain expected message \"" + expected + "\"",
                        e.getCause().getMessage().contains(expected));
            }

            query = new FieldSearchQuery();
            query.setTerms(factory.createFieldSearchQueryTerms(terms));
            FieldSearchResult result = apia.findObjects(TypeUtility.convertStringtoAOS(resultFields), maxResults, query);
            assertEquals(0,result.getResultList().getObjectFields().size());
        }

        purgeDemoObjects(s_client);

        for (String resourceFilename : resourceFilenames) {
            File resourceFile = new File(resourceDirName + resourceFilename);
            if (resourceFile.isFile()) {
                String resource = FileUtils.readFileToString(resourceFile, "UTF-8");
                tri = new TemplatedResourceIterator(resource, "src/test/resources/APIM2/valuesplain");
                while (tri.hasNext()) {
                    byte[] foxml = tri.next().getBytes("UTF-8");
                    apim.ingest(foxml, FOXML1_1.uri,"ingesting new foxml object");
                }
            }
        }

        purgeDemoObjects(s_client);

    }

    @Test
    public void testObjectMethods() throws Exception {
        // test object
        String resfile = "src/test/resources/APIM2/foxml/demo_SmileyBeerGlass.xml";

        File resourceFile = new File(resfile);
        String resource = FileUtils.readFileToString(resourceFile, "UTF-8");
        TemplatedResourceIterator tri = new TemplatedResourceIterator(resource, "src/test/resources/APIM2/valuesplain");
        while (tri.hasNext()) {
            byte[] foxml = tri.next().getBytes("UTF-8");
            String label2 = tri.getAttributeValue("label2");
            String pid = apim.ingest(foxml, FOXML1_1.uri,"ingesting new foxml object");

            // update object label with new value
            apim.modifyObject(pid, null, label2, null, "updating object label");

        }

        purgeDemoObjects(s_client);

        String resourceDirName = "src/test/resources/APIM2/foxml/";
        String[] resourceFilenames = new File(resourceDirName).list();
        for (String resourceFilename : resourceFilenames) {
            resourceFile = new File(resourceDirName + resourceFilename);
            if (resourceFile.isFile()) {
                resource = FileUtils.readFileToString(resourceFile, "UTF-8");
                tri = new TemplatedResourceIterator(resource, "src/test/resources/APIM2/valuesplain");
                while (tri.hasNext()) {
                    byte[] foxml = tri.next().getBytes("UTF-8");
                    apim.ingest(foxml, FOXML1_1.uri,"ingesting new foxml object");
                }
            }
        }

        purgeDemoObjects(s_client);

    }

    @Test
    public void testDatastreamMethods() throws Exception {
        // test object
        String resfile = "src/test/resources/APIM2/foxml/demo_SmileyBeerGlass.xml";

        File resourceFile = new File(resfile);
        String resource = FileUtils.readFileToString(resourceFile, "UTF-8");
        TemplatedResourceIterator tri = new TemplatedResourceIterator(resource, "src/test/resources/APIM2/valuesplain");
        while (tri.hasNext()) {
            byte[] foxml = tri.next().getBytes("UTF-8");
            String label2 = tri.getAttributeValue("label2");
            String pid = apim.ingest(foxml, FOXML1_1.uri,"ingesting new foxml object");

            // modify datastream label
            apim.modifyDatastreamByValue(pid, "DC", null, label2, null, null, null, null, null, "modify datastream label", false);

        }

        purgeDemoObjects(s_client);

        String resourceDirName = "src/test/resources/APIM2/foxml/";
        String[] resourceFilenames = new File(resourceDirName).list();
        for (String resourceFilename : resourceFilenames) {
            resourceFile = new File(resourceDirName + resourceFilename);
            if (resourceFile.isFile()) {
                resource = FileUtils.readFileToString(resourceFile, "UTF-8");
                tri = new TemplatedResourceIterator(resource, "src/test/resources/APIM2/valuesplain");
                while (tri.hasNext()) {
                    byte[] foxml = tri.next().getBytes("UTF-8");
                    apim.ingest(foxml, FOXML1_1.uri,"ingesting new foxml object");
                }
            }
        }

        purgeDemoObjects(s_client);

    }

    public static junit.framework.Test suite() {
        return new JUnit4TestAdapter(TestAPIM2.class);
    }

    public static void main(String[] args) {
        JUnitCore.runClasses(TestAPIM2.class);
    }

}


text:
using System;
using Azure.AI.TextAnalytics;

namespace Azure.AI.TextAnalytics.Models
{
    /// <summary> The TasksStateTasksEntityRecognitionPiiTasksItem. </summary>
    internal partial class EntityRecognitionPiiTasksItem : TaskState
    {
        /// <summary> Initializes a new instance of EntityRecognitionPiiTasksItem. </summary>
        /// <param name="lastUpdateDateTime"></param>
        /// <param name="status"></param>
        internal EntityRecognitionPiiTasksItem(DateTimeOffset lastUpdateDateTime, TextAnalyticsOperationStatus status) : base(lastUpdateDateTime, status)
        {
        }

        /// <summary> Initializes a new instance of EntityRecognitionPiiTasksItem. </summary>
        /// <param name="lastUpdateDateTime"></param>
        /// <param name="taskName"></param>
        /// <param name="status"></param>
        /// <param name="results"></param>
        internal EntityRecognitionPiiTasksItem(DateTimeOffset lastUpdateDateTime, string taskName, TextAnalyticsOperationStatus status, PiiEntitiesResult results) : base(lastUpdateDateTime, taskName, status)
        {
            Results = results;
        }

        /// <summary> Gets the results. </summary>
        public PiiEntitiesResult Results { get; }
    }
}


text:
// [START kms_update_key_add_rotation_schedule]

using Google.Cloud.Kms.V1;
using Google.Protobuf.WellKnownTypes;
using System;

public class UpdateKeyAddRotationSample
{
    public CryptoKey UpdateKeyAddRotation(string projectId = "my-project", string locationId = "us-east1", string keyRingId = "my-key-ring", string keyId = "my-key")
    {
        // Create the client.
        KeyManagementServiceClient client = KeyManagementServiceClient.Create();

        // Build the key.
        CryptoKey key = new CryptoKey
        {
            // Provide the name of the key to update.
            CryptoKeyName = new CryptoKeyName(projectId, locationId, keyRingId, keyId),

            // Rotate the key every 30 days.
            RotationPeriod = new Duration
            {
                Seconds = 60 * 60 * 24 * 30, // 30 days
            },

            // Start the first rotation in 24 hours.
            NextRotationTime = new Timestamp
            {
                Seconds = new DateTimeOffset(DateTime.UtcNow.AddHours(24)).ToUnixTimeSeconds(),
            }
        };

        // Build the update mask.
        FieldMask fieldMask = new FieldMask
        {
            Paths = { "rotation_period", "next_rotation_time" },
        };

        // Call the API.
        CryptoKey result = client.UpdateCryptoKey(key, fieldMask);

        // Return the updated key.
        return result;
    }
}
// [END kms_update_key_add_rotation_schedule]


text:
dispatch-plugin.war is a standalone hawtio plugin that can be deployed in a server alongside the main hawtio-web application.

The project creates a war file that can be deployed in various application services and is also OSGi-ified so it deploys nicely into Apache Karaf.

## Docker

The fastest way to use the console is to run the [docker image](https://hub.docker.com/r/ernieallen/dispatch-console/). Follow the installation/run instruction on that page.

## Building
The dispatch-plugin.war file is pre-built and can be installed alongside the hawtio.war on any system with a modern java installation. If you want to build the dispatch-plugin.war from source:

- clone the hawtio git repo

    $ git clone https://github.com/hawtio/hawtio.git

- build hawtio

    $ cd hawtio

    $ mvn clean install

    If you encounter any errors when building hawtio, visit [the hawtio build page](http://hawt.io/building/index.html) for help.

- create a dispatch dir under the hawtio dir and copy the source code

    $ mkdir dispatch

    $ cp -r {dir where this file is located}/dispatch/* dispatch/

- do a maven build of dispatch

    $ cd dispach

    $ mvn package

The dispatch-plugin-1.4.60.war file should now be in the target directory.

## Apache Tomcat installation

Copy the dispatch-plugin-1.4.60.war file as the following name

    dispatch-plugin.war
to the deploy directory of Apache Tomcat os similar Java web container. Ensure the hawtio.war file is present in the same directory. Point a browser at http://\<tomcathost:post\>/hawtio
Dispatch Router should be available as a tab in the console.

## Connecting to a router

On the Dispatch Router's console page, select the Connect sub tab. Enter the address of a dispatch router. Enter the port of a websockets to tcp proxy and click the Connect button.

### Websockts to tcp proxy

The console communicates to a router using Qpid Proton's [rhea](https://github.com/grs/rhea) javascript binding. When run from a browser, it uses websockets.
The router communicates using tcp. Therefore a websockts/tcp proxy is required.

#### Using a python websockets/tcp proxy

A popular python based proxy is [websockify](https://github.com/kanaka/websockify). To use it:

    $ git clone https://github.com/kanaka/websockify.git
    $ cd websockify
    $ python websockify.py 5673 0.0.0.0:20009 &

In the above, websockify is listening for ws traffic on port 5673 and will proxy it to 0.0.0.0:20009. One of the routers will need a listener on the proxied port. An example router .conf file entry is:

    listener {
        role: normal
        addr: 0.0.0.0
        port: 20009
        sasl-mechanisms: ANONYMOUS
    }


text:
using System;
using System.Linq;
using NUnit.Framework;
using Wikiled.Arff.Logic.Headers;

namespace Wikiled.Arff.Tests.Logic.Headers
{
    [TestFixture]
    public class HeadersWordsHandlingTests
    {
        private HeadersWordsHandling handler;

        [SetUp]
        public void Setup()
        {
            handler = new HeadersWordsHandling();
        }

        [Test]
        public void Clone()
        {
            handler.RegisterNumericClass();
            handler.RegisterNominal("Another", "One", "Two");
            var result = (HeadersWordsHandling)handler.Clone();
            Assert.AreEqual(2, result.Total);
            Assert.IsInstanceOf<NumericHeader>(result.Class);
            Assert.AreNotSame(handler.Class, result.Class);
        }

        [Test]
        public void RegisterNumeric()
        {
            var value = handler.RegisterNumeric("1 2 3 Lie's");
            Assert.AreEqual("1 2 3 Lie's", value.Name);
            Assert.AreEqual(1, handler.Total);
        }

        [Test]
        public void NonRegisterNumeric()
        {
            handler.Register = false;
            var value = handler.RegisterNumeric("1");
            Assert.AreEqual("1", value.Name);
            Assert.AreEqual(0, handler.Total);
        }

        [Test]
        public void RegisterNumericClass()
        {
            var value = handler.RegisterNumericClass();
            Assert.AreEqual("CLASS", value.Name);
        }

        [Test]
        public void RegisterNominalClass()
        {
            var value = handler.RegisterNominalClass("1", "2");
            Assert.AreEqual("CLASS", value.Name);
            Assert.AreEqual(2, value.Nominals.Length);
        }

        [Test]
        public void RegisterNominal()
        {
            var value = handler.RegisterNominal("x", "1", "2");
            Assert.AreEqual("x", value.Name);
            Assert.AreEqual(2, value.Nominals.Length);
            Assert.AreEqual("1", value.Nominals[0]);
            Assert.AreEqual("2", value.Nominals[1]);
        }

        [Test]
        public void Multiple()
        {
            var value = handler.RegisterNumeric("1");
            Assert.AreEqual("1", value.Name);
            var value2 = handler.RegisterNumeric("1");
            Assert.AreEqual("1", value.Name);
            Assert.AreSame(value, value2);
        }

        [Test]
        public void Parse()
        {
            var line = handler.Parse("@ATTRIBUTE Test NUMERIC");
            Assert.IsInstanceOf<NumericHeader>(line);
            Assert.AreEqual("Test", line.Name);

            NominalHeader lineTwo = (NominalHeader)handler.Parse("@ATTRIBUTE Test2 {One, Two}");
            Assert.IsInstanceOf<NominalHeader>(lineTwo);
            Assert.AreEqual("Test2", lineTwo.Name);
            Assert.AreEqual(2, lineTwo.Nominals.Length);
            Assert.AreEqual("One", lineTwo.Nominals[0]);
            Assert.AreEqual("Two", lineTwo.Nominals[1]);

            line = handler.Parse("@ATTRIBUTE class NUMERIC");
            Assert.AreEqual("CLASS", line.Name);
        }

        [Test]
        public void ParseSameLineTwice()
        {
            var line = handler.Parse("@ATTRIBUTE Test NUMERIC");
            Assert.IsInstanceOf<NumericHeader>(line);
            Assert.AreEqual("Test", line.Name);
            Assert.Throws<ArgumentOutOfRangeException>(() => handler.Parse("@ATTRIBUTE Test {One, Two}"));
        }

        [Test]
        public void ParseQuote()
        {
            var line = handler.Parse("@ATTRIBUTE 'Test duo' NUMERIC");
            Assert.IsInstanceOf<NumericHeader>(line);
            Assert.AreEqual("Test duo", line.Name);
        }

        [Test]
        public void Total()
        {
            Assert.AreEqual(0, handler.Total);
            handler.RegisterNumeric("a");
            Assert.AreEqual(1, handler.Total);
            handler.RegisterNumeric("b");
            Assert.AreEqual(2, handler.Total);
        }

        [Test]
        public void GetByIndex()
        {
            handler.RegisterNumeric("a");
            IHeader header = handler.GetByIndex(0);
            Assert.AreEqual("a", header.Name);
        }

        [Test]
        public void Enumerator()
        {
            handler.RegisterNumeric("a");
            handler.RegisterNumeric("b");
            int i = handler.Count();
            Assert.AreEqual(2, i);
        }
    }
}


text:
"use babel";

import {Workspace} from 'atom';

import DataAtomView from '../lib/views/data-atom-view';

function findDataAtomPanel(workspace) {
  return [].slice.call(workspace.getElementsByTagName('section')).filter(i => i.classList.contains('data-atom-panel'));
}

describe("DataAtomView", () => {
  var workspaceElement = null;
  beforeEach(() => {
    workspaceElement = atom.views.getView(atom.workspace);
    jasmine.attachToDOM(workspaceElement);
  });

  describe("when toggling view", () => {
    it("it sets isShowing", () => {
      var view = new DataAtomView();
      expect(findDataAtomPanel(workspaceElement).length).toEqual(0);
      view.toggleView();
      expect(findDataAtomPanel(workspaceElement).length).toEqual(1);
      view.toggleView();
      expect(findDataAtomPanel(workspaceElement).length).toEqual(0);
    });
  });

  describe("when calling show()", () => {
    it("it sets isShowing true", () => {
      var view = new DataAtomView();
      expect(findDataAtomPanel(workspaceElement).length).toEqual(0);
      view.show();
      expect(findDataAtomPanel(workspaceElement).length).toEqual(1);
    });
  });

  describe("when calling hide()", () => {
    it("it sets isShowing false", () => {
      var view = new DataAtomView();
      expect(findDataAtomPanel(workspaceElement).length).toEqual(0);
      view.show();
      expect(findDataAtomPanel(workspaceElement).length).toEqual(1);
      view.hide();
      expect(findDataAtomPanel(workspaceElement).length).toEqual(0);
    });
  });

  describe('When toggling query source', () => {
    var view;
    beforeEach(() => {
      view = new DataAtomView();
    });
    it('it shows the query input', () => {
      view.show();
      view.useEditorAsQuerySource(false);
      expect(view.querySection.style.display).toEqual('block');
    });
    it('it hides the query input', () => {
      view.show();
      view.useEditorAsQuerySource(true);
      expect(view.querySection.style.display).toEqual('none');
    });

    // not sure how to set up the active editor
    // it('it uses the editor text', () => {
    //   view.show();
    //   view.useEditorAsQuerySource(true);
    //   view.queryEditor.getModel().setText('test');
    //   expect(view.getQuery()).not.toEqual('test');
    // });
    it('it uses the query input text', () => {
      view.show();
      view.useEditorAsQuerySource(false);
      view.queryEditor.getModel().setText('test2');
      expect(view.getQuery()).toEqual('test2');
    });
  });
});


text:
<form [formGroup]="form" (ngSubmit)="onSubmit()">

        Кодовая фраза из письма *
        <input type="text" class="form-control" formControlName="token">
        Кодовая фраза не может быть пустой

            <button id="activation_component_activationButton" autocomplete="off" data-loading-text="" class="btn btn-action" type="submit" [disabled]="!form.valid">Активировать</button>

</form>


text:
class PrefService;

namespace base {
class HistogramBase;
}

namespace data_reduction_proxy {

// The number of config fetch variations supported. Must match the number of
// suffixes in histograms.xml.
extern const int kConfigFetchGroups;

// The name of the trial group for measuring lost bytes during fetching the
// configuration.
extern const char kConfigFetchTrialGroup[];

// The config retrieval round trip time is calculated as:
// (previous base) * (multiplier) + increment.
// Multipler is >= 1. Increment is >= 0.
// The name of the param prefix for determining the base round trip time in
// milliseconds for simulating a configuration fetch.
extern const char kConfigRoundtripMillisecondsBaseParam[];

// The name of the param prefix for determining the base round trip time in
// milliseconds for simulating a configuration fetch.
extern const char kConfigRoundtripMultiplierParam[];

// The name of the param prefix for determining the base round trip time in
// milliseconds for simulating a configuration fetch.
extern const char kConfigRoundtripMillisecondsIncrementParam[];

// The name of the param for determining the expiration interval of the
// configuration in seconds.
extern const char kConfigExpirationSecondsParam[];

// The name of the param for determining if the config should be considered
// stale on startup (regardless of whether it is stale or not).
extern const char kConfigAlwaysStaleParam[];

// The number of seconds by which the expiration interval exceeds the refresh
// interval so that we maintain a valid configuration.
extern const int kConfigFetchBufferSeconds;

// Parameters for setting up an experiment to measure potentially uncompressed
// bytes during the retrieval of the Data Reduction Proxy configuration.
class DataReductionProxyConfigRetrievalParams {
 public:
  enum ConfigState {
    VALID = 0,
    RETRIEVING = 1,
    EXPIRED = 2,
  };

  // A variation of the simulated configuration retrieval time, permitting the
  // experiment to measure multiple values.
  class Variation {
   public:
    Variation(int index, const base::Time& simulated_config_retrieved);

    // Returns the current state of the Data Reduction Proxy configuration.
    // Virtual for testing.
    virtual ConfigState GetState(const base::Time& request_time,
                                 const base::Time& config_expiration) const;

    // Records content length statistics if potentially uncompressed bytes have
    // been detected for this variation.
    void RecordStats(int64 received_content_length,
                     int64 original_content_length) const;

    // Visible for testing.
    const base::Time& simulated_config_retrieved() const {
      return simulated_config_retrieved_;
    }

   private:
    // The time at which the simulated Data Reduction Proxy configuration is
    // considered to have been received.
    base::Time simulated_config_retrieved_;

    // Histograms for recording stats.
    base::HistogramBase* lost_bytes_ocl_;
    base::HistogramBase* lost_bytes_rcl_;
    base::HistogramBase* lost_bytes_diff_;
  };

  static scoped_ptr<DataReductionProxyConfigRetrievalParams> Create(
      PrefService* pref_service);

  virtual ~DataReductionProxyConfigRetrievalParams();

  // Records content length statistics against any variations for which
  // potentially uncompressed bytes have been detected.
  void RecordStats(const base::Time& request_time,
                   int64 received_content_length,
                   int64 original_content_length) const;

  // Simulates retrieving a new configuration.
  void RefreshConfig();

  bool loaded_expired_config() const { return loaded_expired_config_; }

  // Returns the expiration time of the current configuration.
  const base::Time& config_expiration() const { return config_expiration_; }

  // Returns how often the configuration should be retrieved.
  const base::TimeDelta& refresh_interval() const {
    return config_refresh_interval_;
  }

  // Visible for testing.
  const std::vector<Variation>& variations() const { return variations_; }

 private:
  DataReductionProxyConfigRetrievalParams(
      bool loaded_expired_config,
      const std::vector<Variation>& variations,
      const base::Time& config_expiration,
      const base::TimeDelta& config_refresh_interval);

  // Indicates that the Data Reduction Proxy configuration when loaded has
  // expired.
  bool loaded_expired_config_;

  // The time at which the simulated Data Reduction Proxy configuration
  // expires.
  base::Time config_expiration_;

  // The duration for which a Data Reduction Proxy configuration is considered
  // valid.
  base::TimeDelta config_expiration_interval_;

  // The duration after which a simulated retrieval of a new Data Reduction
  // Proxy configuration should be performed.
  base::TimeDelta config_refresh_interval_;

  // The different variations on roundtrip time that can take place.
  std::vector<Variation> variations_;
};

}  // namespace data_reduction_proxy
#endif  // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CONFIG_RETRIEVAL_PARAMS_H_


text:
EnableBackgroundLocation
=========================

A simple Phonegap Plugin to enable background location update on iOS

Add to .plist a key "Required background modes" with value "App registers for location updates".


text:
package Question7_5;

public class Line {
	public Point start;
	public Point end;
	public Line(Point start, Point end) {
		this.start = start;
		this.end = end;
	}

	public String toString() {
		return "Line from " + start.toString() + " to " + end.toString();
	}
}


text:
namespace nHydrate.DataImport
{
    public class Field : DatabaseBaseObject
    {
        private int _length = 50;

        public Field()
        {
            this.DataType = System.Data.SqlDbType.VarChar;
            this.IsBrowsable = true;
            this.DefaultValue = string.Empty;
        }

        public System.Data.SqlDbType DataType { get; set; }
        public bool Identity { get; set; }
        public string DefaultValue { get; set; }
        public bool PrimaryKey { get; set; }
        public bool Nullable { get; set; }
        public int Scale { get; set; }
        public string ImportedDefaultName { get; set; }
        public bool IsReadOnly { get; set; }
        public bool IsBrowsable { get; set; }

        private bool _isUnique;
        public bool IsUnique
        {
            get { return _isUnique || this.PrimaryKey; }
            set { _isUnique = value; }
        }

        private bool _isIndexed;
        public bool IsIndexed
        {
            get { return _isIndexed || this.PrimaryKey; }
            set { _isIndexed = value; }
        }

        public int SortOrder { get; set; }
        public bool IsComputed { get; set; }
        public string Formula { get; set; }

        public int Length
        {
            get { return _length; }
            set
            {
                if (value < 0) value = 0;
                _length = value;
            }
        }

        public override string ObjectType => "Field";

        public override string ToString()
        {
            return this.Name;
        }

        public string CorePropertiesHash
        {
            get
            {
                var prehash =
                    this.Name + "|" +
                    this.Identity + "|" +
                    this.Nullable + "|" +
                    this.DefaultValue + "|" +
                    this.Length + "|" +
                    this.IsComputed + "|" +
                    this.Scale + "|" +
                    this.PrimaryKey + "|" +
                    this.IsBrowsable + "|" +
                    this.DataType.ToString();
                return prehash;
            }
        }

        public override bool Equals(object obj)
        {
            var o = obj as Field;
            if (o == null)
                return false;

            if (this.Name != o.Name) return false;
            if (this.IsIndexed != o.IsIndexed) return false;
            if (this.IsUnique != o.IsUnique) return false;
            if (this.DefaultValue != o.DefaultValue) return false;
            if (this.IsComputed != o.IsComputed) return false;
            if (this.Identity != o.Identity) return false;
            if (this.PrimaryKey != o.PrimaryKey) return false;
            if (this.Nullable != o.Nullable) return false;
            if (this.Length != o.Length) return false;
            if (this.Scale != o.Scale) return false;
            if (this.DataType != o.DataType) return false;

            return true;

        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

    }
}


text:
// RobotBuilder Version: 2.0
//
// This file was generated by RobotBuilder. It contains sections of
// code that are automatically generated and assigned by robotbuilder.
// These sections will be updated in the future when you export to
// Java from RobotBuilder. Do not put any code or make any change in
// the blocks indicating autogenerated code or it will be lost on an
// update. Deleting the comments indicating the section will prevent
// it from being updated in the future.

package org.usfirst.frc1450.FRCSteamworks.commands.driveCommands;
import edu.wpi.first.wpilibj.command.Command;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;

import org.usfirst.frc1450.FRCSteamworks.Robot;

/**
 *	This command uses feedback from the raspberry pi to determine what angle the robot should turn to face the target.
 *	It also takes a timeout to exit the function if it never completes.
 */
public class CameraBasedDrive extends Command {

    private double turnError;
    private double feedbackAngle;
    private double feedbackDistance;
    private double m_timeoutSeconds;
    private double m_encoderDistance;
    private int loopCount = 0;
    private int timeout = 0;
    private double turnPercent = 0.0;
    private boolean isNotDone = true;
    private boolean lookForPiFeedback = true;
    private boolean hasFeedback = false;
    private int statePtr, stringIdx1, stringIdx2, stringIdx3;
    private String data;
    private double initialAngle;

    public CameraBasedDrive(double timeoutSeconds) {

        m_timeoutSeconds = timeoutSeconds;

        requires(Robot.drives);
    }

    // Called just before this Command runs the first time
    protected void initialize() {
    	loopCount = 0;
    	initialAngle = Robot.drives.GetGyroAngle();
    	SmartDashboard.putString("Data", "");	//clear feedback to ensure that it is fresh
    	statePtr = 0;
    	timeout = 0;
    	Robot.drives.zeroEncoders();				//zeros encoder count so actual count can be compared to targets
    	m_encoderDistance = 30 * Robot.drives.encodersPerInch;
    	SmartDashboard.putString("AutoState", "CameraTurn");
    }

    // Called repeatedly when this Command is scheduled to run
    protected void execute() {
    	timeout++;
    	switch (statePtr)
    	{
    		case 0:
    			Robot.drives.teleopDrive(0.0,0.0);	//disable motors
    			if (Robot.drives.IsMoving())
    			{
    				loopCount = 0;
    			}
    			if (loopCount > (1.5 / 0.02))
    			{
    				statePtr++;
    				SmartDashboard.putString("Data", "");
    				stringIdx1 = 0;
    				stringIdx2 = 0;
    				stringIdx3 = 0;
    			}
    			break;
    		case 1:
    			data = SmartDashboard.getString("Data", "");		//expected feedback format is <angle,distance> ie <-15.3,14.7> is 15.3 degrees and 14.7 inches away
    			if (data.contains("<"))								//make sure data has expected opening character
		    	{
		    		stringIdx1 = data.indexOf("<");
		    	}
    			if (data.contains(","))								//make sure data has expected opening character
		    	{
		    		stringIdx2 = data.indexOf(",");
		    	}
    			if (data.contains(">"))								//make sure data has expected opening character
		    	{
		    		stringIdx3 = data.indexOf(">");
		    	}
    			if ((stringIdx1 < stringIdx2) && (stringIdx2 < stringIdx3))
    			{
    				feedbackAngle = Double.parseDouble(data.substring(stringIdx1 + 1, stringIdx2)) + SmartDashboard.getNumber("CamOffsetAngle", 3.0);
    				SmartDashboard.putNumber("piAngle", feedbackAngle);
    				SmartDashboard.putString("feedbackString", data);
    				feedbackDistance = Double.parseDouble(data.substring(stringIdx2 + 1, stringIdx3));
    				SmartDashboard.putNumber("piDistance", feedbackDistance);
    				m_encoderDistance = (feedbackDistance - 30.0) * Robot.drives.encodersPerInch;
    				if (Math.abs(feedbackAngle) < 70.0)
	    			{
	    				statePtr++;
	    			}
    			}
    			break;

    		case 2:
    			// get angle error as a function of current angle (0 to 359) minus initial angle (0 to 359)
    	    	double currentError = Robot.drives.GetGyroAngle() - initialAngle;
    	    	// -359 <= currentError <= 359
    	    	//convert error to the shortest possible error ie. if error greater than 180 travel error minus 180 in the opposite direction
    	    	if (currentError > 180)
    	    	{
    	    		currentError -= 360;
    	    	}
    	    	else if (currentError < -180)
    	    	{
    	    		currentError += 360;
    	    	}

    	    	//error is used proportionally as a function of sin.  gain of 12 seemed to keep the robot driving pretty straight
    	    	// so zero error yields all throttle and no turn.  trig functions require angle in radians
    	    	currentError = Math.toRadians(currentError * 12);
    	    	if (currentError < 0)
    	    	{
    	    		//drives forward at half speed(actually voltage) while turning right
    	    		Robot.drives.teleopDrive(Math.abs(Math.sin(currentError)), -0.5);
    	    		//SmartDashboard.putNumber("resultAngle", -Math.sin(currentError));
    	    	}
    	    	else
    	    	{
    	    		//drives forward at half speed(actually voltage) while turning left
    	    		Robot.drives.teleopDrive(-Math.abs(Math.sin(currentError)), -0.5);
    	    		//SmartDashboard.putNumber("resultAngle", Math.sin(currentError));
    	    	}
    			break;
    		case 3:
    			break;
    	}

    	// if not done turning to angle then do algorithm
    	loopCount++;
    }

    // Make this return true when this Command no longer needs to run execute()
    protected boolean isFinished() {
    	//returns true if timed out but could also return true if locked in on angle and is done
    	return ((Math.abs((-1 * m_encoderDistance) - Robot.drives.GetLeftPosition()) < (Robot.drives.encodersPerInch * 3)) ||
    			(Math.abs(m_encoderDistance - Robot.drives.GetRightPosition()) < (Robot.drives.encodersPerInch * 3)) ||
    			(timeout > (m_timeoutSeconds / 0.02)));
    }

    // Called once after isFinished returns true
    protected void end() {
    	Robot.drives.teleopDrive(0.0,0.0);	//disable motors
    }

    // Called when another command which requires one or more of the same
    // subsystems is scheduled to run
    protected void interrupted() {
    }
}


text:
// Copyright ©2005, 2006 Freescale Semiconductor, Inc.
// Please see the License for the specific language governing rights and
// limitations under the License.

#pragma once

#include "SU_Constants.h"
#include "SU_Types.h"
#include "SU_Macros.h"

#include "SUColorUtils.h"
#include "SUSaveGWorld.h"
#include "SUOffscreen.h"
#include "SUMiscUtils.h"
#include "SUErrors.h"

#include "PT_Constants.h"
#include "PT_Errors.h"
#include "PT_Types.h"
#include "PT_Resources.h"

#include "PTSelection.h"
#include "PTCanvas.h"
#include "PTPaintView.h"


text:
using System;
using System.Collections.Generic;

using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;

namespace Phoneword_Droid {

	/// <summary>
	///		メインとなるアクティビティを表します。
	/// </summary>
	[Activity( Label = "Phoneword", MainLauncher = true )]
	public class MainActivity : Activity {

		static readonly List<string> phoneNumbers = new List<string>();

		/// <summary>
		///		このアクティビティが作成された時に実行されます。
		/// </summary>
		/// <param name="bundle">バンドル</param>
		protected override void OnCreate( Bundle bundle ) {

			// バンドルオブジェクトをActivityのOnCreateメソッドに指定し、実行します。
			base.OnCreate( bundle );

			// リソースにある、Layout -> Main.axmlをContentViewにセットします。
			SetContentView( Resource.Layout.Main );

			// ロードされたレイアウトから UI コントロールを取得します。
			EditText phoneNumberText = FindViewById<EditText>( Resource.Id.PhoneNumberText );
			Button translateButton = FindViewById<Button>( Resource.Id.TranslateButton );
			Button callButton = FindViewById<Button>( Resource.Id.CallButton );
			Button callHistoryButton = FindViewById<Button>( Resource.Id.CallHistoryButton );

			// 発信ボタンを Disable にします
			callButton.Enabled = false;
			// 番号を変換するコードを追加します。
			string translatedNumber = string.Empty;

			// 電話番号の変換ボタンをクリックした時のイベントを実装します。
			translateButton.Click +=
				( object sender, EventArgs e ) => {
					// ユーザーのアルファベットの電話番号を電話番号に変換します。
					translatedNumber = Core.PhonewordTranslator.ToNumber( phoneNumberText.Text );
					// 変換後の電話番号が null or 空文字の時
					if( string.IsNullOrWhiteSpace( translatedNumber ) ) {
						// 発信ボタンのテキストを「Call」にし、ボタンを無効にします。
						callButton.Text = "Call";
						callButton.Enabled = false;
					}
					// 変換後の電話番号が null or 空文字以外の時
					else {
						// 発信ボタンのテキストを「Call [電話番号]」にし、ボタンを有効にします。
						callButton.Text = $"Call {translatedNumber}";
						callButton.Enabled = true;
					}
				};

			// 発信ボタンをクリックした時のイベントを構成します。
			callButton.Click +=
				( object sender, EventArgs e ) => {
					// "Call" ボタンがクリックされたら電話番号へのダイヤルを試みます。
					var callDialog = new AlertDialog.Builder( this );
					// ダイアログのメッセージを構成します。
					callDialog.SetMessage( "Call " + translatedNumber + "?" );
					// ニュートラルボタンとそれをクリックした時のイベントを構成します。
					callDialog.SetNeutralButton( "Call", delegate {
						// 掛けた番号のリストに番号を追加します。
						phoneNumbers.Add( translatedNumber );
						// Call History ボタンを有効にします。
						callHistoryButton.Enabled = true;
						// 電話を発信するIntentオブジェクトを作成します。
						var callIntent = new Intent( Intent.ActionCall );
						// データ形式は「tell:[電話番号]」です。
						callIntent.SetData( Android.Net.Uri.Parse( "tel:" + translatedNumber ) );
						StartActivity( callIntent );
					} );
					// キャンセルボタンとそれをクリックした時のイベントを構成します。
					callDialog.SetNegativeButton( "Cancel", delegate { } );
					// アラートダイアログを表示し、ユーザーのレスポンスを待ちます。
					callDialog.Show();
				};

			// 発信履歴のボタンをクリックした時のイベントを構成します。
			callHistoryButton.Click +=
				( sender, e ) => {
					// CallHistoryActivityに送るIntentを作成します。
					var intent = new Intent( this, typeof( CallHistoryActivity ) );
					// 発信履歴のデータをIntentにセットします。
					intent.PutStringArrayListExtra( "phone_numbers", phoneNumbers );
					StartActivity( intent );
				};

		}

	}

}


text:
"""AWS platform for notify component."""
import asyncio
import base64
import json
import logging

from aiobotocore.session import AioSession

from homeassistant.components.notify import (
    ATTR_TARGET,
    ATTR_TITLE,
    ATTR_TITLE_DEFAULT,
    BaseNotificationService,
)
from homeassistant.components.notify.const import ATTR_DATA
from homeassistant.const import (
    CONF_NAME,
    CONF_PLATFORM,
    CONF_PROFILE_NAME,
    CONF_SERVICE,
)
from homeassistant.helpers.json import JSONEncoder

from .const import CONF_CONTEXT, CONF_CREDENTIAL_NAME, CONF_REGION, DATA_SESSIONS

_LOGGER = logging.getLogger(__name__)

async def get_available_regions(hass, service):
    """Get available regions for a service."""
    session = AioSession()
    return await session.get_available_regions(service)

async def async_get_service(hass, config, discovery_info=None):
    """Get the AWS notification service."""
    if discovery_info is None:
        _LOGGER.error("Please config aws notify platform in aws component")
        return None

    session = None

    conf = discovery_info

    service = conf[CONF_SERVICE]
    region_name = conf[CONF_REGION]

    available_regions = await get_available_regions(hass, service)
    if region_name not in available_regions:
        _LOGGER.error(
            "Region %s is not available for %s service, must in %s",
            region_name,
            service,
            available_regions,
        )
        return None

    aws_config = conf.copy()

    del aws_config[CONF_SERVICE]
    del aws_config[CONF_REGION]
    if CONF_PLATFORM in aws_config:
        del aws_config[CONF_PLATFORM]
    if CONF_NAME in aws_config:
        del aws_config[CONF_NAME]
    if CONF_CONTEXT in aws_config:
        del aws_config[CONF_CONTEXT]

    if not aws_config:
        # no platform config, use the first aws component credential instead
        if hass.data[DATA_SESSIONS]:
            session = next(iter(hass.data[DATA_SESSIONS].values()))
        else:
            _LOGGER.error("Missing aws credential for %s", config[CONF_NAME])
            return None

    if session is None:
        credential_name = aws_config.get(CONF_CREDENTIAL_NAME)
        if credential_name is not None:
            session = hass.data[DATA_SESSIONS].get(credential_name)
            if session is None:
                _LOGGER.warning("No available aws session for %s", credential_name)
            del aws_config[CONF_CREDENTIAL_NAME]

    if session is None:
        if (profile := aws_config.get(CONF_PROFILE_NAME)) is not None:
            session = AioSession(profile=profile)
            del aws_config[CONF_PROFILE_NAME]
        else:
            session = AioSession()

    aws_config[CONF_REGION] = region_name

    if service == "lambda":
        context_str = json.dumps(
            {"custom": conf.get(CONF_CONTEXT, {})}, cls=JSONEncoder
        )
        context_b64 = base64.b64encode(context_str.encode("utf-8"))
        context = context_b64.decode("utf-8")
        return AWSLambda(session, aws_config, context)

    if service == "sns":
        return AWSSNS(session, aws_config)

    if service == "sqs":
        return AWSSQS(session, aws_config)

    # should not reach here since service was checked in schema
    return None

class AWSNotify(BaseNotificationService):
    """Implement the notification service for the AWS service."""

    def __init__(self, session, aws_config):
        """Initialize the service."""
        self.session = session
        self.aws_config = aws_config

class AWSLambda(AWSNotify):
    """Implement the notification service for the AWS Lambda service."""

    service = "lambda"

    def __init__(self, session, aws_config, context):
        """Initialize the service."""
        super().__init__(session, aws_config)
        self.context = context

    async def async_send_message(self, message="", **kwargs):
        """Send notification to specified LAMBDA ARN."""
        if not kwargs.get(ATTR_TARGET):
            _LOGGER.error("At least one target is required")
            return

        cleaned_kwargs = {k: v for k, v in kwargs.items() if v is not None}
        payload = {"message": message}
        payload.update(cleaned_kwargs)
        json_payload = json.dumps(payload)

        async with self.session.create_client(
            self.service, **self.aws_config
        ) as client:
            tasks = []
            for target in kwargs.get(ATTR_TARGET, []):
                tasks.append(
                    client.invoke(
                        FunctionName=target,
                        Payload=json_payload,
                        ClientContext=self.context,
                    )
                )

            if tasks:
                await asyncio.gather(*tasks)

class AWSSNS(AWSNotify):
    """Implement the notification service for the AWS SNS service."""

    service = "sns"

    async def async_send_message(self, message="", **kwargs):
        """Send notification to specified SNS ARN."""
        if not kwargs.get(ATTR_TARGET):
            _LOGGER.error("At least one target is required")
            return

        message_attributes = {}
        if data := kwargs.get(ATTR_DATA):
            message_attributes = {
                k: {"StringValue": v, "DataType": "String"}
                for k, v in data.items()
                if v is not None
            }
        subject = kwargs.get(ATTR_TITLE, ATTR_TITLE_DEFAULT)

        async with self.session.create_client(
            self.service, **self.aws_config
        ) as client:
            tasks = []
            for target in kwargs.get(ATTR_TARGET, []):
                tasks.append(
                    client.publish(
                        TargetArn=target,
                        Message=message,
                        Subject=subject,
                        MessageAttributes=message_attributes,
                    )
                )

            if tasks:
                await asyncio.gather(*tasks)

class AWSSQS(AWSNotify):
    """Implement the notification service for the AWS SQS service."""

    service = "sqs"

    async def async_send_message(self, message="", **kwargs):
        """Send notification to specified SQS ARN."""
        if not kwargs.get(ATTR_TARGET):
            _LOGGER.error("At least one target is required")
            return

        cleaned_kwargs = {k: v for k, v in kwargs.items() if v is not None}
        message_body = {"message": message}
        message_body.update(cleaned_kwargs)
        json_body = json.dumps(message_body)
        message_attributes = {}
        for key, val in cleaned_kwargs.items():
            message_attributes[key] = {
                "StringValue": json.dumps(val),
                "DataType": "String",
            }

        async with self.session.create_client(
            self.service, **self.aws_config
        ) as client:
            tasks = []
            for target in kwargs.get(ATTR_TARGET, []):
                tasks.append(
                    client.send_message(
                        QueueUrl=target,
                        MessageBody=json_body,
                        MessageAttributes=message_attributes,
                    )
                )

            if tasks:
                await asyncio.gather(*tasks)


text:
namespace DevO2.UI
{
    partial class GMapsViewer
    {
        /// <summary>
        /// Variable del diseñador requerida.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Limpiar los recursos que se estén utilizando.
        /// </summary>
        /// <param name="disposing">true si los recursos administrados se deben eliminar; false en caso contrario, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Código generado por el Diseñador de componentes

        /// <summary>
        /// Método necesario para admitir el Diseñador. No se puede modificar
        /// el contenido del método con el editor de código.
        /// </summary>
        private void InitializeComponent()
        {
            this.wbbGMaps = new System.Windows.Forms.WebBrowser();
            this.SuspendLayout();
            //
            // wbbGMaps
            //
            this.wbbGMaps.Dock = System.Windows.Forms.DockStyle.Fill;
            this.wbbGMaps.IsWebBrowserContextMenuEnabled = false;
            this.wbbGMaps.Location = new System.Drawing.Point(0, 0);
            this.wbbGMaps.MinimumSize = new System.Drawing.Size(20, 20);
            this.wbbGMaps.Name = "wbbGMaps";
            this.wbbGMaps.ScriptErrorsSuppressed = true;
            this.wbbGMaps.ScrollBarsEnabled = false;
            this.wbbGMaps.Size = new System.Drawing.Size(474, 322);
            this.wbbGMaps.TabIndex = 0;
            this.wbbGMaps.WebBrowserShortcutsEnabled = false;
            this.wbbGMaps.DocumentCompleted += new System.Windows.Forms.WebBrowserDocumentCompletedEventHandler(this.wbbGMaps_DocumentCompleted);
            //
            // GMapsViewer
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.Controls.Add(this.wbbGMaps);
            this.Name = "GMapsViewer";
            this.Size = new System.Drawing.Size(474, 322);
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.WebBrowser wbbGMaps;
    }
}


text:
'use strict';

var JpipTileStructureStub = function(
    tileParams, codestreamStructure, progressionOrder, componentStructure) {

    this.getComponentStructure = function(component) {
        if (componentStructure !== undefined) {
            return componentStructure;
        }

        throw 'Unexpected call to JpipTileStructureStub.getComponentStructure(). Fix test stub implementation';
    };

    this.getDefaultComponentStructure = function() {
        if (componentStructure !== undefined) {
            return componentStructure;
        }

        throw 'Unexpected call to JpipTileStructureStub.getDefaultComponentStructure(). Fix test stub implementation';
    };

    this.getProgressionOrder = function() {
        return progressionOrder;
    };

    this.getTileWidth = function() {
        return tileParams.tileSize[0];
    };

    this.getTileHeight = function() {
        return tileParams.tileSize[1];
    };

    this.getNumQualityLayers = function getNumQualityLayers() {
        return tileParams.numQualityLayers;
    };

    this.getIsPacketHeaderNearData = function getIsPacketHeaderNearData() {
        return tileParams.isPacketHeadersNearData;
    };

    this.getIsStartOfPacketMarkerAllowed = function getIsStartOfPacketMarkerAllowed() {
        return tileParams.isStartOfPacketMarkerAllowed;
    };

    this.getIsEndPacketHeaderMarkerAllowed =
        function getIsEndPacketHeaderMarkerAllowed() {

        return tileParams.isEndPacketHeaderMarkerAllowed;
    };

    this.getCodestreamStructureForTest = function() {
        return codestreamStructure;
    };

    this.getTileSizeForTest = function() {
        return tileParams.tileSize;
    };

    this.getPrecinctIterator = function getPrecinctIterator(
        tileIndex, codestreamPartParams, isIteratePrecinctsNotInCodestreamPart) {

        var dummyPos = 0;

        var iterator = {
            tryAdvance: function tryAdvance() {
                if (dummyPos === 2) {
                    return false;
                }
                ++dummyPos;
                return true;
            },

            get dummyPos() { return dummyPos; },

            get isInCodestreamPart() { return true; }
        };

        return iterator;
    };

    this.precinctPositionToInClassIndex = function(precinctPosition) {
        return precinctPosition.dummyPos;
    };
};


text:
goog.provide('pl.retained.HorizontalAlignment');
goog.provide('pl.retained.VerticalAlignment');

/**
 * @enum {string}
 */
pl.retained.VerticalAlignment = {
  TOP: 'Top',
  BOTTOM: 'Bottom',
  CENTER: 'Center'
};

/**
 * @enum {string}
 */
pl.retained.HorizontalAlignment = {
  LEFT: 'Left',
  RIGHT: 'Right',
  CENTER: 'Center'
};


text:
/*==================================================
 *  Exhibit.Database German localization
 *==================================================
 */

if (!("l10n" in Exhibit.Database)) {
    Exhibit.Database.l10n = {};
}

Exhibit.Database.l10n.itemType = {
    label:          "Element",
    pluralLabel:    "Elemente",
    uri:            "http://simile.mit.edu/2006/11/exhibit#Item"
};
Exhibit.Database.l10n.labelProperty = {
    label:                  "Bezeichnung",
    pluralLabel:            "Bezeichnungen",
    reverseLabel:           "Bezeichnung von",
    reversePluralLabel:     "Bezeichnungen von"
};
Exhibit.Database.l10n.typeProperty = {
    label:                  "Typ",
    pluralLabel:            "Typen",
    reverseLabel:           "Typ von",
    reversePluralLabel:     "Typen von"
};
Exhibit.Database.l10n.uriProperty = {
    label:                  "URI",
    pluralLabel:            "URIs",
    reverseLabel:           "URI von",
    reversePluralLabel:     "URIs von"
};
Exhibit.Database.l10n.sortLabels = {
    "text": {
        ascending:  "a - z",
        descending: "z - a"
    },
    "number": {
        ascending:  "kleinstes zuerst",
        descending: "größtes zuerst"
    },
    "date": {
        ascending:  "frühestes zuerst",
        descending: "spätestes zuerst"
    },
    "boolean": {
        ascending:  "falsch zuerst",
        descending: "wahr zuerst"
    },
    "item": {
        ascending:  "a - z",
        descending: "z - a"
    }
};

Exhibit.Database.l10n.labelItemsOfType = function(count, typeID, database, countStyleClass) {
    var label = count == 1 ? Exhibit.Database.l10n.itemType.label :
        Exhibit.Database.l10n.itemType.pluralLabel

    var type = database.getType(typeID);
    if (type) {
        label = type.getLabel();
        if (count != 1) {
            var pluralLabel = type.getProperty("pluralLabel");
            if (pluralLabel) {
                label = pluralLabel;
            }
        }
    }

    var span = document.createElement("span");
    span.innerHTML = "" + count + " " + label;

    return span;
};


text:
#pragma once

#include <vector>
#include <ostream>

#include <folly/experimental/exception_tracer/ExceptionTracer.h>

namespace folly {
namespace exception_tracer {

struct ExceptionStats {
  uint64_t count;
  ExceptionInfo info;
};

/**
 * This function accumulates exception throwing statistics across all threads.
 * Please note, that during call to this function, other threads might block
 * on exception throws, so it should be called seldomly.
 * All pef-thread statistics is being reset by the call.
 */
std::vector<ExceptionStats> getExceptionStatistics();

std::ostream& operator<<(std::ostream& out, const ExceptionStats& data);

} // namespace exception_tracer
} // namespace folly