text:
package org.springframework.boot.devtools.restart;

import java.net.URL;

import org.junit.Test;

import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertThat;

/**
 * Tests for {@link DefaultRestartInitializer}.
 *
 * @author Phillip Webb
 */
public class DefaultRestartInitializerTests {

	@Test
	public void nullForTests() throws Exception {
		MockRestartInitializer initializer = new MockRestartInitializer(true);
		assertThat(initializer.getInitialUrls(Thread.currentThread()), nullValue());
	}

	@Test
	public void validMainThread() throws Exception {
		MockRestartInitializer initializer = new MockRestartInitializer(false);
		ClassLoader classLoader = new MockAppClassLoader(getClass().getClassLoader());
		Thread thread = new Thread();
		thread.setName("main");
		thread.setContextClassLoader(classLoader);
		assertThat(initializer.isMain(thread), equalTo(true));
		assertThat(initializer.getInitialUrls(thread), not(nullValue()));
	}

	@Test
	public void threadNotNamedMain() throws Exception {
		MockRestartInitializer initializer = new MockRestartInitializer(false);
		ClassLoader classLoader = new MockAppClassLoader(getClass().getClassLoader());
		Thread thread = new Thread();
		thread.setName("buscuit");
		thread.setContextClassLoader(classLoader);
		assertThat(initializer.isMain(thread), equalTo(false));
		assertThat(initializer.getInitialUrls(thread), nullValue());
	}

	@Test
	public void threadNotUsingAppClassLoader() throws Exception {
		MockRestartInitializer initializer = new MockRestartInitializer(false);
		ClassLoader classLoader = new MockLauncherClassLoader(getClass().getClassLoader());
		Thread thread = new Thread();
		thread.setName("main");
		thread.setContextClassLoader(classLoader);
		assertThat(initializer.isMain(thread), equalTo(false));
		assertThat(initializer.getInitialUrls(thread), nullValue());
	}

	@Test
	public void skipsDueToJUnitStacks() throws Exception {
		testSkipStack("org.junit.runners.Something", true);
	}

	@Test
	public void skipsDueToSpringTest() throws Exception {
		testSkipStack("org.springframework.boot.test.Something", true);
	}

	private void testSkipStack(String className, boolean expected) {
		MockRestartInitializer initializer = new MockRestartInitializer(true);
		StackTraceElement element = new StackTraceElement(className, "someMethod",
				"someFile", 123);
		assertThat(initializer.isSkippedStackElement(element), equalTo(expected));
	}

	private static class MockAppClassLoader extends ClassLoader {

		MockAppClassLoader(ClassLoader parent) {
			super(parent);
		}

	}

	private static class MockLauncherClassLoader extends ClassLoader {

		MockLauncherClassLoader(ClassLoader parent) {
			super(parent);
		}

	}

	private static class MockRestartInitializer extends DefaultRestartInitializer {

		private final boolean considerStackElements;

		MockRestartInitializer(boolean considerStackElements) {
			this.considerStackElements = considerStackElements;
		}

		@Override
		protected boolean isSkippedStackElement(StackTraceElement element) {
			if (!this.considerStackElements) {
				return false;
			}
			return true;
		}

		@Override
		protected URL[] getUrls(Thread thread) {
			return new URL[0];
		}

	}

}


text:
module OneviewCookbook
  module API800
    module Synergy
      # StorageSystem API800 Synergy provider
      class StorageSystemProvider < API800::C7000::StorageSystemProvider
      end
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
#include <stdio.h>
#include "common/datatypes.h"
#include "apt_demod.h"

#define FMPLL_RANGE     30000.0     // maximum deviation limit of PLL
#define VOICE_BW        5000.0      // FIXME
#define MAX_FMOUT       0.8
#define FMPLL_BW        VOICE_BW    // natural frequency ~loop bandwidth
#define FMPLL_ZETA      0.707       // PLL Loop damping factor
#define FMDC_ALPHA      0.001       // time constant for DC removal filter

AptDemod::AptDemod()
{
    freq_err_dc = 0.0;
    nco_phase = 0.0;
    nco_freq = 0.0;
    out_gain = 1.0;

    set_sample_rate(96000.0);
}

void AptDemod::set_sample_rate(real_t new_rate)
{
    if (sample_rate == new_rate)
        return;

    sample_rate = new_rate;

    real_t norm = K_2PI / sample_rate;  // to normalize Hz to radians

    // initialize the PLL
    nco_lo_limit = -FMPLL_RANGE * norm;      // clamp PLL NCO
    nco_hi_limit = FMPLL_RANGE * norm;
    pll_alpha = 2.0 * FMPLL_ZETA * FMPLL_BW * norm;
    pll_beta = (pll_alpha * pll_alpha) / (4.0 * FMPLL_ZETA * FMPLL_ZETA);

    out_gain = MAX_FMOUT / nco_hi_limit;  // audio output level gain

    fprintf(stderr, "  APT out_gain: %.2f\n", out_gain);

    // DC removal filter time constant
    dc_alpha = (1.0 - MEXP(-1.0 / (sample_rate * FMDC_ALPHA)));
}

int AptDemod::process(int num, const complex_t * inbuf, real_t * outbuf)
{
    complex_t       tmp;
    real_t          sin, cos;
    real_t          phzerror;

    for (int i = 0; i < num; i++)
    {
        sin = MSIN(nco_phase);
        cos = MCOS(nco_phase);

        // complex multiply input sample by NCO
        tmp.re = cos * inbuf[i].re - sin * inbuf[i].im;
        tmp.im = cos * inbuf[i].im + sin * inbuf[i].re;

        // find current sample phase after being shifted by NCO frequency
        phzerror = -MATAN2(tmp.im, tmp.re);

        // create new NCO frequency term
        nco_freq += (pll_beta * phzerror);        //  radians per sampletime

        // clamp NCO frequency so doesn't get out of lock range
        if (nco_freq > nco_hi_limit)
            nco_freq = nco_hi_limit;
        else if (nco_freq < nco_lo_limit)
            nco_freq = nco_lo_limit;

        // update NCO phase with new value
        nco_phase += (nco_freq + pll_alpha * phzerror);

        // LP filter the NCO frequency term to get DC offset value
        freq_err_dc += dc_alpha * (nco_freq - freq_err_dc);

        // subtract out DC term to get FM audio
        outbuf[i] = (nco_freq - freq_err_dc) * out_gain;
    }

    nco_phase = MFMOD(nco_phase, K_2PI);  // keep radian counter bounded

    return num;
}


text:
package test.java.Domain.User.Authentication;

import junit.framework.TestCase;
import main.java.Domain.User.Authentication.Authentifier;
import main.java.Domain.User.Password;
import main.java.Domain.User.User;
import main.java.Infrastructure.Persistence.User.InMemoryUserRepository;

import java.io.UnsupportedEncodingException;

public class AuthentifierTest extends TestCase {
    private Authentifier authentifier;

    public static final String VALID_USERNAME = "jimmykoak";
    public static final String VALID_PASSWORD = "12345";
    private static final String INVALID_USERNAME = "invalid_username";
    private static final String INVALID_PASSWORD = "invalid_password";

    @Override
    protected void setUp() throws Exception {
        authentifier = new Authentifier(
                new InMemoryUserRepository()
        );
    }

    public void testShouldAuthenticateValidUser() throws UnsupportedEncodingException {
        User user = authentifier.authenticate(VALID_USERNAME, Password.createFromUncrypted(VALID_PASSWORD));

        assertNotNull(user);
        assertSame(VALID_USERNAME, user.getUsername());
    }

    public void testShouldNotAuthenticateInvalidUser() throws UnsupportedEncodingException {
        User user = authentifier.authenticate(INVALID_USERNAME, Password.createFromUncrypted(VALID_PASSWORD));

        assertNull(user);
    }

    public void testShouldNotAuthenticateValidUserButInvalidPassword() throws UnsupportedEncodingException {
        User user = authentifier.authenticate(VALID_USERNAME, Password.createFromUncrypted(INVALID_PASSWORD));

        assertNull(user);
    }
}


text:
package common

import (
	"fmt"
	"io"
	"net/http"
	"os"
)

// Decrypted Message struct
type Message struct {
	Username  string
	Decrypted bool
	Err       error
	Message   string
	Fullname  string
	ToUsers   []string
	ChatName  string
}

// Create a new message with defaults
func NewMessage() *Message {
	return &Message{
		Username:  "",
		Decrypted: true,
		Err:       nil,
		Message:   "",
		Fullname:  "",
	}
}

// Send Message Function from UI type
type SendMessageFunc func(Message)

// Create Connection Function from UI type
type CreateConnFunc func(string)

// Make this true if you want to quit
var Done = make(chan bool, 1)

var DefaultPort = 21991

// Check if user exists
// TODO: Protect against usernames like "/" or " ", that could just go to keybase.io
func DoesUserExist(username string) (bool, error) {
	if username == "" {
		return false, nil
	}
	resp, err := http.Get("https://keybase.io/" + username)
	if err != nil {
		return false, err
	}
	defer resp.Body.Close()

	return resp.StatusCode <= 300, nil
}

// Where the default program directory is
var ProgramDir string

// NOTE: I *NEVER* copy from stack overflow
// XXX: Link for me later: http://stackoverflow.com/questions/21060945/simple-way-to-copy-a-file-in-golang
// CopyFile copies a file from src to dst. If src and dst files exist, and are
// the same, then return success. Otherise, attempt to create a hard link
// between the two files. If that fail, copy the file contents from src to dst.
func CopyFile(src, dst string) (err error) {
	sfi, err := os.Stat(src)
	if err != nil {
		return
	}
	if !sfi.Mode().IsRegular() {
		// cannot copy non-regular files (e.g., directories,
		// symlinks, devices, etc.)
		return fmt.Errorf("CopyFile: non-regular source file %s (%q)", sfi.Name(), sfi.Mode().String())
	}
	dfi, err := os.Stat(dst)
	if err != nil {
		if !os.IsNotExist(err) {
			return
		}
	} else {
		if !(dfi.Mode().IsRegular()) {
			return fmt.Errorf("CopyFile: non-regular destination file %s (%q)", dfi.Name(), dfi.Mode().String())
		}
		if os.SameFile(sfi, dfi) {
			return
		}
	}
	if err = os.Link(src, dst); err == nil {
		return
	}
	err = copyFileContents(src, dst)
	return
}

// copyFileContents copies the contents of the file named src to the file named
// by dst. The file will be created if it does not already exist. If the
// destination file exists, all it's contents will be replaced by the contents
// of the source file.
func copyFileContents(src, dst string) (err error) {
	in, err := os.Open(src)
	if err != nil {
		return
	}
	defer in.Close()
	out, err := os.Create(dst)
	if err != nil {
		return
	}
	defer func() {
		cerr := out.Close()
		if err == nil {
			err = cerr
		}
	}()
	if _, err = io.Copy(out, in); err != nil {
		return
	}
	err = out.Sync()
	return
}


text:
<link href="css/setlData.css" rel="stylesheet" type="text/css"/>

Datos Personales

    <input type="file" id="btnChangePhoto" class="chgPt">
    <form class="frmPersona" name="frmPersona" data-ajax="false">

            <input type="number" id="txtCed" class="text" name="ced" placeholder="Digite su cedula" onfocus="cambiar(this);" data-theme="a" required/>
            <input type="text" id="txtNomb" class="text" placeholder="Digite sus nombres" onblur="validar(this);" data-theme="a" required/>
            <input type="text" id="txtApell" class="text" placeholder="Digite sus apellidos" onblur="validar(this);" data-theme="a" required/>
            <input type="text" id="dttFecha" class="text" name="fecha" placeholder="Digite su fecha de nacimiento" onfocus="cambiar(this);" onblur="validar(this);" data-theme="a" required/>
            <select id="cbxSexo" class="cbx" required>
                <option value="" class="iconRight iconGuardar">Sexo</option>
                <option value="M">Masculino</option>
                <option value="F">Femenino</option>
            </select>

    </form>

        <button id="btnCancelar" class="btnCancelar btn">
            Cancelar

        </button>

        <button id="btnGuardar" class="btnGuardar btn">
            Guardar

        </button>


text:
layout: post
title: Example With Lots of Code
tags:
- Example-Post
---

Some code right in the middle `<img src="meme.gif">` of a sentence.

### Non-highlighted Code

	html {
	  font-family: $font-family-copy;
	  font-size: $font-size-mobile;
	  line-height: 1.5;
	  padding: 0;

	  @media (min-width: $break-point-mobile) {
	    font-size: $font-size-desktop;
	  }
	}

### Highlighted Code

{% highlight HTML %}

Career

Personal

Posts

Contact

{% endhighlight %}

### Add Some Line Numbers

{% highlight ruby linenos %}
def show
  @widget = Widget(params[:id])
  respond_to do |format|
    format.html # show.html.erb
    format.json { render json: @widget }
  end
end
{% endhighlight %}

### Embed It


text:
Tapestry.Messages = {

    pageIsLoading : "Please wait for the page to finish loading ...",

    missingInitializer : "Function Tapestry.Initializer.#{name}() does not exist.",

    missingValidator :      "Function Tapestry.Validator.#{name}() does not exist for field '#{fieldName}'.",

    ajaxFailure : "Ajax failure: Status #{status} for #{request.url}: ",

    ajaxRequestUnsuccessful : "Server request was unsuccessful. There may be a problem accessing the server.",

    clientException :     "Client exception processing response: ",

    missingZone :   "Unable to locate Ajax Zone '#{id}' for dynamic update.",

    noZoneManager :   "Element '#{id}' does not have an associated Tapestry.ZoneManager object." ,

    pathDoesNotStartWithSlash : "External path #{path} does not start with a leading slash.",

    notAnInteger : "Not an integer",

    invalidCharacter : "Invalid character",

    communicationFailed : "Communication with the server failed: "
};


text:
Run with:
```bash
node eg/accelerometer.js
```

```javascript
var five = require("johnny-five"),
    board, accel;

board = new five.Board();

board.on("ready", function() {

  // Create a new `Accelerometer` hardware instance.
  //
  // five.Accelerometer([ x, y[, z] ]);
  //
  // five.Accelerometer({
  //   pins: [ x, y[, z] ]
  //   freq: ms
  // });
  //

  accel = new five.Accelerometer({
    pins: [ "A3", "A4", "A5" ],
    freq: 100
  });

  // Accelerometer Event API

  // "acceleration"
  //
  // Fires once every N ms, equal to value of freg
  // Defaults to 500ms
  //
  accel.on("acceleration", function( err, timestamp ) {

    console.log( "acceleration", this.pitch, this.roll );
  });

  // "axischange"
  //
  // Fires only when X, Y or Z has changed
  //
  accel.on("axischange", function( err, timestamp ) {

    console.log( "axischange", this.raw );
  });
});

```

## Breadboard

<img src="https://raw.github.com/rwldrn/johnny-five/master/docs/breadboard/accelerometer.png">

[docs/breadboard/accelerometer.fzz](https://github.com/rwldrn/johnny-five/blob/master/docs/breadboard/accelerometer.fzz)

## Devices

## Documentation

_(Nothing yet)_

## Contributing
All contributions must adhere to the [Idiomatic.js Style Guide](https://github.com/rwldrn/idiomatic.js),
by maintaining the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [grunt](https://github.com/cowboy/grunt).

## Release History
_(Nothing yet)_

## License
Copyright (c) 2012 Rick Waldron <waldron.rick@gmail.com>
Licensed under the MIT license.


text:
import React, {Component} from 'react';

export default class ImageUploader extends Component {
  constructor() {
    super();
    this.state = {
      image: ""
    };
  }

  handleFileChange = () => {
    const file = this.refs._file.files[0];
    const reader = new FileReader();
    reader.onloadend = () => {
      this.setState({image: reader.result});
      this.props.onClick(this.state.image);
    }
    reader.readAsDataURL(file);
  }

  handleClick = () => {
    this.refs._file.click();
  }

  render() {
    return (

            Upload Image

      		<input className="hidden-input" type="file" ref="_file" onChange={this.handleFileChange}/>

    );
  }
}

ImageUploader.propTypes = {
	onClick: React.PropTypes.func
};


text:
from . import namespaces as ns, xsd

XSD_NAMESPACE = ns.xsd

class Enumeration(xsd.ComplexType):
    value = xsd.Attribute(xsd.String)

    @classmethod
    def create(cls, value):
        enum = Enumeration()
        enum.value = value
        return enum

class Pattern(xsd.ComplexType):
    NAMESPACE = ns.xsd
    value = xsd.Attribute(xsd.String)

class RestrictionValue(xsd.ComplexType):
    NAMESPACE = ns.xsd
    value = xsd.Attribute(xsd.String)

    def __repr__(self):
        return f'RestrictionValue<{self.value!r}>'

class Restriction(xsd.ComplexType):
    NAMESPACE = ns.xsd
    base = xsd.Attribute(xsd.String)
    enumerations = xsd.ListElement(Enumeration, 'enumeration')
    pattern = xsd.Element(Pattern)
    minInclusive = xsd.Element(RestrictionValue)
    minExclusive = xsd.Element(RestrictionValue)
    maxExclusive = xsd.Element(RestrictionValue)
    maxInclusive = xsd.Element(RestrictionValue)
    fractionDigits = xsd.Element(RestrictionValue)
    totalDigits = xsd.Element(RestrictionValue)

    length = xsd.Element(RestrictionValue)
    minLength = xsd.Element(RestrictionValue)
    maxLength = xsd.Element(RestrictionValue)
    whiteSpace = xsd.Element(RestrictionValue)

    def to_python(self):
        return '[%s]' % ', '.join(f"'{e.value}'" for e in self.enumerations)

class List(xsd.ComplexType):
    NAMESPACE = ns.xsd

class SimpleType(xsd.ComplexType):
    NAMESPACE = ns.xsd
    name = xsd.Attribute(xsd.String, use=xsd.Use.OPTIONAL)
    restriction = xsd.Element(Restriction, minOccurs=0)
    list = xsd.Element(List, minOccurs=0)

class Element(xsd.ComplexType):
    NAMESPACE = ns.xsd
    name = xsd.Attribute(xsd.String, use=xsd.Use.OPTIONAL)
    type = xsd.Attribute(xsd.String, use=xsd.Use.OPTIONAL)
    ref = xsd.Attribute(xsd.String, use=xsd.Use.OPTIONAL)
    minOccurs = xsd.Attribute(xsd.Integer, use=xsd.Use.OPTIONAL)
    maxOccurs = xsd.Attribute(xsd.MaxOccurs, use=xsd.Use.OPTIONAL)
    nillable = xsd.Attribute(xsd.Boolean, use=xsd.Use.OPTIONAL)
    substitutionGroup = xsd.Attribute(xsd.String, use=xsd.Use.OPTIONAL)  # FIXME: Should use xsd.List(xsd.QName)?
    simpleType = xsd.Element(SimpleType, minOccurs=0)
    complexType = xsd.Element('soapfish.xsdspec.XSDComplexType')

class Sequence(xsd.ComplexType):
    NAMESPACE = ns.xsd
    elements = xsd.ListElement(Element, 'element')

class Attribute(xsd.ComplexType):
    NAMESPACE = ns.xsd
    name = xsd.Attribute(xsd.String)
    ref = xsd.Attribute(xsd.String)
    type = xsd.Attribute(xsd.String)
    use = xsd.Attribute(xsd.String)
    simpleType = xsd.Element(SimpleType, minOccurs=0)

class AttributeGroup(xsd.ComplexType):
    NAMESPACE = ns.xsd
    name = xsd.Attribute(xsd.String)
    attributes = xsd.ListElement(Attribute, 'attribute')

class AttributeGroupReference(xsd.ComplexType):
    NAMESPACE = ns.xsd
    ref = xsd.Attribute(xsd.String)

    def to_python(self):
        from .utils import get_type
        typename = get_type(self.ref)
        data = {'name': typename.lower(), 'type': typename}
        return '''    %(name)s = xsd.Ref(%(type)s)\n''' % data

class Extension(xsd.ComplexType):
    NAMESPACE = ns.xsd
    base = xsd.Attribute(xsd.String)
    sequence = xsd.Element(Sequence)
    attributes = xsd.ListElement(Attribute, 'attribute')
    attributeGroups = xsd.ListElement(AttributeGroupReference, 'attributeGroup')

class ComplexContent(xsd.ComplexType):
    NAMESPACE = ns.xsd
    mixed = xsd.Attribute(xsd.Boolean)
    extension = xsd.Element(Extension)
    restriction = xsd.Element(Extension)

class XSDComplexType(xsd.ComplexType):
    NAMESPACE = ns.xsd
    name = xsd.Attribute(xsd.String, use=xsd.Use.OPTIONAL)
    sequence = xsd.Element(Sequence)
    choice = xsd.Element(Sequence)
    all = xsd.Element(Sequence)
    complexContent = xsd.Element(ComplexContent)
    attributes = xsd.ListElement(Attribute, 'attribute')
    attributeGroups = xsd.ListElement(AttributeGroupReference, 'attributeGroup')

class Group(xsd.ComplexType):
    NAMESPACE = ns.xsd
    name = xsd.Attribute(xsd.String)
    sequence = xsd.Element(Sequence)

class Import(xsd.ComplexType):
    schemaLocation = xsd.Attribute(xsd.String, use=xsd.Use.OPTIONAL)
    namespace = xsd.Attribute(xsd.String, use=xsd.Use.OPTIONAL)

class Include(xsd.ComplexType):
    schemaLocation = xsd.Attribute(xsd.String)

class Schema(xsd.ComplexType):
    NAMESPACE = ns.xsd
    targetNamespace = xsd.Attribute(xsd.String)
    elementFormDefault = xsd.Attribute(
        xsd.String(enumeration=['qualified', 'unqualified']),
        use=xsd.Use.OPTIONAL, default='unqualified',
    )
    imports = xsd.ListElement(Import, 'import')
    includes = xsd.ListElement(Include, 'include')
    simpleTypes = xsd.ListElement(SimpleType, 'simpleType')
    groups = xsd.ListElement(Group, 'group')
    attributeGroups = xsd.ListElement(AttributeGroup, 'attributeGroup')
    complexTypes = xsd.ListElement(XSDComplexType, 'complexType')
    elements = xsd.ListElement(Element, 'element')

    def get_element_by_name(self, name):
        # FIXME: Handle imported and included schemas.
        for element in self.elements:
            if name == element.name:
                return element
        return None

SCHEMA = xsd.Schema(
    targetNamespace=ns.xsd,
    elementFormDefault=xsd.ElementFormDefault.QUALIFIED,
    simpleTypes=[],
    attributeGroups=[],
    groups=[],
    complexTypes=[Enumeration, Pattern, RestrictionValue, Restriction, List,
                  SimpleType, Element, Sequence, Attribute, AttributeGroup,
                  AttributeGroupReference, Extension, ComplexContent,
                  XSDComplexType, Group, Schema],
    elements={},
)


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Lecidea stigmatea f. luxurians Vain.

### Remarks
null


text:
+++ mcs/tools/mono-configuration-crypto/lib/Mono.Configuration.Crypto/KeyContainerCollection.cs
@@ -32,7 +32,7 @@ namespace Mono.Configuration.Crypto
 			string topPath;

 			if (machineStore)
-				topPath = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.CommonApplicationData), ".mono");
+				topPath = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.CommonApplicationData), "mono");
 			else
 				topPath = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), ".mono");
 			topPath = Path.Combine (topPath, "keypairs");


text:
#include <aws/medialive/model/ScheduleActionStartSettings.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::Utils::Json;
using namespace Aws::Utils;

namespace Aws
{
namespace MediaLive
{
namespace Model
{

ScheduleActionStartSettings::ScheduleActionStartSettings() :
    m_fixedModeScheduleActionStartSettingsHasBeenSet(false),
    m_followModeScheduleActionStartSettingsHasBeenSet(false),
    m_immediateModeScheduleActionStartSettingsHasBeenSet(false)
{
}

ScheduleActionStartSettings::ScheduleActionStartSettings(JsonView jsonValue) :
    m_fixedModeScheduleActionStartSettingsHasBeenSet(false),
    m_followModeScheduleActionStartSettingsHasBeenSet(false),
    m_immediateModeScheduleActionStartSettingsHasBeenSet(false)
{
  *this = jsonValue;
}

ScheduleActionStartSettings& ScheduleActionStartSettings::operator =(JsonView jsonValue)
{
  if(jsonValue.ValueExists("fixedModeScheduleActionStartSettings"))
  {
    m_fixedModeScheduleActionStartSettings = jsonValue.GetObject("fixedModeScheduleActionStartSettings");

    m_fixedModeScheduleActionStartSettingsHasBeenSet = true;
  }

  if(jsonValue.ValueExists("followModeScheduleActionStartSettings"))
  {
    m_followModeScheduleActionStartSettings = jsonValue.GetObject("followModeScheduleActionStartSettings");

    m_followModeScheduleActionStartSettingsHasBeenSet = true;
  }

  if(jsonValue.ValueExists("immediateModeScheduleActionStartSettings"))
  {
    m_immediateModeScheduleActionStartSettings = jsonValue.GetObject("immediateModeScheduleActionStartSettings");

    m_immediateModeScheduleActionStartSettingsHasBeenSet = true;
  }

  return *this;
}

JsonValue ScheduleActionStartSettings::Jsonize() const
{
  JsonValue payload;

  if(m_fixedModeScheduleActionStartSettingsHasBeenSet)
  {
   payload.WithObject("fixedModeScheduleActionStartSettings", m_fixedModeScheduleActionStartSettings.Jsonize());

  }

  if(m_followModeScheduleActionStartSettingsHasBeenSet)
  {
   payload.WithObject("followModeScheduleActionStartSettings", m_followModeScheduleActionStartSettings.Jsonize());

  }

  if(m_immediateModeScheduleActionStartSettingsHasBeenSet)
  {
   payload.WithObject("immediateModeScheduleActionStartSettings", m_immediateModeScheduleActionStartSettings.Jsonize());

  }

  return payload;
}

} // namespace Model
} // namespace MediaLive
} // namespace Aws


text:
"""
Created on Tue Nov 16 18:22:41 2010

@author: kaifox
"""
from __future__ import absolute_import

from .conversions import tofl
from .conversions import tostr
from .service import JPyMadService


text:
CREATE FUNCTION ObjectMadeWithRelativePath
(
)
RETURNS datetime
AS
BEGIN

	return GetDate()

END
GO


text:
package org.craft.commands;

import java.util.*;

import com.google.common.collect.*;

public abstract class AbstractCommand
{

    public abstract boolean invoke(ICommandSender source, String argument, List<String> parents) throws CommandException;

    public List<String> getSuggestions(ICommandSender source, String arguments)
    {
        return Lists.newArrayList();
    }

    public boolean testPermission(ICommandSender source)
    {
        return true;
    }

    public String getShortCommandDescription()
    {
        return null;
    }

    public String getCommandHelp()
    {
        return null;
    }

    public String getUsage()
    {
        return getName();
    }

    public abstract String getName();

    public List<String> getPermissions()
    {
        return Lists.newArrayList();
    }

}


text:
<!DOCTYPE html>

You should see the word 'PASS' twice below:

      FAIL

PASS

PASS

      FAIL


text:
package roadgraph;

import geography.GeographicPoint;

/**
 * @author Ray Allan
 *
 * A class which represents a particular road edge
 * Each edge has a start and end point and may be reference be either
 *
 */
public class RoadEdge {
	private GeographicPoint fromPoint;
	private GeographicPoint toPoint;
	private String roadName;
	private String roadType;
	private double roadLength;

	public RoadEdge(GeographicPoint from, GeographicPoint to, String name,
			String type, double length) {
		fromPoint = from;
		toPoint = to;
		roadName = name;
		roadType = type;
		roadLength = length;
	}

	public GeographicPoint getFrom() {
		return fromPoint;
	}

	public GeographicPoint getTo() {
		return toPoint;
	}

	public String getRoadName() {
		return roadName;
	}

	public String getRoadType() {
		return roadType;
	}

	public double getRoadLength() {
		return roadLength;
	}

	public void setFrom(GeographicPoint from) {
		fromPoint = from;
	}

	public void setTo(GeographicPoint to) {
		toPoint = to;
	}

	public void setRoadName(String name) {
		roadName = name;
	}

	public void setRoadType(String type) {
		roadType = type;
	}

	public void setRoadLength(double length) {
		roadLength = length;
	}

}


text:
namespace spvtools {
namespace fuzz {

FuzzerPassAdjustSelectionControls::FuzzerPassAdjustSelectionControls(
    opt::IRContext* ir_context, TransformationContext* transformation_context,
    FuzzerContext* fuzzer_context,
    protobufs::TransformationSequence* transformations)
    : FuzzerPass(ir_context, transformation_context, fuzzer_context,
                 transformations) {}

FuzzerPassAdjustSelectionControls::~FuzzerPassAdjustSelectionControls() =
    default;

void FuzzerPassAdjustSelectionControls::Apply() {
  // Consider every merge instruction in the module (via looking through all
  // functions and blocks).
  for (auto& function : *GetIRContext()->module()) {
    for (auto& block : function) {
      if (auto merge_inst = block.GetMergeInst()) {
        // Ignore the instruction if it is not a selection merge.
        if (merge_inst->opcode() != SpvOpSelectionMerge) {
          continue;
        }

        // Choose randomly whether to change the selection control for this
        // instruction.
        if (!GetFuzzerContext()->ChoosePercentage(
                GetFuzzerContext()->GetChanceOfAdjustingSelectionControl())) {
          continue;
        }

        // The choices to change the selection control to are the set of valid
        // controls, minus the current control.
        std::vector<uint32_t> choices;
        for (auto control :
             {SpvSelectionControlMaskNone, SpvSelectionControlFlattenMask,
              SpvSelectionControlDontFlattenMask}) {
          if (control == merge_inst->GetSingleWordOperand(1)) {
            continue;
          }
          choices.push_back(control);
        }

        // Apply the transformation and add it to the output transformation
        // sequence.
        TransformationSetSelectionControl transformation(
            block.id(), choices[GetFuzzerContext()->RandomIndex(choices)]);
        ApplyTransformation(transformation);
      }
    }
  }
}

}  // namespace fuzz
}  // namespace spvtools


text:
var FluxConstant = require('flux-constant');

module.exports = FluxConstant.set([
  'SERVER_ACTION',
  'VIEW_ACTION'
]);


text:
import Chronous from '../Chronous';

describe('Chronous module interface', () => {
  it('public interface should be ok', () => {
    const httpIstance = new Chronous();
    ['post', 'get', 'head', 'patch', 'delete', 'request', 'put'].map((method) => {
      expect(httpIstance[method]).toBeDefined();
    });
  });
});

describe('Test new Chronous module', () => {
  let httpIstance;
  beforeEach(() => {
    httpIstance = new Chronous({
      baseURL: 'https://httpbin.org',
    });
  });

  afterEach(() => {
    httpIstance = null;
  });

  it('GET JSON with params in querystring', (done) => {
    httpIstance.get('/get', {
      responseType: 'json',
      params: { pippo: 1 },
    }).then((response) => {
      expect(response.data).toBeDefined();
      expect(response.data.args.pippo).toEqual('1');
      done();
    }).catch((reason) => {
      done.fail(reason);
    });
  });

  it('GET https://httpbin.org/html', (done) => {
    httpIstance.get('/get', {
      responseType: 'document',
    }).then((response) => {
      expect(response.data).toBeDefined();
      expect(typeof response.data).toEqual('object');
      done();
    }).catch((reason) => {
      done.fail(reason);
    });
  });

  it('POST https://httpbin.org/post', (done) => {
    httpIstance.post('/post', {
      responseType: 'json',
      dataType: 'formdata',
      data: { a: 1 },
    }).then((response) => {
      expect(response.data).toBeDefined();
      expect(typeof response.data).toEqual('object');
      expect(response.data.form.a).toEqual('1');
      done();
    }).catch((reason) => {
      done.fail(reason);
    });
  });

  it('GET /basic-auth/:user/:passwd ', (done) => {
    let user = 'pasquale';
    let secret = 'ssssh.it\'ssecret';

    httpIstance.get(`/basic-auth/${user}/${secret}`, {
      auth: { user: user, password: secret }
    }).then((response) => {

      expect(response.status).toEqual(200);
      expect(response.statusText).toEqual('OK');
      done();

    }).catch((reason) => {
      done.fail(reason);
    });
  });

  it('GET /basic-auth/:user/:passwd with auth set in instance', (done) => {
    let user = 'pasquale';
    let secret = 'ssssh.it\'ssecret';

    httpIstance = new Chronous({ baseURL: 'https://httpbin.org', config:{ auth: { user: user, password: secret } } });

    httpIstance.get(`/basic-auth/${user}/${secret}`)
    .then((response) => {
      expect(response.status).toEqual(200);
      expect(response.statusText).toEqual('OK');
      done();
    }).catch((reason) => {
      done.fail(reason);
    });
  });

  it('normalize url should return absolute url', () => {
    // first result
    const result = httpIstance.normalizeURL('/get');
    expect(result).toBeDefined();
    expect(result).toEqual('https://httpbin.org/get');
    const result2 = httpIstance.normalizeURL('https://www.mydomain.com/get');
    expect(result2).toEqual('https://www.mydomain.com/get');
  });

  it('GET bytes. onProgress should be called', (done) => {
    const obj = {
      ownProgress: (percentage) => {
        return percentage;
      },
    };

    spyOn(obj, 'ownProgress');
    expect(obj.ownProgress.calls.count()).toEqual(0);

    httpIstance.get('/bytes/5000', { onProgress: obj.ownProgress }).then((response) => {
      expect(response).toBeDefined();
      expect(obj.ownProgress.calls.count()).not.toEqual(0);
      expect(obj.ownProgress).toHaveBeenCalledWith(100);
      done();
    }).catch((reason) => {
      done.fail(reason);
    });
  });

  it('PATCH https://httpbin.org/patch', (done) => {
    httpIstance.patch('/patch', {
      responseType: 'json',
      dataType: 'formdata',
      data: { a: 1 },
    }).then((response) => {
      expect(response.data).toBeDefined();
      expect(response.data.json).toEqual(null);
      expect(response.data.form.a).toBeDefined();
      expect(response.data.form.a).toEqual('1');
      expect(response.status).toEqual(200);
      expect(response.statusText).toEqual('OK');
      done();
    }).catch(reason => done.fail(reason));
  });

  it('PUT https://httpbin.org/put', (done) => {
    httpIstance.put('/put', { responseType: 'json', dataType: 'json', data: { b: 2 } }).then((response) => {
      expect(response.data).toBeDefined();
      expect(typeof response.data.json).toEqual('object');
      done();
    });
  });

  it('DELETE https://httpbin.org/delete', (done) => {
    httpIstance.delete('/delete', { responseType: 'json', dataType: 'json', data: { b: 4 } }).then((response) => {
      expect(response.data).toBeDefined();
      expect(response.status).toEqual(200);
      expect(response.data.json).toEqual({ b: 4 });
      done();
    });
  });
});


text:
using System;
using System.IO;
using System.Reflection;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Linq;

using MetaIS.SaaS.Plugins;

namespace MetaIS_Test
{
    public partial class frmTest : Form
    {
        PluginSystem pluginSystem = null;
        const string testFilesSubPath = @"/Test/SaaS/Plugins/Files/";
        const string runnerNameSpace = @"MetaIS.SaaS.Plugins.PluginRunner";
        const string pluginsSubDir = @"Plugins";
        string[] coreRefs = new string[] {"System.dll", "System.Drawing.dll", "MetaIS.SaaS.Plugins.dll"};

        public frmTest()
        {
            InitializeComponent();
            //this.WindowState = FormWindowState.Maximized;
        }

        private void frmTest_Load(object sender, EventArgs e)
        {
            // This quick fixes some control sizing issues
            this.Width = 1000;
            this.Height = 700;
            this.Left = 50;
            this.Top = 50;
            this.splitContainer1.SplitterDistance = this.tabControl1.Width / 4;
            this.splitContainer2.SplitterDistance = this.Height / 2;
            this.tabControl1.SelectedTab = tpPluginSystem;
            InitSystem();

            if(lbDomains.Items.Count > 0) {
                lbDomains.SelectedIndex = 1;
                lbDomainPlugins.SelectedIndex = 2;
                lbClasses.SelectedIndex = 0;
                tbParams.Text = "7";
                btnRunMethod.BackColor = System.Drawing.Color.Yellow;
            } else {
                tbLog.Text = "*** FAILED TO LOAD EXAMPLE ***";
            }
        }

        #region " InitSystem "

        protected void InitSystem()
        {
            string baseDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + @"/";   // path to bin
            string subDir = pluginsSubDir;
            //srcDir = @"PluginSource";
            string dllRoot = baseDir + subDir + @"/";

            pluginSystem = new PluginSystem("MyDefaultDomain", baseDir, subDir, runnerNameSpace);
            pluginSystem.LogNotify += PluginSystem_LogNotify;

            List<Plugin> pluginSet = LoadPluginsFromSource(dllRoot);

            // Load plugins into example Domain(s)
            if(pluginSet!=null && pluginSet.Count == 3) {
                pluginSystem.PluginDomainLoad("AppDomain1", new List<string>() { pluginSet[0].PluginID, pluginSet[1].PluginID, pluginSet[2].PluginID});
                pluginSystem.PluginDomainLoad("AppDomain2", new List<string>() { pluginSet[0].PluginID, pluginSet[1].PluginID});
                pluginSystem.PluginDomainLoad("AppDomain3", new List<string>() { pluginSet[0].PluginID});
                UpdateDomainSet();
            }
        }

        private void PluginSystem_LogNotify(string message) {
            LogWrite(message);
        }

        protected void LogWrite(string message)
        {
            tbLog.Text = message + Environment.NewLine + tbLog.Text;
        }
        #endregion

        #region " LoadPluginsFromSource "

        protected List<Plugin> LoadPluginsFromSource(string dllRoot) {
            string binFolderPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            string fullPath = binFolderPath + testFilesSubPath;
            List<Plugin> pluginSetSorted = null;

            if(!System.IO.Directory.Exists(fullPath)) {
                System.Console.WriteLine("File path not found: " + fullPath);
            } else {
                string[] fileSet = System.IO.Directory.GetFiles(fullPath);
                List<Plugin> pluginSet = new List<Plugin>();
                lbPlugins.Items.Clear();
                foreach(string file in fileSet) {
                    Plugin plugin = CreatePlugin(file, binFolderPath, dllRoot);
                    if(plugin!=null) {
                        pluginSet.Add(plugin);
                        lbPlugins.Items.Add(plugin);
                    }
                }

                // compile order matters -- a production solution should determine order based on the web of references
                pluginSetSorted = pluginSet.OrderBy(o=>o.CompileOrder).ToList();
                pluginSystem.PluginSystemLoad(pluginSetSorted);
            }
            return pluginSetSorted;
        }

        protected Plugin CreatePlugin(string srcFilePath, string coreBinDir, string pluginDir)
        {
            // This is a quick and dirty reader to get some plugin settings
            //      definetly NOT recommend for production
            //      it expects this EXACT structure at the top of the file
                        // START PLUGIN SETTINGS
                        // PluginLibraryName = _CodeMirror.dll
                        // PluginReferences  =
                        // END PLUGIN SETTINGS

            string code = System.IO.File.ReadAllText(srcFilePath);
            string[] lines = code.Split('\n');
            string pluginLibName = "";
            List<string> pluginRefs = new List<string>();
            Int32 compileOrder = 0;

            bool watchOn = false;
            foreach(string line in lines) {
                if(line.StartsWith("// START PLUGIN SETTINGS")) {
                    watchOn = true;
                } else if(line.StartsWith("// END PLUGIN SETTINGS")) {
                    break;
                } else if(watchOn) {
                    if(line.StartsWith("// PluginLibraryName")) {
                        string[] parts = line.Split('=');
                        pluginLibName = parts[1].Trim();
                    } else if(line.StartsWith("// PluginReferences")) {
                        string[] parts = line.Split('=');
                        string[] refs = parts[1].Split(',');
                        foreach(string plugRef in refs) {
                            if(plugRef.Trim() != "")
                                pluginRefs.Add(plugRef.Trim());
                        }
                    } else if(line.StartsWith("// CompileOrder")) {
                        string[] parts = line.Split('=');
                        Int32.TryParse(parts[1].Trim(), out compileOrder);
                    }
                }
            }

            return HelperPlugin.CreatePlugin(pluginLibName, coreBinDir, pluginDir, new string[] {code}, "", coreRefs, pluginRefs.ToArray(), compileOrder);
        }

        #endregion

        #region " Source Code "

        private void lbFileNames_SelectedIndexChanged(object sender, EventArgs e)
        {
            if(lbPlugins.SelectedIndex == -1) {
                tbSourceCode.Text = "";
            } else {
                Plugin plugin = (Plugin)lbPlugins.SelectedItem;
                tbSourceCode.Text = plugin.Code[0];
            }
        }

        private void tbSourceCode_TextChanged(object sender, EventArgs e)
        {
            if(lbPlugins.SelectedIndex != -1) {
                Plugin plugin = (Plugin)lbPlugins.SelectedItem;
                plugin.IsCompiled = false;
                plugin.Code = new string[] {tbSourceCode.Text};
            }
        }

        private void btnRecompileCode_Click(object sender, EventArgs e)
        {
            if(lbPlugins.SelectedIndex != -1) {
                // Recompile just this plugin
                tbLog.Text = "";
                Plugin plugin = (Plugin)lbPlugins.SelectedItem;

                List<string> pluginSet = new List<string>() {plugin.PluginID};
                pluginSystem.SystemUpdate(pluginSet);
                UpdateDomainSet();
            }
        }

        #endregion

        #region " Plugin System "

        private void btnCompileAll_Click_1(object sender, EventArgs e)
        {
            // Recompile all plugins
            tbLog.Text = "";
            List<string> pluginSet = new List<string>();
            foreach(Plugin plugin in lbPlugins.Items) {
                pluginSet.Add(plugin.PluginID);
            }
            pluginSystem.SystemUpdate(pluginSet);
            UpdateDomainSet();
        }

        private void btnSystemReload_Click(object sender, EventArgs e)
        {
            // Unload / Reload ALL domains
            tbLog.Text = "";
            pluginSystem.SystemReload();
        }

        protected void UpdateDomainSet()
        {
            lbDomains.Items.Clear();
            lbDomainPlugins.Items.Clear();
            lbAssemblies.Items.Clear();
            lbClasses.Items.Clear();
            lbMethodParams.Items.Clear();
            foreach(string domainName in pluginSystem.DomainSet.Keys) {
                lbDomains.Items.Add(pluginSystem.DomainSet[domainName]);
            }
        }

        protected void UpdateDomainPluginSet()
        {
            // Get a list of Plugins
            lbDomainPlugins.Items.Clear();
            if(lbDomains.SelectedIndex != -1) {
                PluginDomain domain = (PluginDomain)lbDomains.SelectedItem;
                foreach(PluginReference pluginRef in domain.PluginReferenceSet.Values) {
                    lbDomainPlugins.Items.Add(pluginRef);
                }
            }

            // Get a list of running assemblies
            lbAssemblies.Items.Clear();
            if(lbDomains.SelectedIndex != -1) {
                PluginDomain domain = (PluginDomain)lbDomains.SelectedItem;
                List<string> asmSet = domain.GetDomainAssemblies();
                foreach(string asm in asmSet) {
                    lbAssemblies.Items.Add(asm);
                }
            }
        }

        private void lbDomains_SelectedIndexChanged(object sender, EventArgs e)
        {
            UpdateDomainPluginSet();
            lbClasses.Items.Clear();
            lbMethodParams.Items.Clear();
        }

        private void lbDomainPlugins_SelectedIndexChanged(object sender, EventArgs e)
        {
            // reflection on this plugin
            lbClasses.Items.Clear();
            lbMethodParams.Items.Clear();
            if(lbDomains.SelectedIndex != -1) {
                PluginReference pluginRef = (PluginReference)lbDomainPlugins.SelectedItem;

                List<string> typeSet = pluginRef.GetTypes();
                if(typeSet != null) {
                    foreach(string tp in typeSet) {
                        //lbClasses.Items.Add(tp);

                        List<string> methodSet = pluginRef.GetTypeMethods(tp);
                        foreach(string method in methodSet) {
                            lbClasses.Items.Add(tp + "." + method);
                        }

                        //Type oTp = Type.GetType(tp);
                        //MethodInfo[] methodInfos = Type.GetType(tp).GetMethods(BindingFlags.Public | BindingFlags.Instance);
                        //foreach(MethodInfo method in methodInfos) {
                        //}
                        //string a = "";
                    }

                }
            }
        }

        private void lbClasses_SelectedIndexChanged(object sender, EventArgs e)
        {
            lbMethodParams.Items.Clear();
            if(lbClasses.SelectedIndex != -1) {
                PluginReference pluginRef = (PluginReference)lbDomainPlugins.SelectedItem;
                string classMethodPath = (string)lbClasses.SelectedItem;
                string methodName = "";
                string classPath = "";
                GetClassMethodParts(classMethodPath, ref classPath, ref methodName);

                List<string> paramSet = pluginRef.GetTypeMethodParams(classPath, methodName);
                foreach(string param in paramSet) {
                    lbMethodParams.Items.Add(param);
                }
            }
        }

        private void btnRunMethod_Click(object sender, EventArgs e)
        {
            tbLog.Text = "";

            btnRunMethod.BackColor = tpPluginSystem.BackColor;
            if(lbClasses.SelectedIndex != -1) {
                PluginDomain domain = (PluginDomain)lbDomains.SelectedItem;
                PluginReference pluginRef = (PluginReference)lbDomainPlugins.SelectedItem;
                string classMethodPath = (string)lbClasses.SelectedItem;
                string methodName = "";
                string classPath = "";
                GetClassMethodParts(classMethodPath, ref classPath, ref methodName);

                // Build the argument objects
                List<string> paramSet = pluginRef.GetTypeMethodParams(classPath, methodName);
                string[] paramValues = tbParams.Text.Split(',');
                List<object> args = new List<object>();
                bool isOK = true;

                if(paramSet.Count-1 != paramValues.Length) {
                    LogWrite("Run Result: ERROR");
                } else {
                    try {
                        for(int ix=1; ix<paramSet.Count; ix++) {
                            string dataType = paramSet[ix].Split(':')[0];
                            string dataValue = paramValues[ix-1];
                            if(dataType=="System.Int32") {
                                Int32 i32Value = Int32.Parse(dataValue);
                                args.Add(i32Value);
                            } else if(dataType=="System.Int64") {
                                args.Add(Int64.Parse(dataValue));
                            } else if(dataType=="System.String") {
                                args.Add(dataValue);
                            } else {
                                LogWrite("Run type not supported: " + dataType);
                                isOK = false;
                            }
                        }
                        if(isOK) {
                            object objA = pluginSystem.InvokeMethod(domain.InstanceDomainName,
                                pluginRef.Plugin.PluginID,
                                classPath, methodName, args.ToArray<object>());

                            LogWrite("Run Result: " + HelperPlugin.ObjectToString(objA));
                        }

                    } catch {
                        LogWrite("Run Result: ERROR");
                    }
                }
            }
        }

        protected void GetClassMethodParts(string classMethodPath, ref string classPath, ref string methodName)
        {
            string[] parts = classMethodPath.Split('.');
            methodName = parts[parts.Length-1];

            parts[parts.Length-1] = "";
            foreach(string part in parts) {
                if(part != "") {
                    classPath = (classPath == "" ? part : classPath + "." + part);
                }
            }
        }

        #endregion

    }
}


text:
"""Loader for Python files."""

from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals

from ..core import config
from . import base

class PythonFile(base.ConfigurationFile):

    """Configuration file parser for Python files.

    Unlike static format configuration files, Python files are expected to
    generate side-effects by interacting in some way with the Configuration
    singleton.
    """

    def __init__(self, *args, **kwargs):
        super(PythonFile, self).__init__(*args, **kwargs)
        self._parsed = None

    @property
    def parsed(self):
        """Get the code object which represents the compiled Python file.

        This property is cached and only parses the content once.
        """
        if not self._parsed:

            self._parsed = compile(self.content, self.path, "exec")

        return self._parsed

    @property
    def config(self):
        """Get a Configuration object from the file contents."""
        exec(self.parsed, {}, None)
        return config.Configuration()

    @property
    def namespaces(self):
        """Get an empty iterable.

        An iterable of namespaces cannot be generated from Python files.
        """
        return ()

    def items(self, namespace):
        """Get an empty iterable.

        An iterable of items cannot be generated from Python files.
        """
        return ()


text:
//
//  GTLAdSenseAdClient.h
//

// ----------------------------------------------------------------------------
// NOTE: This file is generated from Google APIs Discovery Service.
// Service:
//   AdSense Management API (adsense/v1.2)
// Description:
//   Gives AdSense publishers access to their inventory and the ability to
//   generate reports
// Documentation:
//   https://developers.google.com/adsense/management/
// Classes:
//   GTLAdSenseAdClient (0 custom class methods, 5 custom properties)

#if GTL_BUILT_AS_FRAMEWORK
  #import "GTL/GTLObject.h"
#else
  #import "GTLObject.h"
#endif

// ----------------------------------------------------------------------------
//
//   GTLAdSenseAdClient
//

@interface GTLAdSenseAdClient : GTLObject

// Whether this ad client is opted in to ARC.
@property (retain) NSNumber *arcOptIn;  // boolValue

// Unique identifier of this ad client.
// identifier property maps to 'id' in JSON (to avoid Objective C's 'id').
@property (copy) NSString *identifier;

// Kind of resource this is, in this case adsense#adClient.
@property (copy) NSString *kind;

// This ad client's product code, which corresponds to the PRODUCT_CODE report
// dimension.
@property (copy) NSString *productCode;

// Whether this ad client supports being reported on.
@property (retain) NSNumber *supportsReporting;  // boolValue

@end


text:
/**
 * @author sliva
 */
package compiler.phases.seman;

import compiler.common.report.*;
import compiler.data.abstree.*;
import compiler.data.abstree.visitor.*;

/**
 * Name resolving: the result is stored in {@link SemAn#declaredAt}.
 *
 * @author sliva
 */
public class TypeNameDeclaration<Result, Arg> extends NameResolver<Result, Arg> {

    @Override
    public Result visit(AbsBlockExpr blockExpr, Arg visArg) {
        // System.out.println("TypeNameDeclaration new scope currDepth: " +
        // symbTable.currDepth());
        symbTable.newScope();
        super.visit(blockExpr, visArg);
        blockExpr.decls.accept(new TypeNameResolution(), null);
        blockExpr.decls.accept(new VarNameDeclaration(), null);
        blockExpr.stmts.accept(new TypeNameResolution(), null);
        blockExpr.stmts.accept(new VarNameDeclaration(), null);
        blockExpr.expr.accept(new TypeNameResolution(), null);
        blockExpr.expr.accept(new VarNameDeclaration(), null);
        symbTable.oldScope();
        // System.out.println("TypeNameDeclaration old scope currDepth: " +
        // symbTable.currDepth());
        return null;
    }

}


text:
<?php

// This line loads the library
require '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

// Find your Account Sid and Token at twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

// Initialize the client
$client = new Client($sid, $token);

// Retrieve the services
$services = $client->chat->services->read();

foreach ($services as $service) {
    echo $service->friendlyName . PHP_EOL;
}


text:
package org.Hash.Table;

/**
 * Created by rajeevgurram on 6/5/16.
 */
public interface HashTable {
    void put(String key, int value);
    int get(String key);
    int getSize();
    void remove(String key);
    void iterate();
    void getKeys();
}


text:
<?php
/* ====================
[BEGIN_COT_EXT]
Hooks=admin.structure.first
[END_COT_EXT]
==================== */

/**
 * Page extension
 *
 * @package page
 * @version 0.9.0
 * @author Feliz Team
 * @copyright Copyright (c) Feliz Team 2008-2014
 * @license BSD
 */

defined('COT_CODE') or die('Wrong URL');

$extension_structure[] = 'page';


text:
package org.apache.jena.engine;

import org.apache.jena.engine.join.HashJoin ;
import org.apache.jena.engine.join.RowOrder ;
import org.apache.jena.engine.row.RowBuilderBase ;

/** Tests hash join where the right is streaming */
public class TestHashJoinStream extends AbstractTestJoin1 {

    @Override
    public <X> RowList<X> join(JoinKey joinKey , RowList<X> left , RowList<X> right , RowOrder<X> comparator ) {
        return HashJoin.hashJoin(joinKey, left, right, new RowBuilderBase<X>()) ;
    }

}


text:
package org.apache.hadoop.hbase.replication;

import java.io.Closeable;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.Abortable;
import org.apache.hadoop.hbase.DeserializationException;
import org.apache.hadoop.hbase.ServerName;
import org.apache.hadoop.hbase.zookeeper.ZKUtil;
import org.apache.hadoop.hbase.zookeeper.ZooKeeperNodeTracker;
import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
import org.apache.zookeeper.KeeperException;

/**
 * This class acts as a wrapper for all the objects used to identify and
 * communicate with remote peers and is responsible for answering to expired
 * sessions and re-establishing the ZK connections.
 */
@InterfaceAudience.Private
public class ReplicationPeer implements Abortable, Closeable {
  private static final Log LOG = LogFactory.getLog(ReplicationPeer.class);

  private final String clusterKey;
  private final String id;
  private List<ServerName> regionServers = new ArrayList<ServerName>(0);
  private final AtomicBoolean peerEnabled = new AtomicBoolean();
  // Cannot be final since a new object needs to be recreated when session fails
  private ZooKeeperWatcher zkw;
  private final Configuration conf;

  private PeerStateTracker peerStateTracker;

  /**
   * Constructor that takes all the objects required to communicate with the
   * specified peer, except for the region server addresses.
   * @param conf configuration object to this peer
   * @param key cluster key used to locate the peer
   * @param id string representation of this peer's identifier
   */
  public ReplicationPeer(Configuration conf, String key,
      String id) throws IOException {
    this.conf = conf;
    this.clusterKey = key;
    this.id = id;
    this.reloadZkWatcher();
  }

  /**
   * start a state tracker to check whether this peer is enabled or not
   *
   * @param zookeeper zk watcher for the local cluster
   * @param peerStateNode path to zk node which stores peer state
   * @throws KeeperException
   */
  public void startStateTracker(ZooKeeperWatcher zookeeper, String peerStateNode)
      throws KeeperException {
    ReplicationZookeeper.ensurePeerEnabled(zookeeper, peerStateNode);
    this.peerStateTracker = new PeerStateTracker(peerStateNode, zookeeper, this);
    this.peerStateTracker.start();
    try {
      this.readPeerStateZnode();
    } catch (DeserializationException e) {
      throw ZKUtil.convert(e);
    }
  }

  private void readPeerStateZnode() throws DeserializationException {
    this.peerEnabled.set(ReplicationZookeeper.isPeerEnabled(this.peerStateTracker.getData(false)));
  }

  /**
   * Get the cluster key of that peer
   * @return string consisting of zk ensemble addresses, client port
   * and root znode
   */
  public String getClusterKey() {
    return clusterKey;
  }

  /**
   * Get the state of this peer
   * @return atomic boolean that holds the status
   */
  public AtomicBoolean getPeerEnabled() {
    return peerEnabled;
  }

  /**
   * Get a list of all the addresses of all the region servers
   * for this peer cluster
   * @return list of addresses
   */
  public List<ServerName> getRegionServers() {
    return regionServers;
  }

  /**
   * Set the list of region servers for that peer
   * @param regionServers list of addresses for the region servers
   */
  public void setRegionServers(List<ServerName> regionServers) {
    this.regionServers = regionServers;
  }

  /**
   * Get the ZK connection to this peer
   * @return zk connection
   */
  public ZooKeeperWatcher getZkw() {
    return zkw;
  }

  /**
   * Get the identifier of this peer
   * @return string representation of the id (short)
   */
  public String getId() {
    return id;
  }

  /**
   * Get the configuration object required to communicate with this peer
   * @return configuration object
   */
  public Configuration getConfiguration() {
    return conf;
  }

  @Override
  public void abort(String why, Throwable e) {
    LOG.warn("The ReplicationPeer coresponding to peer " + clusterKey
        + " was aborted for the following reason(s):" + why, e);
  }

  /**
   * Closes the current ZKW (if not null) and creates a new one
   * @throws IOException If anything goes wrong connecting
   */
  public void reloadZkWatcher() throws IOException {
    if (zkw != null) zkw.close();
    zkw = new ZooKeeperWatcher(conf,
        "connection to cluster: " + id, this);
  }

  @Override
  public boolean isAborted() {
    // Currently the replication peer is never "Aborted", we just log when the
    // abort method is called.
    return false;
  }

  @Override
  public void close() throws IOException {
    if (zkw != null){
      zkw.close();
    }
  }

  /**
   * Tracker for state of this peer
   */
  public class PeerStateTracker extends ZooKeeperNodeTracker {

    public PeerStateTracker(String peerStateZNode, ZooKeeperWatcher watcher,
        Abortable abortable) {
      super(watcher, peerStateZNode, abortable);
    }

    @Override
    public synchronized void nodeDataChanged(String path) {
      if (path.equals(node)) {
        super.nodeDataChanged(path);
        try {
          readPeerStateZnode();
        } catch (DeserializationException e) {
          LOG.warn("Failed deserializing the content of " + path, e);
        }
      }
    }
  }
}