text:
package org.openo.nfvo.resmanagement.service.rest;

import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;

import org.openo.baseservice.remoteservice.exception.ServiceException;
import org.openo.nfvo.resmanagement.common.VimUtil;
import org.openo.nfvo.resmanagement.common.constant.HttpConstant;
import org.openo.nfvo.resmanagement.common.constant.ParamConstant;
import org.openo.nfvo.resmanagement.common.constant.UrlConstant;
import org.openo.nfvo.resmanagement.common.util.request.RequestUtil;
import org.openo.nfvo.resmanagement.common.util.response.ResponseUtil;
import org.openo.nfvo.resmanagement.common.util.response.RoaResponseUtil;
import org.openo.nfvo.resmanagement.service.group.inf.ResOperateService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import net.sf.json.JSONObject;

/**
 * Resource Operate ROA Class.

 *

 *

 *
 * @author
 * @version NFVO 0.5 Sep 10, 2016
 */
@Path(UrlConstant.RESOPERATE_URL)
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public class ResOperateRoa {

    private static final Logger LOGGER = LoggerFactory.getLogger(ResOperateRoa.class);

    private ResOperateService resOperateService;

    /**
     * Update iResource pool.

     *
     * @param context
     * @param tenantId
     * @param vimId
     * @return
     * @throws ServiceException
     * @since NFVO 0.5
     */
    @PUT
    @Path(UrlConstant.MODRES_URL)
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public JSONObject updateIResPool(@Context HttpServletRequest context,
            @QueryParam(ParamConstant.PARAM_VIMID) String vimId) throws ServiceException {
        JSONObject json = RequestUtil.getAllJsonRequestBody(context);
        LOGGER.warn("ResPoolRoa::modVimId :{}", vimId);
        JSONObject vimInfo = VimUtil.getVimById(vimId);
        String tenant = vimInfo.getString("tenant");
        String tenantId = VimUtil.getTenantIdByName(tenant, vimId);
        try {
            resOperateService.updateIRes(tenantId, vimId, json);
            resOperateService.sendMsgMonitor("update", vimId);
            return RoaResponseUtil.update(HttpConstant.OK_CODE);
        } catch(ServiceException se) {
            LOGGER.error("ResOperateRoa::updateIResPool error:{}" + se);
            return ResponseUtil.genHttpResponse(HttpConstant.ERROR_CODE, se.getMessage());
        }
    }

    /**
     * Add all resource pool.

     *
     * @param context
     * @param tenantId
     * @param vimId
     * @return
     * @throws ServiceException
     * @since NFVO 0.5
     */
    @POST
    @Path(UrlConstant.ADDRES_URL)
    @Consumes(UrlConstant.APPLICATION_TYPE)
    @Produces(MediaType.APPLICATION_JSON)
    public JSONObject addAllResPool(@Context HttpServletRequest context,
            @QueryParam(ParamConstant.PARAM_TENANTID) String tenantId,
            @QueryParam(ParamConstant.PARAM_VIMID) String vimId) throws ServiceException {
        JSONObject json = RequestUtil.getAllJsonRequestBody(context);
        LOGGER.warn("ResOperateRoa::vimId :{}", vimId);

        try {
            resOperateService.addIRes(tenantId, vimId, json);
            resOperateService.sendMsgMonitor("create", vimId);
            return RoaResponseUtil.add(HttpConstant.OK_CODE);
        } catch(ServiceException se) {
            LOGGER.error("ResOperateRoa::addAllResPool error:{}" + se);
            return ResponseUtil.genHttpResponse(HttpConstant.ERROR_CODE, se.getMessage());
        }
    }

    /**
     * Delete iResource.

     *
     * @param context
     * @param vimId
     * @return
     * @throws ServiceException
     * @since NFVO 0.5
     */
    @DELETE
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public JSONObject deleteIRes(@Context HttpServletRequest context,
            @QueryParam(ParamConstant.PARAM_VIMID) String vimId) throws ServiceException {
        LOGGER.warn("ResOperateRoa::deleteIResource vimId:{}", vimId);

        try {
            resOperateService.sendMsgMonitor("delete", vimId);
            int result = resOperateService.deleteIRes(vimId);
            return RoaResponseUtil.delete(result);
        } catch(ServiceException se) {
            LOGGER.error("ResOperateRoa::deleteIRes error:{}" + se);
            return ResponseUtil.genHttpResponse(HttpConstant.ERROR_CODE, se.getMessage());
        }
    }

    public void setResOperateService(ResOperateService resOperateService) {
        this.resOperateService = resOperateService;
    }
}


text:
<?php
/**
 * Created by PhpStorm.
 * User: alex
 * Date: 27/10/2016
 * Time: 20:11
 */

namespace vr\api\components;

use yii\base\Exception;

/**
 * Class VerboseException
 * @package vr\api\components
 */
class VerboseException extends Exception
{
    /**
     * @var array
     */
    public $params;

    /**
     * VerboseException constructor.
     *
     * @param array $params
     */
    public function __construct($params)
    {
        $this->params = $params;
        parent::__construct('Getting action params. Please never use this exception', null, null);
    }
}

redpajama_set_name: RedPajamaGithub


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Lecanora expallens var. conizaea Ach.

### Remarks
null


text:
package com.example.appengine.firetactoe;

import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import com.google.api.client.http.LowLevelHttpRequest;
import com.google.api.client.http.LowLevelHttpResponse;
import com.google.api.client.testing.http.MockHttpTransport;
import com.google.api.client.testing.http.MockLowLevelHttpRequest;
import com.google.api.client.testing.http.MockLowLevelHttpResponse;
import com.google.appengine.tools.development.testing.LocalDatastoreServiceTestConfig;
import com.google.appengine.tools.development.testing.LocalServiceTestHelper;
import com.google.appengine.tools.development.testing.LocalURLFetchServiceTestConfig;
import com.google.appengine.tools.development.testing.LocalUserServiceTestConfig;
import com.google.common.collect.ImmutableMap;
import com.googlecode.objectify.Objectify;
import com.googlecode.objectify.ObjectifyFactory;
import com.googlecode.objectify.ObjectifyService;
import com.googlecode.objectify.util.Closeable;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.HashMap;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Unit tests for {@link DeleteServlet}.
 */
@RunWith(JUnit4.class)
public class DeleteServletTest {
  private static final String USER_EMAIL = "whisky@tangofoxtr.ot";
  private static final String USER_ID = "whiskytangofoxtrot";
  private static final String FIREBASE_DB_URL = "http://firebase.com/dburl";

  private final LocalServiceTestHelper helper =
      new LocalServiceTestHelper(
          // Set no eventual consistency, that way queries return all results.
          // http://g.co/cloud/appengine/docs/java/tools/localunittesting#Java_Writing_High_Replication_Datastore_tests
          new LocalDatastoreServiceTestConfig().setDefaultHighRepJobPolicyUnappliedJobPercentage(0),
          new LocalUserServiceTestConfig(),
          new LocalURLFetchServiceTestConfig()
          )
      .setEnvEmail(USER_EMAIL)
      .setEnvAuthDomain("gmail.com")
      .setEnvAttributes(new HashMap(
          ImmutableMap.of("com.google.appengine.api.users.UserService.user_id_key", USER_ID)));

  @Mock private HttpServletRequest mockRequest;
  @Mock private HttpServletResponse mockResponse;
  protected Closeable dbSession;

  private DeleteServlet servletUnderTest;

  @BeforeClass
  public static void setUpBeforeClass() {
    // Reset the Factory so that all translators work properly.
    ObjectifyService.setFactory(new ObjectifyFactory());
    ObjectifyService.register(Game.class);
    // Mock out the firebase config
    FirebaseChannel.firebaseConfigStream = new ByteArrayInputStream(
        String.format("databaseURL: \"%s\"", FIREBASE_DB_URL).getBytes());
  }

  @Before
  public void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);
    helper.setUp();
    dbSession = ObjectifyService.begin();

    servletUnderTest = new DeleteServlet();

    helper.setEnvIsLoggedIn(true);
    // Make sure there are no firebase requests if we don't expect it
    FirebaseChannel.getInstance().httpTransport = null;
  }

  @After
  public void tearDown() {
    dbSession.close();
    helper.tearDown();
  }

  @Test
  public void doPost_noGameKey() throws Exception {
    try {
      servletUnderTest.doPost(mockRequest, mockResponse);
      fail("Should not succeed with no gameKey specified.");
    } catch (IllegalArgumentException e) {
      assertThat(e.getMessage()).startsWith("id 'null'");
    }
  }

  @Test
  public void doPost_deleteGame() throws Exception {
    // Insert a game
    Objectify ofy = ObjectifyService.ofy();
    Game game = new Game(USER_ID, "my-opponent", "         ", true);
    ofy.save().entity(game).now();
    String gameKey = game.getId();
    when(mockRequest.getParameter("gameKey")).thenReturn(gameKey);

    // Mock out the firebase response. See
    // http://g.co/dv/api-client-library/java/google-http-java-client/unit-testing
    MockHttpTransport mockHttpTransport = spy(new MockHttpTransport() {
      @Override
      public LowLevelHttpRequest buildRequest(String method, String url) throws IOException {
        return new MockLowLevelHttpRequest() {
          @Override
          public LowLevelHttpResponse execute() throws IOException {
            MockLowLevelHttpResponse response = new MockLowLevelHttpResponse();
            response.setStatusCode(200);
            return response;
          }
        };
      }
    });
    FirebaseChannel.getInstance().httpTransport = mockHttpTransport;

    servletUnderTest.doPost(mockRequest, mockResponse);

    verify(mockHttpTransport, times(1)).buildRequest(
        eq("DELETE"), Matchers.matches(FIREBASE_DB_URL + "/channels/[\\w-]+.json$"));
  }
}


text:
package org.unbrokendome.jsonwebtoken.impl;

import org.unbrokendome.jsonwebtoken.BinaryData;
import org.unbrokendome.jsonwebtoken.JoseHeader;
import org.unbrokendome.jsonwebtoken.Jws;
import org.unbrokendome.jsonwebtoken.JwtDecodingProcessor;
import org.unbrokendome.jsonwebtoken.encoding.HeaderDeserializer;
import org.unbrokendome.jsonwebtoken.encoding.JwsDecoder;
import org.unbrokendome.jsonwebtoken.encoding.JwtMalformedTokenException;
import org.unbrokendome.jsonwebtoken.encoding.payload.PayloadDeserializer;
import org.unbrokendome.jsonwebtoken.signature.JwsSignatureException;
import org.unbrokendome.jsonwebtoken.signature.JwsUnsupportedAlgorithmException;
import org.unbrokendome.jsonwebtoken.signature.VerificationKeyResolver;
import org.unbrokendome.jsonwebtoken.signature.Verifier;

import javax.annotation.Nonnull;
import java.security.Key;
import java.util.List;
import java.util.Map;

public final class DefaultJwtDecodingProcessor implements JwtDecodingProcessor {

    private final List<PayloadDeserializer<?>> payloadDeserializers;
    private final Map<String, VerifierWithKeyResolver<?>> verifiers;
    private final HeaderDeserializer headerDeserializer;
    private final JwsDecoder jwsDecoder;

    DefaultJwtDecodingProcessor(List<PayloadDeserializer<?>> payloadDeserializers,
                                Map<String, VerifierWithKeyResolver<?>> verifiers,
                                HeaderDeserializer headerDeserializer,
                                JwsDecoder jwsDecoder) {
        this.payloadDeserializers = payloadDeserializers;
        this.verifiers = verifiers;
        this.headerDeserializer = headerDeserializer;
        this.jwsDecoder = jwsDecoder;
    }

    @Override
    @Nonnull
    public <T> T decode(String encodedToken, Class<T> payloadType) throws JwtMalformedTokenException,
            JwsUnsupportedAlgorithmException, JwsSignatureException {
        Jws jws = jwsDecoder.decode(encodedToken);

        JoseHeader header = headerDeserializer.deserialize(jws.getHeader());
        T payload = deserializePayload(jws.getPayload(), payloadType);

        verifySignature(jws, header, payload);

        return payload;
    }

    @Nonnull
    private <T> T deserializePayload(BinaryData payloadBytes, Class<T> payloadType) throws JwtMalformedTokenException {
        PayloadDeserializer<T> payloadSerializer = findPayloadSerializerForType(payloadType);

        try {
            return payloadSerializer.deserialize(payloadBytes, payloadType);
        } catch (Exception ex) {
            throw new JwtMalformedTokenException("Error deserializing JWT payload", ex);
        }
    }

    @SuppressWarnings("unchecked")
    @Nonnull
    private <T> PayloadDeserializer<T> findPayloadSerializerForType(Class<T> payloadType) {
        PayloadDeserializer<?> payloadDeserializer = payloadDeserializers
                .stream()
                .filter(ps -> ps.supports(payloadType))
                .findFirst()
                .orElseThrow(
                        () -> new IllegalStateException("No payload serializer could handle the payload of type: "
                                + payloadType));

        return (PayloadDeserializer<T>) payloadDeserializer;
    }

    @SuppressWarnings({"rawtypes", "unchecked"})
    private void verifySignature(Jws jws, JoseHeader header, Object payload)
            throws JwsUnsupportedAlgorithmException, JwsSignatureException {
        VerifierWithKeyResolver<?> verifierWithKeyResolver = getVerifierAndKeyResolver(header);

        VerificationKeyResolver<?> verificationKeyResolver = verifierWithKeyResolver.getVerificationKeyResolver();

        Verifier verifier = verifierWithKeyResolver.getVerifier();
        Key verificationKey = verificationKeyResolver.getVerificationKey(header, payload);

        verifier.verify(jws.getHeader(), jws.getPayload(), jws.getSignature(), verificationKey);
    }

    @Nonnull
    private VerifierWithKeyResolver<?> getVerifierAndKeyResolver(JoseHeader header)
            throws JwsUnsupportedAlgorithmException {
        String algorithmName = header.getAlgorithm();
        VerifierWithKeyResolver<?> verifierWithKeyResolver = verifiers.get(algorithmName);
        if (verifierWithKeyResolver == null) {
            throw new JwsUnsupportedAlgorithmException(algorithmName);
        }
        return verifierWithKeyResolver;
    }
}


text:
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>ssl::context::context (2 of 2 overloads)</title>
<link rel="stylesheet" href="../../../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="../../../../index.html" title="Asio">
<link rel="up" href="../context.html" title="ssl::context::context">
<link rel="prev" href="overload1.html" title="ssl::context::context (1 of 2 overloads)">
<link rel="next" href="../default_workarounds.html" title="ssl::context::default_workarounds">

ssl::context::context
          (2 of 2 overloads)

            Move-construct a context from another.

context(
    context && other);

            This constructor moves an SSL context from one object to another.

            Parameters

other

                  The other context object from which the move will occur.

            Remarks

            Following the move, the following operations only are valid for the moved-from
            object: * Destruction.

                As a target for move-assignment.

Copyright © 2003-2015 Christopher M.
      Kohlhoff

        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


text:
extern "C" {
#include "jpeglib.h"
}
#include <png.h>
#include <zlib.h>
#include "CImg.h"

using namespace cimg_library;
using namespace v8;
using namespace node;
using namespace std;

class EncodeToJpegBufferWorker : public NanAsyncWorker {
public:
    EncodeToJpegBufferWorker(
        Local<Object> & buff,
        size_t width,
        size_t height,
        int quality,
        NanCallback * callback
    );
    ~EncodeToJpegBufferWorker();
    void Execute ();
    void HandleOKCallback ();
private:
    unsigned char * _pixbuf;
    size_t _width;
    size_t _height;
    int _quality;
    char * _jpegbuf;
    size_t _jpegbufsize;
};

class EncodeToPngBufferWorker : public NanAsyncWorker {
public:
    EncodeToPngBufferWorker(
        Local<Object> & buff,
        size_t width,
        size_t height,
        int compression,
        bool interlaced,
        bool trans,
        NanCallback * callback
    );
    ~EncodeToPngBufferWorker();
    void Execute ();
    void HandleOKCallback ();
private:
    unsigned char * _pixbuf;
    size_t _width;
    size_t _height;
    int _compression;
    bool _interlaced;
    bool _trans;
    char * _pngbuf;
    size_t _pngbufsize;
};

typedef struct {
    unsigned char * buff;
    size_t buffsize;
} pngWriteCbData;

struct lwip_jpeg_error_mgr {
    struct jpeg_error_mgr pub;
    jmp_buf setjmp_buffer;
};

inline void lwip_jpeg_error_exit (j_common_ptr cinfo) {
    lwip_jpeg_error_mgr * lwip_jpeg_err = (lwip_jpeg_error_mgr *) cinfo->err;
    longjmp(lwip_jpeg_err->setjmp_buffer, 1);
}

NAN_METHOD(encodeToJpegBuffer);
NAN_METHOD(encodeToPngBuffer);
void pngWriteCB(png_structp png_ptr, png_bytep data, png_size_t length);
void initAll(Handle<Object> exports);

#endif


text:
"use strict";

var elementUI = $( "#Goldgained" );
var button = $( "#ElementButton" );
var button2 = $( "#ElementButton2" );
var secondary = $( '#Secondary' );

var lumber = $( '#GoldValue' );

var lumberDisplay = $( '#LumberDisplay' );

var elements = {water: '#WaterValue', fire: '#FireValue', nature: '#NatureValue', earth: '#EarthValue', light: '#LightValue', dark:'#DarkValue'};

var toggle = true; // True = Visible, false = collapsed

function UpdateGoldTower( data )
{
	lumber.text = data.lumber;
	elementUI.visible = true;
}

function UpdateElements( data )
{
	for(var element in data)
	{
		if( element in elements )
		{
			$(elements[element]).text = data[element];
		}
	}
}

function ShowButton()
{
	if(toggle)
		button.visible = true;
	else
		button2.visible = true;
}

function HideButton()
{
	if(toggle)
		button.visible = false;
	else
		button2.visible = false;
}

function ToggleCollapse()
{
	toggle = !toggle;
	Game.EmitSound("ui_generic_button_click");
	if (toggle)
	{
		button2.visible = false;
		button.visible = true;
		secondary.visible = true;
		elementUI.RemoveClass('small');
	}
	else
	{
		button2.visible = true;
		button.visible = false;
		secondary.visible = false;
		elementUI.AddClass('small');
	}
}

(function () {
  button.visible = false;
  button2.visible = false;
  lumberDisplay.visible = false;
  GameEvents.Subscribe( "etd_update_goldgained", UpdateGoldTower );
})();


text:
<pipelines>
  <link rel="self" href="https://go.seal-software.net/go/api/feed/pipelines.xml"/>
  <pipeline href="https://ci.example.com/go/api/feed/pipelines/go-pipeline-1/stages.xml"/>
  <pipeline href="https://ci.example.com/go/api/feed/pipelines/go-pipeline-2/stages.xml"/>
</pipelines>


text:
Heading With Desc
            Panel Description Here..

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce velit
            tortor, dictum in gravida nec, aliquet non lorem. pellentesque.ipiscing
            elit. Fusce velit tortor.


text:
title: Understand the Prototype Chain
---
## Understand the Prototype Chain

### Solution
Your code should show that Object.prototype is the prototype of Dog.prototype

``` javascript
function Dog(name) {
  this.name = name;
}

let beagle = new Dog("Snoopy");

Dog.prototype.isPrototypeOf(beagle);  // => true

// Fix the code below so that it evaluates to true
Object.prototype.isPrototypeOf(Dog.prototype);
```


text:
package org.araqne.logdb.cep;

public interface EventClockItem {

	EventKey getKey();

	String getHost();

	long getExpireTime();

	void setExpireTime(long expireTime);

	long getTimeoutTime();

	void setTimeoutTime(long timeoutTime);

}


text:
/**
 * @author Temdog007 / http://github.com/Temdog007
 */

import * as THREE from '../../build/three.module.js';

import { UIRow, UIText, UIInteger, UISelect, UICheckbox, UINumber } from './libs/ui.js';
import { UIPoints3 } from './libs/ui.three.js';

import { SetGeometryCommand } from './commands/SetGeometryCommand.js';

var SidebarGeometryTubeGeometry = function ( editor, object ) {

	var strings = editor.strings;

	var container = new UIRow();

	var geometry = object.geometry;
	var parameters = geometry.parameters;

	// points

	var pointsRow = new UIRow();
	pointsRow.add( new UIText( strings.getKey( 'sidebar/geometry/tube_geometry/path' ) ).setWidth( '90px' ) );

	var points = new UIPoints3().setValue( parameters.path.points ).onChange( update );
	pointsRow.add( points );

	container.add( pointsRow );

	// radius

	var radiusRow = new UIRow();
	var radius = new UINumber( parameters.radius ).onChange( update );

	radiusRow.add( new UIText( strings.getKey( 'sidebar/geometry/tube_geometry/radius' ) ).setWidth( '90px' ) );
	radiusRow.add( radius );

	container.add( radiusRow );

	// tubularSegments

	var tubularSegmentsRow = new UIRow();
	var tubularSegments = new UIInteger( parameters.tubularSegments ).onChange( update );

	tubularSegmentsRow.add( new UIText( strings.getKey( 'sidebar/geometry/tube_geometry/tubularsegments' ) ).setWidth( '90px' ) );
	tubularSegmentsRow.add( tubularSegments );

	container.add( tubularSegmentsRow );

	// radialSegments

	var radialSegmentsRow = new UIRow();
	var radialSegments = new UIInteger( parameters.radialSegments ).onChange( update );

	radialSegmentsRow.add( new UIText( strings.getKey( 'sidebar/geometry/tube_geometry/radialsegments' ) ).setWidth( '90px' ) );
	radialSegmentsRow.add( radialSegments );

	container.add( radialSegmentsRow );

	// closed

	var closedRow = new UIRow();
	var closed = new UICheckbox( parameters.closed ).onChange( update );

	closedRow.add( new UIText( strings.getKey( 'sidebar/geometry/tube_geometry/closed' ) ).setWidth( '90px' ) );
	closedRow.add( closed );

	container.add( closedRow );

	// curveType

	var curveTypeRow = new UIRow();
	var curveType = new UISelect().setOptions( { centripetal: 'centripetal', chordal: 'chordal', catmullrom: 'catmullrom' } ).setValue( parameters.path.curveType ).onChange( update );

	curveTypeRow.add( new UIText( strings.getKey( 'sidebar/geometry/tube_geometry/curvetype' ) ).setWidth( '90px' ), curveType );

	container.add( curveTypeRow );

	// tension

	var tensionRow = new UIRow().setDisplay( curveType.getValue() == 'catmullrom' ? '' : 'none' );
	var tension = new UINumber( parameters.path.tension ).setStep( 0.01 ).onChange( update );

	tensionRow.add( new UIText( strings.getKey( 'sidebar/geometry/tube_geometry/tension' ) ).setWidth( '90px' ), tension );

	container.add( tensionRow );

	//

	function update() {

		tensionRow.setDisplay( curveType.getValue() == 'catmullrom' ? '' : 'none' );

		editor.execute( new SetGeometryCommand( editor, object, new THREE.TubeBufferGeometry(
			new THREE.CatmullRomCurve3( points.getValue(), closed.getValue(), curveType.getValue(), tension.getValue() ),
			tubularSegments.getValue(),
			radius.getValue(),
			radialSegments.getValue(),
			closed.getValue()
		) ) );

	}

	return container;

};

export { SidebarGeometryTubeGeometry };


text:
package com.sessionm.smp_auth;

import android.app.ProgressDialog;
import android.support.annotation.VisibleForTesting;
import android.support.v7.app.AppCompatActivity;

public class BaseActivity extends AppCompatActivity {

    @VisibleForTesting
    public ProgressDialog mProgressDialog;

    public void showProgressDialog() {
        if (mProgressDialog == null) {
            mProgressDialog = new ProgressDialog(this);
            mProgressDialog.setMessage(getString(R.string.loading));
            mProgressDialog.setIndeterminate(true);
        }

        mProgressDialog.show();
    }

    public void hideProgressDialog() {
        if (mProgressDialog != null && mProgressDialog.isShowing()) {
            mProgressDialog.dismiss();
        }
    }

    @Override
    public void onStop() {
        super.onStop();
        hideProgressDialog();
    }

}


text:
export GO111MODULE=on

source $(dirname $0)/../vendor/knative.dev/hack/presubmit-tests.sh

# We use the default build, unit and integration test runners.

function integration_tests() {
  local options=""
  local failed=0
  e2e_test="test/e2e-tests.sh"
  echo "Running integration test ${e2e_test}"
  if ! ${e2e_test} ${options}; then
    failed=1
  fi
  return ${failed}
}

main $@


text:
import pytest
import responses

from feedrsub.ingestion import subscriber
from feedrsub.models.entry import Entry
from feedrsub.models.feed import Feed, STATUS
from feedrsub.utils.exceptions import SubscriberError

def test_subscribe_failed(session):
    topic = "http://test.com/feed"
    hub = "http://push.superfeedr.com"

    Feed(topic=topic).save()

    with responses.RequestsMock() as rsps:
        rsps.add(
            rsps.POST,
            hub,
            body='{"error": "not found"}',
            status=404,
            content_type="application/json",
        )

        result = subscriber.subscribe(topic, hub)

        feed = Feed.query.filter_by(topic=topic).first()

        assert result[0] == 404
        assert feed is not None
        assert feed.status == STATUS.PENDING_SUB
        assert feed.sub_time is None

def test_subscribe_succeeded(session):
    topic = "http://test.com/feed"
    hub = "http://push.superfeedr.com"

    Feed(topic=topic).save()

    with responses.RequestsMock() as rsps:
        rsps.add(
            rsps.POST,
            hub,
            body='{"title": "Success"}',
            status=204,
            content_type="application/json",
        )

        result = subscriber.subscribe(topic, hub)

        assert result[0] == 204
        feed = Feed.query.filter_by(topic=topic).first()
        assert feed.status == STATUS.PENDING_SUB

def test_subscribe_succeeded_with_content(
    session, signal_notification_received, xml_data
):
    topic = "http://test.com/feed"
    hub = "http://push.superfeedr.com"

    Feed(topic=topic).save()

    with responses.RequestsMock() as rsps:
        rsps.add(
            rsps.POST,
            hub,
            body=xml_data,
            status=200,
            content_type="application/rss+xml",
        )

        result = subscriber.subscribe(topic, hub)
        assert result[0] == 200

    feed = Feed.query.filter_by(topic=topic).first()
    assert feed.title == "David Beath"
    assert feed.status == STATUS.PENDING_SUB

    entryCount = Entry.query.count()
    assert entryCount == 10

def test_subscribe_raises_error(session):
    topic = "http://test.com"

    with pytest.raises(SubscriberError):
        subscriber.subscribe(topic)

    Feed(topic=topic).save()

    with pytest.raises(SubscriberError):
        subscriber.subscribe(topic=topic, hub=None)

def test_unsubscribe_raises_error(session):
    topic = "http://test.com"

    with pytest.raises(SubscriberError):
        subscriber.unsubscribe(topic=topic)

    feed = Feed(topic=topic).save()

    with pytest.raises(SubscriberError):
        subscriber.unsubscribe(topic=topic)

    feed.is_push = True

    with pytest.raises(SubscriberError):
        subscriber.unsubscribe(topic=topic)

    feed.hub = "http://test.com/hub"

    with pytest.raises(SubscriberError):
        subscriber.unsubscribe(topic=topic)

    feed.status = STATUS.UNSUBSCRIBED

    with pytest.raises(SubscriberError):
        subscriber.unsubscribe(topic=topic)

def test_unsubscribe(session):
    topic = "http://test.com/feed"
    hub = "http://push.superfeedr.com"

    feed = Feed(topic=topic, status=STATUS.SUBSCRIBED, hub=hub, is_push=True).save()

    with responses.RequestsMock() as rsps:
        rsps.add(rsps.POST, hub, status=200)

        status, message = subscriber.unsubscribe(topic)
        assert status == 200

        assert feed.status == STATUS.PENDING_UNSUB


text:
package com.jetbrains.python.psi.impl;

import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.util.containers.ContainerUtil;
import com.jetbrains.python.psi.*;
import com.jetbrains.python.psi.types.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.*;

/**
* @author yole
*/
public class CallArgumentsMappingImpl implements CallArgumentsMapping {

  private final Map<PyExpression, PyNamedParameter> myPlainMappedParams; // one param per arg
  private final Map<PyExpression, List<PyNamedParameter>> myNestedMappedParams; // one arg sweeps a nested tuple of params
  private PyStarArgument myTupleArg; // the *arg
  private PyStarArgument myKwdArg;   // the **arg
  private final List<PyNamedParameter> myTupleMappedParams; // params mapped to *arg
  private final List<PyNamedParameter> myKwdMappedParams;   // params mapped to **arg
  private final List<PyNamedParameter> myUnmappedParams;
  private final Map<PyExpression, EnumSet<ArgFlag>> myArgFlags; // flags of every arg
  private PyCallExpression.PyMarkedCallee myMarkedCallee;
  private PyArgumentList myArgumentList;

  public CallArgumentsMappingImpl(PyArgumentList arglist) {
    // full of empty containers
    myPlainMappedParams = new LinkedHashMap<PyExpression, PyNamedParameter>();
    myNestedMappedParams = new LinkedHashMap<PyExpression, List<PyNamedParameter>>();
    myTupleMappedParams = new ArrayList<PyNamedParameter>();
    myKwdMappedParams = new ArrayList<PyNamedParameter>();
    myUnmappedParams = new ArrayList<PyNamedParameter>();
    myArgFlags = new HashMap<PyExpression, EnumSet<ArgFlag>>();
    myMarkedCallee = null;
    myArgumentList = arglist;
  }

  /**
   * Maps arguments of a call to parameters of a callee.
   * must contain already resolved callee with flags set appropriately.
   *

   * NOTE: <tt>*arg</tt> of unknown length is considered to be long just enough to fill appropriate
   * positional paramaters, but at least one item long.
   * @param arguments what to map, get if from call site
   * @param resolved_callee what to map parameters of
   * @param context optional shared type evaluator / cache.
   */
  public void mapArguments(PyCallExpression.PyMarkedCallee resolved_callee, @NotNull TypeEvalContext context) {
    PyExpression[] arguments = myArgumentList.getArguments();
    myMarkedCallee = resolved_callee;
    final List<PyExpression> unmatched_subargs = new LinkedList<PyExpression>(); // unmatched nested arguments will go here
    List<PyExpression> unmatched_args = verifyArguments();

    final List<PyParameter> parameters = PyUtil.getParameters(myMarkedCallee.getCallable(), context);
    // prepare parameter slots
    Map<PyNamedParameter, PyExpression> slots = new LinkedHashMap<PyNamedParameter, PyExpression>();
    PyNamedParameter kwd_par = null;   // **param
    PyNamedParameter tuple_par = null; // *param
    Set<PyExpression> mapped_args = new HashSet<PyExpression>();
    final int implicitOffset = resolved_callee.getImplicitOffset();
    int positional_index = 0; // up to this index parameters are positional
    // check positional arguments, fill slots
    int i = 0;
    for (PyParameter par : parameters) {
      if (tuple_par == null && kwd_par == null && positional_index < implicitOffset) {
        positional_index += 1;
        continue;
      }
      PyNamedParameter n_par = par.getAsNamed();
      if (n_par != null) {
        if (n_par.isPositionalContainer()) tuple_par = n_par;
        else if (n_par.isKeywordContainer()) kwd_par = n_par;
        else {
          slots.put(n_par, null); // regular parameter that may serve as positional/named
          if (tuple_par == null && kwd_par == null) {
            positional_index += 1; // only if we're not past *param / **param
          }
        }
      }
      else {
        PyTupleParameter t_par = par.getAsTuple();
        if (t_par != null) positional_index += 1; // tuple can only be positional
        // else lone star, skip
      }
      i += 1;
    }
    // rule out 'self' or other implicit params
    for (i=0; i < implicitOffset && i < parameters.size(); i+=1) {
      slots.remove(parameters.get(i).getAsNamed());
      positional_index += 1;
    }
    // now params to the left of positional_index are positional.
    // map positional args to positional params.
    // we assume that implicitly skipped parameters are never nested tuples. no idea when they could ever be.
    int cnt = implicitOffset;
    int positional_bound = arguments.length; // to the right of this pos args are verboten
    ListIterator<PyExpression> unmatched_arg_iter = unmatched_args.listIterator();
    while (unmatched_arg_iter.hasNext()) {
      PyExpression arg = unmatched_arg_iter.next();
      if (arg instanceof PyStarArgument || arg instanceof PyKeywordArgument) {
        positional_bound = cnt;
        break;
      }
      if (cnt < parameters.size() && cnt < positional_index) {
        final PyParameter par = parameters.get(cnt);
        PyNamedParameter n_par = par.getAsNamed();
        if (n_par != null) {
          cnt += 1;
          slots.put(n_par, PyUtil.peelArgument(arg));
          mapped_args.add(arg);
        }
        else {
          PyTupleParameter t_par = par.getAsTuple();
          if (t_par != null) {
            if (arg instanceof PyParenthesizedExpression) {
              mapped_args.add(arg); // tuple itself is always mapped; its insides can fail
            }
            else {
              PyType arg_type = context.getType(arg);
              if (arg_type != null && arg_type.isBuiltin(context) && "list".equals(arg_type.getName())) {
                mapped_args.add(arg); // we can't really analyze arbitrary lists statically yet
                // but ListLiteralExpressions are handled by visitor
              }
            }
            unmatched_arg_iter.previous();
            MyParamVisitor visitor = new MyParamVisitor(unmatched_arg_iter, this);
            visitor.enterTuple(t_par.getAsTuple()); // will recur as needed
            unmatched_subargs.addAll(visitor.getUnmatchedSubargs()); // what didn't match inside
            cnt += 1;
          }
          // else: goes to *param
        }
      }
      else break;
    }
    // anything left after mapping of nested-tuple params?
    for (Map.Entry<PyExpression, List<PyNamedParameter>> pair : myNestedMappedParams.entrySet()) {
      PyExpression arg = pair.getKey();
      List<PyNamedParameter> params = pair.getValue();
      mapped_args.add(arg);
      for (PyNamedParameter n_par : params) slots.remove(n_par);
    }
    for (PyExpression arg : unmatched_subargs) {
      markArgument(arg, ArgFlag.IS_UNMAPPED);
    }

    boolean seen_named_args = false;
    // map named args to named params if possible
    Map<String, PyNamedParameter> parameter_by_name = new LinkedHashMap<String, PyNamedParameter>();
    for (PyParameter par : parameters) {
      PyNamedParameter n_par = par.getAsNamed();
      if (n_par != null) parameter_by_name.put(n_par.getName(), n_par);
    }
    for (PyExpression arg : arguments) {
      if (arg instanceof PyKeywordArgument) { // to explicitly named param?
        String arg_name = ((PyKeywordArgument)arg).getKeyword();
        PyNamedParameter respective_par = parameter_by_name.get(arg_name);
        if (respective_par != null && !respective_par.isKeywordContainer() && !respective_par.isPositionalContainer()) {
          if (slots.get(respective_par) != null) markArgument(arg, ArgFlag.IS_DUP);
          else slots.put(respective_par, arg);
        }
        else { // to **param?
          if (kwd_par != null) {
            myPlainMappedParams.put(arg, kwd_par);
            mapped_args.add(arg);
          }
        }
        seen_named_args = true;
      }
    }
    // map *arg to positional params if possible
    boolean tuple_arg_not_exhausted = false;
    boolean tuple_dup_found = false;
    if (cnt < parameters.size() && cnt < positional_index && myTupleArg != null) {
      // check length of myTupleArg
      PyType tuple_arg_type = null;
      final PyExpression expression = PsiTreeUtil.getChildOfType(myTupleArg, PyExpression.class);
      if (expression != null) {
        tuple_arg_type = context.getType(expression);
      }
      int tuple_length;
      boolean tuple_length_known;
      if (tuple_arg_type instanceof PyTupleType) {
        tuple_length = ((PyTupleType)tuple_arg_type).getElementCount();
        tuple_length_known = true;
      }
      else {
        tuple_length = 2000000; // no practical function will have so many positional params
        tuple_length_known = false;
      }
      int mapped_params_count = 0;
      while (cnt < parameters.size() && cnt < positional_index && mapped_params_count < tuple_length) {
        PyParameter par = parameters.get(cnt);
        if (par instanceof PySingleStarParameter) break;
        PyNamedParameter n_par = par.getAsNamed();
        if (slots.containsKey(n_par)) {
          final PyExpression arg_here = slots.get(n_par);
          if (arg_here != null) {
            if (tuple_length_known) {
              final EnumSet<ArgFlag> flags = myArgFlags.get(arg_here);
              if (flags == null || flags.isEmpty()) {
                markArgument(arg_here, ArgFlag.IS_DUP);
                tuple_dup_found = true;
              }
            }
            // else: unknown tuple length is just enough
            // the spree is over
            break;
          }
          else if (n_par != null) { // normally always true
            myTupleMappedParams.add(n_par);
            mapped_args.add(myTupleArg);
            slots.remove(n_par);
          }
        }
        else if (n_par == tuple_par) {
          mapped_params_count = tuple_length; // we found *param for our *arg, consider it fully mapped
          break;
        }
        cnt += 1;
        mapped_params_count += 1;
      }
      if (
        tuple_length_known && (mapped_params_count < tuple_length) || // not exhausted
        mapped_params_count == 0 // unknown length must consume at least first param
        ) {
        tuple_arg_not_exhausted = true;
      }
    }
    // map *param to the leftmost chunk of unmapped positional args
    // NOTE: ignores the structure of nested-tuple params!
    if (tuple_par != null) {
      i = 0;
      while (i < arguments.length && mapped_args.contains(arguments[i]) && isPositionalArg(arguments[i])) {
        i += 1; // skip first mapped args
      }
      if (i < arguments.length && isPositionalArg(arguments[i])) {
        while (i < arguments.length && !mapped_args.contains(arguments[i]) && isPositionalArg(arguments[i])) {
          myPlainMappedParams.put(arguments[i], tuple_par);
          mapped_args.add(arguments[i]);
          i += 1;
        }
      }
    }
    // map unmapped *arg to *param
    if (myTupleArg != null && tuple_par != null) {
      if (!mapped_args.contains(myTupleArg)) {
        myTupleMappedParams.add(tuple_par);
        mapped_args.add(myTupleArg);
      }
      else if (! seen_named_args && tuple_arg_not_exhausted) {
        // case of (*(1, 2, 3)) -> (a, *b); map the rest of *arg to *param
        myTupleMappedParams.add(tuple_par);
        mapped_args.add(myTupleArg);
        tuple_arg_not_exhausted = false;
      }
    }
    if (tuple_arg_not_exhausted && ! tuple_dup_found) {
      markArgument(myTupleArg, ArgFlag.IS_TOO_LONG);
    }
    // map unmapped named params to **kwarg
    if (myKwdArg != null) {
      for (int j = implicitOffset; j != parameters.size(); ++j) {
        final PyParameter par = parameters.get(j);
        final PyNamedParameter namedParameter = par.getAsNamed();
        if (namedParameter != null && !namedParameter.isKeywordContainer()
            && !namedParameter.isPositionalContainer() && slots.get(namedParameter) == null) {
          slots.put(namedParameter, myKwdArg);
        }
      }
    }
    // map unmapped **kwarg to **param
    if (myKwdArg != null && kwd_par != null && !mapped_args.contains(myKwdArg)) {
      myKwdMappedParams.add(kwd_par);
      mapped_args.add(myKwdArg);
    }
    // fill in ret, mark unmapped named params
    for (Map.Entry<PyNamedParameter, PyExpression> pair : slots.entrySet()) {
      PyNamedParameter n_par = pair.getKey();
      PyExpression arg = pair.getValue();
      if (arg == null) {
        if (!n_par.hasDefaultValue()) myUnmappedParams.add(n_par);
      }
      else {
        if (arg == myTupleArg) {
          myTupleMappedParams.add(n_par);
        }
        else if (arg == myKwdArg) {
          myKwdMappedParams.add(n_par);
        }
        else {
          myPlainMappedParams.put(arg, n_par);
        }
      }
    }
    // mark unmapped args
    for (PyExpression arg : slots.values()) {
      if (arg != null) mapped_args.add(arg);
    }
    for (PyExpression arg : arguments) {
      if (!mapped_args.contains(arg)) {
        final EnumSet<ArgFlag> flags = myArgFlags.get(arg);
        if (flags == null || flags.isEmpty()) {
          markArgument(arg, ArgFlag.IS_UNMAPPED);
        }
      }
    }
  }

  public List<PyExpression> verifyArguments() {
    List<PyExpression> unmatched_args = new LinkedList<PyExpression>();
    Collections.addAll(unmatched_args, myArgumentList.getArguments());
    // detect starred args
    for (PyExpression arg : myArgumentList.getArguments()) {
      if (arg instanceof PyStarArgument) {
        PyStarArgument star_arg = (PyStarArgument)arg;
        if (star_arg.isKeyword()) {
          if (myKwdArg == null) myKwdArg = star_arg;
          else {
            markArgument(arg, ArgFlag.IS_DUP_KWD);
            unmatched_args.remove(arg);
          }
        }
        else {
          if (myTupleArg == null) myTupleArg = star_arg;
          else {
            markArgument(arg, ArgFlag.IS_DUP_TUPLE);
            unmatched_args.remove(arg);
          }
        }
      }
    }

    markPastBoundPositionalArguments(myArgumentList.getArguments());
    return unmatched_args;
  }

  private void markPastBoundPositionalArguments(PyExpression[] arguments) {
    boolean seenKwArg = false;
    boolean seenKeyword = false;
    boolean seenStar = false;
    for (PyExpression arg : arguments) {
      if (arg == myKwdArg) {
        seenKwArg = true;
      }
      else if (arg instanceof PyKeywordArgument) {
        seenKeyword = true;
      }
      else if (arg instanceof PyStarArgument) {
        seenStar = true;
      }

      if (seenKeyword || seenKwArg || seenStar) {
        if (!(arg instanceof PyStarArgument) && (seenKwArg || !(arg instanceof PyKeywordArgument))) {
          markArgument(arg, ArgFlag.IS_POS_PAST_KWD);
        }
      }
    }
  }

  private static boolean isPositionalArg(PyExpression arg) {
    return !(arg instanceof PyKeywordArgument) && !(arg instanceof PyStarArgument);
  }

  /**
   * @return A mapping argument->parameter for non-starred arguments (but includes starred parameters).
   */
  public @NotNull
  Map<PyExpression, PyNamedParameter> getPlainMappedParams() {
    return myPlainMappedParams;
  }

  @NotNull
  public Map<PyExpression, List<PyNamedParameter>> getNestedMappedParams() {
    return myNestedMappedParams;
  }

  /**
   * @return First *arg, or null.
   */
  public PyStarArgument getTupleArg(){
    return myTupleArg;
  }

  /**
   * @return A list of parameters mapped to an *arg.
   */
  public @NotNull List<PyNamedParameter> getTupleMappedParams(){
    return myTupleMappedParams;
  }

  /**
   * @return First **arg, or null.
   */
  public PyStarArgument getKwdArg(){
    return myKwdArg;
  }

  /**
   * @return A list of parameters mapped to an **arg.
   */
  public @NotNull List<PyNamedParameter> getKwdMappedParams(){
    return myKwdMappedParams;
  }

  /**
   * @return A list of parameters for which no arguments were found ('missing').
   */
  public @NotNull
  List<PyNamedParameter> getUnmappedParams(){
    return myUnmappedParams;
  }

  /**
   * @return result of a resolveCallee() against the function call to which the paramater list belongs.
   */
  @Nullable
  public PyCallExpression.PyMarkedCallee getMarkedCallee() {
    return myMarkedCallee;
  }

  /**
   * @return Lists all args with their flags.
   */
  public Map<PyExpression, EnumSet<ArgFlag>> getArgumentFlags(){
    return myArgFlags;
  }

  @Override
  public boolean hasProblems() {
    for (Map.Entry<PyExpression, EnumSet<CallArgumentsMapping.ArgFlag>> arg_entry : myArgFlags.entrySet()) {
      EnumSet<CallArgumentsMapping.ArgFlag> flags = arg_entry.getValue();
      if (!flags.isEmpty()) return true;
    }
    return myUnmappedParams.size() > 0;
  }

  public PyArgumentList getArgumentList() {
    return myArgumentList; // that is, 'outer'
  }

  protected PyExpression markArgument(PyExpression arg, ArgFlag... flags) {
    EnumSet<ArgFlag> argflags = myArgFlags.get(arg);
    if (argflags == null) {
      argflags = EnumSet.noneOf(ArgFlag.class);
    }
    ContainerUtil.addAll(argflags, flags);
    myArgFlags.put(arg, argflags);
    return arg;
  }

  static class MyParamVisitor extends PyElementVisitor {
    private final Iterator<PyExpression> myArgIterator;
    private final CallArgumentsMappingImpl myResult;
    private final List<PyExpression> myUnmatchedSubargs;

    private MyParamVisitor(Iterator<PyExpression> arg_iterator, CallArgumentsMappingImpl ret) {
      myArgIterator = arg_iterator;
      myResult = ret;
      myUnmatchedSubargs = new ArrayList<PyExpression>(5); // arbitrary 'enough'
    }

    private Collection<PyExpression> getUnmatchedSubargs() {
      return myUnmatchedSubargs;
    }

    @Override
    public void visitPyParameter(PyParameter node) {
      PyNamedParameter named = node.getAsNamed();
      if (named != null) enterNamed(named);
      else enterTuple(node.getAsTuple());
    }

    public void enterTuple(PyTupleParameter param) {
      PyExpression arg = null;
      if (myArgIterator.hasNext()) arg = myArgIterator.next();
      // try to unpack a tuple expr in argument, if there's any
      PyExpression[] elements = null;
      if (arg instanceof PyParenthesizedExpression) {
        PyExpression inner_expr = ((PyParenthesizedExpression)arg).getContainedExpression();
        if (inner_expr instanceof PyTupleExpression) elements = ((PyTupleExpression)inner_expr).getElements();
      }
      else if (arg instanceof PyListLiteralExpression) {
        elements = ((PyListLiteralExpression)arg).getElements();
      }
      final PyParameter[] nested_params = param.getContents();
      if (elements != null) { // recursively map expression's tuple to parameter's.
        final Iterator<PyExpression> subargs_iterator = Arrays.asList(elements).iterator();
        MyParamVisitor visitor = new MyParamVisitor(subargs_iterator, myResult);
        for (PyParameter nested : nested_params) nested.accept(visitor);
        myUnmatchedSubargs.addAll(visitor.getUnmatchedSubargs());
        while (subargs_iterator.hasNext()) {  // more args in a tuple than parameters
          PyExpression overflown_arg = subargs_iterator.next();
          myResult.markArgument(overflown_arg, ArgFlag.IS_UNMAPPED);
        }
      }
      else { // map all what's inside to this arg
        final List<PyNamedParameter> nested_mapped = new ArrayList<PyNamedParameter>(nested_params.length);
        ParamHelper.walkDownParamArray(
          nested_params,
          new ParamHelper.ParamVisitor() {
            @Override public void visitNamedParameter(PyNamedParameter param, boolean first, boolean last) {
              nested_mapped.add(param);
            }
          }
        );
        myResult.myNestedMappedParams.put(arg, nested_mapped);
      }
    }

    public void enterNamed(PyNamedParameter param) {
      if (myArgIterator.hasNext()) {
        PyExpression subarg = myArgIterator.next();
        myResult.myPlainMappedParams.put(subarg, param);
      }
      else {
        myResult.myUnmappedParams.add(param);
      }
      // ...and *arg or **arg just won't parse inside a tuple, no need to handle it here
    }
  }
}


text:
using System.Collections;
using UnityEngine;

namespace Atlas.Test
{
    public class EasingTests : MonoBehaviour
    {
        [SerializeField] private Ease m_ease;
        [SerializeField] private float m_duration;
        [SerializeField] private Transform m_target;
        [SerializeField] private Vector3 m_goalPos;

        private bool m_atGoal;
        private Vector3 m_initialPos;

        private void Awake()
        {
            m_initialPos = m_target.position;
        }

        private void OnGUI()
        {
            if ( GUILayout.Button( "Run Ease" ) )
            {
                StopAllCoroutines();
                StartCoroutine( EaseCoroutine( m_atGoal ? m_initialPos : m_goalPos) );
                m_atGoal = !m_atGoal;
            }
        }

        private IEnumerator EaseCoroutine( Vector3 goalPos )
        {
            Vector3 startPos = m_target.position;
            Vector3 deltaPos = goalPos - startPos;

            Timer timer = new Timer();
            timer.Start();
            float t = 0.0f;

            while ( t < m_duration )
            {
                m_target.position = startPos + m_ease.Evaluate( t, m_duration ) * deltaPos;
                yield return null;

                t = timer.Elapsed;
            }

            m_target.position = goalPos;
        }
    }
}


text:
class Browser;
class TabStripModel;
class TabStripModelChange;
struct TabStripSelectionChange;

class BreadcrumbManagerBrowserAgent
    : public breadcrumbs::BreadcrumbManagerBrowserAgent,
      public TabStripModelObserver {
 public:
  explicit BreadcrumbManagerBrowserAgent(Browser* browser);
  BreadcrumbManagerBrowserAgent(const BreadcrumbManagerBrowserAgent&) = delete;
  BreadcrumbManagerBrowserAgent& operator=(
      const BreadcrumbManagerBrowserAgent&) = delete;
  ~BreadcrumbManagerBrowserAgent() override;

 private:
  // breadcrumbs::BreadcrumbManagerBrowserAgent:
  void PlatformLogEvent(const std::string& event) override;

  // TabStripModelObserver:
  void OnTabStripModelChanged(
      TabStripModel* tab_strip_model,
      const TabStripModelChange& change,
      const TabStripSelectionChange& selection) override;

  // The browser whose tab strip this agent observes. Can't be nullptr because
  // |browser_| owns this object.
  raw_ptr<Browser> browser_;
};

#endif  // CHROME_BROWSER_UI_BREADCRUMB_MANAGER_BROWSER_AGENT_H_


text:
using System.Xml.Linq;

namespace SIL.Lexicon
{
	public interface ISettingsStore
	{
		XElement GetSettings();

		void SaveSettings(XElement settingsElem);
	}
}


text:
package cpu

// CacheLinePadSize is used to prevent false sharing of cache lines.
// We choose 64 because Loongson 3A5000 the L1 Dcache is 4-way 256-line 64-byte-per-line.
const CacheLinePadSize = 64

func doinit() {}


text:
This is a normal paragraph:

This is a code block.


text:
package bp.details;

import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;

import bp.event.BPFocusListener;
import bp.model.data.MessageEndEvent;
import bp.model.util.BPKeyWords;
import bp.model.util.Controller;

public class MessageEndEventDetails extends EndEventDetails{

    /**
     *
     */
    private static final long serialVersionUID = -3193942905444889597L;

    public static final String MESSAGE_LABEL = "Message";

    private MessageEndEvent event = (MessageEndEvent) getElement();

    private JLabel messageLb;
    private JTextArea messageTa;
    private JScrollPane messageScroll;

    public MessageEndEventDetails(MessageEndEvent element) {
        super(element);
    }

    @Override
    protected void initComponents() {
        super.initComponents();

        this.messageLb = new JLabel(MESSAGE_LABEL);
        this.messageTa = new JTextArea(5, 20);
        this.messageScroll = new JScrollPane(this.messageTa);

        // Set the texts if available
        event = (MessageEndEvent) getElement();
        if (event.getMessage() != null)
        	messageTa.setText(event.getMessage());
    }

    @Override
    protected void layoutComponents() {
        super.layoutComponents();

        createAdvanced();

        getAdvanced().add(this.messageLb);
        getAdvanced().add(this.messageScroll);
    }

    @Override
    protected void addActions() {
        super.addActions();

        this.messageTa.addFocusListener(new BPFocusListener() {

            @Override
            public void updateValue() {
                MessageEndEventDetails.this.event.updateMessage((String) getValue(), Controller.DETAILS);
            }

            @Override
            public Object getValue() {
                return MessageEndEventDetails.this.messageTa.getText();
            }
        });
    }

    @Override
    protected void dataAttributeChanged(final BPKeyWords keyWord, final Object value) {
        super.dataAttributeChanged(keyWord, value);
        if (value != null) {
            if (keyWord == BPKeyWords.MESSAGE) {
                this.messageTa.setText((String) value);
            }
        }
    }

}


text:
package org.seasar.doma.internal.apt.processor.entity;

import org.seasar.doma.jdbc.domain.AbstractDomainType;
import org.seasar.doma.wrapper.StringWrapper;

public class _Names extends AbstractDomainType<String, Names> {

  private _Names() {
    super(StringWrapper::new);
  }

  @Override
  public Names newDomain(String value) {
    return null;
  }

  @Override
  public String getBasicValue(Names domain) {
    return null;
  }

  @Override
  public Class<String> getBasicClass() {
    return null;
  }

  @Override
  public Class<Names> getDomainClass() {
    return null;
  }

  public static _Names getSingletonInternal() {
    return null;
  }
}


text:
using System.Text.Json;
using Azure.Core;

namespace Azure.ResourceManager.MachineLearning.Models
{
    public partial class TextNer : IUtf8JsonSerializable
    {
        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
        {
            writer.WriteStartObject();
            if (Optional.IsDefined(FeaturizationSettings))
            {
                if (FeaturizationSettings != null)
                {
                    writer.WritePropertyName("featurizationSettings");
                    writer.WriteObjectValue(FeaturizationSettings);
                }
                else
                {
                    writer.WriteNull("featurizationSettings");
                }
            }
            if (Optional.IsDefined(LimitSettings))
            {
                if (LimitSettings != null)
                {
                    writer.WritePropertyName("limitSettings");
                    writer.WriteObjectValue(LimitSettings);
                }
                else
                {
                    writer.WriteNull("limitSettings");
                }
            }
            if (Optional.IsDefined(ValidationData))
            {
                if (ValidationData != null)
                {
                    writer.WritePropertyName("validationData");
                    writer.WriteObjectValue(ValidationData);
                }
                else
                {
                    writer.WriteNull("validationData");
                }
            }
            if (Optional.IsDefined(LogVerbosity))
            {
                writer.WritePropertyName("logVerbosity");
                writer.WriteStringValue(LogVerbosity.Value.ToString());
            }
            if (Optional.IsDefined(TargetColumnName))
            {
                if (TargetColumnName != null)
                {
                    writer.WritePropertyName("targetColumnName");
                    writer.WriteStringValue(TargetColumnName);
                }
                else
                {
                    writer.WriteNull("targetColumnName");
                }
            }
            writer.WritePropertyName("taskType");
            writer.WriteStringValue(TaskType.ToString());
            writer.WritePropertyName("trainingData");
            writer.WriteObjectValue(TrainingData);
            writer.WriteEndObject();
        }

        internal static TextNer DeserializeTextNer(JsonElement element)
        {
            Optional<ClassificationPrimaryMetric> primaryMetric = default;
            Optional<NlpVerticalFeaturizationSettings> featurizationSettings = default;
            Optional<NlpVerticalLimitSettings> limitSettings = default;
            Optional<MLTableJobInput> validationData = default;
            Optional<LogVerbosity> logVerbosity = default;
            Optional<string> targetColumnName = default;
            TaskType taskType = default;
            MLTableJobInput trainingData = default;
            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("primaryMetric"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    primaryMetric = new ClassificationPrimaryMetric(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("featurizationSettings"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        featurizationSettings = null;
                        continue;
                    }
                    featurizationSettings = NlpVerticalFeaturizationSettings.DeserializeNlpVerticalFeaturizationSettings(property.Value);
                    continue;
                }
                if (property.NameEquals("limitSettings"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        limitSettings = null;
                        continue;
                    }
                    limitSettings = NlpVerticalLimitSettings.DeserializeNlpVerticalLimitSettings(property.Value);
                    continue;
                }
                if (property.NameEquals("validationData"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        validationData = null;
                        continue;
                    }
                    validationData = MLTableJobInput.DeserializeMLTableJobInput(property.Value);
                    continue;
                }
                if (property.NameEquals("logVerbosity"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    logVerbosity = new LogVerbosity(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("targetColumnName"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        targetColumnName = null;
                        continue;
                    }
                    targetColumnName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("taskType"))
                {
                    taskType = new TaskType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("trainingData"))
                {
                    trainingData = MLTableJobInput.DeserializeMLTableJobInput(property.Value);
                    continue;
                }
            }
            return new TextNer(Optional.ToNullable(logVerbosity), targetColumnName.Value, taskType, trainingData, Optional.ToNullable(primaryMetric), featurizationSettings.Value, limitSettings.Value, validationData.Value);
        }
    }
}


text:
/*
 * @author max
 */
package com.intellij.openapi.project.impl;

import com.intellij.openapi.project.Project;

import java.util.List;

public class TooManyProjectLeakedException extends RuntimeException {
  private final List<Project> leakedProjects;

  public TooManyProjectLeakedException(List<Project> leakedProjects) {
    this.leakedProjects = leakedProjects;
  }

  public List<Project> getLeakedProjects() {
    return leakedProjects;
  }
}


text:
package sun.nio.ch;

import java.io.FileDescriptor;
import java.io.IOException;
import java.lang.reflect.*;
import java.net.*;
import java.nio.channels.*;
import java.nio.channels.spi.*;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.HashSet;
import java.util.Iterator;

/**
 * An implementation of ServerSocketChannels
 */

class ServerSocketChannelImpl
    extends ServerSocketChannel
    implements SelChImpl
{

    // Used to make native close and configure calls
    private static NativeDispatcher nd;

    // Our file descriptor
    private final FileDescriptor fd;

    // fd value needed for dev/poll. This value will remain valid
    // even after the value in the file descriptor object has been set to -1
    private int fdVal;

    // ID of native thread currently blocked in this channel, for signalling
    private volatile long thread = 0;

    // Lock held by thread currently blocked in this channel
    private final Object lock = new Object();

    // Lock held by any thread that modifies the state fields declared below
    // DO NOT invoke a blocking I/O operation while holding this lock!
    private final Object stateLock = new Object();

    // -- The following fields are protected by stateLock

    // Channel state, increases monotonically
    private static final int ST_UNINITIALIZED = -1;
    private static final int ST_INUSE = 0;
    private static final int ST_KILLED = 1;
    private int state = ST_UNINITIALIZED;

    // Binding
    private SocketAddress localAddress = null; // null => unbound

    // Options, created on demand
    private SocketOpts.IP.TCP options = null;

    // Our socket adaptor, if any
    ServerSocket socket;

    // -- End of fields protected by stateLock

    public ServerSocketChannelImpl(SelectorProvider sp) throws IOException {
        super(sp);
        this.fd =  Net.serverSocket(true);
        this.fdVal = IOUtil.fdVal(fd);
        this.state = ST_INUSE;
    }

    public ServerSocketChannelImpl(SelectorProvider sp, FileDescriptor fd)
        throws IOException
    {
        super(sp);
        this.fd =  fd;
        this.fdVal = IOUtil.fdVal(fd);
        this.state = ST_INUSE;
        localAddress = Net.localAddress(fd);
    }

    public ServerSocket socket() {
        synchronized (stateLock) {
            if (socket == null)
                socket = ServerSocketAdaptor.create(this);
            return socket;
        }
    }

    public boolean isBound() {
        synchronized (stateLock) {
            return localAddress != null;
        }
    }

    public SocketAddress localAddress() {
        synchronized (stateLock) {
            return localAddress;
        }
    }

    public void bind(SocketAddress local, int backlog) throws IOException {
        synchronized (lock) {
            if (!isOpen())
                throw new ClosedChannelException();
            if (isBound())
                throw new AlreadyBoundException();
            InetSocketAddress isa = Net.checkAddress(local);
            SecurityManager sm = System.getSecurityManager();
            if (sm != null)
                sm.checkListen(isa.getPort());
            Net.bind(fd, isa.getAddress(), isa.getPort());
            listen(fd, backlog < 1 ? 50 : backlog);
            synchronized (stateLock) {
                localAddress = Net.localAddress(fd);
            }
        }
    }

    public SocketChannel accept() throws IOException {
        synchronized (lock) {
            if (!isOpen())
                throw new ClosedChannelException();
            if (!isBound())
                throw new NotYetBoundException();
            SocketChannel sc = null;

            int n = 0;
            FileDescriptor newfd = new FileDescriptor();
            InetSocketAddress[] isaa = new InetSocketAddress[1];

            try {
                begin();
                if (!isOpen())
                    return null;
                thread = NativeThread.current();
                for (;;) {
                    n = accept0(this.fd, newfd, isaa);
                    if ((n == IOStatus.INTERRUPTED) && isOpen())
                        continue;
                    break;
                }
            } finally {
                thread = 0;
                end(n > 0);
                assert IOStatus.check(n);
            }

            if (n < 1)
                return null;

            IOUtil.configureBlocking(newfd, true);
            InetSocketAddress isa = isaa[0];
            sc = new SocketChannelImpl(provider(), newfd, isa);
            SecurityManager sm = System.getSecurityManager();
            if (sm != null) {
                try {
                    sm.checkAccept(isa.getAddress().getHostAddress(),
                                   isa.getPort());
                } catch (SecurityException x) {
                    sc.close();
                    throw x;
                }
            }
            return sc;

        }
    }

    protected void implConfigureBlocking(boolean block) throws IOException {
        IOUtil.configureBlocking(fd, block);
    }

    public SocketOpts options() {
        synchronized (stateLock) {
            if (options == null) {
                SocketOptsImpl.Dispatcher d
                    = new SocketOptsImpl.Dispatcher() {
                            int getInt(int opt) throws IOException {
                                return Net.getIntOption(fd, opt);
                            }
                            void setInt(int opt, int arg) throws IOException {
                                Net.setIntOption(fd, opt, arg);
                            }
                        };
                options = new SocketOptsImpl.IP.TCP(d);
            }
            return options;
        }
    }

    protected void implCloseSelectableChannel() throws IOException {
        synchronized (stateLock) {
            nd.preClose(fd);
            long th = thread;
            if (th != 0)
                NativeThread.signal(th);
            if (!isRegistered())
                kill();
        }
    }

    public void kill() throws IOException {
        synchronized (stateLock) {
            if (state == ST_KILLED)
                return;
            if (state == ST_UNINITIALIZED) {
                state = ST_KILLED;
                return;
            }
            assert !isOpen() && !isRegistered();
            nd.close(fd);
            state = ST_KILLED;
        }
    }

    /**
     * Translates native poll revent set into a ready operation set
     */
    public boolean translateReadyOps(int ops, int initialOps,
                                     SelectionKeyImpl sk) {
        int intOps = sk.nioInterestOps(); // Do this just once, it synchronizes
        int oldOps = sk.nioReadyOps();
        int newOps = initialOps;

        if ((ops & PollArrayWrapper.POLLNVAL) != 0) {
            // This should only happen if this channel is pre-closed while a
            // selection operation is in progress
            // ## Throw an error if this channel has not been pre-closed
            return false;
        }

        if ((ops & (PollArrayWrapper.POLLERR
                    | PollArrayWrapper.POLLHUP)) != 0) {
            newOps = intOps;
            sk.nioReadyOps(newOps);
            return (newOps & ~oldOps) != 0;
        }

        if (((ops & PollArrayWrapper.POLLIN) != 0) &&
            ((intOps & SelectionKey.OP_ACCEPT) != 0))
                newOps |= SelectionKey.OP_ACCEPT;

        sk.nioReadyOps(newOps);
        return (newOps & ~oldOps) != 0;
    }

    public boolean translateAndUpdateReadyOps(int ops, SelectionKeyImpl sk) {
        return translateReadyOps(ops, sk.nioReadyOps(), sk);
    }

    public boolean translateAndSetReadyOps(int ops, SelectionKeyImpl sk) {
        return translateReadyOps(ops, 0, sk);
    }

    /**
     * Translates an interest operation set into a native poll event set
     */
    public void translateAndSetInterestOps(int ops, SelectionKeyImpl sk) {
        int newOps = 0;

        // Translate ops
        if ((ops & SelectionKey.OP_ACCEPT) != 0)
            newOps |= PollArrayWrapper.POLLIN;
        // Place ops into pollfd array
        sk.selector.putEventOps(sk, newOps);
    }

    public FileDescriptor getFD() {
        return fd;
    }

    public int getFDVal() {
        return fdVal;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append(this.getClass().getName());
        sb.append('[');
        if (!isOpen())
            sb.append("closed");
        else {
            synchronized (stateLock) {
                if (localAddress() == null) {
                    sb.append("unbound");
                } else {
                    sb.append(localAddress().toString());
                }
            }
        }
        sb.append(']');
        return sb.toString();
    }

    // -- Native methods --

    private static native void listen(FileDescriptor fd, int backlog)
        throws IOException;

    // Accepts a new connection, setting the given file descriptor to refer to
    // the new socket and setting isaa[0] to the socket's remote address.
    // Returns 1 on success, or IOStatus.UNAVAILABLE (if non-blocking and no
    // connections are pending) or IOStatus.INTERRUPTED.
    //
    private native int accept0(FileDescriptor ssfd, FileDescriptor newfd,
                               InetSocketAddress[] isaa)
        throws IOException;

    private static native void initIDs();

    static {
        Util.load();
        initIDs();
        nd = new SocketDispatcher();
    }

}


text:
package sun.net.www.protocol.jslipc;

import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.net.URLConnection;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;

import org.jslipc.JslipcBinman;
import org.jslipc.JslipcPipe;
import org.jslipc.TestUtil;
import org.jslipc.channel.JslipcChannelInputStream;
import org.jslipc.channel.JslipcChannelOutputStream;
import org.jslipc.channel.ReadableJslipcByteChannel;
import org.jslipc.channel.WritableJslipcByteChannel;
import org.jslipc.ipc.pipe.JslipcConnection;
import org.jslipc.ipc.pipe.JslipcPipeServer;
import org.jslipc.ipc.pipe.JslipcPipeURLConnection;
import org.jslipc.util.FileUtil;
import org.jslipc.util.HostDir;
import org.jslipc.util.PipeUtil;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class HandlerTest {

	private File connectDir;
	private File pipeDir;
	private File dir;
	private HostDir hostDir;
	private File hostParentDir;

	@Before
	public void setUp() throws Exception {
		connectDir = TestUtil.createDirectory();
		pipeDir = TestUtil.createDirectory();
		hostParentDir = TestUtil.createDirectory();
		hostDir = HostDir.create(hostParentDir);
	}

	@After
	public void tearDown() throws Exception {
		FileUtil.delete(connectDir, true);
		FileUtil.delete(pipeDir, true);
		if (dir != null) {
			FileUtil.delete(dir, true);
		}
		hostDir.close();
		FileUtil.delete(hostParentDir, true);
	}

	@Test(expected = IOException.class)
	public void testOpenConnectionWithUnknownServerDir() throws Exception {
		URL url = new URL("jslipc:///c:/server/connect");
		url.openConnection();
	}

	@Test(timeout = 60000)
	public void testOpenConnectionWithAbsoluteServerDir() throws Exception {
		checkOpenConnection("/" + connectDir.getAbsolutePath());
	}

	@Test(timeout = 60000)
	public void testOpenConnectionWithRelativeServerDir() throws Exception {
		dir = FileUtil.createDirectory(new File("."));
		checkOpenConnection(dir.getPath());
	}

	@Test(timeout = 60000)
	public void testOpenConnectionWithHostDir() throws Exception {
		File hostConnectDir = PipeUtil.createConnectDir(hostDir);
		checkOpenConnection(hostConnectDir.getAbsolutePath(),
				"jslipc:hostdir://" + hostParentDir);
	}

	public void checkOpenConnection(final String connectDirPath)
			throws IOException, InterruptedException {
		checkOpenConnection(connectDirPath, "jslipc://" + connectDirPath);
	}

	public void checkOpenConnection(final String connectDirPath,
			final String urlString) throws IOException, InterruptedException {
		final AtomicReference<JslipcConnection> connectRef = new AtomicReference<JslipcConnection>();
		Thread thread = new Thread() {
			public void run() {
				JslipcPipeServer server;
				try {
					server = new JslipcPipeServer(new File(connectDirPath),
							pipeDir);
					connectRef.set(server.accept());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		};
		thread.start();

		URL url = new URL(urlString);
		URLConnection urlConnection = url.openConnection();
		assertNotNull(urlConnection);
		assertEquals(JslipcPipeURLConnection.class, urlConnection.getClass());

		// not yet connected, server still waiting
		thread.join(200);
		assertTrue(thread.isAlive());

		// now connect
		urlConnection.connect();
		thread.join();
		assertFalse(thread.isAlive());

		// server responded, check pipe
		JslipcPipe serverSidePipe = connectRef.get().getPipe();
		checkConnection(urlConnection.getOutputStream(),
				serverSidePipe.source());
		checkConnection(serverSidePipe.sink(), urlConnection.getInputStream());

		urlConnection.getInputStream().close();
		urlConnection.getOutputStream().close();
		serverSidePipe.source().close();
		serverSidePipe.sink().close();
	}

	private void checkConnection(final OutputStream out,
			final ReadableJslipcByteChannel source) throws IOException {
		checkConnection(out, new JslipcChannelInputStream(source));
	}

	private void checkConnection(final WritableJslipcByteChannel sink,
			final InputStream in) throws IOException {
		checkConnection(new JslipcChannelOutputStream(sink), in);
	}

	private void checkConnection(final OutputStream out, final InputStream in)
			throws IOException {
		byte[] written = new byte[] { 17, 68, 89 };
		byte[] read = new byte[3];
		out.write(written);
		out.flush();

		in.read(read);
		assertArrayEquals(written, read);
	}

	@Test(timeout = 60000)
	public void testRequestProperty() throws IOException, InterruptedException {
		final String connectDirPath = "/" + connectDir.getAbsolutePath();
		final AtomicReference<JslipcConnection> connectRef = new AtomicReference<JslipcConnection>();
		Thread thread = new Thread() {
			public void run() {
				JslipcPipeServer server;
				try {
					server = new JslipcPipeServer(new File(connectDirPath),
							pipeDir);
					connectRef.set(server.accept());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		};
		thread.start();

		URL url = new URL("jslipc://" + connectDirPath);
		URLConnection urlConnection = url.openConnection();
		urlConnection.setRequestProperty("key1", "value1");
		urlConnection.setRequestProperty("key2", "value2");

		// now connect
		urlConnection.connect();
		thread.join();
		assertFalse(thread.isAlive());

		// server responded, check pipe
		JslipcConnection jslipcConnection = connectRef.get();
		Map<String, String> requestParameters = jslipcConnection
				.getRequestParameters();
		assertEquals("value1", requestParameters.get("key1"));
		assertEquals("value2", requestParameters.get("key2"));

		((JslipcBinman) jslipcConnection.getPipe()).close();
	}
}


text:
package ua.com.fielden.platform.web.resources.webui;

import static org.restlet.data.MediaType.TEXT_JAVASCRIPT;
import static ua.com.fielden.platform.web.resources.webui.FileResource.createRepresentation;

import org.restlet.Context;
import org.restlet.Request;
import org.restlet.Response;
import org.restlet.representation.Representation;
import org.restlet.resource.Get;

import ua.com.fielden.platform.utils.IDates;
import ua.com.fielden.platform.web.app.IWebResourceLoader;
import ua.com.fielden.platform.web.interfaces.IDeviceProvider;

/**
 *
 * Responds to GET requests with generated application specific main Web UI component, which basically represents a scaffolding for the whole application Web UI client.
 *
 * @author TG Team
 *
 */
public class MainWebUiComponentResource  extends AbstractWebResource {
    private final IWebResourceLoader webResourceLoader;

    /**
     * Creates {@link MainWebUiComponentResource} instance.
     *
     * @param webResourceLoader
     * @param context
     * @param request
     * @param response
     */
    public MainWebUiComponentResource(final IWebResourceLoader webResourceLoader, final IDeviceProvider deviceProvider, final IDates dates, final Context context, final Request request, final Response response) {
        super(context, request, response, deviceProvider, dates);
        this.webResourceLoader = webResourceLoader;
    }

    @Get
    @Override
    public Representation get() {
        return createRepresentation(webResourceLoader, TEXT_JAVASCRIPT, "/app/tg-app.js", getReference().getRemainingPart());
    }

}


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2017.11.30 at 08:24:17 PM JST
//

package eu.datex2.schema._2_0rc1._2_0;

import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for CarParkConfigurationEnum.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *

 *

 * <simpleType name="CarParkConfigurationEnum">
 *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *     <enumeration value="multiStorey"/>
 *     <enumeration value="parkAndRide"/>
 *     <enumeration value="singleLevel"/>
 *     <enumeration value="underground"/>
 *   </restriction>
 * </simpleType>
 *

 *
 */
@XmlType(name = "CarParkConfigurationEnum")
@XmlEnum
public enum CarParkConfigurationEnum {

    @XmlEnumValue("multiStorey")
    MULTI_STOREY("multiStorey"),
    @XmlEnumValue("parkAndRide")
    PARK_AND_RIDE("parkAndRide"),
    @XmlEnumValue("singleLevel")
    SINGLE_LEVEL("singleLevel"),
    @XmlEnumValue("underground")
    UNDERGROUND("underground");
    private final String value;

    CarParkConfigurationEnum(String v) {
        value = v;
    }

    public String value() {
        return value;
    }

    public static CarParkConfigurationEnum fromValue(String v) {
        for (CarParkConfigurationEnum c: CarParkConfigurationEnum.values()) {
            if (c.value.equals(v)) {
                return c;
            }
        }
        throw new IllegalArgumentException(v);
    }

}


text:
Pta.Build.WebEssentialsBundleTask
=================================

**MSBUILD task for expanding *Web Essentials* CSS and JavaScript bundles in HTML files**

Using *Web Essentials* CSS and JavaScript bundle files?
Referencing those bundles in plain HTML files?
Want the same behavior as the ASP.NET Optimization framework?

Quick start
-----------
1. Install the *NuGet* package to your project:

	`Install-Package Pta.Build.WebEssentialsBundleTask`

2. Create one or more *Web Essentials* CSS and JavaScript bundle files.
3. Reference the bundles in your HTML files, for example:

	`!!styles: /css/app!!`

	`!!scripts: /js/vendor!!`

	`!!scripts: /js/app!!`

4. Build your project.

Documentation
-------------

### Bundle files

Creating *Web Essentials* CSS and JavaScript bundles will create files with extension *.css.bundle*
or *.js.bundle*. These are XML files containing references to CSS and JavaScript resources.

*Web Essentials* will automatically generate and update the vanilla and minified version
of the bundle resource file.

In HTML, you reference the bundle as a vanilla, non-minified, CSS and JavaScript resource file:

		<link rel="stylesheet" href="/css/app.css">
		<script src="/js/vendor.js"></script>
		<script src="/js/app.js"></script>

and the minified version as:

		<link rel="stylesheet" href="/css/app.min.css">
		<script src="/js/vendor.min.js"></script>`
		<script src="/js/app.min.js"></script>`

There are 3 problems with this approach:

1.	The bundle will not expand to the individual resource files in debug builds.
2.	The bundle will not switch between the minified version in release builds and the vanilla, non-minified, version in debug builds.
3.	The bundle will not automatically invalidate the browsers cache if the resources changes.

### Using the *NuGet* package

The *NuGet* package adds a build task to the project. This task will scan all HTML files in the project
for bundle references. When a bundle reference is found, the bundle reference is replaced by references
to the actual resource files.

For example:

		!!scripts: /js/app!!

will be replaced with:

	    <!--begin-scripts: /js/app-->
	    <script src='/js/app.min.js?_v=140ff438eaaede'></script>
	    <!--end-scripts: /js/app-->

or:

	    <!--begin-scripts: /js/app-->
	    <script src='/js/app/main.js?_v=c3506a667e0dc5'></script>
	    <script src='/js/app/dataService.js?_v=79c103a8992298'></script>
	    <script src='/js/app/homeController.js?_v=f57f92c89eb3d8'></script>
	    <!--end-scripts: /js/app-->

depending on the build configuration. The former one is a release build, the later one a debug build.

Things to note:

*	The release build references the minified version of the resource generated by *Web Essentials*.
	You can disable minification by setting the minify flag in the bundle file to false.
*	The debug build references all resources in the bundle separately.
*	The debug build references the vanilla, non-minified, resources.
*	A version query is added to the resource reference.

### The build task

The build task will run as early as possible in the build process so the HTML output can be processed further by other build tasks. For instance they can be add

The task is define as:

		<Target Name="WebEssentialsBundle">
			<ItemGroup>
				<Bundles Include="@(Content);@(EmbeddedResource)" Condition="'%(Extension)' == '.bundle'" />
				<HtmlFiles Include="@(Content);@(EmbeddedResource)" Condition="'%(Extension)' == '.html'" />
			</ItemGroup>

			<WebEssentialsBundleTask Configuration="$(Configuration)" ProjectDir="$(ProjectDir)"
				Bundles="@(Bundles)" HtmlFiles="@(HtmlFiles)" DebugConfiguration="$(BundleDebugConfiguration)"
				WebRootDir="$(BundleWebRootDir)" AddVersionQuery="$(BundleAddVersionQuery)" />
		</Target>

and the default properties are:

		<PropertyGroup>
			<BundleDebugConfiguration>Debug</BundleDebugConfiguration>
			<BundleWebRootDir></BundleWebRootDir>
			<BundleAddVersionQuery>true</BundleAddVersionQuery>
		</PropertyGroup>

Things to note:

*	The build task only recognizes  bundle and HTML files that are marked as *Content* or *EmbeddedResource* **Build Actions** in the project.

### Customizing the build task

There are 3 levels of customization:

1. Solution
2. Project
3. Bundle

#### Solution level customization

Edit the package file *Pta.Build.WebEssentialsBundleTask.props*. The file
can be found in the package folder `packages\Pta.Build.WebEssentialsBundleTask.1.0.2\build`.

Property `BundleDebugConfiguration`	specifies the build configuration name to be recognized as
the debug build, all other configurations will be treated as release builds.

Property `BundleAddVersionQuery` specifies if a version query string should be added to each
resource file URL.

Property `BundleWebRootDir` specifies the web root directory used to calculate the resource URLs.
The directory should  be a subdirectory of the project. For example if the project directory is
`D:\Dev\Project1` and `BundleWebRootDir` is set to `Web` then `D:\Dev\Project1\Web` is used as
the web root to calculate the (relative) resource URLs.

#### Project level customization

Add the `PropertyGroup` from the package *Pta.Build.WebEssentialsBundleTask.props* file to the
project file (`.csproj` or `.vbproj`). Project properties override package properties.

#### Bundle level custiomization

Add an `addVersionQuery` element to the `settings` section in the bundle file:

		<settings>
			<addVersionQuery>true</addVersionQuery>
		</settings>

Bundle settings override project and solution properties.

### Not supported

* *Web Essentials* HTML and sprite bundles.

Roadmap
-------

* Support for wildcards in file references in the bundle files. For example: `/js/app/**/*.js`.
* Support for HTML bundles.
* *Visual Studio* extension:
	* configure / customize settings
	* revert bundle references (aka undo bundle reference expansions)

Please note that some items will also result in pull requests for *Web Essentials*.

License
-------

[MIT](https://github.com/ptakes/Pta.Build.WebEssentialsBundleTask/blob/master/LICENSE)


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

<title>GLWallpaperService</title>
<meta name="date" content="2012-06-12">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

net.rbgrn.opengl

Class GLWallpaperService

java.lang.Object

WallpaperService

net.rbgrn.opengl.GLWallpaperService

Direct Known Subclasses:

Wallpaper

public class GLWallpaperService
extends WallpaperService

Nested Class Summary

Nested Classes

Modifier and Type
Class and Description

class
GLWallpaperService.GLEngine

Constructor Summary

Constructors

Constructor and Description

GLWallpaperService()

Method Summary

Methods

Modifier and Type
Method and Description

void
onCreate()

Engine
onCreateEngine()

void
onDestroy()

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

GLWallpaperService

public GLWallpaperService()

Method Detail

onCreate

public void onCreate()

onDestroy

public void onDestroy()

onCreateEngine

public Engine onCreateEngine()

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
package au.gov.dto.dibp.appointments.session;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;

public class LogoutCookieService {
    private static final String COOKIE_NAME = "session";
    private static final String COOKIE_PATH = "/";

    public static Cookie getLogoutCookie(HttpServletRequest request){
        Cookie cookie = new Cookie(COOKIE_NAME, "");
        cookie.setPath(COOKIE_PATH);
        cookie.setMaxAge(0);
        cookie.setHttpOnly(true);
        cookie.setSecure(request.isSecure());
        return cookie;
    }
}


text:
SGE_REFLECT_TYPE(sge::CCapsuleCollider)
.property("radius", &CCapsuleCollider::radius, &CCapsuleCollider::radius)
.property("height", &CCapsuleCollider::height, &CCapsuleCollider::height);

namespace sge
{
    struct CCapsuleCollider::SharedData : CSharedData<CCapsuleCollider>
    {
    };

    CCapsuleCollider::CCapsuleCollider(NodeId node, SharedData& shared_data)
        : _node(node),
        _shared_data(&shared_data)
    {
    }

    void CCapsuleCollider::register_type(Scene& scene)
    {
        scene.register_component_type(type_info, std::make_unique<BasicComponentContainer<CCapsuleCollider, SharedData>>());
    }

    void CCapsuleCollider::to_archive(ArchiveWriter& writer) const
    {
        writer.object_member("s", _shape);
    }

    void CCapsuleCollider::from_archive(ArchiveReader& reader)
    {
        reader.object_member("s", _shape);
    }

    NodeId CCapsuleCollider::node() const
    {
        return _node;
    }

    float CCapsuleCollider::radius() const
    {
        return _shape.x();
    }

    void CCapsuleCollider::radius(float value)
    {
        if (value != radius())
        {
            _shape.x(value);
            set_modified("radius");
        }
    }

    float CCapsuleCollider::height() const
    {
        return _shape.y();
    }

    void CCapsuleCollider::height(float value)
    {
        if (value != height())
        {
            _shape.y(value);
            set_modified("height");
        }
    }

    void CCapsuleCollider::set_modified(const char* property_name)
    {
        _shared_data->set_modified(_node, this, property_name);
    }
}


text:
package ca.uhn.fhir.jpa.mdm.svc.candidate;

import ca.uhn.fhir.mdm.api.MdmMatchOutcome;
import ca.uhn.fhir.jpa.entity.MdmLink;
import ca.uhn.fhir.rest.api.server.storage.ResourcePersistentId;

public class MatchedGoldenResourceCandidate {

	private final ResourcePersistentId myCandidateGoldenResourcePid;
	private final MdmMatchOutcome myMdmMatchOutcome;

	public MatchedGoldenResourceCandidate(ResourcePersistentId theCandidate, MdmMatchOutcome theMdmMatchOutcome) {
		myCandidateGoldenResourcePid = theCandidate;
		myMdmMatchOutcome = theMdmMatchOutcome;
	}

	public MatchedGoldenResourceCandidate(ResourcePersistentId theGoldenResourcePid, MdmLink theMdmLink) {
		myCandidateGoldenResourcePid = theGoldenResourcePid;
		myMdmMatchOutcome = new MdmMatchOutcome(theMdmLink.getVector(), theMdmLink.getScore()).setMatchResultEnum(theMdmLink.getMatchResult());
	}

	public ResourcePersistentId getCandidateGoldenResourcePid() {
		return myCandidateGoldenResourcePid;
	}

	public MdmMatchOutcome getMatchResult() {
		return myMdmMatchOutcome;
	}

	public boolean isMatch() {
		return myMdmMatchOutcome.isMatch();
	}
}


text:
<?php

class Algolia_Algoliasearch_Model_Indexer_Algoliacategories extends Algolia_Algoliasearch_Model_Indexer_Abstract
{
    const EVENT_MATCH_RESULT_KEY = 'algoliasearch_match_result';

    /** @var Algolia_Algoliasearch_Helper_Config */
    protected $config;

    protected static $credential_error = false;

    public function __construct()
    {
        parent::__construct();

        $this->config = Mage::helper('algoliasearch/config');
    }

    protected $_matchedEntities = array(
        Mage_Catalog_Model_Category::ENTITY => array(
            Mage_Index_Model_Event::TYPE_SAVE,
            Mage_Index_Model_Event::TYPE_DELETE,
        ),
    );

    public function getName()
    {
        return Mage::helper('algoliasearch')->__('Algolia Search Categories');
    }

    public function getDescription()
    {
        /** @var Algolia_Algoliasearch_Helper_Data $helper */
        $helper = Mage::helper('algoliasearch');
        $decription = $helper->__('Rebuild categories.').' '.$helper->__($this->enableQueueMsg);

        return $decription;
    }

    public function matchEvent(Mage_Index_Model_Event $event)
    {
        $result = $event->getEntity() !== 'core_config_data';

        $event->addNewData(self::EVENT_MATCH_RESULT_KEY, $result);

        return $result;
    }

    protected function _registerEvent(Mage_Index_Model_Event $event)
    {
        $event->addNewData(self::EVENT_MATCH_RESULT_KEY, true);

        switch ($event->getEntity()) {
            case Mage_Catalog_Model_Category::ENTITY:
                $this->_registerCatalogCategoryEvent($event);
                break;
        }
    }

    protected function _registerCatalogCategoryEvent(Mage_Index_Model_Event $event)
    {
        switch ($event->getType()) {
            case Mage_Index_Model_Event::TYPE_SAVE:

                /** @var Mage_Catalog_Model_Category $category*/
                $category = $event->getDataObject();

                $productIds = array();
                if ($this->config->indexAllCategoryProductsOnCategoryUpdate()) {
                    $categories = array_merge(array($category->getId()), $category->getAllChildren(true));

                    $collection = Mage::getResourceModel('catalog/product_collection');
                    $collection->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left');
                    $collection->addAttributeToFilter('category_id', array('in' => $categories));

                    $productIds = $collection->getAllIds();
                } elseif ($this->config->indexProductOnCategoryProductsUpdate()) {
                    $productIds = $category->getAffectedProductIds();
                }

                if (!$category->getData('is_active')) {
                    $categories = array_merge(array($category->getId()), $category->getAllChildren(true));
                    $event->addNewData('catalogsearch_delete_category_id', $categories);

                    if ($productIds) {
                        $event->addNewData('catalogsearch_update_product_id', $productIds);
                    }
                } elseif ($productIds) {
                    $event->addNewData('catalogsearch_update_product_id', $productIds);
                    $event->addNewData('catalogsearch_update_category_id', array($category->getId()));
                } elseif ($movedCategoryId = $category->getMovedCategoryId()) {
                    $event->addNewData('catalogsearch_update_category_id', array($movedCategoryId));
                } else {
                    $event->addNewData('catalogsearch_update_category_id', array($category->getId()));
                }

                break;

            case Mage_Index_Model_Event::TYPE_DELETE:

                /** @var $category Mage_Catalog_Model_Category */
                $category = $event->getDataObject();

                $event->addNewData('catalogsearch_delete_category_id', $category->getId());

                break;
        }

        return $this;
    }

    protected function _processEvent(Mage_Index_Model_Event $event)
    {
        if (!$this->config->getApplicationID() || !$this->config->getAPIKey() || !$this->config->getSearchOnlyAPIKey()) {
            if (self::$credential_error === false) {
                /** @var Mage_Adminhtml_Model_Session $session */
                $session = Mage::getSingleton('adminhtml/session');
                $session->addError('Algolia indexing failed: You need to configure your Algolia credentials in System > Configuration > Algolia Search.');

                self::$credential_error = true;
            }

            return;
        }

        $data = $event->getNewData();

        /*
         * Reindex all products and all categories and update index settings
         */
        if (!empty($data['algoliasearch_reindex_all'])) {
            $process = $event->getProcess();
            $process->changeStatus(Mage_Index_Model_Process::STATUS_REQUIRE_REINDEX);
        } else {
            /*
             * Clear indexer for the deleted category including all children categories and update index for the related products.
             */
            if (!empty($data['catalogsearch_delete_category_id'])) {
                $categoryIds = $data['catalogsearch_delete_category_id'];
                $this->engine->removeCategories(null, $categoryIds);
                /*
                 * Change indexer status as need to reindex related products to update the list of categories.
                 * It's low priority so no need to automatically reindex all related products after deleting each category.
                 * Do not reindex all if affected products are given or product count is not indexed.
                 */
                if (!isset($data['catalogsearch_update_product_id'])) {
                    $process = $event->getProcess();
                    $process->changeStatus(Mage_Index_Model_Process::STATUS_REQUIRE_REINDEX);
                }
            }
        }

        /*
         * Reindex categories.
         * Category products are tracked separately. The specified categories are active. See _registerCatalogCategoryEvent().
         */
        if (!empty($data['catalogsearch_update_category_id'])) {
            $this->reindexSpecificCategories($data['catalogsearch_update_category_id']);
        }

        /*
         * If we have added any new products to a category then we need to
         * update these products in Algolia indices.
         */
        if (!empty($data['catalogsearch_update_product_id'])) {
            $this->reindexSpecificProducts($data['catalogsearch_update_product_id']);
        }
    }

    /**
     * Rebuild all index data.
     */
    public function reindexAll()
    {
        if (!$this->config->getApplicationID() || !$this->config->getAPIKey() || !$this->config->getSearchOnlyAPIKey()) {
            /** @var Mage_Adminhtml_Model_Session $session */
            $session = Mage::getSingleton('adminhtml/session');
            $session->addError('Algolia reindexing failed: You need to configure your Algolia credentials in System > Configuration > Algolia Search.');

            return $this;
        }

        $this->engine->rebuildCategories();

        return $this;
    }
}


text:
@interface PodsDummy_PEAR_FileManager_iOS : NSObject
@end
@implementation PodsDummy_PEAR_FileManager_iOS
@end