text:
package com.baidubce.services.binaryparser;

import com.baidubce.AbstractBceClient;
import com.baidubce.BceClientConfiguration;
import com.baidubce.BceClientException;
import com.baidubce.auth.DefaultBceCredentials;
import com.baidubce.http.Headers;
import com.baidubce.http.HttpMethodName;
import com.baidubce.http.handler.BceErrorResponseHandler;
import com.baidubce.http.handler.BceJsonResponseHandler;
import com.baidubce.http.handler.BceMetadataResponseHandler;
import com.baidubce.http.handler.HttpResponseHandler;
import com.baidubce.internal.InternalRequest;
import com.baidubce.internal.RestartableInputStream;
import com.baidubce.model.AbstractBceRequest;
import com.baidubce.model.GenericAccountRequest;
import com.baidubce.services.binaryparser.model.BinaryParser;
import com.baidubce.services.binaryparser.model.CreateBinaryParserRequest;
import com.baidubce.services.binaryparser.model.ListBinaryParserRequest;
import com.baidubce.services.binaryparser.model.ListBinaryParserResponse;
import com.baidubce.services.binaryparser.model.UpdateBinaryParserRequest;
import com.baidubce.services.binaryparser.model.NormalResponse;
import com.baidubce.services.iotalarm.model.CommonResponse;
import com.baidubce.services.iotalarm.model.UuidResponse;
import com.baidubce.util.HttpUtils;
import com.baidubce.util.JsonUtils;

import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;

/**
 * Client for binary parser service
 * Created by yuanyoujun on 2017/9/2.
 */
public class BinaryParserClient extends AbstractBceClient {
    private static final String ENDPOINT = "parser.iot.gz.baidubce.com";
    private static final String VERSION = "v1";
    private static final String BINPARSER = "binparser";
    private static final String CLEAR_ERROR = "clearerror";
    private static final String CONTENT_TYPE = "application/json;charset=UTF-8";
    private static final String DELETE = "delete";

    private static final HttpResponseHandler[] HANDLERS = new HttpResponseHandler[] {
            new BceMetadataResponseHandler(), new BceErrorResponseHandler(), new BceJsonResponseHandler() };

    public BinaryParserClient(BceClientConfiguration config) {

        super(config.getEndpoint() == null ? config.withEndpoint(ENDPOINT) : config, HANDLERS);
    }

    public BinaryParserClient(String accessKey, String secretKey) {
        this(new BceClientConfiguration()
                .withCredentials(new DefaultBceCredentials(accessKey, secretKey))
                .withEndpoint(ENDPOINT));
    }

    public ListBinaryParserResponse list(ListBinaryParserRequest request) {
        InternalRequest internalRequest =
                createRequest(request, HttpMethodName.GET, BINPARSER);
        internalRequest.addParameter("pageNo", String.valueOf(request.getPageNo()));
        internalRequest.addParameter("pageSize", String.valueOf(request.getPageSize()));

        return this.invokeHttpClient(internalRequest, ListBinaryParserResponse.class);
    }

    public UuidResponse create(CreateBinaryParserRequest request) {
        InternalRequest internalRequest =
                createRequest(request, HttpMethodName.POST, BINPARSER);
        return this.invokeHttpClient(internalRequest, UuidResponse.class);
    }

    public BinaryParser get(String uuid) {
        InternalRequest internalRequest =
                createRequest(new GenericAccountRequest(), HttpMethodName.GET, BINPARSER, uuid);
        return this.invokeHttpClient(internalRequest, BinaryParser.class);
    }

    public CommonResponse update(UpdateBinaryParserRequest req, String uuid) {
        InternalRequest internalRequest =
                createRequest(req, HttpMethodName.PUT, BINPARSER, uuid);
        return this.invokeHttpClient(internalRequest, CommonResponse.class);
    }

    public CommonResponse delete(String uuid) {
        InternalRequest internalRequest =
                createRequest(new GenericAccountRequest(), HttpMethodName.DELETE, BINPARSER, uuid);
        return this.invokeHttpClient(internalRequest, CommonResponse.class);
    }

    public NormalResponse clearError(String uuid) {
        InternalRequest internalRequest =
                createRequest(new GenericAccountRequest(), HttpMethodName.PUT, BINPARSER, uuid, CLEAR_ERROR);
        return this.invokeHttpClient(internalRequest, NormalResponse.class);
    }

    private InternalRequest createRequest(AbstractBceRequest bceRequest, HttpMethodName httpMethod,
                                          String... pathVariables) {
        List<String> path = new ArrayList<String>();
        path.add(VERSION);

        if (pathVariables != null) {
            for (String pathVariable : pathVariables) {
                path.add(pathVariable);
            }
        }

        URI uri = HttpUtils.appendUri(this.getEndpoint(), path.toArray(new String[path.size()]));
        InternalRequest request = new InternalRequest(httpMethod, uri);

        request.setCredentials(bceRequest.getRequestCredentials());

        if (httpMethod == HttpMethodName.POST || httpMethod == HttpMethodName.PUT) {
            fillInHeadAndBody(bceRequest, request);
        }

        return request;
    }

    private void fillInHeadAndBody(AbstractBceRequest bceRequest, InternalRequest request) {
        byte[] content = toJson(bceRequest);
        request.addHeader(Headers.CONTENT_LENGTH, Integer.toString(content.length));
        request.addHeader(Headers.CONTENT_TYPE, CONTENT_TYPE);
        request.setContent(RestartableInputStream.wrap(content));
    }

    private byte[] toJson(AbstractBceRequest bceRequest) {
        String jsonStr = JsonUtils.toJsonString(bceRequest);
        try {
            return jsonStr.getBytes(DEFAULT_ENCODING);
        } catch (UnsupportedEncodingException e) {
            throw new BceClientException("Fail to get UTF-8 bytes", e);
        }
    }
}


text:
package com.studentsearch.xoodle.studentsearch;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;

/**
 * Created by aryan on 7/6/17.
 */

public class SplashActivity extends AppCompatActivity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.splashscreen);
    Animation anim1 = AnimationUtils.loadAnimation(this,R.anim.anim_down);
    ImageView img =(ImageView)findViewById(R.id.imageView);
    img.setAnimation(anim1);

    Handler handler = new Handler();

    handler.postDelayed(new Runnable() {
      @Override
      public void run() {

        startActivity(new Intent(SplashActivity.this,MainActivity.class));
        finish();

      }
    },1000);
  }
}

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Magento\CatalogRule\Controller\Adminhtml\Promo\Catalog;

class NewAction extends \Magento\CatalogRule\Controller\Adminhtml\Promo\Catalog
{
    /**
     * @return void
     */
    public function execute()
    {
        $this->_forward('edit');
    }
}


text:
/**
 * @ngdoc service
 * @name wp-api-angularjs.$wpApiTerms
 * @description
 * Posts entity
 * @requires  wp-api-angularjs.WpApi
 * @requires  $http
 */
import Parent from './parent.service.js';

export default class extends Parent {

    /**
     * @ngdoc function
     * @name wp-api-angularjs.$wpApiTerms#getCategoryList
     * @access public
     * @methodOf wp-api-angularjs.$wpApiTerms
     *
     * @description
     * Get category list
     * @param {object} params  Optional: {Object.<string|Object>} – Map of strings or objects which will be appended as GET parameters.
     * @param {object} data  Optional: {string|Object} – Data to be sent as the request message data.
     * @param {object} headers  Optional: {Object} – Map of strings or functions which return strings representing HTTP headers
     * @example
     * $wpApiTerms.getList({
     *  page: 1,
     *  per_page: 10,
     *  search: '',
     *  order: '',
     *  orderby: '',
     *  parent: '',
     * });
     * @returns {Object} Promise
     */
    getCategoryList(params, data, headers) {
        return super.getList(`/terms/category`, params, data, headers);
    }

    /**
     * @ngdoc function
     * @name wp-api-angularjs.$wpApiTerms#getTagList
     * @access public
     * @methodOf wp-api-angularjs.$wpApiTerms
     *
     * @description
     * Get category list
     * @param {object} params  Optional: {Object.<string|Object>} – Map of strings or objects which will be appended as GET parameters.
     * @param {object} data  Optional: {string|Object} – Data to be sent as the request message data.
     * @param {object} headers  Optional: {Object} – Map of strings or functions which return strings representing HTTP headers
     * @example
     * $wpApiTerms.getList({
     *  page: 1,
     *  per_page: 10,
     *  search: '',
     *  order: '',
     *  orderby: ''
     * });
     * @returns {Object} Promise
     */
    getTagList(params, data, headers) {
        return super.getList(`/terms/tag`, params, data, headers);
    }

    /**
     * @ngdoc function
     * @name wp-api-angularjs.$wpApiTerms#getCategory
     * @access public
     * @methodOf wp-api-angularjs.$wpApiTerms
     *
     * @description
     * Get a specific category by its ID
     *
     * @param {int} termId  The term id
     * @param {object} params  Optional: {Object.<string|Object>} – Map of strings or objects which will be appended as GET parameters.
     * @param {object} data  Optional: {string|Object} – Data to be sent as the request message data.
     * @param {object} headers  Optional: {Object} – Map of strings or functions which return strings representing HTTP headers
     * @returns {Object} Promise
     */
    getCategory(termId, params, data, headers) {
        super.requiredInput('$wpApiTerms:get', {
            termId
        });
        return super.get(`/terms/category/${termId}`, params, data, headers);
    }

    /**
     * @ngdoc function
     * @name wp-api-angularjs.$wpApiTerms#getTag
     * @access public
     * @methodOf wp-api-angularjs.$wpApiTerms
     *
     * @description
     * Get a specific tag by its ID
     *
     * @param {int} termId  The term id
     * @param {object} params  Optional: {Object.<string|Object>} – Map of strings or objects which will be appended as GET parameters.
     * @param {object} data  Optional: {string|Object} – Data to be sent as the request message data.
     * @param {object} headers  Optional: {Object} – Map of strings or functions which return strings representing HTTP headers
     * @returns {Object} Promise
     */
    getTag(termId, params, data, headers) {
        super.requiredInput('$wpApiTerms:get', {
            termId
        });
        return super.get(`/terms/tag/${termId}`, params, data, headers);
    }
}


text:
@implementation FLObjcClassInitializerMethod

- (void) configureWithInputConstructor:(FLCodeConstructor*) constructor
                            withObject:(FLObjcObject*) object {

    self.methodName = [FLObjcMethodName objcMethodName:[object.objectName.generatedName stringByDeletingPrefix_fl:self.project.classPrefix]];

    self.returnType = [self.project.typeRegistry typeForKey:@"id"];
    self.isStatic = YES;
    self.isPrivate = NO;

    if(constructor && constructor.parameters.count) {

        NSMutableString* superparms = [NSMutableString string];

        for(FLCodeConstructorParameter* parameter in constructor.parameters) {
            FLObjcName* name = [FLObjcParameterName objcParameterName:parameter.name];
            FLObjcType* type = [self.project.typeRegistry typeForKey:parameter.type];

            [object addDependency:type];

            FLObjcParameter* objcParameter = [FLObjcParameter objcParameter:name parameterType:type key:parameter.name];
            [self addParameter:objcParameter];

            if(superparms.length) {
                [superparms appendFormat:@" %@:%@", name.generatedName, name.generatedName];
            }
            else {
                [superparms appendFormat:@"%@", name.generatedName];
            }

        }

        NSString* methodName = [FLObjcConstructor methodNameForConstructor:constructor].generatedName;
        [self.code appendReturnValue:
            [NSString stringWithFormat:@"FLAutorelease([[[self class] alloc] %@:%@])",
         methodName, superparms]];

    }
    else {
        [self.code appendReturnValue:@"FLAutorelease([[[self class] alloc] init])"];
    }
}

//- (void) didMoveToObject:(FLObjcObject*) object {
//    [super didMoveToObject:object];

//    [self.parentObject addDependency:self.ivar.variableType];
//    [self.parentObject addDependency:self.propertyType];
//    [self.parentObject addIvar:self.ivar];
//
//    if(self.containerTypes && self.containerTypes.count) {
//        [self.parentObject addDependency:[self.project typeForKey:[FLObjectDescriber class]]];
//
//        for(FLObjcContainerSubType* subType in self.containerTypes) {
//            [self.parentObject addDependency:subType.objcType];
//        }
//    }

//}

@end


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>
	<groupId>com.terry</groupId>
	<artifactId>DevOpsCenter</artifactId>
    <packaging>war</packaging>
	<version>0.0.1-SNAPSHOT</version>
	<name>DevOpsCenter Webapp</name>

     <!-- parent specifies the version for the starter dependency,从父依赖中继承默认设置 -->
     <parent>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-parent</artifactId>
         <version>1.3.2.RELEASE</version>
     </parent>

     <properties>
        <main.basedir>${basedir}/../..</main.basedir>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <m2eclipse.wtp.contextRoot>/</m2eclipse.wtp.contextRoot>
    </properties>

    <dependencies>
        <!-- Spring MVC -->
	    <dependency>
	        <groupId>org.springframework.boot</groupId>
	        <artifactId>spring-boot-starter-web</artifactId>
	    </dependency>

        <!-- https://spring.io/blog/2015/06/17/devtools-in-spring-boot-1-3 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
        </dependency>

        <!-- thymeleaf -->
        <dependency>
          <groupId>org.thymeleaf</groupId>
          <artifactId>thymeleaf-spring4</artifactId>
        </dependency>

        <!-- Adds production ready features such as metrics and monitoring. -->
        <!-- /health /metrics  -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>

        <!-- Spring JPA -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>

        <!-- Embed Tomcat -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-jasper</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
        </dependency>

        <!-- DB -->
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>1.4.190</version>
        </dependency>

        <dependency>
          <groupId>org.apache.commons</groupId>
          <artifactId>commons-lang3</artifactId>
          <version>3.4</version>
        </dependency>

        <!-- For test  -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <scope>test</scope>
        </dependency>
  </dependencies>

    <build>
        <finalName>DevOpsCenter</finalName>
        <plugins>
            <!-- Creating an executable jar -->
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <!--
                <dependencies>
                    <dependency>
                        <groupId>org.springframework</groupId>
                        <artifactId>springloaded</artifactId>
                        <version>1.2.5.RELEASE</version>
                    </dependency>
                </dependencies>
                -->
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <useSystemClassLoader>false</useSystemClassLoader>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>


text:
Written in Rust. The rust-gc, libloading and libffi crates do most of the heavy
lifting at the moment.

# Plans

* Fill out missing functionality (e.g. float operations).
* Improve the value representation with tagged pointers etc.
* Custom GC, with safepoints


text:
/*
Browser-detect.js by James Zhang.
This is a very basic browser sniffer.
*/

(function() {

	var userAgent = window.navigator.userAgent;
	// Browser User Agent Strings
	var ie = 'MSIE';
	var ie9 = 'MSIE 9.0';
	var ie10 = 'MSIE 10.0';
	var chrome = 'Chrome';
	var firefox = 'Firefox/';
	var safari = 'Safari';
	// OS User Agent Strings
	var windows = 'Windows';
	var mac = 'Macintosh';
	var linux = 'Linux';

	// class names
	var ie_class = 'ie';
	var ie9_class = 'ie9';
	var ie10_class = 'ie10';
	var ie11_class = 'ie11';
	var chrome_class = 'chrome';
	var firefox_class = 'firefox';
	var safari_class = 'safari';
	var windows_class = 'windows';
	var mac_class = 'mac';
	var linux_class = 'linux';

	// All matching classes will be appended to classes
	var classes = '';

	// using UserAgent, checking to see which match
	if (userAgent.indexOf(ie) > -1) {
		classes += ie_class + ' ';
	}
	if (userAgent.indexOf(ie9) > -1) {
		classes += ie9_class + ' ';
	}
	if (userAgent.indexOf(ie10) > -1) {
		classes += ie10_class + ' ';
	}
	if (!!navigator.userAgent.match(/Trident.*rv\:11\./)) {
		classes += ie_class + ' ' + ie11_class + ' ';
	}
	if (userAgent.indexOf(safari) > -1 && userAgent.indexOf(chrome) == -1) {
		classes += safari_class + ' ';
	}
	if (userAgent.indexOf(chrome) > -1) {
		classes += chrome_class + ' ';
	}
	if (userAgent.indexOf(firefox) > -1) {
		classes += firefox_class + ' ';
	}
	if (userAgent.indexOf(windows) > -1) {
		classes += windows_class + ' ';
	}
	if (userAgent.indexOf(mac) > -1) {
		classes += mac_class + ' ';
	}
	if (userAgent.indexOf(linux) > -1) {
		classes += linux_class + ' ';
	}

	// trimming off additional space
	classes = classes.slice(0,-1);

	document.addEventListener('DOMContentLoaded', function() {
		// adding class names to body tag
		document.body.className += classes;
	});

	// exposing browser information globally
	window.browserInfo = classes;

	return classes;

})();


text:
#ifndef _ASM_POWERPC_POSIX_TYPES_H
#define _ASM_POWERPC_POSIX_TYPES_H

/*
 * This file is generally used by user-level software, so you need to
 * be a little careful about namespace pollution etc.  Also, we cannot
 * assume GCC is being used.
 */

typedef unsigned long	__kernel_ino_t;
typedef unsigned int	__kernel_mode_t;
typedef long		__kernel_off_t;
typedef int		__kernel_pid_t;
typedef unsigned int	__kernel_uid_t;
typedef unsigned int	__kernel_gid_t;
typedef long		__kernel_ptrdiff_t;
typedef long		__kernel_time_t;
typedef long		__kernel_clock_t;
typedef int		__kernel_timer_t;
typedef int		__kernel_clockid_t;
typedef long		__kernel_suseconds_t;
typedef int		__kernel_daddr_t;
typedef char *		__kernel_caddr_t;
typedef unsigned short	__kernel_uid16_t;
typedef unsigned short	__kernel_gid16_t;
typedef unsigned int	__kernel_uid32_t;
typedef unsigned int	__kernel_gid32_t;
typedef unsigned int	__kernel_old_uid_t;
typedef unsigned int	__kernel_old_gid_t;

#ifdef __powerpc64__
typedef unsigned long  	__kernel_nlink_t;
typedef int             __kernel_ipc_pid_t;
typedef unsigned long	__kernel_size_t;
typedef long		__kernel_ssize_t;
typedef unsigned long	__kernel_old_dev_t;
#else
typedef unsigned short	__kernel_nlink_t;
typedef short		__kernel_ipc_pid_t;
typedef unsigned int	__kernel_size_t;
typedef int		__kernel_ssize_t;
typedef unsigned int	__kernel_old_dev_t;
#endif

#ifdef __powerpc64__
typedef long long	__kernel_loff_t;
#else
#ifdef __GNUC__
typedef long long	__kernel_loff_t;
#endif
#endif

typedef struct {
	int	val[2];
} __kernel_fsid_t;

#ifndef __GNUC__

#define	__FD_SET(d, set)	((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
#define	__FD_CLR(d, set)	((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
#define	__FD_ISSET(d, set)	(((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) != 0)
#define	__FD_ZERO(set)	\
  ((void) memset ((void *) (set), 0, sizeof (__kernel_fd_set)))

#else /* __GNUC__ */

#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) \
    || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 0)
/* With GNU C, use inline functions instead so args are evaluated only once: */

#undef __FD_SET
static __inline__ void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp)
{
	unsigned long _tmp = fd / __NFDBITS;
	unsigned long _rem = fd % __NFDBITS;
	fdsetp->fds_bits[_tmp] |= (1UL<<_rem);
}

#undef __FD_CLR
static __inline__ void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp)
{
	unsigned long _tmp = fd / __NFDBITS;
	unsigned long _rem = fd % __NFDBITS;
	fdsetp->fds_bits[_tmp] &= ~(1UL<<_rem);
}

#undef __FD_ISSET
static __inline__ int __FD_ISSET(unsigned long fd, __kernel_fd_set *p)
{
	unsigned long _tmp = fd / __NFDBITS;
	unsigned long _rem = fd % __NFDBITS;
	return (p->fds_bits[_tmp] & (1UL<<_rem)) != 0;
}

/*
 * This will unroll the loop for the normal constant case (8 ints,
 * for a 256-bit fd_set)
 */
#undef __FD_ZERO
static __inline__ void __FD_ZERO(__kernel_fd_set *p)
{
	unsigned long *tmp = (unsigned long *)p->fds_bits;
	int i;

	if (__builtin_constant_p(__FDSET_LONGS)) {
		switch (__FDSET_LONGS) {
		      case 16:
			tmp[12] = 0; tmp[13] = 0; tmp[14] = 0; tmp[15] = 0;
			tmp[ 8] = 0; tmp[ 9] = 0; tmp[10] = 0; tmp[11] = 0;

		      case 8:
			tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0;

		      case 4:
			tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
			return;
		}
	}
	i = __FDSET_LONGS;
	while (i) {
		i--;
		*tmp = 0;
		tmp++;
	}
}

#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */
#endif /* __GNUC__ */
#endif /* _ASM_POWERPC_POSIX_TYPES_H */


text:
<?php

declare(strict_types=1);

return [
    'Anarchy Battle' => 'Partita anarchica',
    'Anarchy Battle (Open)' => 'Partita anarchica (Aperta)',
    'Anarchy Battle (Series)' => 'Partita anarchica (Serie)',
    'Any Lobby' => '',
    'Private Battle' => 'Privata privata',
    'Regular Battle' => 'Partita amichevole',
    'Splatfest' => '',
    'Splatfest (Open)' => '',
    'Splatfest (Pro)' => '',
];


text:
external help file: Microsoft.Azure.Commands.Cdn.dll-Help.xml
ms.assetid: 7060D3D7-B397-447E-88E3-B6F0D094770D
online version:
schema: 2.0.0
---

# New-AzureRmCdnCustomDomain

## SYNOPSIS
Creates a custom domain for a CDN endpoint.

## SYNTAX

### Parameter Set for fields parameters (Default)
```
New-AzureRmCdnCustomDomain -HostName <String> -CustomDomainName <String> -EndpointName <String>
 -ProfileName <String> -ResourceGroupName <String> [-InformationAction <ActionPreference>]
 [-InformationVariable <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### Parameter Set for object parameters
```
New-AzureRmCdnCustomDomain -HostName <String> -CustomDomainName <String> -CdnEndpoint <PSEndpoint>
 [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-WhatIf] [-Confirm]
 [<CommonParameters>]
```

## DESCRIPTION
The **New-AzureRmCdnCustomDomain** cmdlet creates a custom domain for the Azure Content Delivery Network (CDN) endpoint.

## EXAMPLES

### 1:
```

```

## PARAMETERS

### -HostName
Specifies the host name of the custom domain.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -CustomDomainName
Specifies the resource name of the custom domain.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -EndpointName
Specifies the name of the endpoint.

```yaml
Type: String
Parameter Sets: Parameter Set for fields parameters
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ProfileName
Specifies the name of the profile.

```yaml
Type: String
Parameter Sets: Parameter Set for fields parameters
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ResourceGroupName
Specifies the name of the resource group to which the custom domain belongs.

```yaml
Type: String
Parameter Sets: Parameter Set for fields parameters
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -InformationAction
Specifies how this cmdlet responds to an information event.

The acceptable values for this parameter are:

- Continue
- Ignore
- Inquire
- SilentlyContinue
- Stop
- Suspend

```yaml
Type: ActionPreference
Parameter Sets: (All)
Aliases: infa

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -InformationVariable
Specifies an information variable.

```yaml
Type: String
Parameter Sets: (All)
Aliases: iv

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -CdnEndpoint
Specifies the CDN endpoint object to which the custom domain is added.

```yaml
Type: PSEndpoint
Parameter Sets: Parameter Set for object parameters
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```

### -Confirm
Prompts you for confirmation before running the cmdlet.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```

### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

## OUTPUTS

## NOTES

## RELATED LINKS

[Get-AzureRmCdnCustomDomain](./Get-AzureRmCdnCustomDomain.md)

[Remove-AzureRmCdnCustomDomain](./Remove-AzureRmCdnCustomDomain.md)

[Test-AzureRmCdnCustomDomain](./Test-AzureRmCdnCustomDomain.md)


text:
namespace knoledge_keychain
{
    partial class FormAddressDetails
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.label5 = new System.Windows.Forms.Label();
            this.textBoxBitcoinAddress = new System.Windows.Forms.TextBox();
            this.label4 = new System.Windows.Forms.Label();
            this.textBoxPubHash = new System.Windows.Forms.TextBox();
            this.label1 = new System.Windows.Forms.Label();
            this.textBoxType = new System.Windows.Forms.TextBox();
            this.label2 = new System.Windows.Forms.Label();
            this.textBoxScriptPubKey = new System.Windows.Forms.TextBox();
            this.label3 = new System.Windows.Forms.Label();
            this.textBoxAddress = new System.Windows.Forms.TextBox();
            this.menuStrip = new System.Windows.Forms.MenuStrip();
            this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.createQRCodeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.displayTransactionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.menuStrip.SuspendLayout();
            this.SuspendLayout();
            //
            // label5
            //
            this.label5.AutoSize = true;
            this.label5.Location = new System.Drawing.Point(13, 132);
            this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(120, 20);
            this.label5.TabIndex = 5;
            this.label5.Text = "Bitcoin Address";
            //
            // textBoxBitcoinAddress
            //
            this.textBoxBitcoinAddress.Location = new System.Drawing.Point(157, 128);
            this.textBoxBitcoinAddress.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
            this.textBoxBitcoinAddress.Name = "textBoxBitcoinAddress";
            this.textBoxBitcoinAddress.Size = new System.Drawing.Size(834, 26);
            this.textBoxBitcoinAddress.TabIndex = 6;
            //
            // label4
            //
            this.label4.AutoSize = true;
            this.label4.Location = new System.Drawing.Point(13, 169);
            this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(133, 20);
            this.label4.TabIndex = 7;
            this.label4.Text = "Public Key (Hash)";
            //
            // textBoxPubHash
            //
            this.textBoxPubHash.Location = new System.Drawing.Point(157, 164);
            this.textBoxPubHash.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
            this.textBoxPubHash.Name = "textBoxPubHash";
            this.textBoxPubHash.Size = new System.Drawing.Size(834, 26);
            this.textBoxPubHash.TabIndex = 8;
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(13, 52);
            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(43, 20);
            this.label1.TabIndex = 1;
            this.label1.Text = "Type";
            //
            // textBoxType
            //
            this.textBoxType.Location = new System.Drawing.Point(157, 49);
            this.textBoxType.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
            this.textBoxType.Name = "textBoxType";
            this.textBoxType.ReadOnly = true;
            this.textBoxType.Size = new System.Drawing.Size(834, 26);
            this.textBoxType.TabIndex = 2;
            //
            // label2
            //
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(13, 205);
            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(112, 20);
            this.label2.TabIndex = 9;
            this.label2.Text = "Script Pub Key";
            //
            // textBoxScriptPubKey
            //
            this.textBoxScriptPubKey.Location = new System.Drawing.Point(157, 200);
            this.textBoxScriptPubKey.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
            this.textBoxScriptPubKey.Name = "textBoxScriptPubKey";
            this.textBoxScriptPubKey.Size = new System.Drawing.Size(834, 26);
            this.textBoxScriptPubKey.TabIndex = 10;
            //
            // label3
            //
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(13, 96);
            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(68, 20);
            this.label3.TabIndex = 3;
            this.label3.Text = "Address";
            //
            // textBoxAddress
            //
            this.textBoxAddress.Location = new System.Drawing.Point(157, 92);
            this.textBoxAddress.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
            this.textBoxAddress.Name = "textBoxAddress";
            this.textBoxAddress.Size = new System.Drawing.Size(834, 26);
            this.textBoxAddress.TabIndex = 4;
            //
            // menuStrip
            //
            this.menuStrip.ImageScalingSize = new System.Drawing.Size(24, 24);
            this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.fileToolStripMenuItem,
            this.optionsToolStripMenuItem});
            this.menuStrip.Location = new System.Drawing.Point(0, 0);
            this.menuStrip.Name = "menuStrip";
            this.menuStrip.Size = new System.Drawing.Size(1023, 33);
            this.menuStrip.TabIndex = 0;
            this.menuStrip.Text = "menuStrip1";
            //
            // fileToolStripMenuItem
            //
            this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.exitToolStripMenuItem});
            this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
            this.fileToolStripMenuItem.Size = new System.Drawing.Size(50, 29);
            this.fileToolStripMenuItem.Text = "&File";
            //
            // exitToolStripMenuItem
            //
            this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
            this.exitToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4)));
            this.exitToolStripMenuItem.Size = new System.Drawing.Size(189, 30);
            this.exitToolStripMenuItem.Text = "E&xit";
            this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
            //
            // optionsToolStripMenuItem
            //
            this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.createQRCodeToolStripMenuItem,
            this.displayTransactionsToolStripMenuItem});
            this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
            this.optionsToolStripMenuItem.Size = new System.Drawing.Size(88, 29);
            this.optionsToolStripMenuItem.Text = "&Options";
            //
            // createQRCodeToolStripMenuItem
            //
            this.createQRCodeToolStripMenuItem.Name = "createQRCodeToolStripMenuItem";
            this.createQRCodeToolStripMenuItem.Size = new System.Drawing.Size(256, 30);
            this.createQRCodeToolStripMenuItem.Text = "Create &QR Code";
            this.createQRCodeToolStripMenuItem.Click += new System.EventHandler(this.createQRCodeToolStripMenuItem_Click);
            //
            // displayTransactionsToolStripMenuItem
            //
            this.displayTransactionsToolStripMenuItem.Name = "displayTransactionsToolStripMenuItem";
            this.displayTransactionsToolStripMenuItem.Size = new System.Drawing.Size(256, 30);
            this.displayTransactionsToolStripMenuItem.Text = "Display &Transactions";
            //
            // FormAddressDetails
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(1023, 271);
            this.Controls.Add(this.label3);
            this.Controls.Add(this.textBoxAddress);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.textBoxScriptPubKey);
            this.Controls.Add(this.textBoxType);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.label5);
            this.Controls.Add(this.textBoxBitcoinAddress);
            this.Controls.Add(this.label4);
            this.Controls.Add(this.textBoxPubHash);
            this.Controls.Add(this.menuStrip);
            this.MainMenuStrip = this.menuStrip;
            this.Name = "FormAddressDetails";
            this.ShowInTaskbar = false;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            this.Text = "Address Details";
            this.Load += new System.EventHandler(this.FormDetails_Load);
            this.menuStrip.ResumeLayout(false);
            this.menuStrip.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Label label5;
        private System.Windows.Forms.TextBox textBoxBitcoinAddress;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.TextBox textBoxPubHash;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.TextBox textBoxType;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.TextBox textBoxScriptPubKey;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.TextBox textBoxAddress;
        private System.Windows.Forms.MenuStrip menuStrip;
        private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem createQRCodeToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem displayTransactionsToolStripMenuItem;
    }
}


text:
var fs = require("fs");

var scripta = {};
var scriptaDir = __dirname + "/scripta";

// load scripta
var files = fs.readdirSync(scriptaDir).forEach(function(file) {
  var scriptaPath = scriptaDir + "/" + file;
  var mod = require(scriptaPath);
  var key = Object.keys(mod)[0];
  scripta[key] = mod[key];
});

// module export
module.exports = scripta;


text:
package com.intellij.tools;

import com.intellij.openapi.actionSystem.ActionManager;
import com.intellij.openapi.components.RoamingType;
import com.intellij.openapi.options.SchemeProcessor;
import com.intellij.openapi.options.SchemesManager;
import com.intellij.openapi.options.SchemesManagerFactory;
import com.intellij.openapi.util.Comparing;
import com.intellij.util.ArrayUtil;

import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;

public abstract class BaseToolManager<T extends Tool> {

  private final ActionManager myActionManager;
  private final SchemesManager<ToolsGroup<T>, ToolsGroup<T>> mySchemesManager;

  public BaseToolManager(ActionManager actionManagerEx, SchemesManagerFactory factory) {
    myActionManager = actionManagerEx;

    mySchemesManager = factory.createSchemesManager(
      getSchemesPath(), createProcessor(), RoamingType.PER_USER);

    mySchemesManager.loadSchemes();
    registerActions();
  }

  protected abstract String getSchemesPath();

  protected abstract SchemeProcessor<ToolsGroup<T>> createProcessor();

  @Nullable
  public static String convertString(String s) {
    if (s != null && s.trim().length() == 0) return null;
    return s;
  }

  public List<T> getTools() {
    ArrayList<T> result = new ArrayList<T>();
    for (ToolsGroup group : mySchemesManager.getAllSchemes()) {
      result.addAll(group.getElements());
    }
    return result;
  }

  public List<T> getTools(String group) {
    ArrayList<T> list = new ArrayList<T>();
    ToolsGroup groupByName = mySchemesManager.findSchemeByName(group);
    if (groupByName != null) {
      list.addAll(groupByName.getElements());
    }
    return list;
  }

  /**
   * Get all not empty group names of tools in array
   */
  String[] getGroups(T[] tools) {
    ArrayList<String> list = new ArrayList<String>();
    for (int i = 0; i < tools.length; i++) {
      T tool = tools[i];
      if (!list.contains(tool.getGroup())) {
        list.add(tool.getGroup());
      }
    }
    return ArrayUtil.toStringArray(list);
  }

  public String getGroupByActionId(String actionId) {
    for (T tool : getTools()) {
      if (Comparing.equal(actionId, tool.getActionId())) {
        return tool.getGroup();
      }
    }
    return null;
  }

  public List<ToolsGroup<T>> getGroups() {
    return mySchemesManager.getAllSchemes();
  }

  public void setTools(ToolsGroup[] tools) {
    mySchemesManager.clearAllSchemes();
    for (ToolsGroup newGroup : tools) {
      mySchemesManager.addNewScheme(newGroup, true);
    }
    registerActions();
  }

  void registerActions() {
    unregisterActions();

    // register
    HashSet registeredIds = new HashSet(); // to prevent exception if 2 or more targets have the same name

    List<T> tools = getTools();
    for (T tool : tools) {
      String actionId = tool.getActionId();

      if (!registeredIds.contains(actionId)) {
        registeredIds.add(actionId);
        myActionManager.registerAction(actionId, createToolAction(tool));
      }
    }
  }

  protected ToolAction createToolAction(T tool) {
    return new ToolAction(tool);
  }

  protected abstract String getActionIdPrefix();

  private void unregisterActions() {
    // unregister Tool actions
    String[] oldIds = myActionManager.getActionIds(getActionIdPrefix());
    for (int i = 0; i < oldIds.length; i++) {
      String oldId = oldIds[i];
      myActionManager.unregisterAction(oldId);
    }
  }
}


text:
"""Halin.py

Reduction-based algorithm for recognizing Halin and D3-reducible graphs

D. Eppstein, January 2015.
"""

from .graphs import copy_graph
from .graphs import is_undirected

# ============================================================
#     Main reduction algorithm for D3 reducible graphs
# ============================================================

def is_K4(G):
    """Is this graph K4?"""
    if len(G) != 4:
        return False
    for v in G:
        if v in G[v] or len(set(G[v])) != 3:
            return False
    return True

def is_D3_reducible(G, triangleHooks=[], pathHooks=[], finalize=is_K4):
    """Test if the graph G is D3-reducible.

    Whenever a reduction is found, the hook functions are
    called in turn on it, and should return True if the reduction
    should be allowed to continue or False otherwise.

    The arguments to a triangle hook are the graph, the three
    triangle vertices, their three neighbors, and the id that
    will be given to the new vertex formed by the collapsed
    triangle. The arguments to a path hook are the graph, the
    three path vertices and the apex.

    The finalize hook takes as input the irreducible graph
    after all reductions are complete, and produces as output
    the return value for the overall computation.
    By default the return value is a Boolean that is true
    whenever the irreducible graph is K4."""
    if not is_undirected(G):
        raise TypeError("Argument to D3reducible must be an undirected graph")
    G = copy_graph(G)        # We are going to change G, so make a copy of it
    C = {v for v in G if len(G[v]) == 3}  # Active vertices, init. all w/deg=3

    def otherNeighbor(u, v, w):
        """Other neighbor of v given known neighbors u,w"""
        return [x for x in G[v] if x != u and x != w][0]

    def triangle(u, v, w):
        """Try a D3a reduction."""
        # u, v, and w are known to form a triangle but we still need to
        # check whether they have distinct neighbors."""
        Nu = otherNeighbor(v, u, w)
        Nv = otherNeighbor(u, v, w)
        Nw = otherNeighbor(u, w, v)
        if Nu == Nv or Nv == Nw or Nu == Nw:
            return      # Need to have three distinct neighbors
        x = object()    # Cons up an id for the triangle

        # Run the hooks
        for hook in triangleHooks:
            if not hook(G, u, v, w, Nu, Nv, Nw, x):
                return False

        # Make the change!
        del G[u], G[v], G[w]
        G[Nu].remove(u)
        G[Nv].remove(v)
        G[Nw].remove(w)
        G[x] = {Nu, Nv, Nw}
        G[Nu].add(x)
        G[Nv].add(x)
        G[Nw].add(x)

        # Update the active vertices
        C.update(z for z in (x, Nu, Nv, Nw) if len(G[z]) == 3)

    def path(u, v, w):
        """Try a D3b reduction."""
        # u, v, and w are known to induce a path but we still need to
        # check whether they have a common neighbor as apex."""
        apexes = G[u] & G[v] & G[w]
        if len(apexes) != 1:
            return
        apex = apexes.pop()

        # Run the hooks
        for hook in pathHooks:
            if not hook(G, u, v, w, apex):
                return False

        # Make the change!
        del G[v]
        G[u].remove(v)
        G[w].remove(v)
        G[apex].remove(v)
        G[u].add(w)
        G[w].add(u)

        # Update the active vertices
        if len(G[apex]) == 3:
            C.add(apex)
        pass

    def reduce(u, v, w):
        """Try a reduction in which v is the middle vertex"""
        for x in (u, v, w):
            if x not in G or len(G[x]) != 3:
                return      # No longer in G or not all degree 3, no redux
        if w in G[u]:
            triangle(u, v, w)
        else:
            path(u, v, w)

    while C:
        v = C.pop()
        if v in G and len(G[v]) == 3:
            p, q, r = tuple(G[v])     # Decode set of neighbors
            reduce(p, v, q)
            reduce(p, v, r)
            reduce(q, v, r)

    # Now check whether we found K4
    return finalize(G)

def reconstruct_D3(G, initialize, triangle, path, recognizer=is_D3_reducible):
    """Recursively reconstruct a D3-reducible graph G
    by inverting the reductions used to recognize it.

    The other four arguments are functions:

    - recognize is a routine for performing D3 reductions
      on a graph with triangle hooks, path hooks, and a finalizer
      (like D3reducible or isHalin).

    - initialize is called first, as the finalizer from
      the recognition algorithm. Therefore, its signature
      should match what the recognizer is expecting.
      If any state passed in by the recognition phase is
      needed for later calls, it should be saved here,
      because it won't be passed in later. If the graph
      is not recognized, this should throw an exception.

    - triangle and path take the same eight and five arguments
      (respectively) as the triangle and path hooks from the
      reductions, but are called in the opposite order to
      the order they are called in the reductions."""

    calls = []

    def thook(*args):
        calls.append((triangle, args))
        return True

    def phook(*args):
        calls.append((path, args))
        return True

    recognizer(G, [thook], [phook], initialize)
    calls.reverse()
    for fun, args in calls:
        fun(*args)

# ============================================================
#     Additional reduction rules for Halin graphs
# ============================================================

def is_outer_K4(G, outer):
    """Have we reduced to a K4 with a non-outer vertex?"""
    if not is_K4(G):
        return False
    for v in G:
        if v not in outer:
            return True
    return False

def is_halin(G, triangleHooks=[], pathHooks=[], finalize=is_outer_K4):
    """Test if the graph G is Halin.
    The two hook arguments are the same as for D3reducible,
    but the finalize argument takes two parameters:
    the final graph (as for D3reducible) and a set of
    vertices that have been marked as outer."""
    outer = set()           # Vertices that must be on the outer face

    def triangle(G, u, v, w, Nu, Nv, Nw, x):
        """Check and recolor vertices for triangle reduction"""
        if u in outer and v in outer and w in outer:
            return False    # Can't collapse when all three are outer
        outer.update(q for p, q in ((u, Nu), (v, Nv), (w, Nw)) if p in outer)
        # Mark neighbors of outer as outer as well as the new supervertex
        outer.add(x)
        return True

    def path(G, u, v, w, x):
        """Check and recolor vertices for path reduction"""
        if x in outer:
            return False    # Can't shorten path with outer apex
        if len(G) == 5:
            outer.update(v for v in G if v != x)
        else:
            outer.update((u, w))  # Mark remaining path vertices as outer
        return True

    def final(H):
        """Have we reduced to a K4 with only one outer face?"""
        return finalize(H, outer)

    return is_D3_reducible(G, [triangle] + triangleHooks,
                           [path] + pathHooks, final)

def halin_leaf_vertices(G):
    """Reconstruct the leaf cycle of Halin graph G.
    The cycle is returned as a set of its vertices."""

    outer = set()

    def initialize(H, marked):
        """Augment outer to include all outer vertices"""
        if not is_outer_K4(H, marked):
            raise TypeError("Argument to HalinLeafVertices must be Halin")
        for v in H:
            if v not in marked:
                outer.update(w for w in H if v != w)  # outerize all but v
                break

    def triangle(G, u, v, w, Nu, Nv, Nw, x):
        """Undo a D3a reduction"""
        nout = 0
        for (p, q) in ((u, Nu), (v, Nv), (w, Nw)):
            if q in outer:
                outer.add(p)
                nout += 1
        assert nout == 2

    def path(G, u, v, w, x):
        """Undo a D3b reduction"""
        assert x not in outer
        outer.update((u, v, w))

    reconstruct_D3(G, initialize, triangle, path, is_halin)
    return outer & set(iter(G))     # Find all marked vertices

# ============================================================
#     Hamiltonian cycle
# ============================================================

def hamiltonian_cycle_D3(G):
    ham = {}                # Where to put the Hamiltonian cycle

    def initialize(H):
        """Start a Hamiltonian cycle on a K4"""
        if not is_K4(H):
            raise TypeError("Argument to D3HamiltonianCycle not D3 reducible")
        C = list(H)
        for i in range(4):
            ham[C[i - 1]] = {C[i - 2], C[i]}

    def triangle(G, u, v, w, Nu, Nv, Nw, x):
        """Undo D3a reduction on Hamiltonian cycle"""
        # Permute so the missing edge in the Hamiltonian cycle is Nw-x
        if Nu not in ham[x]:
            u, Nu, w, Nw = w, Nw, u, Nu
        elif Nv not in ham[x]:
            v, Nv, w, Nw = w, Nw, v, Nv
        assert w not in ham[x]

        # Out with the old, in with the new
        del ham[x]
        ham[Nu].remove(x)
        ham[Nu].add(u)
        ham[Nv].remove(x)
        ham[Nv].add(v)
        ham[u] = {Nu, w}
        ham[w] = {u, v}
        ham[v] = {w, Nv}

    def path(G, u, v, w, x):
        """Undo D3b reduction on Hamiltonian cycle"""
        if w not in ham[u]:
            w = x    # Permute so w is a ham-neighbor of u
        ham[u].remove(w)
        ham[u].add(v)
        ham[w].remove(u)
        ham[w].add(v)
        ham[v] = {u, w}

    reconstruct_D3(G, initialize, triangle, path)
    return ham

# ============================================================
#     Additional reduction rules for other graph classes
# ============================================================

def is_dual_3_tree(G, triangleHooks=[], pathHooks=[], finalize=is_K4):
    """Test if the graph G is the dual of a 3-tree."""
    def noPath(G, u, v, w, x):
        return False
    return is_D3_reducible(G, triangleHooks, [noPath], finalize)

def is_wheel(G, triangleHooks=[], pathHooks=[], finalize=is_K4):
    """Test if the graph G is a wheel."""
    def noTriangle(G, u, v, w, Nu, Nv, Nw, x):
        return False
    return is_D3_reducible(G, [noTriangle], pathHooks, finalize)


text:
using System;

namespace Terraria.ModLoader.IO
{
	//implement this interface and add
	//public static Func<TagCompound, ClassName> DESERIALIZER
	//to your class to make it automatically serializable
	public interface TagSerializable
	{
		TagCompound SerializeData();
	}

	internal class TagSerializableSerializer<T> : TagSerializer<T, TagCompound> where T : TagSerializable
	{
		private Func<TagCompound, T> deserializer;

		public TagSerializableSerializer() {
			var type = typeof(T);
			var field = type.GetField("DESERIALIZER");
			if (field != null) {
				if (field.FieldType != typeof(Func<TagCompound, T>))
					throw new ArgumentException(
						$"Invalid deserializer field type {field.FieldType} in {type.FullName} expected {typeof(Func<TagCompound, T>)}.");

				deserializer = (Func<TagCompound, T>)field.GetValue(null);
			}
		}

		public override TagCompound Serialize(T value) {
			var tag = value.SerializeData();
			tag["<type>"] = value.GetType().FullName;
			return tag;
		}

		public override T Deserialize(TagCompound tag) {
			if (tag.ContainsKey("<type>") && tag.GetString("<type>") != Type.FullName) {
				var instType = GetType(tag.GetString("<type>"));
				TagSerializer instSerializer;
				if (instType != null && Type.IsAssignableFrom(instType) && TryGetSerializer(instType, out instSerializer))
					return (T) instSerializer.Deserialize(tag);
			}

			if (deserializer == null)
				throw new ArgumentException($"Missing deserializer for type '{Type.FullName}'.");

			return deserializer(tag);
		}
	}
}


text:
import type { TuplifyUnion, UnionOfTuple } from './types/helpers';
import type { EntityId } from './entity-id';

export type BoxifyTuple<T extends ReadonlyArray<TClass<any>> | [TClass<any>]> = {
  [P in keyof T]: T[P] extends TClass<any> ? ExtractCompileTimeType<T[P]> : never;
};

export type ExtractCompileTimeType<T extends TClass<any>> = T[typeof IO_TS_COMPILE_TIME_TYPE];

export type ExtractCompileTimeTypes<T extends ReadonlyArray<TClass<any>> | [TClass<any>]> = BoxifyTuple<T> extends
  | ReadonlyArray<any>
  | [any]
  ? BoxifyTuple<T>
  : never;

export const IO_TS_RUNTIME_TYPE = Symbol();
export const IO_TS_RUNTIME_VALUE = Symbol();
export const IO_TS_COMPILE_TIME_TYPE = Symbol();

export class TClass<T extends any> {
  [IO_TS_COMPILE_TIME_TYPE]: T;
  [IO_TS_RUNTIME_TYPE]: string;
  [IO_TS_RUNTIME_VALUE]: any;
}

export class TString extends TClass<string> {
  [IO_TS_RUNTIME_TYPE] = 'string';
}
export class TNull extends TClass<null> {
  [IO_TS_RUNTIME_TYPE] = 'null';
}
export class TUndefined extends TClass<undefined> {
  [IO_TS_RUNTIME_TYPE] = 'undefined';
}
export class TVoid extends TClass<void> {
  [IO_TS_RUNTIME_TYPE] = 'void';
}
export class TNumber extends TClass<number> {
  [IO_TS_RUNTIME_TYPE] = 'number';
}
export class TBoolean extends TClass<boolean> {
  [IO_TS_RUNTIME_TYPE] = 'boolean';
}
export class TUnknown extends TClass<unknown> {
  [IO_TS_RUNTIME_TYPE] = 'unknown';
}
export class TLiteral<T extends string> extends TClass<T> {
  [IO_TS_RUNTIME_TYPE] = 'literal';
  [IO_TS_RUNTIME_VALUE]: T;
  constructor(value: T) {
    super();
    this[IO_TS_RUNTIME_TYPE] = value;
  }
}
export class TArray<T extends TClass<any>> extends TClass<Array<T[typeof IO_TS_COMPILE_TIME_TYPE]>> {
  [IO_TS_RUNTIME_TYPE] = 'array';
  [IO_TS_RUNTIME_VALUE]: TClass<T>;
  constructor(value: TClass<T>) {
    super();
    this[IO_TS_RUNTIME_VALUE] = value;
  }
}
export class TRecord<T extends Record<any, TClass<any>>> extends TClass<
  { [K in keyof T]: T[K][typeof IO_TS_COMPILE_TIME_TYPE] }
> {
  [IO_TS_RUNTIME_TYPE] = 'record';
  [IO_TS_RUNTIME_VALUE]: T;
  constructor(value: T) {
    super();
    this[IO_TS_RUNTIME_VALUE] = value;
  }
}

export class TUnion<T extends ReadonlyArray<TClass<any>> | [TClass<any>]> extends TClass<
  UnionOfTuple<ExtractCompileTimeTypes<T>>
> {
  [IO_TS_RUNTIME_TYPE] = 'union';
  [IO_TS_RUNTIME_VALUE]: T;
  constructor(value: T) {
    super();
    this[IO_TS_RUNTIME_VALUE] = value;
  }
}

export class TEntityId<T extends string> extends TClass<EntityId<T>> {
  [IO_TS_RUNTIME_TYPE] = 'entityId';
  [IO_TS_RUNTIME_VALUE]: T;
  constructor(value: T) {
    super();
    this[IO_TS_RUNTIME_TYPE] = value;
  }
}

export type ExtractEntityNames<T extends TClass<any>> = T extends TEntityId<string>
  ? T[typeof IO_TS_RUNTIME_VALUE]
  : T extends TArray<infer P>
  ? ExtractEntityNames<P>
  : T extends TRecord<infer P>
  ? {
      [K in keyof P]: P[K] extends TEntityId<string> ? P[K][typeof IO_TS_RUNTIME_VALUE] : ExtractEntityNames<P[K]>;
    }[keyof P]
  : never;

export const t = {
  null: new TNull(),
  undefined: new TUndefined(),
  void: new TVoid(),
  string: new TString(),
  number: new TNumber(),
  boolean: new TBoolean(),
  unknown: new TUnknown(),
  entityId: <EntityName extends string>(entityName: EntityName): TEntityId<EntityName> => new TEntityId(entityName),
  literal: <Type extends string>(value: Type): TLiteral<Type> => new TLiteral(value),
  array: <Type extends TClass<any>>(schema: Type): TArray<Type> => new TArray(schema),
  type: <Type extends Record<string, TClass<any>>>(schema: Type): TRecord<Type> => new TRecord(schema),
  union: <Type extends ReadonlyArray<TClass<any>> | [TClass<any>]>(schema: Type) => new TUnion(schema),
};

function optionalAddEntityName(entityNames: Array<string>, schema: TClass<any> | undefined): void {
  if (schema == null) {
    return;
  }
  switch (schema[IO_TS_RUNTIME_TYPE]) {
    case 'record': {
      const runtimeValue = schema[IO_TS_RUNTIME_VALUE];
      for (const key in runtimeValue) {
        if (Object.prototype.hasOwnProperty.call(runtimeValue, key)) {
          optionalAddEntityName(entityNames, runtimeValue[key]);
        }
      }
      break;
    }
    case 'array': {
      const runtimeValue = schema[IO_TS_RUNTIME_VALUE];
      for (let index = 0; index < runtimeValue.length; index++) {
        optionalAddEntityName(entityNames, runtimeValue[index]);
      }
      break;
    }
    case 'entityId': {
      entityNames.push(schema[IO_TS_RUNTIME_VALUE]);
      break;
    }
  }
}

export function extractEntityNamesFromSchema<T extends TClass<any>>(schema: T): TuplifyUnion<ExtractEntityNames<T>> {
  const entityNames: Array<string> = [];
  optionalAddEntityName(entityNames, schema);
  Object.freeze(entityNames);
  return entityNames as any;
}


text:
CREATE TABLE event (
		id            BIGINT      NOT NULL AUTO_INCREMENT,

		created_by_id BIGINT
		COMMENT 'Пользователь к которому относится событие. Может быть NULL если событие системное',

		created_at    DATETIME    NOT NULL
		COMMENT 'Момент создания',

		type          VARCHAR(30) NOT NULL
		COMMENT 'Тип (enum)',

		success       BOOLEAN     NOT NULL
		COMMENT 'Успешность события',

		ip            VARCHAR(45) NOT NULL
		COMMENT 'IP-адрес клиента',

		session_id    BIGINT
		COMMENT 'Ссылка на сессию работы',

		ext           LONGTEXT    NOT NULL
		COMMENT 'Дополнительные данные',

		CONSTRAINT pk$event PRIMARY KEY (id),
		CONSTRAINT fk$event$account$account FOREIGN KEY (created_by_id) REFERENCES account (id),
		CONSTRAINT fk$event$account_session$session FOREIGN KEY (session_id) REFERENCES account_session (id)
)
		COMMENT = 'Журнал событий';


text:
<?php
    //qa/form/new.php

    include 'sc-app.inc';
    include(APP_WEB_DIR . '/inc/header.inc');
    include(APP_WEB_DIR . '/inc/role/user.inc');

    $gSessionLogin = \com\indigloo\sc\auth\Login::getLoginInSession();

    use \com\indigloo\ui\form as Form;
    use \com\indigloo\Constants as Constants ;
    use \com\indigloo\Util as Util ;
    use \com\indigloo\Url as Url ;

    use \com\indigloo\sc\util\PseudoId as PseudoId ;
    use \com\indigloo\exception\UIException as UIException;

    if (isset($_POST['save']) && ($_POST['save'] == 'Save')) {

        $gWeb = \com\indigloo\core\Web::getInstance();
        $fvalues = array();
        $fUrl = \com\indigloo\Url::tryFormUrl("fUrl");

        try{

            $fhandler = new Form\Handler('web-form-1', $_POST);
            $fhandler->addRule('links_json', 'links_json', array('rawData' => 1));
            $fhandler->addRule('images_json', 'images_json', array('rawData' => 1));
            $fhandler->addRule('group_names', 'Tags', array('maxlength' => 64,'rawData' => 1));

            //check security token
            $fhandler->checkToken("token",$gWeb->find("form.token",true)) ;
            $fvalues = $fhandler->getValues();

            if ($fhandler->hasErrors()) {
                throw new UIException($fhandler->getErrors());
            }

            $groupDao = new \com\indigloo\sc\dao\Group();
            $group_names =$fvalues['group_names']  ;
            $group_slug = $groupDao->nameToSlug($group_names);

            $postDao = new com\indigloo\sc\dao\Post();
            $title = Util::abbreviate($fvalues['description'],128);

            $itemId = $postDao->create($title,
                                $fvalues['description'],
                                $gSessionLogin->id,
                                $gSessionLogin->name,
                                $_POST['links_json'],
                                $_POST['images_json'],
                                $group_slug,
                                $fvalues['category']);

            //success - always go to item details
            $location = "/item/".$itemId;
            header("Location: /qa/thanks.php?q=". base64_encode($location));

        } catch(UIException $ex) {
            $gWeb->store(Constants::STICKY_MAP, $fvalues);
            $gWeb->store(Constants::FORM_ERRORS,$ex->getMessages());
            header("Location: " . $fUrl);
            exit(1);
        }

    }
?>


text:
class UnmovableStringBuilder {

  public void foo(Object obj) {
    StringBuilder sb<caret> = new StringBuilder();
    sb.append("obj");
    sb.append('=');
    sb.append(obj);
    System.out.println(sb);
  }
}


text:
<!--- Copyright (C) 2009-2013 Typesafe Inc. <http://www.typesafe.com> -->
# Accessing an SQL database

## Configuring JDBC connection pools

Play provides a plug-in for managing JDBC connection pools. You can configure as many databases as you need.

To enable the database plug-in, add jdbc in your build dependencies :

```scala
libraryDependencies += jdbc
```

Then you must configure a connection pool in the `conf/application.conf` file. By convention, the default JDBC data source must be called `default` and the corresponding configuration properties are `db.default.driver` and `db.default.url`.

If something isn't properly configured you will be notified directly in your browser:

[[images/dbError.png]]

> **Note:** You likely need to enclose the JDBC URL configuration value with double quotes, since ':' is a reserved character in the configuration syntax.

### H2 database engine connection properties

```properties
# Default database configuration using H2 database engine in an in-memory mode
db.default.driver=org.h2.Driver
db.default.url="jdbc:h2:mem:play"
```

```properties
# Default database configuration using H2 database engine in a persistent mode
db.default.driver=org.h2.Driver
db.default.url="jdbc:h2:/path/to/db-file"
```

The details of the H2 database URLs are found from [H2 Database Engine Cheat Sheet](http://www.h2database.com/html/cheatSheet.html).

### SQLite database engine connection properties

```properties
# Default database configuration using SQLite database engine
db.default.driver=org.sqlite.JDBC
db.default.url="jdbc:sqlite:/path/to/db-file"
```

### PostgreSQL database engine connection properties

```properties
# Default database configuration using PostgreSQL database engine
db.default.driver=org.postgresql.Driver
db.default.url="jdbc:postgresql://database.example.com/playdb"
```

### MySQL database engine connection properties

```properties
# Default database configuration using MySQL database engine
# Connect to playdb as playdbuser
db.default.driver=com.mysql.jdbc.Driver
db.default.url="jdbc:mysql://localhost/playdb"
db.default.user=playdbuser
db.default.password="a strong password"
```

## How to see SQL Statement in the console?

```properties
db.default.logStatements=true
logger.com.jolbox=DEBUG // for EBean
```

## How to configure several data sources

```properties
# Orders database
db.orders.driver=org.h2.Driver
db.orders.url="jdbc:h2:mem:orders"

# Customers database
db.customers.driver=org.h2.Driver
db.customers.url="jdbc:h2:mem:customers"
```

## Configuring the JDBC Driver

Play is bundled only with an [H2](http://www.h2database.com) database driver. Consequently, to deploy in production you will need to add your database driver as a dependency.

For example, if you use MySQL5, you need to add a [[dependency | SBTDependencies]] for the connector:

```scala
libraryDependencies += "mysql" % "mysql-connector-java" % "5.1.34"
```

Or if the driver can't be found from repositories you can drop the driver into your project's [[unmanaged dependencies|Anatomy]] `lib` directory.

## Accessing the JDBC datasource

The `play.api.db` package provides access to the configured data sources:

```scala
import play.api.db._

val ds = DB.getDataSource()
```

## Obtaining a JDBC connection

There are several ways to retrieve a JDBC connection. The simplest way is:

```scala
val connection = DB.getConnection()
```

Following code show you a JDBC example very simple, working with MySQL 5.*:

```scala
package controllers
import play.api.Play.current
import play.api.mvc._
import play.api.db._

object Application extends Controller {

  def index = Action {
    var outString = "Number is "
    val conn = DB.getConnection()
    try {
      val stmt = conn.createStatement
      val rs = stmt.executeQuery("SELECT 9 as testkey ")
      while (rs.next()) {
        outString += rs.getString("testkey")
      }
    } finally {
      conn.close()
    }
    Ok(outString)
  }

}
```

But of course you need to call `close()` at some point on the opened connection to return it to the connection pool. Another way is to let Play manage closing the connection for you:

```scala
// access "default" database
DB.withConnection { conn =>
  // do whatever you need with the connection
}
```

For a database other than the default:

```scala
// access "orders" database instead of "default"
DB.withConnection("orders") { conn =>
  // do whatever you need with the connection
}
```

The connection will be automatically closed at the end of the block.

> **Tip:** Each `Statement` and `ResultSet` created with this connection will be closed as well.

A variant is to set the connection's auto-commit to `false` and to manage a transaction for the block:

```scala
DB.withTransaction { conn =>
  // do whatever you need with the connection
}
```


text: Presentazioni Meetup https://www.meetup.com/Python-Milano/events/239846600/


text:
package containerd

import (
	"bytes"
	"context"
	"flag"
	"fmt"
	"io/ioutil"
	golog "log"
	"os"
	"os/exec"
	"runtime"
	"syscall"
	"testing"
	"time"

	"google.golang.org/grpc/grpclog"

	"github.com/containerd/containerd/log"
	"github.com/containerd/containerd/namespaces"
	"github.com/containerd/containerd/testutil"
	"github.com/sirupsen/logrus"
)

var (
	address      string
	noDaemon     bool
	noCriu       bool
	supportsCriu bool
)

func init() {
	// Discard grpc logs so that they don't mess with our stdio
	grpclog.SetLogger(golog.New(ioutil.Discard, "", golog.LstdFlags))

	flag.StringVar(&address, "address", defaultAddress, "The address to the containerd socket for use in the tests")
	flag.BoolVar(&noDaemon, "no-daemon", false, "Do not start a dedicated daemon for the tests")
	flag.BoolVar(&noCriu, "no-criu", false, "Do not run the checkpoint tests")
	flag.Parse()
}

func testContext() (context.Context, context.CancelFunc) {
	ctx, cancel := context.WithCancel(context.Background())
	ctx = namespaces.WithNamespace(ctx, "testing")
	return ctx, cancel
}

func TestMain(m *testing.M) {
	if testing.Short() {
		os.Exit(m.Run())
	}
	testutil.RequiresRootM()
	// check if criu is installed on the system
	_, err := exec.LookPath("criu")
	supportsCriu = err == nil && !noCriu

	var (
		cmd         *exec.Cmd
		buf         = bytes.NewBuffer(nil)
		ctx, cancel = testContext()
	)
	defer cancel()

	if !noDaemon {
		os.RemoveAll(defaultRoot)

		// setup a new containerd daemon if !testing.Short
		cmd = exec.Command("containerd",
			"--root", defaultRoot,
			"--address", address,
			"--log-level", "debug",
		)
		cmd.Stdout = buf
		cmd.Stderr = buf
		if err := cmd.Start(); err != nil {
			cmd.Wait()
			fmt.Fprintf(os.Stderr, "%s: %s", err, buf.String())
			os.Exit(1)
		}
	}

	client, err := waitForDaemonStart(ctx, address)
	if err != nil {
		if cmd.Process != nil {
			cmd.Process.Kill()
		}
		cmd.Wait()
		fmt.Fprintf(os.Stderr, "%s: %s", err, buf.String())
		os.Exit(1)
	}

	// print out the version in information
	version, err := client.Version(ctx)
	if err != nil {
		fmt.Fprintf(os.Stderr, "error getting version: %s", err)
		os.Exit(1)
	}

	// allow comparison with containerd under test
	log.G(ctx).WithFields(logrus.Fields{
		"version":  version.Version,
		"revision": version.Revision,
	}).Info("running tests against containerd")

	// pull a seed image
	if runtime.GOOS != "windows" { // TODO: remove once pull is supported on windows
		if _, err = client.Pull(ctx, testImage, WithPullUnpack); err != nil {
			cmd.Process.Signal(syscall.SIGTERM)
			cmd.Wait()
			fmt.Fprintf(os.Stderr, "%s: %s", err, buf.String())
			os.Exit(1)
		}
	}

	if err := platformTestSetup(client); err != nil {
		fmt.Fprintln(os.Stderr, "platform test setup failed", err)
		os.Exit(1)
	}

	if err := client.Close(); err != nil {
		fmt.Fprintln(os.Stderr, "failed to close client", err)
	}

	// run the test
	status := m.Run()

	if !noDaemon {
		// tear down the daemon and resources created
		if err := cmd.Process.Signal(syscall.SIGTERM); err != nil {
			if err := cmd.Process.Kill(); err != nil {
				fmt.Fprintln(os.Stderr, "failed to signal containerd", err)
			}
		}
		if err := cmd.Wait(); err != nil {
			fmt.Fprintln(os.Stderr, "failed to wait for containerd", err)
		}
		if err := os.RemoveAll(defaultRoot); err != nil {
			fmt.Fprintln(os.Stderr, "failed to remove test root dir", err)
			os.Exit(1)
		}
		// only print containerd logs if the test failed
		if status != 0 {
			fmt.Fprintln(os.Stderr, buf.String())
		}
	}
	os.Exit(status)
}

func waitForDaemonStart(ctx context.Context, address string) (*Client, error) {
	var (
		client  *Client
		serving bool
		err     error
	)

	for i := 0; i < 20; i++ {
		if client == nil {
			client, err = New(address)
		}
		if err == nil {
			serving, err = client.IsServing(ctx)
			if serving {
				return client, nil
			}
		}
		time.Sleep(100 * time.Millisecond)
	}
	return nil, fmt.Errorf("containerd did not start within 2s: %v", err)
}

func newClient(t testing.TB, address string, opts ...ClientOpt) (*Client, error) {
	if testing.Short() {
		t.Skip()
	}
	// testutil.RequiresRoot(t) is not needed here (already called in TestMain)
	return New(address, opts...)
}

func TestNewClient(t *testing.T) {
	client, err := newClient(t, address)
	if err != nil {
		t.Fatal(err)
	}
	if client == nil {
		t.Fatal("New() returned nil client")
	}
	if err := client.Close(); err != nil {
		t.Errorf("client closed returned errror %v", err)
	}
}

func TestImagePull(t *testing.T) {
	if runtime.GOOS == "windows" {
		// TODO: remove once Windows has a snapshotter
		t.Skip("Windows does not have a snapshotter yet")
	}

	client, err := newClient(t, address)
	if err != nil {
		t.Fatal(err)
	}
	defer client.Close()

	ctx, cancel := testContext()
	defer cancel()
	_, err = client.Pull(ctx, testImage)
	if err != nil {
		t.Error(err)
		return
	}
}


text:
Native Navigation is built in such a way that a core interface, called a "Navigation Implementation"
can be provided to the library to handle a lot of the UI aspects of Navigation. This allows users of
the library to actually use their own custom navigation solutions without hacking the internals of it
or rolling their own.

Native Navigation ships with [`DefaultImplementation`](/docs/implementations/DefaultImplementation.md)
which is an implementation that uses the iOS and Android idiomatic platform navigation components, and
attempts to make them as customizable as they were meant to be, but this may not be customizable
enough for your use case.

Below is some documentation around the specific interface methods

## iOS Navigation Implementations

```swift
protocol ReactNavigationImplementation {

  func makeNavigationController(rootViewController: UIViewController) -> UINavigationController

  func reconcileScreenConfig(
    viewController: ReactViewController,
    navigationController: UINavigationController?,
    prev: [String: AnyObject],
    next: [String: AnyObject]
  )

  func reconcileTabConfig(
    tabBarItem: UITabBarItem,
    prev: [String: AnyObject],
    next: [String: AnyObject]
  )

  func reconcileTabBarConfig(
    tabBar: UITabBar,
    prev: [String: AnyObject],
    next: [String: AnyObject]
  )

  func getBarHeight(
    viewController: ReactViewController,
    navigationController: UINavigationController?,
    config: [String: AnyObject]
  ) -> CGFloat;
}
```

If you have a navigation implementation that you would like to use, you have to inject it into the
`ReactNavigationCoordinator`:

```swift
let implementation: ReactNavigationImplementation = MyCustomNavigationImplementation();
ReactNavigationCoordinator.sharedInstance.navigation = implementation;
```

### Android Navigation Implementations

```java
interface NavigationImplementation {
  void reconcileNavigationProperties(
      ReactInterface component,
      ReactToolbar toolbar,
      ActionBar bar,
      ReadableMap previous,
      ReadableMap next,
      boolean firstCall
  );

  void prepareOptionsMenu(
      ReactInterface component,
      ReactToolbar toolbar,
      ActionBar bar,
      Menu menu,
      ReadableMap previous,
      ReadableMap next
  );

  boolean onOptionsItemSelected(
      ReactInterface component,
      ReactToolbar toolbar,
      ActionBar bar,
      MenuItem item,
      ReadableMap config
  );

  float getBarHeight(
      ReactInterface component,
      ReactToolbar toolbar,
      ActionBar actionBar,
      ReadableMap config,
      boolean firstCall
  );

  void makeTabItem(
      ReactBottomNavigation bottomNavigation,
      Menu menu,
      int index,
      Integer itemId,
      ReadableMap config
  );

  void reconcileTabBarProperties(
      ReactBottomNavigation bottomNavigation,
      Menu menu,
      ReadableMap prev,
      ReadableMap next
  );
}
```

If you have a navigation implementation that you would like to use, you have to inject it into the
`ReactNavigationCoordinator`:

```java
NavigationImplementation implementation = new MyCustomNavigationImplementation();
ReactNavigationCoordinator.sharedInstance.injectImplementation(implementation);
```


text:
<!DOCTYPE html>

        <meta charset="UTF-8">
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">

        <title>TODO List</title>

        <form>

                Description:
                <input type="text" class="form-control" id="description" title="Enter description" placeholder="Descriptions task" name="description">

            <button type="button" class="btn btn-primary" onclick="addItem()">New task</button>
        </form>

Items

            <input class="form-check-input" type="checkbox" id="check" onclick="loadItems()">
            not completed

                    id
                    description
                    created
                    status


text:
package ru.histone.v2.java_compiler.java_evaluator;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ru.histone.v2.evaluator.Converter;
import ru.histone.v2.java_compiler.bcompiler.StdLibrary;
import ru.histone.v2.java_compiler.bcompiler.Translator;
import ru.histone.v2.java_compiler.bcompiler.data.Template;
import ru.histone.v2.java_compiler.java_evaluator.support.HistoneTemplateCompiler;
import ru.histone.v2.java_compiler.java_evaluator.support.TemplateFileObject;
import ru.histone.v2.parser.Parser;

import javax.tools.JavaFileObject;
import java.io.IOException;
import java.net.URI;
import java.net.URL;
import java.net.URLClassLoader;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.stream.Collectors;

/**
 * @author Alexey Nevinsky
 */
public class JavaHistoneClassRegistry implements HistoneClassRegistry {

    private static final Logger LOG = LoggerFactory.getLogger(JavaHistoneClassRegistry.class);

    protected final Path basePath;
    protected final StdLibrary stdLibrary;
    protected final Converter converter;
    protected HistoneTemplateCompiler compiler;

    protected final Map<String, RegistryObj> data = new ConcurrentHashMap<>();
    protected final URL[] baseURL;

    public JavaHistoneClassRegistry(URL basePath, StdLibrary stdLibrary, Parser parser, Translator histoneTranslator,
                                    Converter converter) {
        baseURL = new URL[]{basePath};
        this.basePath = Paths.get(URI.create(basePath.toString()));
        this.stdLibrary = stdLibrary;
        this.converter = converter;
        this.compiler = new HistoneTemplateCompiler(this, parser, histoneTranslator);
    }

    @Override
    public Template loadInstance(String className) {
        RegistryObj obj = getOrCreateLock(className);
        if (obj.instance != null) {
            return obj.instance;
        }

        obj.lock.writeLock().lock();
        try {
            URLClassLoader tmp = new URLClassLoader(baseURL, getClass().getClassLoader());
            Template t = loadTemplateByClassName(className, tmp);
            obj.instance = t;
            return t;
        } finally {
            obj.lock.writeLock().unlock();
        }
    }

    @Override
    public void add(String className, JavaFileObject javaFile) {
        RegistryObj obj = getOrCreateLock(className);
        obj.lock.writeLock().lock();
        try {
            obj.instance = null;
            obj.file = javaFile;
        } finally {
            obj.lock.writeLock().unlock();
        }
    }

    @Override
    public Collection<? extends JavaFileObject> files() {
        return Collections.unmodifiableCollection(data.values().stream()
                .filter(x -> x.file != null)
                .map(x -> x.file)
                .collect(Collectors.toList())
        );
    }

    @Override
    public void remove(final String className) {
        RegistryObj obj = data.get(className);
        data.remove(className, obj);
    }

    @Override
    public Template loadInstanceFromTpl(String className, String tpl) {
        RegistryObj obj = getOrCreateLock(className);
        obj.lock.writeLock().lock();
        try {
            String javaCode;
            try {
                javaCode = compiler.translate(className, tpl);
            } catch (IOException e) {
                LOG.error("Error translate tpl '" + className + "'", e);
                data.remove(className, obj);
                return null;
            }

            Map<String, String> classesObjects = Collections.singletonMap(className, javaCode);
            compiler.compile(classesObjects);

            JavaFileObject file = obj.file;
            if (file != null) {
                Template t = loadTemplateFromFile(file, className);
                obj.instance = t;
                if (t != null) {
                    return t;
                }
            }
            data.remove(className, obj);
            return null;
        } finally {
            obj.lock.writeLock().unlock();
        }
    }

    protected RegistryObj getOrCreateLock(String className) {
        return data.computeIfAbsent(className, k -> new RegistryObj());
    }

    /**
     * Method without locking. You must use lock from locks map then you will use this method
     *
     * @param file
     * @param className
     * @return instance of template
     */
    protected Template loadTemplateFromFile(JavaFileObject file, String className) {
        TemplateFileObject castedFile = (TemplateFileObject) file;
        URLClassLoader tmp = new URLClassLoader(baseURL, getClass().getClassLoader()) {
            @Override
            public Class<?> loadClass(String name) throws ClassNotFoundException {
                if (className.equals(name)) {
                    byte[] bytes = castedFile.getByteCode();
                    return defineClass(className, bytes, 0, bytes.length);
                }
                return super.loadClass(name);
            }
        };

        return loadTemplateByClassName(className, tmp);
    }

    protected Template loadTemplateByClassName(String className, URLClassLoader tmp) {
        try {
            Template t = (Template) tmp.loadClass(className).newInstance();
            t.setStdLibrary(stdLibrary);
            t.setConverter(converter);
            return t;
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
            LOG.error(e.getMessage(), e);
            return null;
        }
    }

    @Override
    public String getOriginBasePath() {
        return basePath.toString();
    }

    @Override
    public String getRealBasePath() {
        return basePath.toString();
    }

    protected static class RegistryObj {
        public volatile ReadWriteLock lock;
        public volatile JavaFileObject file;
        public volatile Template instance;

        public RegistryObj() {
            lock = new ReentrantReadWriteLock();
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;

            if (o == null || getClass() != o.getClass()) return false;

            RegistryObj that = (RegistryObj) o;

            return new EqualsBuilder()
                    .append(lock, that.lock)
                    .isEquals();
        }

        @Override
        public int hashCode() {
            return new HashCodeBuilder(17, 37)
                    .append(lock)
                    .toHashCode();
        }
    }
}


text:
package org.kaazing.gateway.server.spi.security;

import java.net.InetAddress;

import javax.security.auth.callback.Callback;

/**
 * A callback class that retrieves the remote InetAddress presented to
 * the Gateway for use in a {@link javax.security.auth.spi.LoginModule}.
 */
public class InetAddressCallback implements Callback {
    private InetAddress inetAddress;

    public InetAddress getInetAddress() {
        return inetAddress;
    }

    public void setInetAddress(InetAddress inetAddress) {
        this.inetAddress = inetAddress;
    }
}


text:
import Sketchy from 'moresketchy';
import mathjs from 'mathjs';

export default class Geometry {
  static extractDataFromSVG(svgText, width = 109, height = 109, pixelsPerPoint = 1) {
    const object = document.createElement('object');
    object.innerHTML = svgText;

    // Get paths
    const paths = object.getElementsByTagName('path');
    const pathArray = [];
    for (let i = 0; i < paths.length; i++) {
      const pathLength = paths[i].getTotalLength();

      const numPoints = pathLength / pixelsPerPoint + 1;
      const pathPoints = [];

      for (let j = 0; j < numPoints; j++) {
        const p = paths[i].getPointAtLength(j * pathLength / numPoints);
        pathPoints.push({
          x: p.x / 109 * width,
          y: p.y / 109 * height
        });
      }

      pathArray.push(pathPoints);
    }

    // Get numbers
    const texts = object.getElementsByTagName('text');
    const numberArray = [];
    for (let k = 0; k < texts.length; k++) {
      // matrix(1 0 0 1 20.25 13.63)
      const xyMatches = texts[k]
        .getAttribute('transform')
        .match(/matrix\([(\d\s)]{8}([^(\s)]*)\s([^(\s)]*)\)/)
        .slice(1);
      const text = parseInt(texts[k].textContent, 10);
      const x = parseInt(parseFloat(xyMatches[0]) / 109 * width, 10);
      const y = parseInt(parseFloat(xyMatches[1]) / 109 * height, 10);

      numberArray.push({ text, x, y });
    }

    return {
      paths: pathArray,
      numbers: numberArray
    };
  }

  static getIntersections(pointPath1, pointPath2) {
    const intersections = [];

    const coordsAsArr = coordsObj => [coordsObj.x, coordsObj.y];
    const coordsAsObj = coordsArr => ({ x: coordsArr[0], y: coordsArr[1] });

    pointPath2.forEach((rootCoords, rootIndex, rootArr) => {
      if (rootArr[rootIndex + 1] === undefined) {
        // out of bounds
        return;
      }

      pointPath1.forEach((subCoords, subIndex, subArr) => {
        if (subArr[subIndex + 1] === undefined) {
          // out of bounds
          return;
        }

        const nextSubCoords = subArr[subIndex + 1];
        const nextRootCoords = rootArr[rootIndex + 1];

        const intersection = mathjs.intersect(
          coordsAsArr(subCoords),
          coordsAsArr(nextSubCoords),
          coordsAsArr(rootCoords),
          coordsAsArr(nextRootCoords)
        );

        if (intersection) {
          const intObj = coordsAsObj(intersection);

          // is the intersection happening within the two lines or somewhere outside?
          if (
            this.isCoordinateWithinLine(subCoords, nextSubCoords, intObj) &&
            this.isCoordinateWithinLine(rootCoords, nextRootCoords, intObj)
          ) {
            intersections.push({
              firstPathPercentage: subIndex / (subArr.length - 1) * 100 || 0,
              secondPathPercentage: rootIndex / (rootArr.length - 1) * 100 || 0
            });
          }
        }
      });
    });

    return intersections;
  }

  static getLineDimensions(lineStart, lineEnd) {
    const width = Math.abs(lineStart.x - lineEnd.x);
    const height = Math.abs(lineStart.y - lineEnd.y);
    const minX = Math.min(lineStart.x, lineEnd.x);
    const minY = Math.min(lineStart.y, lineEnd.y);

    return {
      width,
      height,
      minX,
      minY
    };
  }

  static isCoordinateWithinLine(lineStart, lineEnd, coords) {
    const { width, height, minX, minY } = this.getLineDimensions(lineStart, lineEnd);
    return coords.x <= minX + width && coords.x >= minX && coords.y <= minY + height && coords.y >= minY;
  }

  static getAngle(startPoint, endPoint) {
    return Math.atan2(endPoint.y - startPoint.y, endPoint.x - startPoint.x) * 180 / Math.PI;
  }

  static compareShapes(pointPath1, pointPath2, convertToPoints = false, accuracyPercentage = 10) {
    return Sketchy.shapeContextMatch(pointPath1, pointPath2, convertToPoints, accuracyPercentage);
  }
}