text:
<?php

/* core/themes/stable/templates/field/file-link.html.twig */
class __TwigTemplate_5ff39811745a6e8e0622f1dfdc03776746e04915d9fe88f22505e4433378dd9c extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = false;

        $this->blocks = array(
        );
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        $tags = array();
        $filters = array();
        $functions = array();

        try {
            $this->env->getExtension('sandbox')->checkSecurity(
                array(),
                array(),
                array()
            );
        } catch (Twig_Sandbox_SecurityError $e) {
            $e->setTemplateFile($this->getTemplateName());

            if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
                $e->setTemplateLine($tags[$e->getTagName()]);
            } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
                $e->setTemplateLine($filters[$e->getFilterName()]);
            } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
                $e->setTemplateLine($functions[$e->getFunctionName()]);
            }

            throw $e;
        }

        // line 13
        echo "env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, (isset($context["attributes"]) ? $context["attributes"] : null), "html", null, true));
        echo ">";
        echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, (isset($context["link"]) ? $context["link"] : null), "html", null, true));
        echo "
";
    }

    public function getTemplateName()
    {
        return "core/themes/stable/templates/field/file-link.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  43 => 13,);
    }

    public function getSource()
    {
        return "{#
/**
 * @file
 * Theme override for a link to a file.
 *
 * Available variables:
 * - attributes: The HTML attributes for the containing element.
 * - link: A link to the file.
 *
 * @see template_preprocess_file_link()
 */
#}
{{ link }}
";
    }
}


text:
package steam

import (
	"errors"
	"fmt"
	"net"
	"time"
)

type udpSocket struct {
	conn net.Conn
}

func newUDPSocket(dial DialFn, addr string) (*udpSocket, error) {
	conn, err := dial("udp", addr)
	if err != nil {
		return nil, err
	}
	return &udpSocket{conn}, nil
}

func (s *udpSocket) close() {
	s.conn.Close()
}

func (s *udpSocket) send(payload []byte) error {
	n, err := s.conn.Write(payload)
	if err != nil {
		return err
	}
	if n != len(payload) {
		return fmt.Errorf("steam: could not send full udp request to %v", s.conn.RemoteAddr())
	}
	return nil
}

func (s *udpSocket) receivePacket() ([]byte, error) {
	if err := s.conn.SetReadDeadline(time.Now().Add(1 * time.Second)); err != nil {
		return nil, err
	}
	buf := make([]byte, 1500)
	n, err := s.conn.Read(buf)
	if err != nil {
		return nil, err
	}
	return buf[:n], nil
}

func (s *udpSocket) receive() ([]byte, error) {
	buf, err := s.receivePacket()
	if err != nil {
		return nil, err
	}
	if buf[0] == 0xFE {
		return nil, errors.New("steam: cannot handle split packets")
	}
	return buf[4:], nil
}

redpajama_set_name: RedPajamaGithub


text:
// Generated by xsd compiler for android/java
// DO NOT CHANGE!
package com.ebay.trading.api;

import java.io.Serializable;
import com.leansoft.nano.annotation.*;
import java.util.List;

public class VeROReportedItemType implements Serializable {

    private static final long serialVersionUID = -1L;

	@Element(name = "ItemID")
	@Order(value=0)
	public String itemID;

	@Element(name = "ItemStatus")
	@Order(value=1)
	public VeROItemStatusCodeType itemStatus;

	@Element(name = "ItemReasonForFailure")
	@Order(value=2)
	public String itemReasonForFailure;

	@AnyElement
	@Order(value=3)
	public List<Object> any;

}


text:
<?php
include_once "globalVar.php";
include_once "../events.php";
class EventTest extends PHPUnit_Framework_TestCase
{
  public function testKeyShouldBeSet() {
    $participantIds = [["type" => "email", "value" => "james.mcsales@relateiq.com"],
                      ["type" => "email", "value" => "tim.archer@avocado.com"],
                      ["type" => "phone","value" => "8001235555"]];
    $data = ['participantIds'=>$participantIds];
    $event = new Events($data);
    $this->assertEquals($participantIds, $event->participantIds());
  }

  public function testEvent()
  {
    Client::relateIQ(GlobalVar::KEY, GlobalVar::SECRET);
    $event = new Events([]);
    $event->subject("Support Ticket #12345: How do I create an event?");
    $event->body("Just called Tim and walked him through how to create an event with the new API.
    He'll reach out to support@relateiq.com with any questions he might have.
    Resolving.
    - James");
    $participantIds = [["type" => "email", "value" => "james.mcsales@relateiq.com"],
                      ["type" => "email", "value" => "tim.archer@avocado.com"],
                      ["type" => "phone","value" => "8001235555"]];
    $event->participantIds($participantIds);
    $res = $event->update();
    $this->assertInstanceOf('Events', $res);
  }
}
?>


text:
A Minimum structure featuring:

* Docker using Slim Debian
* Python 3.6
* Earth Engine Python API, and authorisation set-up
* Flask and Flask_restplus
* Working skeleton of a Flask App with Swagger UI interface

#### Launch

1) Ensure you have execution permissions set for the start.sh and entrypoint.sh files:

```bash
chown +x start.sh
chown +x entrypoint.sh
```

2) Run the `start.sh` script:
```bash
./start.sh develop
```
The microservice should now be accessible at `localhost:8000`

#### Interactive docker session

If you wish to enter the container in interactive mode, identify the `CONTAINER ID` using `docker ps`, e.g.:

```bash
docker ps
CONTAINER ID        IMAGE                COMMAND                  CREATED             STATUS              PORTS                    NAMES
ea58c240878c        dockertest_develop   "./entrypoint.sh d..."   19 minutes ago      Up 19 minutes       0.0.0.0:8000->5000/tcp   dockertest_develop_1
```

Then use the id to run `docker exec`:

```
docker exec -it ea58c240878c bash
```

### Environment variables

* DEBUG= Boolean
* PORT= port that flask app will try and run on e.g. 5000
* EE_USER= Earth Engine user account info
* EE_PRIVATE_KEY=Earth engine private key from which to generate a PEM
* EE_AUTH_TYPE=nonlocal (set to local if you want to authenticte via locally stored Earth Engine credentials)


text:
// CGuidDlg dialog

class CGuidDlg : public CDialog
{
	DECLARE_DYNAMIC(CGuidDlg)

public:
	CGuidDlg(CWnd* pParent = NULL);   // standard constructor
	virtual ~CGuidDlg();

// Dialog Data
	enum { IDD = IDD_GUID };

	GUID m_Guid;

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()
public:
	CEdit m_EditGuid;
	CButton m_BtnGenerate;
	CButton m_BtnOK;
	virtual BOOL OnInitDialog();
private:
	void DisplayGuid();
	GUID GetGuid();
	void SetState();
public:
	afx_msg void OnGenerate();
	afx_msg void OnGuidChange();
protected:
	virtual void OnOK();
};


text:
package workbench.interfaces;

import workbench.db.ConnectionProfile;
import workbench.db.WbConnection;

/**
 *
 * @author  Thomas Kellerer
 */
public interface Connectable
{
	void connectCancelled();
	boolean connectBegin(ConnectionProfile profile, StatusBar info, boolean loadWorkspace);
	String getConnectionId(ConnectionProfile profile);
	void connectFailed(String error);
	void connected(WbConnection conn);
	void connectEnded();
	String getDefaultIconName();
}


text:
typedef NS_ENUM(NSInteger, Y2WRTCVideoViewFillMode) {
    Y2WRTCVideoViewFillModeScaleAspectFill, // 裁剪
    Y2WRTCVideoViewFillModeScaleAspectFit,  // 居中
    Y2WRTCVideoViewFillModeScaleToFill      // 拉伸
};

@class Y2WRTCVideoView, Y2WRTCVideoTrack;
@protocol Y2WRTCVideoViewDelegate<NSObject>

- (void)videoView:(Y2WRTCVideoView *)videoView didChangeVideoSize:(CGSize)size;

@end

@interface Y2WRTCVideoView : UIView

@property (nonatomic, weak) Y2WRTCVideoTrack *videoTrack;

@property (nonatomic, assign) id<Y2WRTCVideoViewDelegate>delegate;

@property (nonatomic, assign) Y2WRTCVideoViewFillMode fillMode;  // 默认 Y2WRTCVideoViewFillModeScaleAspectFill

@property (nonatomic, assign) UIImage *snapshot;

@end


text:
package com.doctor.curator;

import java.util.concurrent.TimeUnit;

import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.framework.recipes.nodes.PersistentEphemeralNode;
import org.apache.curator.framework.recipes.nodes.PersistentEphemeralNode.Mode;
import org.apache.curator.framework.state.ConnectionState;
import org.apache.curator.framework.state.ConnectionStateListener;
import org.apache.curator.retry.ExponentialBackoffRetry;
import org.apache.curator.test.KillSession;
import org.apache.curator.test.TestingServer;

/**
 * @author sdcuike
 *
 * @time 2016年1月31日 下午5:10:18
 *
 * @see http://ifeve.com/zookeeper-ephemeral-node/
 */
public class EphemeralNode {

    private static final String PATH = "/example/ephemeralNode";
    private static final String PATH2 = "/example/node";

    public static void main(String[] args) {
        try (TestingServer testingServer = new TestingServer();
                CuratorFramework client = CuratorFrameworkFactory.newClient(testingServer.getConnectString(), new ExponentialBackoffRetry(1000, 3));) {

            client.getConnectionStateListenable().addListener(new ConnectionStateListener() {

                @Override
                public void stateChanged(CuratorFramework client, ConnectionState newState) {
                    System.out.println("===client state:" + newState.name());

                }
            });

            client.start();

            PersistentEphemeralNode node = new PersistentEphemeralNode(client, Mode.EPHEMERAL, PATH, "test path".getBytes());
            node.start();
            node.waitForInitialCreate(3, TimeUnit.SECONDS);
            String actualPath = node.getActualPath();
            System.out.println("node:" + actualPath + "value:" + new String(client.getData().forPath(actualPath)));

            client.create().forPath(PATH2, "persistent node".getBytes());
            System.out.println("node " + PATH2 + "value:" + new String(client.getData().forPath(PATH2)));

            KillSession.kill(client.getZookeeperClient().getZooKeeper());

            System.out.println("node" + actualPath + "doesn't exist:" + (client.checkExists().forPath(actualPath) == null));

            System.out.println("node:" + PATH2 + "doesn't exist " + (client.checkExists().forPath(PATH2)));

        } catch (Exception e) {
            e.printStackTrace();
        }

    }

}


text:
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * Program to test different ways to get file info; right now it
 * only works for solaris and OS/2.
 *
 */
#include "nspr.h"
#include "prpriv.h"
#include "prinrval.h"

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#ifdef XP_OS2
#include <io.h>
#include <sys/types.h>
#include <sys/stat.h>
#endif

#define DEFAULT_COUNT 100000
PRInt32 count;

#ifndef XP_PC
char *filename = "/etc/passwd";
#else
char *filename = "..\\stat.c";
#endif

static void statPRStat(void)
{
    PRFileInfo finfo;
    PRInt32 index = count;

    for (;index--;) {
         PR_GetFileInfo(filename, &finfo);
    }
}

static void statStat(void)
{
    struct stat finfo;
    PRInt32 index = count;

    for (;index--;) {
        stat(filename, &finfo);
    }
}

/************************************************************************/

static void Measure(void (*func)(void), const char *msg)
{
    PRIntervalTime start, stop;
    double d;
    PRInt32 tot;

    start = PR_IntervalNow();
    (*func)();
    stop = PR_IntervalNow();

    d = (double)PR_IntervalToMicroseconds(stop - start);
    tot = PR_IntervalToMilliseconds(stop-start);

    printf("%40s: %6.2f usec avg, %d msec total\n", msg, d / count, tot);
}

int main(int argc, char **argv)
{
    PR_Init(PR_USER_THREAD, PR_PRIORITY_NORMAL, 0);
    PR_STDIO_INIT();

    if (argc > 1) {
	count = atoi(argv[1]);
    } else {
	count = DEFAULT_COUNT;
    }

    Measure(statPRStat, "time to call PR_GetFileInfo()");
    Measure(statStat, "time to call stat()");

    PR_Cleanup();
}


text:
<?php

$languageStrings = array(
	'SINGLE_SalesOrder'            => 'Orden Venta',
	'LBL_EXPORT_TO_PDF'            => 'Exportar a PDF',
	'LBL_ADD_RECORD'               => 'Añadir Orden Venta',
	'LBL_RECORDS_LIST'             => 'Lista de Ordenes Venta',
	'LBL_SO_INFORMATION'           => 'Detalles de Orden Venta',
	'SalesOrder No'                => 'Número Orden Venta',
	'Quote Name'                   => 'Referencia del Presupuesto',
	'Customer No'                  => 'Referencia del Cliente',
	'Requisition No'               => 'Referencia de la Orden',
	'Tracking Number'              => 'Nº de seguimiento',
	'Sales Commission'             => 'Comisión sobre Ventas',
	'Purchase Order'               => 'Orden Compra',
	'Vendor Terms'                 => 'Términos del Proveedor',
	'Pending'                      => 'Pendiente',
    'Recurring Invoive Information'=>'Recurrente Información Factura',
	'Enable Recurring'             => 'Habilitar facturación recurrente',
	'Frequency'                    => 'Frecuencia',
	'Start Period'                 => 'Inicio Periodo',
	'End Period'                   => 'Final Periodo',
	'Payment Duration'             => 'Duración Pago',
	'Invoice Status'               => 'Estado Factura',
	'Sub Total'                    => 'Sub Total',
	'AutoCreated'                  => 'Automática',
	'Sent'                         => 'Enviada',
	'Credit Invoice'               => 'Rectificativa',
	'Paid'                         => 'Pagada',
	'LBL_SEND_MAIL_PDF' => 'Enviar Email con PDF',
    'Daily'=>'Diario',
    'Monthly'=>'Mensual',
    'Quarterly'=>'Trimestral',
    'Yearly'=>'Anual',
    'Net 30 days'=>'30 días netos',
    'Net 45 days'=>'Net 45 días',
    'Net 60 days'=>'Netos 60 días',

	//Translation for product not found
	'LBL_THIS' => 'Este',
	'LBL_IS_DELETED_FROM_THE_SYSTEM_PLEASE_REMOVE_OR_REPLACE_THIS_ITEM' => 'ha sido eliminado de la aplicación. Por favor, elimina o sustituye este artículo.',
	'LBL_THIS_LINE_ITEM_IS_DELETED_FROM_THE_SYSTEM_PLEASE_REMOVE_THIS_LINE_ITEM' => 'Este artículo ha sido eliminado de la aplicación. Por favor, elimina o sustituye este artículo.',
);

$jsLanguageStrings = array(
		'JS_PLEASE_REMOVE_LINE_ITEM_THAT_IS_DELETED' => 'Por favor arregla la línea con artículo eliminado',
);


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="match_parent"
                android:layout_height="match_parent">

    <TextView
        android:id="@+id/week_item_text"
        android:layout_width="match_parent"
        android:layout_height="20dp"
        android:layout_centerInParent="true"
        android:background="@drawable/week_item_bg"
        android:gravity="center"
        android:padding="2dp"
        android:paddingBottom="15dp"
        android:text="一"/>

</RelativeLayout>


text:
<!-- Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
<query-profile id="yahoo/uk/test">
<field name="a.c">c</field>
</query-profile>


text:
'use strict';

// Communities controller
angular.module('communities').controller('CommunitiesController', ['$scope', '$stateParams', '$location', 'Authentication', 'Communities',
	function($scope, $stateParams, $location, Authentication, Communities ) {
		$scope.authentication = Authentication;

		// Create new Community
		$scope.create = function() {
			// Create new Community object
			var community = new Communities ({
				name: this.name
			});

			// Redirect after save
			community.$save(function(response) {
				$location.path('communities/' + response._id);

				// Clear form fields
				$scope.name = '';
			}, function(errorResponse) {
				$scope.error = errorResponse.data.message;
			});
		};

		// Remove existing Community
		$scope.remove = function( community ) {
			if ( community ) { community.$remove();

				for (var i in $scope.communities ) {
					if ($scope.communities [i] === community ) {
						$scope.communities.splice(i, 1);
					}
				}
			} else {
				$scope.community.$remove(function() {
					$location.path('communities');
				});
			}
		};

		// Update existing Community
		$scope.update = function() {
			var community = $scope.community ;

			community.$update(function() {
				$location.path('communities/' + community._id);
			}, function(errorResponse) {
				$scope.error = errorResponse.data.message;
			});
		};

		// Find a list of Communities
		$scope.find = function() {
			$scope.communities = Communities.query();
		};

		// Find existing Community
		$scope.findOne = function() {
			$scope.community = Communities.get({
				communityId: $stateParams.communityId
			});
		};
	}
]);


text:
package com.vmall.common.pojo;

import java.util.List;

public class EUDataGridResult {

	private long total;
	private List<?> rows;
	public long getTotal() {
		return total;
	}
	public void setTotal(long total) {
		this.total = total;
	}
	public List<?> getRows() {
		return rows;
	}
	public void setRows(List<?> rows) {
		this.rows = rows;
	}

}


text:
FROM ruby:2.4.1-alpine

MAINTAINER Jake Meyer <jakewmeyer@gmail.com>

RUN apk update && apk upgrade
RUN apk add --update alpine-sdk
RUN apk add ruby-bundler

WORKDIR /app
ADD Gemfile /app/Gemfile
ADD Gemfile.lock /app/Gemfile.lock
RUN bundle install --system

ADD . /app
RUN bundle install --system

EXPOSE 9292

CMD ["bundle", "exec", "puma", "-e", "production"]


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

import javax.swing.JPanel;

import org.jdom.Element;

/**
 * The VisualizationMethod class can be extended to create a visualization method for
 * the visualization of experimental data on GPML pathways
 */
public abstract class AbstractVisualizationMethod implements VisualizationMethod
{
	private boolean isConfigurable; //Configurable (if true, override createConfigComposite)
	private boolean isUseProvidedArea; //Does this plugin use reserved region in o.p.view.Graphics

	private Visualization visualization;

	/** Internal method, should be called by Visualization.add-,removeMethod() only */
	public void setVisualization(Visualization v) { visualization = v; }

	/**
	 * @return The {@link Visualization} this plugin belongs to. May be null!
	 */
	public final Visualization getVisualization() { return visualization; }

	/**
	 * Call this method whenever a setting is modified. It will
	 * notify the parent visualization of the modification.
	 */
	protected final void modified() {
		if (visualization != null) visualization.modified();
	}

	/**
	 * Save the configuration of the current instance of this class to an XML element.

	 * Override this method to save custom configuration settings:

	 *
	 * public Element toXML() {

	 *  Element elm = super.toXML();

	 *  //Add custom attributes and elements to elm, e.g.:

	 *  elm.setAttribute("fontsize", fontsize)

	 *

	 *  return elm;

	 * }
	 *
	 */
	public Element toXML() {
		Element elm = new Element(XML_ELEMENT);
		elm.setAttribute(XML_ATTR_NAME, getClass().toString());
		return elm;
	}

	/**
	 * Load the configuration of the current instance of this class from an XML element.

	 * Override this method to load custom configuration settings:

	 *
	 * public Element loadXML(Element xml) {

	 *  super.loadXML(xml)

	 *  //Load custom attributes and elements to elm, e.g.:

	 *  fontSize = xml.getAttributeValue("fontsize")

	 * }
	 *
	 * @param xml The {@link Element} that contains the configuration for this plugin
	 */
	public void loadXML(Element xml) { }

	/**
	 * Specify whether the parent {@link Visualization} needs to provide an area on the
	 * graphics.
	 * When multiple visualization plugins apply visualizations on the same {@link Graphics}
	 * object, the available space will be divided over the plugins for which this method is called
	 * with true as argument.
	 * The provided area can be obtained by calling {@link Visualization#provideDrawArea(AbstractVisualizationMethod, Graphics)}
	 * @param use	true if this plugin uses the provided area, false if not
	 * @see Visualization#provideDrawArea(AbstractVisualizationMethod, Graphics)
	 */
	protected void setUseProvidedArea(boolean use) {
		isUseProvidedArea = use;
	}

	/**
	 * Specify whether this visualization plugin is configurable or not.
	 * @param configurable
	 */
	protected void setIsConfigurable(boolean configurable) {
		isConfigurable = configurable;
	}

	/**
	 * Returns whether this visualization plugin is configurable or not
	 * @see AbstractVisualizationMethod#setIsConfigurable(boolean)
	 * @return true if this plugin is configurable, false otherwise
	 */
	public final boolean isConfigurable() { return isConfigurable; }

	public JPanel getConfigurationPanel() { return new JPanel(); }

	/**
	 * Returns whether this visualization plugin uses the area provided by
	 * the {@link Visualization} it belongs to.
	 * @see AbstractVisualizationMethod#setUseProvidedArea(boolean)
	 * @return true if this plugin uses the provided area, false otherwise
	 */
	public final boolean isUseProvidedArea() {
		return isUseProvidedArea;
	}

	public int compareTo(VisualizationMethod o)
	{
		return getName().compareTo(o.getName());
	}

	@Override
	public void setActive(boolean value) {}
}


text:
from urllib.parse import urljoin

OAUTH_BASE_ENDPOINT = "account/api/oauth/"
AUTH_ENDPOINT = urljoin(OAUTH_BASE_ENDPOINT, 'authorize.htm')
USER_ENDPOINT = urljoin(OAUTH_BASE_ENDPOINT, 'user.htm')

EMAIL_VALIDATION_ENDPOINT = "/account/validateEmail.htm"
EMAIL_VALIDATION_STATUS_ENDPOINT = "/account/api/isEmailValidated.htm"

TOU_ENDPOINT = "/account/user/termsOfUse.htm"
TOU_STATUS_ENDPOINT = "/account/api/isTermsOfUseCurrent.htm"

ENROLLMENT_ENDPOINT = "/account/api/enrollment.htm"
ENROLLMENT_STATUS_ENDPOINT = "/account/api/getEnrollment.htm"

USER_SEARCH_ENDPOINT = "/account/api/user.htm"
USERS_SEARCH_ENDPOINT = "/account/api/getUsers.htm"


text:
// ---------------------------------------------------------------------------
//  _    _          _
// | |  | |   /\   | |
// | |__| |  /  \  | |
// |  __  | / /\ \ | |
// | |  | |/ ____ \| |____
// |_|  |_/_/    \_\______|
//
// A C#/.NET Core implementation of Hypertext Application Language
// https://stateless.group/hal_specification.html
//
// MIT License
//
// Copyright (c) 2017 Sunny Chen
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
// ---------------------------------------------------------------------------

using System.Collections.Generic;

namespace Hal
{
    /// <summary>
    /// Represents that the implemented classes are link items.
    /// </summary>
    /// <remarks>
    /// For more information about the definition of each property, please refer to: https://tools.ietf.org/html/draft-kelly-json-hal-08.
    /// </remarks>
    public interface ILinkItem
    {
        /// <summary>
        /// Gets or sets the name attribute of a link item. This value is optional.
        /// </summary>
        /// <remarks>
        /// Its value MAY be used as a secondary key for selecting Link Objects
        /// which share the same relation type.
        /// </remarks>
        string? Name { get; set; }

        /// <summary>
        /// Gets or sets the href attribute of a link item. This value is required.
        /// </summary>
        /// <remarks>
        /// Its value is either a URI [RFC3986] or a URI Template [RFC6570].
        /// If the value is a URI Template then the <see cref="Link"/> Object SHOULD have a
        /// "templated" attribute whose value is true.
        /// </remarks>
        string Href { get; set; }

        /// <summary>
        /// Gets or sets a <see cref="bool"/> value which indicates if the <c>Href</c> property
        /// is a URI template. This value is optional.
        /// </summary>
        /// <remarks>
        /// Its value SHOULD be considered false if it is undefined or any other
        /// value than true.
        /// </remarks>
        bool? Templated { get; set; }

        /// <summary>
        /// Gets or sets the media type expected when dereferencing the target source. This value
        /// is optional.
        /// </summary>
        string? Type { get; set; }

        /// <summary>
        /// Gets or sets a URL which provides further information about the deprecation. This value is
        /// optional.
        /// </summary>
        /// <remarks>
        /// Its presence indicates that the link is to be deprecated (i.e.
        /// removed) at a future date.Its value is a URL that SHOULD provide
        /// further information about the deprecation.
        /// A client SHOULD provide some notification (for example, by logging a
        /// warning message) whenever it traverses over a link that has this
        /// property.The notification SHOULD include the deprecation property's
        /// value so that a client manitainer can easily find information about
        /// the deprecation.
        /// </remarks>
        string? Deprecation { get; set; }

        /// <summary>
        /// Gets or sets the URI that hints about the profile of the target resource. This
        /// value is optional.
        /// </summary>
        string? Profile { get; set; }

        /// <summary>
        /// Gets or sets a <see cref="string"/> value which is intended for labelling
        /// the link with a human-readable identifier. This value is optional.
        /// </summary>
        string? Title { get; set; }

        /// <summary>
        /// Gets or sets a <see cref="string"/> value which is intending for indicating
        /// the language of the target resource.
        /// </summary>
        string? Hreflang { get; set; }

        /// <summary>
        /// Gets a list of additional properties assigned to the current link item.
        /// </summary>
        IEnumerable<KeyValuePair<string, object>> Properties { get; }

        /// <summary>
        /// Adds a property to the additional properties collection.
        /// </summary>
        /// <param name="name">The name of the property.</param>
        /// <param name="value">The value of the property.</param>
        void AddProperty(string name, object value);

        /// <summary>
        /// Removes all the properties from the properties collection.
        /// </summary>
        void ClearProperties();

        /// <summary>
        /// Gets the property value by using the specified name.
        /// </summary>
        /// <param name="name">The name of the property which the property value should be returned.</param>
        /// <returns>The value of the property.</returns>
        object GetProperty(string name);
    }
}


text:
package lc.com.net_library.tcpudp;

import android.util.Log;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.net.SocketException;
import java.nio.ByteBuffer;
import java.nio.channels.DatagramChannel;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;

import lc.com.net_library.tcpudp.util.NETConfig;

/**
 * UDP 封装  基于byte [] 的数据流,基于NIO事件注册,系统底层通知的架构
 *
 * @author Lin
 */
class UdpConnection {
    static final String TAG = NETConfig.TAG;
    InetSocketAddress connectedAddress;
    DatagramChannel datagramChannel;
    int keepAliveMillis = 19000;
    final ByteBuffer readBuffer, writeBuffer;
    private SelectionKey selectionKey;
    private final Object writeLock = new Object();
    private long lastCommunicationTime;
    int bufferSize = 1024;
    int recevieLength=0;

    public UdpConnection() {
        readBuffer = ByteBuffer.allocate(bufferSize);
        writeBuffer = ByteBuffer.allocateDirect(bufferSize);
    }

    public void bind(Selector selector, InetSocketAddress localPort) throws IOException {
        close();
        readBuffer.clear();
        writeBuffer.clear();
        try {
            datagramChannel = selector.provider().openDatagramChannel();
            datagramChannel.socket().bind(localPort);
            datagramChannel.configureBlocking(false);
            selectionKey = datagramChannel.register(selector, SelectionKey.OP_READ);

            lastCommunicationTime = System.currentTimeMillis();
        } catch (IOException ex) {
            close();
            throw ex;
        }
    }

    public void connect(Selector selector, InetSocketAddress remoteAddress) throws IOException {
        close();
        readBuffer.clear();
        writeBuffer.clear();
        try {
            datagramChannel = selector.provider().openDatagramChannel();
                datagramChannel.socket().bind(new InetSocketAddress(NETConfig.NET_PORT));
                datagramChannel.socket().connect(remoteAddress);

            datagramChannel.configureBlocking(false);

            selectionKey = datagramChannel.register(selector, SelectionKey.OP_READ);

            lastCommunicationTime = System.currentTimeMillis();

            connectedAddress = remoteAddress;
        } catch (IOException ex) {
            close();
            IOException ioEx = new IOException("Unable to connect to: " + remoteAddress);
            ioEx.initCause(ex);
            throw ioEx;
        }
    }

    public InetSocketAddress readFromAddress() throws IOException {
        readBuffer.clear();
        recevieLength=0;
        DatagramChannel datagramChannel = this.datagramChannel;
        if (datagramChannel == null) throw new SocketException("Connection is closed.");
        lastCommunicationTime = System.currentTimeMillis();
        InetSocketAddress mupdAdr=null;
        /**
         * datagramChannel.receive(readBuffer)返回InetSocketAddress地址的API无效,关键是是否绑定远程地址,如没有绑定则有效
         */
//        if(!isConnnectTarget) {
//             mupdAdr = (InetSocketAddress) datagramChannel.receive(readBuffer);
//        }
        mupdAdr=(InetSocketAddress)datagramChannel.socket().getRemoteSocketAddress();
        if(mupdAdr!=null){
            byte [] temp=new byte[bufferSize];
            DatagramPacket mreceiveddp=new DatagramPacket(temp,temp.length);
            recevieLength=datagramChannel.read(readBuffer);
            if(recevieLength>0) {
                mupdAdr=(InetSocketAddress)datagramChannel.socket().getRemoteSocketAddress();
            }
        }else{
            mupdAdr = (InetSocketAddress) datagramChannel.receive(readBuffer);
        }
        return mupdAdr;
    }

    public byte[] readData(Connection connection) {
        byte[] data=null;
        try {
            readBuffer.flip();

            if(connectedAddress!=null){
                 data = new byte[recevieLength];
            }else{
                data = new byte[readBuffer.limit()];
            }
            readBuffer.get(data, 0, data.length);
            recevieLength=0;

        } catch (Exception ex) {
            Log.e(TAG, ex.getMessage());
        } finally {
            readBuffer.clear();
            return data;
        }
    }

    /**
     * This method is thread safe.
     */
    public int sendData(Connection connection, byte[] data, SocketAddress address) throws IOException {
        DatagramChannel datagramChannel = this.datagramChannel;
        if (datagramChannel == null) throw new SocketException("Connection is closed.");
        synchronized (writeLock) {
            try {
                writeBuffer.clear();
                writeBuffer.put(data);
                writeBuffer.flip();
                int length = writeBuffer.limit();
                datagramChannel.send(writeBuffer, address);

                lastCommunicationTime = System.currentTimeMillis();

                boolean wasFullWrite = !writeBuffer.hasRemaining();
                return wasFullWrite ? length : -1;
            } finally {
                writeBuffer.clear();
            }
        }
    }

    public void close() {
        connectedAddress = null;
        try {
            if (datagramChannel != null) {
                datagramChannel.close();
                datagramChannel = null;
                if (selectionKey != null) selectionKey.selector().wakeup();
            }
        } catch (IOException ex) {
            if (NETConfig.NET_DEBUG) Log.i(TAG, "Unable to close UDP connection.", ex);
        }
    }

    public boolean needsKeepAlive(long time) {
        return connectedAddress != null && keepAliveMillis > 0 && time - lastCommunicationTime > keepAliveMillis;
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<assembly name="Microsoft.VisualBasic.Compatibility">
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.BaseControlArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.BaseOcxArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.ButtonArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.CheckBoxArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.CheckedListBoxArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.ColorDialogArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.ComboBoxArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.DirListBox">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.DirListBoxArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.DriveListBox">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.DriveListBoxArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.FileListBox">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.FileListBoxArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.FixedLengthString">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.FontDialogArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.GroupBoxArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.HScrollBarArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.ImageListArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.LabelArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.ListBoxArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.ListBoxItem">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.ListViewArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.MaskedTextBoxArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.MenuItemArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.OpenFileDialogArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.PanelArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.PictureBoxArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.PrintDialogArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.ProgressBarArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.RadioButtonArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.RichTextBoxArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.SaveFileDialogArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.StatusBarArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.StatusStripArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.Support">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.TabControlArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.TextBoxArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.TimerArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.ToolBarArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.ToolStripArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.ToolStripMenuItemArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.TreeViewArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.VScrollBarArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.WebBrowserArray">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.WebClass">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.WebClassContainingClassNotOptional">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.WebClassCouldNotFindEvent">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.WebClassNextItemCannotBeCurrentWebItem">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.WebClassNextItemRespondNotFound">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.WebClassUserWebClassNameNotOptional">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.WebClassWebClassFileNameNotOptional">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.WebClassWebItemNotValid">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.WebItem">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.WebItemAssociatedWebClassNotOptional">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.WebItemClosingTagNotFound">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.WebItemCouldNotLoadEmbeddedResource">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.WebItemCouldNotLoadTemplateFile">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.WebItemNameNotOptional">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.WebItemNoTemplateSpecified">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.WebItemTooManyNestedTags">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
  <member name="T:Microsoft.VisualBasic.Compatibility.VB6.WebItemUnexpectedErrorReadingTemplateFile">
    <attribute ctor="M:AgentHeisenbug.Annotations.Generated.GeneratedThreadSafeAttribute.#ctor">
      <argument>Static</argument>
    </attribute>
  </member>
</assembly>


text:
module Dropbox
  module API

    class Connection

      module Requests

        def request(options = {})
          response = yield
          raise Dropbox::API::Error::ConnectionFailed if !response
          status = (response.respond_to?(:code) ? response.code : response.status).to_i
          case status
            when 400
              parsed = MultiJson.decode(response.body)
              raise Dropbox::API::Error::BadInput.new("400 - Bad input parameter - #{parsed['error']}")
            when 401
              raise Dropbox::API::Error::Unauthorized.new("401 - Bad or expired token")
            when 403
              parsed = MultiJson.decode(response.body)
              raise Dropbox::API::Error::Forbidden.new('403 - Bad OAuth request')
            when 404
              raise Dropbox::API::Error::NotFound.new("404 - Not found")
            when 405
              parsed = MultiJson.decode(response.body)
              raise Dropbox::API::Error::WrongMethod.new("405 - Request method not expected - #{parsed['error']}")
            when 406
              parsed = MultiJson.decode(response.body)
              raise Dropbox::API::Error.new("#{status} - #{parsed['error']}")
            when 429
              raise Dropbox::API::Error::RateLimit.new('429 - Rate Limiting in affect')
            when 300..399
              raise Dropbox::API::Error::Redirect.new("#{status} - Redirect Error")
            when 503
              parsed = MultiJson.decode(response.body)
              header_parse = MultiJson.decode(response.headers)
              error_message = "#{parsed["error"]}. Retry after: #{header_parse['Retry-After']}"
              raise Dropbox::API::Error.new("503 - #{error_message}")
            when 507
              raise Dropbox::API::Error::StorageQuota.new("507 - Dropbox storage quota exceeded.")
            when 500..502, 504..506, 508..599
              parsed = MultiJson.decode(response.body)
              raise Dropbox::API::Error.new("#{status} - Server error. Check http://status.dropbox.com/")
            else
              options[:raw] ? response.body : MultiJson.decode(response.body)
          end
        end

        def get_raw(endpoint, path, data = {}, headers = {})
          query = Dropbox::API::Util.query(data)
          request_url = "#{Dropbox::API::Config.prefix}#{path}?#{URI.parse(URI.encode(query))}"
          request(:raw => true) do
            if token.is_a?(::OAuth2::AccessToken)
              token(endpoint).get request_url, :headers => headers
            else
              token(endpoint).get request_url, headers
            end
          end
        end

        def get(endpoint, path, data = {}, headers = {})
          query = Dropbox::API::Util.query(data)
          request_url = "#{Dropbox::API::Config.prefix}#{path}?#{URI.parse(URI.encode(query))}"
          request do
            if token.is_a?(::OAuth2::AccessToken)
              token(endpoint).get request_url, :headers => headers
            else
              token(endpoint).get request_url, headers
            end
          end
        end

        def post(endpoint, path, data = {}, headers = {})
          request_url = "#{Dropbox::API::Config.prefix}#{path}"
          request do
            if token.is_a?(::OAuth2::AccessToken)
              token(endpoint).post request_url, :params => data, :headers => headers
            else
              token(endpoint).post request_url, data, headers
            end
          end
        end

        def put(endpoint, path, data = {}, headers = {})
          request_url = "#{Dropbox::API::Config.prefix}#{path}"
          request do
            if token.is_a?(::OAuth2::AccessToken)
              token(endpoint).put request_url, :params => data, :headers => headers
            else
              token(endpoint).put request_url, data, headers
            end
          end
        end

      end

    end

  end
end


text:
'''finalSteps.py - OpenFOAM working panel'''

import wx
from createRun import CreateRunFile
from definedWxClasses import RadioBtnsSizer, LabelFormat, GaugeFrame
import const
from jobsStatus import HandleJobsFrame

class TestFrame(wx.Frame):
    def __init__(self, loginInfo, *args, **kwargs):
        wx.Frame.__init__(self, None, *args, **kwargs)

        self.Center()
        self.SetSizerAndFit(FinalStepsSizer(self, loginInfo=loginInfo))
class FinalStepsSizer(wx.BoxSizer):
  '''Sizer to define the final steps in'''
  def __init__(self, parent, foamDataSizer=None, loginInfo=None, *args, **kwargs):
    wx.BoxSizer.__init__(self, wx.VERTICAL)

    '''some default values for bindings'''
    self.foamDataSizer = foamDataSizer
    self.loginInfo = loginInfo
    self.parent = parent

    '''CLUSTER SPECIFIC WIDGETS'''
    '''path to remote directory'''
    remLbl = LabelFormat(parent, label="Workspace folder:")
    remPath = LabelFormat(parent, label=loginInfo['remotePath'], size=(500,-1))
    remSizer = wx.BoxSizer(wx.HORIZONTAL)
    remSizer.AddMany([remLbl, remPath])

    """generate run"""
    genRunSizer = RadioBtnsSizer(parent, check=self.GenerateRun(),
        label="Use available 'run.pbs'?", disable=True, yesbtnName="genRun")

    '''queue sizer'''
    queueLbl = LabelFormat(parent, label='Insert cluster queue name:')
    self.queueName = wx.TextCtrl(parent, size=const.textBox, value='user')
    queueSizer = wx.BoxSizer(wx.HORIZONTAL)
    queueSizer.AddMany([queueLbl, self.queueName])

    '''BUTTONS'''
    space = (20, -1)
    sendBtn = wx.Button(parent, -1, "Send job to cluster", size=const.btnSize)
    loadBtn = wx.Button(parent, -1, "Jobs Managment", size=const.btnSize)
    sendBtn.Bind(wx.EVT_BUTTON, self.SendJob)
    loadBtn.Bind(wx.EVT_BUTTON, self.LoadCase)
    btnSizer = wx.BoxSizer(wx.HORIZONTAL)
    btnSizer.AddMany([sendBtn, space, loadBtn])

    '''final sizer (self)'''
    self.AddMany([const.hdelimit, const.hdelimit,
        (remSizer, 0, wx.LEFT|wx.EXPAND|wx.ALIGN_LEFT, 15), const.vdelimit,
        (genRunSizer, 0, wx.LEFT|wx.EXPAND|wx.ALIGN_LEFT, 15), const.vdelimit,
        (queueSizer, 0, wx.LEFT|wx.EXPAND|wx.ALIGN_LEFT, 15), const.vdelimit,
        (btnSizer, 0, wx.LEFT|wx.EXPAND|wx.ALIGN_LEFT, 15)
        ])

  def GenerateRun(self):
    '''runBtn event'''
    import os.path
    return os.path.exists(os.path.join(self.loginInfo['casePath'], 'run.pbs'))

  def SendJob(self, event, data={}):
    '''gather and submit all the inputed data to cluster'''
    self.loginInfo['queue'] = self.queueName.GetValue()
    '''submit and run the job on the cluster:'''
    if not self.parent.FindWindowByName("genRun").GetValue():
        """if a new run.pbs file has to be created:"""
        CreateRunFile(self.parent, self.foamDataSizer, self.loginInfo)
    GaugeFrame(action="submit", loginInfo=self.loginInfo).Show()

  def LoadCase(self, event):
    '''download case data from the cluster'''
    HandleJobsFrame(self.loginInfo).Show()

if __name__ == '__main__':
    app = wx.App(False)
    from remote_data import loginInfo
    TestFrame(loginInfo=loginInfo).Show()
    app.MainLoop()


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Workers
{
  public class EmailSender
  {
    public void Send(int userId, string message)
    {
      // Send an email to userId with the message
      System.Threading.Thread.Sleep(1000*10);
    }
  }
}


text:
class ReloadButtonTest : public ChromeRenderViewHostTestHarness {
 public:
  ReloadButtonTest();

  ReloadButtonTest(const ReloadButtonTest&) = delete;
  ReloadButtonTest& operator=(const ReloadButtonTest&) = delete;

  void CheckState(bool enabled,
                  ReloadButton::Mode intended_mode,
                  ReloadButton::Mode visible_mode,
                  bool double_click_timer_running,
                  bool mode_switch_timer_running);

  // These accessors eliminate the need to declare each testcase as a friend.
  void set_mouse_hovered(bool hovered) {
    reload_.testing_mouse_hovered_ = hovered;
  }
  int reload_count() { return reload_.testing_reload_count_; }

 protected:
  ReloadButton* reload() { return &reload_; }

 private:
  ChromeTestViewsDelegate<> views_delegate_;
  ReloadButton reload_;
};

ReloadButtonTest::ReloadButtonTest() : reload_(nullptr) {
  // Set the timer delays to 0 so that timers will fire as soon as we tell the
  // message loop to run pending tasks.
  reload_.double_click_timer_delay_ = base::TimeDelta();
  reload_.mode_switch_timer_delay_ = base::TimeDelta();
}

void ReloadButtonTest::CheckState(bool enabled,
                                  ReloadButton::Mode intended_mode,
                                  ReloadButton::Mode visible_mode,
                                  bool double_click_timer_running,
                                  bool mode_switch_timer_running) {
  EXPECT_EQ(enabled, reload_.GetEnabled());
  EXPECT_EQ(intended_mode, reload_.intended_mode_);
  EXPECT_EQ(visible_mode, reload_.visible_mode_);
  EXPECT_EQ(double_click_timer_running,
            reload_.double_click_timer_.IsRunning());
  EXPECT_EQ(mode_switch_timer_running, reload_.mode_switch_timer_.IsRunning());
}

TEST_F(ReloadButtonTest, Basic) {
  // The stop/reload button starts in the "enabled reload" state with no timers
  // running.
  CheckState(true, ReloadButton::Mode::kReload, ReloadButton::Mode::kReload,
             false, false);

  // Press the button.  This should start the double-click timer.
  ui::MouseEvent e(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(),
                   ui::EventTimeForNow(), 0, 0);
  views::test::ButtonTestApi test_api(reload());
  test_api.NotifyClick(e);
  CheckState(true, ReloadButton::Mode::kReload, ReloadButton::Mode::kReload,
             true, false);

  // Now change the mode (as if the browser had started loading the page).  This
  // should cancel the double-click timer since the button is not hovered.
  reload()->ChangeMode(ReloadButton::Mode::kStop, false);
  CheckState(true, ReloadButton::Mode::kStop, ReloadButton::Mode::kStop, false,
             false);

  // Press the button again.  This should change back to reload.
  test_api.NotifyClick(e);
  CheckState(true, ReloadButton::Mode::kReload, ReloadButton::Mode::kReload,
             false, false);
}

TEST_F(ReloadButtonTest, DoubleClickTimer) {
  // Start by pressing the button.
  ui::MouseEvent e(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(),
                   ui::EventTimeForNow(), 0, 0);
  views::test::ButtonTestApi test_api(reload());
  test_api.NotifyClick(e);

  // Try to press the button again.  This should do nothing because the timer is
  // running.
  int original_reload_count = reload_count();
  test_api.NotifyClick(e);
  CheckState(true, ReloadButton::Mode::kReload, ReloadButton::Mode::kReload,
             true, false);
  EXPECT_EQ(original_reload_count, reload_count());

  // Hover the button, and change mode.  The visible mode should not change,
  // again because the timer is running.
  set_mouse_hovered(true);
  reload()->ChangeMode(ReloadButton::Mode::kStop, false);
  CheckState(true, ReloadButton::Mode::kStop, ReloadButton::Mode::kReload, true,
             false);

  // Now fire the timer.  This should complete the mode change.
  base::RunLoop().RunUntilIdle();
  CheckState(true, ReloadButton::Mode::kStop, ReloadButton::Mode::kStop, false,
             false);
}

TEST_F(ReloadButtonTest, DisableOnHover) {
  // Change to stop and hover.
  ui::MouseEvent e(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(),
                   ui::EventTimeForNow(), 0, 0);
  views::test::ButtonTestApi(reload()).NotifyClick(e);
  reload()->ChangeMode(ReloadButton::Mode::kStop, false);
  set_mouse_hovered(true);

  // Now change back to reload.  This should result in a disabled stop button
  // due to the hover.
  reload()->ChangeMode(ReloadButton::Mode::kReload, false);
  CheckState(false, ReloadButton::Mode::kReload, ReloadButton::Mode::kStop,
             false, true);

  // Un-hover the button, which should allow it to reset.
  set_mouse_hovered(false);
  ui::MouseEvent e2(ui::ET_MOUSE_MOVED, gfx::Point(), gfx::Point(),
                    ui::EventTimeForNow(), 0, 0);
  reload()->OnMouseExited(e2);
  CheckState(true, ReloadButton::Mode::kReload, ReloadButton::Mode::kReload,
             false, false);
}

TEST_F(ReloadButtonTest, ResetOnClick) {
  // Change to stop and hover.
  ui::MouseEvent e(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(),
                   ui::EventTimeForNow(), 0, 0);
  views::test::ButtonTestApi test_api(reload());
  test_api.NotifyClick(e);
  reload()->ChangeMode(ReloadButton::Mode::kStop, false);
  set_mouse_hovered(true);

  // Press the button.  This should change back to reload despite the hover,
  // because it's a direct user action.
  test_api.NotifyClick(e);
  CheckState(true, ReloadButton::Mode::kReload, ReloadButton::Mode::kReload,
             false, false);
}

TEST_F(ReloadButtonTest, ResetOnTimer) {
  // Change to stop, hover, and change back to reload.
  ui::MouseEvent e(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(),
                   ui::EventTimeForNow(), 0, 0);
  views::test::ButtonTestApi(reload()).NotifyClick(e);
  reload()->ChangeMode(ReloadButton::Mode::kStop, false);
  set_mouse_hovered(true);
  reload()->ChangeMode(ReloadButton::Mode::kReload, false);

  // Now fire the stop-to-reload timer.  This should reset the button.
  base::RunLoop().RunUntilIdle();
  CheckState(true, ReloadButton::Mode::kReload, ReloadButton::Mode::kReload,
             false, false);
}


text:
namespace study
{
    public class ResponseStatus
    {
         public string StatusCode { get; set; }
        public string Description { get; set; }
    }
}


text:
package turkey
package tasks

import turkey.util._

import com.amazonaws.services.mturk.model.AssignmentStatus
import com.amazonaws.services.mturk.model.UpdateExpirationForHITRequest
import com.amazonaws.services.mturk.model.DeleteHITRequest
import com.amazonaws.services.mturk.model.ApproveAssignmentRequest
import com.amazonaws.services.mturk.model.RejectAssignmentRequest

import scala.util.{Try, Success, Failure}
import scala.concurrent.duration._
import scala.language.postfixOps

import akka.actor.Actor
import akka.actor.ActorRef

import upickle.default._

import com.typesafe.scalalogging.StrictLogging

/**
  * Manages a particular kind of task; corresponds to a single TaskSpecification / HIT Type.
  * In here will be all of the logic related to how to review HITs, do quality control, keep track of auxiliary data,
  * schedule which HITs should be uploaded when, etc.
  */
abstract class HITManager[Prompt, Response](
  helper: HITManager.Helper[Prompt, Response]
) extends Actor {

  import helper.Message._

  final override def receive = receiveHelperMessage orElse receiveAux

  // delegates to helper when given a standard message defined in the helper
  private[this] final val receiveHelperMessage: PartialFunction[Any, Unit] = {
    case ExpireAll => helper.expireAll
    case DeleteAll => helper.deleteAll
    case ReviewHITs => reviewHITs
    case AddPrompt(p) => addPrompt(p)
  }

  /** Override to add more incoming message types and message-processing logic */
  def receiveAux: PartialFunction[Any, Unit] =
    PartialFunction.empty[Any, Unit]

  /** Queries Turk and refreshes the task state, sending assignments for approval/validation,
    * approving/rejecting them, deleting HITs, etc. as necessary */
  def reviewHITs: Unit

  /** Adds a prompt to the set of prompts that this HITManager should be responsible for sourcing responses for. */
  def addPrompt(prompt: Prompt): Unit
}

object HITManager {
  /** Manages the ongoing state for a task with a particular HIT type;
    * keeps track of HITs and assignments that are active, saved, etc.
    * and gives convenience methods for interfacing with Turk. */
  class Helper[P, R](
    val taskSpec: TaskSpecification { type Prompt = P ; type Response = R })(
    implicit val promptReader: Reader[P],
    val responseReader: Reader[R],
    val responseWriter: Writer[R],
    val config: TaskConfig
  ) extends StrictLogging {
    private type Prompt = P
    private type Response = R

    import scala.collection.mutable

    object Message {
      sealed trait Message
      case object DeleteAll extends Message
      case object ExpireAll extends Message
      case object ReviewHITs extends Message
      case class AddPrompt(prompt: Prompt) extends Message
    }
    import Message._
    import taskSpec.hitTypeId

    def expireAll: Unit = {
      val currentlyActiveHITs = activeHITs.iterator.toList
      currentlyActiveHITs.foreach(expireHIT)
    }

    def deleteAll: Unit = {
      val currentlyActiveHITs = activeHITs.iterator.toList
      currentlyActiveHITs.foreach(deleteHIT)
    }

    // HITs Active stuff

    // active HITs are currently up on Turk
    // finished means the HIT is not on turk (i.e., all assignments are done)
    // actives by prompt includes HITs for which some assignments are done and some are not
    private[this] val (activeHITs, finishedHITInfosByPrompt, activeHITInfosByPrompt) = {
      val active = mutable.Set.empty[HIT[Prompt]]
      for {
        mTurkHIT <- config.service.listAllHITs
        if mTurkHIT.getHITTypeId.equals(hitTypeId)
        hit <- config.hitDataService.getHIT[Prompt](hitTypeId, mTurkHIT.getHITId).toOptionLogging(logger)
      } yield (active += hit)

      val finishedRes = mutable.Map.empty[Prompt, List[HITInfo[Prompt, Response]]]
      val activeRes = mutable.Map.empty[Prompt, List[HITInfo[Prompt, Response]]]
      config.hitDataService.getAllHITInfo[Prompt, Response](hitTypeId).get
        .groupBy(_.hit.prompt)
        .foreach { case (prompt, infos) =>
          infos.foreach { hitInfo =>
            if(active.contains(hitInfo.hit)) {
              activeRes.put(prompt, hitInfo :: activeRes.get(prompt).getOrElse(Nil))
            } else {
              finishedRes.put(prompt, hitInfo :: activeRes.get(prompt).getOrElse(Nil))
            }
          }
      }
      (active, finishedRes, activeRes)
    }

    def finishedHITInfosByPromptIterator: Iterator[(Prompt, List[HITInfo[Prompt, Response]])] =
      finishedHITInfosByPrompt.iterator
    def finishedHITInfos(p: Prompt): List[HITInfo[Prompt, Response]] =
      finishedHITInfosByPrompt.get(p).getOrElse(Nil)
    def activeHITInfosByPromptIterator: Iterator[(Prompt, List[HITInfo[Prompt, Response]])] =
      activeHITInfosByPrompt.iterator
    def activeHITInfos(p: Prompt): List[HITInfo[Prompt, Response]] =
      activeHITInfosByPrompt.get(p).getOrElse(Nil)
    def allCurrentHITInfosByPromptIterator: Iterator[(Prompt, List[HITInfo[Prompt, Response]])] =
      activeHITInfosByPromptIterator ++ finishedHITInfosByPromptIterator
    def allCurrentHITInfos(p: Prompt): List[HITInfo[Prompt, Response]] =
      activeHITInfos(p) ++ finishedHITInfos(p)

    /** Create a HIT with the specific parameters.
      * This should be used in order to ensure the helper has a consistent state.
      */
    def createHIT(prompt: Prompt, numAssignments: Int): Try[HIT[Prompt]] = {
      val attempt = taskSpec.createHIT(prompt, numAssignments)
      attempt match {
        case Success(hit) =>
          activeHITs += hit
          val newHITInfo = HITInfo[Prompt, Response](hit, Nil)
          activeHITInfosByPrompt.put(prompt, newHITInfo :: activeHITInfos(prompt))
          logger.info(s"Created HIT: ${hit.hitId}\n${config.workerUrl}/mturk/preview?groupId=${hit.hitTypeId}")
        case Failure(e) =>
          logger.error(e.getMessage)
          e.printStackTrace
      }
      attempt
    }

    def isActive(prompt: Prompt): Boolean = activeHITInfosByPrompt.contains(prompt)
    def isActive(hit: HIT[Prompt]): Boolean = activeHITs.contains(hit)
    def isActive(hitId: String): Boolean = activeHITs.exists(_.hitId == hitId)
    def numActiveHITs = activeHITs.size

    def expireHIT(hit: HIT[Prompt]): Unit = {
      val cal = java.util.Calendar.getInstance
      cal.add(java.util.Calendar.DATE, -1)
      val yesterday = cal.getTime
      Try(
        config.service.updateExpirationForHIT(
          (new UpdateExpirationForHITRequest)
            .withHITId(hit.hitId)
            .withExpireAt(yesterday)
        )
      ) match {
        case Success(_) =>
          logger.info(s"Expired HIT: ${hit.hitId}\nHIT type for expired HIT: ${hitTypeId}")
        case Failure(e) =>
          logger.error(s"HIT expiration failed:\n$hit\n$e")
      }
    }

    /** Deletes a HIT (if possible) and takes care of bookkeeping. */
    def deleteHIT(hit: HIT[Prompt]): Unit = {
      Try(config.service.deleteHIT((new DeleteHITRequest).withHITId(hit.hitId))) match {
        case Success(_) =>
          logger.info(s"Deleted HIT: ${hit.hitId}\nHIT type for deleted HIT: ${hitTypeId}")
          if(!isActive(hit)) {
            logger.error(s"Deleted HIT that isn't registered as active: $hit")
          } else {
            activeHITs -= hit
            // add to other appropriate data structures
            val finishedData = finishedHITInfos(hit.prompt)
            val activeData = activeHITInfos(hit.prompt)
            val curInfo = activeData
              .find(_.hit.hitId == hit.hitId)
              .getOrElse {
              logger.error("Could not find active HIT to move to finished");
              HITInfo(
                hit,
                config.hitDataService.getAssignmentsForHIT[Response](hitTypeId, hit.hitId).get)
            }
            val newActiveData = activeData.filterNot(_.hit.hitId == hit.hitId)
            val newFinishedData = curInfo :: finishedData
            if(newActiveData.isEmpty) {
              activeHITInfosByPrompt.remove(hit.prompt)
            } else {
              activeHITInfosByPrompt.put(hit.prompt, newActiveData)
            }
            finishedHITInfosByPrompt.put(hit.prompt, newFinishedData)
          }
        case Failure(e) =>
          logger.error(s"HIT deletion failed:\n$hit\n$e")
      }
    }

    // Assignment reviewing

    /** Represents an assignment waiting for a reviewing result. */
    class AssignmentInReview protected[Helper] (val assignment: Assignment[Response])

    private[this] val assignmentsInReview = mutable.Set.empty[AssignmentInReview]

    def getInReview(assignment: Assignment[Response]): Option[AssignmentInReview] =
      assignmentsInReview.find(_.assignment == assignment)
    def getInReview(assignmentId: String): Option[AssignmentInReview] =
      assignmentsInReview.find(_.assignment.assignmentId == assignmentId)
    def isInReview(assignment: Assignment[Response]): Boolean =
      getInReview(assignment).nonEmpty
    def isInReview(assignmentId: String): Boolean =
      getInReview(assignmentId).nonEmpty
    def numAssignmentsInReview = assignmentsInReview.size

    /** Mark an assignment as under review. */
    def startReviewing(assignment: Assignment[Response]): AssignmentInReview = {
      val aInRev = new AssignmentInReview(assignment)
      assignmentsInReview += aInRev
      aInRev
    }

    /** Process and record the result of reviewing an assignment. */
    def evaluateAssignment(
      hit: HIT[Prompt],
      aInRev: AssignmentInReview,
      evaluation: AssignmentEvaluation
    ): Unit = {
      import aInRev.assignment
      evaluation match {
        case Approval(message) => Try {
          config.service.approveAssignment(
            (new ApproveAssignmentRequest)
              .withAssignmentId(assignment.assignmentId)
              .withRequesterFeedback(message))
          assignmentsInReview -= aInRev
          val curData = activeHITInfos(hit.prompt)
          val curInfo = curData.find(_.hit.hitId == hit.hitId)
            .getOrElse {
            logger.error(s"Could not find active data for hit $hit")
            activeHITs += hit
            HITInfo[Prompt, Response](hit, Nil)
          }
          val filteredData = curData.filterNot(_.hit.hitId == hit.hitId)
          val newInfo = curInfo.copy(assignments = assignment :: curInfo.assignments)
          activeHITInfosByPrompt.put(hit.prompt, newInfo :: filteredData)
          logger.info(s"Approved assignment for worker ${assignment.workerId}: ${assignment.assignmentId}\n" +
                        s"HIT for approved assignment: ${assignment.hitId}; $hitTypeId")
          config.hitDataService.saveApprovedAssignment(assignment).recover { case e =>
            logger.error(s"Failed to save approved assignment; data:\n${write(assignment)}")
          }
        }
        case Rejection(message) => Try {
          config.service.rejectAssignment(
            (new RejectAssignmentRequest)
              .withAssignmentId(assignment.assignmentId)
              .withRequesterFeedback(message))
          assignmentsInReview -= aInRev
          logger.info(s"Rejected assignment: ${assignment.assignmentId}\n" +
                        s"HIT for rejected assignment: ${assignment.hitId}; ${hitTypeId}\n" +
                        s"Reason: $message")
          config.hitDataService.saveRejectedAssignment(assignment) recover { case e =>
            logger.error(s"Failed to save approved assignment; data:\n${write(assignment)}")
          }
        }
      }
    }
  }
}


text:
var Schema = require('jugglingdb').Schema;
var schema = new Schema('mysql', global.mysql.connection || {});

// Get models
var User = require('./user')(schema);
var Group = require('./group')(schema);

// Define Relationships
User.hasAndBelongsToMany('groups');
Group.hasAndBelongsToMany('users');

// Exports schema & models
module.exports = {
    schema: schema,
    User: User,
    Group: Group
};


text:
input[type="checkbox"] {
  position: absolute;
  overflow: hidden;
  padding: 0;
  border: 0;
  opacity: 0.001;
  z-index: 1;
  vertical-align: top;
  outline: none;
}
.checkbox,
.topcoat-checkbox__checkmark {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-background-clip: padding;
  -moz-background-clip: padding;
  background-clip: padding-box;
  position: relative;
  display: inline-block;
  vertical-align: top;
  cursor: default;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
.checkbox__label,
.topcoat-checkbox {
  position: relative;
  display: inline-block;
  vertical-align: top;
  cursor: default;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
.checkbox--disabled,
input[type="checkbox"]:disabled + .topcoat-checkbox__checkmark {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}
.checkbox:before,
.checkbox:after,
.topcoat-checkbox__checkmark:before,
.topcoat-checkbox__checkmark:after {
  content: '';
  position: absolute;
}
.checkbox:before,
.topcoat-checkbox__checkmark:before {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-background-clip: padding;
  -moz-background-clip: padding;
  background-clip: padding-box;
}
/* topdoc
  name: Checkbox
  description: Default skin for Topcoat checkbox
  modifiers:
    :focus: Focus state
    :disabled: Disabled state
  markup:

      <input type="checkbox">

      Default

      <input type="checkbox" disabled>

      Disabled

  examples:
    mobile checkbox: http://codepen.io/Topcoat/pen/piHcs
  tags:
    - desktop
    - light
    - mobile
    - checkbox
*/
.topcoat-checkbox__checkmark {
  height: 1rem;
}
input[type="checkbox"] {
  height: 1rem;
  width: 1rem;
  margin-top: 0;
  margin-right: -1rem;
  margin-bottom: -1rem;
  margin-left: 0;
}
input[type="checkbox"]:checked + .topcoat-checkbox__checkmark:after {
  opacity: 1;
}
.topcoat-checkbox {
  line-height: 1rem;
}
.topcoat-checkbox__checkmark:before {
  width: 1rem;
  height: 1rem;
  background: #e5e9e8;
  border: 1px solid #a5a8a8;
  -webkit-border-radius: 3px;
  border-radius: 3px;
  -webkit-box-shadow: inset 0 1px #fff;
  box-shadow: inset 0 1px #fff;
}
.topcoat-checkbox__checkmark {
  width: 1rem;
  height: 1rem;
}
.topcoat-checkbox__checkmark:after {
  top: 2px;
  left: 1px;
  opacity: 0;
  width: 14px;
  height: 4px;
  background: transparent;
  border: 7px solid #666;
  border-width: 3px;
  border-top: none;
  border-right: none;
  -webkit-border-radius: 1px;
  border-radius: 1px;
  -webkit-transform: rotate(-50deg);
  -moz-transform: rotate(-50deg);
  -o-transform: rotate(-50deg);
  -ms-transform: rotate(-50deg);
  transform: rotate(-50deg);
}
input[type="checkbox"]:focus + .topcoat-checkbox__checkmark:before {
  border: 1px solid #0940fd;
  -webkit-box-shadow: 0 0 0 2px #6fb5f1;
  box-shadow: 0 0 0 2px #6fb5f1;
}


text:
from setuptools import setup, find_packages

setup(
    name='django-media',
    packages=find_packages(),
    version='1.0.1',
    description='A basic Django application to store and manage media.',
    author='Peter Hogg',
    author_email='peter@havenaut.net',
    url='https://github.com/pigmonkey/django-media',
    classifiers=[
        "Programming Language :: Python",
        "License :: OSI Approved :: BSD License",
        "Operating System :: OS Independent",
        "Development Status :: 5 - Production/Stable",
        "Framework :: Django",
    ],
    long_description=open('README.md').read(),
    include_package_data=True,
    zip_safe=False,
    install_requires=['PIL'],
)


text:
from django.db import migrations
import django_extensions.db.fields.json

class Migration(migrations.Migration):

    dependencies = [
        ('scanners', '0007_remove_scannerresult_matches'),
    ]

    operations = [
        migrations.AlterField(
            model_name='scannerresult',
            name='results',
            field=django_extensions.db.fields.json.JSONField(default=[]),
        ),
    ]


text:
**********
Components
**********
.. automodule:: networkx.algorithms.components

Connectivity
------------
.. autosummary::
   :toctree: generated/

   is_connected
   number_connected_components
   connected_components
   connected_component_subgraphs
   node_connected_component

Strong connectivity
-------------------
.. autosummary::
   :toctree: generated/

   is_strongly_connected
   number_strongly_connected_components
   strongly_connected_components
   strongly_connected_component_subgraphs
   strongly_connected_components_recursive
   kosaraju_strongly_connected_components
   condensation

Weak connectivity
-----------------
.. autosummary::
   :toctree: generated/

   is_weakly_connected
   number_weakly_connected_components
   weakly_connected_components
   weakly_connected_component_subgraphs

Attracting components
---------------------
.. autosummary::
   :toctree: generated/

   is_attracting_component
   number_attracting_components
   attracting_components
   attracting_component_subgraphs

Biconnected components
----------------------
.. autosummary::
   :toctree: generated/

   is_biconnected
   biconnected_components
   biconnected_component_edges
   biconnected_component_subgraphs
   articulation_points

Semiconnectedness
-----------------
.. autosummary::
   :toctree: generated/

   is_semiconnected


text:
package ru.test.mantis.appmanager;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.boot.MetadataSources;
import org.hibernate.boot.registry.StandardServiceRegistry;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import ru.test.mantis.model.UserData;

import java.util.List;

/**
 * Created by Александра Гудкина on 22.05.2016.
 */
public class DbHelper {
    private final SessionFactory sessionFactory;

    public DbHelper() {
        final StandardServiceRegistry registry = new StandardServiceRegistryBuilder()
                .configure() // configures settings from hibernate.cfg.xml
                .build();
        this.sessionFactory = new MetadataSources( registry ).buildMetadata().buildSessionFactory();
    }
    public List<UserData> users(){
        Session session = sessionFactory.openSession();
        session.beginTransaction();
        List<UserData> result = session.createQuery("from UserData").list();
        session.getTransaction().commit();
        session.close();
        return result;
    }

    public UserData user (int id){
        Session session = sessionFactory.openSession();
        session.beginTransaction();
        UserData result = (UserData) session.createQuery("from UserData where id=:id").setParameter("id",id).uniqueResult();
        session.getTransaction().commit();
        session.close();
        return result;
    }
}


text:
#ifndef STRINGIFY_MACRO_VALUE_H
#define STRINGIFY_MACRO_VALUE_H

#include "stringifymacro.h"

#define STRINGIFYMACROVALUE(_macro) STRINGIFYMACRO(_macro)

#endif /* STRINGIFY_MACRO_VALUE_H */


text:
package com.hubbardgary.londontrails.view;

import android.content.res.AssetManager;
import android.graphics.Color;
import android.os.AsyncTask;

import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.LatLngBounds;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;
import com.google.android.gms.maps.model.PolylineOptions;
import com.hubbardgary.londontrails.R;
import com.hubbardgary.londontrails.dataprovider.CoordinateProvider;
import com.hubbardgary.londontrails.dataprovider.POIProvider;
import com.hubbardgary.londontrails.model.LondonTrailsPlacemark;
import com.hubbardgary.londontrails.model.POI;
import com.hubbardgary.londontrails.model.interfaces.IRoute;
import com.hubbardgary.londontrails.presenter.MapContentPresenter;
import com.hubbardgary.londontrails.view.interfaces.IMapContentView;
import com.hubbardgary.londontrails.view.interfaces.IShowMapView;
import com.hubbardgary.londontrails.viewmodel.MapContentViewModel;
import com.hubbardgary.londontrails.viewmodel.PathViewModel;
import com.hubbardgary.londontrails.viewmodel.ShowMapViewModel;

import java.util.ArrayList;
import java.util.List;

 /*
 * Called when map has been displayed to perform potentially expensive
 * route calculation without blocking the UI thread.
 */
public class MapContentActivity extends AsyncTask<Void, Void, Integer> implements IMapContentView {

    private IShowMapView showMapView;
    private PolylineOptions path;
    private MapContentViewModel vm;
    private ShowMapViewModel showMapVm;

    MapContentActivity(IShowMapView showMapView) {
        this.showMapView = showMapView;
        showMapVm = showMapView.getShowMapVm();
        MapContentPresenter presenter = new MapContentPresenter(this, showMapVm, new CoordinateProvider(), new POIProvider());
        vm = presenter.getMapContentViewModel();
    }

    @Override
    protected Integer doInBackground(Void... params) {
        getPath(vm.path);

        // Set default zoom bounds based on the route and points of interest we're plotting
        initializeDefaultBounds(vm.minimumLatitude, vm.minimumLongitude, vm.maximumLatitude, vm.maximumLongitude);
        return 1;
    }

    @Override
    protected void onPostExecute(Integer i) {
        // Route and markers have now been retrieved, so display them on the map.
        showMapView.setMapRoute(showMapView.getMap().addPolyline(path));
        addStartAndEndMarkers(showMapVm.start, showMapVm.end, showMapVm.route);
        addWayPointMarkers();
    }

    @Override
    public void getPath(PathViewModel path) {
        if (path.getCoordinates().size() > 1) {    // If length is 1, we only have 1 point so can't draw a line
            this.path = new PolylineOptions();
            this.path.width(5);
            this.path.color(Color.RED);

            LatLng from = new LatLng((path.getCoordinateLat(0)), (path.getCoordinateLng(0)));
            LatLng to;

            for (int i = 1; i < path.getCoordinates().size(); i++) {
                to = new LatLng((path.getCoordinateLat(i)), (path.getCoordinateLng(i)));
                this.path.add(from, to);
                from = new LatLng(to.latitude, to.longitude);
            }
        }
    }

    @Override
    public void initializeDefaultBounds(double minLatitude, double minLongitude, double maxLatitude, double maxLongitude) {
        LatLngBounds.Builder bounds = new LatLngBounds.Builder();
        bounds.include(new LatLng(minLatitude, minLongitude));
        bounds.include(new LatLng(maxLatitude, maxLongitude));
        showMapView.setDefaultBounds(bounds);
    }

    @Override
    public AssetManager getAssetManager() {
        return showMapView.getApplicationContextFromView().getAssets();
    }

     private void addStartAndEndMarkers(int start, int end, IRoute route) {
         if (showMapVm.route.isLinear() && start == end) {
             // Linear, and we're walking the full circuit
             pushPin(vm.startLatitude, vm.startLongitude, route.getSection(start).getStartLocationName(), "Your walk starts and ends here.", R.drawable.waypoint_startstop);
             return;
         }

         String startLabel, endLabel;
         if (route.isLinear()) {
             if (route.isCircular()) {
                 if (showMapVm.isClockwise) {
                     startLabel = route.getSection(start).getStartLocationName();
                     endLabel = route.getSection(end).getStartLocationName();
                 } else {
                     startLabel = route.getSection(start).getStartLocationName();
                     endLabel = route.getSection(end).getStartLocationName();
                 }
             } else {
                 if (showMapVm.isClockwise) {
                     startLabel = route.getSection(start).getStartLocationName();
                     endLabel = route.getSection(end - 1).getEndLocationName();
                 } else {
                     startLabel = route.getSection(start - 1).getEndLocationName();
                     endLabel = route.getSection(end).getStartLocationName();
                 }
             }
         } else {
             startLabel = route.getSection(start).getStartLocationName();
             endLabel = route.getSection(end).getEndLocationName();
         }

         pushPin(vm.startLatitude, vm.startLongitude, startLabel, "Your walk starts here.", R.drawable.waypoint_start);
         pushPin(vm.endLatitude, vm.endLongitude, endLabel, "Your walk ends here.", R.drawable.waypoint_stop);
     }

     private void addWayPointMarkers() {
         List<LondonTrailsPlacemark> placemarks = new ArrayList<>();
         for (POI p : vm.poi) {
             Marker marker = pushPin(
                     p.getLatitude(),
                     p.getLongitude(),
                     p.getTitle(),
                     p.getSnippet(),
                     p.getIsAlternativeEndPoint() ? R.drawable.waypoint_stop : R.drawable.waypoint_pause
             );

             placemarks.add(new LondonTrailsPlacemark(marker, p.getIsAlternativeEndPoint()));
         }
         showMapView.setPlacemarks(placemarks);
     }

     private Marker pushPin(double latitude, double longitude, String title, String snippet, int icon) {
         return showMapView.getMap().addMarker(new MarkerOptions()
                 .position(new LatLng(latitude, longitude))
                 .title(title)
                 .snippet(snippet)
                 .icon(BitmapDescriptorFactory.fromResource(icon)));
     }
}


text:
import { Subject } from 'rxjs';

import { Middleware } from 'redux';

import { Action, ArgumentAction } from './action';
import { Logic } from './logic';
import { Object } from './utilities';

//
// MIDDLEWARE
//

interface LogicMiddleware<
  State extends object = {},
  Dependency extends object = {},
  Context extends Object = undefined,
  Type extends string = string
> extends Middleware {
  (store: CreateLogicMiddleware.Store<State>): CreateLogicMiddleware.Next;

  monitor$: Subject<{
    action?:
      | 'op'
      | 'top'
      | 'bottom'
      | 'begin'
      | 'nesxPartial<t'
      | 'nextDisp'
      | 'nextError'
      | 'filtered'
      | 'cancelled'
      | 'dispatch'
      | 'dispCancelled'
      | 'end';
    name?: string;
    nextAction?: Action;
    shouldProcess?: boolean;
    dispAction?: Action;
  }>;

  addDeps(additionalDeps: Partial<Dependency>): void;

  addLogic(
    newLogics: Logic<State, any, any, Dependency, any>[]
  ): { logicCount: number };

  mergeNewLogic(
    newLogics: Logic<State, any, any, Dependency, any>[]
  ): { logicCount: number };

  replaceLogic(
    logics: Logic<State, any, any, Dependency, any>[]
  ): { logicCount: number };

  whenComplete<Fn extends Function>(callback?: Fn): Promise<Fn>;
}

/* ----- createLogicMiddleware ----- */

export function createLogicMiddleware<
  State extends object = {},
  Dependency extends object = {},
  Context extends Object = undefined,
  Type extends string = string
>(
  logics?: Logic<State, any, any, Dependency, Context, Type>[],
  deps?: Dependency
): LogicMiddleware<State, Dependency, Context, Type>;

export namespace CreateLogicMiddleware {
  export interface Store<State> {
    dispatch?: (action?: Action) => Action;
    getState?: () => State;
  }

  export type Next = (next: Function) => ActionCreator;

  export type ActionCreator = (action?: ArgumentAction) => Action;
}

// ---------------------------------------- //


text:
This document will outline how to contribute to the further development of the HackTX iOS. While this app has been specifically designed for use at HackTX, it can easily be adapted for use by any hackathon, so we appreciate any contributions to help us further our support back to the community. We have a few guidelines that we need contributors from the community to follow in order to keep things running smoothly.

## Getting Started

Fork then clone the repo replacing `your_username` with your actual GitHub username

    git clone git@github.com:your_username/iOS-HackTX-2015.git

## Making Changes

1. Create a branch with an appropriate name
  1. Branch off from where you want to base your work (usually the master branch)
  2. Please don't target release branches
  3. Do not work directly on master. If you submit a pull request directly on the master branch it will be closed.
2. Make your commits in logical units. There should not be tiny changes in all commits, nor should all your work be condensed in one commit.
3. Make sure you continue to follow the whitespace formatting. Remove extraneous whitespace using `git diff --check`

## Submitting Changes
Once you have pushed all changes to your fork, you can submit a pull request to the HackTX repo. A member from the HackTX iOS team will review your changes. If it all looks good, we'll merge it, otherwise we'll make suggestions how to fix it.


text:
module Spree
  module Api
    module V1
      class InventoryUnitsController < Spree::Api::BaseController
        before_action :prepare_event, only: :update

        def show
          @inventory_unit = inventory_unit
          respond_with(@inventory_unit)
        end

        def update
          authorize! :update, inventory_unit.order

          inventory_unit.transaction do
            if inventory_unit.update_attributes(inventory_unit_params)
              fire
              render :show, status: 200
            else
              invalid_resource!(inventory_unit)
            end
          end
        end

        private

        def inventory_unit
          @inventory_unit ||= InventoryUnit.accessible_by(current_ability, :read).find(params[:id])
        end

        def prepare_event
          return unless @event = params[:fire]

          can_event = "can_#{@event}?"

          unless inventory_unit.respond_to?(can_event) &&
              inventory_unit.send(can_event)
            render plain: { exception: "cannot transition to #{@event}" }.to_json,
                   status: 200
            false
          end
        end

        def fire
          inventory_unit.send("#{@event}!") if @event
        end

        def inventory_unit_params
          params.require(:inventory_unit).permit(permitted_inventory_unit_attributes)
        end
      end
    end
  end
end


text:
package com.pushinginertia.commons.web.searchnetwork;

import com.pushinginertia.commons.core.init.ListInitializer;
import com.pushinginertia.commons.net.IpIntervalMappings;
import edu.jwetherell.algorithms.dataStructures.IntervalTree;

/**
 * Enumerates the big and well-known search networks, such as Google or Bing.
 */
public class SearchNetworkIPs extends IpIntervalMappings<String> {
	public SearchNetworkIPs(final ListInitializer<IntervalTree.IntervalData<String>> initializer) {
		super(initializer);
	}
}


text:
@import "../variables.css";

.GameStartReadyScreen .ScreenBody {
  background: var(--white);
  justify-content: flex-start;
  align-items: flex-start;
  padding-top: 2em;
}

.GameStartReadyScreen .ScreenBody > div {
  margin-bottom: 1.5em;
}

.GameStartReadyScreen-code {
  margin-left: 1rem;
  font-size: 2em;
  font-weight: bold;
  color: var(--secondary);
}

.GameStartReadyScreen .title {
  margin-left: 1rem;
  margin-bottom: 0.5em;
  color: #5f5f5f;
}

.GameStartReadyScreen-Settings {
  width: 100%;
}

.Settings-List {
  margin: 0;
  padding: 0.5em 0;
  list-style-type: none;
}

.List-Row {
  padding: 0.25em 1.5em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-width: 1px 0;
  border-style: solid;
  border-color: #eee;
}

.Row-SettingName {
  font-weight: bold;
}

.Row-SettingValue {
}


text:
ace.define('ace/snippets/liquid', ['require', 'exports', 'module' ], function(require, exports, module) {

exports.snippetText = "";
exports.scope = "liquid";

});


text:
package ru.otus.chepiov.l2;

import org.junit.Test;

import java.util.ArrayList;
import java.util.LinkedList;

/**
 * Test cases for Sizer.
 *
 * @author Anvar Kiekbaev
 */
@SuppressWarnings({"Convert2MethodRef", "RedundantStringConstructorCall"})
public class SizerTest {

    @Test
    public void jol() {
        final long emptyObject = Sizer.byJOL(() -> new Object(){});
        final long emptyStringWithoutIntern = Sizer.byJOL(() -> new String(""));
        final long emptyString = Sizer.byJOL(() -> "");
        final long emptyArrayList = Sizer.byJOL(() -> new ArrayList());
        final long emptyLinkedList = Sizer.byJOL(() -> new LinkedList());

        System.out.println("==== JOL ====");
        System.out.printf("Size of the empty object: %d\n", emptyObject);
        System.out.printf("Size of the empty string without interning: %d\n", emptyStringWithoutIntern);
        System.out.printf("Size of the empty string: %d\n", emptyString);
        System.out.printf("Size of the empty array list: %d\n", emptyArrayList);
        System.out.printf("Size of the empty linked list: %d\n", emptyLinkedList);
    }

    @Test
    public void jamm() {
        final long emptyObject = Sizer.byJAMM(() -> new Object(){});
        final long emptyStringWithoutIntern = Sizer.byJAMM(() -> new String(""));
        final long emptyString = Sizer.byJAMM(() -> "");
        final long emptyArrayList = Sizer.byJAMM(() -> new ArrayList());
        final long emptyLinkedList = Sizer.byJAMM(() -> new LinkedList());

        System.out.println("==== JAMM ====");
        System.out.printf("Size of the empty object: %d\n", emptyObject);
        System.out.printf("Size of the empty string without interning: %d\n", emptyStringWithoutIntern);
        System.out.printf("Size of the empty string: %d\n", emptyString);
        System.out.printf("Size of the empty array list: %d\n", emptyArrayList);
        System.out.printf("Size of the empty linked list: %d\n", emptyLinkedList);
    }

    @Test
    public void jmx() {
        final long emptyObject = Sizer.byMemAssumption(() -> new Object(){});
        final long emptyStringWithoutIntern = Sizer.byMemAssumption(() -> new String(""));
        final long emptyString = Sizer.byMemAssumption(() -> "");
        final long emptyArrayList = Sizer.byMemAssumption(() -> new ArrayList());
        final long emptyLinkedList = Sizer.byMemAssumption(() -> new LinkedList());

        System.out.println("==== Memory assumption ====");
        System.out.printf("Size of the empty object: %d\n", emptyObject);
        System.out.printf("Size of the empty string without interning: %d\n", emptyStringWithoutIntern);
        System.out.printf("Size of the empty string: %d\n", emptyString);
        System.out.printf("Size of the empty array list: %d\n", emptyArrayList);
        System.out.printf("Size of the empty linked list: %d\n", emptyLinkedList);
    }

}


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = undefined;

var _inlineLists = require('./inlineLists');

var _inlineLists2 = _interopRequireDefault(_inlineLists);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

exports.default = _inlineLists2.default;
module.exports = exports['default'];
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9pbmxpbmVMaXN0cy9pbmRleC5qcyJdLCJuYW1lcyI6WyJkZWZhdWx0Il0sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7OztRQUVPQSxPIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnXG5cbmV4cG9ydCBkZWZhdWx0IGZyb20gJy4vaW5saW5lTGlzdHMnXG4iXX0=