text:
/*
	References the root element of the page, typically the HTML tag;
	I use ':root' instead of 'html' for CSS variable declarations, so they can
	apply to any descendant of the root tag. I use 'html' when I want to apply styles
	specifically to the 'html' tag
*/

:root {
	/* this is how you define css variables */
	--primary-application-color: #CC5647;
	--primary-application-background-color: #FAFAFA;
	--secondary-application-background-color: white;

	--application-border-color: #F4F4F4;

	/* context tabs */
	--context-tab-text: #BABABA;
	--context-tab-text-selected: #7C7C7C;
	--context-tab-border: #E8E8E8;
	--context-tab-border-selected: #9A9A9A;

	/* icons */
	--application-primary-icon-color: #5C5C5C;

	/* text styles */
	--heading-text-color: #414343;
	--content-text-color: #9E9E9E;
	--primary-app-font: 'Raleway', sans-serif;
	--secondary-app-font: 'Khula', sans-serif;

	/* project item colors */
	--project-color-red: #ed8d75;
	--project-color-gray: #cccccc;
	--project-color-blue: #adc8e1;
	--project-color-teal: #8fe5d3;
	--project-color-purple: #daabe0;

	/* search bar */
	--search-bar-initial-color: #E6B9B6;
}

/* vw = view width, vh = view height; both depend on the viewport */

html, body {
	width: 100vw;
	height: 100vh;
	background-color: var(--primary-application-background-color);
}

/* APPLICATION MENU BAR */

.menubar {
	width: 100%;
	height: 50px;

	/* this is how you use CSS variables */
	background-color: var(--primary-application-color);
}

/* UI CONTAINERS */
.app-ui-container {
	height: 100%;
	width: 63.5%;

	display: block;
	margin: 0 auto;

	/* we want to move the containers up so that the controls display in the menu-bar */
	margin-top: -50px;
}

/* common styles are extracted into their own CSS classes and applied to all common UI elements */
.app-half {
	float: left;
}

.app-ui-left {
	height: 100%;
	width: 27.8%;
}

.app-ui-right {
	/*
		You can have css dynamically calculate values for things like width; we're doing this so the right-half doesn't
		overflow; it will have 1px borders on the left and right; 70% width + 2 pixels will make it overflow since ui-left is 30%
	*/
	width: 72.2%;
	height: 100%;
}

/* APPLICATION LEFT-HALF */

.app-logo-container {
	width: 100%;
	height: 50px;
	cursor: pointer;
}

.app-logo {
	width: 25px; /* square images typically only need to be scaled in one direction, the other will follow to maintain aspect-ratio */
	margin-top: 12.5px;
}

.app-groups-container {
	height: calc(100% - 50px);
	width: 100%;
}

/* APPLICATION RIGHT-HALF */

.app-controls-container {
	width: 100%;
	height: 50px;
	display: inline-block;
}

.app-todo-list-container {
	width: calc(100% - 2px); /* CSS can perform dynamic calculations like this */
	min-height: calc(100% - 50px);
	background-color: var(--secondary-application-background-color);
	border-left: 1px solid var(--application-border-color);
	border-right: 1px solid var(--application-border-color);
	padding-top: 30px;
}

.time-groups-container {
	width: 100%;
	display: inline-block;
	margin-top: 30px;
}

.time-group {
	width: calc(92.5% - 6px);
	padding: 10px 3px;
	clear: both;
	display: inline-block;

	cursor: pointer;

	transition: background-color 0.2s ease;
	-webkit-transition: background-color 0.2s ease;
}

.time-group:hover {
	background-color: var(--secondary-application-background-color);
}

.time-group-selected {
	background-color: var(--secondary-application-background-color);;
}

.time-group-content {
	float: left;
}

.time-group-icon {
	width: 20px;
	margin-right: 15px;
}

.time-group-text {
	font-family: var(--primary-app-font);
	color: var(--title-text-color);

	margin-top: 5px;
	font-size: 85%;
}

.time-group-text-selected {
	font-weight: 600;
}

.context-groups-container {
	width: 92.5%;
	display: inline-block;
	margin-top: 25px;
}

.context-tabs-container {
	width: 100%;
	display: inline-block;
}

.context-tab {
	float: left;
	cursor: pointer;

	padding: 3px 5px;
	width: calc(33.3% - 10px);

	border-bottom: 2px solid var(--context-tab-border);
	color: var(--context-tab-text);

	font-family: var(--secondary-app-font);
	text-align: center;
	font-size: 80%;
}

.context-tab:hover {
	color: var(--context-tab-text-selected);
}

.context-tab-selected {
	color: var(--context-tab-text-selected);
	border-bottom: 2px solid var(--context-tab-border-selected);
	font-weight: bold;
}

.context-tab-content {
	display: inline-block;
	width: 92.5%;
	margin-top: 25px;
}

.context-tab-content-hidden {
	display: none;
}

.project-item {
	width: 115%;
	margin-left: -15px;
	display: inline-block;
	clear: both;
	cursor: pointer;
}

.project-item:hover .project-item-content {
	background-color: var(--secondary-application-background-color);
}

.project-item:hover .drag-button {
	opacity: 0.8;
}

.project-item:hover .project-item-drop-down-button {
	opacity: 0.5;
}

.drag-button {
	float: left;
	width: 6px;
	margin-right: 5px;
	margin-top: 7px;
	cursor: move;

	opacity: 0;
	transition: opacity 0.3s ease;
	-webkit-transition: opacity 0.3s ease;
}

.project-item-content {
	float: left;
	width: calc(100% - 21px);
	padding: 10px 5px;

	transition: background-color 0.3s ease;
	-webkit-transition: background-color 0.3s ease;
}

.project-item-content-selected {
	background-color: var(--secondary-application-background-color);
}

.project-item-icon {
	width: 11px;
	height: 11px;
	background-color: var(--project-color-red);
	border-radius: 100%;
	margin-right: 15px;
	margin-top: -1px;

	float: left;
}

.project-item-title {
	float: left;
	font-family: var(--secondary-app-font);
	color: var(--context-tab-selected);
	margin-right: 5px;
	font-size: 90%;

}

.project-item-title-selected {
	font-weight: 600;
	color: var(--title-text-color);
}

.project-item-number {
	float: left;
	font-family: var(--secondary-app-font);
	color: var(--content-text-color);

	font-size: 60%;
	margin-top: 2px;
}

.project-item-drop-down-button {
	float: right;
	width: 12px;
	cursor: pointer;
	opacity: 0;

	transition: opacity 0.3s ease;
	-webkit-transition: opacity 0.3s ease;
}

.project-item-drop-down-button:hover {
	opacity: 1 !important;
}

.add-project-container {
	display: inline-block;
	padding: 10px 5px;
	cursor: pointer;
	margin-left: -3px;
}

.add-project-container:hover .add-project-text {
	text-decoration: underline;
}

.add-project-icon {
	width: 11px;
	float: left;
	margin-right: 15px;
}

.add-project-text {
	color: var(--primary-application-color);
	font-family: var(--primary-app-font);
	float: left;
	font-size: 90%;
}

.archived-projects-text {
	font-family: var(--secondary-app-font);
	color: var(--content-text-color);
	margin-top: 35px;
	cursor: pointer;
	font-size: 90%;
    font-weight: lighter;
}

.archived-projects-text:hover {
	text-decoration: underline;
}

/* APPLICATION CONTROLS */

.search-bar-container {
	position: absolute;
	float: left;
	background-color: transparent;
	cursor: text;
	border-radius: 3px;
	height: 35px;
	margin-top: 7px;

	width: 260px;
	margin-left: 50;

	clear: both;

	z-index: 100;

	transition: width 0.5s ease, background-color 0.5s ease;
	-webkit-transition: width 0.5s ease, background-color 0.5s ease;
}

.search-bar-container:hover {
	background-color: rgba(255, 255, 255, 0.3);
}

.search-icon {
	float: left;
	width: 20px;
	margin-top: 8px;
	margin-left: 10px;
}

.search-bar {
	float: left;
	background-color: transparent;

	height: 100%;
	width: calc(100% - 50px);
	padding-left: 5px;

	border: none;
	outline: none;

	font-family: var(--secondary-app-font);
	color: var(--search-bar-initial-color);
	font-weight: lighter;
	font-size: 100%;

	transition: color 1s ease;
	-webkit-transition: color 1s ease;
}

.search-bar::placeholder {
	color: var(--search-bar-initial-color);
	font-weight: lighter;
}

.control-buttons-container {
	display: inline-block;
	height: 100%;
	float: right;

	z-index: 50;
}

.control-button {
	width: 16px;
    margin-top: 18px;
    cursor: pointer;
    float: right;
    margin-right: 40px;
}

.productivity-container {
	float: right;
	display: inline-block;
	height: 100%;
	margin-right: 30px;
}

.productivity-button {
	float: right;
	margin-right: 3px;
}

.productivity-arrow {
	width: 8px;
	float: right;
	margin-top: 20px;
	margin-right: 3px;
}

.productivity-number {
	float: right;
	font-family: var(--secondary-app-font);
	color: white;
	font-size: 80%;
	margin-top: 21px;
}

.settings-button {
	margin-right: 7px;
}

/* RIGHT HALF OF THE APP, MAIN CONTENT AREA */

.todo-list-content-container {
	display: none !important;

	width: 90%;
	display: block;
	margin: 0 auto;

	padding: 10px 3px;
}

.todo-list-content-container-selected {
	display: block !important;
}

.todo-title-icons-container {
	width: 100%;
	display: inline-block;
}

.todo-title {
	font-family: var(--secondary-app-font);
	color: var(--title-text-color);
	font-size: 130%;
	line-height: 10px;
	display: inline-block;
	border-bottom: 1.5px solid transparent;

	cursor: pointer;
}

.todo-title:hover {
	border-bottom-color: var(--title-text-color);
}

.todo-title-no-hover {
	cursor: text;
}

.todo-title-no-hover:hover {
	border-bottom-color: transparent !important;
}

.todo-date-text {
	display: inline;
	font-family: var(--secondary-app-font);
	color: var(--content-text-color);
	font-weight: lighter;
    font-size: 75%;
    margin-left: 3px;
}

.todo-content-button {
	float: right;
	width: 15px;
	cursor: pointer;

	opacity: 0.35;
}

.todo-content-button:hover {
	opacity: 1;
}

.project-comments-button {
	margin-right: 30px;
}

.share-options-button {
	margin-right: 30px;
}

.add-todo-container {
	width: 100%;
	display: inline-block;
	margin-top: 22px;
}

.add-todo-container:hover .add-todo-button {
	opacity: 1;
}

.seven-days-container {
	margin-top: 45px;
}

.add-todo-button {
	display: inline-block;
	cursor: pointer;
	margin-left: 3px;
}

.add-todo-button:hover .add-todo-text {
	text-decoration: underline;
}

.add-todo-icon {
	width: 11px;
	margin-right: 15px;
	float: left;
}

.add-todo-text {
	color: var(--primary-application-color);
	font-family: var(--secondary-app-font);
	float: left;
	font-weight: lighter;
    font-size: 90%;
    margin-top: 3px;
}

.show-archived-button {
	cursor: pointer;
	width: 15px;
	opacity: 0.35;
	float: right;
}

.show-archived-button:hover {
	opacity: 1;
}

.no-tasks-container {
	width: 100%;
	display: inline-block;
	margin-top: 30px;
	text-align: center;
}

.no-tasks-image {
	width: 38%;
	margin-bottom: 15px;
}

.no-tasks-title {
	font-family: var(--secondary-app-font);
	color: var(--title-text-color);
	font-size: 140%;
    margin-bottom: 15px;
}

.no-tasks-subtitle {
	font-family: var(--secondary-app-font);
	color: var(--title-text-color);
}

.day-section-container {
	width: 100%;
	display: inline-block;
}

.day-section-title {
	font-family: var(--secondary-app-font);
	color: var(--title-text-color);
	font-size: 90%;
	font-weight: 600;
	cursor: pointer;
	display: inline-block;
}

.day-section-title:hover {
	text-decoration: underline;
}

.day-section-divider {
	opacity: 0.3;
}

.unimplementedTabText {
	text-align: center;
	color: var(--content-text-color);
	font-family: var(--secondary-app-font);
}

/* POPOVER STYLINGS */

.popover-container {
	display: none;
	opacity: 0;

	position: absolute;

	transition: opacity 0.2s ease;
	-webkit-transition: opacity 0.2s ease
}

.popover-content {
	background-color: #333333;
	padding: 8px 12px;
	border-radius: 3px;
}

.popover-title {
	font-family: var(--secondary-app-font);
	color: #f7f6f7;
	font-size: 78%;
}

.popover-subtitle {
	font-family: var(--secondary-app-font);
	color: #f7f6f7;
	font-size: 78%;
    margin-top: 2px;
    font-weight: lighter;
}

.popover-triangle {
	width: 0;
	height: 0;
	border-left: 7px solid transparent;
	border-right: 7px solid transparent;
	border-bottom: 7px solid #333333;

	margin-bottom: -2px;
	margin-left: 12px;
}

/* special style for any item that needs to be translucent until hovered over */

.translucency-hover {
	opacity: 0.5;

	transition: opacity 0.3s ease;
	-webkit-transition: opacity 0.3s ease;
}

.translucency-hover:hover {
	opacity: 1;
}


text:
<!doctype html>

  <meta charset="utf-8">

  <title>fluid</title>

basic

redpajama_set_name: RedPajamaGithub


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

Imports System.Globalization
Imports System.Runtime.InteropServices

Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
    Friend NotInheritable Class GeneratedNameParser
        Friend Shared Function GetKind(name As String) As GeneratedNameKind
            If name.StartsWith(GeneratedNameConstants.HoistedMeName, StringComparison.Ordinal) Then
                Return GeneratedNameKind.HoistedMeField
            ElseIf name.StartsWith(GeneratedNameConstants.StateMachineStateFieldName, StringComparison.Ordinal) Then
                Return GeneratedNameKind.StateMachineStateField
            ElseIf name.StartsWith(GeneratedNameConstants.StaticLocalFieldNamePrefix, StringComparison.Ordinal) Then
                Return GeneratedNameKind.StaticLocalField
            ElseIf name.StartsWith(GeneratedNameConstants.HoistedSynthesizedLocalPrefix, StringComparison.Ordinal) Then
                Return GeneratedNameKind.HoistedSynthesizedLocalField
            ElseIf name.StartsWith(GeneratedNameConstants.HoistedUserVariablePrefix, StringComparison.Ordinal) Then
                Return GeneratedNameKind.HoistedUserVariableField
            ElseIf name.StartsWith(GeneratedNameConstants.IteratorCurrentFieldName, StringComparison.Ordinal) Then
                Return GeneratedNameKind.IteratorCurrentField
            ElseIf name.StartsWith(GeneratedNameConstants.IteratorInitialThreadIdName, StringComparison.Ordinal) Then
                Return GeneratedNameKind.IteratorInitialThreadIdField
            ElseIf name.StartsWith(GeneratedNameConstants.IteratorParameterProxyPrefix, StringComparison.Ordinal) Then
                Return GeneratedNameKind.IteratorParameterProxyField
            ElseIf name.StartsWith(GeneratedNameConstants.StateMachineAwaiterFieldPrefix, StringComparison.Ordinal) Then
                Return GeneratedNameKind.StateMachineAwaiterField
            ElseIf name.StartsWith(GeneratedNameConstants.HoistedWithLocalPrefix, StringComparison.Ordinal) Then
                Return GeneratedNameKind.HoistedWithLocalPrefix
            ElseIf name.StartsWith(GeneratedNameConstants.StateMachineHoistedUserVariableOrDisplayClassPrefix, StringComparison.Ordinal) Then
                Return GeneratedNameKind.StateMachineHoistedUserVariableOrDisplayClassField
            ElseIf name.StartsWith(GeneratedNameConstants.AnonymousTypeTemplateNamePrefix, StringComparison.Ordinal) Then
                Return GeneratedNameKind.AnonymousType
            ElseIf name.StartsWith(GeneratedNameConstants.DisplayClassPrefix, StringComparison.Ordinal) Then
                Return GeneratedNameKind.LambdaDisplayClass
            ElseIf name.Equals(GeneratedNameConstants.It, StringComparison.Ordinal) OrElse
                    name.Equals(GeneratedNameConstants.It1, StringComparison.Ordinal) OrElse
                    name.Equals(GeneratedNameConstants.It2, StringComparison.Ordinal) Then
                Return GeneratedNameKind.TransparentIdentifier
            ElseIf name.Equals(GeneratedNameConstants.ItAnonymous, StringComparison.Ordinal) Then
                ' We distinguish GeneratedNameConstants.ItAnonymous, because it won't be an instance
                ' of an anonymous type.
                Return GeneratedNameKind.AnonymousTransparentIdentifier
            End If

            Return GeneratedNameKind.None
        End Function

        Public Shared Function TryParseStateMachineTypeName(stateMachineTypeName As String, <Out> ByRef methodName As String) As Boolean
            If Not stateMachineTypeName.StartsWith(GeneratedNameConstants.StateMachineTypeNamePrefix, StringComparison.Ordinal) Then
                Return False
            End If

            Dim prefixLength As Integer = GeneratedNameConstants.StateMachineTypeNamePrefix.Length
            Dim separatorPos = stateMachineTypeName.IndexOf(GeneratedNameConstants.MethodNameSeparator, prefixLength)
            If separatorPos < 0 OrElse separatorPos = stateMachineTypeName.Length - 1 Then
                Return False
            End If

            methodName = stateMachineTypeName.Substring(separatorPos + 1)
            Return True
        End Function

        ''' <summary>
        ''' Try to parse the local (or parameter) name and return <paramref name="variableName"/> if successful.
        ''' </summary>
        Public Shared Function TryParseHoistedUserVariableName(proxyName As String, <Out> ByRef variableName As String) As Boolean
            variableName = Nothing

            Dim prefixLen As Integer = GeneratedNameConstants.HoistedUserVariablePrefix.Length
            If proxyName.Length <= prefixLen Then
                Return False
            End If

            ' All names should start with "$VB$Local_"
            If Not proxyName.StartsWith(GeneratedNameConstants.HoistedUserVariablePrefix, StringComparison.Ordinal) Then
                Return False
            End If

            variableName = proxyName.Substring(prefixLen)
            Return True
        End Function

        ''' <summary>
        ''' Try to parse the local name and return <paramref name="variableName"/> and <paramref name="index"/> if successful.
        ''' </summary>
        Public Shared Function TryParseStateMachineHoistedUserVariableOrDisplayClassName(proxyName As String, <Out> ByRef variableName As String, <Out()> ByRef index As Integer) As Boolean
            variableName = Nothing
            index = 0

            ' All names should start with "$VB$ResumableLocal_"
            If Not proxyName.StartsWith(GeneratedNameConstants.StateMachineHoistedUserVariableOrDisplayClassPrefix, StringComparison.Ordinal) Then
                Return False
            End If

            Dim prefixLen As Integer = GeneratedNameConstants.StateMachineHoistedUserVariableOrDisplayClassPrefix.Length
            Dim separator As Integer = proxyName.LastIndexOf("$"c)
            If separator <= prefixLen Then
                Return False
            End If

            variableName = proxyName.Substring(prefixLen, separator - prefixLen)
            Return Integer.TryParse(proxyName.Substring(separator + 1), NumberStyles.None, CultureInfo.InvariantCulture, index)
        End Function

        Friend Shared Function TryParseStaticLocalFieldName(
            fieldName As String,
            <Out> ByRef methodName As String,
            <Out> ByRef methodSignature As String,
            <Out> ByRef localName As String) As Boolean

            If fieldName.StartsWith(GeneratedNameConstants.StaticLocalFieldNamePrefix, StringComparison.Ordinal) Then
                Dim parts = fieldName.Split("$"c)
                If parts.Length = 5 Then
                    methodName = parts(2)
                    methodSignature = parts(3)
                    localName = parts(4)
                    Return True
                End If
            End If

            methodName = Nothing
            methodSignature = Nothing
            localName = Nothing
            Return False
        End Function

        ' Extracts the slot index from a name of a field that stores hoisted variables or awaiters.
        ' Such a name ends with "$prefix{slot index}".
        ' Returned slot index is >= 0.
        Friend Shared Function TryParseSlotIndex(prefix As String, fieldName As String, <Out> ByRef slotIndex As Integer) As Boolean
            If fieldName.StartsWith(prefix, StringComparison.Ordinal) AndAlso
                Integer.TryParse(fieldName.Substring(prefix.Length), NumberStyles.None, CultureInfo.InvariantCulture, slotIndex) Then
                Return True
            End If
            slotIndex = -1
            Return False
        End Function

    End Class
End Namespace


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>javax.lang.model.element (Java Platform SE 7 )</title>
<meta name="date" content="2014-12-18">
<meta name="keywords" content="javax.lang.model.element package">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

javax.lang.model.element

Interfaces

AnnotationMirror

AnnotationValue

AnnotationValueVisitor

Element

ElementVisitor

ExecutableElement

Name

PackageElement

Parameterizable

QualifiedNameable

TypeElement

TypeParameterElement

VariableElement

Enums

ElementKind

Modifier

NestingKind

Exceptions

UnknownAnnotationValueException

UnknownElementException


text:
var tap = require('../tap');

tap.count(4);

var util = require('util');
var EventEmitter = require('events').EventEmitter;

function UART(){}
util.inherits(UART, EventEmitter);

var globalUART = new UART();
function Test() {
    this.uart = globalUART;
    this.uart.on('data', this.parseIncoming.bind(this));
}

var i = 1;
Test.prototype.parseIncoming = function(data, _, _, _, _, c) {
    tap.ok(data == i, 'test ' + i + ' bound arguments correctly');
    console.log('#', arguments)
    i++
    if (i == 4) {
    	tap.ok(c != null, 'last numerical value included');
    }
}

var test = new Test();
setTimeout(function() {
    globalUART.emit('data', 1)
    globalUART.emit('data', 2, 'extra args');
    globalUART.emit('data', 3, 'extra args', 'more extra args', 1, 2, 3);
}, 0);


text:
Open Source projects are maintained and backed by a **wonderful community** of users and collaborators.

We encourage you to actively participate in the development and future of Inkline by contributing to the source code, improving documentation, reporting potential bugs or testing new features.

### Channels

There are many ways to taking part in the Inkline community.

1. Github Repositories: Report bugs or create feature requests against the dedicated Inkline repository.
2. Discord: Join the Discord Server to chat instantly with other developers in the Inkline community.
3. Twitter: Stay in touch with the progress we make and learn about the awesome things happening around Inkline.

## Using the issue tracker

The [issue tracker](https://github.com/inkline/inkline/issues) is
the preferred channel for [bug reports](#bug-reports), [features requests](#feature-requests)
and [submitting pull requests](#pull-requests), but please respect the following
restrictions:

* Please **do not** use the issue tracker for personal support requests.

* Please **do not** get off track in issues. Keep the discussion on topic and
  respect the opinions of others.

* Please **do not** post comments consisting solely of "+1" or ":thumbsup:".
  Use [GitHub's "reactions" feature](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments)
  instead. We reserve the right to delete comments which violate this rule.

## Issues and labels

Our bug tracker utilizes several labels to help organize and identify issues. Here's what they represent and how we use them:

- `browser bug` - Issues that are reported to us, but actually are the result of a browser-specific bug. These are diagnosed with reduced test cases and result in an issue opened on that browser's own bug tracker.
- `confirmed` - Issues that have been confirmed with a reduced test case and identify a bug in Inkline.
- `css` - Issues due to our compiled CSS or source Sass files.
- `js` - Issues stemming from our compiled or source JavaScript files.
- `docs` - Issues for improving or updating our documentation.
- `feature` - Issues asking for a new feature to be added, or an existing one to be extended or modified. New features require a minor version bump (e.g., `v1.0.0` to `v1.1.0`).
- `help wanted` - Issues where we need or would love help from the community to resolve.
- `meta` - Issues with the project itself or our GitHub repository.

For a complete look at our labels, see the [project labels page](https://github.com/inkline/inkline/labels).

## Bug reports

A bug is a _demonstrable problem_ that is caused by the code in the repository.
Good bug reports are extremely helpful, so thanks!

Guidelines for bug reports:

1. Provide a clear title and description of the issue.
2. Share the version of Inkline you are using.
3. Add code examples to demonstrate the issue. You can also provide a complete repository to reproduce the issue quickly.

A good bug report shouldn't leave others needing to chase you up for more information. Please try to be as detailed as possible in your report:

- What is your environment?
- What steps will reproduce the issue?
- What browser(s) and OS experience the problem?
- Do other browsers show the bug differently?
- What would you expect to be the outcome?

All these details will help us fix any potential bugs. Remember, fixing bugs takes time. We're doing our best!

Example:

> Short and descriptive example bug report title
>
> A summary of the issue and the browser/OS environment in which it occurs. If
> suitable, include the steps required to reproduce the bug.
>
> 1. This is the first step
> 2. This is the second step
> 3. Further steps, etc.
>
> `<url>` - a link to the reduced test case
>
> Any other information you want to share that is relevant to the issue being
> reported. This might include the lines of code that you have identified as
> causing the bug, and potential solutions (and your opinions on their
> merits).

### Reporting upstream browser bugs

Sometimes bugs reported to us are actually caused by bugs in the browser(s) themselves, not bugs in Inkline per se.
When feasible, we aim to report such upstream bugs to the relevant browser vendor(s), and then list them on our [Wall of Browser Bugs](http://getInkline.com/browser-bugs/) and [document them in MDN](https://developer.mozilla.org/en-US/docs/Web).

| Vendor(s)     | Browser(s)                   | Rendering engine | Bug reporting website(s)                                                              | Notes                                                    |
| ------------- | ---------------------------- | ---------------- | ------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| Mozilla       | Firefox                      | Gecko            | https://bugzilla.mozilla.org/enter_bug.cgi                                            | "Core" is normally the right product option to choose.   |
| Apple         | Safari                       | WebKit           | https://bugs.webkit.org/enter_bug.cgi?product=WebKit
 https://bugreport.apple.com | In Apple's bug reporter, choose "Safari" as the product. |
| Google, Opera | Chrome, Chromium, Opera v15+ | Blink            | https://code.google.com/p/chromium/issues/list                                        | Click the "New issue" button.                            |
| Microsoft     | Edge                         | EdgeHTML         | https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/                 |                                                          |

## Feature requests
Feature requests are welcome! When opening a feature request, it's up to *you* to make a strong case to convince the project's developers of the merits of this feature. Please provide as much detail and context as possible.

When adding a new feature to the library, make sure you update the documentation package as well.

### Testing
Before providing a pull request be sure to test the feature you are adding. Inkline's target code coverage is 100% and we're proudly consistent with that.

## Pull requests

Good pull requests—patches, improvements, new features are a fantastic
help. They should remain focused in scope and avoid containing unrelated
commits.

**Please ask first** before starting on any significant pull request (e.g.
implementing features, refactoring code, porting to a different language),
otherwise you might spend a lot of time working on something that the
project's developers might not want to merge into the project.

Please adhere to the [coding guidelines](#code-guidelines) used throughout the
project (indentation, accurate comments, etc.) and any other requirements
(such as test coverage).

**Do not edit `inkline.css`, or `inkline.js`
directly!** Those files are automatically generated. You should edit the source files in [`/src`](https://github.com/inkline/inkline/tree/master/src) instead.

Similarly, when contributing to Inkline's documentation, you should edit the documentation source files in
[the `/src` directory](https://github.com/inkline/inkline.io/tree/master/src).

Adhering to the following process is the best way to get your work
included in the project:

1. [Fork](https://help.github.com/fork-a-repo/) the project, clone your fork,
   and configure the remotes:

   ```bash
   # Clone your fork of the repo into the current directory
   git clone https://github.com/<your-username>/inkline.git

   # Navigate to the newly cloned directory
   cd inkline

   # Assign the original repo to a remote called "upstream"
   git remote add upstream https://github.com/inkline/inkline.git
   ```

2. Create a new topic branch (off the main project master branch) to
   contain your feature, change, or fix:

   ```bash
   git checkout -b <topic-branch-name>
   ```

3. Make sure your commits are logically structured. Please adhere to these [git commit
   message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). Use Git's
   [interactive rebase](https://help.github.com/en/github/using-git/about-git-rebase)
   feature to tidy up your commits before making them public.

4. Locally rebsase the upstream master branch into your topic branch:

   ```bash
   git pull --rebase upstream master
   ```

5. Push your topic branch up to your fork:

   ```bash
   git push origin <topic-branch-name>
   ```

6. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
    with a clear title and description against the `master` branch.

**Important!** By submitting a patch, you agree to allow the project owners to
license your work under the terms of the [MIT License](../packages/inkline/LICENSE) (for code changes) and under the terms of the
[Creative Commons Attribution 3.0 Unported License](../packages/docs/LICENSE)
(for documentation changes).

## Code guidelines

### HTML

Adhere to the linting and [Code](http://codeguide.co/#html) guidelines.

- Use tags and elements appropriate for an HTML5 doctype (e.g., self-closing tags).
- Use [WAI-ARIA](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) attributes in documentation examples for better accessibility.

### Sass

Adhere to the linting and [RSCSS](https://rscss.io) guidelines.

- Default color palettes should comply with [WCAG color contrast guidelines](http://www.w3.org/TR/WCAG20/#visual-audio-contrast).
- Don't remove default `:focus` styles (via e.g. `outline: none;`) without providing alternative styles. See [this A11Y Project post](http://a11yproject.com/posts/never-remove-css-outlines) for more details.

### JS

Adhere to the linting guidelines.

- Use semicolons
- 4 spaces (no tabs)
- strict mode

### Vue

Adhere to the linting and [Concepts](https://inkline.io/docs/preface/concepts) guidelines.

- Prefix Inkline components with the `I` character
- Provide multiple customization options
- Use mixins where applicable

## Local Development

1. First, fork the repository and create a branch as specified in the [Pull Request Guidelines](#pull-requests) above.

2. You'll find a well-structured [Vite.js](https://vitejs.dev) + [Vue.js](https://vuejs.org) project.

3. Run `npm install` to install all dependencies.

4. To start developing, run `npm run dev` in your command line to run Inkline in development mode. The documentation will be automatically generated based on the UI library updates.

5. To test, run `npm run test:dev` to run the UI Library tests in development mode. Make sure you run `npm run test` to run all the tests once before creating a pull request.

## License

By contributing your code, you agree to license your contribution under the [MIT License](https://github.com/inkline/inkline/tree/master/LICENSE).
By contributing to the documentation, you agree to license your contribution under the [Creative Commons Attribution 3.0 Unported License](https://github.com/inkline/inkline.io/tree/master/LICENSE).


text:
import expressSession from 'express-session';

const STRICT_TRANSPORT_SECURITY_EXPIRE_TIME = String(60 * 24 * 365 * 1000);
const SESSION_COOKIE_KEY = 'karen.sessionid';

export function applyGenericSecurityHeader(req, res, next) {
    res.setHeader('X-Content-Type-Options', 'nosniff');
    res.setHeader('Strict-Transport-Security', 'max-age=' + STRICT_TRANSPORT_SECURITY_EXPIRE_TIME + ';');
    res.setHeader('X-XSS-Protection', '1; mode=block');

    next();
}

const cspDirective = new Map([
    ['default-src', '\'none\''],
    ['connect-src', '\'self\' ws: wss:'],
    ['font-src', '\'self\' https://fonts.gstatic.com'],

    // XXX: karen tries to expand all image which is embedded in a message.
    ['img-src', '* data:'],

    ['media-src', '\'self\''],
    ['script-src', '\'self\''],

    // FIXME: this 'unsafe-inline' should be removed.
    ['style-src', '\'self\' https://fonts.googleapis.com \'unsafe-inline\''],
]);
const cspDirectiveStr = [...cspDirective.entries()].map(function([key, value]){
    return key + ' ' + value + ';';
}).join(' ');

export function applyHtmlSecurtyHeader(req, res) {
    res.setHeader('Content-Security-Policy', cspDirectiveStr);
    res.setHeader('X-Frame-Options', 'DENY');
}

export function setSessionMiddleware(express, config) {
    express.enable('trust proxy');

    const httpsOptions = config.https || {};
    const sessionOption = {
        cookie: {
            path: '/',
            httpOnly: true,
            secure: !!httpsOptions.enable,
            maxAge: null,
        },
        secret: String(Date.now() * Math.random),
        resave: false,
        name: SESSION_COOKIE_KEY,
        saveUninitialized: config.public,
    };
    express.use(expressSession(sessionOption));
}

export function checkSessionMiddleware(req, res, next) {
    const userInfo = req.session.userInfo;
    if (!!userInfo) {
        next();
    } else {
        res.status(403).send();
    }
}

export function trySignIn(req, res) {
    const { id, password } = req.body;

    const isValidId = typeof id === 'string';
    const isValidPass = typeof password === 'string';
    if (!isValidId || !isValidPass) {
        res.status(400).json({
            ok: false,
        });
        return;
    }

    // TODO: verify password actually

    req.session.userInfo = { // eslint-disable-line no-param-reassign
        userid: id,
    };

    res.status(200).json({
        ok: true,
        userid: id,
    });
}

export function doSignout(req, res) {
    const userInfo = req.session.userInfo;
    if (!userInfo) {
        res.clearCookie(SESSION_COOKIE_KEY);
        res.status(412).send(`You have already signouted.`);
        return;
    }

    req.session.destroy((err) => {
        if (!!err) {
            res.status(500).send(`fail to signout`);
            return;
        }

        res.clearCookie(SESSION_COOKIE_KEY);
        res.status(200).send();
    });
}


text:
package org.springframework.beans.factory;

import org.springframework.beans.FatalBeanException;

/**
 * Exception to be thrown from a FactoryBean's {@code getObject()} method
 * if the bean is not fully initialized yet, for example because it is involved
 * in a circular reference.
 *
 *
Note: A circular reference with a FactoryBean cannot be solved by eagerly
 * caching singleton instances like with normal beans. The reason is that
 * every FactoryBean needs to be fully initialized before it can
 * return the created bean, while only specific normal beans need
 * to be initialized - that is, if a collaborating bean actually invokes
 * them on initialization instead of just storing the reference.
 *
 * @author Juergen Hoeller
 * @since 30.10.2003
 * @see FactoryBean#getObject()
 */
@SuppressWarnings("serial")
public class FactoryBeanNotInitializedException extends FatalBeanException {

	/**
	 * Create a new FactoryBeanNotInitializedException with the default message.
	 */
	public FactoryBeanNotInitializedException() {
		super("FactoryBean is not fully initialized yet");
	}

	/**
	 * Create a new FactoryBeanNotInitializedException with the given message.
	 * @param msg the detail message
	 */
	public FactoryBeanNotInitializedException(String msg) {
		super(msg);
	}

}


text:
<?
//check username with users object
//if good
include("objects/db.class.php");
include("objects/user.class.php");
//echo "test";
$myUser= new User();

 $userID=$myUser->login($user,md5($pass));

if ($userID>0){
    setcookie("gtsficg-user",$userID,time()+999999);
    include("manage.php");
    //echo "<META HTTP-EQUIV=REFRESH CONTENT=\"1;\" URL=\"manage.php\">";
}
else {
    //if bad
    $error="Login not accepted";
    include("index.php");
}


text:
import socket, ssl
from typing import Dict

from bversion.http.http_common import read_body, generate_headers, parse_http_responce_preamble

#=====================================================================
class HTTPClient:
    def __init__(self):
        self.s = None

    def connect(self, host: str, port: int, tls: bool = False):
        self.s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)

        if tls: self.s = ssl.wrap_socket(self.s, ssl_version=ssl.PROTOCOL_TLS)
        self.s.connect((host,port))

    def send(self, data: bytes):
        self.s.send(data)

    def send_headers(self, uri: str, headers: Dict[str, str]):
        msg = b"POST " + uri.encode('utf8') + b" HTTP/1.1\r\n"
        self.send(
            msg +
            generate_headers(headers) +
            b"\r\n"
        )

    def read_responce(self):
        parsed_preamble, body_partial = self.read_headers()
        body = read_body(self.s.recv, int(parsed_preamble['headers']['content-length']), body_partial)
        return parsed_preamble, body

    def read_headers(self):
        data = b""

        # read request preamble
        while True:
            data += self.s.recv(1024)
            if b"\r\n\r\n" in data: break

        preamble, body_partial = data.split(b"\r\n\r\n", 1)
        parsed_preamble = parse_http_responce_preamble(preamble)
        return parsed_preamble, body_partial

    def close(self):
        self.s.close()


text:
package org.knowm.xchange.bitmarket.dto.trade;

import com.fasterxml.jackson.annotation.JsonProperty;
import org.knowm.xchange.bitmarket.dto.BitMarketAPILimit;
import org.knowm.xchange.bitmarket.dto.BitMarketBaseResponse;
import org.knowm.xchange.bitmarket.dto.account.BitMarketBalance;

/**
 * @author kfonal
 */
public class BitMarketCancelResponse extends BitMarketBaseResponse<BitMarketBalance> {

  /**
   * Constructor
   *
   * @param success
   * @param data
   * @param limit
   * @param error
   * @param errorMsg
   */
  public BitMarketCancelResponse(@JsonProperty("success") boolean success, @JsonProperty("data") BitMarketBalance data,
      @JsonProperty("limit") BitMarketAPILimit limit, @JsonProperty("error") int error, @JsonProperty("errorMsg") String errorMsg) {

    super(success, data, limit, error, errorMsg);
  }
}


text:
part_of_chain = 0
stigma_chain = 0.5
p_bpoc = 0 -- prob. to become part of chain
stigma_chain_delta = 0.3
stigma_chain_alpha = 0.1

search_prev_chain_member = 5

tMax = 100

-- Variables for sync
alphaSync = 2
betaSync = 10
counterSyncBeat = 0

x_Velo = 30
y_Velo = 30

-- pattern
dTarget = 80
epsilon = 20
maxLength = dTarget / 2.5

--[[
-- cool clustering in small rectangles
dTarget = 60
epsilon = 50
maxLength = dTarget / 8
--]]
--

local collision = 0
local collisionLeft = 0
local collisionRight = 0

--- com overview
comData={
1, -- sync signal 	- 1 or 0 		-	1
1, -- pattern		- 1 := neighb.	-	2
1, -- part of chain	- 1 := true		-	3
0.1, -- right		4
0.0, --			5
0.0,	--			6
0.0,	--			7
0.0,	--			8
0.0,	--			9
0.0	--			10
}

--[[ This function is executed every time you press the 'execute'
     button ]]
function init()
   -- put your code here

	-- initialize counterSyncBeat with a random value < tMax
	counterSyncBeat = robot.random.uniform(tMax)
	-- log("counterSyncBeat init : " .. counterSyncBeat)

	robot.in_chain = 0

end

function setSpeed(speed, turnSpeed)

	local leftSpeed = speed
	local rightSpeed = speed

	 --  curve
	leftSpeed = leftSpeed - turnSpeed
	rightSpeed = rightSpeed + turnSpeed

	robot.wheels.set_velocity(leftSpeed, rightSpeed)

end

--[[ This function is executed at each time step
     It must contain the logic of your controller ]]
function step()
	myprox = table.copy(robot.proximity)

	-- Synchronizing
	-- synchronization()
	-- Pattern formation
	-- pattern()

	if (part_of_chain == 0) then
		collisionHandling()

		collisionDetection()

	end

	-- beomming part of chain decision
	engage_in_chain_decision()

	if (part_of_chain == 0) and (collision == 0)then

		exploration_along_chain()

	else
		-- search the next chain member
		if (search_prev_chain_member ~= 0) then

			setSpeed(-x_Velo, 0)
			search_prev_chain_member = search_prev_chain_member - 1
			if(count_message_recieved_in(3) >= 1) then

				search_prev_chain_member = 0
				setSpeed(0,0)

			end
		end
	end

		groundIsWhite = robot.motor_ground[1].value + robot.motor_ground[2].value + robot.motor_ground[3].value + robot.motor_ground[4].value

	groundIsWhite = groundIsWhite / 4
	if (groundIsWhite == 0) then
		x_Velo = 0
		y_Velo= 0
	end

end

function exploration_along_chain()
	-- body

	local t = robot.range_and_bearing
	local x = 0
	local y = 0

	if (count_message_recieved_in(3) >= 1) then

		for key,tab in pairs(t) do

			if(type(tab) == "table") then
				--log("Key : " .. key)
				--log("Table : " .. tab)
				--log("Type : " .. type(tab))
				--log("Range: ")
				--log(tab.range)
				if (tab.data[3] == 1) then
				--	log ("HB : " .. tab.horizontal_bearing)
				--	log ("Range : " .. tab.range)
					local hb = tab.horizontal_bearing
					local range = tab.range
					local lennardJones =  1 --lennard_jones(range)

					local temp_x = lennardJones * math.cos(hb)
					local temp_y = lennardJones * math.sin(hb)

					local temp_angle = math.atan2(temp_y,temp_x)

					log("temp_angle " .. temp_angle)

					if (temp_angle <= math.pi - math.pi/6) and (temp_angle >= math.pi/6) then
						x = x + temp_x
						y = y + temp_y

					end

					--log("x : " .. temp_x)
					--log("y : " .. temp_y)

				end
				--[[
				for k,val in pairs(tab.data) do
					log("Data Key : " .. k)
					log("Data Val : " .. val)

				end
				--]]
			end

	   	end
		-- log("Count : " .. count)
		--log("Total x : " .. x)
		--log("Total y : " .. y)

		angle = math.atan2(y,x)
		--log("Angle : " .. angle)

		if (angle >= math.pi) then
			turnSpeed = (math.pi*2 - angle) * -1
		else
			turnSpeed = angle
		end
		turnSpeed = (turnSpeed * 5) / math.pi

		local length = math.sqrt( math.pow(x,2) +  math.pow(y,2))
		--log("Length : " .. length)
		local normLength = length / maxLength

		if (normLength > 1) then
			normLength = 1
		end

		setSpeed(x_Velo, turnSpeed)

	else
		setSpeed(x_Velo, 0)
	end
end

function leave_chain_decision()
	-- body
		-- leave chain ?

		r_leave_chain = robot.random.bernoulli(0.05) + math.max((count_message_recieved_in(3) / 2), 1)

		log("r_leave_chain " .. r_leave_chain)

		if (r_leave_chain >= 1) then

			--leave
			robot.in_chain = 0
			part_of_chain = 0

			robot.range_and_bearing.set_data(3, 0)
			robot.leds.set_all_colors("black")

		end

end

function engage_in_chain_decision()
	-- body
	calculate_stigma_chain()
	--log("stigma_chain " .. stigma_chain)

	p_bpoc =  math.pow(stigma_chain,2) / (  math.pow(stigma_chain,2)  + 0.5 )

	log("p_bpoc " .. p_bpoc)
	if (p_bpoc >= 0.7) then

		-- set chain signal in third byte
		robot.in_chain = 1
		part_of_chain = 1
		setSpeed(0,0);
		robot.range_and_bearing.set_data(3, 1)
		robot.leds.set_all_colors("green")
	else
		robot.in_chain = 0
		part_of_chain = 0

		robot.range_and_bearing.set_data(3, 0)
		robot.leds.set_all_colors("black")

	end

end

function calculate_stigma_chain()
	-- body
	groundIsWhite = robot.motor_ground[1].value + robot.motor_ground[2].value + robot.motor_ground[3].value + robot.motor_ground[4].value

	groundIsWhite = groundIsWhite / 4

	temp2 = count_message_recieved_in(3) / 2

	log("rec val " .. temp2)

	tempa = stigma_chain + stigma_chain_alpha
	tempb = stigma_chain_delta * ( temp2 )
	tempc = tempa - tempb

	stigma_chain = stigma_chain + stigma_chain_alpha - stigma_chain_delta * ( temp2 )

	stigma_chain = math.max(stigma_chain,0)
	log("stigma_chain " .. stigma_chain)

end

--[[ This function is executed every time you press the 'reset'
     button in the GUI. It is supposed to restore the state
     of the controller to whatever it was right after init() was
     called. The state of sensors and actuators is reset
     automatically by ARGoS. ]]
function reset()
   -- put your code here
end

--[[ This function is executed only once, when the robot is removed
     from the simulation ]]
function destroy()
   -- put your code here
end

function collisionHandling()

if (collision == 1) then
k = findMaxKey(myprox)
r = robot.random.bernoulli(0.8)

if (collisionLeft == 1) then
	--robot.wheels.set_velocity(x_Velo,-y_Velo)

	--log("r : " .. r)
	if (r == 1) then
		k = 10
	end
	if (k == 10) or ( k == 11) or (k == 12)then
		--log("k : " .. k)
		collisionLeft = 0
		collision = 0;
	end

	-- perhaps the other way arround - right
	r = robot.random.bernoulli(0.05)
	if (r == 1) then
		log("perhaps right")
		robot.wheels.set_velocity(-x_Velo,y_Velo)
		--robot.leds.set_all_colors("red")

	end
end

if (collisionRight == 1) then
	--robot.wheels.set_velocity(-x_Velo,y_Velo)

	--log("r : " .. r)
	if (r == 1) then
		k = 15
	end
	if (k == 15) or ( k == 14) or (k == 13)then
		--log("k : " ..k)
		collisionRight = 0
		collision = 0;
	end

	-- perhaps the other way arround - left
	r = robot.random.bernoulli(0.05)
	if (r == 1) then
		log("perhaps left")
		robot.wheels.set_velocity(x_Velo,-y_Velo)
		--robot.leds.set_all_colors("yellow")
	end
end

if (nobodyThere(myprox) == 1) then
		collisionLeft = 0
		collisionRight = 0
		collision = 0
end

end

function collisionDetection()
-- DETECT

if(collision == 0) then
	robot.wheels.set_velocity(0,0)

	closeValueRight =  myprox[24].value +  myprox[23].value  +  myprox[22].value + myprox[21].value + myprox[20].value
	closeValueLeft =   myprox[1].value + myprox[2].value + myprox[3].value + myprox[4].value + myprox[5].value

	maxValue = closeValueLeft + closeValueRight
	--log("Max Value : " .. maxValue)
	if (maxValue > 0.02) then
		if (closeValueLeft >= closeValueRight) then -- left
			collisionLeft = 1
			collisionRight = 0
			collision = 1
			robot.wheels.set_velocity(x_Velo,-y_Velo/2)
			--robot.leds.set_all_colors("yellow")

		else -- right
			collisionRight = 1
			collisionLeft = 0
			collision = 1
			robot.wheels.set_velocity(-x_Velo/2,y_Velo)
			--robot.leds.set_all_colors("red")
		end

	else
		collisionLeft = 0
		collisionRight = 0
		collision = 0
		robot.wheels.set_velocity(x_Velo, y_Velo)
		curve = robot.random.uniform()
		direct = robot.random.bernoulli(0.5)
		doIt = robot.random.bernoulli(0.3)
		if (doIt == 1) then
			if(direct == 1) then
				robot.wheels.set_velocity(curve * x_Velo, y_Velo)
			else
				robot.wheels.set_velocity(x_Velo, curve * y_Velo)
			end

			--robot.leds.set_all_colors("white")
		end

	end
	end

end

end

function table.copy(t)
   local t2 = {}
   for key,value in pairs(t) do
      t2[key] = value
   end
return t2 end

function findMaxKey(t)
	local k = 1
	for key,val in pairs(t) do
		if val.value >= t[k].value then
			k = key
		end
	end
return k end

function nobodyThere(t)
	for key,value in pairs(t) do
      if (value.value ~= 0) then
			return 0
		end
   	end
return 1 end

function countNearSides(t)
	local count = 0
	for key,value in pairs(t) do
      if (value.value >= 0.5) then
			count = count + 1
		end
   	end
return count end

-----------------------------------
-----------------------------------
---------- pattern & sync ---------

function signal()
	-- set signal in first byte
	robot.range_and_bearing.set_data(1, 1)
	-- reset counterSyncBeat
	counterSyncBeat = 0

end

function count_message_recieved_in(i)
	local t = robot.range_and_bearing
	local count = 0

	for key,tab in pairs(t) do

		if(type(tab) == "table") then
--			log("Key : " .. key)
			--log("Table : " .. tab)
--			log("Type : " .. type(tab))
			--log("Range: ")
			--log(tab.range)
			count = count + tab.data[i]
			--[[
			for k,val in pairs(tab.data) do
				log("Data Key : " .. k)
				log("Data Val : " .. val)

			end
			--]]
		end

   	end
	-- log("Count : " .. count)
return count end

function synchronization()
	-- Synchronizing using range and bearing

	-- first reset signal
	robot.range_and_bearing.set_data(1, 0)
	if(counterSyncBeat > 5) then
		robot.leds.set_all_colors("white")
	end
	-- increase counterSyncBeat
	counterSyncBeat = counterSyncBeat + 1
	log("C. : " .. counterSyncBeat )
	-- signal part
	if (counterSyncBeat > tMax) then
		signal()
		robot.leds.set_all_colors("red")
	end

	-- synchronizing part
	if (count_message_recieved_in(1) >= 1) and (counterSyncBeat > 2) then
		local r = robot.random.bernoulli()

		--log("Signal Lost : " .. r )
		if (r == 1) then
			counterSyncBeat = counterSyncBeat + alphaSync * counterSyncBeat/betaSync
		end

	end

end

function lennard_jones(range)
	local force = 0
	local temp = math.pow(dTarget / range, 2)
	force = -4*epsilon/range * ( math.pow(temp,2) - temp)

return force end

function pattern()
robot.range_and_bearing.set_data(2, 1) -- I am a neighbor

	local t = robot.range_and_bearing
	local x = 0
	local y = 0

	for key,tab in pairs(t) do

		if(type(tab) == "table") then
--			log("Key : " .. key)
			--log("Table : " .. tab)
--			log("Type : " .. type(tab))
			--log("Range: ")
			--log(tab.range)
			if (tab.data[2] == 1) then
			--	log ("HB : " .. tab.horizontal_bearing)
			--	log ("Range : " .. tab.range)
				local hb = tab.horizontal_bearing
				local range = tab.range
				local lennardJones =  lennard_jones(range)

				local temp_x = lennardJones * math.cos(hb)
				local temp_y = lennardJones * math.sin(hb)
				--log("x : " .. temp_x)
				--log("y : " .. temp_y)
				x = x + temp_x
				y = y + temp_y

			end
			--[[
			for k,val in pairs(tab.data) do
				log("Data Key : " .. k)
				log("Data Val : " .. val)

			end
			--]]
		end

   	end
	-- log("Count : " .. count)
	--log("Total x : " .. x)
	--log("Total y : " .. y)

	angle = math.atan2(y,x)
	--log("Angle : " .. angle)

	if (angle >= math.pi) then
		turnSpeed = (math.pi*2 - angle) * -1
	else
		turnSpeed = angle
	end
	turnSpeed = (turnSpeed * 10) / math.pi

	local length = math.sqrt( math.pow(x,2) +  math.pow(y,2))
	--log("Length : " .. length)
	local normLength = length / maxLength

	if (normLength > 1) then
		normLength = 1
	end

	setSpeed(x_Velo/3 * normLength, turnSpeed)
end


text:
/*
 * Include necessary headers...
 */

#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <cups/cups.h>
#include <cups/raster.h>
#include <cups/string-private.h>
#include <cups/thread-private.h>

/*
 * Constants...
 */

#define MAX_CLIENTS	100		/* Maximum number of client threads */

/*
 * Local types...
 */

typedef struct _client_data_s
{
  const char		*uri,		/* Printer URI */
			*hostname,	/* Hostname */
			*user,		/* Username */
			*resource;	/* Resource path */
  int			port;		/* Port number */
  http_encryption_t	encryption;	/* Use encryption? */
  const char		*docfile,	/* Document file */
			*docformat;	/* Document format */
  int			grayscale,	/* Force grayscale? */
			keepfile;	/* Keep temporary file? */
  ipp_pstate_t		printer_state;	/* Current printer state */
  char			printer_state_reasons[1024];
					/* Current printer-state-reasons */
  int			job_id; 	/* Job ID for submitted job */
  ipp_jstate_t		job_state;	/* Current job state */
  char			job_state_reasons[1024];
					/* Current job-state-reasons */
} _client_data_t;

/*
 * Local globals...
 */

static int		client_count = 0;
static _cups_mutex_t	client_mutex = _CUPS_MUTEX_INITIALIZER;
static int		verbosity = 0;

/*
 * Local functions...
 */

static const char	*make_raster_file(ipp_t *response, int grayscale, char *tempname, size_t tempsize, const char **format);
static void		*monitor_printer(_client_data_t *data);
static void		*run_client(_client_data_t *data);
static void		show_attributes(const char *title, int request, ipp_t *ipp);
static void		show_capabilities(ipp_t *response);
static void		usage(void);

/*
 * 'main()' - Main entry.
 */

int					/* O - Exit status */
main(int  argc,				/* I - Number of command-line arguments */
     char *argv[])			/* I - Command-line arguments */
{
  int			i;		/* Looping var */
  const char		*opt;		/* Current option */
  int			num_clients = 0,/* Number of clients to simulate */
			clients_started = 0;
					/* Number of clients that have been started */
  char			scheme[32],     /* URI scheme */
			userpass[256],  /* Username:password */
			hostname[256],  /* Hostname */
			resource[256];  /* Resource path */
  _client_data_t	data;		/* Client data */

 /*
  * Parse command-line options...
  */

  if (argc == 1)
    return (0);

  memset(&data, 0, sizeof(data));

  for (i = 1; i < argc; i ++)
  {
    if (argv[i][0] == '-')
    {
      for (opt = argv[i] + 1; *opt; opt ++)
      {
        switch (*opt)
        {
          case 'c' : /* -c num-clients */
              if (num_clients)
              {
                puts("Number of clients can only be specified once.");
                usage();
                return (1);
              }

              i ++;
              if (i >= argc)
              {
                puts("Expected client count after '-c'.");
                usage();
                return (1);
              }

              if ((num_clients = atoi(argv[i])) < 1)
              {
                puts("Number of clients must be one or more.");
                usage();
                return (1);
              }
              break;

          case 'd' : /* -d document-format */
              if (data.docformat)
              {
                puts("Document format can only be specified once.");
                usage();
                return (1);
              }

              i ++;
              if (i >= argc)
              {
                puts("Expected document format after '-d'.");
                usage();
                return (1);
              }

              data.docformat = argv[i];
              break;

          case 'f' : /* -f print-file */
              if (data.docfile)
              {
                puts("Print file can only be specified once.");
                usage();
                return (1);
              }

              i ++;
              if (i >= argc)
              {
                puts("Expected print file after '-f'.");
                usage();
                return (1);
              }

              data.docfile = argv[i];
              break;

          case 'g' :
              data.grayscale = 1;
              break;

          case 'k' :
              data.keepfile = 1;
              break;

          case 'v' :
              verbosity ++;
              break;

          default :
              printf("Unknown option '-%c'.\n", *opt);
              usage();
              return (1);
        }
      }
    }
    else if (data.uri || (strncmp(argv[i], "ipp://", 6) && strncmp(argv[i], "ipps://", 7)))
    {
      printf("Unknown command-line argument '%s'.\n", argv[i]);
      usage();
      return (1);
    }
    else
      data.uri = argv[i];
  }

 /*
  * Make sure we have everything we need.
  */

  if (!data.uri)
  {
    puts("Expected printer URI.");
    usage();
    return (1);
  }

  if (num_clients < 1)
    num_clients = 1;

 /*
  * Connect to the printer...
  */

  if (httpSeparateURI(HTTP_URI_CODING_ALL, data.uri, scheme, sizeof(scheme), userpass, sizeof(userpass), hostname, sizeof(hostname), &data.port, resource, sizeof(resource)) < HTTP_URI_STATUS_OK)
  {
    printf("Bad printer URI '%s'.\n", data.uri);
    return (1);
  }

  if (!data.port)
    data.port = IPP_PORT;

  if (!strcmp(scheme, "https") || !strcmp(scheme, "ipps"))
    data.encryption = HTTP_ENCRYPTION_ALWAYS;
  else
    data.encryption = HTTP_ENCRYPTION_IF_REQUESTED;

 /*
  * Start the client threads...
  */

  data.hostname = hostname;
  data.resource = resource;

  while (clients_started < num_clients)
  {
    _cupsMutexLock(&client_mutex);
    if (client_count < MAX_CLIENTS)
    {
      _cups_thread_t	tid;		/* New thread */

      client_count ++;
      _cupsMutexUnlock(&client_mutex);
      tid = _cupsThreadCreate((_cups_thread_func_t)run_client, &data);
      _cupsThreadDetach(tid);
    }
    else
    {
      _cupsMutexUnlock(&client_mutex);
      sleep(1);
    }
  }

  while (client_count > 0)
  {
    _cupsMutexLock(&client_mutex);
    printf("%d RUNNING CLIENTS\n", client_count);
    _cupsMutexUnlock(&client_mutex);
    sleep(1);
  }

  return (0);
}

/*
 * 'make_raster_file()' - Create a temporary raster file.
 */

static const char *                     /* O - Print filename */
make_raster_file(ipp_t      *response,  /* I - Printer attributes */
                 int        grayscale,  /* I - Force grayscale? */
                 char       *tempname,  /* I - Temporary filename buffer */
                 size_t     tempsize,   /* I - Size of temp file buffer */
                 const char **format)   /* O - Print format */
{
  int                   i,              /* Looping var */
                        count;          /* Number of values */
  ipp_attribute_t       *attr;          /* Printer attribute */
  const char            *type = NULL;   /* Raster type (colorspace + bits) */
  pwg_media_t           *media = NULL;  /* Media size */
  int                   xdpi = 0,       /* Horizontal resolution */
                        ydpi = 0;       /* Vertical resolution */
  int                   fd;             /* Temporary file */
  cups_mode_t           mode;           /* Raster mode */
  cups_raster_t         *ras;           /* Raster stream */
  cups_page_header2_t   header;         /* Page header */
  unsigned char         *line,          /* Line of raster data */
                        *lineptr;       /* Pointer into line */
  unsigned              y,              /* Current position on page */
                        xcount, ycount, /* Current count for X and Y */
                        xrep, yrep,     /* Repeat count for X and Y */
                        xoff, yoff,     /* Offsets for X and Y */
                        yend;           /* End Y value */
  int                   temprow,        /* Row in template */
                        tempcolor;      /* Template color */
  const char            *template;      /* Pointer into template */
  const unsigned char   *color;         /* Current color */
  static const unsigned char colors[][3] =
  {                                     /* Colors for test */
    { 191, 191, 191 },
    { 127, 127, 127 },
    {  63,  63,  63 },
    {   0,   0,   0 },
    { 255,   0,   0 },
    { 255, 127,   0 },
    { 255, 255,   0 },
    { 127, 255,   0 },
    {   0, 255,   0 },
    {   0, 255, 127 },
    {   0, 255, 255 },
    {   0, 127, 255 },
    {   0,   0, 255 },
    { 127,   0, 255 },
    { 255,   0, 255 }
  };
  static const char * const templates[] =
  {                                     /* Raster template */
    " CCC   U   U  PPPP    SSS          TTTTT  EEEEE   SSS   TTTTT          000     1     222    333      4   55555   66    77777   888    999   ",
    "C   C  U   U  P   P  S   S           T    E      S   S    T           0   0   11    2   2  3   3  4  4   5      6          7  8   8  9   9  ",
    "C      U   U  P   P  S               T    E      S        T           0   0    1        2      3  4  4   5      6         7   8   8  9   9  ",
    "C      U   U  PPPP    SSS   -----    T    EEEE    SSS     T           0 0 0    1      22    333   44444   555   6666      7    888    9999  ",
    "C      U   U  P          S           T    E          S    T           0   0    1     2         3     4       5  6   6    7    8   8      9  ",
    "C   C  U   U  P      S   S           T    E      S   S    T           0   0    1    2      3   3     4   5   5  6   6    7    8   8      9  ",
    " CCC    UUU   P       SSS            T    EEEEE   SSS     T            000    111   22222   333      4    555    666     7     888     99   ",
    "                                                                                "
  };

 /*
  * Figure out the output format...
  */

  if ((attr = ippFindAttribute(response, "document-format-supported", IPP_TAG_MIMETYPE)) == NULL)
  {
    puts("No supported document formats, aborting.");
    return (NULL);
  }

  if (*format)
  {
    if (!ippContainsString(attr, *format))
    {
      printf("Printer does not support document-format '%s'.\n", *format);
      return (NULL);
    }

    if (!strcmp(*format, "image/urf"))
      mode = CUPS_RASTER_WRITE_APPLE;
    else if (!strcmp(*format, "image/pwg-raster"))
      mode = CUPS_RASTER_WRITE_PWG;
    else
    {
      printf("Unable to generate document-format '%s'.\n", *format);
      return (NULL);
    }
  }
  else if (ippContainsString(attr, "image/urf"))
  {
   /*
    * Apple Raster format...
    */

    *format = "image/urf";
    mode    = CUPS_RASTER_WRITE_APPLE;
  }
  else if (ippContainsString(attr, "image/pwg-raster"))
  {
   /*
    * PWG Raster format...
    */

    *format = "image/pwg-raster";
    mode    = CUPS_RASTER_WRITE_PWG;
  }
  else
  {
   /*
    * No supported raster format...
    */

    puts("Printer does not support Apple or PWG raster files, aborting.");
    return (NULL);
  }

 /*
  * Figure out the the media, resolution, and color mode...
  */

  if ((attr = ippFindAttribute(response, "media-ready", IPP_TAG_KEYWORD)) != NULL)
  {
   /*
    * Use ready media...
    */

    if (ippContainsString(attr, "na_letter_8.5x11in"))
      media = pwgMediaForPWG("na_letter_8.5x11in");
    else if (ippContainsString(attr, "iso_a4_210x297mm"))
      media = pwgMediaForPWG("iso_a4_210x297mm");
    else
      media = pwgMediaForPWG(ippGetString(attr, 0, NULL));
  }
  else if ((attr = ippFindAttribute(response, "media-default", IPP_TAG_KEYWORD)) != NULL)
  {
   /*
    * Use default media...
    */

    media = pwgMediaForPWG(ippGetString(attr, 0, NULL));
  }
  else
  {
    puts("No default or ready media reported by printer, aborting.");
    return (NULL);
  }

  if (mode == CUPS_RASTER_WRITE_APPLE && (attr = ippFindAttribute(response, "urf-supported", IPP_TAG_KEYWORD)) != NULL)
  {
    for (i = 0, count = ippGetCount(attr); i < count; i ++)
    {
      const char *val = ippGetString(attr, i, NULL);

      if (!strncmp(val, "RS", 2))
        xdpi = ydpi = atoi(val + 2);
      else if (!strncmp(val, "W8", 2) && !type)
        type = "sgray_8";
      else if (!strncmp(val, "SRGB24", 6) && !grayscale)
        type = "srgb_8";
    }
  }
  else if (mode == CUPS_RASTER_WRITE_PWG && (attr = ippFindAttribute(response, "pwg-raster-document-resolution-supported", IPP_TAG_RESOLUTION)) != NULL)
  {
    for (i = 0, count = ippGetCount(attr); i < count; i ++)
    {
      int tempxdpi, tempydpi;
      ipp_res_t tempunits;

      tempxdpi = ippGetResolution(attr, 0, &tempydpi, &tempunits);

      if (i == 0 || tempxdpi < xdpi || tempydpi < ydpi)
      {
        xdpi = tempxdpi;
        ydpi = tempydpi;
      }
    }

    if ((attr = ippFindAttribute(response, "pwg-raster-document-type-supported", IPP_TAG_KEYWORD)) != NULL)
    {
      if (!grayscale && ippContainsString(attr, "srgb_8"))
        type = "srgb_8";
      else if (ippContainsString(attr, "sgray_8"))
        type = "sgray_8";
    }
  }

  if (xdpi < 72 || ydpi < 72)
  {
    puts("No supported raster resolutions, aborting.");
    return (NULL);
  }

  if (!type)
  {
    puts("No supported color spaces or bit depths, aborting.");
    return (NULL);
  }

 /*
  * Make the raster context and details...
  */

  if (!cupsRasterInitPWGHeader(&header, media, type, xdpi, ydpi, "one-sided", NULL))
  {
    printf("Unable to initialize raster context: %s\n", cupsRasterErrorString());
    return (NULL);
  }

  header.cupsInteger[CUPS_RASTER_PWG_TotalPageCount] = 1;

  if (header.cupsWidth > (2 * header.HWResolution[0]))
  {
    xoff = header.HWResolution[0] / 2;
    yoff = header.HWResolution[1] / 2;
  }
  else
  {
    xoff = header.HWResolution[0] / 4;
    yoff = header.HWResolution[1] / 4;
  }

  xrep = (header.cupsWidth - 2 * xoff) / 140;
  yrep = xrep * header.HWResolution[1] / header.HWResolution[0];
  yend = header.cupsHeight - yoff;

 /*
  * Prepare the raster file...
  */

  if ((line = malloc(header.cupsBytesPerLine)) == NULL)
  {
    printf("Unable to allocate %u bytes for raster output: %s\n", header.cupsBytesPerLine, strerror(errno));
    return (NULL);
  }

  if ((fd = cupsTempFd(tempname, (int)tempsize)) < 0)
  {
    printf("Unable to create temporary print file: %s\n", strerror(errno));
    free(line);
    return (NULL);
  }

  if ((ras = cupsRasterOpen(fd, mode)) == NULL)
  {
    printf("Unable to open raster stream: %s\n", cupsRasterErrorString());
    close(fd);
    free(line);
    return (NULL);
  }

 /*
  * Write a single page consisting of the template dots repeated over the page.
  */

  cupsRasterWriteHeader2(ras, &header);

  memset(line, 0xff, header.cupsBytesPerLine);

  for (y = 0; y < yoff; y ++)
    cupsRasterWritePixels(ras, line, header.cupsBytesPerLine);

  for (temprow = 0, tempcolor = 0; y < yend;)
  {
    template = templates[temprow];
    color    = colors[tempcolor];

    temprow ++;
    if (temprow >= (int)(sizeof(templates) / sizeof(templates[0])))
    {
      temprow = 0;
      tempcolor ++;
      if (tempcolor >= (int)(sizeof(colors) / sizeof(colors[0])))
        tempcolor = 0;
      else if (tempcolor > 3 && header.cupsColorSpace == CUPS_CSPACE_SW)
        tempcolor = 0;
    }

    memset(line, 0xff, header.cupsBytesPerLine);

    if (header.cupsColorSpace == CUPS_CSPACE_SW)
    {
     /*
      * Do grayscale output...
      */

      for (lineptr = line + xoff; *template; template ++)
      {
        if (*template != ' ')
        {
          for (xcount = xrep; xcount > 0; xcount --)
            *lineptr++ = *color;
        }
        else
        {
          lineptr += xrep;
        }
      }
    }
    else
    {
     /*
      * Do color output...
      */

      for (lineptr = line + 3 * xoff; *template; template ++)
      {
        if (*template != ' ')
        {
          for (xcount = xrep; xcount > 0; xcount --, lineptr += 3)
            memcpy(lineptr, color, 3);
        }
        else
        {
          lineptr += 3 * xrep;
        }
      }
    }

    for (ycount = yrep; ycount > 0 && y < yend; ycount --, y ++)
      cupsRasterWritePixels(ras, line, header.cupsBytesPerLine);
  }

  memset(line, 0xff, header.cupsBytesPerLine);

  for (y = 0; y < header.cupsHeight; y ++)
    cupsRasterWritePixels(ras, line, header.cupsBytesPerLine);

  free(line);

  cupsRasterClose(ras);

  close(fd);

  printf("PRINT FILE: %s\n", tempname);

  return (tempname);
}

/*
 * 'monitor_printer()' - Monitor the job and printer states.
 */

static void *				/* O - Thread exit code */
monitor_printer(
    _client_data_t *data)		/* I - Client data */
{
  http_t	*http;			/* Connection to printer */
  ipp_t		*request,		/* IPP request */
		*response;		/* IPP response */
  ipp_attribute_t *attr;		/* Attribute in response */
  ipp_pstate_t	printer_state;		/* Printer state */
  char          printer_state_reasons[1024];
                                        /* Printer state reasons */
  ipp_jstate_t	job_state;		/* Job state */
  char          job_state_reasons[1024];/* Printer state reasons */
  static const char * const jattrs[] =  /* Job attributes we want */
  {
    "job-state",
    "job-state-reasons"
  };
  static const char * const pattrs[] =  /* Printer attributes we want */
  {
    "printer-state",
    "printer-state-reasons"
  };

 /*
  * Open a connection to the printer...
  */

  http = httpConnect2(data->hostname, data->port, NULL, AF_UNSPEC, data->encryption, 1, 0, NULL);

 /*
  * Loop until the job is canceled, aborted, or completed.
  */

  printer_state            = (ipp_pstate_t)0;
  printer_state_reasons[0] = '\0';

  job_state            = (ipp_jstate_t)0;
  job_state_reasons[0] = '\0';

  while (data->job_state < IPP_JSTATE_CANCELED)
  {
   /*
    * Reconnect to the printer as needed...
    */

    if (httpGetFd(http) < 0)
      httpReconnect2(http, 30000, NULL);

    if (httpGetFd(http) >= 0)
    {
     /*
      * Connected, so check on the printer state...
      */

      request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
      ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, data->uri);
      ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", NULL, cupsUser());
      ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes", (int)(sizeof(pattrs) / sizeof(pattrs[0])), NULL, pattrs);

      response = cupsDoRequest(http, request, data->resource);

      if ((attr = ippFindAttribute(response, "printer-state", IPP_TAG_ENUM)) != NULL)
        printer_state = (ipp_pstate_t)ippGetInteger(attr, 0);

      if ((attr = ippFindAttribute(response, "printer-state-reasons", IPP_TAG_KEYWORD)) != NULL)
        ippAttributeString(attr, printer_state_reasons, sizeof(printer_state_reasons));

      if (printer_state != data->printer_state || strcmp(printer_state_reasons, data->printer_state_reasons))
      {
        printf("PRINTER: %s (%s)\n", ippEnumString("printer-state", (int)printer_state), printer_state_reasons);

        data->printer_state = printer_state;
        strlcpy(data->printer_state_reasons, printer_state_reasons, sizeof(data->printer_state_reasons));
      }

      ippDelete(response);

      if (data->job_id > 0)
      {
       /*
        * Check the status of the job itself...
        */

        request = ippNewRequest(IPP_OP_GET_JOB_ATTRIBUTES);
        ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, data->uri);
        ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER, "job-id", data->job_id);
        ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", NULL, cupsUser());
        ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes", (int)(sizeof(jattrs) / sizeof(jattrs[0])), NULL, jattrs);

        response = cupsDoRequest(http, request, data->resource);

        if ((attr = ippFindAttribute(response, "job-state", IPP_TAG_ENUM)) != NULL)
          job_state = (ipp_jstate_t)ippGetInteger(attr, 0);

        if ((attr = ippFindAttribute(response, "job-state-reasons", IPP_TAG_KEYWORD)) != NULL)
          ippAttributeString(attr, job_state_reasons, sizeof(job_state_reasons));

        if (job_state != data->job_state || strcmp(job_state_reasons, data->job_state_reasons))
        {
          printf("JOB %d: %s (%s)\n", data->job_id, ippEnumString("job-state", (int)job_state), job_state_reasons);

          data->job_state = job_state;
          strlcpy(data->job_state_reasons, job_state_reasons, sizeof(data->job_state_reasons));
        }

        ippDelete(response);
      }
    }

    if (data->job_state < IPP_JSTATE_CANCELED)
    {
     /*
      * Sleep for 5 seconds...
      */

      sleep(5);
    }
  }

 /*
  * Cleanup and return...
  */

  httpClose(http);

  printf("FINISHED MONITORING JOB %d\n", data->job_id);

  return (NULL);
}

/*
 * 'run_client()' - Run a client thread.
 */

static void *				/* O - Thread exit code */
run_client(
    _client_data_t *data)		/* I - Client data */
{
  _cups_thread_t monitor_id;		/* Monitoring thread ID */
  const char	*name;			/* Job name */
  char		tempfile[1024] = "";	/* Temporary file (if any) */
  _client_data_t ldata;			/* Local client data */
  http_t	*http;			/* Connection to printer */
  ipp_t		*request,		/* IPP request */
		*response;		/* IPP response */
  ipp_attribute_t *attr;		/* Attribute in response */
  static const char * const pattrs[] =  /* Printer attributes we are interested in */
  {
    "all",
    "media-col-database"
  };

  ldata = *data;

 /*
  * Start monitoring the printer in the background...
  */

  monitor_id = _cupsThreadCreate((_cups_thread_func_t)monitor_printer, &ldata);

 /*
  * Open a connection to the printer...
  */

  http = httpConnect2(data->hostname, data->port, NULL, AF_UNSPEC, data->encryption, 1, 0, NULL);

 /*
  * Query printer status and capabilities...
  */

  request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, ldata.uri);
  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", NULL, cupsUser());
  ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes", (int)(sizeof(pattrs) / sizeof(pattrs[0])), NULL, pattrs);

  response = cupsDoRequest(http, request, ldata.resource);

  if (verbosity)
    show_capabilities(response);

 /*
  * Now figure out what we will be printing...
  */

  if (ldata.docfile)
  {
   /*
    * User specified a print file, figure out the format...
    */
    const char *ext;			/* Filename extension */

    if ((ext = strrchr(ldata.docfile, '.')) != NULL)
    {
     /*
      * Guess the format from the extension...
      */

      if (!strcmp(ext, ".jpg"))
        ldata.docformat = "image/jpeg";
      else if (!strcmp(ext, ".pdf"))
        ldata.docformat = "application/pdf";
      else if (!strcmp(ext, ".ps"))
        ldata.docformat = "application/postscript";
      else if (!strcmp(ext, ".pwg"))
        ldata.docformat = "image/pwg-raster";
      else if (!strcmp(ext, ".urf"))
        ldata.docformat = "image/urf";
      else
        ldata.docformat = "application/octet-stream";
    }
    else
    {
     /*
      * Tell the printer to auto-detect...
      */

      ldata.docformat = "application/octet-stream";
    }
  }
  else
  {
   /*
    * No file specified, make something to test with...
    */

    if ((ldata.docfile = make_raster_file(response, ldata.grayscale, tempfile, sizeof(tempfile), &ldata.docformat)) == NULL)
      return ((void *)1);
  }

  ippDelete(response);

 /*
  * Create a job and wait for completion...
  */

  request = ippNewRequest(IPP_OP_CREATE_JOB);
  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, ldata.uri);
  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", NULL, cupsUser());

  if ((name = strrchr(ldata.docfile, '/')) != NULL)
    name ++;
  else
    name = ldata.docfile;

  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL, name);

  if (verbosity)
    show_attributes("Create-Job request", 1, request);

  response = cupsDoRequest(http, request, ldata.resource);

  if (verbosity)
    show_attributes("Create-Job response", 0, response);

  if (cupsLastError() >= IPP_STATUS_REDIRECTION_OTHER_SITE)
  {
    printf("Unable to create print job: %s\n", cupsLastErrorString());

    ldata.job_state = IPP_JSTATE_ABORTED;

    goto cleanup;
  }

  if ((attr = ippFindAttribute(response, "job-id", IPP_TAG_INTEGER)) == NULL)
  {
    puts("No job-id returned in Create-Job request.");

    ldata.job_state = IPP_JSTATE_ABORTED;

    goto cleanup;
  }

  ldata.job_id = ippGetInteger(attr, 0);

  printf("CREATED JOB %d, sending %s of type %s\n", ldata.job_id, ldata.docfile, ldata.docformat);

  ippDelete(response);

  request = ippNewRequest(IPP_OP_SEND_DOCUMENT);
  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, ldata.uri);
  ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER, "job-id", ldata.job_id);
  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", NULL, cupsUser());
  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, "document-format", NULL, ldata.docformat);
  ippAddBoolean(request, IPP_TAG_OPERATION, "last-document", 1);

  if (verbosity)
    show_attributes("Send-Document request", 1, request);

  response = cupsDoFileRequest(http, request, ldata.resource, ldata.docfile);

  if (verbosity)
    show_attributes("Send-Document response", 0, response);

  if (cupsLastError() >= IPP_STATUS_REDIRECTION_OTHER_SITE)
  {
    printf("Unable to print file: %s\n", cupsLastErrorString());

    ldata.job_state = IPP_JSTATE_ABORTED;

    goto cleanup;
  }

  puts("WAITING FOR JOB TO COMPLETE");

  while (ldata.job_state < IPP_JSTATE_CANCELED)
    sleep(1);

 /*
  * Cleanup after ourselves...
  */

  cleanup:

  httpClose(http);

  if (tempfile[0] && !ldata.keepfile)
    unlink(tempfile);

  _cupsThreadWait(monitor_id);

  _cupsMutexLock(&client_mutex);
  client_count --;
  _cupsMutexUnlock(&client_mutex);

  return (NULL);
}

/*
 * 'show_attributes()' - Show attributes in a request or response.
 */

static void
show_attributes(const char *title,      /* I - Title */
                int        request,     /* I - 1 for request, 0 for response */
                ipp_t      *ipp)        /* I - IPP request/response */
{
  int                   minor, major = ippGetVersion(ipp, &minor);
                                        /* IPP version number */
  ipp_tag_t             group = IPP_TAG_ZERO;
                                        /* Current group tag */
  ipp_attribute_t       *attr;          /* Current attribute */
  const char            *name;          /* Attribute name */
  char                  buffer[1024];   /* Value */

  printf("%s:\n", title);
  printf("  version=%d.%d\n", major, minor);
  printf("  request-id=%d\n", ippGetRequestId(ipp));
  if (!request)
    printf("  status-code=%s\n", ippErrorString(ippGetStatusCode(ipp)));

  for (attr = ippFirstAttribute(ipp); attr; attr = ippNextAttribute(ipp))
  {
    if (group != ippGetGroupTag(attr))
    {
      group = ippGetGroupTag(attr);
      if (group)
        printf("  %s:\n", ippTagString(group));
    }

    if ((name = ippGetName(attr)) != NULL)
    {
      ippAttributeString(attr, buffer, sizeof(buffer));
      printf("    %s(%s%s)=%s\n", name, ippGetCount(attr) > 1 ? "1setOf " : "", ippTagString(ippGetValueTag(attr)), buffer);
    }
  }
}

/*
 * 'show_capabilities()' - Show printer capabilities.
 */

static void
show_capabilities(ipp_t *response)      /* I - Printer attributes */
{
  int                   i;              /* Looping var */
  ipp_attribute_t       *attr;          /* Attribute */
  char                  buffer[1024];   /* Attribute value buffer */
  static const char * const pattrs[] =  /* Attributes we want to show */
  {
    "copies-default",
    "copies-supported",
    "finishings-default",
    "finishings-ready",
    "finishings-supported",
    "media-default",
    "media-ready",
    "media-supported",
    "output-bin-default",
    "output-bin-supported",
    "print-color-mode-default",
    "print-color-mode-supported",
    "sides-default",
    "sides-supported",
    "document-format-default",
    "document-format-supported",
    "pwg-raster-document-resolution-supported",
    "pwg-raster-document-type-supported",
    "urf-supported"
  };

  puts("CAPABILITIES:");
  for (i = 0; i < (int)(sizeof(pattrs) / sizeof(pattrs[0])); i ++)
  {
     if ((attr = ippFindAttribute(response, pattrs[i], IPP_TAG_ZERO)) != NULL)
     {
       ippAttributeString(attr, buffer, sizeof(buffer));
       printf("  %s=%s\n", pattrs[i], buffer);
     }
  }
}

/*
 * 'usage()' - Show program usage...
 */

static void
usage(void)
{
  puts("Usage: ./testclient printer-uri [options]");
  puts("Options:");
  puts("  -c num-clients      Simulate multiple clients");
  puts("  -d document-format  Generate the specified format");
  puts("  -f print-file       Print the named file");
  puts("  -g                  Force grayscale printing");
  puts("  -k                  Keep temporary files");
  puts("  -v                  Be more verbose");
}


text:
package org.qommons.collect;

import java.util.*;
import java.util.stream.Collectors;

/**
 * A graph that can be modified directly
 *
 * @param <N> The type of values stored in this graph's nodes
 * @param <E> The type of values stored in this graph's edges
 */
public interface MutableGraph<N, E> extends Graph<N, E> {
	/**
	 * Adds a node to the graph
	 *
	 * @param value The value for the node to have
	 * @return The node that was created and added
	 */
	Node<N, E> addNode(N value);

	/**
	 * Adds a collection of nodes to a graph
	 *
	 * @param values The node values to add
	 * @return The nodes that were added to this graph
	 */
	List<? extends Node<N, E>> addNodes(Collection<? extends N> values);

	/**
	 * Adds an edge between two nodes which must already be in the graph. The nodes cannot be the same.
	 *
	 * @param start The node for the edge to start at
	 * @param end The node for the edge to end at
	 * @param directed Whether the edge is directed (i.e. one-way)
	 * @param value The value to associate with the new edge
	 * @return The edge that was created and added
	 */
	Edge<N, E> addEdge(Node<N, E> start, Node<N, E> end, boolean directed, E value);

	/**
	 * @param node The node to remove from the graph along with all its edges
	 * @return Whether the node was found in the graph
	 */
	boolean removeNode(Node<N, E> node);

	/**
	 * @param edge The edge to remove from the graph
	 * @return Whether the edge was found in the graph
	 */
	boolean removeEdge(Edge<N, E> edge);

	/**
	 * Replaces a node in the graph with a new node having a different value. This method is useful because the value of a node cannot be
	 * directly modified. All edges referring to the given node will be replaced with equivalent edges referring to the new node.
	 *
	 * @param node The node to replace
	 * @param newValue The value for the new node to have
	 * @return The node that was created and added
	 */
	Node<N, E> replaceNode(Node<N, E> node, N newValue);

	/** Removes all nodes and edges from this graph */
	void clear();

	/** Removes all edges from this graph */
	void clearEdges();

	/**
	 * Adds all nodes and edges from the given graph into this graph
	 *
	 * @param graph The graph to add into this graph
	 */
	default void addAll(Graph<? extends N, ? extends E> graph) {
		List<? extends Node<? extends N, ? extends E>> oldNodes;
		if (graph.getNodes() instanceof List)
			oldNodes = (List<? extends Node<? extends N, ? extends E>>) graph.getNodes();
		else
			oldNodes = new ArrayList<>(graph.getNodes());
		List<? extends Node<N, E>> newNodes = addNodes(oldNodes.stream().map(n -> n.getValue()).collect(Collectors.toList()));
		Map<Node<? extends N, ? extends E>, Node<N, E>> oldToNewNodes = new HashMap<>();
		for (int n = 0; n < oldNodes.size(); n++)
			oldToNewNodes.put(oldNodes.get(n), newNodes.get(n));
		for (Edge<? extends N, ? extends E> edge : graph.getEdges()) {
			Node<N, E> from = oldToNewNodes.get(edge.getStart());
			Node<N, E> to = oldToNewNodes.get(edge.getEnd());
			addEdge(from, to, edge.isDirected(), edge.getValue());
		}
	}

	/** @return An immutable graph backed by this graph's data */
	default Graph<N, E> immutable() {
		return new Graph<N, E>() {
			@Override
			public Collection<? extends Node<N, E>> getNodes() {
				return MutableGraph.this.getNodes();
			}

			@Override
			public Collection<? extends Edge<N, E>> getEdges() {
				return MutableGraph.this.getEdges();
			}

			@Override
			public org.qommons.collect.Graph.Node<N, E> nodeFor(N value) {
				return MutableGraph.this.nodeFor(value);
			}
		};
	}
}


text:
<!DOCTYPE html>

  <meta charset="utf-8">

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

  <title>Overview: module code — Python-RDM 0.1 documentation</title>

  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />

    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />

             Python-RDM

                0.1.2

  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>

Introduction

Installation

Getting started

Example use case

ClowdFlows

API Reference

Licences of included approaches

          Python-RDM

 »

Overview: module code

All modules for which code is available

rdm.db.context

rdm.db.converters

rdm.db.datasource

rdm.db.mapper

rdm.validation

rdm.wrappers.aleph.aleph

rdm.wrappers.caraf.caraf

rdm.wrappers.proper.proper

rdm.wrappers.rsd.rsd

rdm.wrappers.tertius.onebc

rdm.wrappers.tertius.tertius

rdm.wrappers.treeliker.treeliker

rdm.wrappers.wordification.wordification

        © Copyright 2016, Anze Vavpetic, Matic Perovsek

    Built with Sphinx using a

    theme

    provided by Read the Docs.


text:
<?php declare(strict_types=1);

namespace Limoncello\Tests\Application\Data\Config;

/**
 * @package Limoncello\Tests\Application
 */
interface MarkerInterfaceChild1 extends MarkerInterfaceTop
{
}


text:
package org.apache.drill.exec.physical.impl.sort;

import static org.junit.Assert.assertTrue;
import mockit.Injectable;
import mockit.NonStrictExpectations;

import org.apache.drill.common.config.DrillConfig;
import org.apache.drill.common.expression.ExpressionPosition;
import org.apache.drill.common.expression.SchemaPath;
import org.apache.drill.common.util.FileUtils;
import org.apache.drill.exec.ExecTest;
import org.apache.drill.exec.compile.CodeCompiler;
import org.apache.drill.exec.expr.fn.FunctionImplementationRegistry;
import org.apache.drill.exec.memory.TopLevelAllocator;
import org.apache.drill.exec.ops.FragmentContext;
import org.apache.drill.exec.physical.PhysicalPlan;
import org.apache.drill.exec.physical.base.FragmentRoot;
import org.apache.drill.exec.physical.impl.ImplCreator;
import org.apache.drill.exec.physical.impl.OperatorCreatorRegistry;
import org.apache.drill.exec.physical.impl.SimpleRootExec;
import org.apache.drill.exec.planner.PhysicalPlanReader;
import org.apache.drill.exec.proto.BitControl.PlanFragment;
import org.apache.drill.exec.proto.CoordinationProtos;
import org.apache.drill.exec.rpc.user.UserServer.UserClientConnection;
import org.apache.drill.exec.server.DrillbitContext;
import org.apache.drill.exec.vector.BigIntVector;
import org.apache.drill.exec.vector.IntVector;
import org.junit.Ignore;
import org.junit.Test;

import com.codahale.metrics.MetricRegistry;
import com.google.common.base.Charsets;
import com.google.common.io.Files;

@Ignore
public class TestSimpleSort extends ExecTest {
  static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(TestSimpleSort.class);
  DrillConfig c = DrillConfig.create();

  @Test
  public void sortOneKeyAscending(@Injectable final DrillbitContext bitContext, @Injectable UserClientConnection connection) throws Throwable{

    new NonStrictExpectations(){{
      bitContext.getMetrics(); result = new MetricRegistry();
      bitContext.getAllocator(); result = new TopLevelAllocator();
      bitContext.getOperatorCreatorRegistry(); result = new OperatorCreatorRegistry(c);
      bitContext.getConfig(); result = c;
      bitContext.getCompiler(); result = CodeCompiler.getTestCompiler(c);
    }};

    PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance());
    PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/sort/one_key_sort.json"), Charsets.UTF_8));
    FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c);
    FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry);
    SimpleRootExec exec = new SimpleRootExec(ImplCreator.getExec(context, (FragmentRoot) plan.getSortedOperators(false).iterator().next()));

    int previousInt = Integer.MIN_VALUE;

    int recordCount = 0;
    int batchCount = 0;

    while(exec.next()){
      batchCount++;
      IntVector c1 = exec.getValueVectorById(new SchemaPath("blue", ExpressionPosition.UNKNOWN), IntVector.class);
      IntVector c2 = exec.getValueVectorById(new SchemaPath("green", ExpressionPosition.UNKNOWN), IntVector.class);

      IntVector.Accessor a1 = c1.getAccessor();
      IntVector.Accessor a2 = c2.getAccessor();

      for(int i =0; i < c1.getAccessor().getValueCount(); i++){
        recordCount++;
        assert previousInt <= a1.get(i);
        previousInt = a1.get(i);
        assert previousInt == a2.get(i);
      }

    }

    System.out.println(String.format("Sorted %,d records in %d batches.", recordCount, batchCount));

    if(context.getFailureCause() != null){
      throw context.getFailureCause();
    }
    assertTrue(!context.isFailed());
  }

  @Test
  public void sortTwoKeysOneAscendingOneDescending(@Injectable final DrillbitContext bitContext, @Injectable UserClientConnection connection) throws Throwable{

    new NonStrictExpectations(){{
      bitContext.getMetrics(); result = new MetricRegistry();
      bitContext.getAllocator(); result = new TopLevelAllocator();
      bitContext.getOperatorCreatorRegistry(); result = new OperatorCreatorRegistry(c);
      bitContext.getConfig(); result = c;
      bitContext.getCompiler(); result = CodeCompiler.getTestCompiler(c);
    }};

    PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance());
    PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/sort/two_key_sort.json"), Charsets.UTF_8));
    FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c);
    FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry);
    SimpleRootExec exec = new SimpleRootExec(ImplCreator.getExec(context, (FragmentRoot) plan.getSortedOperators(false).iterator().next()));

    int previousInt = Integer.MIN_VALUE;
    long previousLong = Long.MAX_VALUE;

    int recordCount = 0;
    int batchCount = 0;

    while(exec.next()){
      batchCount++;
      IntVector c1 = exec.getValueVectorById(new SchemaPath("blue", ExpressionPosition.UNKNOWN), IntVector.class);
      BigIntVector c2 = exec.getValueVectorById(new SchemaPath("alt", ExpressionPosition.UNKNOWN), BigIntVector.class);

      IntVector.Accessor a1 = c1.getAccessor();
      BigIntVector.Accessor a2 = c2.getAccessor();

      for(int i =0; i < c1.getAccessor().getValueCount(); i++){
        recordCount++;
        assert previousInt <= a1.get(i);

        if(previousInt != a1.get(i)){
          previousLong = Long.MAX_VALUE;
          previousInt = a1.get(i);
        }

        assert previousLong >= a2.get(i);

        //System.out.println(previousInt + "\t" + a2.get(i));

      }

    }

    System.out.println(String.format("Sorted %,d records in %d batches.", recordCount, batchCount));

    if(context.getFailureCause() != null){
      throw context.getFailureCause();
    }
    assertTrue(!context.isFailed());
  }

}


text:
Provisioning Profiles.app
=========================

This application lists all profiles of your provisioning folder located at ```~/Library/MobileDevice/Provisioning Profiles```. It shows the profiles contents and allows you to sort and organize them or to move profiles to the trash folder. For parsing the provisioning profiles this application uses the ```security``` command line utility.

![Provisioning Profiles Screenshot](https://raw.githubusercontent.com/cmittendorf/ProvisioningProfiles/master/Screenshot1.jpg "Screenshot")

You can find more information on provisioning files in the article from  [Craig Hockenberry](http://furbo.org/2013/11/02/a-quick-look-plug-in-for-provisioning/) on his QuickLook plugin or in Sean Heber's [provisioning overview](http://bigzaphod.tumblr.com/post/78574849549/provisioning).

Versions
--------

- 1.0.0 (24 May 2015)
  I cleaned up the project and added as a new feature support for QuickLook. Make sure that you have a plugin supporting Provisioning Profiles installed on your computer, like i.e. [the QuickLook plugin from Craig Hockenberry](https://github.com/chockenberry/Provisioning).


text:
#include <config.h>

#include <vmdnssys.h>

#ifdef HAVE_SYS_EPOLL_H
#include <sys/epoll.h>
#endif

#include <vmdns.h>
#include <vmdnsdefines.h>

#include <vmdnscommon.h>
#include <vmsock.h>
#include <vmsockapi.h>
#include <vmsockposix.h>

#include "defines.h"
#include "structs.h"
#include "prototypes.h"
#include "externs.h"


text:
<?xml version="1.0"?>
<!--

-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
    <head>
        <link src="Magento_GoogleShopping::js/bootstrap.js"/>
    </head>
    <body>
        <referenceContainer name="page.main.actions">
            <block class="Magento\Backend\Block\Store\Switcher" name="store_switcher" template="Magento_Backend::store/switcher.phtml"/>
        </referenceContainer>
    </body>
</page>


text:
// MIT License. Copyright (c) 2016 Maxim Kuzmin. Contacts: https://github.com/maxim-kuzmin

// Author: Maxim Kuzmin

namespace Makc2016.Modules.AspNetIdentity.Web.Mvc.Account.Actions
{
    internal class ModuleAspNetIdentityWebMvcAccountActionExternalLoginCallback
    {
        #region Constatns

        public const string VIEW_NAME = "ExternalLoginCallback";

        public const string ROUTE_NAME = "external-login-callback";

        #endregion Constatns
    }
}