text:
function define(name, value) {
    Object.defineProperty(exports, name, {
        value:      value,
        enumerable: true
    });
}

var ns = 'http://www.w3.org/ns/ldp#';
define('ns', ns);
define('prefix', 'ldp');

// Resources
define('Resource', ns + 'Resource');
define('RDFSource', ns + 'RDFSource');
define('Container', ns + 'Container');
define('BasicContainer', ns + 'BasicContainer');
define('DirectContainer', ns + 'DirectContainer');

// Properties
define('contains', ns + 'contains');
define('membershipResource', ns + 'membershipResource');
define('hasMemberRelation', ns + 'hasMemberRelation');
define('isMemberOfRelation', ns + 'isMemberOfRelation');

// Link relations
define('constrainedBy', ns + 'constrainedBy');

// Preferences
define('PreferContainment', ns + 'PreferContainment');
define('PreferMembership', ns + 'PreferMembership');
define('PreferMinimalContainer', ns + 'PreferMinimalContainer');
define('PreferEmptyContainer', ns + 'PreferEmptyContainer');


text:
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';

import {NgbAccordion, NgbPanel, NgbPanelTitle, NgbPanelContent, NgbPanelHeader, NgbPanelToggle} from './accordion';

export {
  NgbAccordion,
  NgbPanel,
  NgbPanelTitle,
  NgbPanelContent,
  NgbPanelChangeEvent,
  NgbPanelHeader,
  NgbPanelHeaderContext,
  NgbPanelToggle
} from './accordion';
export {NgbAccordionConfig} from './accordion-config';

const NGB_ACCORDION_DIRECTIVES =
    [NgbAccordion, NgbPanel, NgbPanelTitle, NgbPanelContent, NgbPanelHeader, NgbPanelToggle];

@NgModule({declarations: NGB_ACCORDION_DIRECTIVES, exports: NGB_ACCORDION_DIRECTIVES, imports: [CommonModule]})
export class NgbAccordionModule {
}

redpajama_set_name: RedPajamaGithub


text:
.class Landroid/widget/RemoteViews$SetOnClickFillInIntent;
.super Landroid/widget/RemoteViews$Action;
.source "RemoteViews.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/widget/RemoteViews;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "SetOnClickFillInIntent"
.end annotation

# static fields
.field public static final TAG:I = 0x9

# instance fields
.field fillInIntent:Landroid/content/Intent;

.field final synthetic this$0:Landroid/widget/RemoteViews;

# direct methods
.method public constructor <init>(Landroid/widget/RemoteViews;ILandroid/content/Intent;)V
    .locals 1
    .parameter
    .parameter "id"
    .parameter "fillInIntent"

    .prologue
    .line 321
    iput-object p1, p0, Landroid/widget/RemoteViews$SetOnClickFillInIntent;->this$0:Landroid/widget/RemoteViews;

    const/4 v0, 0x0

    invoke-direct {p0, v0}, Landroid/widget/RemoteViews$Action;-><init>(Landroid/widget/RemoteViews$1;)V

    .line 322
    iput p2, p0, Landroid/widget/RemoteViews$SetOnClickFillInIntent;->viewId:I

    .line 323
    iput-object p3, p0, Landroid/widget/RemoteViews$SetOnClickFillInIntent;->fillInIntent:Landroid/content/Intent;

    .line 324
    return-void
.end method

.method public constructor <init>(Landroid/widget/RemoteViews;Landroid/os/Parcel;)V
    .locals 1
    .parameter
    .parameter "parcel"

    .prologue
    .line 326
    iput-object p1, p0, Landroid/widget/RemoteViews$SetOnClickFillInIntent;->this$0:Landroid/widget/RemoteViews;

    const/4 v0, 0x0

    invoke-direct {p0, v0}, Landroid/widget/RemoteViews$Action;-><init>(Landroid/widget/RemoteViews$1;)V

    .line 327
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v0

    iput v0, p0, Landroid/widget/RemoteViews$SetOnClickFillInIntent;->viewId:I

    .line 328
    sget-object v0, Landroid/content/Intent;->CREATOR:Landroid/os/Parcelable$Creator;

    invoke-interface {v0, p2}, Landroid/os/Parcelable$Creator;->createFromParcel(Landroid/os/Parcel;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/content/Intent;

    iput-object v0, p0, Landroid/widget/RemoteViews$SetOnClickFillInIntent;->fillInIntent:Landroid/content/Intent;

    .line 329
    return-void
.end method

# virtual methods
.method public apply(Landroid/view/View;Landroid/view/ViewGroup;Landroid/widget/RemoteViews$OnClickHandler;)V
    .locals 4
    .parameter "root"
    .parameter "rootParent"
    .parameter "handler"

    .prologue
    .line 339
    iget v2, p0, Landroid/widget/RemoteViews$SetOnClickFillInIntent;->viewId:I

    invoke-virtual {p1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    .line 340
    .local v1, target:Landroid/view/View;
    if-nez v1, :cond_1

    .line 393
    :cond_0
    :goto_0
    return-void

    .line 342
    :cond_1
    iget-object v2, p0, Landroid/widget/RemoteViews$SetOnClickFillInIntent;->this$0:Landroid/widget/RemoteViews;

    #getter for: Landroid/widget/RemoteViews;->mIsWidgetCollectionChild:Z
    invoke-static {v2}, Landroid/widget/RemoteViews;->access$100(Landroid/widget/RemoteViews;)Z

    move-result v2

    if-nez v2, :cond_2

    .line 343
    const-string v2, "RemoteViews"

    const-string v3, "The method setOnClickFillInIntent is available only from RemoteViewsFactory (ie. on collection items)."

    invoke-static {v2, v3}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0

    .line 347
    :cond_2
    if-ne v1, p1, :cond_3

    .line 348
    const v2, #id@fillInIntent#t

    iget-object v3, p0, Landroid/widget/RemoteViews$SetOnClickFillInIntent;->fillInIntent:Landroid/content/Intent;

    invoke-virtual {v1, v2, v3}, Landroid/view/View;->setTagInternal(ILjava/lang/Object;)V

    goto :goto_0

    .line 349
    :cond_3
    if-eqz v1, :cond_0

    iget-object v2, p0, Landroid/widget/RemoteViews$SetOnClickFillInIntent;->fillInIntent:Landroid/content/Intent;

    if-eqz v2, :cond_0

    .line 350
    new-instance v0, Landroid/widget/RemoteViews$SetOnClickFillInIntent$1;

    invoke-direct {v0, p0, p3}, Landroid/widget/RemoteViews$SetOnClickFillInIntent$1;-><init>(Landroid/widget/RemoteViews$SetOnClickFillInIntent;Landroid/widget/RemoteViews$OnClickHandler;)V

    .line 391
    .local v0, listener:Landroid/view/View$OnClickListener;
    invoke-virtual {v1, v0}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    goto :goto_0
.end method

.method public getActionName()Ljava/lang/String;
    .locals 1

    .prologue
    .line 396
    const-string v0, "SetOnClickFillInIntent"

    return-object v0
.end method

.method public writeToParcel(Landroid/os/Parcel;I)V
    .locals 2
    .parameter "dest"
    .parameter "flags"

    .prologue
    .line 332
    const/16 v0, 0x9

    invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeInt(I)V

    .line 333
    iget v0, p0, Landroid/widget/RemoteViews$SetOnClickFillInIntent;->viewId:I

    invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeInt(I)V

    .line 334
    iget-object v0, p0, Landroid/widget/RemoteViews$SetOnClickFillInIntent;->fillInIntent:Landroid/content/Intent;

    const/4 v1, 0x0

    invoke-virtual {v0, p1, v1}, Landroid/content/Intent;->writeToParcel(Landroid/os/Parcel;I)V

    .line 335
    return-void
.end method


text:
package com.github.rockjam.iqnotes.db

import com.typesafe.config.Config

import scala.util.Try

object MongoConfig {
  def load(config: Config): Try[MongoConfig] = Try {
    val c = config.getConfig("iqnotes.mongo")
    MongoConfig(c.getString("host"), c.getInt("port"), c.getString("db-name"))
  }
}

case class MongoConfig(host: String, port: Int, dbName: String) {
  val mongoUri = s"mongodb://${host}:${port}/${dbName}?authMode=scram-sha1"
}


text:
package main

import (
	"errors"
	"flag"
	"fmt"
	"net/http"
	"net/url"
	"strconv"
	"strings"
	"time"

	"github.com/WICG/webpackage/go/signedexchange/version"
	"github.com/google/webpackager"
	"github.com/google/webpackager/certchain/certchainutil"
	"github.com/google/webpackager/exchange"
	"github.com/google/webpackager/exchange/vprule"
	"github.com/google/webpackager/fetch"
	"github.com/google/webpackager/internal/customflag"
	"github.com/google/webpackager/processor"
	"github.com/google/webpackager/processor/complexproc"
	"github.com/google/webpackager/processor/htmlproc/htmltask"
	"github.com/google/webpackager/resource/cache"
	"github.com/google/webpackager/resource/cache/filewrite"
	"github.com/google/webpackager/urlrewrite"
	"github.com/google/webpackager/validity"
	multierror "github.com/hashicorp/go-multierror"
)

var (
	// RequestTweaker
	flagRequestHeader = customflag.MultiString("request_header", `Request headers, e.g. "Accept-Language: en-US, en;q=0.5". (repeatable)`)

	// ExchangeFactory
	flagVersion      = flag.String("version", "1b3", `Signed exchange version.`)
	flagMIRecordSize = flag.String("mi_record_size", "4096", `Merkle Integration content encoding record size.`)
	flagCertCBOR     = flag.String("cert_cbor", "", `Certificate chain CBOR file. Fetched from --cert_url when unspecified.`)
	flagCertURL      = flag.String("cert_url", "", `Certficiate chain URL. (required)`)
	flagPrivateKey   = flag.String("private_key", "", `Private key PEM file. (required)`)

	// Processor
	flagSizeLimit  = flag.String("size_limit", "4194304", `Maximum size of resources in bytes allowed for signed exchanges, or "none" to set no limit.`)
	flagPreloadCSS = flag.Bool("preload_css", true, `Get CSS preloaded.`)
	flagPreloadJS  = flag.Bool("preload_js", false, `Get JavaScript preloaded. USE WITH CAUTION: your scripts may remain cached and used until the expiry, even if you find security issues later.`)

	// ValidPeriodRule
	flagExpiry           = flag.String("expiry", "72h", `Lifetime of signed exchanges. This value is not applied to JavaScript (see: --js_expiry). Maximum is "168h".`)
	flagJSExpiry         = flag.String("js_expiry", "12h", `Lifetime of signed exchanges for JavaScript. Also applied to HTML with inline JavaScript. Maximum is "24h" by default, "168h" with --insecure_js_expiry.`)
	flagInsecureJSExpiry = flag.Bool("insecure_js_expiry", false, `Allow --js_expiry to be longer than "24h". USE WITH CAUTION: your scripts may remain cached and used until the expiry, even if you find security issues later.`)

	// PhysicalURLRule
	flagIndexFile = flag.String("index_file", "index.html", `Filename assumed for slash-ended URLs.`)

	// ResourceCache, ValidityURLRule
	flagSXGExt      = flag.String("sxg_ext", ".sxg", `File extension for signed exchange files.`)
	flagSXGDir      = flag.String("sxg_dir", "sxg/", `Directory to output signed exchange files.`)
	flagValidityExt = flag.String("validity_ext", ".validity", `File extension for validity files. Note it is followed by a UNIX timestamp.`)
	flagValidityDir = flag.String("validity_dir", "", `Directory to output validity files. (unimplemented)`)
)

const (
	noSizeLimitString = "none"

	maxExpiry       = 7 * (24 * time.Hour)
	maxGoodJSExpiry = 1 * (24 * time.Hour)
)

func getConfigFromFlags() (*webpackager.Config, error) {
	cfg := new(webpackager.Config)
	var err error
	errs := new(multierror.Error)

	cfg.RequestTweaker, err = getRequestTweakerFromFlags()
	errs = multierror.Append(errs, err)
	cfg.PhysicalURLRule, err = getPhysicalURLRuleFromFlags()
	errs = multierror.Append(errs, err)
	cfg.ValidityURLRule, err = getValidityURLRuleFromFlags()
	errs = multierror.Append(errs, err)
	cfg.Processor, err = getProcessorFromFlags()
	errs = multierror.Append(errs, err)
	cfg.ValidPeriodRule, err = getValidPeriodRuleFromFlags()
	errs = multierror.Append(errs, err)
	cfg.ExchangeFactory, err = getExchangeFactoryFromFlags()
	errs = multierror.Append(errs, err)
	cfg.ResourceCache, err = getResourceCacheFromFlags()
	errs = multierror.Append(errs, err)

	if err := errs.ErrorOrNil(); err != nil {
		return nil, err
	}
	return cfg, nil
}

func parseVersion(s string) (version.Version, error) {
	v, ok := version.Parse(s)
	if !ok {
		return "", errors.New("unknown version")
	}
	return v, nil
}

func parseByteSize(s string) (int, error) {
	// TODO(yuizumi): Maybe support binary suffixes (e.g. "4k" == 4096).
	v, err := strconv.Atoi(s)
	if err != nil {
		return v, err
	}
	if v <= 0 {
		return v, errors.New("value must be positive")
	}
	return v, nil
}

func parseDuration(s string, max time.Duration) (time.Duration, error) {
	v, err := time.ParseDuration(s)
	if err != nil {
		return 0, err
	}
	if v <= 0 {
		return 0, errors.New("duration must be positive")
	}
	if v > max {
		return 0, errors.New("duration too large")
	}
	return v, nil
}

func parseSizeLimit(s string) (int, error) {
	if s == noSizeLimitString {
		return -1, nil
	}
	return parseByteSize(s)
}

func parseCertURL(s string) (*url.URL, error) {
	u, err := url.Parse(s)
	if err != nil {
		return nil, err
	}
	// TODO(yuizumi): Support data: URIs and relative URLs.
	if u.Scheme != "https" {
		return nil, errors.New("must be an https:// url")
	}
	return u, nil
}

func getRequestTweakerFromFlags() (fetch.RequestTweaker, error) {
	header := make(http.Header)
	errs := new(multierror.Error)

	for _, s := range *flagRequestHeader {
		chunks := strings.SplitN(s, ":", 2)
		if len(chunks) == 2 {
			key := strings.TrimSpace(chunks[0])
			val := strings.TrimSpace(chunks[1])
			header.Add(key, val)
		} else {
			errs = multierror.Append(
				errs, fmt.Errorf("invalid --request_header %q", s))
		}
	}

	if err := errs.ErrorOrNil(); err != nil {
		return nil, err
	}

	t := fetch.DefaultRequestTweaker
	if len(header) != 0 {
		t = fetch.RequestTweakerSequence{t, fetch.SetCustomHeaders(header)}
	}
	return t, nil
}

func getPhysicalURLRuleFromFlags() (urlrewrite.Rule, error) {
	rule := urlrewrite.RuleSequence{
		urlrewrite.CleanPath(),
		urlrewrite.IndexRule(*flagIndexFile),
	}
	return rule, nil
}

func getValidityURLRuleFromFlags() (validity.URLRule, error) {
	return validity.AppendExtDotLastModified(*flagValidityExt), nil
}

func getProcessorFromFlags() (processor.Processor, error) {
	var cfg complexproc.Config
	var err error
	errs := new(multierror.Error)

	cfg.Preverify.MaxContentLength, err = parseSizeLimit(*flagSizeLimit)
	if err != nil {
		errs = multierror.Append(errs, fmt.Errorf("invalid --size_limit: %v", err))
	}

	cfg.HTML.TaskSet = getHTMLTaskSetFromFlags()

	if err := errs.ErrorOrNil(); err != nil {
		return nil, err
	}
	return complexproc.NewComprehensiveProcessor(cfg), nil
}

func getHTMLTaskSetFromFlags() []htmltask.HTMLTask {
	var tasks []htmltask.HTMLTask

	tasks = append(tasks, htmltask.ConservativeTaskSet...)

	if *flagPreloadCSS {
		tasks = append(tasks, htmltask.PreloadStylesheets())
	}
	if *flagPreloadJS {
		tasks = append(tasks, htmltask.InsecurePreloadScripts())
	}

	return tasks
}

func getValidPeriodRuleFromFlags() (vprule.Rule, error) {
	errs := new(multierror.Error)

	expiry, err := parseDuration(*flagExpiry, maxExpiry)
	if err != nil {
		errs = multierror.Append(errs, fmt.Errorf("invalid --expiry: %v", err))
	}

	maxJSExpiry := maxGoodJSExpiry
	if *flagInsecureJSExpiry {
		maxJSExpiry = maxExpiry
	}
	jsExpiry, err := parseDuration(*flagJSExpiry, maxJSExpiry)
	if err != nil {
		errs = multierror.Append(errs, fmt.Errorf("invalid --js_expiry: %v", err))
	}

	if err := errs.ErrorOrNil(); err != nil {
		return nil, err
	}

	rule := vprule.PerContentType(
		map[string]vprule.Rule{
			"application/javascript":   vprule.FixedLifetime(jsExpiry),
			"text/javascript":          vprule.FixedLifetime(jsExpiry),
			"application/x-javascript": vprule.FixedLifetime(jsExpiry),
		},
		vprule.FixedLifetime(expiry),
	)
	return rule, nil
}

func getExchangeFactoryFromFlags() (*exchange.Factory, error) {
	fty := new(exchange.Factory)
	var err error
	errs := new(multierror.Error)

	fty.Version, err = parseVersion(*flagVersion)
	if err != nil {
		errs = multierror.Append(errs, fmt.Errorf("invalid --version: %v", err))
	}

	fty.MIRecordSize, err = parseByteSize(*flagMIRecordSize)
	if err != nil {
		errs = multierror.Append(errs, fmt.Errorf("invalid --mi_record_size: %v", err))
	}

	if *flagCertURL == "" {
		errs = multierror.Append(errs, errors.New("missing --cert_url"))
	} else {
		fty.CertURL, err = parseCertURL(*flagCertURL)
		if err != nil {
			errs = multierror.Append(errs, fmt.Errorf("invalid --cert_url: %v", err))
		}
	}

	var certChainSource string
	if *flagCertCBOR != "" {
		fty.CertChain, err = certchainutil.ReadAugmentedChainFile(*flagCertCBOR)
		certChainSource = *flagCertCBOR
	} else if fty.CertURL != nil {
		fty.CertChain, err = certchainutil.FetchAugmentedChain(fty.CertURL)
		certChainSource = fty.CertURL.String()
	}
	if err != nil {
		errs = multierror.Append(errs, fmt.Errorf("failed to load cert chain from %q: %v", certChainSource, err))
	}

	if *flagPrivateKey == "" {
		errs = multierror.Append(errs, errors.New("missing --private_key"))
	} else {
		fty.PrivateKey, err = certchainutil.ReadPrivateKeyFile(*flagPrivateKey)
		if err != nil {
			errs = multierror.Append(errs, fmt.Errorf("failed to load private key from %q: %v", *flagPrivateKey, err))
		}
	}

	if err := errs.ErrorOrNil(); err != nil {
		return nil, err
	}
	return fty, err
}

func getResourceCacheFromFlags() (cache.ResourceCache, error) {
	config := filewrite.Config{BaseCache: cache.NewOnMemoryCache()}

	if *flagSXGDir != "" {
		config.ExchangeMapping = filewrite.AddBaseDir(
			filewrite.AppendExt(filewrite.UsePhysicalURLPath(), *flagSXGExt),
			*flagSXGDir,
		)
	}
	if *flagValidityDir != "" {
		return nil, errors.New("--validity_dir is not implemented yet")
	}

	return filewrite.NewFileWriteCache(config), nil
}


text:
This project is a proof of concept for a retro-styled shoot 'em up game, featuring modern per-pixel lighting and real-time color grading restricted to a 320x200 pixels resolution.

Each tile and sprite requires these maps:
- Diffuse color
- Specular
- Height
- Emission
- Normal (derived from the height map)

## Screenshots

[](https://raw.githubusercontent.com/ruben3d/shmup-prototype2/master/doc/ss01.png)
[](https://raw.githubusercontent.com/ruben3d/shmup-prototype2/master/doc/ss02.png)
[](https://raw.githubusercontent.com/ruben3d/shmup-prototype2/master/doc/ss03.png)
[](https://raw.githubusercontent.com/ruben3d/shmup-prototype2/master/doc/ss04.png)
[](https://raw.githubusercontent.com/ruben3d/shmup-prototype2/master/doc/ss05.png)

## Build & Execute

The project requires SFML.

```
$ git clone https://github.com/ruben3d/shmup-prototype2.git
$ cd shmup-prototype2
$ mkdir build
$ cd build
$ cmake ../
$ make
$ cd bin && ./shmup && cd ..
```

## License

MIT License (see LICENSE in the repository).


text:
package gnu.java.beans.encoder;

/** A special {@link ScannerState} implementation that ignores all child
 * elements.
 *
 *
Consider the call hierarchy:
 *
 * methodInvocation
 *   objectInstantiation
 *     classResolution*
 *       objectInstantiation
 *         classResolution
 *
 *

 *
 *
When the ignoring state is active one can filter the elements of
 * one level. One has to set up the state machine that a transition
 * via "class resolution" from a state that was reached via "object
 * instantation" reaches an IgnoringScannerState.

 *
 *
Setting the default successor of a IgnoringScannerState
 * to itself causes all elements of the call hierarchy to be skipped
 * until another state is reached by going back.

 *
 * @author Robert Schuster (robertschuster@fsfe.org)
 *
 */
class IgnoringScannerState extends ScannerState
{

  void methodInvocation(String methodName)
  {
  }

  void staticMethodInvocation(String className, String methodName)
  {
  }

  void staticFieldAccess(String className, String fieldName)
  {
  }

  void classResolution(String className)
  {
  }

  void objectInstantiation(String className, ObjectId objectId)
  {
  }

  void primitiveInstantiation(String primitiveName, String valueAsString)
  {
  }

  void objectArrayInstantiation(String arrayClassName, String lengthAsString, ObjectId objectId)
  {
  }

  void primitiveArrayInstantiation(String arrayClassName, String lengthAsString, ObjectId objectId)
  {
  }

  void arraySet(String indexAsString)
  {
  }

  void arrayGet(String indexAsString)
  {
  }

  void listGet()
  {
  }

  void listSet()
  {
  }

  void nullObject()
  {
  }

  void stringReference(String string)
  {
  }

  void objectReference(ObjectId id)
  {
  }

  void end()
  {
  }

}


text:
package org.broadinstitute.hellbender.tools.exome;

import htsjdk.samtools.util.Locatable;
import org.broadinstitute.hellbender.utils.IndexRange;
import org.broadinstitute.hellbender.utils.SimpleInterval;
import org.broadinstitute.hellbender.utils.Utils;
import org.broadinstitute.hellbender.utils.test.BaseTest;
import org.broadinstitute.hellbender.utils.test.ExomeToolsTestUtils;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import java.lang.reflect.Method;
import java.util.*;

/**
 * Unit tests for {@link TargetCollection}'s default method implementations.
 *
 * @author Valentin Ruano-Rubio <valentin@broadinstitute.org>
 */
public final class TargetCollectionUnitTest extends BaseTest {

    /**
     * General exon_db_test_data, will contain ExonDB instances as a single arguments.
     *
     *

     *  Initialized by {@link #setUp} before any tests.
     *

     */
    private static Object[][] EXON_DB_TEST_DATA;

    @BeforeClass
    public void setUp() {
        final Random rdn = new Random(11131719);
        final List<Object[]> exonDBTestData = new ArrayList<>(30);
        exonDBTestData.add(new Object[] { new TargetCollectionStub(0,rdn) });
        exonDBTestData.add(new Object[] { new TargetCollectionStub(1,rdn) });
        exonDBTestData.add(new Object[] { new TargetCollectionStub(33,rdn) });
        final int maxExonCount = ExomeToolsTestUtils.REFERENCE_DICTIONARY.getSequence(0).getSequenceLength() / 50;
        final int minExonCount = 2;
        while (exonDBTestData.size() < 30) {
            final int exonCount = rdn.nextInt(maxExonCount - minExonCount + 1) + minExonCount;
            exonDBTestData.add(new Object[] { new TargetCollectionStub(exonCount,rdn)});
        }
        EXON_DB_TEST_DATA = exonDBTestData.toArray(new Object[exonDBTestData.size()][]);
    }

    @Test(dataProvider = "exonDBData")
    public void testExonByName(final TargetCollection<SimpleInterval> targetCollection) {
        Assert.assertNull(targetCollection.target("silly-name"));
        for (int i = 0; i < targetCollection.targetCount(); i++) {
            Assert.assertEquals(targetCollection.target("" + i), targetCollection.target(i));
        }
    }

    @Test(dataProvider = "exonDBData")
    public void testExonByLocationExactMatch(final TargetCollection<SimpleInterval> targetCollection) {
        for (int i = 0; i < targetCollection.targetCount(); i++) {
            final SimpleInterval si = targetCollection.target(i);
            Assert.assertEquals(targetCollection.target(si), si);
        }
    }

    @Test(dataProvider = "exonDBData")
    public void testExonByLocationNonOverlapping(final TargetCollection<SimpleInterval> targetCollection) {
        final SimpleInterval otherChromosome =  ExomeToolsTestUtils.createOverEntireContig(2);
        Assert.assertNull(targetCollection.target(otherChromosome));
        for (int i = 0; i < targetCollection.targetCount() - 1; i++) {
            final int start = targetCollection.target(i).getEnd() + 1;
            final int end = targetCollection.target(i + 1).getStart() - 1;
            if (end < start) {   // avoid zero-length intra-target intervals (due to artificial data construction).
                continue;
            }
            final SimpleInterval loc = ExomeToolsTestUtils.createInterval(targetCollection.target(i).getContig(), start, end);
            Assert.assertNull(targetCollection.target(loc),"query = " + targetCollection.target(i).getContig() + ":" + start + "-" + end);
        }
    }

    @Test(dataProvider = "twoOrMoreExonDBData")
    public void testExonByLocationAmbiguousOverlapping(final TargetCollection<SimpleInterval> targetCollection) {
        for (int i = 0; i < targetCollection.targetCount() - 1; i++) {
            final int start = targetCollection.target(i).getEnd() - 1;
            final int end = targetCollection.target(i + 1).getStart() + 1;
            final SimpleInterval loc = ExomeToolsTestUtils.createInterval(targetCollection.target(i).getContig(), start, end);
            try {
                targetCollection.target(loc);
                Assert.fail("expected exception. Index == " + i);
            } catch (final TargetCollection.AmbiguousTargetException ex) {
                // ok.
            } catch (final Throwable t) {
                Assert.fail("wrong exception: ",t);
            }
        }
    }

    @Test(expectedExceptions = IllegalArgumentException.class)
    public void testForEachNullTask() {
        final TargetCollection<SimpleInterval> targetCollection = new TargetCollectionStub(0,new Random(13));
        targetCollection.forEachTarget(ExomeToolsTestUtils.createOverEntireContig(0), null);
    }

    @Test(dataProvider = "exonDBData")
    public void testForEachSingleCallExactMatch(final TargetCollection<SimpleInterval> targetCollection) {
        for (int i = 0; i < targetCollection.targetCount(); i++) {
            final SimpleInterval simpleInterval = targetCollection.target(i);
            final SimpleInterval loc = ExomeToolsTestUtils.createInterval(simpleInterval.getContig(), simpleInterval.getStart(), simpleInterval.getEnd());
            final int expectedIdx = i;
            final int[] totalCalls = new int[] { 0 };
            targetCollection.forEachTarget(loc, (idx, exon) -> {
                Assert.assertEquals(exon, simpleInterval);
                Assert.assertEquals(idx, expectedIdx);
                totalCalls[0]++;
            });
            Assert.assertEquals(totalCalls[0],1);
        }
    }

    @Test(dataProvider = "exonDBData")
    public void testForEachExhaustiveRanges(final TargetCollection<SimpleInterval> targetCollection) {
        final int min = 0;
        final int max = targetCollection.targetCount();
        for (int i = min; i < max; i++) {

            final SimpleInterval iInterval = targetCollection.target(i);
            final String contig = iInterval.getContig();
            final int start = (iInterval.getStart() + iInterval.getEnd()) >> 1;
            for (int j = i; j < max; j++) {
                final SimpleInterval jInterval = targetCollection.target(j);
                if (!jInterval.getContig().equals(contig)) {
                    break;
                }
                final int end = (jInterval.getStart() + jInterval.getEnd() + 1) >> 1;
                if (start > end) {
                    continue;
                }
                final SimpleInterval loc = ExomeToolsTestUtils.createInterval(contig, start, end);
                final List<SimpleInterval> visited = new ArrayList<>(j - i + 1);
                final int iFinal = i;
                targetCollection.forEachTarget(loc, (idx, e) -> {
                    Assert.assertEquals(idx, iFinal + visited.size());
                    Assert.assertEquals(e, targetCollection.target(idx));
                    visited.add(e);
                });
                Assert.assertEquals(visited.size(),j - i + 1);
            }
        }
    }

    @Test(dataProvider = "exonDBData", expectedExceptions = IllegalArgumentException.class)
    public void testExonsByBadIndexRange(final TargetCollection<SimpleInterval> targetCollection) {
        targetCollection.targets(new IndexRange(targetCollection.targetCount(), targetCollection.targetCount() + 1));
    }

    @Test(dataProvider = "exonDBData", expectedExceptions = IllegalArgumentException.class)
    public void testExonsByNullIndexRange(final TargetCollection<SimpleInterval> targetCollection) {
        targetCollection.targets((IndexRange) null);
    }

    @Test(dataProvider = "exonDBData")
    public void testForEachExhaustiveZeroRanges(final TargetCollection<SimpleInterval> targetCollection) {
        final int min = 0;
        final int max = targetCollection.targetCount();
        for (int i = min; i < max - 1; i++) {
            final SimpleInterval iInterval = targetCollection.target(i);
            final SimpleInterval jInterval = targetCollection.target(i + 1);
            if (!jInterval.getContig().equals(iInterval.getContig()))
                continue;
            final int start = iInterval.getEnd() + 1;
            final int end = jInterval.getStart() - 1;
            if (start < end)
                continue;
            targetCollection.forEachTarget(
                    ExomeToolsTestUtils.createInterval(iInterval.getContig(), start, end),
                    (idx, e) -> Assert.fail("no target should be call"));
        }
    }

    @Test(dataProvider = "exonDBData")
    public void testExonsByLocationExhaustiveZeroRanges(final TargetCollection<SimpleInterval> targetCollection) {
        final int min = 0;
        final int max = targetCollection.targetCount();
        for (int i = min; i < max - 1; i++) {
            final SimpleInterval iInterval = targetCollection.target(i);
            final SimpleInterval jInterval = targetCollection.target(i + 1);
            if (!jInterval.getContig().equals(iInterval.getContig()))
                continue;
            final int start = iInterval.getEnd() + 1;
            final int end = jInterval.getStart() - 1;
            if (start < end)
                continue;
            final List<SimpleInterval> observed = targetCollection.targets(ExomeToolsTestUtils.createInterval(iInterval.getContig(), start, end));
            Assert.assertEquals(observed.size(), 0);
        }
    }

    @Test(dataProvider = "exonDBData")
    public void testExonSize(final TargetCollection<SimpleInterval> targetCollection) {
        long totalSize = 0;
        for (int i = 0; i < targetCollection.targetCount(); i++) {
            totalSize += targetCollection.target(i).size();
        }
        Assert.assertEquals(targetCollection.exomeSize(), totalSize);
    }

    @Test
    public void testIndexRangeCreation() {
       for (int i = 0; i < 10; i++)
           for (int j = i; j < 10; j++) {
               final IndexRange range = new IndexRange(i, j);
               Assert.assertEquals(range.from, i);
               Assert.assertEquals(range.to, j);
           }
    }

    @Test
    public void testIndexRangeSize() {
        for (int i = 0; i < 10; i++)
            for (int j = i; j < 10; j++) {
                final IndexRange range = new IndexRange(i, j);
                Assert.assertEquals(range.size(),j - i);
            }
    }

    @Test
    public void testIndexRangeEqual() {
        final IndexRange r1 = new IndexRange(1,2);
        final IndexRange r1_bis = new IndexRange(1,2);
        final IndexRange r2 = new IndexRange(2,2);
        final IndexRange r3 = new IndexRange(1,10);
        Assert.assertEquals(r1,r1_bis);
        Assert.assertEquals(r1,r1);
        Assert.assertNotEquals(r1,r2);
        Assert.assertNotEquals(r1,null);
        Assert.assertNotEquals(r1, new Object());
        Assert.assertNotEquals(r1, r3);
    }

    @Test
    public void testIndexRangeHashCode() {
        final IndexRange r1 = new IndexRange(1,2);
        final IndexRange r1_bis = new IndexRange(1,2);
        Assert.assertEquals(r1.hashCode(),r1_bis.hashCode());
        Assert.assertEquals(r1.hashCode(),r1.hashCode());
    }

    /**
     * Stub class to test default implementations of {@link TargetCollection}.
     *
     *

     *     This class should not implement any method that has a default implementation in {@code ExonDB} as
     *     that would interfere with its testing.
     *

     */
    public static class TargetCollectionStub implements TargetCollection<SimpleInterval> {

        private final List<SimpleInterval> intervals;

        public TargetCollectionStub(final int numberOfExons, final Random rdn) {
            if (numberOfExons == 0) {
                this.intervals = Collections.emptyList();
                return;
            }
            List<SimpleInterval> intervals = new ArrayList<>(numberOfExons);
            final String contig = ExomeToolsTestUtils.REFERENCE_DICTIONARY.getSequence(0).getSequenceName();
            final int contigLength = ExomeToolsTestUtils.REFERENCE_DICTIONARY.getSequence(0).getSequenceLength();
            final float avgSlotSize = contigLength / numberOfExons;

            int nextBasePos = 0;
            for (int i = 0; i < numberOfExons; i++) {
                final int slotLength = (int) Math.max(1,Math.min(3 * avgSlotSize,(rdn.nextGaussian() * avgSlotSize * .5) + avgSlotSize));
                final int exonLength = (int) Math.max(1,slotLength * rdn.nextDouble());
                final int start = Math.max(nextBasePos,1 + nextBasePos + ((slotLength - exonLength) >> 1));
                final int stop = start + exonLength;
                intervals.add(new SimpleInterval(contig,start,stop));
                nextBasePos += slotLength;
                nextBasePos = Math.max(nextBasePos,stop + 1);
            }
            this.intervals = Collections.unmodifiableList(intervals);
        }

        @Override
        public int targetCount() {
            return intervals.size();
        }

        @Override
        public SimpleInterval target(final int index) {
            return intervals.get(index);
        }

        @Override
        public String name(final SimpleInterval exon) {
            if (exon == null) {
                throw new IllegalArgumentException("the input target cannot be null");
            }
            return exon.toString();
        }

        @Override
        public int index(final String name) {
            if (name.matches("^\\d+$")) {
                int index = Integer.valueOf(name);
                if (index >= intervals.size()) {
                    return -1;
                } else {
                    return index;
                }
            } else {
                return -1;
            }
        }

        @Override
        public List<SimpleInterval> targets() {
            return intervals;
        }

        @Override
        public SimpleInterval location(final int index) {
            if (index < 0) {
                throw new IndexOutOfBoundsException();
            } if (index >= targetCount()) {
                throw new IndexOutOfBoundsException();
            }
            return intervals.get(index);
        }

        @Override
        public SimpleInterval location(final SimpleInterval exon) {
            return Utils.nonNull(exon, "the input target cannot be null");
        }

        @Override
        public IndexRange indexRange(final Locatable location) {
            if (!location.getContig().equals(ExomeToolsTestUtils.REFERENCE_DICTIONARY.getSequence(0).getSequenceName()))
                return new IndexRange(targetCount(), targetCount());
            else {
                int from = 0;
                while (from < intervals.size()) {
                    final SimpleInterval nextInterval = intervals.get(from);
                    if (nextInterval.getEnd() >= location.getStart()) {
                        break;
                    }
                    from++;
                }
                int to = from;
                while (to < intervals.size()) {
                    final SimpleInterval nextInterval = intervals.get(to);
                    if (nextInterval.getStart() > location.getEnd()) {
                        break;
                    }
                    to++;
                }
                return new IndexRange(from,to);
            }
        }
    }

    @Test
    public void testExonDBSubOnlyImplementsNonDefaults() throws NoSuchMethodException {
        final List<Method> overriddenDefaults = new ArrayList<>(10);
        for (final Method method : TargetCollection.class.getMethods()) {
            if (!method.isDefault())
                continue;
            final Method implementationMethod = TargetCollectionStub.class.getMethod(method.getName(), method.getParameterTypes());
            if (!implementationMethod.getDeclaringClass().isAssignableFrom(TargetCollection.class))
                overriddenDefaults.add(method);
        }
        Assert.assertTrue(overriddenDefaults.isEmpty(), "Bug in testing code!!! " + TargetCollectionStub.class.getName() +
                " must not override any default method in " + TargetCollection.class + " as we present to test those. " +
                "Currently it overrides the following default methods: "
                + Utils.join(", ",Arrays.asList(overriddenDefaults.stream().map(Method::getName).toArray())));
    }

    @DataProvider(name="exonDBData")
    public Object[][] exonDBData() {
        return EXON_DB_TEST_DATA;
    }

    @DataProvider(name="twoOrMoreExonDBData")
    public Object[][] twoOrMoreExonDBData() {
        final List<Object[]> result = new ArrayList<>(EXON_DB_TEST_DATA.length);
        for (final Object[] params : EXON_DB_TEST_DATA) {
            @SuppressWarnings("unchecked")
            final TargetCollection<SimpleInterval> db = (TargetCollection<SimpleInterval>)params[0];
            if (db.targetCount() <= 1)
                continue;
            result.add(params);
        }
        return result.toArray(new Object[result.size()][]);
    }
}


text:
module Experian
  module BusinessIq
    class Request < Experian::Request

      def build_request
        super do |xml|
          xml.tag!('EAI', Experian.eai)
          xml.tag!('DBHost', BusinessIq.db_host)
          add_reference_id(xml)
          xml.tag!('Request', :xmlns => Experian::XML_REQUEST_NAMESPACE, :version => '1.0') do
            xml.tag!('Products') do
              add_request_content(xml)
            end
          end
        end
      end

      def add_reference_id(xml)
        xml.tag!('ReferenceId', @options[:reference_id]) if @options[:reference_id]
      end

      def add_subscriber(xml)
        xml.tag!('Subscriber') do
          # xml.tag!('Preamble', Experian.preamble)
          xml.tag!('OpInitials', Experian.op_initials)
          xml.tag!('SubCode', Experian.subcode)
        end
      end

      def add_output_type(xml)
        xml.tag!('OutputType') do
          xml.tag!('XML') do
            xml.tag!('Verbose', 'Y')
          end
        end
      end

      def add_vendor(xml)
        xml.tag!('Vendor') do
          xml.tag!('VendorNumber', Experian.vendor_number)
        end
      end

      def add_request_content(xml)
        raise "sub classes must override this method"
      end

    end
  end
end


text:
#include "SkFrontBufferedStream.h"
#include "SkStream.h"
#include "SkTemplates.h"

class FrontBufferedStream : public SkStreamRewindable {
public:
    // Called by Create.
    FrontBufferedStream(SkStream*, size_t bufferSize);

    virtual size_t read(void* buffer, size_t size) SK_OVERRIDE;

    virtual bool isAtEnd() const SK_OVERRIDE;

    virtual bool rewind() SK_OVERRIDE;

    virtual bool hasPosition() const SK_OVERRIDE { return true; }

    virtual size_t getPosition() const SK_OVERRIDE { return fOffset; }

    virtual bool hasLength() const SK_OVERRIDE { return fHasLength; }

    virtual size_t getLength() const SK_OVERRIDE { return fLength; }

    virtual SkStreamRewindable* duplicate() const SK_OVERRIDE { return NULL; }

private:
    SkAutoTUnref<SkStream>  fStream;
    const bool              fHasLength;
    const size_t            fLength;
    // Current offset into the stream. Always >= 0.
    size_t                  fOffset;
    // Amount that has been buffered by calls to read. Will always be less than
    // fBufferSize.
    size_t                  fBufferedSoFar;
    // Total size of the buffer.
    const size_t            fBufferSize;
    // FIXME: SkAutoTMalloc throws on failure. Instead, Create should return a
    // NULL stream.
    SkAutoTMalloc<char>     fBuffer;

    // Read up to size bytes from already buffered data, and copy to
    // dst, if non-NULL. Updates fOffset. Assumes that fOffset is less
    // than fBufferedSoFar.
    size_t readFromBuffer(char* dst, size_t size);

    // Buffer up to size bytes from the stream, and copy to dst if non-
    // NULL. Updates fOffset and fBufferedSoFar. Assumes that fOffset is
    // less than fBufferedSoFar, and size is greater than 0.
    size_t bufferAndWriteTo(char* dst, size_t size);

    // Read up to size bytes directly from the stream and into dst if non-
    // NULL. Updates fOffset. Assumes fOffset is at or beyond the buffered
    // data, and size is greater than 0.
    size_t readDirectlyFromStream(char* dst, size_t size);

    typedef SkStream INHERITED;
};

SkStreamRewindable* SkFrontBufferedStream::Create(SkStream* stream, size_t bufferSize) {
    if (NULL == stream) {
        return NULL;
    }
    return SkNEW_ARGS(FrontBufferedStream, (stream, bufferSize));
}

FrontBufferedStream::FrontBufferedStream(SkStream* stream, size_t bufferSize)
    : fStream(SkRef(stream))
    , fHasLength(stream->hasPosition() && stream->hasLength())
    , fLength(stream->getLength() - stream->getPosition())
    , fOffset(0)
    , fBufferedSoFar(0)
    , fBufferSize(bufferSize)
    , fBuffer(bufferSize) {}

bool FrontBufferedStream::isAtEnd() const {
    if (fOffset < fBufferedSoFar) {
        // Even if the underlying stream is at the end, this stream has been
        // rewound after buffering, so it is not at the end.
        return false;
    }

    return fStream->isAtEnd();
}

bool FrontBufferedStream::rewind() {
    // Only allow a rewind if we have not exceeded the buffer.
    if (fOffset <= fBufferSize) {
        fOffset = 0;
        return true;
    }
    return false;
}

size_t FrontBufferedStream::readFromBuffer(char* dst, size_t size) {
    SkASSERT(fOffset < fBufferedSoFar);
    // Some data has already been copied to fBuffer. Read up to the
    // lesser of the size requested and the remainder of the buffered
    // data.
    const size_t bytesToCopy = SkTMin(size, fBufferedSoFar - fOffset);
    if (dst != NULL) {
        memcpy(dst, fBuffer + fOffset, bytesToCopy);
    }

    // Update fOffset to the new position. It is guaranteed to be
    // within the buffered data.
    fOffset += bytesToCopy;
    SkASSERT(fOffset <= fBufferedSoFar);

    return bytesToCopy;
}

size_t FrontBufferedStream::bufferAndWriteTo(char* dst, size_t size) {
    SkASSERT(size > 0);
    SkASSERT(fOffset >= fBufferedSoFar);
    // Data needs to be buffered. Buffer up to the lesser of the size requested
    // and the remainder of the max buffer size.
    const size_t bytesToBuffer = SkTMin(size, fBufferSize - fBufferedSoFar);
    char* buffer = fBuffer + fOffset;
    const size_t buffered = fStream->read(buffer, bytesToBuffer);

    fBufferedSoFar += buffered;
    fOffset = fBufferedSoFar;
    SkASSERT(fBufferedSoFar <= fBufferSize);

    // Copy the buffer to the destination buffer and update the amount read.
    if (dst != NULL) {
        memcpy(dst, buffer, buffered);
    }

    return buffered;
}

size_t FrontBufferedStream::readDirectlyFromStream(char* dst, size_t size) {
    SkASSERT(size > 0);
    // If we get here, we have buffered all that can be buffered.
    SkASSERT(fBufferSize == fBufferedSoFar && fOffset >= fBufferSize);

    const size_t bytesReadDirectly = fStream->read(dst, size);
    fOffset += bytesReadDirectly;

    // If we have read past the end of the buffer, rewinding is no longer
    // supported, so we can go ahead and free the memory.
    if (bytesReadDirectly > 0) {
        fBuffer.reset(0);
    }

    return bytesReadDirectly;
}

size_t FrontBufferedStream::read(void* voidDst, size_t size) {
    // Cast voidDst to a char* for easy addition.
    char* dst = reinterpret_cast<char*>(voidDst);
    SkDEBUGCODE(const size_t totalSize = size;)
    const size_t start = fOffset;

    // First, read any data that was previously buffered.
    if (fOffset < fBufferedSoFar) {
        const size_t bytesCopied = this->readFromBuffer(dst, size);

        // Update the remaining number of bytes needed to read
        // and the destination buffer.
        size -= bytesCopied;
        SkASSERT(size + (fOffset - start) == totalSize);
        if (dst != NULL) {
            dst += bytesCopied;
        }
    }

    // Buffer any more data that should be buffered, and copy it to the
    // destination.
    if (size > 0 && fBufferedSoFar < fBufferSize) {
        const size_t buffered = this->bufferAndWriteTo(dst, size);

        // Update the remaining number of bytes needed to read
        // and the destination buffer.
        size -= buffered;
        SkASSERT(size + (fOffset - start) == totalSize);
        if (dst != NULL) {
            dst += buffered;
        }
    }

    if (size > 0 && !fStream->isAtEnd()) {
        SkDEBUGCODE(const size_t bytesReadDirectly =) this->readDirectlyFromStream(dst, size);
        SkDEBUGCODE(size -= bytesReadDirectly;)
        SkASSERT(size + (fOffset - start) == totalSize);
    }

    return fOffset - start;
}


text:
package retrofacebook;

import auto.json.AutoJson;
import android.support.annotation.Nullable;
import android.os.Bundle;

/**
 * @see https://developers.facebook.com/docs/graph-api/reference/v2.3/user/scores
 */
@AutoJson
public abstract class Score {
    @Nullable
    @AutoJson.Field
    public abstract User user();
    @Nullable
    @AutoJson.Field
    public abstract int score();
    @Nullable
    @AutoJson.Field
    public abstract App application();

    @AutoJson.Builder
    public abstract static class Builder {
        public abstract Builder user(User x);
        public abstract Builder score(int x);
        public abstract Builder application(App x);

        public abstract Score build();
    }

    public static Builder builder() {
        return new AutoJson_Score.Builder();
    }

    public abstract Bundle toBundle();
}


text:
package com.gdn.venice.validator.factory;

import com.gdn.venice.validator.OrderUpdateValidator;
import com.gdn.venice.validator.OrderValidator;

/**
 *
 * @author yauritux
 *
 */
public class OrderUpdateValidatorFactory implements OrderValidatorFactory {

	public OrderValidator getOrderValidator() {
		return new OrderUpdateValidator();
	}
}


text:
from django.db import IntegrityError

from migrate_dns.build_nics import *
from migrate_dns.utils import *
import ipaddr
from core.network.models import Network, NetworkKeyValue
from core.network.utils import calc_parent
from core.vlan.models import Vlan

import truth

from mozdns.domain.utils import *

import pprint
import re
import ipaddr
import pdb

DEBUG = 3
DO_DEBUG = False

pp = pprint.PrettyPrinter(indent=2)

def migrate_networks():
    all = truth.models.Truth.objects.all()
    print all
    scopes = []
    for thing in all:
        if thing.name.find("-vlan") != -1:
            scopes.append(thing)
    vlan_number_re = re.compile("(\d+)$")
    is_network_start = re.compile("dhcp.scope.start")
    is_network_end = re.compile("dhcp.scope.end")
    is_netmask = re.compile("dhcp.scope.netmask")
    is_pool_start = re.compile("dhcp.pool.start")
    is_pool_end = re.compile("dhcp.pool.end")
    is_ntp_server = re.compile("dhcp.option.ntp_server.\d")
    is_domain_name = re.compile("dhcp.option.domain_name.\d")
    is_dns_servers = re.compile("dhcp.option.dns_server.\d")
    is_pool_allow_booting = re.compile("dhcp.pool.allow_booting.\d")
    is_pool_allow_bootp = re.compile("dhcp.pool.allow_bootp.\d")
    for scope in scopes:
        if str(scope).endswith("fake"):
            print "Skipping "+str(scope)
            continue
        vlan_number = vlan_number_re.search(str(scope)).groups(1)[0]
        network_start = None
        network_end = None
        netmask = None
        pool_start = None
        pool_end = None
        ntp_servers = []
        domain_name = None
        dns_servers = []
        allow_booting = None
        allow_bootp = None
        for kv in scope.keyvalue_set.all():
            if is_network_start.match(kv.key):
                network_start = kv.value
            if is_network_end.match(kv.key):
                network_end = kv.value
            if is_netmask.match(kv.key):
                netmask = kv.value
            if is_pool_start.match(kv.key):
                pool_start = kv.value
            if is_pool_end.match(kv.key):
                pool_end = kv.value
            if is_ntp_server.match(kv.key):
                ntp_servers.append(kv.value)
            if is_domain_name.match(kv.key):
                domain_name = kv.value
            if is_dns_servers.match(kv.key):
                dns_servers.append(kv.value)
            if is_pool_allow_booting.match(kv.key):
                allow_booting = bool(kv.value)
            if is_pool_allow_bootp.match(kv.key):
                allow_bootp = bool(kv.value)

        vlan = Vlan.objects.filter(number=vlan_number)
        try:
            net = ipaddr.IPv4Network(network_start+'/'+netmask)
        except ipaddr.AddressValueError, e:
            if str(scope) == "phx1-vlan75":
                net = ipaddr.IPv4Network("10.8.75.0/24")
            else:
                pdb.set_trace()
                continue
        network = Network.objects.filter(ip_lower=int(net.network),
                ip_upper = 0, prefixlen = net.prefixlen)

        print "="*20 + " " +str(scope)
        print "Expected Vlan: "+str(vlan)
        print vlan_number
        if not network:
            print "Creating new Network: "+str(net)
            network, _ = Network.objects.get_or_create(network_str = str(net), ip_type='4')
            parent = calc_parent(network)
            if parent:
                network.site = parent.site
        else:
            network = network[0]
            print "Existing Network: "+str(network)

        if vlan:
            network.vlan = vlan[0]
        else:
            v, _ = Vlan.objects.get_or_create(name="I need a name.", number=vlan_number)
            network.vlan = v
        network.save()

        print network_start
        print network_end
        print netmask
        print pool_start
        print pool_end
        print ntp_servers
        print domain_name
        print dns_servers
        print allow_booting
        print allow_bootp
        if str(scope) == "phx1-vlan75":
            continue
        if ntp_servers:
            real_ntp_servers = []
            for server in ntp_servers:
                if server == '':
                    continue
                else:
                    real_ntp_servers.append(server)
            if real_ntp_servers:
                kv = NetworkKeyValue(key="ntp-servers", value=", ".join(real_ntp_servers),
                        network=network)
                try:
                    kv.clean()
                    kv.save()
                except IntegrityError, e:
                    # Duplicate error
                    pass
        if domain_name:
            pdb.set_trace()
            kv = NetworkKeyValue(key="domain-name", value=domain_name,
                    network=network)
            try:
                kv.clean()
                kv.save()
            except IntegrityError, e:
                # Duplicate error
                pass
        if dns_servers:
            kv = NetworkKeyValue(key="ntp-servers", value=", ".join(dns_servers),
                    network=network)
            try:
                kv.clean()
                kv.save()
            except IntegrityError, e:
                # Duplicate error
                pass
        if allow_booting and not allow_bootp:
            kv = NetworkKeyValue(key="allow", value="booting", network=network)
            try:
                kv.clean()
                kv.save()
            except IntegrityError, e:
                # Duplicate error
                pass
        elif not allow_booting and allow_bootp:
            kv = NetworkKeyValue(key="allow", value="bootp", network=network)
            try:
                kv.clean()
                kv.save()
            except IntegrityError, e:
                # Duplicate error
                pass
        elif allow_booting and allow_bootp:
            kv = NetworkKeyValue(key="allow", value="booting, bootp",
                    network=network)
            try:
                kv.clean()
                kv.save()
            except IntegrityError, e:
                # Duplicate error
                pass


text:
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <LinearLayout
        android:id="@+id/l_contact_phone"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/app_white"
        android:orientation="vertical"
        android:padding="15dp">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingBottom="10dp"
            android:text="@string/field_phone"
            android:textColor="@android:color/white"
            android:textStyle="bold"/>

        <TextView
            android:id="@+id/tv_contact_phone"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textColor="@android:color/white"
            android:textSize="15sp"
            tools:text="0902123456"/>

    </LinearLayout>

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <TextView
            android:id="@+id/tv_empty"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:gravity="center"
            android:text="@string/msg_empty"
            android:visibility="gone"/>

        <android.support.v7.widget.RecyclerView
            android:id="@+id/rv_orders"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scrollbars="vertical"/>

        <ProgressBar
            android:id="@+id/progress_bar"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:visibility="gone"/>

    </FrameLayout>

</LinearLayout>


text:
using System;
using System.ComponentModel.DataAnnotations;
using EPiServer.Core;
using EPiServer.DataAbstraction;
using EPiServer.DataAnnotations;
using EPiServerSimpleSite.Models.Blocks;

namespace EPiServerSimpleSite.Models.Forms
{
    public class BaseFormModel<T> where T : SiteBlockData
    {
        public PageReference CurrentPageLink { get; set; }

        public ContentReference CurrentBlockLink { get; set; }

        public string CurrentLanguage { get; set; }

        public T ParentBlock { get; set; }
    }
}


text:
package com.unicorn.easygo.zxing.android;

import android.app.Activity;

/**
 * The main settings activity.
 * 设置相关的常量
 *
 * @author dswitkin@google.com (Daniel Switkin)
 * @author Sean Owen
 */
public final class PreferencesActivity extends Activity {

  public static final String KEY_DECODE_1D_PRODUCT = "preferences_decode_1D_product";
  public static final String KEY_DECODE_1D_INDUSTRIAL = "preferences_decode_1D_industrial";
  public static final String KEY_DECODE_QR = "preferences_decode_QR";
  public static final String KEY_DECODE_DATA_MATRIX = "preferences_decode_Data_Matrix";
  public static final String KEY_DECODE_AZTEC = "preferences_decode_Aztec";
  public static final String KEY_DECODE_PDF417 = "preferences_decode_PDF417";

  public static final String KEY_CUSTOM_PRODUCT_SEARCH = "preferences_custom_product_search";

  public static final String KEY_PLAY_BEEP = "preferences_play_beep";
  public static final String KEY_VIBRATE = "preferences_vibrate";
  public static final String KEY_COPY_TO_CLIPBOARD = "preferences_copy_to_clipboard";
  public static final String KEY_FRONT_LIGHT_MODE = "preferences_front_light_mode";
  public static final String KEY_BULK_MODE = "preferences_bulk_mode";
  public static final String KEY_REMEMBER_DUPLICATES = "preferences_remember_duplicates";
  public static final String KEY_SUPPLEMENTAL = "preferences_supplemental";
  public static final String KEY_AUTO_FOCUS = "preferences_auto_focus";
  public static final String KEY_INVERT_SCAN = "preferences_invert_scan";
  public static final String KEY_SEARCH_COUNTRY = "preferences_search_country";
  public static final String KEY_DISABLE_AUTO_ORIENTATION = "preferences_orientation";

  public static final String KEY_DISABLE_CONTINUOUS_FOCUS = "preferences_disable_continuous_focus";
  public static final String KEY_DISABLE_EXPOSURE = "preferences_disable_exposure";
  public static final String KEY_DISABLE_METERING = "preferences_disable_metering";
  public static final String KEY_DISABLE_BARCODE_SCENE_MODE = "preferences_disable_barcode_scene_mode";
  public static final String KEY_AUTO_OPEN_WEB = "preferences_auto_open_web";

}


text:
package br.unb.meb.rna.sandbox;

import br.unb.meb.rna.sandbox.api.*;

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

/**
 * Created by daniel on 10/18/13.
 */
public class NetworkImpl implements Network {

    private List<Layer> layers = new ArrayList<Layer>();

    @Override
    public Network add(Layer layer) {
        if (layer != null) {
            if (!layers.contains(layer)) {
                if (layers.size() == 0) {
                    layer.defineFirstLayer();
                } else {
                    layer.defineNotFirstLayer();
                }
                layers.add(layer);
            }
        }
        return this;
    }

    @Override
    public Network add(int index, Layer layer) throws IndexOutOfBoundsException {
        if (layer != null && index > -1) {
            layers.set(index, layer);
        }
        return this;
    }

    @Override
    public Network remove(Layer layer) {
        if (layer != null) {
            layers.remove(layer);
        }
        return this;
    }

    @Override
    public Network remove(int index) throws IndexOutOfBoundsException {
        if (index > -1) {
            layers.remove(index);
        }
        return this;
    }

    @Override
    public int size() {
        return layers.size();
    }

    @Override
    public double[] calculate() {
        return calculate(null);
    }

    @Override
    public double[] calculate(final double[] inputs) {
        double[] output = null;
        int size = size();

        if (size > 0) {
            double[][] outputs = null;
            for (int i = 0; i < size; i++) {
                if (i == 0) {
                    if (inputs == null || inputs.length == 0) {
                        outputs[i] = layers.get(i).calculate();
                    } else {
                        outputs[i] = layers.get(i).calculate(inputs);
                    }
                } else {
                    int preview = i - 1;
                    outputs[i] = layers.get(i).calculate(outputs[preview]);
                }
            }
            int last = size - 1;
            output = outputs[last];
        }

        return output;
    }
}


text:
package ikube.action;

import ikube.IConstants;
import ikube.database.IDataBase;
import ikube.model.File;
import ikube.model.IndexContext;
import ikube.model.Indexable;
import ikube.model.Url;

import java.util.*;

/**
 * This class resets the data in the cluster. It is imperative that nothing gets reset if there are any servers
 * working of course. The urls that are published into the cluster during the indexing need to be deleted. This
 * deletion action will delete them not only from this server's map but from all the servers' maps.
 *
 * @author Michael Couck
 * @version 01.00
 * @since 31-10-2010
 */
public class Reset extends Action<IndexContext, Boolean> {

    /**
     * {@inheritDoc}
     */
    @Override
    synchronized boolean internalExecute(
            final IndexContext indexContext) {
        try {
            Map<String, Object> parameters = new HashMap<>();
            parameters.put(IConstants.NAME, indexContext.getName());
            delete(dataBase, Url.class, Url.SELECT_FROM_URL_BY_NAME, parameters);
            delete(dataBase, File.class, File.SELECT_FROM_FILE_BY_NAME, parameters);
            for (final Indexable child : indexContext.getChildren()) {
                parameters.put(IConstants.NAME, child.getName());
                delete(dataBase, Url.class, Url.SELECT_FROM_URL_BY_NAME, parameters);
                delete(dataBase, File.class, File.SELECT_FROM_FILE_BY_NAME, parameters);
            }
            indexContext.setHashes(new TreeSet<Long>());
            return Boolean.TRUE;
        } finally {
            notifyAll();
        }
    }

    protected synchronized void delete(
            final IDataBase dataBase,
            final Class<?> klass,
            final String sql,
            final Map<String, Object> parameters) {
        do {
            List<?> list = dataBase.find(klass, sql, parameters, 0, IConstants.RESET_DELETE_BATCH_SIZE);
            if (list.size() <= 0) {
                break;
            }
            dataBase.removeBatch(list);
        } while (true);
    }

}


text:
#include <alloca.h>
#include <assert.h>
#include <errno.h>
#include <dirent.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#include <sys/param.h>
#include <sys/types.h>

#include <sysdep.h>
#include <sys/syscall.h>

/* Pack the dirent64 struct down into 32-bit offset/inode fields, and
   ensure that no overflow occurs.  */
ssize_t
__getdents (int fd, char *buf, size_t nbytes)
{
  union
  {
    struct dirent64 k;  /* Kernel structure.  */
    struct dirent u;
    char b[1];
  } *kbuf = (void *) buf, *outp, *inp;
  size_t kbytes = nbytes;
  off64_t last_offset = -1;
  ssize_t retval;

  const size_t size_diff = (offsetof (struct dirent64, d_name)
                            - offsetof (struct dirent, d_name));
  if (nbytes <= sizeof (struct dirent))
    {
      kbytes = nbytes + offsetof (struct dirent64, d_name)
        - offsetof (struct dirent, d_name);
      kbuf = __alloca(kbytes);
    }

  retval = INLINE_SYSCALL (getdents64, 3, fd, kbuf, kbytes);
  if (retval == -1)
    return -1;

  /* These two pointers might alias the same memory buffer.
     Standard C requires that we always use the same type for them,
     so we must use the union type.  */
  inp = kbuf;
  outp = (void *) buf;

  while (&inp->b < &kbuf->b + retval)
    {
      const size_t alignment = __alignof__ (struct dirent);
      /* Since inp->k.d_reclen is already aligned for the kernel
         structure this may compute a value that is bigger
         than necessary.  */
      size_t old_reclen = inp->k.d_reclen;
      size_t new_reclen = ((old_reclen - size_diff + alignment - 1)
                           & ~(alignment - 1));

      /* Copy the data out of the old structure into temporary space.
         Then copy the name, which may overlap if BUF == KBUF.  */
      const uint64_t d_ino = inp->k.d_ino;
      const int64_t d_off = inp->k.d_off;
      const uint8_t d_type = inp->k.d_type;

      memmove (outp->u.d_name, inp->k.d_name,
               old_reclen - offsetof (struct dirent64, d_name));

      /* Now we have copied the data from INP and access only OUTP.  */

      outp->u.d_ino = d_ino;
      outp->u.d_off = d_off;
      if ((sizeof (outp->u.d_ino) != sizeof (inp->k.d_ino)
           && outp->u.d_ino != d_ino)
          || (sizeof (outp->u.d_off) != sizeof (inp->k.d_off)
              && outp->u.d_off != d_off))
        {
          /* Overflow.  If there was at least one entry before this one,
             return them without error, otherwise signal overflow.  */
          if (last_offset != -1)
            {
              __lseek64 (fd, last_offset, SEEK_SET);
              return outp->b - buf;
            }
          __set_errno (EOVERFLOW);
          return -1;
        }

      last_offset = d_off;
      outp->u.d_reclen = new_reclen;
      outp->u.d_type = d_type;

      inp = (void *) inp + old_reclen;
      outp = (void *) outp + new_reclen;
    }

  return outp->b - buf;
}


text:
using System;
using System.Data;
using ADatabase;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace ACopyLibTest
{
    [TestClass]
    public class TestCreateTableFromXmlSqlServer: TestCopyLibBase
    {
        [TestInitialize]
        public override void Setup()
        {
            DbContext = DbContextFactory.CreateSqlServerContext(ConnectionStrings.GetSqlServer());
            TableName = "htablefromxml";

            base.Setup();
            DbSchema.DropTable(TableName);
        }

        [TestCleanup]
        public override void Cleanup()
        {
            base.Cleanup();
        }

        [TestMethod, TestCategory("SqlServer")]
        public void TestBinaryDoubleCol_When_SqlServer()
        {
            CreateTable(ColumnTypeName.BinaryDouble, 0, 0, 0, false, "", null);
            VerifyColumnType("float", null, 53, null);
        }

        [TestMethod, TestCategory("SqlServer")]
        public void TestBinaryFloatCol_When_SqlServer()
        {
            CreateTable(ColumnTypeName.BinaryFloat, 0, 0, 0, false, "", null);
            VerifyColumnType("real", null, null, null);
        }

        [TestMethod, TestCategory("SqlServer")]
        public void TestBlobCol_When_SqlServer()
        {
            CreateTable(ColumnTypeName.Blob, 0, 0, 0, true, null, null);
            VerifyColumnType("varbinary", -1, null, null);
        }

        [TestMethod, TestCategory("SqlServer")]
        public void TestBoolCol_When_SqlServer()
        {
            CreateTable(ColumnTypeName.Bool, 0, 1, 0, false, "0", null);
            VerifyColumnType("bit", null, null, null);
        }

        [TestMethod, TestCategory("SqlServer")]
        public void TestCharCol_When_SqlServer()
        {
            CreateTable(ColumnTypeName.Char, 10, 0, 0, false, "", null);
            VerifyColumnType("char", 10, 0, 0);
        }

        [TestMethod, TestCategory("SqlServer")]
        public void TestDateCol_When_SqlServer()
        {
            CreateTable(ColumnTypeName.Date, 0, 0, 0, false, "", null);
            VerifyColumnType("date", null, null, null);
        }

        [TestMethod, TestCategory("SqlServer")]
        public void TestDatetimeCol_When_SqlServer()
        {
            CreateTable(ColumnTypeName.DateTime, 0, 0, 0, false, "", null);
            VerifyColumnType("datetime", null, null, null);
        }

        [TestMethod, TestCategory("SqlServer")]
        public void TestDecCol_When_SqlServer()
        {
            CreateTable(ColumnTypeName.Dec, 0, 5, 0, false, "", null);
            VerifyColumnType("decimal", null, 5, 0);
        }

        [TestMethod, TestCategory("SqlServer")]
        public void TestFloatCol_When_SqlServer()
        {
            CreateTable(ColumnTypeName.Float, 0, 0, 0, false, "", null);
            VerifyColumnType("float", null, 53, null);
        }

        [TestMethod, TestCategory("SqlServer")]
        public void TestFloatColWithLength_When_SqlServer()
        {
            CreateTable(ColumnTypeName.Float, 47, 0, 0, false, "", null);
            VerifyColumnType("float", null, 53, null); // it's always 24 or 53
        }

        [TestMethod, TestCategory("SqlServer")]
        public void TestGuidCol_When_SqlServer()
        {
            CreateTable(ColumnTypeName.Guid, 0, 0, 0, false, "", null);
            VerifyColumnType("uniqueidentifier", null, null, null);
        }

        [TestMethod, TestCategory("SqlServer")]
        public void TestOldBlobCol_When_SqlServer()
        {
            CreateTable(ColumnTypeName.OldBlob, 0, 0, 0, false, "", null);
            VerifyColumnType("image", null, null, null);
        }

        [TestMethod, TestCategory("SqlServer")]
        public void TestOldTextCol_When_SqlServer()
        {
            CreateTable(ColumnTypeName.OldText, 0, 0, 0, false, "", null);
            VerifyColumnType("text", null, null, null);
        }

        [TestMethod, TestCategory("SqlServer")]
        public void TestIntCol_When_SqlServer()
        {
            CreateTable(ColumnTypeName.Int, 0, 0, 0, false, "", null);
            VerifyColumnType("int", null, null, null);
        }

        [TestMethod, TestCategory("SqlServer")]
        public void TestInt16Col_When_SqlServer()
        {
            CreateTable(ColumnTypeName.Int16, 0, 0, 0, false, "", null);
            VerifyColumnType("smallint", null, null, null);
        }

        [TestMethod, TestCategory("SqlServer")]
        public void TestInt64Col_When_SqlServer()
        {
            CreateTable(ColumnTypeName.Int64, 0, 0, 0, false, "", null);
            VerifyColumnType("bigint", null, null, null);
        }

        [TestMethod, TestCategory("SqlServer")]
        public void TestInt8Col_When_SqlServer()
        {
            CreateTable(ColumnTypeName.Int8, 0, 0, 0, false, "", null);
            VerifyColumnType("tinyint", null, null, null);
        }

        [TestMethod, TestCategory("SqlServer")]
        public void TestLongTextCol_When_SqlServer()
        {
            CreateTable(ColumnTypeName.LongText, 0, 0, 0, false, "", null);
            VerifyColumnType("varchar", -1, null, null);
        }

        [TestMethod, TestCategory("SqlServer")]
        public void TestMoneyCol_When_SqlServer()
        {
            CreateTable(ColumnTypeName.Money, 0, 0, 0, false, "", null);
            VerifyColumnType("money", null, null, null);
        }

        [TestMethod, TestCategory("SqlServer")]
        public void TestNCharCol_When_SqlServer()
        {
            CreateTable(ColumnTypeName.NChar, 10, 0, 0, false, "", null);
            VerifyColumnType("nchar", 10, null, null);
        }

        [TestMethod, TestCategory("SqlServer")]
        public void TestNLongTextCol_When_SqlServer()
        {
            CreateTable(ColumnTypeName.NLongText, 0, 0, 0, false, "", null);
            VerifyColumnType("nvarchar", -1, null, null);
        }

        [TestMethod, TestCategory("SqlServer")]
        public void TestNVarcharCol_When_SqlServer()
        {
            CreateTable(ColumnTypeName.NVarchar, 50, 0, 0, false, "", null);
            VerifyColumnType("nvarchar", 50, null, null);
        }

        [TestMethod, TestCategory("SqlServer")]
        public void TestRawCol_When_SqlServer()
        {
            CreateTable(ColumnTypeName.Raw, 1000, 0, 0, false, "", null);
            VerifyColumnType("binary", 1000, null, null);
        }

        [TestMethod, TestCategory("SqlServer")]
        public void TestSmallDateTimeCol_When_SqlServer()
        {
            CreateTable(ColumnTypeName.SmallDateTime, 0, 0, 0, false, "", null);
            VerifyColumnType("smalldatetime", null, null, null);
        }

        [TestMethod, TestCategory("SqlServer")]
        public void TestSmallMoneyCol_When_SqlServer()
        {
            CreateTable(ColumnTypeName.SmallMoney, 0, 0, 0, false, "", null);
            VerifyColumnType("smallmoney", null, null, null);
        }

        [TestMethod, TestCategory("SqlServer")]
        public void TestTimeCol_When_SqlServer()
        {
            CreateTable(ColumnTypeName.Time, 0, 0, 0, false, "", null);
            VerifyColumnType("time", null, null, null);
        }

        [TestMethod, TestCategory("SqlServer")]
        public void TestVarcharCol_When_SqlServer()
        {
            CreateTable(ColumnTypeName.Varchar, 250, 0, 0, false, "", null);
            VerifyColumnType("varchar", 250, null, null);
        }

        #region Private helpers

        private void VerifyColumnType(string expectedType, int? expectedLength, int? expectedPrec, int? expectedScale)
        {
            var selectStmt = "";
            selectStmt += "SELECT c.name, " + "\n";
            selectStmt += "       t.name AS t_name, " + "\n";
            selectStmt += "       isnull(c.max_length, 0) as length, " + "\n";
            selectStmt += "       isnull(c.precision, 0) as prec, " + "\n";
            selectStmt += "       isnull(c.scale, 0) as scale, " + "\n";
            selectStmt += "       c.is_nullable, " + "\n";
            selectStmt += "       convert(varchar(256), isnull(c.collation_name, '')) as collation, " + "\n";
            selectStmt += "       isnull(object_definition(c.default_object_id), '') as def, " + "\n";
            selectStmt += "       c.is_identity " + "\n";
            selectStmt += "FROM   sys.columns c " + "\n";
            selectStmt += "       JOIN sys.types t " + "\n";
            selectStmt += "         ON c.user_type_id = t.user_type_id " + "\n";
            selectStmt += $"WHERE  c.object_id = Object_id('{TableName}') " + "\n";
            selectStmt += "ORDER  BY c.column_id ";

            IDataCursor cursor = DbContext.PowerPlant.CreateDataCursor();
            string type = "";
            int length = -99;
            int prec = -99;
            int scale = -99;
            try
            {
                IDataReader reader = cursor.ExecuteReader(selectStmt);
                reader.Read();
                type = reader.GetString(1).ToLower();
                length = reader.GetInt16(2);
                if (length != -1 && (type == "nvarchar" || type == "nchar")) length /= 2;
                prec = reader.GetByte(3);
                scale = reader.GetByte(4);
                if (reader.GetBoolean(8))
                {
                    type = "identity";
                }
            }
            catch (Exception)
            {
                false.Should().BeTrue("because we want to fail when we cant read type from database.");
            }
            finally
            {
                cursor.Close();
            }
            type.Should().Be(expectedType);
            if (expectedLength != null) length.Should().Be(expectedLength, "because that's the expected length");
            if (expectedPrec != null) prec.Should().Be(expectedPrec, "because that's the expected precision");
            if (expectedScale != null) scale.Should().Be(expectedScale, "because that's the expected scale");
        }

        #endregion

    }
}


text:
{{ include.header.title }}

        {{ include.header.subtitle }}

      {{ include.header.buttontitle }}


text:
FILE(REMOVE_RECURSE
  "CMakeFiles/sample1_unittest.dir/samples/sample1_unittest.cc.o"
  "CMakeFiles/sample1_unittest.dir/samples/sample1.cc.o"
  "sample1_unittest.pdb"
  "sample1_unittest"
)

# Per-language clean rules from dependency scanning.
FOREACH(lang CXX)
  INCLUDE(CMakeFiles/sample1_unittest.dir/cmake_clean_${lang}.cmake OPTIONAL)
ENDFOREACH(lang)


text:
layout: post
title: "Walking towards Epcot...oh its..."
---
Walking towards Epcot...oh its hot


text:
<?php
/* @var $this UsuarioController */
/* @var $model Usuario */
/* @var $form CActiveForm */
?>

<?php $form=$this->beginWidget('CActiveForm', array(
	'action'=>Yii::app()->createUrl($this->route),
	'method'=>'get',
)); ?>

		<?php echo $form->label($model,'id'); ?>
		<?php echo $form->textField($model,'id'); ?>

		<?php echo $form->label($model,'ciudad_id'); ?>
		<?php echo $form->textField($model,'ciudad_id'); ?>

		<?php echo $form->label($model,'Paciente_id'); ?>
		<?php echo $form->textField($model,'Paciente_id'); ?>

		<?php echo $form->label($model,'Rol_id'); ?>
		<?php echo $form->textField($model,'Rol_id'); ?>

		<?php echo $form->label($model,'nombre'); ?>
		<?php echo $form->textField($model,'nombre',array('size'=>45,'maxlength'=>45)); ?>

		<?php echo $form->label($model,'apellido'); ?>
		<?php echo $form->textField($model,'apellido',array('size'=>45,'maxlength'=>45)); ?>

		<?php echo $form->label($model,'direccion'); ?>
		<?php echo $form->textField($model,'direccion',array('size'=>45,'maxlength'=>45)); ?>

		<?php echo $form->label($model,'telefono'); ?>
		<?php echo $form->textField($model,'telefono',array('size'=>45,'maxlength'=>45)); ?>

		<?php echo $form->label($model,'email'); ?>
		<?php echo $form->textField($model,'email',array('size'=>45,'maxlength'=>45)); ?>

		<?php echo $form->label($model,'genero'); ?>
		<?php echo $form->textField($model,'genero',array('size'=>45,'maxlength'=>45)); ?>

		<?php echo $form->label($model,'fecha_nacimiento'); ?>
		<?php echo $form->textField($model,'fecha_nacimiento'); ?>

		<?php echo $form->label($model,'username'); ?>
		<?php echo $form->textField($model,'username',array('size'=>45,'maxlength'=>45)); ?>

		<?php echo CHtml::submitButton('Search' , array("class"=>"btn btn-primary btn-large")); ?>

<?php $this->endWidget(); ?>


text:
<?php

if (!defined('CCADMIN')) { echo "NO DICE"; exit; }

if (empty($_GET['process'])) {
	global $getstylesheet;
	include_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'config.php');

echo <<<EOD
<!DOCTYPE html>

$getstylesheet
</style>

<form style="height:100%" action="?module=dashboard&action=loadexternal&type=extension&name=jabber&process=true" method="post">

Settings

If you would like to use your own GTalk application for GTalk Connect please fill in the values below. If not leave them blank.

GTalk App ID:

<input type="text" class="inputbox" name="gtalkAppId" value="$gtalkAppId">

GTalk App Secret Key:

<input type="text" class="inputbox" name="gtalkSecretKey" value="$gtalkSecretKey">

		<input type="submit" value="Update Settings" class="button">  or cancel or close

</form>

EOD;
} else {

	$data = '';
	foreach ($_POST as $field => $value) {
		$data .= '$'.$field.' = \''.$value.'\';'."\r\n";
	}

	configeditor('SETTINGS',$data,0,dirname(__FILE__).DIRECTORY_SEPARATOR.'config.php');
	header("Location:?module=dashboard&action=loadexternal&type=extension&name=jabber");
}


text:
'use strict';

const os = require('os');
const fs = require('fs');
const { pathToFileURL } = require('url');
const path = require('path');
const {
  extendDefaultPlugins,
  optimize: optimizeAgnostic,
  createContentItem,
} = require('./svgo.js');

exports.extendDefaultPlugins = extendDefaultPlugins;
exports.createContentItem = createContentItem;

const importConfig = async (configFile) => {
  let config;
  // at the moment dynamic import may randomly fail with segfault
  // to workaround this for some users .cjs extension is loaded
  // exclusively with require
  if (configFile.endsWith('.cjs')) {
    config = require(configFile);
  } else {
    try {
      // dynamic import expects file url instead of path and may fail
      // when windows path is provided
      const { default: imported } = await import(pathToFileURL(configFile));
      config = imported;
    } catch (importError) {
      // TODO remove require in v3
      try {
        config = require(configFile);
      } catch (requireError) {
        // throw original error if es module is detected
        if (requireError.code === 'ERR_REQUIRE_ESM') {
          throw importError;
        } else {
          throw requireError;
        }
      }
    }
  }
  if (config == null || typeof config !== 'object' || Array.isArray(config)) {
    throw Error(`Invalid config file "${configFile}"`);
  }
  return config;
};

const isFile = async (file) => {
  try {
    const stats = await fs.promises.stat(file);
    return stats.isFile();
  } catch {
    return false;
  }
};

const loadConfig = async (configFile, cwd = process.cwd()) => {
  if (configFile != null) {
    if (path.isAbsolute(configFile)) {
      return await importConfig(configFile);
    } else {
      return await importConfig(path.join(cwd, configFile));
    }
  }
  let dir = cwd;
  // eslint-disable-next-line no-constant-condition
  while (true) {
    const js = path.join(dir, 'svgo.config.js');
    if (await isFile(js)) {
      return await importConfig(js);
    }
    const mjs = path.join(dir, 'svgo.config.mjs');
    if (await isFile(mjs)) {
      return await importConfig(mjs);
    }
    const cjs = path.join(dir, 'svgo.config.cjs');
    if (await isFile(cjs)) {
      return await importConfig(cjs);
    }
    const parent = path.dirname(dir);
    if (dir === parent) {
      return null;
    }
    dir = parent;
  }
};
exports.loadConfig = loadConfig;

const optimize = (input, config) => {
  if (config == null) {
    config = {};
  }
  if (typeof config !== 'object') {
    throw Error('Config should be an object');
  }
  return optimizeAgnostic(input, {
    ...config,
    js2svg: {
      // platform specific default for end of line
      eol: os.EOL === '\r\n' ? 'crlf' : 'lf',
      ...config.js2svg,
    },
  });
};
exports.optimize = optimize;


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package us.guihouse.projector.scenes;

import java.io.IOException;
import java.net.URL;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.stage.Stage;
import us.guihouse.projector.forms.controllers.AddMusicCallback;
import us.guihouse.projector.forms.controllers.projection.ImageController;
import us.guihouse.projector.forms.controllers.MusicListController;
import us.guihouse.projector.services.ManageMusicService;

/**
 *
 * @author guilherme
 */
public class MusicListScene {
    public static Parent createMusicListScene(AddMusicCallback callback,  ManageMusicService manageMusicService, Stage listMusicStage) throws IOException {
        URL url = ImageController.class.getClassLoader().getResource("fxml/music_list.fxml");
        FXMLLoader loader = new FXMLLoader(url);

        Parent root = loader.load();
        MusicListController ctrl = loader.getController();
        ctrl.setAddMusicCallback(callback);
        ctrl.setManageMusicService(manageMusicService);
        ctrl.setCurrentStage(listMusicStage);

        return root;
    }
}


text:
using System;
using System.Runtime.Loader;
using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.Cli.Utils.ExceptionExtensions;
using Microsoft.DotNet.Tools.Common;

namespace Microsoft.DotNet.Cli
{
    public class MulticoreJitActivator
    {
        public bool TryActivateMulticoreJit()
        {
            var disableMulticoreJit = IsMulticoreJitDisabled();

            if (disableMulticoreJit)
            {
                return false;
            }

            StartCliProfileOptimization();

            return true;
        }

        private bool IsMulticoreJitDisabled()
        {
            return Env.GetEnvironmentVariableAsBool("DOTNET_DISABLE_MULTICOREJIT");
        }

        private void StartCliProfileOptimization()
        {
            var profileOptimizationRootPath = new MulticoreJitProfilePathCalculator().MulticoreJitProfilePath;

            if (!TryEnsureDirectoryExists(profileOptimizationRootPath))
            {
                return;
            }

            AssemblyLoadContext.Default.SetProfileOptimizationRoot(profileOptimizationRootPath);

            AssemblyLoadContext.Default.StartProfileOptimization("dotnet");
        }

        private bool TryEnsureDirectoryExists(string directoryPath)
        {
            try
            {
                PathUtility.EnsureDirectoryExists(directoryPath);

                return true;
            }
            catch (Exception e)
            {
                e.ReportAsWarning();
                return false;
            }
        }
    }
}


text:
%{
For CVX in-class tutorial, CCIMI short-course at Cambridge,
 June 2018, Becker
%}
%% Setup the matrix:
% rng(0);
n   = 10;
m   = 5;
A   = reshape( mod( (1:m*n)-1, 11 )+1, m, n )
y   = (1:m)'

% Make global changes to CVX parameters
cvx_precision best
cvx_quiet true
%% Exercise 1
cvx_begin
  variable x(n)
  minimize norm(x)
  subject to
    norm( A*x-y ) <= .1
cvx_end
fprintf('Problem 1, CVX status is "%s", optimal value is %g\n', cvx_status, cvx_optval );
%% Exercise 2
cvx_begin
  variable x(n)
  minimize sum_square(x)
  subject to
    norm( A*x-y ) <= .1
cvx_end
fprintf('Problem 2, CVX status is "%s", optimal value is %g\n', cvx_status, cvx_optval );
%% Exercise 3
cvx_begin
  variable x(n)
  minimize norm(x,1)
  subject to
    norm( A*x-y ) <= .1
cvx_end
fprintf('Problem 3, CVX status is "%s", optimal value is %g\n', cvx_status, cvx_optval );
%% Exercise 4
cvx_begin
  variable x(n)
  dual variable lambda
  minimize norm(x)
  subject to
    norm( A*x-y ) <= .1 : lambda
cvx_end
% Now, resolve
cvx_begin
  variable xx(n)
  minimize norm(xx) + lambda*norm( A*xx - y )
cvx_end
fprintf('Problem 4, CVX status is "%s", optimal value is %g\n', cvx_status, cvx_optval );
fprintf(' Discrepanct via two methods is %g\n', norm(xx-x)/norm(x) );

%% Exercise 5: matrix problem
% Note: the simple solution, sum(norms(A-x*o',2))
%   doesn't work in CVX "Version 3.0beta, Build 1183 (dda2109)"
o = ones(n,1);
cvx_begin
  variable x(m)
  minimize sum(norms( A - x*o', 2 ))
cvx_end
fprintf('Problem 5, CVX status is "%s", optimal value is %g\n', cvx_status, cvx_optval );
%% Exercise 6: matrix problem
cvx_begin
  variable x(m)
  minimize norm( A - x*o')
cvx_end
fprintf('Problem 6, CVX status is "%s", optimal value is %g\n', cvx_status, cvx_optval );
%% Exercise 7: matrix problem
cvx_begin
  variable X(m,n)
  minimize norm( X - A, 'fro')
  subject to
    ones(1,m)*X*ones(n,1) == 1
cvx_end
fprintf('Problem 7, CVX status is "%s", optimal value is %g\n', cvx_status, cvx_optval );
%% Exercise 8: matrix problem
B   = A(:,1:5);
cvx_begin
  variable X(m,m) symmetric
  minimize norm( X - B, 'fro')
  subject to
    X == semidefinite(m)
cvx_end
fprintf('Problem 8, CVX status is "%s", optimal value is %g\n', cvx_status, cvx_optval );


text:
<?php

namespace app\models;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use app\models\CarPart;
use yii\data\Sort;

/**
 * CarPartSearch represents the model behind the search form about `app\models\CarPart`.
 */
class CarPartSearch extends CarPart
{

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'size_id', 'color_id', 'damage_id', 'price_id'], 'integer'],
            [['created_at', 'updated_at', 'price_total','size_name','color_name','damage_name'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = CarPart::find();
        $query->innerJoinWith('size','color','damage','price');

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
            'sort' => new Sort([
                'attributes' => [
                    'size_name' => [
                        'asc' => ['size.name' => SORT_ASC],
                        'desc' => ['size.name' => SORT_DESC]
                    ],
                    'color_name' => [
                        'asc' => ['color.name' => SORT_ASC],
                        'desc' => ['color.name' => SORT_DESC]
                    ],
                    'damage_name' => [
                        'asc' => ['damage.name' => SORT_ASC],
                        'desc' => ['damage.name' => SORT_DESC]
                    ],
                    'price_total' => [
                        'asc' => ['price.total' => SORT_ASC],
                        'desc' => ['price.total' => SORT_DESC]
                    ],
                    'created_at',
                    'updated_at'
                ],
            ])
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        $query->andFilterWhere([
            /*'size_id' => $this->size_id,
            'color_id' => $this->color_id,
            'damage_id' => $this->damage_id,
            'price_id' => $this->price_id,*/
            'created_at' => $this->created_at,
            'updated_at' => $this->updated_at,
        ]);

        $query->andFilterWhere(['like', 'size.name', $this->size_name])->andFilterWhere(['like', 'damage.name', $this->damage_name])
            ->andFilterWhere(['like', 'color.name', $this->color_name])->andFilterWhere(['like','price.total',$this->price_total]);

        return $dataProvider;
    }
}


text:
#pragma once

// The following XML snippet needs to be added to Package.appxmanifest:
//
//<Extensions>
//  <Extension Category = "windows.activatableClass.inProcessServer">
//    <InProcessServer>
//      <Path>VideoEffects.WindowsPhone.dll</Path>
//      <ActivatableClass ActivatableClassId = "VideoEffects.LumiaEffect" ThreadingModel = "both" />
//    </InProcessServer>
//  </Extension>
//</Extensions>
//

class LumiaEffect WrlSealed : public Microsoft::WRL::RuntimeClass<Video1in1outEffect>
{
    InspectableClass(L"VideoEffects.LumiaEffect", TrustLevel::BaseTrust);

public:

    LumiaEffect()
        : _inputWidthInit(0)
        , _inputHeightInit(0)
        , _outputWidthInit(0)
        , _outputHeightInit(0)
        , _inputWidth(0)
        , _inputHeight(0)
        , _outputWidth(0)
        , _outputHeight(0)
    {
    }

    HRESULT RuntimeClassInitialize()
    {
        return Video1in1outEffect::RuntimeClassInitialize();
    }

    virtual void Initialize(_In_ Windows::Foundation::Collections::IMap<Platform::String^, Platform::Object^>^ props) override;

    // Format management
    virtual std::vector<unsigned long> GetSupportedFormats() const override;
    virtual bool IsValidInputType(_In_ const Microsoft::WRL::ComPtr<IMFMediaType>& type) const override;
    virtual bool IsValidOutputType(_In_ const Microsoft::WRL::ComPtr<IMFMediaType>& type) const override;
    virtual _Ret_maybenull_ Microsoft::WRL::ComPtr<IMFMediaType> CreateInputAvailableType(_In_ unsigned int typeIndex) const override;
    virtual _Ret_maybenull_ Microsoft::WRL::ComPtr<IMFMediaType> CreateOutputAvailableType(_In_ unsigned int typeIndex) const override;

    // Data processing
    virtual void StartStreaming(_In_ unsigned long format, _In_ unsigned int width, _In_ unsigned int height) override;
    virtual bool ProcessSample(_In_ const Microsoft::WRL::ComPtr<IMFSample>& inputSample, _In_ const Microsoft::WRL::ComPtr<IMFSample>& outputSample) override;

private:

    bool _IsValidType(
        _In_ const Microsoft::WRL::ComPtr<IMFMediaType> &type,
        unsigned int width,
        unsigned int height,
        unsigned int framerateNum,
        unsigned int framerateDenom
        ) const;

    _Ret_maybenull_ Microsoft::WRL::ComPtr<IMFMediaType> _CreatePartialType(
        _In_ unsigned int typeIndex,
        unsigned int width,
        unsigned int height,
        unsigned int framerateNum,  // 0 if no framerate
        unsigned int framerateDenom // 0 if no framerate
        ) const;

    unsigned int _inputWidthInit;
    unsigned int _inputHeightInit;
    unsigned int _outputWidthInit;
    unsigned int _outputHeightInit;
    unsigned int _inputWidth;
    unsigned int _inputHeight;
    unsigned int _outputWidth;
    unsigned int _outputHeight;

    Windows::Foundation::Collections::IIterable<Lumia::Imaging::IFilter^>^ _filters;
    VideoEffects::IAnimatedFilterChain^ _animatedFilters;
    VideoEffects::IBitmapVideoEffect^ _bitmapEffect;
};

ActivatableClass(LumiaEffect);


text:
class Shape(object):
    def __init__(self, width, height):
        self.length = width, height

    def setLength(self, width, height):
        self.length = width, height

    def getLength(self):
        return self.length

    def getDeg(self):
        return 0

    def getName(self): pass

class Parallelogram(Shape):
    def __init__(self, width, height, deg):
        Shape.__init__(self, width, height)
        self.deg = deg

    def setDeg(self, deg):
        self.deg = deg

    def getDeg(self):
        return self.deg

    def getName(self):
        return 'Parallelogram'

class Rectangle(Shape):
    def getDeg(self):
        return 90

    def getName(self):
        return 'Rectangle'

class Sqaure(Shape):
    def __init__(self, width):
        self.length = width

    def setLength(self, width):
        self.length = width

    def getDeg(self):
        return 90

    def getName(self):
        return 'Sqaure'

po = Parallelogram(10, 20, 15)
ro = Rectangle(30, 40)
so = Sqaure(50)

print '\nParallelogram\'s length =', po.getLength(), ' deg =', po.getDeg()
print '\nRectangle\'s length =', ro.getLength(), ' deg =', ro.getDeg()
print '\nSqaure\'s length =', so.getLength(), ' deg =', so.getDeg()

po.setDeg(90)
print '\nParallelogram\'s deg =', po.getDeg()

print '\n'


text:
require 'spec_helper'

describe AchievementsController do
  describe 'awarding badges' do
    let(:api_key) { "abcd" }

    it 'should award 24pullrequests badges' do
      api_access = Fabricate(:api_access, api_key: api_key, awards: %w(TwentyFourPullRequestsParticipant2012 TwentyFourPullRequestsContinuous2012))
      participant = Fabricate(:user, github: "bashir")
      post :award, badge: 'TwentyFourPullRequestsParticipant2012', date: '12/24/2012', github: participant.github, api_key: api_key
      participant.badges.count.should == 1
      participant.badges.first.is_a? TwentyFourPullRequestsParticipant2012
      post :award, badge: 'TwentyFourPullRequestsContinuous2012', date: '12/24/2012', github: participant.github, api_key: api_key
      participant.badges.count.should == 2
      participant.badges.last.is_a? TwentyFourPullRequestsContinuous2012
    end

    it 'should fail to allow awards with no api key' do
      api_access = Fabricate(:api_access, api_key: api_key, awards: %w(TwentyFourPullRequestsParticipant2012 TwentyFourPullRequestsContinuous2012))
      participant = Fabricate(:user, github: "bashir")
      post :award, badge: 'TwentyFourPullRequestsParticipant2012', date: '12/24/2012', github: participant.github
      participant.badges.count.should == 0
    end

    it 'should fail to allow awards if api_key does not have award privileges for the requested badge' do
      api_access = Fabricate(:api_access, api_key: api_key, awards: %w(TwentyFourPullRequestsParticipant2012 TwentyFourPullRequestsContinuous2012))
      participant = Fabricate(:user, github: "bashir")
      post :award, badge: 'SomeRandomBadge', date: '12/24/2012', github: participant.github, api_key: api_key
      participant.badges.count.should == 0
    end
  end
end


text:
package com.hazelcast.map.impl.querycache;

import com.hazelcast.map.impl.ListenerAdapter;

/**
 * Marker interface for the listener adapters used to listen {@link com.hazelcast.map.QueryCache QueryCache}.
 */
public interface QueryCacheListenerAdapter<T> extends ListenerAdapter<T> {
}


text:
package com.zend.zendserver.bamboo;

public class ZendServerApplicationException extends Exception {
	private static final long serialVersionUID = 1L;

	public ZendServerApplicationException(String message) {
		super(message);
	}
}