text:
title: CustomCodeField
page_title: CustomCodeField | RadWordsProcessing for ASP.NET AJAX Documentation
description: CustomCodeField
slug: radwordsprocessing-concepts-customcodefield
tags: customcodefield
published: True
position: 3
---

# CustomCodeField

__Fields__ in __RadFlowDocument__ consist of code fragment and result fragment as explained in the [Fields]({%slug radwordsprocessing-concepts-fields%}) article. Some fields have direct representation in the document model – for example [Hyperlinks]({%slug radwordsprocessing-concepts-hyperlinks%}). For all other fields you can use the __CustomCodeField__ class – however you will need some knowledge of how to correctly form the code of the field.

## Syntax

Here is the basic syntax of a field code:

field-type [field-argument] [switches]

* *field-type*: The type of the field. For example: HYPERINK.

* *argument*: The argument of the field. This is optional as some of the fields do not require an argument.

* *switches*: Additional properties of the field. More information on the topic can be found in the [Fields]({%slug radwordsprocessing-concepts-fields%}) article.

## Inserting

The suggested approach for inserting code fields is by using [RadFlowDocumentEditor]({%slug radwordsprocessing-editing-radflowdocumenteditor%}). The __InsertField()__ method accepts code as a first argument and the result as a second argument.

Here are some commonly used fields. The complete list of field codes and the switches for each of them can be found in the [Docx specification](http://www.ecma-international.org/publications/standards/Ecma-376.htm).

>In all examples the result fragment is also inserted. However, if you export the document to [Docx format]({%slug radwordsprocessing-formats-and-conversion-docx%}), you can make use of the __AutoUpdateFields__ property. It forces all fields to be updated when the document is opened in MS Word or another editor.

### Inserting PAGE Field

Here is how to insert __PAGE__ field representing the current page number in the document:

#### __C#__

{{region radwordsprocessing-concepts-customcodefield_0}}
    editor.InsertField("PAGE  \\* ROMAN", "VII");
{{endregion}}

The __\* ROMAN__ is general formatting switch that formats a numeric result using uppercase Roman numerals.

### Inserting NUMPAGE Field

Here is how a combination of __PAGE__ and __NUMPAGES__ fields can be inserted to show which is the current page as well as the total page count in the document:

#### __C#__

{{region radwordsprocessing-concepts-customcodefield_1}}
    editor.InsertText("Page ");
    editor.InsertField("PAGE", "3");
    editor.InsertText(" of ");
    editor.InsertField("NUMPAGES", "5");
{{endregion}}

### Inserting AUTHOR Field

Here is how to insert __AUTHOR__ field showing the name of the author of the document.

#### __C#__

{{region radwordsprocessing-concepts-customcodefield_3}}
    editor.InsertField("AUTHOR  \\* Upper", "JOHN DOE");
{{endregion}}

The __\* Upper__ switch will convert all letters in the result to uppercase.

### Inserting Table of Contents Field

Here is how to insert table of contents (TOC) field:

#### __C#__

{{region radwordsprocessing-concepts-customcodefield_4}}
    FieldInfo tocField = editor.InsertField("TOC \\o \"1-3\" \\h \\z \\u", "result");
    tocField.IsDirty = true;
{{endregion}}

There are several switches which can be used for this field:

* __\o "1-3"__: Specifies that the first 3 heading levels should be included in the table of contents.

* __\h__: Makes the table of contents entries hyperlinks.

* __\z__: Hides tab leader and page numbers in Web layout view.

* __\u__: Uses the applied paragraph outline level.

The __IsDirty__ property is set so that the TOC field is updated when the document is loaded inside an editor like Microsoft Word.

# See Also

 * [Fields]({%slug radwordsprocessing-concepts-fields%})

 * [RadFlowDocument]({%slug radwordsprocessing-model-radflowdocument%})

 * [RadFlowDocumentEditor]({%slug radwordsprocessing-editing-radflowdocumenteditor%})


text:
try:
    # Switching to 'agg' backend (may be overridden in holoviews.rc)
    import matplotlib.pyplot as plt
    plt.switch_backend('agg')
except:
    pass

import os
from distutils.version import LooseVersion

from matplotlib import rc_params_from_file

from ...core import Layout, NdOverlay, Collator, GridMatrix
from ...core.options import Cycle, Palette, Options
from ...element import * # noqa (API import)
from ..plot import PlotSelector
from .annotation import * # noqa (API import)
from .chart import * # noqa (API import)
from .chart3d import * # noqa (API import)
from .path import * # noqa (API import)
from .plot import * # noqa (API import)
from .raster import * # noqa (API import)
from .tabular import * # noqa (API import)
from . import pandas # noqa (API import)
from . import seaborn # noqa (API import)

from .renderer import MPLRenderer

mpl_ge_150 = LooseVersion(mpl.__version__) >= '1.5.0'

def set_style(key):
    """
    Select a style by name, e.g. set_style('default'). To revert to the
    previous style use the key 'unset' or False.
    """
    if key is None:
        return
    elif not key or key in ['unset', 'backup']:
        if 'backup' in styles:
            plt.rcParams.update(styles['backup'])
        else:
            raise Exception('No style backed up to restore')
    elif key not in styles:
        raise KeyError('%r not in available styles.')
    else:
        path = os.path.join(os.path.dirname(__file__), styles[key])
        new_style = rc_params_from_file(path)
        styles['backup'] = dict(plt.rcParams)

        plt.rcParams.update(new_style)

styles = {'default': './default.mplstyle',
          'default>1.5': './default1.5.mplstyle'}

if mpl_ge_150:
    set_style('default>1.5')
else:
    set_style('default')

# Define matplotlib based style cycles and Palettes
def get_color_cycle():
    if mpl_ge_150:
        cyl = mpl.rcParams['axes.prop_cycle']
        # matplotlib 1.5 verifies that axes.prop_cycle *is* a cycler
        # but no guarantee that there's a `color` key.
        # so users could have a custom rcParmas w/ no color...
        try:
            return [x['color'] for x in cyl]
        except KeyError:
            pass  # just return axes.color style below
    return mpl.rcParams['axes.color_cycle']

Cycle.default_cycles.update({'default_colors': get_color_cycle()})
Palette.colormaps.update({cm: plt.get_cmap(cm) for cm in plt.cm.datad})

style_aliases = {'edgecolor': ['ec', 'ecolor'], 'facecolor': ['fc'],
                 'linewidth': ['lw'], 'edgecolors': ['ec', 'edgecolor'],
                 'linestyle': ['ls'], 'size': ['s'], 'color': ['c'],
                 'markeredgecolor': ['mec'], 'markeredgewidth': ['mew'],
                 'markerfacecolor': ['mfc'], 'markersize': ['ms']}

Store.renderers['matplotlib'] = MPLRenderer.instance()

# Defines a wrapper around GridPlot and RasterGridPlot
# switching to RasterGridPlot if the plot only contains
# Raster Elements
BasicGridPlot = GridPlot
def grid_selector(grid):
    raster_fn = lambda x: True if isinstance(x, Raster) else False
    all_raster = all(grid.traverse(raster_fn, [Element]))
    return 'RasterGridPlot' if all_raster else 'GridPlot'

GridPlot = PlotSelector(grid_selector,
                        plot_classes=[('GridPlot', BasicGridPlot),
                                      ('RasterGridPlot', RasterGridPlot)])

# Register default Elements
Store.register({Curve: CurvePlot,
                Scatter: PointPlot,
                Bars: BarPlot,
                Histogram: HistogramPlot,
                Points: PointPlot,
                VectorField: VectorFieldPlot,
                ErrorBars: ErrorPlot,
                Spread: SpreadPlot,
		Spikes: SpikesPlot,
                BoxWhisker: BoxPlot,
                Area: AreaPlot,

                # General plots
                GridSpace: GridPlot,
                GridMatrix: GridPlot,
                NdLayout: LayoutPlot,
                Layout: LayoutPlot,
                AdjointLayout: AdjointLayoutPlot,

                # Element plots
                NdOverlay: OverlayPlot,
                Overlay: OverlayPlot,

                # Chart 3D
                Surface: SurfacePlot,
                Trisurface: TrisurfacePlot,
                Scatter3D: Scatter3DPlot,

                # Tabular plots
                ItemTable: TablePlot,
                Table: TablePlot,
                NdElement: TablePlot,
                Collator: TablePlot,

                # Raster plots
                QuadMesh: QuadMeshPlot,
                Raster: RasterPlot,
                HeatMap: HeatMapPlot,
                Image: RasterPlot,
                RGB: RasterPlot,
                HSV: RasterPlot,

                # Annotation plots
                VLine: VLinePlot,
                HLine: HLinePlot,
                Arrow: ArrowPlot,
                Spline: SplinePlot,
                Text: TextPlot,

                # Path plots
                Contours: PathPlot,
                Path:     PathPlot,
                Box:      PathPlot,
                Bounds:   PathPlot,
                Ellipse:  PathPlot,
                Polygons: PolygonPlot}, 'matplotlib', style_aliases=style_aliases)

MPLPlot.sideplots.update({Histogram: SideHistogramPlot,
                          GridSpace: GridPlot,
                          Spikes: SideSpikesPlot,
                          BoxWhisker: SideBoxPlot})

options = Store.options(backend='matplotlib')

# Default option definitions
# Note: *No*short aliases here! e.g use 'facecolor' instead of 'fc'

# Charts
options.Curve = Options('style', color=Cycle(), linewidth=2)
options.Scatter = Options('style', color=Cycle(), marker='o')
options.ErrorBars = Options('style', ecolor='k')
options.Spread = Options('style', facecolor=Cycle(), alpha=0.6, edgecolor='k', linewidth=0.5)
options.Bars = Options('style', ec='k', color=Cycle())
options.Histogram = Options('style', ec='k', facecolor=Cycle())
options.Points = Options('style', color=Cycle(), marker='o')
options.Scatter3D = Options('style', c=Cycle(), marker='o')
options.Scatter3D = Options('plot', fig_size=150)
options.Surface = Options('plot', fig_size=150)
options.Spikes = Options('style', color='black')
options.Area = Options('style', facecolor=Cycle(), edgecolor='black')
options.BoxWhisker = Options('style', boxprops=dict(color='k', linewidth=1.5),
                             whiskerprops=dict(color='k', linewidth=1.5))

# Rasters
options.Image = Options('style', cmap='hot', interpolation='nearest')
options.Raster = Options('style', cmap='hot', interpolation='nearest')
options.QuadMesh = Options('style', cmap='hot')
options.HeatMap = Options('style', cmap='RdYlBu_r', interpolation='nearest')
options.HeatMap = Options('plot', show_values=True, xticks=20, yticks=20)
options.RGB = Options('style', interpolation='nearest')
# Composites
options.Layout = Options('plot', sublabel_format='{Alpha}')
options.GridMatrix = Options('plot', fig_size=160, shared_xaxis=True,
                             shared_yaxis=True, xaxis=None, yaxis=None)

# Annotations
options.VLine = Options('style', color=Cycle())
options.HLine = Options('style', color=Cycle())
options.Spline = Options('style', linewidth=2, edgecolor='r')
options.Text = Options('style', fontsize=13)
options.Arrow = Options('style', color='k', linewidth=2, fontsize=13)
# Paths
options.Contours = Options('style', color=Cycle())
options.Contours = Options('plot', show_legend=True)
options.Path = Options('style', color=Cycle())
options.Box = Options('style', color=Cycle())
options.Bounds = Options('style', color=Cycle())
options.Ellipse = Options('style', color=Cycle())
# Interface
options.TimeSeries = Options('style', color=Cycle())

redpajama_set_name: RedPajamaGithub


text:
package jaxb_builders;

import javax.xml.bind.JAXBContext;

import interfaces.Builder;
import ru.aplana.jaxb.JaxbContexts;
import ru.aplana.model.xsd.jaxb.client_profile.BaseSvcRqType;
import ru.aplana.model.xsd.jaxb.client_profile.BaseSvcRsType;
import ru.aplana.model.xsd.jaxb.client_profile.CustCreditRsType;
import ru.aplana.model.xsd.jaxb.client_profile.IFXType;
import ru.aplana.model.xsd.jaxb.client_profile.ObjectFactory;
import ru.aplana.model.xsd.jaxb.client_profile.StatusType;
import ru.aplana.tools.XmlHelper;

public class ClientProfileResponseBuilder implements Builder {

	private static JAXBContext jaxbCtx;
	private final String messageId;

	static {
		jaxbCtx = JaxbContexts.getInstance().getJAXBContext(BaseSvcRqType.class.getPackage().getName(),
				ObjectFactory.class.getClassLoader());
	}

	public ClientProfileResponseBuilder(String messageId) {
		this.messageId = messageId;
	}

	@Override
	public XmlHelper getXmlHelper() {
		return new XmlHelper(jaxbCtx);
	}

	@Override
	public String makeXml() throws Exception {

		IFXType ifxType = new IFXType();

		BaseSvcRsType bsrt = new BaseSvcRsType();
		bsrt.setRqUID(this.messageId);

		StatusType st = new StatusType();
		st.setStatusCode(0);

		bsrt.setStatus(st);

		CustCreditRsType ccrt = new CustCreditRsType();
		ccrt.setRqUID(this.messageId);

		StatusType stCredit = new StatusType();
		stCredit.setStatusCode(0);

		ccrt.setStatus(stCredit);
		bsrt.setCustCreditRs(ccrt);
		ifxType.setBaseSvcRs(bsrt);

		ObjectFactory of = new ObjectFactory();

		String result = getXmlHelper().marshall(of.createIFX(ifxType));

		return result;
	}
}


text:
package org.arrah.framework.datagen;

/*
 * This file is used for shuffle data
 * and Mask data in  RTM columns.
 *
 */

import java.util.ArrayList;
import java.util.Collections;

import org.arrah.framework.ndtable.ReportTableModel;

public class ShuffleRTM {

	public ShuffleRTM() {

	} // Constructor

	public static String shuffleString(String str) {
		if ( str == null || "".equals(str)) return str;

		ArrayList<Character> charList = new ArrayList<Character>();
		for (int i=0; i < str.length(); i++) {
			charList.add(str.charAt(i));
		}
		Collections.shuffle(charList);

		String newVal = new String();
		for (int i=0; i < charList.size(); i++) {
			newVal = newVal.concat(charList.get(i).toString());
		}
		return newVal;

	}

	public static ArrayList<Integer> shuffleIntegerList(ArrayList<Integer> rowNumber) {
		if ( rowNumber == null || rowNumber.size() ==0 ) return rowNumber;

		Collections.shuffle(rowNumber);
		return rowNumber;

	}
	/* It will modify individual record */

	public static ReportTableModel shuffleRecord(ReportTableModel rtm, int colIndex, int beginRow, int endRow) {
		if (rtm == null || rtm.getModel().getRowCount() == 0) return rtm;
		for (int i = beginRow; i < endRow; i++ ) {
			try {
				String colVal = (rtm.getModel().getValueAt(i, colIndex)).toString();
				String newColVal = shuffleString(colVal);
				rtm.setValueAt(newColVal,i, colIndex);
			} catch (Exception e) {
				rtm.setValueAt(rtm.getModel().getValueAt(i, colIndex),i, colIndex);
			}
		}
		return rtm;

	}

	/* It will shuffle across table but will not modify record */
	public static ReportTableModel shuffleColumns(ReportTableModel rtm, int[] colIndex, int beginRow, int endRow) {
		if (rtm == null || rtm.getModel().getRowCount() == 0) return rtm;
		ArrayList<Integer> rowList = new ArrayList<Integer>();
		for (int i = beginRow; i < endRow; i++ ) {
			rowList.add(i);
		}
		rowList = shuffleIntegerList(rowList);

		for (int i = beginRow; i < endRow; i++ ) {
			for (int j =0; j<colIndex.length; j++) {
				Object colVal = (rtm.getModel().getValueAt(i, colIndex[j]));
				Object newcolVal = (rtm.getModel().getValueAt(rowList.get(i), colIndex[j]));
				rtm.setValueAt(colVal,rowList.get(i),colIndex[j]);
				rtm.setValueAt(newcolVal,i,colIndex[j]);
			}

		} // Shuffling done

		return rtm;
	}

	// It will mask columns with given maskChar **** /
	public static ReportTableModel maskColumn(ReportTableModel rtm, int colIndex,
				int beginRow, int endRow, String maskChar, int maskPosition) {

		if (rtm == null || rtm.getModel().getRowCount() == 0) return rtm;

		for (int i = beginRow; i < endRow; i++ ) {
			Object o = rtm.getModel().getValueAt(i, colIndex);
			if ( o == null) {
				rtm.setValueAt(o,i,colIndex);
				continue;
			}
			String colVal = o.toString();
			String newcolVal = null;
			if ( maskChar.length() > colVal.length() )
				newcolVal = maskChar;
			else {
				switch (maskPosition) {
				case 0: // start from begining
					newcolVal = maskChar +colVal.substring(maskChar.length());
					break;
				case -1 : // start from end
					newcolVal = colVal.substring(0,colVal.length() -maskChar.length()) + maskChar;
					break;
				default: // start from pos of colIndex
					newcolVal = colVal.substring(0,maskPosition) + maskChar;
					break;
			}
			} // end of else

			rtm.setValueAt(newcolVal,i,colIndex);

		} // Masking done

		return rtm;
	}

} // End of ShuffleRTM


text:
namespace ge0
{
class Ge0Parser
{
public:
  struct Result
  {
    double m_zoomLevel = 0.0;
    double m_lat = 0.0;
    double m_lon = 0.0;
    std::string m_name;
  };

  Ge0Parser();

  bool Parse(std::string const & url, Result & result);

protected:
  bool ParseAfterPrefix(std::string const & url, size_t from, Result & result);

  uint8_t DecodeBase64Char(char const c);
  static double DecodeZoom(uint8_t const zoomByte);
  bool DecodeLatLon(std::string const & s, double & lat, double & lon);
  bool DecodeLatLonToInt(std::string const & s, int & lat, int & lon);
  double DecodeLatFromInt(int const lat, int const maxValue);
  double DecodeLonFromInt(int const lon, int const maxValue);
  std::string DecodeName(std::string name);
  void SpacesToUnderscore(std::string & name);
  void ValidateName(std::string & name);
  static bool IsHexChar(char const a);

private:
  uint8_t m_base64ReverseCharTable[256];
};

std::string DebugPrint(Ge0Parser::Result const & r);
}  // namespace ge0


text:
**Since I am no longer working with Angular, I am no longer maintaining this project**

# Angular Mockable HTTP Provider

**NOTE: Version 0.3+ is designed to work with Angular 1.3.x, use version 0.2.x if you are using angular 1.2.x.å**

This is not designed as a replacement to $httpBackend as this will never do some of the things $httpBackend can (like verifying the number of times a request was called or verifying there are no more expected calls left).

The primary thing right now that this component can do that I could not find any easy way to do with $httpBackend is to be able to add delay to the mocked responses. I use DalekJS instead of Karma to unit test my UI (why I don't use Karma is a whole other conversion outside the scope of this component) and only certain things can be tested properly if there is a delay in the mocked response. For example, I might display some sort of loading indicator when fetching data so if the data is returned near instant like it is with $httpBackend, I can't verify that type of functionality.  The only thing I could find with adding delays to response with $httpBackend would add the delay to all responses which is not very practical.

It should also be known this component in specifically designed for testing and as such things like performance and what not will never be something worried about (it is highly recommended against using this in production).

# Examples

To use this, include the javascript file and add the httpMockable module to you application like:

```javascript
angular.module('app', ['httpMockable']);
```

The way to add a mocked response is by using the register command of the httpMocker service.  The signature of that method is as follows:

```javascript
httpMocker.register(method, url, response, options)
```

The method parameter is a string and any HTTP method (GET, POST, PUT, PATCH, DELETE, ... you get the point).  You can also use JSONP there too.

The url parameter is a string with the url that should match in order to have the mocked response returned.  Note that if the options have a payload defined, that must also match in order to return the mocked response.

The response parameter is a string of the mocked response to be returned.

The options parameter is an object that can container the following options:

- statusCode (int): The HTTP response to code return with the mocked response (defaults to 200)
- headers (string): Any headers you with to be returned with the mocked response (defaults to empty string)
- payload (string): The expected payload with the request in order to be match with the mocked response (defaults to undefined)
- delay (int): The number of millisecond to delay the response (defaults to 0)

Here is an example of defined a mocked response:

```javascript
  httpMocker.register('GET', '/api/v1/users_custom_response?itemsPerPage=3', JSON.stringify({
    status: "success",
    httpStatusCode: 200,
    data: [{
      id: 1,
      firstName: 'Test',
      lastName: 'User1',
      username: 'testuser1'
    }, {
      id: 2,
      firstName: 'Test',
      lastName: 'User2',
      username: 'testuser2'
    }, {
      id: 3,
      firstName: 'Test',
      lastName: 'User3',
      username: 'testuser3'
    }],
    totalRecords: 3
  }), {
    statusCode: 200,
    delay: 500
  });
```


text:
using System;
using System.Collections.Generic;
using System.Web.UI;
using EPiServer.Core;
using EPiServer.Filters;
using EPiServer.Web.WebControls;

namespace EPiServer.Templates.AlloyTech.Units.Placeable
{
    /// <summary>
    ///	Lists the pages that has been changed in the last x hours,
    /// where x is the number of hours specified in the property "RecentHours".
    /// </summary>
    public partial class ChangedPages : UserControlBase
    {
        // "RecentContainer" (PropertyPageReference)[Optional, Default value=Start page for site] defines the root page for changed pages.

        // "RecentHours" (PropertyNumber)Required, No default value] Number of hours back in time to check for changed pages.
        private const string _recentHoursPropertyName = "RecentHours";

        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Load"/> event.
        /// </summary>
        /// <param name="e">The <see cref="T:System.EventArgs"/> object that contains the event data.</param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            PropertyCriteriaCollection pcc = new PropertyCriteriaCollection();
            PropertyCriteria pc = new PropertyCriteria
            {
                Name = "PageChanged",
                Value = DateTime.Now.Subtract(TimeSpan.FromHours(CorrectHoursPropertyValue())).ToString(),
                Condition = CompareCondition.GreaterThan,
                Type = PropertyDataType.Date
            };

            pcc.Add(pc);
            var pdc = DataFactory.Instance.FindPagesWithCriteria(CurrentPage["RecentContainer"] as PageReference ?? PageReference.StartPage, pcc);
            pagelist.DataSource = FilterForVisitor.Filter(pdc);
            pagelist.DataBind();
        }

        /// <summary>
        /// Corrects the hours property value based on a property on the currentpage
        /// </summary>
        /// <returns></returns>
        private int CorrectHoursPropertyValue()
        {
            DateTime minSqlValue = new DateTime(1900, 1, 1); // for SQL we count since 01 Jan 1900
            int hoursAllowed = (int)((DateTime.Now - minSqlValue).TotalHours);
            return (int)CurrentPage[_recentHoursPropertyName] > hoursAllowed ? hoursAllowed : (int)CurrentPage[_recentHoursPropertyName];
        }
    }
}


text:
title: updateItem
page_title: updateItem | RadListView for ASP.NET AJAX Documentation
description: updateItem
slug: listview/client-side-programming/radlistview/methods/updateitem
tags: updateitem
published: True
position: 2
---

# updateItem

##

Method which fires the Update command for the **RadListView** edited item corresponding to the index passed as an argument in edit mode.

|  **function updateItem(index)**  |  |  |
| ------ | ------ | ------ |
| **index** |Integer|The edited item corresponding to the **index** will be updated.|

````ASP.NET
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function UpdateFirstItem() {
            var listView = $find("<%= RadListView1.ClientID %>");
            listView.updateItem(0);
        }
    </script>
</telerik:RadCodeBlock>
````


text:
{% if render %}

Previous Leaderboards

    <select id="program_select" class="uniform">
      {% for program, url, selected in programs %}
        <option value="{{ url }}" {{ selected }}>{{ program }}</option>
      {% endfor %}
    </select>

{% endif %}


text:
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using TestHelper;
using Jubjubnest.Style.DotNet;
using Jubjubnest.Style.DotNet.Test.Helpers;

namespace Jubjubnest.Style.DotNet.Test
{
	[TestClass]
	public class NamingTests : CodeFixVerifier
	{

		[TestMethod]
		public void TestEmpty()
		{
			var test = @"";

			VerifyCSharpDiagnostic( test );
		}

		[TestMethod]
		public void TestNamespaceWithCamelCaseName()
		{

			VerifyCSharpDiagnostic(

					@"namespace TestProject.foo { }",

					new TestEnvironment { FileName = "foo/Test.cs" },
					Warning( 1, 23, NamingAnalyzer.NameNamespacesWithPascalCasing, "foo" ) );
		}

		[TestMethod]
		public void TestNamespacesContainingOneWithCamelCaseName()
		{

			VerifyCSharpDiagnostic(

					@"namespace TestProject.bar.Foobar { }",

					new TestEnvironment { FileName = "bar/Foobar/Test.cs" },
					Warning( 1, 23, NamingAnalyzer.NameNamespacesWithPascalCasing, "bar" ) );
		}

		[TestMethod]
		public void TestNumericNameWithCamelCase()
		{
			VerifyCSharpDiagnostic(

					@"namespace TestProject.Foo1Bar { class Foo2Bar { } }",

					new TestEnvironment { FileName = "Foo1Bar/Foo2Bar.cs" } ) ;
		}

		[TestMethod]
		public void TestClassWithCamelCaseName()
		{

			VerifyCSharpDiagnostic(

					@"namespace TestProject { class bar { } }",

					new TestEnvironment { FileName = "bar.cs" },
					Warning( 1, 31, NamingAnalyzer.NameTypesWithPascalCasing, "class", "bar" ) );
		}

		[TestMethod]
		public void TestEnumWithCamelCaseName()
		{

			VerifyCSharpDiagnostic(

					@"namespace TestProject { enum bar { } }",

					new TestEnvironment { FileName = "bar.cs" },
					Warning( 1, 30, NamingAnalyzer.NameTypesWithPascalCasing, "enum", "bar" ) );
		}

		[TestMethod]
		public void TestEventWithCamelCaseName()
		{

			VerifyCSharpDiagnostic(

					@"namespace TestProject { class Bar { public event EventHandler eventName; } }",

					new TestEnvironment { FileName = "Bar.cs" },
					Warning( 1, 63, NamingAnalyzer.NameEventsWithPascalCase, "eventName" ) );
		}

		[TestMethod]
		public void TestInterfaceWithCamelCaseName()
		{

			VerifyCSharpDiagnostic(

					@"namespace TestProject { interface bar { } }",

					new TestEnvironment { FileName = "bar.cs" },
					Warning( 1, 35, NamingAnalyzer.NameInterfacesWithIPrefix, "bar" ),
					Warning( 1, 35, NamingAnalyzer.NameTypesWithPascalCasing, "interface", "bar" ) );
		}

		[TestMethod]
		public void TestEnumValueWithCamelCaseName()
		{

			VerifyCSharpDiagnostic(

					@"namespace Foo { enum Bar { foo } }",

					new TestEnvironment { FileName = "Bar.cs" },
					Warning( 1, 28, NamingAnalyzer.NameEnumValuesWithPascalCase, "foo" ) );
		}

		[TestMethod]
		public void TestInterfaceWithoutIPrefix()
		{

			VerifyCSharpDiagnostic(

					@"namespace Foo { interface Bar { } }",

					new TestEnvironment { FileName = "Bar.cs" },
					Warning( 1, 27, NamingAnalyzer.NameInterfacesWithIPrefix, "Bar" ) );
		}

		[TestMethod]
		public void TestExceptionWithoutExceptionSuffix()
		{

			VerifyCSharpDiagnostic(

					@"namespace Foo { class Foo : Exception { } }",

					new TestEnvironment { FileName = "Foo.cs" },
					Warning( 1, 23, NamingAnalyzer.NameExceptionsWithExceptionSuffix, "Foo" ) );
		}

		[TestMethod]
		public void TestTypeArgumentWithoutTPrefix()
		{

			VerifyCSharpDiagnostic(

					@"namespace Foo { class Foo<Bar> { } }",

					new TestEnvironment { FileName = "Foo.cs" },
					Warning( 1, 27, NamingAnalyzer.NameTypeParameterWithTPrefix, "Bar" ) );
		}

		[TestMethod]
		public void TestPrefixedNamesAlone()
		{

			VerifyCSharpDiagnostic(

					@"namespace Foo {
						interface I<T> { void M<T>(); } }
					",

					new TestEnvironment { FileName = "I.cs" },
					Warning( 2, 17, NamingAnalyzer.NamePrefixedNamesWithDescriptiveName, "I" ),
					Warning( 2, 19, NamingAnalyzer.NamePrefixedNamesWithDescriptiveName, "T" ),
					Warning( 2, 31, NamingAnalyzer.NamePrefixedNamesWithDescriptiveName, "T" ) );
		}

		[TestMethod]
		public void TestProperNaming()
		{
			VerifyCSharpDiagnostic(
				@"namespace Foo.Bar {

					class Bar<TFoo> {
						public Bar() {}
						public void Method() {}
						public string Property { get; set; }
						public string XSingleCapitalCharacter { get; set; }
						public string SingleXCapitalCharacter { get; set; }
						public string SingleCapitalCharacterX { get; set; }

						public void Generic<TParameter>( TParameter p ) {}

						private string privateField;
						private string singleXCapitalCharacter;
						private string singleCapitalCharacterX;
						private readonly string readOnlyField = null
						private const int ConstField = 1;

						public event EventHandler FooBar;
					}
				}",
				new TestEnvironment { FileName = "Bar.cs" } );

			VerifyCSharpDiagnostic(
				@"namespace Foo.Bar {
					interface IBar { }
				}",
				new TestEnvironment { FileName = "IBar.cs" } );

			VerifyCSharpDiagnostic(
				@"namespace Foo.Bar {
					enum Foo { }
				}",
				new TestEnvironment { FileName = "Foo.cs" } );
		}

		[TestMethod]
		public void TestAbbreviationFails()
		{
			VerifyCSharpDiagnostic(
				@"class XYPascalCase {
						public void PascalXYCase() {}
						public void XYZPascalCase() {}
						public void PascalXYZCase() {}
						public void PascalCaseXY() {}

						private string camelXYCase;
						private string camelXYZCase;
						private string camelCaseXY;
					}
				}",
				new TestEnvironment { FileName = "XYPascalCase.cs" },
				Warning( 1, 7, NamingAnalyzer.NameTypesWithPascalCasing, "class", "XYPascalCase" ),
				Warning( 2, 19, NamingAnalyzer.NameMethodsWithPascalCasing, "PascalXYCase" ),
				Warning( 3, 19, NamingAnalyzer.NameMethodsWithPascalCasing, "XYZPascalCase" ),
				Warning( 4, 19, NamingAnalyzer.NameMethodsWithPascalCasing, "PascalXYZCase" ),
				Warning( 5, 19, NamingAnalyzer.NameMethodsWithPascalCasing, "PascalCaseXY" ),
				Warning( 7, 22, NamingAnalyzer.NameFieldsWithCamelCase, "camelXYCase" ),
				Warning( 8, 22, NamingAnalyzer.NameFieldsWithCamelCase, "camelXYZCase" ),
				Warning( 9, 22, NamingAnalyzer.NameFieldsWithCamelCase, "camelCaseXY" ) );
		}

		[TestMethod]
		public void TestWrongFileName()
		{
			VerifyCSharpDiagnostic(

					@"namespace TestProject { class Bar { } }",

					new TestEnvironment { FileName = "File" },
					Warning( 1, 31, NamingAnalyzer.NameFilesAccordingToTypeNames, "Bar", "Bar.cs" ) );
		}

		[TestMethod]
		public void TestStaticHelperClassAllowedForEnumerations(
		)
		{
			var validHelperPostfixes = new string[] { "Helper", "Extension", "Extensions" };
			foreach( var postfix in validHelperPostfixes )
			{
				VerifyCSharpDiagnostic(

					$"namespace TestProject {{ enum Bar {{}} public static class Bar{postfix} {{}} }}",

					new TestEnvironment { FileName = "Bar" } );
			}
		}

		[TestMethod]
		public void TestEnumerationsCannotActAsHelpersForEnumerations()
		{
			VerifyCSharpDiagnostic(

					@"namespace TestProject { enum Bar {} public enum BarHelper {} }",

					new TestEnvironment { FileName = "Bar" },
					Warning( 1, 49, NamingAnalyzer.NameFilesAccordingToTypeNames, "BarHelper", "BarHelper.cs" ) );
		}

		[TestMethod]
		public void TestNonStaticClassIsNotHelperForEnumerations()
		{
			VerifyCSharpDiagnostic(

					@"namespace TestProject { enum Bar {} class BarHelper { public static int GetInt() => 5; } }",

					new TestEnvironment { FileName = "Bar" },
					Warning( 1, 43, NamingAnalyzer.NameFilesAccordingToTypeNames, "BarHelper", "BarHelper.cs" ) );
		}

		[TestMethod]
		public void TestWrongFileNameInDirectory()
		{
			VerifyCSharpDiagnostic(

					@"namespace TestProject { class Bar { } }",

					new TestEnvironment { FileName = @"Path\File" },
					Warning( 1, 31, NamingAnalyzer.NameFilesAccordingToTypeNames, "Bar", "Bar.cs" ) );
		}

		[TestMethod]
		public void TestNamesEndingInLetterAndNumber()
		{
			VerifyCSharpDiagnostic( @"namespace SomethingA1 { class Bar { } }",
					new TestEnvironment { FileName = "Bar.cs" } );
		}

		[TestMethod, Ignore /* Folder name rules not implemented */ ]
		public void TestWrongFolderName()
		{
			VerifyCSharpDiagnostic(

					@"namespace TestProject.Folder { class Bar { } }",

					new TestEnvironment { FileName = "File" },
					Warning( 1, 11, NamingAnalyzer.NameFoldersAccordingToNamespaces, "TestProject.Folder", "Folder" ) );
		}

		protected override DiagnosticAnalyzer GetCSharpDiagnosticAnalyzer()
		{
			return new NamingAnalyzer();
		}
	}
}


text:
module.exports = function (config) {
  config.set({

    files: [
      'bower_components/angular/angular.js',
      'bower_components/angular-mocks/angular-mocks.js',
      'src/*.js'
    ],

    autoWatch: true,

    frameworks: ['jasmine'],

    browsers: ['PhantomJS'],

    preprocessors: {
      'src/netstatus.js': ['coverage']
    },

    reporters: ['progress', 'coverage'],

    coverageReporter: {
      reporters: [{type: 'text-summary'}]
    }
  });
};


text:
using System;
using Sitecore.Data;

namespace Rightpoint.Sitecore.FieldSync.Config
{
    public class FieldRelationship
    {
        public FieldRelationship(ID leftFieldId, ID rightFieldId, SyncDirection syncDirection)
        {
            this.LeftFieldId = leftFieldId;
            this.RightFieldId = rightFieldId;
            this.SyncDirection = syncDirection;
        }

        public FieldRelationship(string leftFieldId, string rightFieldId, SyncDirection syncDirection)
            : this(ID.Parse(leftFieldId), ID.Parse(rightFieldId), syncDirection)
        {
        }

        public FieldRelationship(string leftFieldId, string rightFieldId, string syncDirection)
            : this(leftFieldId, rightFieldId, (SyncDirection)Enum.Parse(typeof(SyncDirection), syncDirection))
        {
        }

        public ID LeftFieldId { get; protected set; }

        public ID RightFieldId { get; protected set; }

        public SyncDirection SyncDirection { get; set; }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>io.dropwizard</groupId>
  <artifactId>dropwizard-example</artifactId>
  <name>Dropwizard Example Application</name>
  <version>1.0.0-SNAPSHOT</version>
  <prerequisites>
    <maven>3.0.0</maven>
  </prerequisites>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <version>2.6.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-install-plugin</artifactId>
          <version>2.5.2</version>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.18.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>2.7</version>
        </plugin>
        <plugin>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>1.4.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.3</version>
        </plugin>
        <plugin>
          <artifactId>maven-source-plugin</artifactId>
          <version>2.4</version>
        </plugin>
        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>2.6</version>
        </plugin>
        <plugin>
          <artifactId>maven-shade-plugin</artifactId>
          <version>2.4.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
        </plugin>
        <plugin>
          <artifactId>maven-site-plugin</artifactId>
          <version>3.4</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>enforce</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <DependencyConvergence />
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
            </manifest>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <createDependencyReducedPom>true</createDependencyReducedPom>
          <filters>
            <filter>
              <artifact>*:*</artifact>
              <excludes>
                <exclude>META-INF/*.SF</exclude>
                <exclude>META-INF/*.DSA</exclude>
                <exclude>META-INF/*.RSA</exclude>
              </excludes>
            </filter>
          </filters>
          <transformers>
            <transformer />
            <transformer>
              <mainClass>com.example.helloworld.HelloWorldApplication</mainClass>
            </transformer>
          </transformers>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <repositories>
    <repository>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype Nexus Snapshots</name>
      <url>http://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
  </repositories>
  <dependencies>
    <dependency>
      <groupId>io.dropwizard</groupId>
      <artifactId>dropwizard-testing</artifactId>
      <version>1.0.0-SNAPSHOT</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>junit</artifactId>
          <groupId>junit</groupId>
        </exclusion>
        <exclusion>
          <artifactId>mockito-core</artifactId>
          <groupId>org.mockito</groupId>
        </exclusion>
        <exclusion>
          <artifactId>objenesis</artifactId>
          <groupId>org.objenesis</groupId>
        </exclusion>
        <exclusion>
          <artifactId>assertj-core</artifactId>
          <groupId>org.assertj</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.test-framework.providers</groupId>
      <artifactId>jersey-test-framework-provider-inmemory</artifactId>
      <version>2.22.1</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>javax.servlet-api</artifactId>
          <groupId>javax.servlet</groupId>
        </exclusion>
        <exclusion>
          <artifactId>junit</artifactId>
          <groupId>junit</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jersey-test-framework-core</artifactId>
          <groupId>org.glassfish.jersey.test-framework</groupId>
        </exclusion>
        <exclusion>
          <artifactId>asm-debug-all</artifactId>
          <groupId>org.ow2.asm</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.test-framework.providers</groupId>
      <artifactId>jersey-test-framework-provider-grizzly2</artifactId>
      <version>2.22.1</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>javax.servlet-api</artifactId>
          <groupId>javax.servlet</groupId>
        </exclusion>
        <exclusion>
          <artifactId>junit</artifactId>
          <groupId>junit</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jersey-container-grizzly2-http</artifactId>
          <groupId>org.glassfish.jersey.containers</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jersey-container-grizzly2-servlet</artifactId>
          <groupId>org.glassfish.jersey.containers</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jersey-test-framework-core</artifactId>
          <groupId>org.glassfish.jersey.test-framework</groupId>
        </exclusion>
        <exclusion>
          <artifactId>asm-debug-all</artifactId>
          <groupId>org.ow2.asm</groupId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.dropwizard</groupId>
        <artifactId>dropwizard-bom</artifactId>
        <version>${project.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <properties>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <maven.site.deploy.skip>true</maven.site.deploy.skip>
    <maven.site.skip>true</maven.site.skip>
    <maven.compiler.source>1.8</maven.compiler.source>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.deploy.skip>true</maven.deploy.skip>
    <maven.compiler.target>1.8</maven.compiler.target>
  </properties>
</project>


text:
package com.pvsagar.smartlockscreen.fragments;

import android.app.Fragment;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.graphics.Color;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.ListView;
import android.widget.ProgressBar;

import com.pvsagar.smartlockscreen.R;
import com.pvsagar.smartlockscreen.adapters.AllowedAppsListAdapter;
import com.pvsagar.smartlockscreen.applogic_objects.App;
import com.pvsagar.smartlockscreen.applogic_objects.User;
import com.readystatesoftware.systembartint.SystemBarTintManager;

import java.util.List;

/**
 * Created by aravind on 11/11/14.
 */
public class AllowedAppsFragment extends Fragment {
    private static String ARG_CURRENT_USER = "current_user_id";

    private ListView allowedAppsListView;
    private ProgressBar progressBar;
    private int mPaddingBottom;
    private int mPaddingTop;
    private User mCurrentUser;

    public AllowedAppsFragment(){

    }

    public static AllowedAppsFragment getNewInstance(Long currentUserId){
        AllowedAppsFragment fragment = new AllowedAppsFragment();
        Bundle args = new Bundle();
        args.putLong(ARG_CURRENT_USER, currentUserId);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null){
            mCurrentUser = User.getUserWithId(getActivity(), getArguments().getLong(ARG_CURRENT_USER));
        } else {
            throw new IllegalArgumentException("Current user id must be passed into the fragment. Use "
                    + AllowedAppsFragment.class.getSimpleName() + ".getNewInstance(Long currentUserId)" +
                    " to get an instance of the fragment.");
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.fragment_allowed_apps, container, false);
        allowedAppsListView = (ListView) rootView.findViewById(R.id.list_view_allowed_apps);
        progressBar = (ProgressBar) rootView.findViewById(R.id.progress_bar_allowed_apps);

        SystemBarTintManager tintManager = new SystemBarTintManager(getActivity());
        if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
            mPaddingBottom = tintManager.getConfig().getNavigationBarHeight();
            mPaddingTop = tintManager.getConfig().getPixelInsetTop(true);
            if(Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT){
                mPaddingTop += 16;
            }
        }

        getActivity().setProgressBarIndeterminateVisibility(true);
        progressBar.setVisibility(View.VISIBLE);
        progressBar.setIndeterminate(true);

        switch (getActivity().getResources().getConfiguration().orientation){
            case Configuration.ORIENTATION_UNDEFINED:
            case Configuration.ORIENTATION_PORTRAIT:
                rootView.setPadding(rootView.getPaddingLeft(), rootView.getPaddingTop() + mPaddingTop,
                        rootView.getPaddingRight(), rootView.getPaddingBottom());
                View bottomPaddingView = new View(getActivity());
                bottomPaddingView.setBackgroundColor(Color.TRANSPARENT);
                bottomPaddingView.setLayoutParams(new AbsListView.LayoutParams(
                        ViewGroup.LayoutParams.MATCH_PARENT, mPaddingBottom));
                allowedAppsListView.addFooterView(bottomPaddingView, null, false);
                break;
            case Configuration.ORIENTATION_LANDSCAPE:
                rootView.setPadding(rootView.getPaddingLeft(), rootView.getPaddingTop() + mPaddingTop,
                        rootView.getPaddingRight() + mPaddingBottom, rootView.getPaddingBottom());
                break;
        }
        new GetAppsAsyncTask().execute();

        return rootView;
    }

    private class GetAppsAsyncTask extends AsyncTask<Void, Void, List<App>>{
        @Override
        protected List<App> doInBackground(Void... params) {
            PackageManager packageManager = getActivity().getPackageManager();
            return App.getAllApps(packageManager);
        }

        @Override
        protected void onPostExecute(List<App> apps) {
            allowedAppsListView.setAdapter(new AllowedAppsListAdapter(getActivity(),
                    R.layout.list_item_allowed_apps, apps, mCurrentUser));
            getActivity().setProgressBarIndeterminateVisibility(false);
            progressBar.setVisibility(View.GONE);
            super.onPostExecute(apps);
        }
    }
}


text:
namespace boost {
template <class T> class optional;
} // namespace boost

namespace kudu {
namespace tools {

// A map from a count of replicas to a server id. The "reversed" relationship
// facilitates finding the servers with the maximum and minimum counts.
typedef std::multimap<int32_t, std::string> ServersByCountMap;

// Balance information for a table.
struct TableBalanceInfo {
  std::string table_id;

  // Mapping table replica count -> tablet server.
  //
  // The table replica count of a tablet server is defined as the number of
  // replicas belonging to the table hosted on the tablet server.
  ServersByCountMap servers_by_replica_count;
};

// Balance information for a cluster.
struct ClusterBalanceInfo {
  // Mapping table skew -> table balance information. The "reversed"
  // relationship facilitates finding the most and least skewed tables.
  //
  // The skew of a table is defined as the difference between its most
  // occupied and least occupied tablet servers. Skew is considered to be
  // improved both when the number of pairs of tablet servers exhibiting max
  // skew between them decreases, or when the skew decreases.
  std::multimap<int32_t, TableBalanceInfo> table_info_by_skew;

  // Mapping total replica count -> tablet server.
  //
  // The total replica count of a tablet server is defined as the total number
  // of replicas hosted on the tablet server.
  ServersByCountMap servers_by_total_replica_count;
};

// A directive to move some replica of a table between two tablet servers.
struct TableReplicaMove {
  std::string table_id;
  std::string from;     // Unique identifier of the source tablet server.
  std::string to;       // Unique identifier of the target tablet server.
};

// A rebalancing algorithm, which orders replica moves aiming to balance a
// cluster. The definition of "balance" depends on the algorithm.
class RebalancingAlgo {
 public:
  virtual ~RebalancingAlgo() = default;

  // The top-level method of the algorithm. Using information on the current
  // balance state of the cluster in 'cluster_info', the algorithm populates
  // the output parameter 'moves' with no more than 'max_moves_num' replica
  // moves that aim to balance the cluster. Due to code conventions, 'int' is
  // used instead of 'size_t' as 'max_moves_num' type; 'max_moves_num' must be
  // non-negative value, where value of '0' is a shortcut for
  // 'the possible maximum'.
  //
  // Once this method returns Status::OK() and leaves 'moves' empty, the cluster
  // is considered balanced.
  //
  // 'moves' must be non-NULL.
  virtual Status GetNextMoves(const ClusterBalanceInfo& cluster_info,
                              int max_moves_num,
                              std::vector<TableReplicaMove>* moves);
 protected:
  // Get the next rebalancing move from the algorithm. If there is no such move,
  // the 'move' output parameter is set to 'boost::none'.
  //
  // 'move' must be non-NULL.
  virtual Status GetNextMove(const ClusterBalanceInfo& cluster_info,
                             boost::optional<TableReplicaMove>* move) = 0;

  // Update the balance state in 'cluster_info' with the outcome of the move
  // 'move'. 'cluster_info' is an in-out parameter.
  //
  // 'cluster_info' must be non-NULL.
  static Status ApplyMove(const TableReplicaMove& move,
                          ClusterBalanceInfo* cluster_info);
};

// A two-dimensional greedy rebalancing algorithm. From among moves that
// decrease the skew of a most skewed table, it prefers ones that reduce the
// skew of the cluster. A cluster is considered balanced when the skew of every
// table is <= 1 and the skew of the cluster is <= 1.
//
// The skew of the cluster is defined as the difference between the maximum
// total replica count over all tablet servers and the minimum total replica
// count over all tablet servers.
class TwoDimensionalGreedyAlgo : public RebalancingAlgo {
 public:
  // Policies for picking one element from equal-skew choices.
  enum class EqualSkewOption {
    PICK_FIRST,
    PICK_RANDOM,
  };
  explicit TwoDimensionalGreedyAlgo(
      EqualSkewOption opt = EqualSkewOption::PICK_RANDOM);

  Status GetNextMove(const ClusterBalanceInfo& cluster_info,
                     boost::optional<TableReplicaMove>* move) override;

 private:
  enum class ExtremumType { MAX, MIN, };

  FRIEND_TEST(RebalanceAlgoUnitTest, RandomizedTest);
  FRIEND_TEST(RebalanceAlgoUnitTest, EmptyClusterBalanceInfoGetNextMove);

  // Compute the intersection of the least or most loaded tablet servers for a
  // table with the least or most loaded tablet servers in the cluster:
  // 'intersection' is populated with the ids of the tablet servers in the
  // intersection of those two sets. The minimum or maximum number of replicas
  // per tablet server for the table and for the cluster are output into
  // 'replica_count_table' and 'replica_count_total', respectively. Identifiers
  // of the tablet servers with '*replica_count_table' replicas of the table are
  // output into the 'server_uuids' parameter. Whether to consider most or least
  // loaded servers is controlled by 'extremum'. An empty 'intersection' on
  // return means no intersection was found for the mentioned sets of the
  // extremally loaded servers: in that case optimizing the load by table would
  // not affect the extreme load by server.
  //
  // None of the output parameters may be NULL.
  Status GetIntersection(
      ExtremumType extremum,
      const ServersByCountMap& servers_by_table_replica_count,
      const ServersByCountMap& servers_by_total_replica_count,
      int32_t* replica_count_table,
      int32_t* replica_count_total,
      std::vector<std::string>* server_uuids,
      std::vector<std::string>* intersection);

  // As determined by 'extremum', find the tablet servers with the minimum or
  // maximum count in 'server_by_replica_counts'. The extremal count will be set
  // in 'replica_count', while 'server_uuids' will be populated with the servers
  // that host the extremal replica count.
  //
  // Neither of the output parameters may be NULL.
  Status GetMinMaxLoadedServers(
      const ServersByCountMap& servers_by_replica_count,
      ExtremumType extremum,
      int32_t* replica_count,
      std::vector<std::string>* server_uuids);

  const EqualSkewOption equal_skew_opt_;
  std::random_device random_device_;
  std::mt19937 generator_;
};

} // namespace tools
} // namespace kudu


text:
extern "Java"
{
  namespace java
  {
    namespace awt
    {
        class Point;
    }
  }
  namespace javax
  {
    namespace accessibility
    {
        class Accessible;
        class AccessibleRole;
        class AccessibleSelection;
    }
    namespace swing
    {
        class JTree;
        class JTree$AccessibleJTree;
      namespace event
      {
          class TreeExpansionEvent;
          class TreeModelEvent;
          class TreeSelectionEvent;
      }
    }
  }
}

class javax::swing::JTree$AccessibleJTree : public ::javax::swing::JComponent$AccessibleJComponent
{

public:
  JTree$AccessibleJTree(::javax::swing::JTree *);
  virtual void addAccessibleSelection(jint);
  virtual void clearAccessibleSelection();
  virtual void fireVisibleDataPropertyChange();
  virtual ::javax::accessibility::Accessible * getAccessibleAt(::java::awt::Point *);
  virtual ::javax::accessibility::Accessible * getAccessibleChild(jint);
  virtual jint getAccessibleChildrenCount();
  virtual jint getAccessibleIndexInParent();
  virtual ::javax::accessibility::AccessibleRole * getAccessibleRole();
  virtual ::javax::accessibility::AccessibleSelection * getAccessibleSelection();
  virtual ::javax::accessibility::Accessible * getAccessibleSelection(jint);
  virtual jint getAccessibleSelectionCount();
  virtual jboolean isAccessibleChildSelected(jint);
  virtual void removeAccessibleSelection(jint);
  virtual void selectAllAccessibleSelection();
  virtual void treeCollapsed(::javax::swing::event::TreeExpansionEvent *);
  virtual void treeExpanded(::javax::swing::event::TreeExpansionEvent *);
  virtual void treeNodesChanged(::javax::swing::event::TreeModelEvent *);
  virtual void treeNodesInserted(::javax::swing::event::TreeModelEvent *);
  virtual void treeNodesRemoved(::javax::swing::event::TreeModelEvent *);
  virtual void treeStructureChanged(::javax::swing::event::TreeModelEvent *);
  virtual void valueChanged(::javax::swing::event::TreeSelectionEvent *);
public: // actually package-private
  static ::javax::swing::JTree * access$0(::javax::swing::JTree$AccessibleJTree *);
  ::javax::swing::JTree * __attribute__((aligned(__alignof__( ::javax::swing::JComponent$AccessibleJComponent)))) this$0;
public:
  static ::java::lang::Class class$;
};

#endif // __javax_swing_JTree$AccessibleJTree__


text:
package ch.chuv.lren.woken.backends.worker

import akka.cluster.Cluster
import akka.cluster.pubsub.{ DistributedPubSub, DistributedPubSubMediator }
import akka.pattern.ask
import akka.util.Timeout
import cats.data.NonEmptyList
import cats.effect.{ Effect, ExitCase, IO }
import ch.chuv.lren.woken.core.fp.fromFutureWithGuarantee
import ch.chuv.lren.woken.messages.validation.{
  ScoringQuery,
  ScoringResult,
  ValidationQuery,
  ValidationResult
}
import ch.chuv.lren.woken.messages.validation.validationProtocol._
import com.typesafe.scalalogging.LazyLogging
import spray.json._
import sup.{ HealthCheck, HealthReporter, mods }
import sup.data.Tagged

import scala.concurrent.duration._
import scala.language.{ higherKinds, postfixOps }

object WokenWorker {
  type TaggedS[H] = Tagged[String, H]
  def apply[F[_]: Effect](pubSub: DistributedPubSub, cluster: Cluster): WokenWorker[F] =
    new WokenWorkerImpl(pubSub, cluster)
}

import WokenWorker.TaggedS

trait WokenWorker[F[_]] {
  def validate(validationQuery: ValidationQuery): F[ValidationResult]
  def score(scoringQuery: ScoringQuery): F[ScoringResult]
  def validationServiceHealthCheck: HealthCheck[F, TaggedS]
  def scoringServiceHealthCheck: HealthCheck[F, TaggedS]
  def healthChecks: HealthReporter[F, NonEmptyList, TaggedS]
}

class WokenWorkerImpl[F[_]: Effect](pubSub: DistributedPubSub, cluster: Cluster)
    extends WokenWorker[F]
    with LazyLogging {

  override def validate(validationQuery: ValidationQuery): F[ValidationResult] =
    fromFutureWithGuarantee[F, ValidationResult](
      {
        implicit val askTimeout: Timeout = Timeout(5 minutes)
        logger.whenDebugEnabled(
          logger.debug(s"validationQuery: $validationQuery")
        )
        val future = pubSub.mediator ? DistributedPubSubMediator.Send("/user/validation",
                                                                      validationQuery,
                                                                      localAffinity = false)
        future.mapTo[ValidationResult]
      }, {
        case ExitCase.Error(t) =>
          IO.delay(
            logger.error(s"Cannot complete validation ${validationQuery.toJson.compactPrint}", t)
          )
        case _ => IO(())
      }
    )

  override def score(scoringQuery: ScoringQuery): F[ScoringResult] =
    fromFutureWithGuarantee[F, ScoringResult](
      {
        implicit val askTimeout: Timeout = Timeout(5 minutes)
        logger.whenDebugEnabled(
          logger.debug(s"scoringQuery: $scoringQuery")
        )
        val future = pubSub.mediator ? DistributedPubSubMediator.Send("/user/scoring",
                                                                      scoringQuery,
                                                                      localAffinity = false)
        future.mapTo[ScoringResult]
      }, {
        case ExitCase.Error(t) =>
          IO.delay(logger.error(s"Cannot complete scoring ${scoringQuery.toJson.compactPrint}", t))
        case _ => IO(())
      }
    )

  override val validationServiceHealthCheck: HealthCheck[F, TaggedS] =
    DistributedPubSubHealthCheck
      .checkValidation(pubSub, cluster)
      .through[F, TaggedS](mods.tagWith("Woken validation worker(s)"))

  override val scoringServiceHealthCheck: HealthCheck[F, TaggedS] =
    DistributedPubSubHealthCheck
      .checkScoring(pubSub, cluster)
      .through[F, TaggedS](mods.tagWith("Woken scoring worker(s)"))

  override lazy val healthChecks: HealthReporter[F, NonEmptyList, TaggedS] =
    HealthReporter.fromChecks(validationServiceHealthCheck, scoringServiceHealthCheck)

}


text:
<?php

namespace AntiMattr\Tests\Bundle\AppBundle;

use AntiMattr\TestCase\AntiMattrTestCase;

/**
 * @codeCoverageIgnore
 */
abstract class AbstractTestCase extends AntiMattrTestCase
{

}


text:
package androidx.test.services.events.platform;

import static androidx.test.internal.util.Checks.checkNotNull;

import android.os.Parcel;
import androidx.annotation.NonNull;
import androidx.test.services.events.TestCaseInfo;
import androidx.test.services.events.TimeStamp;

/**
 * Represents the start of an individual test case. One {@link TestCaseStartedEvent} should always
 * be emitted for each individual test case in a test run. However, there are a couple of test
 * statuses that do not require an explicit {@link TestCaseStartedEvent}.
 *
 * <ul>
 *   <li>{@link androidx.test.services.events.TestStatus.Status.IGNORED}: The test was never started
 *       and will not be run.
 *   <li>{@link androidx.test.services.events.TestStatus.Status.CANCELLED}: The test was supposed to
 *       run, but this client encountered a state that required it to exit before the test could
 *       run.
 * </ul>
 *
 * @see TestCaseFinishedEvent to indicate the end of a test case
 * @see TestCaseErrorEvent for reporting various errors encountered during a test run.
 */
public final class TestCaseStartedEvent extends TestPlatformEvent {
  /** The test case that started. */
  @NonNull public final TestCaseInfo testCase;
  /** The time this test case started. */
  @NonNull public final TimeStamp timeStamp;

  /**
   * Creates a {@link TestCaseStartedEvent}.
   *
   * @param testCase the test case that started.
   * @param timeStamp the time the test case began.
   */
  public TestCaseStartedEvent(@NonNull TestCaseInfo testCase, @NonNull TimeStamp timeStamp) {
    this.testCase = checkNotNull(testCase, "testCase cannot be null");
    this.timeStamp = checkNotNull(timeStamp, "timeStamp cannot be null");
  }

  /**
   * Creates a {@link TestCaseStartedEvent} from an {@link Parcel}.
   *
   * @param source {@link Parcel} to create the {@link TestCaseStartedEvent} from.
   */
  public TestCaseStartedEvent(Parcel source) {
    testCase = new TestCaseInfo(source);
    timeStamp = new TimeStamp(source);
  }

  @Override
  public void writeToParcel(Parcel parcel, int i) {
    super.writeToParcel(parcel, i);
    testCase.writeToParcel(parcel, i);
    timeStamp.writeToParcel(parcel, i);
  }

  @Override
  public EventType instanceType() {
    return EventType.TEST_CASE_STARTED;
  }
}


text:
package org.codehaus.groovy.ant;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

class GroovycTest2 {
    static void main(String[] args) throws IOException {
        FileOutputStream fout = new FileOutputStream(
            new File("target/classes/groovy/test/org/codehaus/groovy/ant/GroovycTest2_Result.txt"));
        try {
            fout.write("OK.".getBytes());
        } finally {
            try {
                fout.close();
            } catch (IOException ignore) {
            }
        }
    }
}


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

import com.facebook.presto.spi.ColumnHandle;
import com.facebook.presto.spi.TableHandle;
import com.facebook.presto.sql.planner.Symbol;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.ImmutableList;

import javax.annotation.concurrent.Immutable;

import java.util.List;
import java.util.Map;

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

@Immutable
public class TableWriterNode
        extends PlanNode
{
    private final PlanNode source;
    private final TableHandle tableHandle;
    private final Symbol output;
    private final Map<Symbol, ColumnHandle> columns;

    @JsonCreator
    public TableWriterNode(@JsonProperty("id") PlanNodeId id,
            @JsonProperty("source") PlanNode source,
            @JsonProperty("table") TableHandle table,
            @JsonProperty("columns") Map<Symbol, ColumnHandle> columns,
            @JsonProperty("output") Symbol output)
    {
        super(id);

        this.columns = columns;
        this.output = output;
        this.source = checkNotNull(source, "source is null");
        this.tableHandle = table;
    }

    @Override
    public List<PlanNode> getSources()
    {
        return ImmutableList.of(source);
    }

    @JsonProperty
    public PlanNode getSource()
    {
        return source;
    }

    @JsonProperty
    public TableHandle getTable()
    {
        return tableHandle;
    }

    @JsonProperty
    public Map<Symbol, ColumnHandle> getColumns()
    {
        return columns;
    }

    @JsonProperty
    public Symbol getOutput()
    {
        return output;
    }

    public List<Symbol> getOutputSymbols()
    {
        return ImmutableList.of(output);
    }

    public <C, R> R accept(PlanVisitor<C, R> visitor, C context)
    {
        return visitor.visitTableWriter(this, context);
    }
}


text:
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Data.SQLite;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace QuickLauncher
{
    class DbUtil
    {
        private static string DbBaseDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Unicorn\\QuickLancher";
        private static string QUICK_COMMAND_TABLE = "CREATE TABLE IF NOT EXISTS QUICK_COMMAND(UUID TEXT PRIMARY KEY,ALIAS TEXT UNIQUE,PATH TEXT, WORKDIRECTORY TEXT,COMMAND TEXT);";
        private static string QUICK_COMMAND_EVN_CONFIG_TABLE = "CREATE TABLE IF NOT EXISTS QUICK_COMMAND_ENV_CONFIG(Id INTEGER PRIMARY KEY, PARENT_ID TEXT NOT NULL, ENV_KEY TEXT, ENV_VALUE TEXT, FOREIGN KEY(PARENT_ID) REFERENCES QUICK_COMMAND(UUID))";
        private static string SETTING_TABLE = "CREATE TABLE IF NOT EXISTS SETTING(KEY TEXT, VALUE TEXT, PRIMARY KEY(KEY))";
        private static string DbPath = "Data Source =" + DbBaseDir + "\\lancherDb.db";
        public static SQLiteConnection getConnection()
        {
            if (!Directory.Exists(DbBaseDir))
            {
                Directory.CreateDirectory(DbBaseDir);
            }
            return new SQLiteConnection(DbPath);
        }

        public static void prepareTables()
        {
            var dbConn = getConnection();
            dbConn.Open();

            prepareTable(dbConn, QUICK_COMMAND_TABLE);
            prepareTable(dbConn, QUICK_COMMAND_EVN_CONFIG_TABLE);
            prepareTable(dbConn, SETTING_TABLE);
            dbConn.Close();
        }

        private static void prepareTable(SQLiteConnection conn, string sql)
        {
            SQLiteCommand cmdCreateTable = new SQLiteCommand(sql, conn);
            cmdCreateTable.ExecuteNonQuery();
        }
    }
}


text:
\section{Dynamische Systeme}

\textbf{Fixpunkt:} $x^*:$ \hspace{1cm}$f(x^*) = 0$

\subsection{Gleichgewichtslösungen}
Die Gleichgewichtslösungen sind diejenigen Punkte, in welchen die Ableitung verschwindet:
\begin{equation*}
	\diffp{}{t}y(t) = 0
\end{equation*}
\subsection{Phasengerade und Integralkurven}
Bei der Phasengerade werden die Gleichgewichtslösungen in Funktion der Ableitung eingetragen. Dadurch kann die Stabilität eines Systems bestimmt werden.

\subsection{Eindimensionale Syteme}
Falls $x^*$ ein \textbf{Fixpunkt} von $\dot{x} = f(x)$ ist, ist $x(t) = x^*$ eine konstante Lösung des Systems $\dot{x} = f(x)$. Der \textbf{Phasenraum} eines eindimensionalen Systems vom Typ $\dot{x} = f(x)$ is $\mathbb{R}$. Wegen des \textbf{Eindeutigkeitssatzes} hat $\dot{x} = f(x)$ für alle $0 \leq t$ das selbe Vorzeichen. Die Lösung ist daher monoton steigend, monoton fallend oder ist ein Fixpunkt. Nur für \textbf{autonome} DLG 1. Ordnung sind keine periodische Lösungen möglich.

\subsection{Lineare Stabilitätsanalyse}
\label{sec:linStab}
$\eta (t) = x(t) - x^*$ \hspace{1cm} falls $x^* \neq 0 \Rightarrow$ Taylor:\newline
$\dot{\eta} = \dot{x} = f(x) \approx f(x^*) + f'(x^*) \cdot \underbrace{(x - x^*)}_{\eta (t)}(x - x^*) = f'(x^*) \cdot \eta$ \\
$\Rightarrow \mathrm{DGL}: \dot{\eta} = \eta \cdot f'(x^*),$ \hspace{1cm} $\eta(t) = \eta(0) \cdot e^{f'(x^*)t}$

\begin{tabular}{ll}
	\textbf{stabil:} \quad & $f'(x^*) < 0$ \\
	\textbf{instabil:} & $f'(x^*) > 0$ \\
	\textbf{(in)stabil:} & $f'(x^*) = 0$ \\
\end{tabular}

\begin{multicols}{2}
	\subsection{Bifurkationen}

	\begin{equation*}
		\dot{x} = f(x,r), \quad r \in \mathbb{R}
	\end{equation*}

	Eine qualitative Änderung der Dynamik eines von einem Parameter $r$ abhängigen Systems, heisst Bifurkation. Die Parameterwerte von $r$ an denen diese qualitativen Änderungen erfolgen, heissen \textbf{Bifurkationspunkte} des Systems.
	\columnbreak
	\subsubsection{Saddle-Node-Bifurkation}
	Fixpunkte können durch Variation von $r$ erzeugt oder zerstört werden.

	\includegraphics[width=0.5\textwidth]{./images/Saddle_Node.png}
\end{multicols}

\begin{multicols}{2}
	\subsubsection{Pitchfork-Bifurkation}
	Die Pitchfork Bifurkation ist eine Bifurkation, bei der ein Fixpunkt seine Stabilität änder und gleichzeitig zwei neue Fixpunkte entstehen. \newline \newline

	\textbf{superkritische Pitchfork-Bifurkation:} Man nennt diesen Typ von Bifurkation superkritisch, weil die Fixpunkte $x^* \neq 0$ nur für Parameterwerte \textbf{über} dem Bifurkationspunkt existieren, bzw. für $r >0$.

	\includegraphics[width=0.5\textwidth]{./images/superkritisch.png}
	\columnbreak

	\textbf{subkritische Pitchfork-Bifurkation:} Man nennt diesen Typ von Bifurkation subkritisch, weil die Fixpunkte $x^* \neq 0$ nur für Parameterwerte \textbf{unter} dem Bifurkationspunkt existieren.

	\subsubsection{Transkritische Bifurkation}
	Bei einer transkritischen Bifurkation werden keine Fixpunkte erzeugt oder vernichtet, allerdings wird die Stabilität zweier Fixpunkte vertauscht.
\end{multicols}

\subsection{Bifurkationsdiagramm}
	Diagramm der kritischen Punkte in Abhängigkeit eines Parameters (e.g. $a$).

	Beispiel:

	\[y'=y(a-y)\]

\begin{tabular}{p{0.3\textwidth}p{0.3\textwidth}p{0.3\textwidth}}
	\vspace{0pt}
	\begin{tabular}[h]{p{0.1\textwidth}p{0.2\textwidth}}
	Ausgezogen:		& Asymptotisch Stabil\\
	Gestrichelt:	& Instabil\\
	Zentrum:		& Semistabil\\
	\end{tabular}
	& 	\vspace{0pt}
		\includegraphics[width=0.3\textwidth]{images/Bifurkationsdiagramm.png}
	& 	\vspace{0pt}
		\textbf{Vorgehen:}
		\begin{tabular}[h]{p{0.02\textwidth}p{0.28\textwidth}}
		1:	& Kritische Punkte berechnen ($\dot{x} = 0$). Ergibt $x^*_k(a)$.\\
		2:	& Stabilität der Punkte berechnen (gemäss Section \ref{sec:linStab}).\\
		3:	& Kurven in Diagramm ($x^*(a)$ aufzeichnen).\\
		\end{tabular}\\
\end{tabular}

\subsection{Zweidimensionale Systeme}

\begin{tabular}{ll}
	\textbf{stabil:} & $\lvert x(t) - x^*\rvert < \epsilon \quad 0 < t < \infty$ \\
	\textbf{instabil:} & $\lvert x(t) - x^*\rvert \nless \epsilon \quad 0 < t < \infty$ \\
	\textbf{asymptotisch stabil:} & $\lim\limits_{t \to \infty} \lvert x(t) - x^*\rvert = 0$ \\
\end{tabular}

\subsubsection{Typen von Fixpunkten}

\begin{tabular}{|p{0.25\textwidth}|p{0.7\textwidth}|}
	\hline
	\textbf{Spur:} & $\tau = \mathrm{tr}(A) = a_{11} + a_{22} = \lambda_1 + \lambda_2$ \\
	\textbf{Determinante:} & $\Delta = \det(A) = a_{11}a_{22}  - a_{12}a_{21} = \lambda_1 \lambda_2$\\
	\textbf{Eigenwerte:} & $\lambda_{1,2} = \frac{1}{2} \left(\tau \pm \sqrt{\tau^2 - 4\Delta}\right)$ \\
	\hline
\end{tabular}

\begin{longtable}{|p{0.25\textwidth}|p{0.7\textwidth}|}
	\hline
	\textbf{Eigenwerte} & \textbf{Stabilität}\\
	\hline
	\endhead

	\multicolumn{2}{l}{Für $\Delta > 0$ und $\tau < 0$ gilt:} \\

	\hline $\operatorname{Re}(\lambda_1) < 0$ und $\operatorname{Re}(\lambda_2) < 0$ & stabiler Knotenpunkt ($\tau^2 - 4 \Delta > 0$ bzw. $ \lambda_1, \lambda_2 \in \mathbb{R}$) \\
	 & stabiler Strudelpunkt ($\tau^2 - 4 \Delta < 0$ bzw. $ \lambda_1, \lambda_2 \notin \mathbb{R}$) \\
	\hline

	\multicolumn{2}{l}{Für $\Delta > 0$ und $\tau > 0$ gilt:}\\

	\hline $\operatorname{Re}(\lambda_1) > 0$ und $\operatorname{Re}(\lambda_2) > 0$ & instabiler Knotenpunkt ($\tau^2 - 4 \Delta > 0$ bzw. $ \lambda_1, \lambda_2 \in \mathbb{R}$) \\
	 & instabiler Strudelpunkt ($\tau^2 - 4 \Delta < 0$ bzw. $ \lambda_1, \lambda_2 \notin \mathbb{R}$) \\
	\hline

	\multicolumn{2}{l}{Für $\Delta > 0$ und $\tau = 0$ gilt:} \\

	\hline $\operatorname{Re}(\lambda_1) = \operatorname{Re}(\lambda_2) = 0$ & Zentrum bzw. einen elliptischen Fixpunkt\\
	\hline

	\multicolumn{2}{l}{Für $\Delta = 0$ gilt:} \\

	\hline $\lambda_1 = 0$ oder $\lambda_2 = 0$ & degeneriertes System; Fixpunkte sind nicht isoliert(bspw. ganze Gerade als Fixpunkte) \\
	\hline

	\multicolumn{2}{l}{Für $\Delta < 0$ gilt:} \\

	\hline $\lambda_1 < 0 < \lambda_2$ & Sattelpunkt (saddle point) \\
	\hline $\lambda_2 < 0 < \lambda_1$ & Sattelpunkt (saddle point) \\
	\hline

	\multicolumn{2}{l}{\textbf{Allgemein:}}\\

	\hline
	\textbf{grenzstabil:} & $\operatorname{Re}(\lambda_i) \leq 0$ für alle $\lambda_i$ \\
	\textbf{instabil:} & $\operatorname{Re}(\lambda_i) > 0$ für mind. einen Wert \\
	\textbf{asymptotisch stabil:} &$\operatorname{Re} < 0$ für alle $\lambda_i$ \\
	\hline
\end{longtable}

\subsubsection{Phasenportraits Zeichnen}

\begin{longtable}{|p{0.47\textwidth}|p{0.47\textwidth}|}
	\hline
	\textbf{Reelle Eigenwerte (Saddle, Node)} & \textbf{Komplexe Eigenwerte (Centre, Focus)}\\
	\hline
	\endhead
	\multicolumn{2}{l}{\textbf{Eigenvektoren}}\\
	\hline
	Eigenvektoren sind ein Anhaltspunkt dafür, wie sich ein System mit der Zeit entwickelt. Sie sind immer durch den Fixpunkt zu zeichnen (Verlauf anhand $x$ und $y$-Koordinate des Vektors). Wenn der Eigenwert $> 0$ ist, ist die Richtung weg vom Fixpunkt einzuzeichnen, sonst zum Fixpunkt hin.
		& Die Eigenvektoren sind hier nicht einzuzeichnen. Sie sind komplex, die Lösung schwingt deshalb.\\
	\hline
	\multicolumn{2}{l}{\textbf{Richtung und Verlauf der Lösungstrajektorien}}\\
	\hline
	\multicolumn{2}{|l|}{Generell:}\\
	\hline
	Lösungen, welche beim Eigenvektor mit niedrigerem Eigenwert beginnen, konvergieren zum nächsten Eigenvektor mit höherem Eigenwert.
		& Um die Richtung der Spirale oder des Kreises zu erkennen, wählt man einen einfachen Punkt im Koordinatensystem (e.g. $\begin{bmatrix}1 & 0\end{bmatrix}$) und multipliziert diesen mit der Systemmatrix $A$. Das Resultat ist ein zweiter Punkt im Koordinatensystem. Das System bewegt sich also vom ersten in Richtung des zweiten Punktes.\\
	\hline
	\textbf{Unstable Node:}\newline
	Linien beginnen beim Fixpunkt und gehen nach aussen. Sie schmiegen sich am Anfang eher dem Eigenvektor mit dem niedrigeren Eigenwert an, und nähern sich dann dem Eigenvektor mit dem höheren Eigenwert. Am Ende verlaufen sie parallel zu diesem Eigenvektor.
		& \textbf{Unstable Focus:}\newline
			Linien beginnen beim Fixpunkt, drehen sich um den Fixpunkt mit der oben genannten Richtung und gehen nach aussen (Spirale).\\
	\textbf{Stable Node:}\newline
	Linien Beginnen aussen und konvergieren zum Fixpunkt. Sie verlaufen am Anfang eher parallel zum Eigenvektor mit dem niedrigeren Eigenwert, und nähern sich dann dem Eigenvektor mit dem höheren Eigenwert.
		& \textbf{Stable Focus:}\newline
			Linien beginnen aussen, drehen sich um den Fixpunkt mit der oben genannten Richtung und konvergieren zum Fixpunkt (Spirale).\\
	\textbf{Saddle:}\newline
	Linien Beginnen aussen parallel zum Eigenvektor mit dem negativen Eigenwert und gehen in Richtung des Fixpunktes. In der Nähe des Fixpunktes ändern sie die Richtung und gehen wieder nach aussen und werden parallel zum Eigenvektor mit dem positiven Eigenwert.
		& \textbf{Centre:}\newline
			Die Linien Drehen sich um den Fixpunkt, konvergieren aber weder zu ihm hin, noch divergieren sie.\\
	\hline
\end{longtable}

\subsection{Atraktorbereich und Separatrizen}
Haben wir ein autonomes System mit Anfangswertproblem. Die Gesamtheit aller Punkte des Phasenraums - die als Anfangsbedingung gewählt - zu einer Trajektorie führen, welche dann gegen einen speziellen Punkt konvergiert, heisst Atraktorbereich des Punktes.
Die Ränder, welche diese Bereiche trennen, heissen Separatrizen.
Im Bild sehen wir zwei Atraktorbereiche, welche durch die beiden blauen Kurven (die Separatrizen) getrennt sind.
Startet man innerhalb der Blase, so konvergiert man gegen den Punkt (0,0) ansonsten gegen den Punkt (1,-2).
\begin{minipage}[h!]{0.35\textwidth}
	\includegraphics[width=1\textwidth]{images/Atraktorbereich.png}
\end{minipage}

\subsection{Vektorfeld und Trajektorie}
\begin{figure}[h!]
	\centering
	\includegraphics[width=0.8\textwidth]{./images/phasenraum.png}
\end{figure}

\subsection{Fast lineare Systeme, Jakobi-Matrix}
Ein System ist fast linear, wenn die Jacobimatrix $J_f$ regulär ist $det(J_f)\neq 0$. \\
\textbf{Robust:} Knotenpunkt, Studelpunkt, Sattelpunkt \\
\textbf{Marginal:} Zentrum, degenerierte Fälle \\ \\
1.Schritt: DGL in Form bringen:\\
$x'_1(t) = f_1(t) = x_2(t)$\\
$x'_2(t) = f_2(t) = -q(t)x_1(t)-p(t)x_2(t)+g(t)$\\
2.Schritt: Jacobi Matrix berechnen:\\
\begin{equation*}
	J_f(x) =
	\begin{vmatrix}
	        \frac{\partial f_1}{\partial x_1} & \frac{\partial f_1}{\partial x_2}\\
	        \frac{\partial f_2}{\partial x_1} & \frac{\partial f_2}{\partial x_2}\\
	\end{vmatrix}
\end{equation*}
3. Schritt: Kritische Punkte berechnen (Ableitungen Null setzen...) $\rightarrow x^* = (x_{k1}^*, x_{k2}^*)$\\
4. Schritt: Jeden kritischen Punkt separat in die Jacobimatrix einsetzen\\
5. Schritt: Anschliessen für jede Jacobimatrix die Eigenwerte ausrechnen \\
6. Schritt: Stabilität nach folgender Tabelle beurteilen\\


text:
describe("Player", function () {
    jasmine.DEFAULT_TIMEOUT_INTERVAL = 100;

    var body;
    var targetFinder;
    var fighter;

    beforeEach(function () {
        body = jasmine.createSpyObj('physicsBody', ['accelerate']);
        targetFinder = jasmine.createSpyObj('targetFinder', ['getTargetPosition']);
        fighter = nanites.fighter({physics: body, targetFinder: targetFinder});
    });

    it("shouldMoveCloserToTarget", function (done) {
        body.state = { pos: Physics.vector(0, 0) };
        targetFinder.getTargetPosition.and.returnValue(Physics.vector(10, 10));

        body.accelerate.and.callFake(function(vector) {
            expect(vector.x).toBeGreaterThan(0);
            expect(vector.y).toBeGreaterThan(0);
            done();
        });

        fighter.updateUnit();
    });

});


text:
package com.google.common.reflect;

import com.google.common.annotations.Beta;
import com.google.common.collect.ForwardingMap;
import com.google.common.collect.ImmutableMap;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import com.google.errorprone.annotations.DoNotCall;
import java.util.Map;

/**
 * A type-to-instance map backed by an {@link ImmutableMap}. See also {@link
 * MutableTypeToInstanceMap}.
 *
 * @author Ben Yu
 * @since 13.0
 */
@Beta
public final class ImmutableTypeToInstanceMap extends ForwardingMap<TypeToken<? extends B>, B>
    implements TypeToInstanceMap {

  /** Returns an empty type to instance map. */
  public static  ImmutableTypeToInstanceMap of() {
    return new ImmutableTypeToInstanceMap(ImmutableMap.<TypeToken<? extends B>, B>of());
  }

  /** Returns a new builder. */
  public static  Builder builder() {
    return new Builder();
  }

  /**
   * A builder for creating immutable type-to-instance maps. Example:
   *
   *
{@code
   * static final ImmutableTypeToInstanceMap<Handler<?>> HANDLERS =
   *     ImmutableTypeToInstanceMap.<Handler<?>>builder()
   *         .put(new TypeToken<Handler<Foo>>() {}, new FooHandler())
   *         .put(new TypeToken<Handler<Bar>>() {}, new SubBarHandler())
   *         .build();
   * }

   *
   *
After invoking {@link #build()} it is still possible to add more entries and build again.
   * Thus each map generated by this builder will be a superset of any map generated before it.
   *
   * @since 13.0
   */
  @Beta
  public static final class Builder {
    private final ImmutableMap.Builder<TypeToken<? extends B>, B> mapBuilder =
        ImmutableMap.builder();

    private Builder() {}

    /**
     * Associates {@code key} with {@code value} in the built map. Duplicate keys are not allowed,
     * and will cause {@link #build} to fail.
     */
    @CanIgnoreReturnValue
    public <T extends B> Builder put(Class<T> key, T value) {
      mapBuilder.put(TypeToken.of(key), value);
      return this;
    }

    /**
     * Associates {@code key} with {@code value} in the built map. Duplicate keys are not allowed,
     * and will cause {@link #build} to fail.
     */
    @CanIgnoreReturnValue
    public <T extends B> Builder put(TypeToken<T> key, T value) {
      mapBuilder.put(key.rejectTypeVariables(), value);
      return this;
    }

    /**
     * Returns a new immutable type-to-instance map containing the entries provided to this builder.
     *
     * @throws IllegalArgumentException if duplicate keys were added
     */
    public ImmutableTypeToInstanceMap build() {
      return new ImmutableTypeToInstanceMap(mapBuilder.build());
    }
  }

  private final ImmutableMap<TypeToken<? extends B>, B> delegate;

  private ImmutableTypeToInstanceMap(ImmutableMap<TypeToken<? extends B>, B> delegate) {
    this.delegate = delegate;
  }

  @Override
  public <T extends B> T getInstance(TypeToken<T> type) {
    return trustedGet(type.rejectTypeVariables());
  }

  @Override
  public <T extends B> T getInstance(Class<T> type) {
    return trustedGet(TypeToken.of(type));
  }

  /**
   * Guaranteed to throw an exception and leave the map unmodified.
   *
   * @deprecated unsupported operation
   * @throws UnsupportedOperationException always
   */
  @CanIgnoreReturnValue
  @Deprecated
  @Override
  @DoNotCall("Always throws UnsupportedOperationException")
  public <T extends B> T putInstance(TypeToken<T> type, T value) {
    throw new UnsupportedOperationException();
  }

  /**
   * Guaranteed to throw an exception and leave the map unmodified.
   *
   * @deprecated unsupported operation
   * @throws UnsupportedOperationException always
   */
  @CanIgnoreReturnValue
  @Deprecated
  @Override
  @DoNotCall("Always throws UnsupportedOperationException")
  public <T extends B> T putInstance(Class<T> type, T value) {
    throw new UnsupportedOperationException();
  }

  /**
   * Guaranteed to throw an exception and leave the map unmodified.
   *
   * @deprecated unsupported operation
   * @throws UnsupportedOperationException always
   */
  @CanIgnoreReturnValue
  @Deprecated
  @Override
  @DoNotCall("Always throws UnsupportedOperationException")
  public B put(TypeToken<? extends B> key, B value) {
    throw new UnsupportedOperationException();
  }

  /**
   * Guaranteed to throw an exception and leave the map unmodified.
   *
   * @deprecated unsupported operation
   * @throws UnsupportedOperationException always
   */
  @Deprecated
  @Override
  @DoNotCall("Always throws UnsupportedOperationException")
  public void putAll(Map<? extends TypeToken<? extends B>, ? extends B> map) {
    throw new UnsupportedOperationException();
  }

  @Override
  protected Map<TypeToken<? extends B>, B> delegate() {
    return delegate;
  }

  @SuppressWarnings("unchecked") // value could not get in if not a T
  private <T extends B> T trustedGet(TypeToken<T> type) {
    return (T) delegate.get(type);
  }
}


text:
package com.burrito.matic.product;

import com.burrito.matic.inventory.Ingredient;
import net.jcip.annotations.NotThreadSafe;

/**
 * Encapsulates the rules for a two ingredient burrito product.
 *
 * @author ewarner
 *
 */
@NotThreadSafe
public class TwoIngredientRule extends BurritoProductRule implements ProductRule {

	@Override
	public boolean validateProduct(BurritoProduct product) {
		return RuleUtils.isValidBurrito(product, RuleUtils.TWO_VALIDATE_BURRITO);
	}

	@Override
	public boolean isComplete(BurritoProduct product) {
		return 	RuleUtils.isCompleteTwoIngredient(product);
	}

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

	@Override
	public boolean isSufficient(BurritoProduct product) {
		return isComplete(product);
	}

	@Override
	public boolean validateIngredient(final BurritoProduct product,
			final Ingredient ingredient, boolean isInitial) {
		if(isInitial) {
			return RuleUtils.isValidInitialIngredient(product, ingredient);
		}
		else {
			return RuleUtils.isValidIngredient(product, ingredient, RuleUtils.TWO_VALIDATE_INGREDIENT);
		}
	}
}


text:
package org.pitest.mutationtest.report.csv;

import java.io.IOException;
import java.io.Writer;

import java.util.Optional;
import org.pitest.mutationtest.ClassMutationResults;
import org.pitest.mutationtest.MutationResult;
import org.pitest.mutationtest.MutationResultListener;
import org.pitest.util.ResultOutputStrategy;
import org.pitest.util.Unchecked;

public class CSVReportListener implements MutationResultListener {

  private final Writer out;

  public CSVReportListener(final ResultOutputStrategy outputStrategy) {
    this(outputStrategy.createWriterForFile("mutations.csv"));
  }

  public CSVReportListener(final Writer out) {
    this.out = out;
  }

  private String createKillingTestDesc(final Optional<String> killingTest) {
    return killingTest.orElse("none");
  }

  private String makeCsv(final Object... os) {
    final StringBuilder sb = new StringBuilder();
    for (int i = 0; i != os.length; i++) {
      sb.append(os[i].toString());
      if (i != (os.length - 1)) {
        sb.append(",");
      }
    }
    return sb.toString();
  }

  @Override
  public void runStart() {

  }

  @Override
  public void runEnd() {
    try {
      this.out.close();
    } catch (final IOException e) {
      throw Unchecked.translateCheckedException(e);
    }
  }

  @Override
  public void handleMutationResult(final ClassMutationResults metaData) {
    try {

      for (final MutationResult mutation : metaData.getMutations()) {
        this.out.write(makeCsv(mutation.getDetails().getFilename(), mutation
            .getDetails().getClassName().asJavaName(), mutation.getDetails()
            .getMutator(), mutation.getDetails().getMethod(), mutation
            .getDetails().getLineNumber(), mutation.getStatus(),
            createKillingTestDesc(mutation.getKillingTest()))
            + System.getProperty("line.separator"));
      }

    } catch (final IOException ex) {
      throw Unchecked.translateCheckedException(ex);
    }

  }

}


text:
using System.Collections.Generic;
using Engine.Contracts;
using Engine;
using Game.Acts;

namespace Game
{
	public class ActorFactory : IActorFactory
	{
		private readonly IStrategy _manualStrategy;
		private static int _id = 0;
		private Player _player;

		public ActorFactory (IStrategy strategy)
		{
			_manualStrategy = strategy;
		}

		private void AddMoveActions (IActor actor)
		{
			actor.AllActions.AddRange (new List<IAct> {new MoveAct("Up", actor),
				new MoveAct("Down", actor),
				new MoveAct("Left", actor),
				new MoveAct("Right", actor),
			});
		}

		private void AddAttackActions (IActor actor)
		{
			actor.AllActions.AddRange (new List<IAct> {
				new AttackAct("Up", actor),
				new AttackAct("Down", actor),
				new AttackAct("Left", actor),
				new AttackAct("Right", actor),
			});
		}

		private void AddWaitAction (IActor actor)
		{
			actor.AllActions.Add (new WaitAct (actor));
		}

		public IPlacableActor GetPlayer ()
		{
			if (_player == null) {
				_player = new Player (_manualStrategy);

				AddMoveActions (_player);
				AddAttackActions (_player);
				AddWaitAction (_player);
			}
			return _player;
		}

		public IPlacableActor GetActor ()
		{
			var actor = new PlacableActor ("Unit" + _id, new RandomStrategy (), 5, 5);
			AddMoveActions (actor);
			AddAttackActions (actor);
			AddWaitAction (actor);
			return actor;
		}
	}
}


text:
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ViewComponents;
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.Macros;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.PublishedContent;

namespace Umbraco.Cms.Web.Common.Macros
{
    /// <summary>
    /// Controller to render macro content for Partial View Macros
    /// </summary>
    //[MergeParentContextViewData] // TODO is this requeired now it is a ViewComponent?
    [HideFromTypeFinder] // explicitly used: do *not* find and register it!
    internal class PartialViewMacroViewComponent : ViewComponent
    {
        private readonly MacroModel _macro;
        private readonly IPublishedContent _content;

        public PartialViewMacroViewComponent(
            MacroModel macro,
            IPublishedContent content,
            ViewComponentContext viewComponentContext)
        {
            _macro = macro;
            _content = content;
            // This must be set before Invoke is called else the call to View will end up
            // using an empty ViewData instance because this hasn't been set yet.
            ViewComponentContext = viewComponentContext;
        }

        public IViewComponentResult Invoke()
        {
            var model = new PartialViewMacroModel(
                _content,
                _macro.Id,
                _macro.Alias,
                _macro.Name,
                _macro.Properties.ToDictionary(x => x.Key, x => (object?)x.Value));

            ViewViewComponentResult result =  View(_macro.MacroSource, model);

            return result;
        }
    }

}


text:
describe('$.fn.exposedPorts', function() {
  var subject,
    $portMappings;

  var serviceResponse = {
    'sub_state': 'running',
    'load_state': 'loaded',
    'default_exposed_ports': ['3000/tcp']
  };

  var stoppedServiceResponse = {
    'sub_state': 'stopped',
    'load_state': 'foo'
  };

  var loadingServiceResponse = {
    'sub_state': 'foo',
    'load_state': 'loading'
  };

  beforeEach(function() {
    fixture.load('exposed-ports-table.html');
  });

  describe('handleResponse', function() {

    describe('when the service is running', function () {
      it('removes the loading message from the table', function () {
        $exposedPorts = $('#teaspoon-fixtures').find('table');
        subject = new $.PMX.ExposedPorts($exposedPorts);
        subject.init();
        $('span.service-status').trigger('update-service-status', stoppedServiceResponse);
        expect($('table.exposed-ports').find('tr.loading').length).toBe(1);

        $('span.service-status').trigger('update-service-status', serviceResponse);
        expect($('table.port-bindings').find('tr.loading').length).toBe(0);
      });

      it('calls updateExposedPorts', function() {
        $exposedPorts = $('#teaspoon-fixtures').find('table');
        subject = new $.PMX.ExposedPorts($exposedPorts);
        subject.init();
        spyOn(subject, 'updateExposedPorts');
        $('span.service-status').trigger('update-service-status', serviceResponse);
        expect(subject.updateExposedPorts).toHaveBeenCalledWith(serviceResponse);
      });
    });

    describe('when the service is stopped', function () {
      it('adds the loading message to the table', function () {
        $exposedPorts = $('#teaspoon-fixtures').find('table');
        subject = new $.PMX.ExposedPorts($exposedPorts);
        subject.init();
        $('span.service-status').trigger('update-service-status', stoppedServiceResponse);
        expect($('table.exposed-ports').find('tr.loading').length).toBe(1);
      });
    });

    describe('when the service is loading', function () {
      it('adds the loading message to the table', function () {
        $exposedPorts = $('#teaspoon-fixtures').find('table');
        subject = new $.PMX.ExposedPorts($exposedPorts);
        subject.init();
        $('span.service-status').trigger('update-service-status', loadingServiceResponse);
        expect($('table.exposed-ports').find('tr.loading').length).toBe(1);
      });
    });
  });

  describe('showLoadingMessage', function () {
    it('adds the loading message to the table', function () {
      $exposedPorts = $('#teaspoon-fixtures').find('table');
      subject = new $.PMX.ExposedPorts($exposedPorts);
      subject.init();
      $('span.service-status').trigger('update-service-status', serviceResponse);
      expect($('table.exposed-ports').find('tr.loading').length).toBe(0);

      $('span.service-status').trigger('update-service-status', stoppedServiceResponse);
      expect($('table.exposed-ports').find('tr.loading').length).toBe(1);
    });

  });

  describe('hideLoadingMessage', function () {
    it('removes the loading message from the table', function () {
      $exposedPorts = $('#teaspoon-fixtures').find('table');
      subject = new $.PMX.ExposedPorts($exposedPorts);
      subject.init();
      $('span.service-status').trigger('update-service-status', stoppedServiceResponse);
      expect($('table.exposed-ports').find('tr.loading').length).toBe(1);

      $('span.service-status').trigger('update-service-status', serviceResponse);
      expect($('table.exposed-ports').find('tr.loading').length).toBe(0);
    });
  });

  describe('updateExposedPorts', function () {
    beforeEach(function () {
      $exposedPorts = $('#teaspoon-fixtures').find('table');
      subject = new $.PMX.ExposedPorts($exposedPorts);
    });

    it('removes the loading message from the table', function () {
      subject.init();
      $('span.service-status').trigger('update-service-status', stoppedServiceResponse);
      expect($('table.exposed-ports').find('tr.loading').length).toBe(1);
      $('span.service-status').trigger('update-service-status', serviceResponse);
      expect($('table.exposed-ports').find('tr.loading').length).toBe(0);
    });

    it ('calls formatPort', function () {
      subject.init();
      spyOn(subject, 'formatPort').andReturn("3000 / TCP");
      $('span.service-status').trigger('update-service-status', serviceResponse);
      expect(subject.formatPort).toHaveBeenCalledWith(serviceResponse.default_exposed_ports[0]);
    });

    describe ('when default_exposed_ports exist in the table', function () {
      it ('does not update the table', function () {
        subject.init();
        $('table.exposed-ports').append(
            '
5432
' +
            'exposed by base image - remote deployment will require explicit port declaration

'
        );
        beforeUpdate = $('table.exposed-ports').html();
        $('span.service-status').trigger('update-service-status', serviceResponse);
        expect($('table.exposed-ports').html()).toEqual(beforeUpdate);
      });
    });

    describe ('when default_exposed_ports do not exist in the table', function () {
      it ('adds port information', function () {
        subject.init();
        expect($('table.exposed-ports').find('.image-defined').length).toBe(0);;
        $('span.service-status').trigger('update-service-status', serviceResponse);
        expect($('table.exposed-ports').find('.image-defined').length).toBe(1);;
      });
    });
  });

  describe('formatPort', function () {
    beforeEach(function () {
      $exposedPorts = $('#teaspoon-fixtures').find('table');
      subject = new $.PMX.ExposedPorts($exposedPorts);
    });

    it ('adds spacing and upcases the protocol', function () {
      $('span.service-status').trigger('update-service-status', serviceResponse);
      var result = subject.formatPort(serviceResponse.default_exposed_ports[0]);
      expect(result).toEqual("3000 / TCP")
    });
  });
});


text:
layout: post
title: on the timelessness of skateboarding
description: i can't ollie yet but I'm trying
date: 2017-10-13
---

*this post is incomplete*

A culture tied to an object so completely, they become impossible to separate. Examples:

- A skateboard and skating culture
- Soccer ball?
- iPhone and rich white kids
- Breakdancing and hip hop and graffiti

this is just here to remind me to write about this