text:
package main

import (
	"fmt"
	"image"
	_ "image/gif"
	_ "image/jpeg"
	_ "image/png"
	"os"

	"hawx.me/code/hadfield"
	"hawx.me/code/img-filtr/recipes"
	"hawx.me/code/img/utils"
)

func runBrdl(cmd *hadfield.Command, args []string) {
	img, data := utils.ReadStdin()
	img = recipes.Brdl(img)
	utils.WriteStdout(img, data)
}

func runDazd(cmd *hadfield.Command, args []string) {
	img, data := utils.ReadStdin()
	img = recipes.Dazd(img)
	utils.WriteStdout(img, data)
}

func runDthr(cmd *hadfield.Command, args []string) {
	img, data := utils.ReadStdin()
	img = recipes.Dthr(img)
	utils.WriteStdout(img, data)
}

func runEdwn(cmd *hadfield.Command, args []string) {
	img, data := utils.ReadStdin()
	img = recipes.Edwn(img)
	utils.WriteStdout(img, data)
}

func runHeathr(cmd *hadfield.Command, args []string) {
	img, data := utils.ReadStdin()
	if len(args) < 1 {
		utils.Warn("Need an<other> image to compose with!")
		os.Exit(2)
	}

	file, err := os.Open(args[0])
	if err != nil {
		utils.Warn("Problem opening", args[0])
		os.Exit(2)
	}

	other, _, err := image.Decode(file)
	if err != nil {
		utils.Warn("Could not decode image, must be jpeg/png/gif.")
		os.Exit(2)
	}

	img = recipes.Heathr(img, other)
	utils.WriteStdout(img, data)
}

func runPostcrd(cmd *hadfield.Command, args []string) {
	img, data := utils.ReadStdin()
	img = recipes.Postcrd(img)
	utils.WriteStdout(img, data)
}

func runPostr(cmd *hadfield.Command, args []string) {
	img, data := utils.ReadStdin()
	img = recipes.Postr(img)
	utils.WriteStdout(img, data)
}

func runRockstr(cmd *hadfield.Command, args []string) {
	img, data := utils.ReadStdin()
	img = recipes.Rockstr(img)
	utils.WriteStdout(img, data)
}

var commands = hadfield.Commands{
	&hadfield.Command{
		Run:   runBrdl,
		Usage: "brdl",
		Short: "the smallest possible transmittable unit",
		Long: `
  Repaints the image with a random dominant colour.
`,
	},
	&hadfield.Command{
		Run:   runDazd,
		Usage: "dazd",
		Short: "blown out",
		Long: `
  Lightens, saturates and increases the contrast.
`,
	},
	&hadfield.Command{
		Run:   runDthr,
		Usage: "dthr",
		Short: "dithered",
		Long: `
  Turns the image into a dithered pattern of white and black pixels.
`,
	},
	&hadfield.Command{
		Run:   runEdwn,
		Usage: "edwn",
		Short: "polaroid",
		Long: `
  Cuts the photo into a square and sticks it onto a simplistic polaroid background.
`,
	},
	&hadfield.Command{
		Run:   runHeathr,
		Usage: "heathr <other>",
		Short: "polaroids, side-by-side",
		Long: `
  Cuts the photos into squares and sticks them onto simple polaroid-esque backings.
`,
	},
	&hadfield.Command{
		Run:   runPostcrd,
		Usage: "postcrd",
		Short: "saturated",
		Long: `
  Saturates, lightens and blurs the image.
`,
	},
	&hadfield.Command{
		Run:   runPostr,
		Usage: "postr",
		Short: "dark and saturated",
		Long: `
  Like a darker, subtler version of postcrd.
`,
	},
	&hadfield.Command{
		Run:   runRockstr,
		Usage: "rockstr",
		Short: "etched",
		Long: `
  Almost etches the image onto the screen in pencil.
`,
	},
}

var templates = hadfield.Templates{
	Help: `Usage: img filtr [command] [arguments]

  An implementation of straup/filtr as a single executable.

  Commands: {{range .}}
    {{.Name | printf "%-15s"}} # {{.Short}}{{end}}

`,
	Command: `Usage: img filtr {{.Usage}}
{{.Long}}
`,
}

const (
	USAGE = "filtr [command] [options]"
	SHORT = "reimplementation of straup/filtr"
)

var longTemplate hadfield.Template = `  A reimplementation of straup/filter using img.

  Commands: {{range .}}
    {{.Name | printf "%-15s"}} # {{.Short}}{{end}}
`

func main() {
	os.Args = utils.GetOutput(os.Args)
	args := os.Args

	if len(args) == 2 {
		switch args[1] {
		case "--long":
			longTemplate.Render(os.Stdout, commands.Data())
			return
		case "--short":
			fmt.Println(SHORT)
			return
		case "--usage":
			fmt.Println(USAGE)
			return
		}
	}

	hadfield.Run(commands, templates)
}

redpajama_set_name: RedPajamaGithub


text:
package org.apache.sling.settings.impl;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;
import java.util.Dictionary;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import org.apache.sling.settings.SlingSettingsService;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.osgi.framework.BundleListener;
import org.osgi.framework.Filter;
import org.osgi.framework.FrameworkListener;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceFactory;
import org.osgi.framework.ServiceListener;
import org.osgi.framework.ServiceObjects;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;

public class RunModeImplTest {

    private void assertParse(String str, String [] expected) {
        final SlingSettingsService rm = new SlingSettingsServiceImpl(new BundleContextMock(str, null, null));
        final Set<String> modes = rm.getRunModes();

        Set<String> expectedSet = new HashSet<String>(expected.length);
        for (String expectedEntry : expected) {
            expectedSet.add(expectedEntry);
        }

        assertThat("Parsed runModes match for '" + str + "'", modes, equalTo(expectedSet));
    }

    @org.junit.Test public void testParseRunModes() {
        assertParse(null, new String[0]);
        assertParse("", new String[0]);
        assertParse(" foo \t", new String[] { "foo" });
        assertParse(" foo \t,  bar\n", new String[] { "foo", "bar" });
    }

    private void assertActive(SlingSettingsService s, boolean active, String ...modes) {
        for(String mode : modes) {
            if(active) {
                assertTrue(mode + " should be active", s.getRunModes().contains(mode));
            } else {
                assertFalse(mode + " should NOT be active", s.getRunModes().contains(mode));
            }
        }
    }

    @org.junit.Test public void testMatchesNotEmpty() {
        final SlingSettingsService rm = new SlingSettingsServiceImpl(new BundleContextMock("foo,bar", null, null));
        assertActive(rm, true, "foo", "bar");
        assertActive(rm, false, "wiz", "bah", "");
    }

    @org.junit.Test public void testOptions() {
        final SlingSettingsService rm = new SlingSettingsServiceImpl(new BundleContextMock("foo,bar", "a,b,c|d,e,f", null));
        assertActive(rm, true, "foo", "bar", "a", "d");
        assertActive(rm, false, "b", "c", "e", "f");
    }

    @org.junit.Test public void testEmptyRunModesWithOptions() {
        final SlingSettingsService rm = new SlingSettingsServiceImpl(new BundleContextMock("", "a,b,c|d,e,f", null));
        assertActive(rm, true, "a", "d");
        assertActive(rm, false, "b", "c", "e", "f");
    }

    @org.junit.Test public void testOptionsSelected() {
        final SlingSettingsService rm = new SlingSettingsServiceImpl(new BundleContextMock("foo,bar,c,e", "a,b,c|d,e,f", null));
        assertActive(rm, true, "foo", "bar", "c", "e");
        assertActive(rm, false, "a", "b", "d", "f");
    }

    @org.junit.Test public void testOptionsMultipleSelected() {
        final SlingSettingsService rm = new SlingSettingsServiceImpl(new BundleContextMock("foo,bar,c,e,f,a", "a,b,c|d,e,f", null));
        assertActive(rm, true, "foo", "bar", "a", "e");
        assertActive(rm, false, "b", "c", "d", "f");
    }

    @org.junit.Test public void testOptionsMultipleSelected2() {
        final SlingSettingsService rm = new SlingSettingsServiceImpl(new BundleContextMock("foo,bar,c,f,a,d", "a,b,c|d,e,f", null));
        assertActive(rm, true, "foo", "bar", "a", "d");
        assertActive(rm, false, "b", "c", "e", "f");
    }

    @org.junit.Test public void testInstallOptions() {
        final SlingSettingsService rm = new SlingSettingsServiceImpl(new BundleContextMock("foo,bar", null, "a,b,c|d,e,f"));
        assertActive(rm, true, "foo", "bar", "a", "d");
        assertActive(rm, false, "b", "c", "e", "f");
    }

    @org.junit.Test public void testInstallOptionsSelected() {
        final SlingSettingsService rm = new SlingSettingsServiceImpl(new BundleContextMock("foo,bar,c,e", null , "a,b,c|d,e,f"));
        assertActive(rm, true, "foo", "bar", "c", "e");
        assertActive(rm, false, "a", "b", "d", "f");
    }

    @org.junit.Test public void testInstallOptionsMultipleSelected() {
        final SlingSettingsService rm = new SlingSettingsServiceImpl(new BundleContextMock("foo,bar,c,e,f,a", null, "a,b,c|d,e,f"));
        assertActive(rm, true, "foo", "bar", "a", "e");
        assertActive(rm, false, "b", "c", "d", "f");
    }

    @org.junit.Test public void testInstallOptionsMultipleSelected2() {
        final SlingSettingsService rm = new SlingSettingsServiceImpl(new BundleContextMock("foo,bar,c,d,f,a", null, "a,b,c|d,e,f"));
        assertActive(rm, true, "foo", "bar", "a", "d");
        assertActive(rm, false, "b", "c", "e", "f");
    }

    @org.junit.Test public void testInstallOptionsRestart() {
        final BundleContextMock bc = new BundleContextMock("foo,bar,c,e,f,a", null, "a,b,c|d,e,f");

        {
            // create first context to simulate install
            final SlingSettingsService rm = new SlingSettingsServiceImpl(bc);
            assertActive(rm, true, "foo", "bar", "a", "e");
            assertActive(rm, false, "b", "c", "d", "f");
        }

        {
            final SlingSettingsService rm = new SlingSettingsServiceImpl(bc);
            assertActive(rm, true, "foo", "bar", "a", "e");
            assertActive(rm, false, "b", "c", "d", "f");
        }

        // simulate restart with different run modes: new ones that are
        // mentioned in the .options properties are ignored
        bc.update("foo,doo,a,b,c,d,e,f,waa");
        {
            final SlingSettingsService rm = new SlingSettingsServiceImpl(bc);
            assertActive(rm, true, "foo", "doo", "a", "e", "waa");
            assertActive(rm, false, "bar", "b", "c", "d", "f");
        }
    }

    private static final class BundleContextMock implements BundleContext {

        private String runModes;
        private final String options;
        private final String installOptions;

        private final Map<String, File> files = new HashMap<String, File>();

        public BundleContextMock(String runModes, String options, String installOptions) {
            this.runModes = runModes;
            this.options = options;
            this.installOptions = installOptions;
        }

        public void update(final String rm) {
            this.runModes = rm;
        }

        @Override
        public void addBundleListener(BundleListener listener) {
            // TODO Auto-generated method stub

        }

        @Override
        public void addFrameworkListener(FrameworkListener listener) {
            // TODO Auto-generated method stub

        }

        @Override
        public void addServiceListener(ServiceListener listener, String filter)
                throws InvalidSyntaxException {
            // TODO Auto-generated method stub

        }

        @Override
        public void addServiceListener(ServiceListener listener) {
            // TODO Auto-generated method stub

        }

        @Override
        public Filter createFilter(String filter) throws InvalidSyntaxException {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public ServiceReference[] getAllServiceReferences(String clazz,
                String filter) throws InvalidSyntaxException {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public Bundle getBundle() {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public Bundle getBundle(long id) {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public Bundle[] getBundles() {
            return new Bundle[0];
        }

        @Override
        public File getDataFile(String filename) {
            File f = files.get(filename);
            if ( f == null ) {
                try {
                    f = File.createTempFile(filename, "id");
                    f.delete();
                    files.put(filename, f);
                } catch (IOException ioe) {
                    throw new RuntimeException(ioe);
                }
            }
            return f;
        }

        @Override
        public String getProperty(String key) {
            if ( key.equals(SlingSettingsService.RUN_MODES_PROPERTY) ) {
                return runModes;
            } else if ( key.equals(SlingSettingsService.RUN_MODE_OPTIONS) ) {
                return options;
            } else if ( key.equals(SlingSettingsService.RUN_MODE_INSTALL_OPTIONS) ) {
                return installOptions;
            }
            return null;
        }

        @Override
        public Object getService(ServiceReference reference) {
            return null;
        }

        @Override
        public ServiceReference getServiceReference(String clazz) {
            return null;
        }

        @Override
        public ServiceReference[] getServiceReferences(String clazz,
                String filter) throws InvalidSyntaxException {
            return null;
        }

        @Override
        public Bundle installBundle(String location, InputStream input)
                throws BundleException {
            return null;
        }

        @Override
        public Bundle installBundle(String location) throws BundleException {
            return null;
        }

        @Override
        @SuppressWarnings("unchecked")
        public ServiceRegistration registerService(String clazz,
                Object service, Dictionary properties) {
            return null;
        }

        @Override
        @SuppressWarnings("unchecked")
        public ServiceRegistration registerService(String[] clazzes,
                Object service, Dictionary properties) {
            return null;
        }

        @Override
        public void removeBundleListener(BundleListener listener) {
        }

        @Override
        public void removeFrameworkListener(FrameworkListener listener) {
        }

        @Override
        public void removeServiceListener(ServiceListener listener) {
        }

        @Override
        public boolean ungetService(ServiceReference reference) {
            return false;
        }

        @Override
        public <S> ServiceRegistration<S> registerService(Class<S> clazz, S service, Dictionary<String, ?> properties) {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public <S> ServiceRegistration<S> registerService(Class<S> clazz, ServiceFactory<S> factory,
                Dictionary<String, ?> properties) {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public <S> ServiceReference<S> getServiceReference(Class<S> clazz) {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public <S> Collection<ServiceReference<S>> getServiceReferences(Class<S> clazz, String filter)
                throws InvalidSyntaxException {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public <S> ServiceObjects<S> getServiceObjects(ServiceReference<S> reference) {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public Bundle getBundle(String location) {
            // TODO Auto-generated method stub
            return null;
        }
    }
}


text:
package io.jboot.components.cache.annotation;

import java.lang.annotation.*;

@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
public @interface CacheEvict {

    String name();
    String key() default "";
    String unless() default "";
    boolean beforeInvocation() default false;

}


text:
var babel = require('babel/register');

babel({
  stage: 0
});


text:
"""Tests for string_join_op."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import tensorflow as tf

class StringJoinOpTest(tf.test.TestCase):

  def testStringJoin(self):
    input0 = ["a", "b"]
    input1 = "a"
    input2 = [["b"], ["c"]]

    with self.test_session():
      output = tf.string_join([input0, input1])
      self.assertAllEqual(output.eval(), [b"aa", b"ba"])

      output = tf.string_join([input0, input1], separator="--")
      self.assertAllEqual(output.eval(), [b"a--a", b"b--a"])

      output = tf.string_join([input0, input1, input0], separator="--")
      self.assertAllEqual(output.eval(), [b"a--a--a", b"b--a--b"])

      output = tf.string_join([input1] * 4, separator="!")
      self.assertEqual(output.eval(), b"a!a!a!a")

      output = tf.string_join([input2] * 2, separator="")
      self.assertAllEqual(output.eval(), [[b"bb"], [b"cc"]])

      with self.assertRaises(ValueError):  # Inconsistent shapes
        tf.string_join([input0, input2]).eval()

if __name__ == "__main__":
  tf.test.main()


text:
package org.apache.accumulo.core.file.keyfunctor;

import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Range;

public interface KeyFunctor {
  /**
   * Implementations should return null if a range can not be converted to a bloom key.
   *
   */
  org.apache.hadoop.util.bloom.Key transform(Range range);

  org.apache.hadoop.util.bloom.Key transform(Key key);
}


text:
'use strict';

var debug = require('debug')('trifler');

module.exports = function(router) {
    router.post('/', function(req, res) {
        var trifle = {
            title: (typeof req.body.title === 'undefined') ? '' : req.body.title,
            html: (typeof req.body.html === 'undefined') ? '' : req.body.html,
            css: (typeof req.body.css === 'undefined') ? '' : req.body.css,
            js: (typeof req.body.js === 'undefined') ? '' : req.body.js,
            scripts: (typeof req.body.scripts === 'undefined') ? [] : JSON.parse(req.body.scripts),
            stylesheets: (typeof req.body.stylesheets === 'undefined') ? [] : JSON.parse(req.body.stylesheets)
        };
        debug('Generated iframe:');
        debug(JSON.stringify(trifle));
        res.render('iframe/body', trifle);
    });
};


text:
[![CI Status](http://img.shields.io/travis/alvaromurillo/AMPDynamicFont.svg?style=flat)](https://travis-ci.org/alvaromurillo/AMPDynamicFont)
[![Version](https://img.shields.io/cocoapods/v/AMPDynamicFont.svg?style=flat)](http://cocoapods.org/pods/AMPDynamicFont)
[![License](https://img.shields.io/cocoapods/l/AMPDynamicFont.svg?style=flat)](http://cocoapods.org/pods/AMPDynamicFont)
[![Platform](https://img.shields.io/cocoapods/p/AMPDynamicFont.svg?style=flat)](http://cocoapods.org/pods/AMPDynamicFont)

## Example

To run the example project, clone the repo, and run `pod install` from the Example directory first.

## Requirements

## Installation

AMPDynamicFont is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod "AMPDynamicFont"
```

## Author

alvaromurillo

## License

AMPDynamicFont is available under the MIT license. See the LICENSE file for more info.


text:
You may also like

    <button class="b-object-shuffler__tab" title="" tabindex="-1" aria-hidden="true"></button>

  <button class="b-object-shuffler__more" title="more suggestions">

      <svg role="presentation">
        <use xlink:href="/assets/svg/svg-template.svg#shuffle"></use>
      </svg>

    Shuffle objects
  </button>


text:
/*
  Returns an array (typed or not), of the passed array with removed trailing and ending
  zero-valued elements
 */
function trimEmptyElements(array) {
  var start = 0;
  var end = array.length;

  while (start < array.length) {
    if (array[start] !== 0) {
      break;
    }
    start++;
  }

  while (end > 0) {
    end--;
    if (array[end] !== 0) {
      break;
    }
  }
  return array.subarray(start, end);
}

function fuzzyCompare(a, b) {
  return Math.abs(a - b) < 9e-3;
}

function compareChannels(buf1, buf2,
                        /*optional*/ length,
                        /*optional*/ sourceOffset,
                        /*optional*/ destOffset,
                        /*optional*/ skipLengthCheck) {
  if (!skipLengthCheck) {
    assert_equals(buf1.length, buf2.length, "Channels must have the same length");
  }
  sourceOffset = sourceOffset || 0;
  destOffset = destOffset || 0;
  if (length == undefined) {
    length = buf1.length - sourceOffset;
  }
  var difference = 0;
  var maxDifference = 0;
  var firstBadIndex = -1;
  for (var i = 0; i < length; ++i) {
    if (!fuzzyCompare(buf1[i + sourceOffset], buf2[i + destOffset])) {
      difference++;
      maxDifference = Math.max(maxDifference, Math.abs(buf1[i + sourceOffset] - buf2[i + destOffset]));
      if (firstBadIndex == -1) {
        firstBadIndex = i;
      }
    }
  };

  assert_equals(difference, 0, "maxDifference: " + maxDifference +
     ", first bad index: " + firstBadIndex + " with test-data offset " +
     sourceOffset + " and expected-data offset " + destOffset +
     "; corresponding values " + buf1[firstBadIndex + sourceOffset] + " and " +
     buf2[firstBadIndex + destOffset] + " --- differences");
}

function compareBuffers(got, expected) {
  if (got.numberOfChannels != expected.numberOfChannels) {
    assert_equals(got.numberOfChannels, expected.numberOfChannels,
                  "Correct number of buffer channels");
    return;
  }
  if (got.length != expected.length) {
    assert_equals(got.length, expected.length,
                  "Correct buffer length");
    return;
  }
  if (got.sampleRate != expected.sampleRate) {
    assert_equals(got.sampleRate, expected.sampleRate,
                  "Correct sample rate");
    return;
  }

  for (var i = 0; i < got.numberOfChannels; ++i) {
    compareChannels(got.getChannelData(i), expected.getChannelData(i),
                    got.length, 0, 0, true);
  }
}

/**
 * This function assumes that the test is a "single page test" [0], and defines a
 * single gTest variable with the following properties and methods:
 *
 * + numberOfChannels: optional property which specifies the number of channels
 *                     in the output.  The default value is 2.
 * + createGraph: mandatory method which takes a context object and does
 *                everything needed in order to set up the Web Audio graph.
 *                This function returns the node to be inspected.
 * + createGraphAsync: async version of createGraph.  This function takes
 *                     a callback which should be called with an argument
 *                     set to the node to be inspected when the callee is
 *                     ready to proceed with the test.  Either this function
 *                     or createGraph must be provided.
 * + createExpectedBuffers: optional method which takes a context object and
 *                          returns either one expected buffer or an array of
 *                          them, designating what is expected to be observed
 *                          in the output.  If omitted, the output is expected
 *                          to be silence.  All buffers must have the same
 *                          length, which must be a bufferSize supported by
 *                          ScriptProcessorNode.  This function is guaranteed
 *                          to be called before createGraph.
 * + length: property equal to the total number of frames which we are waiting
 *           to see in the output, mandatory if createExpectedBuffers is not
 *           provided, in which case it must be a bufferSize supported by
 *           ScriptProcessorNode (256, 512, 1024, 2048, 4096, 8192, or 16384).
 *           If createExpectedBuffers is provided then this must be equal to
 *           the number of expected buffers * the expected buffer length.
 *
 * + skipOfflineContextTests: optional. when true, skips running tests on an offline
 *                            context by circumventing testOnOfflineContext.
 *
 * [0]: https://web-platform-tests.org/writing-tests/testharness-api.html#single-page-tests
 */
function runTest(name)
{
  function runTestFunction () {
    if (!gTest.numberOfChannels) {
      gTest.numberOfChannels = 2; // default
    }

    var testLength;

    function runTestOnContext(context, callback, testOutput) {
      if (!gTest.createExpectedBuffers) {
        // Assume that the output is silence
        var expectedBuffers = getEmptyBuffer(context, gTest.length);
      } else {
        var expectedBuffers = gTest.createExpectedBuffers(context);
      }
      if (!(expectedBuffers instanceof Array)) {
        expectedBuffers = [expectedBuffers];
      }
      var expectedFrames = 0;
      for (var i = 0; i < expectedBuffers.length; ++i) {
        assert_equals(expectedBuffers[i].numberOfChannels, gTest.numberOfChannels,
                      "Correct number of channels for expected buffer " + i);
        expectedFrames += expectedBuffers[i].length;
      }
      if (gTest.length && gTest.createExpectedBuffers) {
        assert_equals(expectedFrames,
                      gTest.length, "Correct number of expected frames");
      }

      if (gTest.createGraphAsync) {
        gTest.createGraphAsync(context, function(nodeToInspect) {
          testOutput(nodeToInspect, expectedBuffers, callback);
        });
      } else {
        testOutput(gTest.createGraph(context), expectedBuffers, callback);
      }
    }

    function testOnNormalContext(callback) {
      function testOutput(nodeToInspect, expectedBuffers, callback) {
        testLength = 0;
        var sp = context.createScriptProcessor(expectedBuffers[0].length, gTest.numberOfChannels, 1);
        nodeToInspect.connect(sp).connect(context.destination);
        sp.onaudioprocess = function(e) {
          var expectedBuffer = expectedBuffers.shift();
          testLength += expectedBuffer.length;
          compareBuffers(e.inputBuffer, expectedBuffer);
          if (expectedBuffers.length == 0) {
            sp.onaudioprocess = null;
            callback();
          }
        };
      }
      var context = new AudioContext();
      runTestOnContext(context, callback, testOutput);
    }

    function testOnOfflineContext(callback, sampleRate) {
      function testOutput(nodeToInspect, expectedBuffers, callback) {
        nodeToInspect.connect(context.destination);
        context.oncomplete = function(e) {
          var samplesSeen = 0;
          while (expectedBuffers.length) {
            var expectedBuffer = expectedBuffers.shift();
            assert_equals(e.renderedBuffer.numberOfChannels, expectedBuffer.numberOfChannels,
                          "Correct number of input buffer channels");
            for (var i = 0; i < e.renderedBuffer.numberOfChannels; ++i) {
              compareChannels(e.renderedBuffer.getChannelData(i),
                             expectedBuffer.getChannelData(i),
                             expectedBuffer.length,
                             samplesSeen,
                             undefined,
                             true);
            }
            samplesSeen += expectedBuffer.length;
          }
          callback();
        };
        context.startRendering();
      }

      var context = new OfflineAudioContext(gTest.numberOfChannels, testLength, sampleRate);
      runTestOnContext(context, callback, testOutput);
    }

    testOnNormalContext(function() {
      if (!gTest.skipOfflineContextTests) {
        testOnOfflineContext(function() {
          testOnOfflineContext(done, 44100);
        }, 48000);
      } else {
        done();
      }
    });
  };

  runTestFunction();
}

// Simpler than audit.js, but still logs the message. Requires
// `setup("explicit_done": true)` if testing code that runs after the "load"
// event.
function equals(a, b, msg) {
  test(function() {
    assert_equals(a, b);
  }, msg);
}
function is_true(a, msg) {
  test(function() {
    assert_true(a);
  }, msg);
}

// This allows writing AudioWorkletProcessor code in the same file as the rest
// of the test, for quick one off AudioWorkletProcessor testing.
function URLFromScriptsElements(ids)
{
  var scriptTexts = [];
  for (let id of ids) {

    const e = document.querySelector("script#"+id)
    if (!e) {
      throw id+" is not the id of a <script> tag";
    }
    scriptTexts.push(e.innerText);
  }
  const blob = new Blob(scriptTexts, {type: "application/javascript"});

  return URL.createObjectURL(blob);
}


text:
<?php

/* TwigBundle:Exception:error.xml.twig */
class __TwigTemplate_594d241e0f4dcd4125ada8c62fa56c3a1a6cb91a02b25b4b272efdb8de23e6f4 extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = false;

        $this->blocks = array(
        );
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        // line 1
        echo "<?xml version=\"1.0\" encoding=\"";
        echo twig_escape_filter($this->env, $this->env->getCharset(), "html", null, true);
        echo "\" ?>

<error code=\"";
        // line 3
        echo twig_escape_filter($this->env, $this->getContext($context, "status_code"), "html", null, true);
        echo "\" message=\"";
        echo twig_escape_filter($this->env, $this->getContext($context, "status_text"), "html", null, true);
        echo "\" />
";
    }

    public function getTemplateName()
    {
        return "TwigBundle:Exception:error.xml.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  25 => 3,  19 => 1,);
    }
}


text:
{{<layout}}

            {{$pageTitle}} M1 vehicle upload {{/pageTitle}}

            {{$head}}
            {{>includes/head}}
	{{>includes/scripts}}
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">

{{/head}}

{{$content}}

    {{>includes/phase-banner-beta-logout}}
    {{>includes/buttons/back}}

            {{>includes/errors/upload-error-box}}

M1 vehicle upload

            <form class="form margin-top-2">

                    <fieldset>
                        <legend class="visuallyhidden">Supplier code</legend>

                                Supplier code

Provide a valid supplier code

                            <input class="form-control form-control-1-4" id="suppliercode" name="suppliercode" type="number" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">MVRIS</legend>

                                MVRIS

Provide a valid MVRIS

                            <input class="form-control form-control-1-4" id="mvris" type="text" name="mvris" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">Price</legend>

                                Price
                                Provide amount in pounds and pence. For example, 15000.00
								Provide a valid price

                            <input class="form-control form-control-2-4" id="price" type="text" name="price" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">VIN, chassis or frame number</legend>

                                VIN, chassis or frame number

Provide a valid VIN, chassis or frame number

                            <input class="form-control form-control-2-4" id="vin" type="text" name="vin" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">Make</legend>

                                Make

Provide a valid make

                            <input class="form-control form-control-1-4" id="make" name="make" type="number" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">Model</legend>

                                Model

Provide a valid model

                            <input class="form-control form-control-1-4" id="model" name="model" type="number" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">MVRIS make</legend>

                                MVRIS make

Provide a valid MVRIS make

                            <input class="form-control form-control-2-4" id="mvrisMake" type="text" name="mvrisMake" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">MVRIS model</legend>

                                MVRIS model

Provide a valid MVRIS model

                            <input class="form-control form-control-2-4" id="mvrisModel" type="text" name="mvrisModel" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">Body type</legend>

                                Body type

Provide a valid body type

                            <input class="form-control form-control-2-4" id="bodytype" name="bodytype" type="text" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">Wheelplan</legend>

                                Wheelplan

Provide a valid wheelplan

                            <input class="form-control form-control-1-4" id="wheelplan" name="wheelplan" type="number" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">Change colour</legend>

                                Main colour
                                If you enter 'Multi coloured' you do not need to enter a second colour
                                Provide a valid main colour

                            <input class="form-control form-control-1-4" id="colour" name="colour" type="text" value="">

                                What colours can I enter?

Beige or buff

Black

Blue

Bronze

Brown

Cream or ivory

Gold

Green

Grey

Maroon

Orange

Purple

Red

Silver

Turquoise

White

Yellow

Multi coloured

For vehicles that are more than 3 colours

                        <legend class="visuallyhidden">Change second colour</legend>

                                Second colour (optional)
                                If the car has two shades of the same colour you must enter it twice
                                Provide a valid second colour

                            <input class="form-control form-control-1-4" id="colour2" name="colour2" type="text" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">Propulsion</legend>

                                Propulsion

Provide a valid propulsion value

                            <input class="form-control form-control-1-4" id="propulsion" name="propulsion" type="number" value="">

                    </fieldset>

                <fieldset>
                    <legend class="visuallyhidden">Engine number</legend>

                            Engine number

Provide a valid engine number

                        <input class="form-control form-control-1-4" id="enginenumber" name="enginenumber" type="text" value="">

                </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">Cylinder capacity (cc)</legend>

                                Cylinder capacity (cc)

Provide a valid cylinder capacity (cc)

                            <input class="form-control form-control-1-4" id="cylindercapacity" name="cylindercapacity" type="text" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">Number of seats (including driver)</legend>

                                Number of seats (including driver)

Provide a valid number of seats (including driver)

                            <input class="form-control form-control-1-4" id="seatingcapacity" name="seatingcapacity" type="number" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">Gross or revenue weight</legend>

                                Gross or revenue weight (kg) (optional)

Provide a valid gross or revenue weight (kg)

                            <input class="form-control form-control-1-4" id="grossrevweight" name="grossrevweight" type="number" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">Unladen weight (kg) (optional)</legend>

                                Unladen weight (kg) (optional)

Provide a valid unladen weight

                            <input class="form-control form-control-1-4" id="unladenweight" name="unladenweight" type="number" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">MSD comments (optional)</legend>

                                MSD comments (optional)

                            <input class="form-control form-control-3-4" id="msdcomments" name="msdcomments" type="text" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">MSD details (optional)</legend>

                                MSD details (optional)

                            <input class="form-control form-control-3-4" id="msddetails" name="msddetails" type="text" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">MSD MSF (optional)</legend>

                                MSD MSF (optional)

                            <input class="form-control form-control-3-4" id="msdmsf" name="msdmsf" type="text" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">MSD type (optional)</legend>

                                MSD type (optional)

Provide a valid MSD type

                            <input class="form-control form-control-3-4" id="msdtype" name="msdtype" type="text" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">SMMT fleet code (optional)</legend>

                                SMMT fleet code (optional)

Provide a valid SMMT fleet code

                            <input class="form-control form-control-1-4" id="smmtfc" name="smmtfc" type="text" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">Type approval number</legend>

                                Type approval number

Provide a valid type approval number

                            <input class="form-control form-control-3-4" id="typeApp" name="typeApp" type="text" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">Version</legend>

                                Version

Provide a valid version

                            <input class="form-control form-control-3-4" id="version" name="version" type="text" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">Variant</legend>

                                Variant

Provide a valid variant

                             <input class="form-control form-control-3-4" id="variant" name="variant" type="text" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">CO2 (g/km)</legend>

                                CO2 (g/km)

Provide a valid CO2 (g/km) value

                            <input class="form-control form-control-1-4" id="co2" name="co2" type="number" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">CO (g/km or g/kWh) (optional)</legend>

                                CO (g/km or g/kWh) (optional)

Provide a valid CO (g/km or g/kWh) value

                            <input class="form-control form-control-1-4" id="co" name="co" type="number" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">NOx (g/km or g/kWh) (optional)</legend>

                                NOx (g/km or g/kWh) (optional)

Provide a valid NOx (g/km or g/kWh) value

                             <input class="form-control form-control-1-4" id="nox" name="nox" type="number" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">Particulates (pm g/km or g/kWh) (optional)</legend>

                                Particulates (pm g/km or g/kWh) (optional)

Provide a valid particulates (pm g/km or g/kWh) value

                             <input class="form-control form-control-1-4" id="particulates" name="particulates" type="number" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">HC (g/km or g/kWh) (optional)</legend>

                                New HC (g/km or g/kWh) (optional)

Provide a valid HC (g/km or g/kWh) value

                            <input class="form-control form-control-1-4" id="hc" name="hc" type="number" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">HC + NOx (g/km) (optional)</legend>

                                HC + NOx (g/km) (optional)

Provide a valid HC + NOx (g/km) value

                            <input class="form-control form-control-1-4" id="hcnox" name="hcnox" type="number" value="">

                    </fieldset>

This section is optional, but if started all fields must be provided

                        <fieldset>
                            <legend class="visuallyhidden">Length (mm)</legend>

                                    Length (mm)

Provide a valid length (mm)

                                <input class="form-control form-control-1-4" id="length" name="length" type="number" value="">

                        </fieldset>

                        <fieldset>
                            <legend class="visuallyhidden">Width (mm)</legend>

                                    Width (mm)

Provide a valid width (mm)

                                <input class="form-control form-control-1-4" id="width" name="width" type="number" value="">

                        </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">Mass in service (kg)</legend>

                                Mass in service (kg)

Provide a valid mass in service (kg)

                            <input class="form-control form-control-1-4" id="massinservice" name="massinservice" type="text" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">European status directive number</legend>

                                European status directive number

Provide a valid European status directive number

                            <input class="form-control form-control-3-4" id="eustatusdirno" name="eustatusdirno" type="text" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">Maximum permissible mass (kg) (optional)</legend>

                                Maximum permissible mass (kg) (optional)

Provide a valid maximum permissible mass (kg)

                            <input class="form-control form-control-1-4" id="maxpermass" name="maxpermass" type="text" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">Maximum net power (kW) (optional)</legend>

                                Maximum net power (kW) (optional)

Provide a valid maximum net power (kW)

                            <input class="form-control form-control-1-4" id="maxpower" name="maxpower" type="text" value="">

                    </fieldset>

This section is optional, but if started all fields must be provided

                    <fieldset>
                        <legend class="visuallyhidden">Stationary sound level (dB(A))</legend>

                                Stationary sound level (dB(A))

Provide a valid stationary sound level (dB(A))

                            <input class="form-control form-control-1-4" id="stationary" name="stationary" type="number" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">Engine speed sound level (min-1)</legend>

                                Engine speed sound level (min-1)

Provide a valid engine speed sound level (min-1)

                            <input class="form-control form-control-1-4" id="enginespeed" name="enginespeed" type="number" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">Drive by sound level (dB(A))</legend>

                                Drive by sound level (dB(A))

Provide a valid drive by sound level (dB(A))

                            <input class="form-control form-control-1-4" id="driveby" name="driveby" type="number" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">Wheelbase (mm)</legend>

                                Wheelbase (mm)

Provide a valid wheelbase (mm)

                            <input class="form-control form-control-1-4" id="wheelbase" name="wheelbase" type="number" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">Type approval manfacturer code</legend>

                                Type approval manfacturer code

Provide a valid type approval manfacturer code

                            <input class="form-control form-control-3-4" id="tamancode" name="tamancode" type="text" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">Type</legend>

                                New type

Provide a valid type

                            <input class="form-control form-control-2-4" id="type" name="type" type="text" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">Axle 1 track width minimum (mm)</legend>

                                Axle 1 track width minimum (mm)

Provide a valid axle 1 track width minimum (mm)

                           <input class="form-control form-control-1-4" id="axle1min" name="axle1min" type="text" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">Axle 1 track width maximum (mm)</legend>

                                Axle 1 track width maximum (mm)

Provide a valid axle 1 track width maximum (mm)

                            <input class="form-control form-control-1-4" id="axle1max" name="axle1max" type="text" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">Axle 2 track width minimum (mm)</legend>

                                Axle 2 track width minimum (mm)

Provide a valid axle 2 track width minimum (mm)

                            <input class="form-control form-control-1-4" id="axle2min" name="axle2min" type="text" value="">

                    </fieldset>

                    <fieldset>
                        <legend class="visuallyhidden">Axle 2 track width maximum (mm)</legend>

                                Axle 2 track width maximum (mm)

Provide a valid axle 2 track width maximum (mm)

                           <input class="form-control form-control-1-4" id="axle2max" name="axle2max" type="text" value="">

                    </fieldset>

This section is optional, but if started all fields must be provided

                        <fieldset>
                            <legend class="visuallyhidden">Axle 3 track width minimum (mm) (optional</legend>

                                    Axle 3 track width minimum (mm)

Provide a valid axle 3 track width minimum (mm)

                                <input class="form-control form-control-1-4" id="axle3min" name="axle3min" type="text" value="">

                        </fieldset>

                        <fieldset>
                            <legend class="visuallyhidden">Axle 3 track width maximum (mm)</legend>

                                    Axle 3 track width maximum (mm)

Provide a valid axle 3 track width maximum (mm)

                                <input class="form-control form-control-1-4" id="axle3max" name="axle3max" type="text" value="">

                        </fieldset>

                {{>includes/buttons/continue-validation}}
            </form>

{{/content}}

{{/layout}}


text:
const express = require('express');
const bodyParser = require('body-parser');
const log = require('./util/log');
const statusCheck = require('./tasks/status-check');
const deploy = require('./tasks/deploy');
const scaleUp = require('./actions/scale-up');
const scaleDown = require('./actions/scale-down');

const app = express();
const cycleGap = 5000;
const scaleUpGap = 30000;
const scaleDownGap = 120000;

let deployScheduled = false;
let lastScaleChange = 0;

function doCycle() {
    if (deployScheduled) {
        deployScheduled = false;
        deploy()
            .then(() => setTimeout(doCycle, cycleGap));
    } else {
        statusCheck()
            .then((result) => {
                if (result.action !== 'IDLE') {
                    let timePassed = (+new Date()) - lastScaleChange;
                    if (result.action === 'SCALE_UP' && timePassed > scaleUpGap) {
                        lastScaleChange = +new Date();
                        return scaleUp(result.droplets);
                    } else if (result.action === 'SCALE_DOWN' && timePassed > scaleDownGap) {
                        lastScaleChange = +new Date();
                        return scaleDown(result.droplets);
                    }
                }
            }).then((result) => setTimeout(doCycle, cycleGap));
    }
}

setTimeout(doCycle, cycleGap);

app.use(bodyParser.json());
app.post('/git', function (req, res) {
    if (req.body.ref !== 'refs/heads/master') {
        res.send('Thanks GitHub! But I don\' think that\'s of my interest');
        return;
    }
    res.send('Thanks GitHub! I will deploy');

    deployScheduled = true;
    log('Deploy scheduled');
});
app.listen(8080, function () {
    log('Listening to git push events');
});


text:
* <!-- .element: class="fragment" --> Identify a problem / area of improvement
* <!-- .element: class="fragment" --> Use Chrome dev tools locally while developing a solution
* <!-- .element: class="fragment" --> Push the solve to a sandbox and test with Webpagetest
* <!-- .element: class="fragment" --> Pull request with WPT test validations
* <!-- .element: class="fragment" --> Deploy (kicks off SC tests on all sites)
* <!-- .element: class="fragment" --> Validate deploy went as expected in SpeedCurve

Note:

The typical flow for performance work goes like:
	- Identify a problem / area of improvement
	- Use Chrome dev tools locally while developing a solution
	- Push the solve to a sandbox and test with Webpagetest
	- Pull request with WPT test validations
	- Deploy (kicks off SC tests on all sites)
	- Validate deploy went as expected in SpeedCurve


text:
package ralli;
public class Road{
	public static void main (String[] args){
		Car car = new Car();
		car.fill(100);
		car.showGas();
		car.drive(10);
		car.showGas();
		Road.gasStation(car);
		car.showGas();

		}
	public static void gasStation(Car car){
		car.fill(100);
	}

}


text:
"use strict";

var run = function(good,bad) {
    var scope = this;
    this.enhance(function(err,newscope){
        good(newscope);
    });
};

module.exports = function(Command,scope) {
    return new Command(scope,run);
};


text:
var express = require('express');
var compress = require('compression');
var morgan  = require('morgan');
var bodyParser = require('body-parser');
var methodOverride = require('method-override');
var path = require('path');
var cors = require('cors');

module.exports = function(parent) {
	var oneMonth = 2592000;
	parent.enable('trust proxy');
	parent.set('port', process.env.PORT || 4000);
	parent.set('view engine', 'jade');
	parent.set('jsonp callback', true );
	parent.use(cors());
	parent.use(compress());
	parent.use(morgan('dev'));
	parent.use(bodyParser.urlencoded({
		extended: true
	}));
	parent.use(bodyParser.json());
	parent.use(methodOverride());
	parent.use(require('stylus').middleware(__dirname + '/../../public'));

	var env = process.env.NODE_ENV || 'development';

	// Load configuration according to environment
	if(process.env.NODE_ENV == 'development') {
		require('./development')(parent);
	} else if(process.env.NODE_ENV == 'production') {
		require('./production')(parent);
	} else {
		require('./development')(parent);
	}

	// Databases initialization
	require('./../initializers/databases')(env);

	// load controllers
	require('./../routers')(parent, { verbose: true });

	logger.info("Cygnus API initial configuration loaded.");
};


text:
<?xml version="1.0" encoding="UTF-8"?>

<extensions xmlns="http://docs.openstack.org/common/api/v1.0"
            xmlns:atom="http://www.w3.org/2005/Atom">
</extensions>


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

<TITLE>
Uses of Class org.springframework.web.portlet.FrameworkPortlet (Spring Framework API 2.5)
</TITLE>

<META NAME="date" CONTENT="2007-11-19">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

The Spring Framework

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
org.springframework.web.portlet.FrameworkPortlet

Packages that use FrameworkPortlet

org.springframework.web.portlet
Provides JSR-168 portlets that integrate with the application context
infrastructure, and the core interfaces and classes for the Portlet
variant of Spring's web MVC framework.

Uses of FrameworkPortlet in org.springframework.web.portlet

Subclasses of FrameworkPortlet in org.springframework.web.portlet

 class
DispatcherPortlet

          Central dispatcher for use within the Portlet MVC framework, e.g. for web UI
 controllers.

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

The Spring Framework

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Copyright © 2002-2007 The Spring Framework.


text:
#pragma once

#include <iostream>
#include <stdio.h>

#include "output.h"

/*!
 * \brief This class for output 2D array to file
 */
class FileOutput : public Output
{
public:
    FileOutput(int **currentArray, const int &currentSize);
    ~FileOutput();

    void print(const QVector<int> &recordSnakeCrawling);
};


text:
package com.xthena.security.api;

import java.util.List;

public interface UserAuth {
    String getId();

    String getScopeId();

    String getUsername();

    String getDisplayName();

    String getStatus();

    List<String> getPermissions();

    List<String> getRoles();
}


text:
FOUNDATION_EXPORT const NSString *kSBStagingResolverURL;

@interface SBTestCase : XCTestCase

@end


text:
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Monkeyspeak.Logging;

namespace Monkeyspeak
{
    internal class ExecutionContext
    {
        private readonly Page page;
        private readonly TriggerBlock triggerBlock;
        private readonly TriggerReader reader;
        private readonly ReadOnlyDictionary<Trigger, TriggerHandler> handlers;
        private Trigger previous, current, next;
        private bool canContinue;
        private int step = 0;

        public ExecutionContext(Page page, TriggerBlock triggerBlock, params object[] args)
        {
            this.page = page;
            this.triggerBlock = triggerBlock.GetSubBlock(0);
            handlers = new ReadOnlyDictionary<Trigger, TriggerHandler>(page.handlers);

            reader = new TriggerReader(page, triggerBlock)
            {
                Parameters = args ?? new object[0]
            };
        }

        public async Task RunAsync(int triggerIndex)
        {
            await Task.Run(() => Run(triggerIndex));
        }

        public void Run(int triggerIndex)
        {
            for (int j = triggerIndex; j <= triggerBlock.Count - 1; j++)
            {
                ExecuteTrigger(triggerBlock, ref j, reader);
                // if j is -1 is used for flow triggers to break out of them, I know, a hack but it works
                if (j < 0) break;
            }
        }

        public void RunOneStep(int triggerIndex)
        {
            if (step == -1) return;
            int j = triggerIndex + step;
            ExecuteTrigger(triggerBlock, ref j, reader);
            // if j is -1 is used for flow triggers to break out of them, I know, a hack but it works
            if (j < 0)
                step = -1;
            else step++;
        }

        public async Task RunOneStepAsync(int triggerIndex)
        {
            await Task.Run(() => RunOneStep(triggerIndex));
        }

        private void ExecuteTrigger(TriggerBlock triggerBlock, ref int index, TriggerReader reader)
        {
            previous = triggerBlock[index - 1];
            current = triggerBlock[index];
            next = triggerBlock[index + 1]; // or undefined if none exists
            handlers.TryGetValue(current, out TriggerHandler handler);

            if (handler == null)
            {
                throw new TriggerHanderNotFoundException($"No handler found for {current}");
            }

            reader.Trigger = current;
            reader.CurrentBlockIndex = index;

            try
            {
                if (previous.Category == TriggerCategory.Condition && current.Category == TriggerCategory.Condition)
                    canContinue = canContinue && (handler != null ? handler(reader) : false);
                else canContinue = (handler != null ? handler(reader) : false);
                if (Logger.DebugEnabled) Logger.Debug<Page>($"{page.GetTriggerDescription(current, true, true)} returned {canContinue} at trigger position {index}");

                if (reader.CurrentBlockIndex < 0)
                {
                    index = reader.CurrentBlockIndex;
                    return;
                }

                if (canContinue == false)
                {
                    switch (current.Category)
                    {
                        case TriggerCategory.Cause:
                            // skip ahead for another cause to meet
                            index = triggerBlock.IndexOfTrigger(TriggerCategory.Cause, startIndex: index + 1);
                            break;

                        case TriggerCategory.Condition:
                            if (previous.Category == TriggerCategory.Condition || next.Category != TriggerCategory.Condition)
                                index = triggerBlock.IndexOfTrigger(TriggerCategory.Condition, startIndex: index + 1);
                            break;

                        case TriggerCategory.Flow:
                            // skip ahead for another flow trigger to meet
                            index = triggerBlock.IndexOfTrigger(TriggerCategory.Flow, startIndex: index + 1);
                            break;

                        case TriggerCategory.Effect:
                            index = -1;
                            break;
                    }
                }
                else
                {
                    // can continue
                    switch (current.Category)
                    {
                        case TriggerCategory.Cause:
                            Trigger possibleCause = Trigger.Undefined;
                            for (int i = index + 1; i <= triggerBlock.Count - 1; i++)
                            {
                                possibleCause = triggerBlock[i];
                                if (possibleCause.Category == TriggerCategory.Cause)
                                {
                                    index = i; // set the current index of the outer loop
                                    break;
                                }
                            }
                            break;

                        case TriggerCategory.Flow:
                            var indexOfOtherFlow = triggerBlock.IndexOfTrigger(TriggerCategory.Flow, startIndex: index + 1);
                            var subBlock = triggerBlock.GetSubBlock(index + 1, indexOfOtherFlow);
                            var subReader = new TriggerReader(page, subBlock) { Parameters = reader.Parameters };
                            int j = index, k = 0;
                            for (; k <= subBlock.Count - 1; k++)
                            {
                                ExecuteTrigger(subBlock, ref k, subReader);
                                if (k == -2)
                                {
                                    j -= 1;
                                    break;
                                }
                                else if (k == -1) break;
                                j += k;
                            }
                            if (k == -2)
                                index += subBlock.Count;
                            else if (k == -1)
                                index = j;
                            else index -= 1;
                            break;
                    }
                }
            }
            catch (Exception e)
            {
                index = triggerBlock.Count;
                page.OnError(handlers[current], current, e);
            }
        }
    }
}


text:
<?php

namespace Chipaau\Validation;

use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Response;
use Illuminate\Routing\UrlGenerator;
use Illuminate\Contracts\Validation\Factory;
use Illuminate\Http\Exception\HttpResponseException;
use Illuminate\Support\MessageBag;
use Chipaau\Validation\ValidationException;
use Chipaau\Validation\AbstractValidator;

trait ValidateRequestTrait
{
    /**
     * The default error bag.
     *
     * @var string
     */
    protected $validatesRequestErrorBag;

    /**
     * Validate the given request with the given rules.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  array  $rules
     * @param  array  $messages
     * @param  array  $customAttributes
     * @return void
     *
     * @throws \Illuminate\Http\Exception\HttpResponseException
     */
    public function validate(AbstractValidator $validator, $removeRequired = false, array $messages = [], array $customAttributes = [])
    {
        try {
            return $validator->validate($removeRequired);
        } catch (ValidationException $e) {
            $this->throwValidationException($e->getErrors());
        }

//              $this->throwValidationException($request, $validator);
        // $validator = $this->getValidationFactory()->make($request->all(), $rules, $messages, $customAttributes);

    }

    /**
     * Validate the given request with the given rules.
     *
     * @param  string  $errorBag
     * @param  \Illuminate\Http\Request  $request
     * @param  array  $rules
     * @param  array  $messages
     * @param  array  $customAttributes
     * @return void
     *
     * @throws \Illuminate\Http\Exception\HttpResponseException
     */
    public function validateWithBag($errorBag, Request $request, array $rules, array $messages = [], array $customAttributes = [])
    {
        $this->withErrorBag($errorBag, function () use ($request, $rules, $messages, $customAttributes) {
            $this->validate($request, $rules, $messages, $customAttributes);
        });
    }

    /**
     * Throw the failed validation exception.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Illuminate\Contracts\Validation\Validator  $validator
     * @return void
     *
     * @throws \Illuminate\Http\Exception\HttpResponseException
     */
    protected function throwValidationException(MessageBag $errors)
    {
        throw new HttpResponseException($this->buildFailedValidationResponse($this->formatValidationErrors($errors)));
    }

    /**
     * Create the response for when a request fails validation.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  array  $errors
     * @return \Illuminate\Http\Response
     */
    protected function buildFailedValidationResponse(array $errors)
    {
        return new JsonResponse($errors, 422);
    }

    /**
     * Format the validation errors to be returned.
     *
     * @param  \Illuminate\Contracts\Validation\Validator  $validator
     * @return array
     */
    protected function formatValidationErrors(MessageBag $errors)
    {
        return [
                'error' => [
                    'message' => 'Validation error!',
                    'data' => $errors->getMessages(),
                    'code' => Response::HTTP_UNPROCESSABLE_ENTITY
                ]
            ];
    }

    /**
     * Get the URL we should redirect to.
     *
     * @return string
     */
    protected function getRedirectUrl()
    {
        return app(UrlGenerator::class)->previous();
    }

    /**
     * Get a validation factory instance.
     *
     * @return \Illuminate\Contracts\Validation\Factory
     */
    protected function getValidationFactory()
    {
        return app(Factory::class);
    }

    /**
     * Execute a Closure within with a given error bag set as the default bag.
     *
     * @param  string  $errorBag
     * @param  callable  $callback
     * @return void
     */
    protected function withErrorBag($errorBag, callable $callback)
    {
        $this->validatesRequestErrorBag = $errorBag;

        call_user_func($callback);

        $this->validatesRequestErrorBag = null;
    }

    /**
     * Get the key to be used for the view error bag.
     *
     * @return string
     */
    protected function errorBag()
    {
        return $this->validatesRequestErrorBag ?: 'default';
    }
}


text:
package helvidios.cp.ch2.ownlibs.unionfind;

/**
 * Represents a disjoint-set data structure (also known as union-find data structure)
 * that keeps track of a set of elements partitioned into a number of disjoint (non-overlapping) subsets.
 */
public class UnionFindStructure {
	private int[] p;
	private int[] rank;
	private int[] size;
	private int nDisjointSets;

	public UnionFindStructure(int n){
		p = new int[n];
		rank = new int[n];
		size = new int[n];

		for(int i = 0; i < p.length; i++){
			p[i] = i;
			size[i] = 1;
		}

		nDisjointSets = n;
	}

	/**
	 * Returns identifier for subset which element i is in.
	 */
	public int findSet(int i){
		if(p[i] != i){
			p[i] = findSet(p[i]);
		}
		return p[i];
	}

	/**
	 * Returns true if elements i and j belong to the same subset.
	 */
	public boolean isSameSet(int i, int j){
		return findSet(i) == findSet(j);
	}

	/**
	 * Joins subsets of i and j together.
	 */
	public void unionSet(int i, int j){
		int iRoot = findSet(i);
		int jRoot = findSet(j);
		if(iRoot == jRoot) return;

		if(rank[iRoot] < rank[jRoot]){
			p[iRoot] = jRoot;
			size[jRoot] += size[iRoot];
		}else if(rank[iRoot] > rank[jRoot]){
			p[jRoot] = iRoot;
			size[iRoot] += size[jRoot];
		}else{
			p[jRoot] = iRoot;
			size[iRoot] += size[jRoot];
			rank[iRoot]++;
		}

		nDisjointSets--;
	}

	/**
	 * Returns the number of disjoint sets currently in this union-find structure.
	 */
	public int nDisjointSets(){
		return nDisjointSets;
	}

	/**
	 * Returns the size of set that currently contains item i.
	 */
	public int sizeOfSet(int i){
		return size[findSet(i)];
	}
}


text:
@implementation AxisDemo

+(void)load
{
	[super registerPlotItem:self];
}

-(id)init
{
	if ( (self = [super init]) ) {
		title = @"Axis Demo";
	}

	return self;
}

-(void)renderInLayer:(CPTGraphHostingView *)layerHostingView withTheme:(CPTTheme *)theme
{
#if TARGET_OS_IPHONE
	CGRect bounds = layerHostingView.bounds;
#else
	CGRect bounds = NSRectToCGRect(layerHostingView.bounds);
#endif

	// Create graph
	CPTGraph *graph = [[[CPTXYGraph alloc] initWithFrame:bounds] autorelease];
	[self addGraph:graph toHostingView:layerHostingView];
	[self applyTheme:theme toGraph:graph withDefault:[CPTTheme themeNamed:kCPTSlateTheme]];

	[self setTitleDefaultsForGraph:graph withBounds:bounds];
	[self setPaddingDefaultsForGraph:graph withBounds:bounds];

	graph.fill = [CPTFill fillWithColor:[CPTColor darkGrayColor]];

	// Plot area
	graph.plotAreaFrame.fill		  = [CPTFill fillWithColor:[CPTColor lightGrayColor]];
	graph.plotAreaFrame.paddingTop	  = 20.0;
	graph.plotAreaFrame.paddingBottom = 50.0;
	graph.plotAreaFrame.paddingLeft	  = 50.0;
	graph.plotAreaFrame.paddingRight  = 50.0;
	graph.plotAreaFrame.cornerRadius  = 10.0;

	graph.plotAreaFrame.axisSet.borderLineStyle = [CPTLineStyle lineStyle];

	graph.plotAreaFrame.plotArea.fill = [CPTFill fillWithColor:[CPTColor whiteColor]];

	// Setup plot space
	CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)graph.defaultPlotSpace;
	plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(-10.0)];
	plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.5) length:CPTDecimalFromDouble(10.0)];

	// Line styles
	CPTMutableLineStyle *axisLineStyle = [CPTMutableLineStyle lineStyle];
	axisLineStyle.lineWidth = 3.0;
	axisLineStyle.lineCap	= kCGLineCapRound;

	CPTMutableLineStyle *majorGridLineStyle = [CPTMutableLineStyle lineStyle];
	majorGridLineStyle.lineWidth = 0.75;
	majorGridLineStyle.lineColor = [CPTColor redColor];

	CPTMutableLineStyle *minorGridLineStyle = [CPTMutableLineStyle lineStyle];
	minorGridLineStyle.lineWidth = 0.25;
	minorGridLineStyle.lineColor = [CPTColor blueColor];

	// Text styles
	CPTMutableTextStyle *axisTitleTextStyle = [CPTMutableTextStyle textStyle];
	axisTitleTextStyle.fontName = @"Helvetica-Bold";
	axisTitleTextStyle.fontSize = 14.0;

	// Axes
	// Label x axis with a fixed interval policy
	CPTXYAxisSet *axisSet = (CPTXYAxisSet *)graph.axisSet;
	CPTXYAxis *x		  = axisSet.xAxis;
	x.separateLayers			  = NO;
	x.orthogonalCoordinateDecimal = CPTDecimalFromDouble(0.5);
	x.majorIntervalLength		  = CPTDecimalFromDouble(0.5);
	x.minorTicksPerInterval		  = 4;
	x.tickDirection				  = CPTSignNone;
	x.axisLineStyle				  = axisLineStyle;
	x.majorTickLength			  = 12.0;
	x.majorTickLineStyle		  = axisLineStyle;
	x.majorGridLineStyle		  = majorGridLineStyle;
	x.minorTickLength			  = 8.0;
	x.minorGridLineStyle		  = minorGridLineStyle;
	x.title						  = @"X Axis";
	x.titleTextStyle			  = axisTitleTextStyle;
	x.titleOffset				  = 25.0;
	x.alternatingBandFills		  = [NSArray arrayWithObjects:[[CPTColor redColor] colorWithAlphaComponent:0.1], [[CPTColor greenColor] colorWithAlphaComponent:0.1], nil];

	// Label y with an automatic labeling policy.
	axisLineStyle.lineColor = [CPTColor greenColor];

	CPTXYAxis *y = axisSet.yAxis;
	y.labelingPolicy		= CPTAxisLabelingPolicyAutomatic;
	y.separateLayers		= YES;
	y.minorTicksPerInterval = 9;
	y.tickDirection			= CPTSignNegative;
	y.axisLineStyle			= axisLineStyle;
	y.majorTickLength		= 6.0;
	y.majorTickLineStyle	= axisLineStyle;
	y.majorGridLineStyle	= majorGridLineStyle;
	y.minorTickLength		= 4.0;
	y.minorGridLineStyle	= minorGridLineStyle;
	y.title					= @"Y Axis";
	y.titleTextStyle		= axisTitleTextStyle;
	y.titleOffset			= 30.0;
	y.alternatingBandFills	= [NSArray arrayWithObjects:[[CPTColor blueColor] colorWithAlphaComponent:0.1], [NSNull null], nil];

	CPTFill *bandFill = [CPTFill fillWithColor:[[CPTColor darkGrayColor] colorWithAlphaComponent:0.5]];
	[y addBackgroundLimitBand:[CPTLimitBand limitBandWithRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(7.0) length:CPTDecimalFromDouble(1.5)] fill:bandFill]];
	[y addBackgroundLimitBand:[CPTLimitBand limitBandWithRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.5) length:CPTDecimalFromDouble(3.0)] fill:bandFill]];

	// Label y2 with an equal division labeling policy.
	axisLineStyle.lineColor = [CPTColor orangeColor];

	CPTXYAxis *y2 = [[[CPTXYAxis alloc] init] autorelease];
	y2.coordinate				   = CPTCoordinateY;
	y2.plotSpace				   = plotSpace;
	y2.orthogonalCoordinateDecimal = CPTDecimalFromDouble(-10.0);
	y2.labelingPolicy			   = CPTAxisLabelingPolicyEqualDivisions;
	y2.separateLayers			   = NO;
	y2.preferredNumberOfMajorTicks = 6;
	y2.minorTicksPerInterval	   = 9;
	y2.tickDirection			   = CPTSignPositive;
	y2.axisLineStyle			   = axisLineStyle;
	y2.majorTickLength			   = 6.0;
	y2.majorTickLineStyle		   = axisLineStyle;
	y2.minorTickLength			   = 4.0;
	y2.title					   = @"Y2 Axis";
	y2.titleTextStyle			   = axisTitleTextStyle;
	y2.titleOffset				   = 30.0;

	// Add the y2 axis to the axis set
	graph.axisSet.axes = [NSArray arrayWithObjects:x, y, y2, nil];
}

@end


text:
# grunt-commenthash [![Build Status](https://travis-ci.org/meinaart/grunt-commenthash.svg?branch=master)](https://travis-ci.org/meinaart/grunt-commenthash)

Calculates a unique hash of a file. This hash will be added as a comment to javascript, CSS, PHP and HTML files.

## Getting Started
This plugin requires Grunt `~0.4.0`

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

```shell
npm install grunt-commenthash --save-dev
```

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

```js
grunt.loadNpmTasks('grunt-commmenthash');
```

*This plugin was designed to work with Grunt 0.4.x. If you're still using grunt v0.3.x it's strongly recommended that [you upgrade](http://gruntjs.com/upgrading-from-0.3-to-0.4).*

[grunt]: http://gruntjs.com/
[getting_started]: https://github.com/gruntjs/grunt/blob/master/docs/getting_started.md

## Documentation

```javascript
grunt.initConfig({
	commenthash: {
		options: {
			hashLength: 8, // hash length, the max value depends on your hash function
			hashFunction: function(source, encoding){ // default is md5
				return require('crypto').createHash('sha1').update(source, encoding).digest('hex');
			},
      footer: '<%= grunt.template.today("yyyy-mm-dd") %> - <%= commenthash.value %>', // Comment text template
      banner: false // Can be true, false, a string or a function that returns a template/boolean. Function retrieves some metadata.
		},
    expand: true,
    cwd: 'src/',
    src: '**/*.js',
    dest: dist/'
	}
});
grunt.loadNpmTasks('grunt-commenthash');
```

Configuration follow the multi-task standard configuration format: http://gruntjs.com/configuring-tasks

```javascript
grunt.initConfig({
  commenthash: {
    options: {
      footer: false,
      banner: function(data) {
        if(data.src === 'src/test1.js') {
          return 'test1 - <%= commenthash.value %>';
        } else {
          return true;
        }
      }
    },
    expand: true,
    cwd: 'src/',
    src: '**/*.js',
    dest: 'dist/'
  }
});
grunt.loadNpmTasks('grunt-commenthash');
```

## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [grunt][grunt].

## License
Based on the hard work of grunt-hash creator Greg Allen:
https://github.com/jgallen23/grunt-hash

Copyright (c) 2014 Meinaart van Straalen
Licensed under the MIT license.


text:
/**
* Program Name:        HiLoLN.java
* Program Purpose:     Generate a random number between 1 and 100 and make
*                      the user guess it (while telling the user if their
*                      guess was too high or too low).
* Date Created:        9/16/2016
* Last Updated:        9/18/2016
*
* @author     Liam Nickell
* @version    1.0.0
*/

import java.util.*;

public class HiLoLN {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        boolean userIsPlaying = true;

        System.out.println("I will generate a random number between 1 and "
                            + "100 and you will try to guess in as few "
                            + "guesses as possible. I will tell you whether "
                            + "your guess is too high or too low. Type \'q\' "
                            + "to exit the game.");
        while(userIsPlaying) {
            int randomNum = (int)(Math.random() * 100) + 1;
            int guesses = 0;
            boolean newGame = false;

            while(userIsPlaying && !newGame) {
                String response = scan.nextLine();

                if(response.equals("q")) {
                    System.out.println("Ok, quitting...");
                    userIsPlaying = false;
                } else if(Integer.parseInt(response) > randomNum) {
                    System.out.println("Too high!");
                    guesses++;
                } else if(Integer.parseInt(response) < randomNum) {
                    System.out.println("Too low!");
                    guesses++;
                } else {
                    System.out.println("You got it!");
                    System.out.printf("That took you %d guesses.\n", guesses);
                    System.out.println("Want to play again?");
                    response = scan.nextLine();

                    if(response.equals("yes") || response.equals("y")) {
                        System.out.println("Okay! Starting new game...");
                        newGame = true;
                    } else {
                        System.out.println("Ok, quitting...");
                        userIsPlaying = false;
                    }
                }
            }
        }
    }

}


text:
Settings and Defaults
=====================

The default settings for new instances of :py:class:`BlackRed <blackred.blackred.BlackRed>` can be defined with the
attributes of the :py:class:`Settings <blackred.blackred.BlackRed.Settings>` subclass.

For all available options, see the :py:class:`Settings <blackred.blackred.BlackRed.Settings>` documentation at the
:doc:`blackred API docs <../api/blackred>`.


text:
package com.google.flatbuffers;

import static com.google.flatbuffers.Constants.*;
import java.util.Arrays;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.charset.Charset;

// Class that helps you build a FlatBuffer.
// See the section "Use in Java" in the main FlatBuffers documentation.

public class FlatBufferBuilder {
    ByteBuffer bb;       // Where we construct the FlatBuffer.
    int space;           // Remaining space in the ByteBuffer.
    static final Charset utf8charset = Charset.forName("UTF-8");
    int minalign = 1;    // Minimum alignment encountered so far.
    int[] vtable = null; // The vtable for the current table, null otherwise.
    int object_start;    // Starting offset of the current struct/table.
    int[] vtables = new int[16];  // List of offsets of all vtables.
    int num_vtables = 0;          // Number of entries in `vtables` in use.
    int vector_num_elems = 0;     // For the current vector being built.

    // Start with a buffer of size `initial_size`, then grow as required.
    public FlatBufferBuilder(int initial_size) {
        if (initial_size <= 0) initial_size = 1;
        space = initial_size;
        bb = newByteBuffer(initial_size);
    }

    // Alternative constructor allowing reuse of ByteBuffers
    public FlatBufferBuilder(ByteBuffer existing_bb) {
        bb = existing_bb;
        bb.clear();
        bb.order(ByteOrder.LITTLE_ENDIAN);
        space = bb.capacity();
    }

    static ByteBuffer newByteBuffer(int capacity) {
        ByteBuffer newbb = ByteBuffer.allocate(capacity);
        newbb.order(ByteOrder.LITTLE_ENDIAN);
        return newbb;
    }

    // Doubles the size of the ByteBuffer, and copies the old data towards the
    // end of the new buffer (since we build the buffer backwards).
    static ByteBuffer growByteBuffer(ByteBuffer bb) {
        int old_buf_size = bb.capacity();
        if ((old_buf_size & 0xC0000000) != 0)  // Ensure we don't grow beyond what fits in an int.
            throw new AssertionError("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");
        int new_buf_size = old_buf_size << 1;
        bb.position(0);
        ByteBuffer nbb = newByteBuffer(new_buf_size);
        nbb.position(new_buf_size - old_buf_size);
        nbb.put(bb);
        return nbb;
    }

    // Offset relative to the end of the buffer.
    public int offset() {
        return bb.capacity() - space;
    }

    public void pad(int byte_size) {
        for (int i = 0; i < byte_size; i++) bb.put(--space, (byte)0);
    }

    // Prepare to write an element of `size` after `additional_bytes`
    // have been written, e.g. if you write a string, you need to align such
    // the int length field is aligned to SIZEOF_INT, and the string data follows it
    // directly.
    // If all you need to do is align, `additional_bytes` will be 0.
    public void prep(int size, int additional_bytes) {
        // Track the biggest thing we've ever aligned to.
        if (size > minalign) minalign = size;
        // Find the amount of alignment needed such that `size` is properly
        // aligned after `additional_bytes`
        int align_size = ((~(bb.capacity() - space + additional_bytes)) + 1) & (size - 1);
        // Reallocate the buffer if needed.
        while (space < align_size + size + additional_bytes) {
            int old_buf_size = bb.capacity();
            bb = growByteBuffer(bb);
            space += bb.capacity() - old_buf_size;
        }
        pad(align_size);
    }

    // Add a scalar to the buffer, backwards from the current location.
    // Doesn't align nor check for space.
    public void putByte  (byte   x) { bb.put      (space -= 1, x); }
    public void putShort (short  x) { bb.putShort (space -= 2, x); }
    public void putInt   (int    x) { bb.putInt   (space -= 4, x); }
    public void putLong  (long   x) { bb.putLong  (space -= 8, x); }
    public void putFloat (float  x) { bb.putFloat (space -= 4, x); }
    public void putDouble(double x) { bb.putDouble(space -= 8, x); }

    // Adds a scalar to the buffer, properly aligned, and the buffer grown
    // if needed.
    public void addByte  (byte   x) { prep(1, 0); putByte  (x); }
    public void addShort (short  x) { prep(2, 0); putShort (x); }
    public void addInt   (int    x) { prep(4, 0); putInt   (x); }
    public void addLong  (long   x) { prep(8, 0); putLong  (x); }
    public void addFloat (float  x) { prep(4, 0); putFloat (x); }
    public void addDouble(double x) { prep(8, 0); putDouble(x); }

    // Adds on offset, relative to where it will be written.
    public void addOffset(int off) {
        prep(SIZEOF_INT, 0);  // Ensure alignment is already done.
        assert off <= offset();
        off = offset() - off + SIZEOF_INT;
        putInt(off);
    }

    public void startVector(int elem_size, int num_elems, int alignment) {
        notNested();
        vector_num_elems = num_elems;
        prep(SIZEOF_INT, elem_size * num_elems);
        prep(alignment, elem_size * num_elems); // Just in case alignment > int.
    }

    public int endVector() {
        putInt(vector_num_elems);
        return offset();
    }

    public int createString(String s) {
        byte[] utf8 = s.getBytes(utf8charset);
        addByte((byte)0);
        startVector(1, utf8.length, 1);
        bb.position(space -= utf8.length);
        bb.put(utf8, 0, utf8.length);
        return endVector();
    }

    public void notNested() {
        // You should not be creating any other objects or strings/vectors
        // while an object is being constructed
        if (vtable != null)
            throw new AssertionError("FlatBuffers: object serialization must not be nested.");
    }

    public void Nested(int obj) {
        // Structs are always stored inline, so need to be created right
        // where they are used. You'll get this assert if you created it
        // elsewhere.
        if (obj != offset())
            throw new AssertionError("FlatBuffers: struct must be serialized inline.");
    }

    public void startObject(int numfields) {
        notNested();
        vtable = new int[numfields];
        object_start = offset();
    }

    // Add a scalar to a table at `o` into its vtable, with value `x` and default `d`
    public void addByte  (int o, byte   x, int    d) { if(x != d) { addByte  (x); slot(o); } }
    public void addShort (int o, short  x, int    d) { if(x != d) { addShort (x); slot(o); } }
    public void addInt   (int o, int    x, int    d) { if(x != d) { addInt   (x); slot(o); } }
    public void addLong  (int o, long   x, long   d) { if(x != d) { addLong  (x); slot(o); } }
    public void addFloat (int o, float  x, double d) { if(x != d) { addFloat (x); slot(o); } }
    public void addDouble(int o, double x, double d) { if(x != d) { addDouble(x); slot(o); } }
    public void addOffset(int o, int    x, int    d) { if(x != d) { addOffset(x); slot(o); } }

    // Structs are stored inline, so nothing additional is being added. `d` is always 0.
    public void addStruct(int voffset, int x, int d) {
        if(x != d) {
            Nested(x);
            slot(voffset);
        }
    }

    // Set the current vtable at `voffset` to the current location in the buffer.
    public void slot(int voffset) {
        vtable[voffset] = offset();
    }

    public int endObject() {
        assert vtable != null; // calling endObject without a startObject
        addInt(0);
        int vtableloc = offset();
        // Write out the current vtable.
        for (int i = vtable.length - 1; i >= 0 ; i--) {
            // Offset relative to the start of the table.
            short off = (short)(vtable[i] != 0 ? vtableloc - vtable[i] : 0);
            addShort(off);
        }

        final int standard_fields = 2; // The fields below:
        addShort((short)(vtableloc - object_start));
        addShort((short)((vtable.length + standard_fields) * SIZEOF_SHORT));

        // Search for an existing vtable that matches the current one.
        int existing_vtable = 0;
        outer_loop:
        for (int i = 0; i < num_vtables; i++) {
            int vt1 = bb.capacity() - vtables[i];
            int vt2 = space;
            short len = bb.getShort(vt1);
            if (len == bb.getShort(vt2)) {
                for (int j = SIZEOF_SHORT; j < len; j += SIZEOF_SHORT) {
                    if (bb.getShort(vt1 + j) != bb.getShort(vt2 + j)) {
                        continue outer_loop;
                    }
                }
                existing_vtable = vtables[i];
                break outer_loop;
            }
        }

        if (existing_vtable != 0) {
            // Found a match:
            // Remove the current vtable.
            space = bb.capacity() - vtableloc;
            // Point table to existing vtable.
            bb.putInt(space, existing_vtable - vtableloc);
        } else {
            // No match:
            // Add the location of the current vtable to the list of vtables.
            if (num_vtables == vtables.length) vtables = Arrays.copyOf(vtables, num_vtables * 2);
            vtables[num_vtables++] = offset();
            // Point table to current vtable.
            bb.putInt(bb.capacity() - vtableloc, offset() - vtableloc);
        }

        vtable = null;
        return vtableloc;
    }

    // This checks a required field has been set in a given table that has
    // just been constructed.
    public void required(int table, int field) {
        int table_start = bb.capacity() - table;
        int vtable_start = table_start - bb.getInt(table_start);
        boolean ok = bb.getShort(vtable_start + field) != 0;
        // If this fails, the caller will show what field needs to be set.
        if (!ok)
            throw new AssertionError("FlatBuffers: field " + field + " must be set");
    }

    public void finish(int root_table) {
        prep(minalign, SIZEOF_INT);
        addOffset(root_table);
        bb.position(space);
    }

    public void finish(int root_table, String file_identifier) {
        prep(minalign, SIZEOF_INT + FILE_IDENTIFIER_LENGTH);
        if (file_identifier.length() != FILE_IDENTIFIER_LENGTH)
            throw new AssertionError("FlatBuffers: file identifier must be length " +
                                     FILE_IDENTIFIER_LENGTH);
        for (int i = FILE_IDENTIFIER_LENGTH - 1; i >= 0; i--) {
            addByte((byte)file_identifier.charAt(i));
        }
        finish(root_table);
    }

    // Get the ByteBuffer representing the FlatBuffer. Only call this after you've
    // called finish(). The actual data starts at the ByteBuffer's current position,
    // not necessarily at 0.
    public ByteBuffer dataBuffer() { return bb; }

    // The FlatBuffer data doesn't start at offset 0 in the ByteBuffer,
    // but now the ByteBuffer's position is set to that location upon
    // finish(). This method should not be needed anymore, but is left
    // here as private for the moment to document this API change.
    // It will be removed in the future.
    private int dataStart() {
        return space;
    }

    public byte[] sizedByteArray(int start, int length){
        byte[] array = new byte[length];
        bb.position(start);
        bb.get(array);
        return array;
    }

    // Utility function for copying a byte array that starts at 0.
    public byte[] sizedByteArray() {
        return sizedByteArray(space, bb.capacity() - space);
    }
}


text:
        {{ vm.legend().title | translate }}

{{ vm.legend().info | translate }}

        <ui-transclude-here></ui-transclude-here>


text:
#ifndef _NETNS_IDP_H_
#define _NETNS_IDP_H_

/*
 * Definitions for NS(tm) Internet Datagram Protocol
 */
struct idp {
	u_short	idp_sum;	/* Checksum */
	u_short	idp_len;	/* Length, in bytes, including header */
	u_char	idp_tc;		/* Transport Control (i.e. hop count) */
	u_char	idp_pt;		/* Packet Type (i.e. level 2 protocol) */
	struct ns_addr	idp_dna;	/* Destination Network Address */
	struct ns_addr	idp_sna;	/* Source Network Address */
};

#endif


text:
package main

import (
	"errors"
	"github.com/ncw/swift"
	"github.com/yob/graval"
	"io"
	"io/ioutil"
	"log"
	"os"
	"path/filepath"
	"strings"
	"time"
)

// A minimal driver for graval that stores all data on rackspace cloudfiles. The
// authentication are ignored, any username and password will work.
//
// This really just exists as a minimal demonstration of the interface graval
// drivers are required to implement.
type SwiftDriver struct{
	connection *swift.Connection
	container  string
	user       string
}

func (driver *SwiftDriver) Authenticate(user string, pass string) bool {
	log.Printf("Authenticate: %s %s", user, pass)
	driver.user = user
	return true
}
func (driver *SwiftDriver) Bytes(path string) (bytes int) {
	path = scoped_path(driver.user, path)
	log.Printf("Bytes: %s", path)
	object, _, err := driver.connection.Object(driver.container, path)
	if err != nil {
		return -1
	}
	return int(object.Bytes)
}
func (driver *SwiftDriver) ModifiedTime(path string) (time.Time, error) {
	path = scoped_path(driver.user, path)
	log.Printf("ModifiedTime: %s", path)
	object, _, err := driver.connection.Object(driver.container, path)
	if err != nil {
		return time.Now(), err
	}
	return object.LastModified, nil
}
func (driver *SwiftDriver) ChangeDir(path string) bool {
	path = scoped_path(driver.user, path)
	if path == ("/"+driver.user) {
		return true
	}
	log.Printf("ChangeDir: %s", path)
	object, _, err := driver.connection.Object(driver.container, path)
	if err != nil {
		return false
	}
	return object.ContentType == "application/directory"
}
func (driver *SwiftDriver) DirContents(path string) (files []os.FileInfo) {
	path = scoped_path_with_trailing_slash(driver.user, path)
	log.Printf("DirContents: %s", path)
	opts    := &swift.ObjectsOpts{Prefix:path, Delimiter:'/'}
	objects, err := driver.connection.ObjectsAll(driver.container, opts)
	if err != nil {
		return // error connecting to cloud files
	}
	for _, object := range objects {
		tail     := strings.Replace(object.Name, path, "", 1)
        basename := strings.Split(tail, "/")[0]
		if object.ContentType == "application/directory" && object.SubDir == "" {
			files = append(files, graval.NewDirItem(basename))
		} else if object.ContentType != "application/directory"  {
			files = append(files, graval.NewFileItem(basename, int(object.Bytes)))
		}
	}
	return
}

func (driver *SwiftDriver) DeleteDir(path string) bool {
	path = scoped_path(driver.user, path)
	log.Printf("DeleteDir: %s", path)
	err := driver.connection.ObjectDelete(driver.container, path)
	if err != nil {
		return false
	}
	return true
}
func (driver *SwiftDriver) DeleteFile(path string) bool {
	path = scoped_path(driver.user, path)
	log.Printf("DeleteFile: %s", path)
	err := driver.connection.ObjectDelete(driver.container, path)
	if err != nil {
		return false
	}
	return true
}
func (driver *SwiftDriver) Rename(fromPath string, toPath string) bool {
	fromPath = scoped_path(driver.user, fromPath)
	toPath   = scoped_path(driver.user, toPath)
	log.Printf("Rename: %s %s", fromPath, toPath)
	return false
}
func (driver *SwiftDriver) MakeDir(path string) bool {
	path = scoped_path(driver.user, path)
	log.Printf("MakeDir: %s", path)
	opts    := &swift.ObjectsOpts{Prefix:path}
	objects, err := driver.connection.ObjectNames(driver.container, opts)
	if err != nil {
		return false // error connection to cloud files
	}
	if len(objects) > 0 {
		return false // the dir already exists
	}
	driver.connection.ObjectPutString(driver.container, path, "", "application/directory")
	return true
}
func (driver *SwiftDriver) GetFile(path string) (data string, err error) {
	path = scoped_path(driver.user, path)
	log.Printf("GetFile: %s", path)
	data, err = driver.connection.ObjectGetString(driver.container, path)
	if err != nil {
		return "", errors.New("foo")
	}
	return
}
func (driver *SwiftDriver) PutFile(destPath string, data io.Reader) bool {
	destPath = scoped_path(driver.user, destPath)
	log.Printf("PutFile: %s", destPath)
	contents, err := ioutil.ReadAll(data)
	if err != nil {
		return false
	}
	err = driver.connection.ObjectPutBytes(driver.container, destPath, contents, "application/octet-stream")
	if err != nil {
		return false
	}
	return true
}

func scoped_path_with_trailing_slash(user string, path string) string {
	path = scoped_path(user, path)
	if !strings.HasSuffix(path, "/") {
		path += "/"
	}
	if path == "/" {
		return ""
	}
	return path
}

func scoped_path(user string, path string) string {
	if path == "/" {
		path = ""
	}
	return filepath.Join("/", user, path)
}

// graval requires a factory that will create a new driver instance for each
// client connection. Generally the factory will be fairly minimal. This is
// a good place to read any required config for your driver.
type SwiftDriverFactory struct{}

func (factory *SwiftDriverFactory) NewDriver() (graval.FTPDriver, error) {
	driver := &SwiftDriver{}
	driver.container  = os.Getenv("Container")
	if driver.container == "" {
		return nil, errors.New("Container env variable not set")
	}
	driver.connection = &swift.Connection{
		UserName: os.Getenv("UserName"),
		ApiKey:   os.Getenv("ApiKey"),
		AuthUrl:  os.Getenv("AuthUrl"),
	}
	err := driver.connection.Authenticate()
	if err != nil {
		return nil, err
	}
	return driver, nil
}

// it's alive!
func main() {
	factory := &SwiftDriverFactory{}
	ftpServer := graval.NewFTPServer(&graval.FTPServerOpts{ Factory: factory })
	err := ftpServer.ListenAndServe()
	if err != nil {
		log.Fatal("Error starting server!")
		log.Fatal(err)
	}
}


text:
package com.greatfeat.greatfeat.model;

import com.google.gson.annotations.SerializedName;

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

/**
 * Created by edwardbryanabergas on 15/06/2017.
 */

public class ApiResponse {

    @SerializedName("status")
    private String status;

    @SerializedName("source")
    private String source;

    @SerializedName("sortBy")
    private String sortBy;

    @SerializedName("articles")
    private List<Articles> articlesList = new ArrayList<>();

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getSortBy() {
        return sortBy;
    }

    public void setSortBy(String sortBy) {
        this.sortBy = sortBy;
    }

    public List<Articles> getArticlesList() {
        return articlesList;
    }

    public void setArticlesList(List<Articles> articlesList) {
        this.articlesList = articlesList;
    }
}


text:
layout: default
key: 2013_infovis_lineup_video_preview
name: LineUp InfoVis Preview Video
year: 2013
youtube-id: ri3ccKuUBYU
file: 2013_infovis_lineup_preview.mp4
---


text:
#ifndef PORT_PROTOS_H
#define PORT_PROTOS_H

#include <dlfcn.h>
#include "utils/dynamic_loader.h"		/* pgrminclude ignore */

/*
 * In some older systems, the RTLD_NOW flag isn't defined and the mode
 * argument to dlopen must always be 1.  The RTLD_GLOBAL flag is wanted
 * if available, but it doesn't exist everywhere.
 * If it doesn't exist, set it to 0 so it has no effect.
 */
#ifndef RTLD_NOW
#define RTLD_NOW 1
#endif
#ifndef RTLD_GLOBAL
#define RTLD_GLOBAL 0
#endif

#define  pg_dlopen(f)	dlopen((f), RTLD_NOW | RTLD_GLOBAL)
#define  pg_dlsym(h, f) ((PGFunction) dlsym(h, f))
#define  pg_dlclose(h)	dlclose(h)
#define  pg_dlerror()	dlerror()

#endif   /* PORT_PROTOS_H */