text:
namespace Microsoft.Azure.Management.Network
{
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.Threading;
    using System.Threading.Tasks;
    using Microsoft.Rest;
    using Microsoft.Rest.Azure;
    using Models;

    /// <summary>
    /// Extension methods for VirtualNetworkGatewaysOperations.
    /// </summary>
    public static partial class VirtualNetworkGatewaysOperationsExtensions
    {
            /// <summary>
            /// The Put VirtualNetworkGateway operation creates/updates a virtual network
            /// gateway in the specified resource group through Network resource provider.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='virtualNetworkGatewayName'>
            /// The name of the virtual network gateway.
            /// </param>
            /// <param name='parameters'>
            /// Parameters supplied to the Begin Create or update Virtual Network Gateway
            /// operation through Network resource provider.
            /// </param>
            public static VirtualNetworkGateway CreateOrUpdate(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters)
            {
                return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).CreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
            }

            /// <summary>
            /// The Put VirtualNetworkGateway operation creates/updates a virtual network
            /// gateway in the specified resource group through Network resource provider.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='virtualNetworkGatewayName'>
            /// The name of the virtual network gateway.
            /// </param>
            /// <param name='parameters'>
            /// Parameters supplied to the Begin Create or update Virtual Network Gateway
            /// operation through Network resource provider.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<VirtualNetworkGateway> CreateOrUpdateAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// The Put VirtualNetworkGateway operation creates/updates a virtual network
            /// gateway in the specified resource group through Network resource provider.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='virtualNetworkGatewayName'>
            /// The name of the virtual network gateway.
            /// </param>
            /// <param name='parameters'>
            /// Parameters supplied to the Begin Create or update Virtual Network Gateway
            /// operation through Network resource provider.
            /// </param>
            public static VirtualNetworkGateway BeginCreateOrUpdate(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters)
            {
                return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
            }

            /// <summary>
            /// The Put VirtualNetworkGateway operation creates/updates a virtual network
            /// gateway in the specified resource group through Network resource provider.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='virtualNetworkGatewayName'>
            /// The name of the virtual network gateway.
            /// </param>
            /// <param name='parameters'>
            /// Parameters supplied to the Begin Create or update Virtual Network Gateway
            /// operation through Network resource provider.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<VirtualNetworkGateway> BeginCreateOrUpdateAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// The Get VirtualNetworkGateway operation retrieves information about the
            /// specified virtual network gateway through Network resource provider.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='virtualNetworkGatewayName'>
            /// The name of the virtual network gateway.
            /// </param>
            public static VirtualNetworkGateway Get(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName)
            {
                return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).GetAsync(resourceGroupName, virtualNetworkGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
            }

            /// <summary>
            /// The Get VirtualNetworkGateway operation retrieves information about the
            /// specified virtual network gateway through Network resource provider.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='virtualNetworkGatewayName'>
            /// The name of the virtual network gateway.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<VirtualNetworkGateway> GetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// The Delete VirtualNetworkGateway operation deletes the specified virtual
            /// network Gateway through Network resource provider.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='virtualNetworkGatewayName'>
            /// The name of the virtual network gateway.
            /// </param>
            public static void Delete(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName)
            {
                Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).DeleteAsync(resourceGroupName, virtualNetworkGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
            }

            /// <summary>
            /// The Delete VirtualNetworkGateway operation deletes the specified virtual
            /// network Gateway through Network resource provider.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='virtualNetworkGatewayName'>
            /// The name of the virtual network gateway.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task DeleteAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken))
            {
                await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false);
            }

            /// <summary>
            /// The Delete VirtualNetworkGateway operation deletes the specified virtual
            /// network Gateway through Network resource provider.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='virtualNetworkGatewayName'>
            /// The name of the virtual network gateway.
            /// </param>
            public static void BeginDelete(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName)
            {
                Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
            }

            /// <summary>
            /// The Delete VirtualNetworkGateway operation deletes the specified virtual
            /// network Gateway through Network resource provider.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='virtualNetworkGatewayName'>
            /// The name of the virtual network gateway.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task BeginDeleteAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken))
            {
                await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false);
            }

            /// <summary>
            /// The List VirtualNetworkGateways operation retrieves all the virtual
            /// network gateways stored.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            public static IPage<VirtualNetworkGateway> List(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName)
            {
                return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
            }

            /// <summary>
            /// The List VirtualNetworkGateways operation retrieves all the virtual
            /// network gateways stored.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<IPage<VirtualNetworkGateway>> ListAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// The Reset VirtualNetworkGateway operation resets the primary of the
            /// virtual network gateway in the specified resource group through Network
            /// resource provider.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='virtualNetworkGatewayName'>
            /// The name of the virtual network gateway.
            /// </param>
            /// <param name='gatewayVip'>
            /// Virtual network gateway vip address supplied to the Begin Reset of
            /// Active-Active feature enabled Gateway.
            /// </param>
            public static VirtualNetworkGateway Reset(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string))
            {
                return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).ResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
            }

            /// <summary>
            /// The Reset VirtualNetworkGateway operation resets the primary of the
            /// virtual network gateway in the specified resource group through Network
            /// resource provider.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='virtualNetworkGatewayName'>
            /// The name of the virtual network gateway.
            /// </param>
            /// <param name='gatewayVip'>
            /// Virtual network gateway vip address supplied to the Begin Reset of
            /// Active-Active feature enabled Gateway.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<VirtualNetworkGateway> ResetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.ResetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// The Reset VirtualNetworkGateway operation resets the primary of the
            /// virtual network gateway in the specified resource group through Network
            /// resource provider.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='virtualNetworkGatewayName'>
            /// The name of the virtual network gateway.
            /// </param>
            /// <param name='gatewayVip'>
            /// Virtual network gateway vip address supplied to the Begin Reset of
            /// Active-Active feature enabled Gateway.
            /// </param>
            public static VirtualNetworkGateway BeginReset(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string))
            {
                return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).BeginResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
            }

            /// <summary>
            /// The Reset VirtualNetworkGateway operation resets the primary of the
            /// virtual network gateway in the specified resource group through Network
            /// resource provider.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='virtualNetworkGatewayName'>
            /// The name of the virtual network gateway.
            /// </param>
            /// <param name='gatewayVip'>
            /// Virtual network gateway vip address supplied to the Begin Reset of
            /// Active-Active feature enabled Gateway.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<VirtualNetworkGateway> BeginResetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.BeginResetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// The Generatevpnclientpackage operation generates Vpn client package for
            /// P2S client of the virtual network gateway in the specified resource group
            /// through Network resource provider.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='virtualNetworkGatewayName'>
            /// The name of the virtual network gateway.
            /// </param>
            /// <param name='parameters'>
            /// Parameters supplied to the Begin Generating  Virtual Network Gateway Vpn
            /// client package operation through Network resource provider.
            /// </param>
            public static string Generatevpnclientpackage(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters)
            {
                return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).GeneratevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
            }

            /// <summary>
            /// The Generatevpnclientpackage operation generates Vpn client package for
            /// P2S client of the virtual network gateway in the specified resource group
            /// through Network resource provider.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='virtualNetworkGatewayName'>
            /// The name of the virtual network gateway.
            /// </param>
            /// <param name='parameters'>
            /// Parameters supplied to the Begin Generating  Virtual Network Gateway Vpn
            /// client package operation through Network resource provider.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<string> GeneratevpnclientpackageAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.GeneratevpnclientpackageWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// The List VirtualNetworkGateways operation retrieves all the virtual
            /// network gateways stored.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='nextPageLink'>
            /// The NextLink from the previous successful call to List operation.
            /// </param>
            public static IPage<VirtualNetworkGateway> ListNext(this IVirtualNetworkGatewaysOperations operations, string nextPageLink)
            {
                return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
            }

            /// <summary>
            /// The List VirtualNetworkGateways operation retrieves all the virtual
            /// network gateways stored.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='nextPageLink'>
            /// The NextLink from the previous successful call to List operation.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<IPage<VirtualNetworkGateway>> ListNextAsync(this IVirtualNetworkGatewaysOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

    }
}


text:
Qualification Testing
#####################

PICS Features
*************

The PICS features for each supported protocol & profile can be found in
the following documents:

.. toctree::
   :maxdepth: 1

   gap-pics.rst
   gatt-pics.rst
   l2cap-pics.rst
   sm-pics.rst
   rfcomm-pics.rst

redpajama_set_name: RedPajamaGithub


text:
package org.ethereum.validator;

import org.ethereum.core.BlockHeader;
import org.ethereum.util.FastByteComparisons;

/**
 * Checks proof value against its boundary for the block header
 *
 * @author Mikhail Kalinin
 * @since 02.09.2015
 */
public class ProofOfWorkRule extends BlockHeaderRule {

    @Override
    public ValidationResult validate(BlockHeader header) {
        byte[] proof = header.calcPowValue();
        byte[] boundary = header.getPowBoundary();

        if (!header.isGenesis() && FastByteComparisons.compareTo(proof, 0, 32, boundary, 0, 32) > 0) {
            return fault(String.format("#%d: proofValue > header.getPowBoundary()", header.getNumber()));
        }

        return Success;
    }
}


text:
from django.apps import AppConfig

class TimetablesConfig(AppConfig):
    name = 'timetables'


text:
//--------------------------------------
// utgb-core Project
//
// BarGraphCanvas.java
// Since: 2010/09/27
//
//--------------------------------------
package org.utgenome.gwt.utgb.client.canvas;

import java.util.List;

import org.utgenome.gwt.utgb.client.bio.CompactWIGData;
import org.utgenome.gwt.utgb.client.canvas.GWTGraphCanvas.GraphStyle;
import org.utgenome.gwt.utgb.client.track.TrackWindow;
import org.utgenome.gwt.widget.client.Style;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.widgetideas.graphics.client.Color;
import com.google.gwt.widgetideas.graphics.client.GWTCanvas;

/**
 * Canvas for drawing {@link CompactWIGData}
 *
 * @author leo
 *
 */
public class BarGraphCanvas extends Composite {

	private final String DEFAULT_COLOR = "rgba(12,106,193,0.7)";
	private GWTCanvas canvas = new GWTCanvas();
	private TrackWindow window = new TrackWindow();
	private final Scale scale = new Scale();

	public BarGraphCanvas(TrackWindow window, int windowHeight) {
		this.window = window;
		//Style.border(canvas, 1, "solid", "gray");
		initWidget(canvas);
		setPixelSize(window.getPixelWidth(), windowHeight);
	}

	public void clear() {
		canvas.clear();
	}

	public TrackWindow getTrackWindow() {
		return window;
	}

	public void setTrackWindow(TrackWindow window, int newPixelX) {
		TrackWindow prev = this.window;
		this.window = window;

		if (!prev.hasSameScaleWith(window)) {
			Style.scaleXwithAnimation(canvas, (double) window.getPixelWidth() / prev.getPixelWidth(), newPixelX, 0.5);
		}
		else {
			Style.scaleX(canvas, 1);
		}
	}

	private float min = 0;
	private float max = 0;

	private List<CompactWIGData> graphData;
	private int span = 1;

	public void redraw(GraphStyle style) {
		if (this.graphData == null)
			return;

		canvas.clear();
		draw(this.graphData, style);
	}

	private void setPixelWidth(int width, int height) {
		int pixelWidthWithSpan = window.convertToPixelLength(window.getSequenceLength() + this.span - 2);
		canvas.setPixelSize(pixelWidthWithSpan, height);
		canvas.setCoordSize(pixelWidthWithSpan, height);
	}

	public List<CompactWIGData> getGraphData() {
		return graphData;
	}

	public void setGraphData(List<CompactWIGData> graphData) {
		this.graphData = graphData;
	}

	public void draw(List<CompactWIGData> graphData, GraphStyle style) {

		for (CompactWIGData each : graphData) {
			if (each.getSpan() > span) {
				this.span = each.getSpan();
			}
		}
		setPixelWidth(window.getPixelWidth(), style.windowHeight);

		scale.updateStyle(style);

		for (CompactWIGData data : graphData) {
			// get graph color
			Color graphColor = new Color(DEFAULT_COLOR);
			if (style.color.isDefined()) {
				graphColor = new Color(style.color.get());
			}
			else if (data.getTrack().containsKey("color")) {
				String colorStr = data.getTrack().get("color");
				String c[] = colorStr.split(",");
				if (c.length == 3)
					graphColor = new Color(Integer.valueOf(c[0]), Integer.valueOf(c[1]), Integer.valueOf(c[2]));
			}

			// draw graph
			canvas.saveContext();
			canvas.setLineWidth(1.0f);
			canvas.setStrokeStyle(graphColor);

			min = scale.getMin();
			max = scale.getMax();

			float y2 = scale.getYPosition(0.0f);

			// draw data graph
			final boolean isReverse = window.isReverseStrand();
			final int pixelWidth = data.getData().length;

			for (int i = 0; i < pixelWidth; ++i) {
				float value = data.getData()[i];
				float y1;
				if (value == 0.0f) {
					if (!style.drawZeroValue)
						continue;
					else {
						y1 = y2 + ((min < max) ? -0.5f : 0.5f);
					}
				}
				else {
					y1 = scale.getYPosition(value);
				}

				int x = i;
				if (isReverse) {
					x = pixelWidth - x - 1;
				}

				canvas.saveContext();
				canvas.beginPath();
				canvas.translate(x + 0.5f, 0);
				canvas.moveTo(0, y1);
				canvas.lineTo(0, y2);
				canvas.stroke();
				canvas.restoreContext();
			}
			canvas.restoreContext();
		}

	}

}


text:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Fecmd Demo</title>
</head>
<body>
    please open javascript console look print data

    and look at export js
    <script src="src/export/js/app.js"></script>
</body>
</html>


text:
package org.minimalj.repository.sql.relationhist;

import java.util.List;

import org.minimalj.model.annotation.Size;

public class TestElementHistorized {

	public TestElementHistorized() {
		// needed for reflection constructor
	}

	public TestElementHistorized(String name) {
		this.name = name;
	}

	public Object id;
	public int version;
	public boolean historized;

	public List<TestElementC> list;

	@Size(30)
	public String name;
}


text:
angular.module("abqtrafficFilters", ["ngSanitize"]).filter("checkmark", function($sce) {
	return(function(input) {
		var checkmark = $sce.trustAsHtml("");
		var xmark = $sce.trustAsHtml("");
		return(input ? checkmark : xmark);
	});
});


text:
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/**
 * @constructor
 * @param {!WebInspector.FormattedContentBuilder} builder
 */
WebInspector.HTMLFormatter = function(builder)
{
    this._builder = builder;
}

/**
 * @constructor
 * @param {string} tagName
 * @param {number} offset
 */
WebInspector.HTMLFormatter.Result = function(tagName, offset)
{
    this.tagName = tagName;
    this.offset = offset;
}

WebInspector.HTMLFormatter.prototype = {
    /**
     * @param {string} text
     * @param {!Array<number>} lineEndings
     * @param {number} fromOffset
     * @return {!WebInspector.HTMLFormatter.Result}
     */
    format: function(text, lineEndings, fromOffset)
    {
        var content = text.substring(fromOffset);
        var tagName = "";
        var accumulatedTokenValue = "";
        var lastOffset = fromOffset;

        /**
         * @param {string} tokenValue
         * @param {?string} type
         * @param {number} tokenStart
         * @param {number} tokenEnd
         * @return {(!Object|undefined)}
         * @this {WebInspector.HTMLFormatter}
         */
        function processToken(tokenValue, type, tokenStart, tokenEnd)
        {
            tokenStart += fromOffset;
            tokenEnd += fromOffset;
            lastOffset = tokenEnd;
            this._builder.addToken(tokenValue, tokenStart);

            if (!type)
                return;
            var tokenType = type.split(" ").keySet();
            if (!tokenType["tag"])
                return;

            if (tokenType["bracket"] && (tokenValue === "<" || tokenValue === "</")) {
                accumulatedTokenValue = tokenValue;
                return;
            }

            if (tagName && tokenValue === ">")
                return WebInspector.AbortTokenization;

            accumulatedTokenValue = accumulatedTokenValue + tokenValue.toLowerCase();
            if (accumulatedTokenValue === "<script" || accumulatedTokenValue === "<style")
                tagName = accumulatedTokenValue.substring(1);
            accumulatedTokenValue = "";
        }
        var tokenizer = WebInspector.createTokenizer("text/html");
        tokenizer(content, processToken.bind(this));
        return new WebInspector.HTMLFormatter.Result(tagName, lastOffset);
    },
}


text:
package com.prt2121.cloudy;

import android.content.Context;
import android.support.multidex.MultiDex;
import android.support.multidex.MultiDexApplication;

/**
 * Created by pt2121 on 9/1/15.
 */
public class App extends MultiDexApplication {

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
    }

}


text:
package org.apache.hadoop.hdfs.protocol;

import java.util.Date;

import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;

/**
 * Rolling upgrade information
 */
@InterfaceAudience.Private
@InterfaceStability.Evolving
public class RollingUpgradeInfo extends RollingUpgradeStatus {
  private final long startTime;
  private long finalizeTime;
  private boolean createdRollbackImages;

  public RollingUpgradeInfo(String blockPoolId, boolean createdRollbackImages,
      long startTime, long finalizeTime) {
    super(blockPoolId, finalizeTime != 0);
    this.createdRollbackImages = createdRollbackImages;
    this.startTime = startTime;
    this.finalizeTime = finalizeTime;
  }

  public boolean createdRollbackImages() {
    return createdRollbackImages;
  }

  public void setCreatedRollbackImages(boolean created) {
    this.createdRollbackImages = created;
  }

  public boolean isStarted() {
    return startTime != 0;
  }

  /** @return The rolling upgrade starting time. */
  public long getStartTime() {
    return startTime;
  }

  @Override
  public boolean isFinalized() {
    return finalizeTime != 0;
  }

  /**
   * Finalize the upgrade if not already finalized
   */
  public void finalize(long finalizeTime) {
    if (finalizeTime != 0) {
      this.finalizeTime = finalizeTime;
      createdRollbackImages = false;
    }
  }

  public long getFinalizeTime() {
    return finalizeTime;
  }

  @Override
  public int hashCode() {
    //only use lower 32 bits
    return super.hashCode() ^ (int)startTime ^ (int)finalizeTime;
  }

  @Override
  public boolean equals(Object obj) {
    if (obj == this) {
      return true;
    } else if (obj == null || !(obj instanceof RollingUpgradeInfo)) {
      return false;
    }
    final RollingUpgradeInfo that = (RollingUpgradeInfo)obj;
    return super.equals(that)
        && this.startTime == that.startTime
        && this.finalizeTime == that.finalizeTime;
  }

  @Override
  public String toString() {
    return super.toString()
        +  "\n     Start Time: "
        + (startTime == 0 ? "<NOT STARTED>" : timestamp2String(startTime))
        +  "\n  Finalize Time: "
        + (finalizeTime == 0 ? "<NOT FINALIZED>" :
        timestamp2String(finalizeTime));
  }

  private static String timestamp2String(long timestamp) {
    return new Date(timestamp) + " (=" + timestamp + ")";
  }

  public static class Bean {
    private final String blockPoolId;
    private final long startTime;
    private final long finalizeTime;
    private final boolean createdRollbackImages;

    public Bean(RollingUpgradeInfo f) {
      this.blockPoolId = f.getBlockPoolId();
      this.startTime = f.startTime;
      this.finalizeTime = f.finalizeTime;
      this.createdRollbackImages = f.createdRollbackImages();
    }

    public String getBlockPoolId() {
      return blockPoolId;
    }

    public long getStartTime() {
      return startTime;
    }

    public long getFinalizeTime() {
      return finalizeTime;
    }

    public boolean isCreatedRollbackImages() {
      return createdRollbackImages;
    }
  }
}


text:
**Namespace:** [OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201505](OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201505.md)
**Assembly:** OfficeDevPnP.Core.dll
## Inheritance Hierarchy
System.Object
## Syntax
```C#
public class TermTerms
```
## Constructors
|**Name**|**Description**|
|:-----|:-----|
| [TermTerms()](OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201505.TermTerms.ctor1.md) |
## Properties
|**Name**|**Description**|
|:-----|:-----|
| [Items](OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201505.TermTerms.Items.md) |
## See also
- [OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201505](OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201505.md)


text:
var defaultTimer = 2000;

/**
 * 成功消息
 *
 * @param {String} title
 * @param {String} message
 * @param {Integer} timer
 *
 * @return {boolean}
 */
function success(title, message, timer) {
    return swal({
            title: title,
            text: message,
            type: "success",
            html: true,
            timer: timer || defaultTimer
        });
}

/**
 * 普通消息
 *
 * @param {String} title
 * @param {String} message
 * @param {Integer} timer
 *
 * @return {boolean}
 */
function info(title, message, timer) {
    return swal({
            title: title,
            text: message,
            type: "info",
            html: true,
            timer: timer || defaultTimer
        });
}

/**
 * 失败消息
 *
 * @param {String} title
 * @param {String} message
 * @param {Integer} timer
 *
 * @return {boolean}
 */
function error(title, message, timer) {
    return swal({
            title: title,
            text: message,
            type: "error",
            html: true,
            timer: timer || defaultTimer
        });
}

/**
 * 警告消息
 *
 * @param {String}   title
 * @param {String}   message
 * @param {Function} callback
 * @param {String}   confirmButtonText
 * @param {Boolean}  closeOnConfirm
 * @param {Boolean}  showCancelButton
 *
 * @return {Boolean}
 */
function warning(title, message, callback, confirmButtonText, closeOnConfirm, showCancelButton) {
    return swal({
        title: title,
        text: message,
        type: "warning",
        showCancelButton: showCancelButton,
        confirmButtonColor: "#DD6B55",
        confirmButtonText: confirmButtonText || 'OK,没问题!',
        closeOnConfirm: closeOnConfirm,
        html: true
    }, callback);
}

/**
 * 自动关闭
 *
 * @param {String}  title
 * @param {String}  message
 * @param {Integer} timer
 *
 * @return {boolean}
 */
function flush(title, message, timer) {
    return swal({   title: title,   text: message,   timer: timer || 2000 });
}

window.alert = function(string){
    swal('' + string);
};

window.confirm = function(title){
    sweetAlert({
        title: title,
        showCancelButton: true,
        confirmButtonText: '确认',
        cancelButtonText: '取消'
    }, function() {
        if (window.event && window.event.toElement) {
            var btn = $(window.event.toElement);
            window.location.href=btn.attr('href');
        };
    });

    return false;
};


text:
{% extends "layout.html" %}
{% load projects_tags %}

{% block script %}

{% endblock %}

{% block stylesheet %}
<link rel="stylesheet" type="text/css" href="/static/css/projects-list.css">
{% endblock %}

{% block nav-projects %}sel{% endblock %}

{% block content %}

            back to project list

        {{ project.area.title }}

{{ project.title }}

        {% if project.sum_image %}

        {% endif %}
        {{ project.start_year }} - {{ project.end_year }}

{{ project.content }}

            {% for research in project.researches.all %}

{{ research.title }}

                {{ research.paper }}

                    {% if research.abstract %}

Abstract

{{ research.abstract }}

                    {% endif %}
                    {% if research.images.all %}

Image

                        {% for image in research.images.all %}

{{ image.caption }}

                        {% endfor %}
                    {% endif %}
                    {% if research.videos.all %}

Video

                        {% for video in research.videos.all %}

{{ video.caption }}

                        {% endfor %}
                    {% endif %}

                <button type="button" class="research-more">See Details</button>

            {% endfor %}

{% endblock %}


text:
<?php
$TRANSLATIONS = array(
"Could not move %s - File with this name already exists" => "Nelze přesunout %s - již existuje soubor se stejným názvem",
"Could not move %s" => "Nelze přesunout %s",
"File name cannot be empty." => "Název souboru nemůže být prázdný řetězec.",
"File name must not contain \"/\". Please choose a different name." => "Název souboru nesmí obsahovat \"/\". Vyberte prosím jiné jméno.",
"The name %s is already used in the folder %s. Please choose a different name." => "Název %s ve složce %s již existuje. Vyberte prosím jiné jméno.",
"Not a valid source" => "Neplatný zdroj",
"Error while downloading %s to %s" => "Chyba při stahování %s do %s",
"Error when creating the file" => "Chyba při vytváření souboru",
"Folder name cannot be empty." => "Název složky nemůže být prázdný.",
"Folder name must not contain \"/\". Please choose a different name." => "Název složky nesmí obsahovat \"/\". Zvolte prosím jiný.",
"Error when creating the folder" => "Chyba při vytváření složky",
"Unable to set upload directory." => "Nelze nastavit adresář pro nahrané soubory.",
"Invalid Token" => "Neplatný token",
"No file was uploaded. Unknown error" => "Žádný soubor nebyl odeslán. Neznámá chyba",
"There is no error, the file uploaded with success" => "Soubor byl odeslán úspěšně",
"The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "Odesílaný soubor přesahuje velikost upload_max_filesize povolenou v php.ini:",
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "Odeslaný soubor přesáhl svou velikostí parametr MAX_FILE_SIZE specifikovaný ve formuláři HTML",
"The uploaded file was only partially uploaded" => "Soubor byl odeslán pouze částečně",
"No file was uploaded" => "Žádný soubor nebyl odeslán",
"Missing a temporary folder" => "Chybí adresář pro dočasné soubory",
"Failed to write to disk" => "Zápis na disk selhal",
"Not enough storage available" => "Nedostatek dostupného úložného prostoru",
"Upload failed. Could not get file info." => "Nahrávání selhalo. Nepodařilo se získat informace o souboru.",
"Upload failed. Could not find uploaded file" => "Nahrávání selhalo. Nepodařilo se nalézt nahraný soubor.",
"Invalid directory." => "Neplatný adresář",
"Files" => "Soubory",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "Nelze nahrát soubor {filename}, protože je to buď adresář nebo má velikost 0 bytů",
"Not enough space available" => "Nedostatek volného místa",
"Upload cancelled." => "Odesílání zrušeno.",
"Could not get result from server." => "Nepodařilo se získat výsledek ze serveru.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Probíhá odesílání souboru. Opuštění stránky způsobí zrušení nahrávání.",
"URL cannot be empty" => "URL nemůže zůstat prázdná",
"In the home folder 'Shared' is a reserved filename" => "V osobní složce je název 'Shared' rezervovaný",
"{new_name} already exists" => "{new_name} již existuje",
"Could not create file" => "Nepodařilo se vytvořit soubor",
"Could not create folder" => "Nepodařilo se vytvořit složku",
"Share" => "Sdílet",
"Delete permanently" => "Trvale odstranit",
"Rename" => "Přejmenovat",
"Pending" => "Nevyřízené",
"Could not rename file" => "Nepodařilo se přejmenovat soubor",
"replaced {new_name} with {old_name}" => "nahrazeno {new_name} s {old_name}",
"undo" => "vrátit zpět",
"Error deleting file." => "Chyba při mazání souboru.",
"_%n folder_::_%n folders_" => array("%n složka","%n složky","%n složek"),
"_%n file_::_%n files_" => array("%n soubor","%n soubory","%n souborů"),
"{dirs} and {files}" => "{dirs} a {files}",
"_Uploading %n file_::_Uploading %n files_" => array("Nahrávám %n soubor","Nahrávám %n soubory","Nahrávám %n souborů"),
"'.' is an invalid file name." => "'.' je neplatným názvem souboru.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Neplatný název, znaky '\\', '/', '<', '>', ':', '\"', '|', '?' a '*' nejsou povoleny.",
"Your storage is full, files can not be updated or synced anymore!" => "Vaše úložiště je plné, nelze aktualizovat ani synchronizovat soubory.",
"Your storage is almost full ({usedSpacePercent}%)" => "Vaše úložiště je téměř plné ({usedSpacePercent}%)",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Aplikace pro šifrování je zapnuta, ale vaše klíče nejsou inicializované. Prosím odhlaste se a znovu přihlaste",
"Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Chybný soukromý klíč pro šifrovací aplikaci. Aktualizujte prosím heslo svého soukromého klíče ve vašem osobním nastavení, abyste znovu získali přístup k vašim zašifrovaným souborům.",
"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Šifrování bylo vypnuto, vaše soubory jsou však stále zašifrované. Běžte prosím do osobního nastavení, kde soubory odšifrujete.",
"Your download is being prepared. This might take some time if the files are big." => "Vaše soubory ke stažení se připravují. Pokud jsou velké, může to chvíli trvat.",
"Error moving file" => "Chyba při přesunu souboru",
"Error" => "Chyba",
"Name" => "Název",
"Size" => "Velikost",
"Modified" => "Upraveno",
"Invalid folder name. Usage of 'Shared' is reserved." => "Neplatný název složky. Použití 'Shared' je rezervováno.",
"%s could not be renamed" => "%s nemůže být přejmenován",
"Upload" => "Odeslat",
"File handling" => "Zacházení se soubory",
"Maximum upload size" => "Maximální velikost pro odesílání",
"max. possible: " => "největší možná: ",
"Needed for multi-file and folder downloads." => "Potřebné pro více-souborové stahování a stahování složek.",
"Enable ZIP-download" => "Povolit ZIP-stahování",
"0 is unlimited" => "0 znamená bez omezení",
"Maximum input size for ZIP files" => "Maximální velikost vstupu pro ZIP soubory",
"Save" => "Uložit",
"New" => "Nový",
"Text file" => "Textový soubor",
"Folder" => "Složka",
"From link" => "Z odkazu",
"Deleted files" => "Odstraněné soubory",
"Cancel upload" => "Zrušit odesílání",
"You don't have permission to upload or create files here" => "Nemáte oprávnění zde nahrávat či vytvářet soubory",
"Nothing in here. Upload something!" => "Žádný obsah. Nahrajte něco.",
"Download" => "Stáhnout",
"Unshare" => "Zrušit sdílení",
"Delete" => "Smazat",
"Upload too large" => "Odesílaný soubor je příliš velký",
"The files you are trying to upload exceed the maximum size for file uploads on this server." => "Soubory, které se snažíte odeslat, překračují limit velikosti odesílání na tomto serveru.",
"Files are being scanned, please wait." => "Soubory se prohledávají, prosím čekejte.",
"Current scanning" => "Aktuální prohledávání",
"Upgrading filesystem cache..." => "Aktualizuji mezipaměť souborového systému..."
);
$PLURAL_FORMS = "nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;";


text:
title: "Conscious Business: Communication"
date: 2017-10-22
draft: false
categories:
    - business
tags:
    - business
    - conscious-business
    - communication
---

[Previous: Humility][1]

> [LinkedIn Conscious Business Week 6: Communication][3]

From the introduction:

> For each week of this course I am going to take my notes on what I learned and turn it into a short blog post. I am hoping this will encourage you to take a look at the course and maybe do it yourself.

This weeks notes on [Conscious Business][2] focus on communication and managing difficult conversations.

## Managing Difficult Conversations

In difficult conversations you will likely feel threatened and uneasy. As a result we instinctively resort to a defensive positioning which brings out the worst in us, often manifesting itself as arrogance. We believe that we know all the relevant information and that we are right and they are wrong. And so the conversation naturally degrades into a fight between you and them.

A good alternative may seem to be 'nice' and try to provide constructive feedback and criticism in the efforts of avoiding confrontation. But doing this is a blow to your integrity. You're not being truthful not only to yourself, but to those that oppose you as well. To make matters worse, those on the other side of the conversation have these exact same issues as well.

To improve this scenario you need to change from a Knower to a Learner, which we looked at in the [last Conscious Business post][1]. Change your assumptions from believing you know everything, to understanding that you only know a piece of the puzzle. Then it becomes easy to see that the other person knows only a piece as well.

This change of view shifts the goal from fighting and winning to exploring and understanding. Instead of trying to beat your opponent, you share knowledge and different points of view which makes it possible to come to a mutual agreement.

This more constructive way of communicating can be thoughts of with three stages: listening; inquiring; and expressing.

## How to Listen

> Listening means gaining a deep understanding not only of what a person thinks, but also why they think that and the actions they may take as a result.

To form a mutual understanding requires respect and communication. But often when we need to listen the most we want to listen the least. It's too easy in these scenarios to resort to interruption. We just want to shutdown what the other person is saying so we can continue to speak. If we do this when we go back to square one, with the viewpoint of you against them.

But listening isn't easy:

1. Focus: look at them; don't do anything else.
+ Be quiet: let them finish; don't interrupt.
+ Encourage: nod; say "mhmm"; paraphrase.
+ Summarize: play back their essential points.
+ Clarify: ask if you have their point, and let them correct you.
+ Validate: acknowledge that they have a point.
+ Inquire: ask what they would like from you.

## How to Inquire

> To inquire is to give you a chance to validate and check your understanding of what the other person has said.

Inquiry helps with the last part of listening: understanding why the others think what they think and the actions they may take as a result. Most of the time people won't outright tell you these things, and so you have to inquire.

It's important though to understand that inquiry doesn't involve judgement. You're not trying to belittle them, nor are you aiming to point our flaws in their ideas and thoughts. Asking "don't you think that idea is stupid?" is really just judgement disguised as being inquisitive.

To inquire productively there are three aspects you need to consider: "what"; "why"; and "so what".

Asking "what" is asking about the present and helps you understand what is going on right now.

The "why" helps gauge what the other person thinks of the past. This gives you a better idea as to how they have arrived at their current position.

Finally, asking "so what" is inquiring into the future and the actions they may take as a result of their opinions and ideas.

This can be a confronting and uncomfortable process, depending on who you're talking to and how often you engage in this kind of conversation. To help here are another three things to keep in mind:

1. Clarifying is not conceding.
+ Understanding is not undermining.
+ Comprehending is not counter-arguing.

## How to Express

> Finally, expressing will involve everyone to act in a respectful way based on the common understanding they all share.

Expression is similar to inquiry, but instead of asking the questions, you are answering them as though they had asked you.

When you're expressing your position it's important not to oppose the other person's views. You don't want to start the conversation with a clash because that will put whoever you're talking to in a defensive stance, and will likely derail the conversation to being unproductive.

Instead you want to project your thoughts in a way that allows the ideas of both sides to be integrated. Then you can both have an effective conversation and avoid 'butting heads.'

Another way to avoid a clash is to always speak in the first person. At this stage you are expressing your views, not the views of the other person. By speaking as though "we should do that" it is likely to also put the other person on the defensive. This also opens up the conversation for a discussion and shifts the conversation more towards the aim improving understanding and collaboration, rather than fighting an opponent.

## Wrapping Up

When a colleague tries to confront you, having a fight will always result in a loss. We all know the old adage "two wrongs don't make a write." Even if you win, you will then have to work with a defeated and resentful opponent.

Communication in all aspects of life is extremely important. And no less in the business world where you and your team need to work together internal to the company in order to respond to the pressures outside the company.

[Next: Collaboration][11]

## Sources

+ [Conscious Business][2]
+ [Managing Difficult Conversations][4]
+ [How to Really Listen in a Difficult Conversation][5]
+ [How to Inquire Productively][6]
+ [How to Express Truth with Honesty and Respect][7]
+ [How to Invite Inquiry][8]
+ [Verbal Akido][9]
+ [A Mutual Learning Conversation][10]

[1]: {{< ref "/posts/conscious-business-humility.md" >}}
[2]: https://conscious.linkedin.com
[3]: https://conscious.linkedin.com/content/6-Communication
[4]: https://www.linkedin.com/pulse/how-manage-difficult-conversations-honesty-respect-fred-kofman
[5]: https://www.linkedin.com/pulse/how-really-listen-difficult-conversation-62-fred-kofman
[6]: https://www.linkedin.com/pulse/how-inquire-productively-63-fred-kofman
[7]: https://www.linkedin.com/pulse/how-express-your-truth-honesty-respect-64-fred-kofman
[8]: https://www.linkedin.com/pulse/how-invite-inquiry-65-fred-kofman
[9]: https://www.linkedin.com/pulse/verbal-aikido-how-respond-reasonable-unreasonable-66-fred-kofman
[10]: https://www.linkedin.com/pulse/conscious-performance-improvement-mutual-learning-66-fred-kofman
[11]: {{< ref "/posts/conscious-business-collaboration.md" >}}


text:
from cacti_rest.utils import retrieve_param
from django.http import HttpResponseServerError
from django.shortcuts import render_to_response
from cacti_rest.models import DataLocal
import logging, simplejson
from django.core.urlresolvers import reverse

def get(request, host):
    try:
        offset = int(retrieve_param(request, "offset", 0))
        limit = int(retrieve_param(request, "limit", 50)) + offset
        query = DataLocal.objects.filter(host_id=host)[offset:limit]
        #print query.query
        data = [{"resource_type": "datasource", "url": reverse("resource_datasource", args=[x.id, ])} for x in query]
        #print "data: %s" % data
        response =  render_to_response(
            "cacti_rest/json/list.json",
            {"data": data},
            content_type="application/json")
        response['Cache-Control'] = 'no-cache'
        return response

    except AttributeError, ex:

        logging.error("Resource get error: %s" % ex)
        response =  HttpResponseServerError(
            content=simplejson.dumps({"errors": str(ex)}),
            content_type="application/json")
        response['Cache-Control'] = 'no-cache'
        return response

#@csrf_exempt
#@access_required
def entrance(request, *args, **kwargs):

    if request.method == "GET":
        return get(request, *args, **kwargs)


text:
var app = angular.module('calypso');

	app.controller('markSheetController', ['$scope', '$http','adminService','$routeParams', function ($scope, $http,adminService,$routeParams) {

		$scope.marksData = {};
		$scope.gradeSystemFlag = false;

		$scope.years = [];
		var date = new Date();
		var year = date.getFullYear();
		$scope.selectedYear = year.toString();
		$scope.years.push(year.toString());

		for(var i = 1; i < 100; i++) {
			$scope.years.push((year - i).toString());
		}

		$scope.populateMetaData = function() {
			var promise = adminService.getMetaDataClasses($routeParams.schoolId);
			promise.then(function(response) {
				var metaData = response.body.metaData;
				$scope.metaDataClasses = metaData.Classes;
				$scope.metaDataSections = metaData.Sections;
				$scope.metaDataSubjects = metaData.Subjects;
				$scope.metaDataTestOrExams = metaData.TestOrExams;
				$scope.metaDataGrades = metaData.Grades;
				$scope.passingGrades = metaData.passingGrades;
				$scope.marksBased = metaData.marksBased;
				$scope.gradeSystemFlag = !$scope.marksBased;
			});
		};

	  $scope.addSubjectToColumn = function(subject,passingMarks,totalMarks) {
		  if($scope.subjectDoesntExistInTableAlreadly(subject)) {

			  $scope.marksData.columnDefs.pop();
			  var obj = {};
			  obj.name = subject;
			  obj.displayName = subject;
			  obj.marksBased = !$scope.gradeSystemFlag;
			  if($scope.gradeSystemFlag == false) {
				  obj.passingMarks = passingMarks;
				  obj.totalMarks = totalMarks;
			  } else {
				  obj.editDropdownValueLabel = subject;
				  obj.editableCellTemplate = "ui-grid/dropdownEditor";
				  obj.editDropdownOptionsArray = [];
				  for(var i = 0; i < $scope.metaDataGrades.length; i++) {
					  var insideObj = {};
					  insideObj.id = $scope.metaDataGrades[i];
					  insideObj[subject] = $scope.metaDataGrades[i];
					  obj.editDropdownOptionsArray.push(insideObj);
				  }

			  }
			  $scope.marksData.columnDefs.push(obj);
			  marksColSize = 90/$scope.marksData.columnDefs.length;
			  size = Math.floor(marksColSize);
			  remainingColSize = (90 - (Math.floor(marksColSize)*($scope.marksData.columnDefs.length)))
			  nameColSize = 10 + remainingColSize;
			  for(var i = 0; i < $scope.marksData.columnDefs.length; i++) {
				  if($scope.marksData.columnDefs[i].name == "name") {
					  $scope.marksData.columnDefs[i].width = nameColSize.toString() + "%";
				  } else {
					  $scope.marksData.columnDefs[i].width = Math.floor(marksColSize).toString() + "%";
				  }
			  }
			  var obj = {};
			  obj.name = "result";
			  obj.displayName = "Result";
			  obj.width = size + "%";
			  $scope.marksData.columnDefs.push(obj);

	  	}
	  };

	  $scope.saveMarks = function(marksData) {
		  $scope.updateResult(marksData);
		  var promise = adminService.saveMarksData($routeParams.schoolId,$scope.displayedMarksCriteria,marksData);
			promise.then(function(response) {
				console.log("Successfully Saved");
			});
	  };

	  $scope.updateResult = function(marksData){
		  $scope.markAllPass();
		  for(var i = 2; i < marksData.columnDefs.length - 1; i++) {

			  var data = {};
			  var marks = null;
			  var passingMarks = null;
			  var totalMarks = null;
			  var grade = null;
			  passingMarks = marksData.columnDefs[i].passingMarks;
			  totalMarks = marksData.columnDefs[i].totalMarks;
			  for(var j = 0; j < marksData.data.length; j++) {
				  data = marksData.data[j];
				  if(data.id && data.id != null && data.id != "") {
					  if(data.marksBased == true) {
						  marks = parseInt(data[marksData.columnDefs[i].name]);
						  if(marks != null && passingMarks != null && marks < passingMarks) {
							  $scope.marksData.data[j].result = "FAIL";
						  }
					  } else {
						  grade = data[marksData.columnDefs[i].name];
						  if($scope.passingGrades.indexOf(grade) == -1) {
							  $scope.marksData.data[j].result = "FAIL";
						  }
					  }
				  }
			  }
		  }
	  };

	  $scope.displayedMarksCriteria = {};

	  $scope.getMarksData = function(selectedYear,selectedClass,selectedSection,selectedTestOrExam) {
		  var promise = adminService.getMarksData($routeParams.schoolId,selectedYear,selectedClass,selectedSection,selectedTestOrExam);
			promise.then(function(response) {
				$scope.marksData = response.body.marksData;
				$scope.marksData.enableCellEditOnFocus = true;
				$scope.updateColumnWidths();
				$scope.displayedMarksCriteria.selectedYear = selectedYear;
				$scope.displayedMarksCriteria.selectedClass = selectedClass;
				$scope.displayedMarksCriteria.selectedSection = selectedSection;
				$scope.displayedMarksCriteria.selectedTestOrExam = selectedTestOrExam;
			});
	  };

	  $scope.subjectDoesntExistInTableAlreadly = function(subject) {
		  for(var i = 0; i < $scope.marksData.columnDefs.length; i++) {
			  if( $scope.marksData.columnDefs[i].name == subject) {
				  return false;
			  }
		  }
		  return true;
	  };

	  $scope.marksData = { enableCellEditOnFocus: true };

	  $scope.marksData.columnDefs = [{ name: 'No_Data', displayName: 'No Data', width: '100%'}];

	  /*
	  $scope.marksData.columnDefs = [
	    { name: 'id', displayName: 'Roll no'},
	    { name: 'name', displayName: 'Name'}

	  ];*/

	  $scope.updateColumnWidths = function() {
		  var marksColSize = 90/$scope.marksData.columnDefs.length;
		  var size = Math.floor(marksColSize);
		  var remainingColSize = (90 - (Math.floor(marksColSize)*($scope.marksData.columnDefs.length)))
		  var nameColSize = 10 + remainingColSize;
		  for(var i = 0; i < $scope.marksData.columnDefs.length; i++) {
			  if($scope.marksData.columnDefs[i].name == "name") {
				  $scope.marksData.columnDefs[i].width = nameColSize.toString() + "%";
			  } else {
				  $scope.marksData.columnDefs[i].width = Math.floor(marksColSize).toString() + "%";
			  }
		  }
		  var obj = {};
		  obj.name = "result";
		  obj.displayName = "Result";
		  obj.width = size + "%";
		  $scope.marksData.columnDefs.push(obj);
	  }

	  //$scope.marksData.data = [{id:'1',name:'yatish'}];

	  $scope.marksData.data = [];

	  $scope.markAllPass = function() {
		  for(var i = 0; i < $scope.marksData.data.length; i++) {
			  if($scope.marksData.data[i].id && $scope.marksData.data[i].id != "") {
				  $scope.marksData.data[i].result = "PASS";
			  }
		  }
	  };
	  //$scope.markAllPass();

	  //adding empty rows to make sure, that there will  be no empty space after data rows
	  for(var i = 0; i < 18; i++) {
		  var obj = {};
		  if(i == 8) {
			  obj.No_Data = "Please Select the Year,  Class,  Section,  Test/Exam  in  dropdowns  present  above  the  table  and click  on  'Get Marks Sheet'  Button";
		  }
		  if(i == 10) {
			  obj.No_Data = "NOTE :   Once  you  click  on the  'Get Marks Sheet'  Button,  you   can  add  subjects  using  the  options  below";
		  }
		  $scope.marksData.data.push(obj);
	  }

	  $scope.msg = {};

	  $scope.marksData.onRegisterApi = function(gridApi){
	           //set gridApi on scope
	           $scope.gridApi = gridApi;
	           gridApi.edit.on.afterCellEdit($scope,function(rowEntity, colDef, newValue, oldValue){
	             $scope.msg.lastCellEdited = 'edited row id:' + rowEntity.id + ' Column:' + colDef.name + ' newValue:' + newValue + ' oldValue:' + oldValue ;
	             $scope.$apply();
	           });
	         };

	   /*$http.get('/data/500_complex.json')
	     .success(function(data) {
	       for(i = 0; i < data.length; i++){
	         data[i].registered = new Date(data[i].registered);
	         data[i].gender = data[i].gender==='male' ? 1 : 2;
	       }
	       $scope.marksData.data = data;
	     });*/
	 }])

	 .filter('mapGender', function() {
	   var genderHash = {
	     1: 'male',
	     2: 'female'
	   };

	   return function(input) {
	     if (!input){
	       return '';
	     } else {
	       return genderHash[input];
	     }
	   };
	 });


text:
using namespace llvm;
using namespace clang;

static void eatDiagnostics(const SMDiagnostic &, void *) {}

namespace clang {
namespace replace {

std::error_code collectReplacementsFromDirectory(
    const llvm::StringRef Directory, TUReplacements &TUs,
    TUReplacementFiles &TUFiles, clang::DiagnosticsEngine &Diagnostics) {
  using namespace llvm::sys::fs;
  using namespace llvm::sys::path;

  std::error_code ErrorCode;

  for (recursive_directory_iterator I(Directory, ErrorCode), E;
       I != E && !ErrorCode; I.increment(ErrorCode)) {
    if (filename(I->path())[0] == '.') {
      // Indicate not to descend into directories beginning with '.'
      I.no_push();
      continue;
    }

    if (extension(I->path()) != ".yaml")
      continue;

    TUFiles.push_back(I->path());

    ErrorOr<std::unique_ptr<MemoryBuffer>> Out =
        MemoryBuffer::getFile(I->path());
    if (std::error_code BufferError = Out.getError()) {
      errs() << "Error reading " << I->path() << ": " << BufferError.message()
             << "\n";
      continue;
    }

    yaml::Input YIn(Out.get()->getBuffer(), nullptr, &eatDiagnostics);
    tooling::TranslationUnitReplacements TU;
    YIn >> TU;
    if (YIn.error()) {
      // File doesn't appear to be a header change description. Ignore it.
      continue;
    }

    // Only keep files that properly parse.
    TUs.push_back(TU);
  }

  return ErrorCode;
}

std::error_code collectReplacementsFromDirectory(
    const llvm::StringRef Directory, TUDiagnostics &TUs,
    TUReplacementFiles &TUFiles, clang::DiagnosticsEngine &Diagnostics) {
  using namespace llvm::sys::fs;
  using namespace llvm::sys::path;

  std::error_code ErrorCode;

  for (recursive_directory_iterator I(Directory, ErrorCode), E;
       I != E && !ErrorCode; I.increment(ErrorCode)) {
    if (filename(I->path())[0] == '.') {
      // Indicate not to descend into directories beginning with '.'
      I.no_push();
      continue;
    }

    if (extension(I->path()) != ".yaml")
      continue;

    TUFiles.push_back(I->path());

    ErrorOr<std::unique_ptr<MemoryBuffer>> Out =
        MemoryBuffer::getFile(I->path());
    if (std::error_code BufferError = Out.getError()) {
      errs() << "Error reading " << I->path() << ": " << BufferError.message()
             << "\n";
      continue;
    }

    yaml::Input YIn(Out.get()->getBuffer(), nullptr, &eatDiagnostics);
    tooling::TranslationUnitDiagnostics TU;
    YIn >> TU;
    if (YIn.error()) {
      // File doesn't appear to be a header change description. Ignore it.
      continue;
    }

    // Only keep files that properly parse.
    TUs.push_back(TU);
  }

  return ErrorCode;
}

/// Extract replacements from collected TranslationUnitReplacements and
/// TranslationUnitDiagnostics and group them per file. Identical replacements
/// from diagnostics are deduplicated.
///
/// \param[in] TUs Collection of all found and deserialized
/// TranslationUnitReplacements.
/// \param[in] TUDs Collection of all found and deserialized
/// TranslationUnitDiagnostics.
/// \param[in] SM Used to deduplicate paths.
///
/// \returns A map mapping FileEntry to a set of Replacement targeting that
/// file.
static llvm::DenseMap<const FileEntry *, std::vector<tooling::Replacement>>
groupReplacements(const TUReplacements &TUs, const TUDiagnostics &TUDs,
                  const clang::SourceManager &SM) {
  std::set<StringRef> Warned;
  llvm::DenseMap<const FileEntry *, std::vector<tooling::Replacement>>
      GroupedReplacements;

  // Deduplicate identical replacements in diagnostics unless they are from the
  // same TU.
  // FIXME: Find an efficient way to deduplicate on diagnostics level.
  llvm::DenseMap<const FileEntry *,
                 std::map<tooling::Replacement,
                          const tooling::TranslationUnitDiagnostics *>>
      DiagReplacements;

  auto AddToGroup = [&](const tooling::Replacement &R,
                        const tooling::TranslationUnitDiagnostics *SourceTU) {
    // Use the file manager to deduplicate paths. FileEntries are
    // automatically canonicalized.
    if (auto Entry = SM.getFileManager().getFile(R.getFilePath())) {
      if (SourceTU) {
        auto &Replaces = DiagReplacements[*Entry];
        auto It = Replaces.find(R);
        if (It == Replaces.end())
          Replaces.emplace(R, SourceTU);
        else if (It->second != SourceTU)
          // This replacement is a duplicate of one suggested by another TU.
          return;
      }
      GroupedReplacements[*Entry].push_back(R);
    } else if (Warned.insert(R.getFilePath()).second) {
      errs() << "Described file '" << R.getFilePath()
             << "' doesn't exist. Ignoring...\n";
    }
  };

  for (const auto &TU : TUs)
    for (const tooling::Replacement &R : TU.Replacements)
      AddToGroup(R, nullptr);

  for (const auto &TU : TUDs)
    for (const auto &D : TU.Diagnostics)
      if (const auto *ChoosenFix = tooling::selectFirstFix(D)) {
        for (const auto &Fix : *ChoosenFix)
          for (const tooling::Replacement &R : Fix.second)
            AddToGroup(R, &TU);
      }

  // Sort replacements per file to keep consistent behavior when
  // clang-apply-replacements run on differents machine.
  for (auto &FileAndReplacements : GroupedReplacements) {
    llvm::sort(FileAndReplacements.second.begin(),
               FileAndReplacements.second.end());
  }

  return GroupedReplacements;
}

bool mergeAndDeduplicate(const TUReplacements &TUs, const TUDiagnostics &TUDs,
                         FileToChangesMap &FileChanges,
                         clang::SourceManager &SM) {
  auto GroupedReplacements = groupReplacements(TUs, TUDs, SM);
  bool ConflictDetected = false;

  // To report conflicting replacements on corresponding file, all replacements
  // are stored into 1 big AtomicChange.
  for (const auto &FileAndReplacements : GroupedReplacements) {
    const FileEntry *Entry = FileAndReplacements.first;
    const SourceLocation BeginLoc =
        SM.getLocForStartOfFile(SM.getOrCreateFileID(Entry, SrcMgr::C_User));
    tooling::AtomicChange FileChange(Entry->getName(), Entry->getName());
    for (const auto &R : FileAndReplacements.second) {
      llvm::Error Err =
          FileChange.replace(SM, BeginLoc.getLocWithOffset(R.getOffset()),
                             R.getLength(), R.getReplacementText());
      if (Err) {
        // FIXME: This will report conflicts by pair using a file+offset format
        // which is not so much human readable.
        // A first improvement could be to translate offset to line+col. For
        // this and without loosing error message some modifications around
        // `tooling::ReplacementError` are need (access to
        // `getReplacementErrString`).
        // A better strategy could be to add a pretty printer methods for
        // conflict reporting. Methods that could be parameterized to report a
        // conflict in different format, file+offset, file+line+col, or even
        // more human readable using VCS conflict markers.
        // For now, printing directly the error reported by `AtomicChange` is
        // the easiest solution.
        errs() << llvm::toString(std::move(Err)) << "\n";
        ConflictDetected = true;
      }
    }
    FileChanges.try_emplace(Entry,
                            std::vector<tooling::AtomicChange>{FileChange});
  }

  return !ConflictDetected;
}

llvm::Expected<std::string>
applyChanges(StringRef File, const std::vector<tooling::AtomicChange> &Changes,
             const tooling::ApplyChangesSpec &Spec,
             DiagnosticsEngine &Diagnostics) {
  FileManager Files((FileSystemOptions()));
  SourceManager SM(Diagnostics, Files);

  llvm::ErrorOr<std::unique_ptr<MemoryBuffer>> Buffer =
      SM.getFileManager().getBufferForFile(File);
  if (!Buffer)
    return errorCodeToError(Buffer.getError());
  return tooling::applyAtomicChanges(File, Buffer.get()->getBuffer(), Changes,
                                     Spec);
}

bool deleteReplacementFiles(const TUReplacementFiles &Files,
                            clang::DiagnosticsEngine &Diagnostics) {
  bool Success = true;
  for (const auto &Filename : Files) {
    std::error_code Error = llvm::sys::fs::remove(Filename);
    if (Error) {
      Success = false;
      // FIXME: Use Diagnostics for outputting errors.
      errs() << "Error deleting file: " << Filename << "\n";
      errs() << Error.message() << "\n";
      errs() << "Please delete the file manually\n";
    }
  }
  return Success;
}

} // end namespace replace
} // end namespace clang


text:
COMMAND=$@

HERE="`dirname \"$0\"`"             # relative
HERE="`( cd \"$HERE\" && pwd )`"    # absolutized and normalized
if [ -z "$HERE" ] ; then
  exit 1
fi

source "${HERE}/../ci/controller_utils.sh"

source ./tools/azure-pipelines/debug_files_utils.sh
prepare_debug_files "$AGENT_JOBNAME"
export FLINK_LOG_DIR="$DEBUG_FILES_OUTPUT_DIR/flink-logs"
mkdir $FLINK_LOG_DIR || { echo "FAILURE: cannot create log directory '${FLINK_LOG_DIR}'." ; exit 1; }
sudo apt-get install -y moreutils

REAL_START_SECONDS=$(date +"%s")
REAL_END_SECONDS=$(date -d "$SYSTEM_PIPELINESTARTTIME + $SYSTEM_JOBTIMEOUT minutes" +"%s")
REAL_TIMEOUT_SECONDS=$(($REAL_END_SECONDS - $REAL_START_SECONDS))
KILL_SECONDS_BEFORE_TIMEOUT=$((2 * 60))

echo "Running command '$COMMAND' with a timeout of $(($REAL_TIMEOUT_SECONDS / 60)) minutes."

MAIN_PID_FILE="/tmp/uploading_watchdog_main.pid"

function timeout_watchdog() {
  # 95%
  sleep $(($REAL_TIMEOUT_SECONDS * 95 / 100))
  echo "=========================================================================================="
  echo "=== WARNING: This task took already 95% of the available time budget of $((REAL_TIMEOUT_SECONDS / 60)) minutes ==="
  echo "=========================================================================================="
  print_stacktraces | tee "$DEBUG_FILES_OUTPUT_DIR/jps-traces.0"

  # final stack trace and kill processes 1 min before timeout
  local secondsToKill=$(($REAL_END_SECONDS - $(date +"%s") - $KILL_SECONDS_BEFORE_TIMEOUT))
  if [[ $secondsToKill -lt 0 ]]; then
    secondsToKill=0
  fi
  sleep ${secondsToKill}
  print_stacktraces | tee "$DEBUG_FILES_OUTPUT_DIR/jps-traces.1"

  echo "============================="
  echo "=== WARNING: Killing task ==="
  echo "============================="
  pkill -P $(<$MAIN_PID_FILE) # kill descendants
  kill $(<$MAIN_PID_FILE)     # kill process itself

  exit 42
}

timeout_watchdog &
WATCHDOG_PID=$!

# ts from moreutils prepends the time to each line
( $COMMAND & PID=$! ; echo $PID >$MAIN_PID_FILE ; wait $PID ) | ts | tee $DEBUG_FILES_OUTPUT_DIR/watchdog
TEST_EXIT_CODE=${PIPESTATUS[0]}

# successful execution, cleanup watchdog related things
if [[ "$TEST_EXIT_CODE" == 0 ]]; then
  kill $WATCHDOG_PID
  rm $DEBUG_FILES_OUTPUT_DIR/watchdog
  rm -f $DEBUG_FILES_OUTPUT_DIR/jps-traces.*
fi

# properly forward exit code
exit $TEST_EXIT_CODE


text:
<?php

namespace AppBundle\Controller;

use AppBundle\Entity\Newsletter;
use AppBundle\Form\NewsletterType;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;

class TemplateController extends Controller
{
    /**
     * @Route("/", name="accueil")
     */
    public function indexAction()
    {
        $listbienaccueils = $this->getDoctrine()
            ->getRepository('AppBundle:Annonce')
            ->findAll();

        $listactualiteaccueils = $this->getDoctrine()
            ->getRepository('AppBundle:Actualite')
            ->findAll();

      return $this->render('template/index.html.twig', array(
          'listbienaccueils' => $listbienaccueils,
          'listactualiteaccueils' => $listactualiteaccueils
      ));
    }

    /**
     * @Route("/contact", name="contact")
     */
    public function contactAction()
    {
        return $this->render('template/contact.html.twig', [
            'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR,
        ]);
    }

    /**
     * @Route("/mentions-legales", name="mentions-legales")
     */
    public function mentionsLegalesAction()
    {
        return $this->render('template/mentions-legales.html.twig', [
            'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR,
        ]);
    }

    /**
     * @Route("/faq", name="faq")
     */
    public function faqAction()
    {
        return $this->render('template/faq.html.twig', [
            'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR,
        ]);
    }

    /**
     * @Route("/decouvrirlyon", name="decouvrirlyon")
     */
    public function decouvrirlyonAction()
    {
        $annonces = $this->getDoctrine()
            ->getRepository('AppBundle:Annonce')
            ->findAll();

        return $this->render('template/decouvrirlyon.html.twig', array(
            'annonces' => $annonces
        ));
    }

    /**
     * @Route("/newsletter", name="newsletter")
     */
    public function newsLetterAction(Request $request)
    {

        $entity = new Newsletter();
        $form = $this->createForm(NewsletterType::class);

        if($request->isMethod('POST'))
        {
            $form->HandleRequest($request);
            if($form->isValid()){
                $em = $this->getDoctrine()->getManager();
                $em->persist($entity);
                $em->flush();

                return $this->redirect($this->generateUrl('accueil'));
            }
        }

        return $this->render('template/newsletter.html.twig', array(
            'form' => $form->createView()

        ));
    }

}


text:
"use strict";

const normalObj = {
    func1: function(){
        console.log('normal func1 - this', this);
        let func2 = function(){
            console.log('normal func2 - this', this);
        }
        func2();
        setTimeout(func2, 1000);
    }
};

normalObj.func1();

const arrowObj = {
    func1: () => {
        console.log('arrow func1 - this', this);
        let func2 = function(){
            console.log('arrow func2 - this', this);
        }
        func2();
        setTimeout(func2, 1000);
    }
};

arrowObj.func1();


text:
<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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>de.jpaw</groupId>
        <artifactId>six-base</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <relativePath>../six-base/pom.xml</relativePath>
    </parent>

    <artifactId>six-core</artifactId>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>de.jpaw</groupId>
            <artifactId>bonaparte-core</artifactId>
        </dependency>
        <dependency>
            <groupId>de.jpaw</groupId>
            <artifactId>bonaparte-api</artifactId>
        </dependency>
        <dependency>
            <groupId>de.jpaw</groupId>
            <artifactId>jdp-core</artifactId>
        </dependency>
        <dependency>
            <groupId>de.jpaw</groupId>
            <artifactId>bonaparte8-vertx3-auth</artifactId>
        </dependency>
        <dependency>
            <groupId>de.jpaw</groupId>
            <artifactId>bonaparte8-vertx3</artifactId>
        </dependency>
        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-core</artifactId>
            <version>${vertx3.version}</version>
        </dependency>
        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-auth-jwt</artifactId>
            <version>${vertx3.version}</version>
        </dependency>
        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-web</artifactId>
            <version>${vertx3.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.xtend</groupId>
            <artifactId>org.eclipse.xtend.lib</artifactId>
            <version>${xtend.version}</version>
        </dependency>
        <dependency>
            <groupId>de.jpaw</groupId>
            <artifactId>jpaw-xenum-init</artifactId>
        </dependency>

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${logback.version}</version>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-unit</artifactId>
            <version>${vertx3.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>


text:
function newState = videoIsDocked(varargin)
	p = inputParser;
	addOptional(p, 'oldState', true);
	addOptional(p, 'action', struct('type', ''));
	p.StructExpand = false;
	parse(p, varargin{:});

	switch(p.Results.action.type)
		case 'TOGGLE_DOCK'
			newState = ~p.Results.oldState;
		otherwise
			newState = p.Results.oldState;
	end
end


text:
<?php

/**
 * @file
 * Contains \Drupal\node\Tests\NodeLoadMultipleTest.
 */

namespace Drupal\node\Tests;

use Drupal\node\Entity\Node;

/**
 * Tests the loading of multiple nodes.
 *
 * @group node
 */
class NodeLoadMultipleTest extends NodeTestBase {

  /**
   * Enable Views to test the frontpage against Node::loadMultiple() results.
   *
   * @var array
   */
  public static $modules = array('views');

  protected function setUp() {
    parent::setUp();
    $web_user = $this->drupalCreateUser(array('create article content', 'create page content'));
    $this->drupalLogin($web_user);
  }

  /**
   * Creates four nodes and ensures that they are loaded correctly.
   */
  function testNodeMultipleLoad() {
    $node1 = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1));
    $node2 = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1));
    $node3 = $this->drupalCreateNode(array('type' => 'article', 'promote' => 0));
    $node4 = $this->drupalCreateNode(array('type' => 'page', 'promote' => 0));

    // Confirm that promoted nodes appear in the default node listing.
    $this->drupalGet('node');
    $this->assertText($node1->label(), 'Node title appears on the default listing.');
    $this->assertText($node2->label(), 'Node title appears on the default listing.');
    $this->assertNoText($node3->label(), 'Node title does not appear in the default listing.');
    $this->assertNoText($node4->label(), 'Node title does not appear in the default listing.');

    // Load nodes with only a condition. Nodes 3 and 4 will be loaded.
    $nodes = entity_load_multiple_by_properties('node', array('promote' => 0));
    $this->assertEqual($node3->label(), $nodes[$node3->id()]->label(), 'Node was loaded.');
    $this->assertEqual($node4->label(), $nodes[$node4->id()]->label(), 'Node was loaded.');
    $count = count($nodes);
    $this->assertTrue($count == 2, format_string('@count nodes loaded.', array('@count' => $count)));

    // Load nodes by nid. Nodes 1, 2 and 4 will be loaded.
    $nodes = Node::loadMultiple(array(1, 2, 4));
    $count = count($nodes);
    $this->assertTrue(count($nodes) == 3, format_string('@count nodes loaded', array('@count' => $count)));
    $this->assertTrue(isset($nodes[$node1->id()]), 'Node is correctly keyed in the array');
    $this->assertTrue(isset($nodes[$node2->id()]), 'Node is correctly keyed in the array');
    $this->assertTrue(isset($nodes[$node4->id()]), 'Node is correctly keyed in the array');
    foreach ($nodes as $node) {
      $this->assertTrue(is_object($node), 'Node is an object');
    }
  }
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Trans. Br. mycol. Soc. 58(1): 77 (1972)

#### Original name
Sphaeria phaeostroma Durieu & Mont., 1846

### Remarks
null


text:
"""
@author: Disa Mhembere
@organization: Johns Hopkins University
@contact: disa@jhu.edu

@summary: A module to synchronize alter the mysql database backend as neccessary
"""

from subprocess import call
import MySQLdb
import os
import argparse
from ocpipeline.settings_secret import DATABASES

def manageMRDjango(alter=False):

  manageFn =  os.path.join(os.path.abspath('.'),'manage.py')
  call( ['python', manageFn, 'syncdb'] ) # sync the DB

  if alter:
    db = MySQLdb.connect(host = 'localhost',
                           user = DATABASES['default']['USER'],
                           passwd = DATABASES['default']['PASSWORD'],
                           db = DATABASES['default']['NAME'])

    cur = db.cursor()
    cur.execute("ALTER TABLE ocpipeline_ownedprojects ADD UNIQUE INDEX(project_name, owner_id);")
    db.close() # close connection

def main():
  parser = argparse.ArgumentParser(description='Run the python database synchronizer with some extra flags if necessary')
  parser.add_argument('--alter', '-a', action='store_true', help='use this flag if you want to alter the tables for referencial integrity etc. Only necessary once')

  result = parser.parse_args()
  manageMRDjango(result.alter)

if __name__ == '__main__':
  main()


text:
define([
	"dojo/_base/lang",
	"dojo/_base/declare",
	"dojo/sniff",
	"../util/misc",
	"xstyle/css!../css/extensions/CompoundColumns.css"
], function(lang, declare, has, miscUtil){
	return declare(null, {
		// summary:
		//		Extension allowing for specification of columns with additional
		//		header rows spanning multiple columns for strictly display purposes.
		//		Only works on `columns` arrays, not `columns` objects or `subRows`
		//		(nor ColumnSets).
		// description:
		//		CompoundColumns allows nested header cell configurations, wherein the
		//		higher-level headers may span multiple columns and are for
		//		display purposes only.
		//		These nested header cells are configured using a special recursive
		//		`children` property in the column definition, where only the deepest
		//		children are ultimately rendered in the grid as actual columns.
		//		In addition, the deepest child columns may be rendered without
		//		individual headers by specifying `showChildHeaders: false` on the parent.

		configStructure: function(){
			// create a set of sub rows for the header row so we can do compound columns
			// the first row is a special spacer row
			var columns = (this.subRows && this.subRows[0]) || this.columns,
				headerRows = [[]],
				topHeaderRow = headerRows[0],
				contentColumns = [];
			// This first row is spacer row that will be made invisible (zero height)
			// with CSS, but it must be rendered as the first row since that is what
			// the table layout is driven by.
			headerRows[0].className = "dgrid-spacer-row";

			function processColumns(columns, level, hasLabel, parent){
				var numColumns = 0,
					noop = function(){},
					children,
					hasChildLabels;

				function processColumn(column, i){
					// Handle the column config when it is an object rather
					// than an array.
					if(typeof column === "string"){
						column = {label: column};
					}
					if(!(columns instanceof Array) && !column.field){
						column.field = i;
					}
					children = column.children;
					hasChildLabels = children && (column.showChildHeaders !== false);
					// Set a reference to the parent column so later the children's ids can
					// be updated to indicate the parent-child relationship.
					column.parentColumn = parent;
					if(children){
						// it has children
						// make sure the column has an id
						if(column.id == null){
							column.id = ((parent && parent.id) || level-1) + "-" + topHeaderRow.length;
						}else if(parent && parent.id){
							// Make sure nested compound columns have ids that are prefixed with
							// their parent's ids.
							column.id = parent.id + "-" + column.id;
						}
					}else{
						// it has no children, it is a normal header, add it to the content columns
						contentColumns.push(column);
						// add each one to the first spacer header row for proper layout of the header cells
						topHeaderRow.push(lang.delegate(column, {renderHeaderCell: noop}));
						numColumns++;
					}
					if(!hasChildLabels){
						// create a header version of the column where we can define a specific rowSpan
						// we define the rowSpan as a negative, the number of levels less than the total number of rows, which we don't know yet
						column = lang.delegate(column, {rowSpan: -level});
					}

					if(children){
						// Recursively process the children; this is specifically
						// performed *after* any potential lang.delegate calls
						// so the parent reference will receive additional info
						numColumns += (column.colSpan =
							processColumns(children, level + 1, hasChildLabels, column));
					}

					// add the column to the header rows at the appropriate level
					if(hasLabel){
						(headerRows[level] || (headerRows[level] = [])).push(column);
					}
				}

				miscUtil.each(columns, processColumn, this);
				return numColumns;
			}

			processColumns(columns, 1, true);

			var numHeaderRows = headerRows.length,
				i, j, headerRow, headerColumn;
			// Now go back through and increase the rowSpans of the headers to be
			// total rows minus the number of levels they are at.
			for(i = 0; i < numHeaderRows; i++){
				headerRow = headerRows[i];
				for(j = 0; j < headerRow.length; j++){
					headerColumn = headerRow[j];
					if(headerColumn.rowSpan < 1){
						headerColumn.rowSpan += numHeaderRows;
					}
				}
			}
			// we need to set this to be used for subRows, so we make it a single row
			contentColumns = [contentColumns];
			// set our header rows so that the grid will use the alternate header row
			// configuration for rendering the headers
			contentColumns.headerRows = headerRows;
			this.subRows = contentColumns;
			this.inherited(arguments);
		},

		renderHeader: function(){
			var i,
				columns = this.subRows[0],
				headerColumns = this.subRows.headerRows[0];

			this.inherited(arguments);

			// The object delegation performed in configStructure unfortunately
			// "protects" the original column definition objects (referenced by
			// columns and subRows) from obtaining headerNode information, so
			// copy them back in.
			for(i = columns.length; i--;){
				columns[i].headerNode = headerColumns[i].headerNode;
			}
		},

		_configColumn: function(column, columnId, rowColumns, prefix){
			// Updates the id on a column definition that is a child to include
			// the parent's id.
			var parent = column.parentColumn;
			if(parent){
				// Adjust the id to incorporate the parent's id.
				// Remove the prefix if it was used to create the id
				var id = columnId.indexOf(prefix) === 0 ? columnId.substring(prefix.length) : columnId;
				prefix = parent.id + "-";
				columnId = column.id = prefix + id;
			}
			this.inherited(arguments, [column, columnId, rowColumns, prefix]);
		},

		cell: function(target, columnId){
			// summary:
			//		Get the cell object by node, event, or id, plus a columnId.
			//		This extension prefixes children's column ids with the parents' column ids,
			//		so cell takes that into account when looking for a column id.

			if(typeof columnId != "object"){
				// Find the columnId that corresponds with the provided id.
				// The provided id may be a suffix of the actual id.
				var column = this.column(columnId);
				if(column){
					columnId = column.id;
				}
			}
			return this.inherited(arguments, [target, columnId]);
		},

		column: function(target){
			// summary:
			//		Get the column object by node, event, or column id.  Take into account parent column id
			//		prefixes that may be added by this extension.
			var results = this.inherited(arguments);
			if(results == null && typeof target != "object"){
				// Find a column id that ends with the provided column id.  This will locate a child column
				// by an id that was provided in the original column configuration.  For example, if a compound column
				// was given the id "compound" and a child column was given the id "child", this will find the column
				// using only "child".  If "compound-child" was being searched for, the inherited call
				// above would have found the cell.
				var suffix = "-" + target,
					suffixLength = suffix.length;
				for(var completeId in this.columns){
					if(completeId.indexOf(suffix, completeId.length - suffixLength) !== -1){
						return this.columns[completeId];
					}
				}
			}
			return results;
		},

		_updateCompoundHiddenStates: function(id, hidden){
			// summary:
			//		Called from _hideColumn and _showColumn (for ColumnHider)
			//		to adjust parent header cells

			var column = this.columns[id],
				colSpan;

			if(column && column.hidden == hidden){
				// Avoid redundant processing (since it would cause colSpan skew)
				return;
			}

			// column will be undefined when this is called for parents
			while(column && column.parentColumn){
				// Update colSpans / hidden state of parents
				column = column.parentColumn;
				colSpan = column.colSpan = column.colSpan + (hidden ? -1 : 1);

				if(colSpan){
					column.headerNode.colSpan = colSpan;
				}
				if(colSpan === 1 && !hidden){
					this._showColumn(column.id);
				}else if(!colSpan && hidden){
					this._hideColumn(column.id);
				}
			}
		},

		_hideColumn: function(id){
			var self = this;

			this._updateCompoundHiddenStates(id, true);
			this.inherited(arguments);

			if(has("ff")){
				// Firefox causes display quirks in certain situations;
				// avoid them by forcing reflow of the header
				this.headerNode.style.display = "none";
				setTimeout(function(){
					self.headerNode.style.display = "";
					self.resize();
				}, 0);
			}
		},

		_showColumn: function(id){
			this._updateCompoundHiddenStates(id, false);
			this.inherited(arguments);
		},

		_getResizedColumnWidths: function(){
			// Overrides ColumnResizer method to report the total width and
			// last column correctly for CompoundColumns structures

			var total = 0,
				columns = this.columns,
				id;

			for(id in columns){
				total += columns[id].headerNode.offsetWidth;
			}

			return {
				totalWidth: total,
				lastColId: this.subRows[0][this.subRows[0].length - 1].id
			};
		}
	});
});


text:
if ( x ) {
}
// Instead of
if ( x )
{
}

//===========================================================================//
// The else statement starts on the same line as the last closing brace.
//---------------------------------------------------------------------------//
if ( x ) {
} else {
}

//===========================================================================//
// Pad parenthesized expressions with spaces
//---------------------------------------------------------------------------//
if ( x ) {
}
// Instead of
if (x) {
}
// And
x = ( y * 0.5f );
// Instead of
x = (y * 0.5f);

//===========================================================================//
// Use precision specification for floating point values unless there is
// an explicit need for a double.
//---------------------------------------------------------------------------//
float f = 0.5f;
// Instead of
float f = 0.5;
// And
float f = 1.0f;
// Instead of
float f = 1.f;

//===========================================================================//
// The standard header for functions is like in this document.
// Function names start with an upper case.
//---------------------------------------------------------------------------//
void Function( void );
// In multi-word function names each word starts with an upper case:
void ThisFunctionDoesSomething( void );

//===========================================================================//
// Variable names start with a lower case character.
//---------------------------------------------------------------------------//
float x;
// In multi-word variable names are camelCase
float maxDistanceFromPlane;

//===========================================================================//
// Typedef names use the same naming convention as variables, however
// they always end with "_t".
//---------------------------------------------------------------------------//
typedef int fileHandle_t;

//===========================================================================//
// Struct names use the same naming convention as variables, however
// they always end with "_t".
//---------------------------------------------------------------------------//
struct renderEntity_t;

//===========================================================================//
// Enum names use the same naming convention as variables, however
// they always end with "_t".
// The enum constants use all upper case characters,
// multiple words are separated with an underscore.
//---------------------------------------------------------------------------//
enum contact_t {
    CONTACT_NONE,
    CONTACT_EDGE,
    CONTACT_MODELVERTEX,
    CONTACT_TRMVERTEX
};

//===========================================================================//
// Names of recursive functions end with "_r"
//---------------------------------------------------------------------------//
void WalkBSP_r( int node );

//===========================================================================//
// #define names use all upper case characters.
// Multiple words are separated with an underscore.
//---------------------------------------------------------------------------//
#define SIDE_FRONT 0

//===========================================================================//
// Use const as much as possible.
//---------------------------------------------------------------------------//
// Use:
const int *p; // pointer to const int
int * const p; // const pointer to int
const int * const p; // const pointer to const int
// Don't use:
int const *p;

//===========================================================================//
// File names are lowercase with underscores
//---------------------------------------------------------------------------//
vertex_shader.h
vertex_shader.c