text:
.class public Lcom/quizup/core/activities/SignUpProfileActivity$MyAlertDialogFragment;
.super Landroid/app/DialogFragment;
.source ""

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/quizup/core/activities/SignUpProfileActivity;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x9
    name = "MyAlertDialogFragment"
.end annotation

# direct methods
.method public constructor <init>()V
    .locals 0

    .line 347
    invoke-direct {p0}, Landroid/app/DialogFragment;-><init>()V

    return-void
.end method

.method static synthetic access$1000(ILjava/lang/String;Landroid/app/Activity;)V
    .locals 0

    .line 347
    invoke-static {p0, p1, p2}, Lcom/quizup/core/activities/SignUpProfileActivity$MyAlertDialogFragment;->showDialogWithErrorMessage(ILjava/lang/String;Landroid/app/Activity;)V

    return-void
.end method

.method static synthetic access$900(Landroid/app/Activity;)Landroid/net/Uri;
    .locals 1

    .line 347
    invoke-static {p0}, Lcom/quizup/core/activities/SignUpProfileActivity$MyAlertDialogFragment;->getPictureUri(Landroid/app/Activity;)Landroid/net/Uri;

    move-result-object v0

    return-object v0
.end method

.method private static getPictureUri(Landroid/app/Activity;)Landroid/net/Uri;
    .locals 4

    .line 410
    const-string v2, "temp.png"

    .line 411
    new-instance v0, Landroid/content/ContentValues;

    invoke-direct {v0}, Landroid/content/ContentValues;-><init>()V

    .line 412
    move-object v3, v0

    const-string v1, "title"

    invoke-virtual {v0, v1, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 414
    invoke-virtual {p0}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    sget-object v1, Landroid/provider/MediaStore$Images$Media;->EXTERNAL_CONTENT_URI:Landroid/net/Uri;

    invoke-virtual {v0, v1, v3}, Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;

    move-result-object p0

    .line 415
    invoke-static {}, Lcom/quizup/core/QuizApplication;->ᐝ()Lcom/quizup/core/QuizApplication;

    move-result-object v0

    iput-object p0, v0, Lcom/quizup/core/QuizApplication;->':Landroid/net/Uri;

    .line 417
    return-object p0
.end method

.method public static newInstance()Lcom/quizup/core/activities/SignUpProfileActivity$MyAlertDialogFragment;
    .locals 1

    .line 351
    new-instance v0, Lcom/quizup/core/activities/SignUpProfileActivity$MyAlertDialogFragment;

    invoke-direct {v0}, Lcom/quizup/core/activities/SignUpProfileActivity$MyAlertDialogFragment;-><init>()V

    return-object v0
.end method

.method private static showDialogWithErrorMessage(ILjava/lang/String;Landroid/app/Activity;)V
    .locals 4

    .line 400
    invoke-static {}, Lcom/quizup/core/activities/SignUpProfileActivity$MyAlertDialogFragment;->newInstance()Lcom/quizup/core/activities/SignUpProfileActivity$MyAlertDialogFragment;

    move-result-object v2

    .line 401
    new-instance v0, Landroid/os/Bundle;

    invoke-direct {v0}, Landroid/os/Bundle;-><init>()V

    .line 402
    move-object v3, v0

    const-string v1, "error"

    invoke-virtual {v0, v1, p1}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 403
    const-string v0, "id"

    invoke-virtual {v3, v0, p0}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V

    .line 404
    invoke-virtual {v2, v3}, Landroid/app/DialogFragment;->setArguments(Landroid/os/Bundle;)V

    .line 405
    invoke-virtual {p2}, Landroid/app/Activity;->getFragmentManager()Landroid/app/FragmentManager;

    move-result-object v0

    const-string v1, "dialog"

    invoke-virtual {v2, v0, v1}, Landroid/app/DialogFragment;->show(Landroid/app/FragmentManager;Ljava/lang/String;)V

    .line 406
    return-void
.end method

# virtual methods
.method public onCreateDialog(Landroid/os/Bundle;)Landroid/app/Dialog;
    .locals 3

    .line 357
    const v0, 0x7f0701ad

    invoke-static {v0}, Lo/ċ;->ˊ(I)Ljava/lang/String;

    move-result-object p1

    .line 359
    const/4 v0, 0x3

    new-array v2, v0, [Ljava/lang/CharSequence;

    const v0, 0x7f0701b0

    invoke-static {v0}, Lo/ċ;->ˊ(I)Ljava/lang/String;

    move-result-object v0

    const/4 v1, 0x0

    aput-object v0, v2, v1

    const v0, 0x7f0701b1

    invoke-static {v0}, Lo/ċ;->ˊ(I)Ljava/lang/String;

    move-result-object v0

    const/4 v1, 0x1

    aput-object v0, v2, v1

    const v0, 0x7f0701af

    invoke-static {v0}, Lo/ċ;->ˊ(I)Ljava/lang/String;

    move-result-object v0

    const/4 v1, 0x2

    aput-object v0, v2, v1

    .line 365
    new-instance v0, Landroid/app/AlertDialog$Builder;

    invoke-virtual {p0}, Lcom/quizup/core/activities/SignUpProfileActivity$MyAlertDialogFragment;->getActivity()Landroid/app/Activity;

    move-result-object v1

    invoke-direct {v0, v1}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V

    invoke-virtual {v0, p1}, Landroid/app/AlertDialog$Builder;->setTitle(Ljava/lang/CharSequence;)Landroid/app/AlertDialog$Builder;

    move-result-object v0

    new-instance v1, Lcom/quizup/core/activities/SignUpProfileActivity$MyAlertDialogFragment$1;

    invoke-direct {v1, p0}, Lcom/quizup/core/activities/SignUpProfileActivity$MyAlertDialogFragment$1;-><init>(Lcom/quizup/core/activities/SignUpProfileActivity$MyAlertDialogFragment;)V

    invoke-virtual {v0, v2, v1}, Landroid/app/AlertDialog$Builder;->setItems([Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    move-result-object v0

    invoke-virtual {v0}, Landroid/app/AlertDialog$Builder;->create()Landroid/app/AlertDialog;

    move-result-object v0

    return-object v0
.end method


text:
using Armature;
using Armature.Core;
using Armature.Core.BuildActions.Constructor;
using Armature.Core.BuildActions.Property;
using Armature.Core.UnitMatchers;
using Armature.Core.UnitMatchers.Properties;
using Armature.Core.UnitSequenceMatcher;
using FluentAssertions;
using NUnit.Framework;

//Resharper disable all

namespace Tests.Functional
{
  public class BaseTypeTest
  {
    [Test]
    public void should_inject_dependency_into_all_inheritors_of_class()
    {
      const int expected = 39;

      // --arrange
      var target = CreateTarget();

      target.Treat<int>().AsInstance(expected);

      target
        .TreatInheritorsOf<SubjectBase>()
        .InjectProperty(Property.Named(nameof(SubjectBase.InjectThere)));

      target
        .Treat<Subject>()
        .AsIs();
      // --act
      var actual = target.Build<Subject>();

      // --assert
      actual.InjectThere.Should().Be(expected);
    }

    [Test]
    public void should_inject_dependency_into_all_inheritors_of_interface()
    {
      const int expected = 39;

      // --arrange
      var target = CreateTarget();

      target.Treat<int>().AsInstance(expected);

      target
        .TreatInheritorsOf<ISubject>()
        .InjectProperty(Property.Named(nameof(ISubject.InjectThere)));

      target
        .Treat<Subject>()
        .AsIs();

      // --act
      var actual = target.Build<Subject>();

      // --assert
      actual.InjectThere.Should().Be(expected);
    }

    [Test]
    public void should_inject_dependency_all_specified_properties()
    {
      const int expected = 39;

      // --arrange
      var target = CreateTarget();

      target.Treat<int>().AsInstance(expected);

      target
        .TreatInheritorsOf<ISubject>()
        .InjectProperty(Property.Named(nameof(ISubject.InjectThere)));

      target
        .Treat<Subject>()
        .AsIs()
        .InjectProperty(Property.Named(nameof(Subject.InjectHere)));

      // --act
      var actual = target.Build<Subject>();

      // --assert
      actual.InjectHere.Should().Be(expected);
      actual.InjectThere.Should().Be(expected);
    }

    private static Builder CreateTarget() =>
      new Builder(BuildStage.Cache, BuildStage.Initialize, BuildStage.Create)
      {
        new AnyUnitSequenceMatcher
        {
          // inject into constructor
          new LastUnitSequenceMatcher(ConstructorMatcher.Instance)
            .AddBuildAction(BuildStage.Create, GetLongestConstructorBuildAction.Instance), // constructor with largest number of parameters has less priority

          new LastUnitSequenceMatcher(PropertyValueMatcher.Instance)
            .AddBuildAction(BuildStage.Create, new CreatePropertyValueBuildAction())
        }
      };

    private interface ISubject
    {
      int InjectThere { get; set; }
    }

    private abstract class SubjectBase
    {
      public int InjectThere { get; set; }
    }

    private class Subject : SubjectBase, ISubject
    {
      public int InjectHere { get; set; }
    }
  }
}

redpajama_set_name: RedPajamaGithub


text:
programming-rnn
===============

Programming a program to program, so meta.


text:
class DepCache(object):
    def __init__(self):
        self.hits = 0
        self.misses = 0
        self.cache = {}

    @classmethod
    def clear(cls):
        cls.instance = None

    def _get(self, obj, state):
        if state:
            return obj.get_deps(state)
        else:
            return obj.get_deps()

    def get(self, obj, state=None):
        from chroma_core.models import StatefulObject

        if state == None and isinstance(obj, StatefulObject):
            state = obj.state

        if state:
            key = (obj, state)
        else:
            key = obj

        try:
            v = self.cache[key]
            self.hits += 1

            return v
        except KeyError:
            self.cache[key] = self._get(obj, state)
            self.misses += 1
            return self.cache[key]


text:
<?php

namespace Tests\Services;

use Services\RequestService;

class RequestServiceTest extends \PHPUnit_Framework_TestCase
{

    /**
     * @test
     */
    public function testQuery()
    {

        $query = [
            'page'      => 7,
            'total'     => 36
        ];

        $request = new RequestService();
        $request->setQuery( $query );

        $all_queries    = $request->query();
        $single_query   = $request->query( 'page' );

        $this->assertEquals( $query, $all_queries );
        $this->assertEquals( 7, $single_query );

    }

    /**
     * @test
     */
    public function testData()
    {

        $data = [
            'page'      => 7,
            'total'     => 36
        ];

        $request = new RequestService();
        $request->setData( $data );

        $all_data       = $request->data();
        $single_datum   = $request->data( 'total' );

        $this->assertEquals( $data, $all_data );
        $this->assertEquals( 36, $single_datum );

    }

    /**
     * @test
     */
    public function testGetPath()
    {

        $path = 'test/uri/path';

        $request = new RequestService();
        $request->setPath( $path );

        $result = $request->getPath();

        $this->assertEquals( $path, $result );

    }

    /**
     * @test
     */
    public function testGetPathWithBlankRequestUri()
    {

        $path = '';

        $request = new RequestService();
        $request->setPath( $path );

        $result = $request->getPath();

        $this->assertEquals( '/', $result );

    }

    /**
     * @test
     */
    public function testSetQuery()
    {

        $query = [
            'page'      => 563,
            'total'     => 36
        ];

        $request = new RequestService();
        $request->setQuery( $query );

        $all_queries    = $request->query();
        $single_query   = $request->query( 'page' );

        $this->assertEquals( $query, $all_queries );
        $this->assertEquals( 563, $single_query );

    }

    /**
     * @test
     */
    public function testSetData()
    {

        $data = [
            'page'      => 123,
            'total'     => 234
        ];

        $request = new RequestService();
        $request->setData( $data );

        $all_data       = $request->data();
        $single_datum   = $request->data( 'total' );

        $this->assertEquals( $data, $all_data );
        $this->assertEquals( 234, $single_datum );

    }

}


text:
package org.apache.camel.builder.component.dsl;

import javax.annotation.Generated;
import org.apache.camel.Component;
import org.apache.camel.builder.component.AbstractComponentBuilder;
import org.apache.camel.builder.component.ComponentBuilder;
import org.apache.camel.component.http.HttpComponent;

/**
 * Send requests to external HTTP servers using Apache HTTP Client 4.x.
 *
 * Generated by camel-package-maven-plugin - do not edit this file!
 */
@Generated("org.apache.camel.maven.packaging.ComponentDslMojo")
public interface HttpComponentBuilderFactory {

    /**
     * HTTP (camel-http)
     * Send requests to external HTTP servers using Apache HTTP Client 4.x.
     *
     * Category: http
     * Since: 2.3
     * Maven coordinates: org.apache.camel:camel-http
     *
     * @return the dsl builder
     */
    static HttpComponentBuilder http() {
        return new HttpComponentBuilderImpl();
    }

    /**
     * Builder for the HTTP component.
     */
    interface HttpComponentBuilder extends ComponentBuilder<HttpComponent> {
        /**
         * To use a custom org.apache.http.client.CookieStore. By default the
         * org.apache.http.impl.client.BasicCookieStore is used which is an
         * in-memory only cookie store. Notice if bridgeEndpoint=true then the
         * cookie store is forced to be a noop cookie store as cookie shouldn't
         * be stored as we are just bridging (eg acting as a proxy).
         *
         * The option is a:
         * org.apache.http.client.CookieStore type.
         *
         * Group: producer
         *
         * @param cookieStore the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder cookieStore(
                org.apache.http.client.CookieStore cookieStore) {
            doSetProperty("cookieStore", cookieStore);
            return this;
        }
        /**
         * If this option is true then IN exchange headers will be copied to OUT
         * exchange headers according to copy strategy. Setting this to false,
         * allows to only include the headers from the HTTP response (not
         * propagating IN headers).
         *
         * The option is a: boolean type.
         *
         * Default: true
         * Group: producer
         *
         * @param copyHeaders the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder copyHeaders(boolean copyHeaders) {
            doSetProperty("copyHeaders", copyHeaders);
            return this;
        }
        /**
         * Whether the producer should be started lazy (on the first message).
         * By starting lazy you can use this to allow CamelContext and routes to
         * startup in situations where a producer may otherwise fail during
         * starting and cause the route to fail being started. By deferring this
         * startup to be lazy then the startup failure can be handled during
         * routing messages via Camel's routing error handlers. Beware that when
         * the first message is processed then creating and starting the
         * producer may take a little time and prolong the total processing time
         * of the processing.
         *
         * The option is a: boolean type.
         *
         * Default: false
         * Group: producer
         *
         * @param lazyStartProducer the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder lazyStartProducer(boolean lazyStartProducer) {
            doSetProperty("lazyStartProducer", lazyStartProducer);
            return this;
        }
        /**
         * This threshold in bytes controls whether the response payload should
         * be stored in memory as a byte array or be streaming based. Set this
         * to -1 to always use streaming mode.
         *
         * The option is a: int type.
         *
         * Default: 8192
         * Group: producer
         *
         * @param responsePayloadStreamingThreshold the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder responsePayloadStreamingThreshold(
                int responsePayloadStreamingThreshold) {
            doSetProperty("responsePayloadStreamingThreshold", responsePayloadStreamingThreshold);
            return this;
        }
        /**
         * Whether to skip mapping all the Camel headers as HTTP request
         * headers. If there are no data from Camel headers needed to be
         * included in the HTTP request then this can avoid parsing overhead
         * with many object allocations for the JVM garbage collector.
         *
         * The option is a: boolean type.
         *
         * Default: false
         * Group: producer (advanced)
         *
         * @param skipRequestHeaders the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder skipRequestHeaders(
                boolean skipRequestHeaders) {
            doSetProperty("skipRequestHeaders", skipRequestHeaders);
            return this;
        }
        /**
         * Whether to skip mapping all the HTTP response headers to Camel
         * headers. If there are no data needed from HTTP headers then this can
         * avoid parsing overhead with many object allocations for the JVM
         * garbage collector.
         *
         * The option is a: boolean type.
         *
         * Default: false
         * Group: producer (advanced)
         *
         * @param skipResponseHeaders the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder skipResponseHeaders(
                boolean skipResponseHeaders) {
            doSetProperty("skipResponseHeaders", skipResponseHeaders);
            return this;
        }
        /**
         * Whether to allow java serialization when a request uses
         * context-type=application/x-java-serialized-object. This is by default
         * turned off. If you enable this then be aware that Java will
         * deserialize the incoming data from the request to Java and that can
         * be a potential security risk.
         *
         * The option is a: boolean type.
         *
         * Default: false
         * Group: advanced
         *
         * @param allowJavaSerializedObject the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder allowJavaSerializedObject(
                boolean allowJavaSerializedObject) {
            doSetProperty("allowJavaSerializedObject", allowJavaSerializedObject);
            return this;
        }
        /**
         * Disables authentication scheme caching.
         *
         * The option is a: boolean type.
         *
         * Default: false
         * Group: advanced
         *
         * @param authCachingDisabled the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder authCachingDisabled(
                boolean authCachingDisabled) {
            doSetProperty("authCachingDisabled", authCachingDisabled);
            return this;
        }
        /**
         * Disables automatic request recovery and re-execution.
         *
         * The option is a: boolean type.
         *
         * Default: false
         * Group: advanced
         *
         * @param automaticRetriesDisabled the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder automaticRetriesDisabled(
                boolean automaticRetriesDisabled) {
            doSetProperty("automaticRetriesDisabled", automaticRetriesDisabled);
            return this;
        }
        /**
         * Whether autowiring is enabled. This is used for automatic autowiring
         * options (the option must be marked as autowired) by looking up in the
         * registry to find if there is a single instance of matching type,
         * which then gets configured on the component. This can be used for
         * automatic configuring JDBC data sources, JMS connection factories,
         * AWS Clients, etc.
         *
         * The option is a: boolean type.
         *
         * Default: true
         * Group: advanced
         *
         * @param autowiredEnabled the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder autowiredEnabled(boolean autowiredEnabled) {
            doSetProperty("autowiredEnabled", autowiredEnabled);
            return this;
        }
        /**
         * To use a custom and shared HttpClientConnectionManager to manage
         * connections. If this has been configured then this is always used for
         * all endpoints created by this component.
         *
         * The option is a:
         * org.apache.http.conn.HttpClientConnectionManager type.
         *
         * Group: advanced
         *
         * @param clientConnectionManager the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder clientConnectionManager(
                org.apache.http.conn.HttpClientConnectionManager clientConnectionManager) {
            doSetProperty("clientConnectionManager", clientConnectionManager);
            return this;
        }
        /**
         * The maximum number of connections per route.
         *
         * The option is a: int type.
         *
         * Default: 20
         * Group: advanced
         *
         * @param connectionsPerRoute the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder connectionsPerRoute(int connectionsPerRoute) {
            doSetProperty("connectionsPerRoute", connectionsPerRoute);
            return this;
        }
        /**
         * Disables connection state tracking.
         *
         * The option is a: boolean type.
         *
         * Default: false
         * Group: advanced
         *
         * @param connectionStateDisabled the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder connectionStateDisabled(
                boolean connectionStateDisabled) {
            doSetProperty("connectionStateDisabled", connectionStateDisabled);
            return this;
        }
        /**
         * The time for connection to live, the time unit is millisecond, the
         * default value is always keep alive.
         *
         * The option is a: long type.
         *
         * Group: advanced
         *
         * @param connectionTimeToLive the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder connectionTimeToLive(
                long connectionTimeToLive) {
            doSetProperty("connectionTimeToLive", connectionTimeToLive);
            return this;
        }
        /**
         * Disables automatic content decompression.
         *
         * The option is a: boolean type.
         *
         * Default: false
         * Group: advanced
         *
         * @param contentCompressionDisabled the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder contentCompressionDisabled(
                boolean contentCompressionDisabled) {
            doSetProperty("contentCompressionDisabled", contentCompressionDisabled);
            return this;
        }
        /**
         * Disables state (cookie) management.
         *
         * The option is a: boolean type.
         *
         * Default: false
         * Group: advanced
         *
         * @param cookieManagementDisabled the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder cookieManagementDisabled(
                boolean cookieManagementDisabled) {
            doSetProperty("cookieManagementDisabled", cookieManagementDisabled);
            return this;
        }
        /**
         * Disables the default user agent set by this builder if none has been
         * provided by the user.
         *
         * The option is a: boolean type.
         *
         * Default: false
         * Group: advanced
         *
         * @param defaultUserAgentDisabled the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder defaultUserAgentDisabled(
                boolean defaultUserAgentDisabled) {
            doSetProperty("defaultUserAgentDisabled", defaultUserAgentDisabled);
            return this;
        }
        /**
         * To use a custom HttpBinding to control the mapping between Camel
         * message and HttpClient.
         *
         * The option is a:
         * org.apache.camel.http.common.HttpBinding
         * type.
         *
         * Group: advanced
         *
         * @param httpBinding the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder httpBinding(
                org.apache.camel.http.common.HttpBinding httpBinding) {
            doSetProperty("httpBinding", httpBinding);
            return this;
        }
        /**
         * To use the custom HttpClientConfigurer to perform configuration of
         * the HttpClient that will be used.
         *
         * The option is a:
         * org.apache.camel.component.http.HttpClientConfigurer type.
         *
         * Group: advanced
         *
         * @param httpClientConfigurer the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder httpClientConfigurer(
                org.apache.camel.component.http.HttpClientConfigurer httpClientConfigurer) {
            doSetProperty("httpClientConfigurer", httpClientConfigurer);
            return this;
        }
        /**
         * To use the shared HttpConfiguration as base configuration.
         *
         * The option is a:
         * org.apache.camel.http.common.HttpConfiguration type.
         *
         * Group: advanced
         *
         * @param httpConfiguration the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder httpConfiguration(
                org.apache.camel.http.common.HttpConfiguration httpConfiguration) {
            doSetProperty("httpConfiguration", httpConfiguration);
            return this;
        }
        /**
         * To use a custom org.apache.http.protocol.HttpContext when executing
         * requests.
         *
         * The option is a:
         * org.apache.http.protocol.HttpContext type.
         *
         * Group: advanced
         *
         * @param httpContext the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder httpContext(
                org.apache.http.protocol.HttpContext httpContext) {
            doSetProperty("httpContext", httpContext);
            return this;
        }
        /**
         * The maximum number of connections.
         *
         * The option is a: int type.
         *
         * Default: 200
         * Group: advanced
         *
         * @param maxTotalConnections the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder maxTotalConnections(int maxTotalConnections) {
            doSetProperty("maxTotalConnections", maxTotalConnections);
            return this;
        }
        /**
         * Disables automatic redirect handling.
         *
         * The option is a: boolean type.
         *
         * Default: false
         * Group: advanced
         *
         * @param redirectHandlingDisabled the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder redirectHandlingDisabled(
                boolean redirectHandlingDisabled) {
            doSetProperty("redirectHandlingDisabled", redirectHandlingDisabled);
            return this;
        }
        /**
         * To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter
         * header to and from Camel message.
         *
         * The option is a:
         * org.apache.camel.spi.HeaderFilterStrategy
         * type.
         *
         * Group: filter
         *
         * @param headerFilterStrategy the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder headerFilterStrategy(
                org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy) {
            doSetProperty("headerFilterStrategy", headerFilterStrategy);
            return this;
        }
        /**
         * Proxy authentication domain to use.
         *
         * The option is a: java.lang.String type.
         *
         * Group: proxy
         *
         * @param proxyAuthDomain the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder proxyAuthDomain(
                java.lang.String proxyAuthDomain) {
            doSetProperty("proxyAuthDomain", proxyAuthDomain);
            return this;
        }
        /**
         * Proxy authentication host.
         *
         * The option is a: java.lang.String type.
         *
         * Group: proxy
         *
         * @param proxyAuthHost the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder proxyAuthHost(
                java.lang.String proxyAuthHost) {
            doSetProperty("proxyAuthHost", proxyAuthHost);
            return this;
        }
        /**
         * Proxy authentication method to use.
         *
         * The option is a: java.lang.String type.
         *
         * Group: proxy
         *
         * @param proxyAuthMethod the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder proxyAuthMethod(
                java.lang.String proxyAuthMethod) {
            doSetProperty("proxyAuthMethod", proxyAuthMethod);
            return this;
        }
        /**
         * Proxy authentication domain (workstation name) to use with NTML.
         *
         * The option is a: java.lang.String type.
         *
         * Group: proxy
         *
         * @param proxyAuthNtHost the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder proxyAuthNtHost(
                java.lang.String proxyAuthNtHost) {
            doSetProperty("proxyAuthNtHost", proxyAuthNtHost);
            return this;
        }
        /**
         * Proxy authentication password.
         *
         * The option is a: java.lang.String type.
         *
         * Group: proxy
         *
         * @param proxyAuthPassword the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder proxyAuthPassword(
                java.lang.String proxyAuthPassword) {
            doSetProperty("proxyAuthPassword", proxyAuthPassword);
            return this;
        }
        /**
         * Proxy authentication port.
         *
         * The option is a: java.lang.Integer type.
         *
         * Group: proxy
         *
         * @param proxyAuthPort the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder proxyAuthPort(
                java.lang.Integer proxyAuthPort) {
            doSetProperty("proxyAuthPort", proxyAuthPort);
            return this;
        }
        /**
         * Proxy authentication username.
         *
         * The option is a: java.lang.String type.
         *
         * Group: proxy
         *
         * @param proxyAuthUsername the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder proxyAuthUsername(
                java.lang.String proxyAuthUsername) {
            doSetProperty("proxyAuthUsername", proxyAuthUsername);
            return this;
        }
        /**
         * To configure security using SSLContextParameters. Important: Only one
         * instance of org.apache.camel.support.jsse.SSLContextParameters is
         * supported per HttpComponent. If you need to use 2 or more different
         * instances, you need to define a new HttpComponent per instance you
         * need.
         *
         * The option is a:
         * org.apache.camel.support.jsse.SSLContextParameters type.
         *
         * Group: security
         *
         * @param sslContextParameters the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder sslContextParameters(
                org.apache.camel.support.jsse.SSLContextParameters sslContextParameters) {
            doSetProperty("sslContextParameters", sslContextParameters);
            return this;
        }
        /**
         * Enable usage of global SSL context parameters.
         *
         * The option is a: boolean type.
         *
         * Default: false
         * Group: security
         *
         * @param useGlobalSslContextParameters the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder useGlobalSslContextParameters(
                boolean useGlobalSslContextParameters) {
            doSetProperty("useGlobalSslContextParameters", useGlobalSslContextParameters);
            return this;
        }
        /**
         * To use a custom X509HostnameVerifier such as DefaultHostnameVerifier
         * or NoopHostnameVerifier.
         *
         * The option is a:
         * javax.net.ssl.HostnameVerifier type.
         *
         * Group: security
         *
         * @param x509HostnameVerifier the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder x509HostnameVerifier(
                javax.net.ssl.HostnameVerifier x509HostnameVerifier) {
            doSetProperty("x509HostnameVerifier", x509HostnameVerifier);
            return this;
        }
        /**
         * The timeout in milliseconds used when requesting a connection from
         * the connection manager. A timeout value of zero is interpreted as an
         * infinite timeout. A timeout value of zero is interpreted as an
         * infinite timeout. A negative value is interpreted as undefined
         * (system default).
         *
         * The option is a: int type.
         *
         * Default: -1
         * Group: timeout
         *
         * @param connectionRequestTimeout the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder connectionRequestTimeout(
                int connectionRequestTimeout) {
            doSetProperty("connectionRequestTimeout", connectionRequestTimeout);
            return this;
        }
        /**
         * Determines the timeout in milliseconds until a connection is
         * established. A timeout value of zero is interpreted as an infinite
         * timeout. A timeout value of zero is interpreted as an infinite
         * timeout. A negative value is interpreted as undefined (system
         * default).
         *
         * The option is a: int type.
         *
         * Default: -1
         * Group: timeout
         *
         * @param connectTimeout the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder connectTimeout(int connectTimeout) {
            doSetProperty("connectTimeout", connectTimeout);
            return this;
        }
        /**
         * Defines the socket timeout in milliseconds, which is the timeout for
         * waiting for data or, put differently, a maximum period inactivity
         * between two consecutive data packets). A timeout value of zero is
         * interpreted as an infinite timeout. A negative value is interpreted
         * as undefined (system default).
         *
         * The option is a: int type.
         *
         * Default: -1
         * Group: timeout
         *
         * @param socketTimeout the value to set
         * @return the dsl builder
         */
        default HttpComponentBuilder socketTimeout(int socketTimeout) {
            doSetProperty("socketTimeout", socketTimeout);
            return this;
        }
    }

    class HttpComponentBuilderImpl
            extends
                AbstractComponentBuilder<HttpComponent>
            implements
                HttpComponentBuilder {
        @Override
        protected HttpComponent buildConcreteComponent() {
            return new HttpComponent();
        }
        @Override
        protected boolean setPropertyOnComponent(
                Component component,
                String name,
                Object value) {
            switch (name) {
            case "cookieStore": ((HttpComponent) component).setCookieStore((org.apache.http.client.CookieStore) value); return true;
            case "copyHeaders": ((HttpComponent) component).setCopyHeaders((boolean) value); return true;
            case "lazyStartProducer": ((HttpComponent) component).setLazyStartProducer((boolean) value); return true;
            case "responsePayloadStreamingThreshold": ((HttpComponent) component).setResponsePayloadStreamingThreshold((int) value); return true;
            case "skipRequestHeaders": ((HttpComponent) component).setSkipRequestHeaders((boolean) value); return true;
            case "skipResponseHeaders": ((HttpComponent) component).setSkipResponseHeaders((boolean) value); return true;
            case "allowJavaSerializedObject": ((HttpComponent) component).setAllowJavaSerializedObject((boolean) value); return true;
            case "authCachingDisabled": ((HttpComponent) component).setAuthCachingDisabled((boolean) value); return true;
            case "automaticRetriesDisabled": ((HttpComponent) component).setAutomaticRetriesDisabled((boolean) value); return true;
            case "autowiredEnabled": ((HttpComponent) component).setAutowiredEnabled((boolean) value); return true;
            case "clientConnectionManager": ((HttpComponent) component).setClientConnectionManager((org.apache.http.conn.HttpClientConnectionManager) value); return true;
            case "connectionsPerRoute": ((HttpComponent) component).setConnectionsPerRoute((int) value); return true;
            case "connectionStateDisabled": ((HttpComponent) component).setConnectionStateDisabled((boolean) value); return true;
            case "connectionTimeToLive": ((HttpComponent) component).setConnectionTimeToLive((long) value); return true;
            case "contentCompressionDisabled": ((HttpComponent) component).setContentCompressionDisabled((boolean) value); return true;
            case "cookieManagementDisabled": ((HttpComponent) component).setCookieManagementDisabled((boolean) value); return true;
            case "defaultUserAgentDisabled": ((HttpComponent) component).setDefaultUserAgentDisabled((boolean) value); return true;
            case "httpBinding": ((HttpComponent) component).setHttpBinding((org.apache.camel.http.common.HttpBinding) value); return true;
            case "httpClientConfigurer": ((HttpComponent) component).setHttpClientConfigurer((org.apache.camel.component.http.HttpClientConfigurer) value); return true;
            case "httpConfiguration": ((HttpComponent) component).setHttpConfiguration((org.apache.camel.http.common.HttpConfiguration) value); return true;
            case "httpContext": ((HttpComponent) component).setHttpContext((org.apache.http.protocol.HttpContext) value); return true;
            case "maxTotalConnections": ((HttpComponent) component).setMaxTotalConnections((int) value); return true;
            case "redirectHandlingDisabled": ((HttpComponent) component).setRedirectHandlingDisabled((boolean) value); return true;
            case "headerFilterStrategy": ((HttpComponent) component).setHeaderFilterStrategy((org.apache.camel.spi.HeaderFilterStrategy) value); return true;
            case "proxyAuthDomain": ((HttpComponent) component).setProxyAuthDomain((java.lang.String) value); return true;
            case "proxyAuthHost": ((HttpComponent) component).setProxyAuthHost((java.lang.String) value); return true;
            case "proxyAuthMethod": ((HttpComponent) component).setProxyAuthMethod((java.lang.String) value); return true;
            case "proxyAuthNtHost": ((HttpComponent) component).setProxyAuthNtHost((java.lang.String) value); return true;
            case "proxyAuthPassword": ((HttpComponent) component).setProxyAuthPassword((java.lang.String) value); return true;
            case "proxyAuthPort": ((HttpComponent) component).setProxyAuthPort((java.lang.Integer) value); return true;
            case "proxyAuthUsername": ((HttpComponent) component).setProxyAuthUsername((java.lang.String) value); return true;
            case "sslContextParameters": ((HttpComponent) component).setSslContextParameters((org.apache.camel.support.jsse.SSLContextParameters) value); return true;
            case "useGlobalSslContextParameters": ((HttpComponent) component).setUseGlobalSslContextParameters((boolean) value); return true;
            case "x509HostnameVerifier": ((HttpComponent) component).setX509HostnameVerifier((javax.net.ssl.HostnameVerifier) value); return true;
            case "connectionRequestTimeout": ((HttpComponent) component).setConnectionRequestTimeout((int) value); return true;
            case "connectTimeout": ((HttpComponent) component).setConnectTimeout((int) value); return true;
            case "socketTimeout": ((HttpComponent) component).setSocketTimeout((int) value); return true;
            default: return false;
            }
        }
    }
}


text:
/**
 * @overview Simulated client node.
 */
'use strict';

var _ = require('../lodash');
var i18n = require('./locale');
var NodeType = require('./NetSimConstants').NodeType;
var NetSimEntity = require('./NetSimEntity');
var NetSimNode = require('./NetSimNode');
var NetSimWire = require('./NetSimWire');
require('../utils'); // Provides Function.prototype.inherits

/**
 * Client model of simulated node
 *
 * Represents the client's view of a node that is controlled by a user client,
 * either by our own client or somebody else's.  Is a NetSimEntity, meaning
 * it wraps a row in the node table and provides functionality around it.
 *
 * You may be looking for NetSimLocalClientNode if you're trying to manipulate
 * your local client node.
 *
 * @param {!NetSimShard} shard
 * @param {Object} [clientRow] - Lobby row for this router.
 * @constructor
 * @augments NetSimNode
 */
var NetSimClientNode = module.exports = function (shard, clientRow) {
  NetSimNode.call(this, shard, clientRow);
};
NetSimClientNode.inherits(NetSimNode);

/** @inheritdoc */
NetSimClientNode.prototype.getNodeType = function () {
  return NodeType.CLIENT;
};

/** @inheritdoc */
NetSimClientNode.prototype.getStatus = function () {
  var outgoingWire = this.getOutgoingWire();
  if (!outgoingWire) {
    return i18n.notConnected();
  }

  // Get remote node for display name / hostname
  var cachedNodeRows = this.shard_.nodeTable.readAll();
  var remoteNodeRow = _.find(cachedNodeRows, function (nodeRow) {
    return nodeRow.id === outgoingWire.remoteNodeID;
  });

  var remoteNodeName = i18n.unknownNode();
  if (remoteNodeRow) {
    remoteNodeName = remoteNodeRow.name;
  }

  // Check for connection state
  var mutualConnection;
  if (remoteNodeRow && remoteNodeRow.type === NodeType.ROUTER) {
    mutualConnection = true;
  } else {
    var cachedWireRows = this.shard_.wireTable.readAll();
    mutualConnection = cachedWireRows.some(function (wireRow) {
      return wireRow.localNodeID === outgoingWire.remoteNodeID &&
          wireRow.remoteNodeID === outgoingWire.localNodeID;
    });
  }

  if (mutualConnection) {
    return i18n.connectedToNodeName({nodeName:remoteNodeName});
  }
  return i18n.connectingToNodeName({nodeName:remoteNodeName});
};

/** @inheritdoc */
NetSimClientNode.prototype.isFull = function () {
  var outgoingWire = this.getOutgoingWire();
  if (!outgoingWire) {
    return false;
  }
  var cachedWireRows = this.shard_.wireTable.readAll();
  return cachedWireRows.some(function (wireRow) {
    return wireRow.localNodeID === outgoingWire.remoteNodeID &&
        wireRow.remoteNodeID === outgoingWire.localNodeID;
  });
};

/**
 * Determine what address has been assigned to this client on its outgoing
 * wire.
 * @returns {string|undefined}
 */
NetSimClientNode.prototype.getAddress = function () {
  var wire = this.getOutgoingWire();
  if (!wire) {
    return undefined;
  }
  return wire.localAddress;
};

/**
 * Based on cached wire data, retrieve this node's outgoing wire.
 * @returns {NetSimWire|null} null if wire does not exist.
 */
NetSimClientNode.prototype.getOutgoingWire = function () {
  var cachedWireRows = this.shard_.wireTable.readAll();
  var outgoingWireRow = _.find(cachedWireRows, function (wireRow) {
    return wireRow.localNodeID === this.entityID;
  }, this);
  if (outgoingWireRow) {
    return new NetSimWire(this.shard_, outgoingWireRow);
  }
  return null;
};

/**
 * Static async retrieval method.  See NetSimEntity.get().
 * @param {!number} nodeID - The row ID for the entity you'd like to find.
 * @param {!NetSimShard} shard
 * @param {!NodeStyleCallback} onComplete - Method that will be given the
 *        found entity, or null if entity search failed.
 */
NetSimClientNode.get = function (nodeID, shard, onComplete) {
  NetSimEntity.get(NetSimClientNode, nodeID, shard, onComplete);
};


text:
class ConfluentOss < Formula
  desc "Developer-optimized distribution of Apache Kafka"
  homepage "https://www.confluent.io/product/confluent-open-source/"
  url "https://packages.confluent.io/archive/5.1/confluent-5.1.2-2.11.tar.gz"
  version "5.1.2"
  sha256 "dceea4333367b4513f971a78064bec9a12b977bb309957e1d4e863f9aae3dac0"

  bottle :unneeded

  depends_on :java => "1.8"

  conflicts_with "kafka", :because => "kafka also ships with identically named Kafka related executables"

  def install
    prefix.install "bin"
    rm_rf "#{bin}/windows"
    prefix.install "etc"
    prefix.install "share"
  end

  test do
    system "#{bin}/confluent", "current"
    assert_match "schema-registry", shell_output("#{bin}/confluent list")
  end
end


text:
Pronounced "hiker" (/ˈhaɪkə(r)/), hikr is a basic hike-tracking app.

![Screen cap](https://github.com/fusetools/hikr/blob/master/hikr.gif)

## basic info
hikr is an example app case to accompany Fuse's [end-to-end Fuse app tutorial](https://www.fusetools.com/docs/tutorial/tutorial).

_Note: there have been some force-pushes on this repo, so if you've cloned it before the series went live, it's probably a good idea to delete it and clone again._

## license
This code is licensed under the MIT license (see LICENSE).

The provided video file (`Assets/nature.mp4`) is a modified version of [Graham Uhelski](https://vimeo.com/mankindfilms)'s ["The Valley"](http://mazwai.com/#/videos/220). It is licensed under [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/).


text:
package org.wildfly.swarm.msc;

import org.junit.Test;
import org.wildfly.swarm.container.Container;

/**
 * @author Bob McWhirter
 */
public class MSCInVmTest {

    @Test
    public void testSimple() throws Exception {
        Container container = new Container();
        container.fraction( new MSCFraction() );
        container.start().stop();
    }
}


text:
package com.intellij.xml.breadcrumbs;

import com.intellij.codeInsight.breadcrumbs.FileBreadcrumbsCollector;
import com.intellij.ide.ui.UISettingsListener;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.ex.EditorSettingsExternalizable;
import com.intellij.openapi.fileEditor.FileEditor;
import com.intellij.openapi.fileEditor.FileEditorManager;
import com.intellij.openapi.fileEditor.FileEditorManagerListener;
import com.intellij.openapi.fileEditor.TextEditor;
import com.intellij.openapi.fileTypes.FileTypeEvent;
import com.intellij.openapi.fileTypes.FileTypeListener;
import com.intellij.openapi.fileTypes.FileTypeManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.startup.StartupActivity;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.VirtualFileListener;
import com.intellij.openapi.vfs.VirtualFileManager;
import com.intellij.openapi.vfs.VirtualFilePropertyEvent;
import com.intellij.openapi.vfs.impl.http.HttpVirtualFile;
import com.intellij.util.messages.MessageBusConnection;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;

final class BreadcrumbsInitializingActivity implements StartupActivity.DumbAware {
  @Override
  public void runActivity(@NotNull Project project) {
    if (project.isDefault() || ApplicationManager.getApplication().isUnitTestMode() || project.isDisposed()) {
      return;
    }

    MessageBusConnection connection = project.getMessageBus().connect();
    connection.subscribe(FileEditorManagerListener.FILE_EDITOR_MANAGER, new MyFileEditorManagerListener());
    connection.subscribe(FileTypeManager.TOPIC, new FileTypeListener() {
      @Override
      public void fileTypesChanged(@NotNull FileTypeEvent event) {
        reinitBreadcrumbsInAllEditors(project);
      }
    });

    VirtualFileManager.getInstance().addVirtualFileListener(new MyVirtualFileListener(project), project);
    connection.subscribe(UISettingsListener.TOPIC, uiSettings -> reinitBreadcrumbsInAllEditors(project));

    UIUtil.invokeLaterIfNeeded(() -> reinitBreadcrumbsInAllEditors(project));
  }

  private static final class MyFileEditorManagerListener implements FileEditorManagerListener {
    @Override
    public void fileOpened(@NotNull final FileEditorManager source, @NotNull final VirtualFile file) {
      reinitBreadcrumbsComponent(source, file);
    }
  }

  private static class MyVirtualFileListener implements VirtualFileListener {
    private final Project myProject;

    MyVirtualFileListener(@NotNull Project project) {
      myProject = project;
    }

    @Override
    public void propertyChanged(@NotNull VirtualFilePropertyEvent event) {
      if (VirtualFile.PROP_NAME.equals(event.getPropertyName()) && !myProject.isDisposed()) {
        FileEditorManager fileEditorManager = FileEditorManager.getInstance(myProject);
        VirtualFile file = event.getFile();
        if (fileEditorManager.isFileOpen(file)) {
          reinitBreadcrumbsComponent(fileEditorManager, file);
        }
      }
    }
  }

  private static void reinitBreadcrumbsInAllEditors(@NotNull Project project) {
    if (project.isDisposed()) return;
    FileEditorManager fileEditorManager = FileEditorManager.getInstance(project);
    for (VirtualFile virtualFile : fileEditorManager.getOpenFiles()) {
      reinitBreadcrumbsComponent(fileEditorManager, virtualFile);
    }
  }

  private static void reinitBreadcrumbsComponent(@NotNull final FileEditorManager fileEditorManager, @NotNull VirtualFile file) {
    boolean above = EditorSettingsExternalizable.getInstance().isBreadcrumbsAbove();
    for (FileEditor fileEditor : fileEditorManager.getAllEditors(file)) {
      if (fileEditor instanceof TextEditor) {
        TextEditor textEditor = (TextEditor)fileEditor;
        Editor editor = textEditor.getEditor();
        BreadcrumbsXmlWrapper wrapper = BreadcrumbsXmlWrapper.getBreadcrumbsWrapper(editor);
        if (isSuitable(textEditor, file)) {
          if (wrapper != null) {
            if (wrapper.breadcrumbs.above != above) {
              remove(fileEditorManager, fileEditor, wrapper);
              wrapper.breadcrumbs.above = above;
              add(fileEditorManager, fileEditor, wrapper);
            }
            wrapper.queueUpdate();
          }
          else {
            registerWrapper(fileEditorManager, fileEditor, new BreadcrumbsXmlWrapper(editor));
          }
        }
        else if (wrapper != null) {
          disposeWrapper(fileEditorManager, fileEditor, wrapper);
        }
      }
    }
  }

  private static boolean isSuitable(@NotNull TextEditor editor, @NotNull VirtualFile file) {
    if (file instanceof HttpVirtualFile || !editor.isValid()) {
      return false;
    }

    for (FileBreadcrumbsCollector collector : FileBreadcrumbsCollector.EP_NAME.getExtensions(editor.getEditor().getProject())) {
      if (collector.handlesFile(file) && collector.isShownForFile(editor.getEditor(), file)) {
        return true;
      }
    }
    return false;
  }

  private static void add(@NotNull FileEditorManager manager, @NotNull FileEditor editor, @NotNull BreadcrumbsXmlWrapper wrapper) {
    if (wrapper.breadcrumbs.above) {
      manager.addTopComponent(editor, wrapper);
    }
    else {
      manager.addBottomComponent(editor, wrapper);
    }
  }

  private static void remove(@NotNull FileEditorManager manager, @NotNull FileEditor editor, @NotNull BreadcrumbsXmlWrapper wrapper) {
    if (wrapper.breadcrumbs.above) {
      manager.removeTopComponent(editor, wrapper);
    }
    else {
      manager.removeBottomComponent(editor, wrapper);
    }
  }

  private static void registerWrapper(@NotNull FileEditorManager fileEditorManager,
                                      @NotNull FileEditor fileEditor,
                                      @NotNull BreadcrumbsXmlWrapper wrapper) {
    add(fileEditorManager, fileEditor, wrapper);
    Disposer.register(fileEditor, () -> disposeWrapper(fileEditorManager, fileEditor, wrapper));
  }

  private static void disposeWrapper(@NotNull FileEditorManager fileEditorManager,
                                     @NotNull FileEditor fileEditor,
                                     @NotNull BreadcrumbsXmlWrapper wrapper) {
    remove(fileEditorManager, fileEditor, wrapper);
    Disposer.dispose(wrapper);
  }
}