text:
function loadPageCount(callback) {
    function filteredRequest(filters) {
        var url = window.scrudFactory.viewAPI + "/count-where";
        var data = JSON.stringify(filters);
        return getAjaxRequest(url, "POST", data);
    };

    function request(filterName, filters) {
        if (!filters && getFilterQueryStringCount()) {
            filters = getQuerystringFilters();

            return filteredRequest(filters);
        };

        var url = window.scrudFactory.viewAPI + "/count";

        if (filterName) {
            url = window.scrudFactory.viewAPI + "/count-filtered/" + filterName;
        };

        if (!filters || !filters.length) {
            return getAjaxRequest(url);
        };

        url = window.scrudFactory.viewAPI + "/count-where";
        var data = JSON.stringify(filters);

        return getAjaxRequest(url, "POST", data);
    };

    $(".view.dimmer").addClass("active");

    if (checkIfProcedure()) {
        if (typeof callback === "function") {
            callback();
        };

        return;
    };

    var filterName = getFilterName();
    var filters = getSelectedFilter();

    var ajax = request(filterName, filters);

    ajax.success(function (response) {
        var pages = (Math.ceil(window.parseInt(response) / 10) || 1);

        $(".total.pages.anchor").text(pages);

        if (typeof callback === "function") {
            callback();
        };
    });

    ajax.fail(function (xhr) {
        logAjaxErrorMessage(xhr);
    });
};


text:
public class Queue extends BankEntity {
    private int size;

    /**
     * Initialises new bank queue.
     *
     * @param bo - bank service organiser
     */
    public Queue(BankServiceOrganizer bo) {
        super(bo);
    }

    /**
     * Dequeue client.
     */
    public void dequeue() {
        if (size > 0)
            size--;
    }

    /**
     * Enqueue client.
     */
    public void enqueue() {
        size++;
        changed();
    }

    /**
     * Returns size of bank queue.
     *
     * @return size of queue
     */
    public int getSize() {
        return size;
    }
}

redpajama_set_name: RedPajamaGithub


text:
(function() {
  'use strict';

  describe('horizon.framework.util.actions.action-result.service', function() {
    var service;

    beforeEach(module('horizon.framework.util.actions'));

    beforeEach(inject(function($injector) {
      service = $injector.get('horizon.framework.util.actions.action-result.service');
    }));

    describe('getIdsOfType', function() {

      it('returns an empty array if no items', function() {
        expect(service.getIdsOfType([], 'OS::Glance::Image')).toEqual([]);
      });

      it('returns an empty array if items is falsy', function() {
        expect(service.getIdsOfType(false, 'OS::Glance::Image')).toEqual([]);
      });

      it('returns items with matching type', function() {
        var items = [{type: 'No::Match'}, {type: 'OS::Glance::Image', id: 1},
          {type: 'OS::Glance::Image', id: 2}];
        expect(service.getIdsOfType(items, 'OS::Glance::Image')).toEqual([1, 2]);
      });
    });

    it('has getActionResult', function() {
      expect(service.getActionResult).toBeDefined();
    });

    describe('ActionResult', function() {
      var actionResult;
      var type = 'OS::Nova::Server';
      var id = 'the-id-value';

      beforeEach(function() {
        actionResult = service.getActionResult();
      });

      it('.updated() adds updated items', function() {
        actionResult.updated(type, id);
        expect(actionResult.result.updated)
          .toEqual([{type: 'OS::Nova::Server', id: 'the-id-value'}]);
      });

      it('.created() adds created items', function() {
        actionResult.created(type, id);
        expect(actionResult.result.created)
          .toEqual([{type: 'OS::Nova::Server', id: 'the-id-value'}]);
      });

      it('.deleted() adds deleted items', function() {
        actionResult.deleted(type, id);
        expect(actionResult.result.deleted)
          .toEqual([{type: 'OS::Nova::Server', id: 'the-id-value'}]);
      });

      it('.failed() adds failed items', function() {
        actionResult.failed(type, id);
        expect(actionResult.result.failed)
          .toEqual([{type: 'OS::Nova::Server', id: 'the-id-value'}]);
      });

    });

  });

})();


text:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from absl import app, flags
import glob
import os

FLAGS = flags.FLAGS
flags.DEFINE_string('input_dir', default='/home/fede/projects/relco/data/prep/amazon/seccurvs', help='Dir with "outseccurv-*" files')

def main(_):
    files = glob.glob(os.path.join(FLAGS.input_dir, "outseccurv-*"))
    graphs = []
    allrel_curvs, norel_curvs = [], []
    for f in files:
        this_curvs = np.load(f)

        this_graph = f.split("-")[1]
        if not graphs or (graphs and graphs[-1] != this_graph):
            graphs += [this_graph] * len(this_curvs)

        rels = f.split("-")[-1].split(".")[0]
        if rels == "norel":
            norel_curvs.append(this_curvs)
        else:
            allrel_curvs.append(this_curvs)

    df = pd.DataFrame({
        "Graph": graphs,
        "norel": np.concatenate(norel_curvs, axis=0),
        "allrel": np.concatenate(allrel_curvs, axis=0)
    })
    df = df[["Graph", "norel", "allrel"]]
    dd = pd.melt(df, id_vars=['Graph'], value_vars=['norel', 'allrel'], var_name='Variants', value_name="SecCurv")
    plot = sns.boxplot(x='Graph', y='SecCurv', data=dd, hue='Variants')
    plot.get_figure().savefig("seccurv-boxplot.png")

if __name__ == '__main__':
    app.run(main)


text:
// Karma configuration
// Generated on Thu Sep 22 2016 13:02:57 GMT+0200 (SAST)
var webpackConfig = require('../webpack.config');

process.env.BABEL_ENV = "test";

module.exports = function(config) {
  config.set({

    // base path that will be used to resolve all patterns (eg. files, exclude)
    basePath: '',

    // frameworks to use
    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
    frameworks: ['jasmine'],

    // list of files / patterns to load in the browser
    files: [
      '../src/index.js',
      '../node_modules/angular-mocks/angular-mocks.js',
      '../src/**/*.spec.js'
    ],

    // list of files to exclude
    exclude: [
    ],

    // preprocess matching files before serving them to the browser
    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
    preprocessors: {
      ['../src/index.js']: ['webpack'],
      ['../src/**/*.spec.js']: ['webpack']
    },

    webpack: webpackConfig,

    // test results reporter to use
    // possible values: 'dots', 'progress'
    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
    reporters: ['progress', 'coverage'],

    coverageReporter: {
      reporters: [
        {type: 'lcov', dir: '../coverage', 'subdir': '.'},
        {type: 'json', dir: '../coverage', 'subdir': '.'},
        {type: 'text-summary'}
      ]
    },

    // web server port
    port: 9876,

    // enable / disable colors in the output (reporters and logs)
    colors: true,

    // level of logging
    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
    logLevel: config.LOG_INFO,

    // enable / disable watching file and executing tests whenever any file changes
    autoWatch: false,

    // start these browsers
    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
    browsers: ['PhantomJS'],

    // Continuous Integration mode
    // if true, Karma captures browsers, runs the tests and exits
    singleRun: true,

    // Concurrency level
    // how many browser should be started simultaneous
    concurrency: Infinity
  })
}


text:
TEST(ImageUtilTest, JPEGEncodeAndDecode) {
  gfx::Image original = gfx::test::CreateImage(100, 100);

  std::vector<unsigned char> encoded;
  ASSERT_TRUE(gfx::JPEG1xEncodedDataFromImage(original, 80, &encoded));

  gfx::Image decoded =
      gfx::ImageFrom1xJPEGEncodedData(&encoded.front(), encoded.size());

  // JPEG is lossy, so simply check that the image decoded successfully.
  EXPECT_FALSE(decoded.IsEmpty());
}

TEST(ImageUtilTest, GetVisibleMargins) {
  int left, right;

  // Fully transparent image.
  {
    SkBitmap bitmap;
    bitmap.allocN32Pixels(16, 14);
    bitmap.eraseColor(SK_ColorTRANSPARENT);
    gfx::ImageSkia img(gfx::ImageSkia::CreateFrom1xBitmap(bitmap));
    gfx::GetVisibleMargins(img, &left, &right);
    EXPECT_EQ(8, left);
    EXPECT_EQ(8, right);
  }

  // Fully non-transparent image.
  {
    SkBitmap bitmap;
    bitmap.allocN32Pixels(16, 14);
    bitmap.eraseColor(SK_ColorYELLOW);
    gfx::ImageSkia img(gfx::ImageSkia::CreateFrom1xBitmap(bitmap));
    gfx::GetVisibleMargins(img, &left, &right);
    EXPECT_EQ(0, left);
    EXPECT_EQ(0, right);
  }

  // Image with non-transparent section in center.
  {
    SkBitmap bitmap;
    bitmap.allocN32Pixels(16, 14);
    bitmap.eraseColor(SK_ColorTRANSPARENT);
    bitmap.eraseArea(SkIRect::MakeLTRB(3, 2, 13, 13), SK_ColorYELLOW);
    gfx::ImageSkia img(gfx::ImageSkia::CreateFrom1xBitmap(bitmap));
    gfx::GetVisibleMargins(img, &left, &right);
    EXPECT_EQ(3, left);
    EXPECT_EQ(3, right);
  }

  // Image with non-transparent section skewed to one side.
  {
    SkBitmap bitmap;
    bitmap.allocN32Pixels(16, 14);
    bitmap.eraseColor(SK_ColorTRANSPARENT);
    bitmap.eraseArea(SkIRect::MakeLTRB(3, 2, 5, 5), SK_ColorYELLOW);
    gfx::ImageSkia img(gfx::ImageSkia::CreateFrom1xBitmap(bitmap));
    gfx::GetVisibleMargins(img, &left, &right);
    EXPECT_EQ(3, left);
    EXPECT_EQ(11, right);
  }

  // Image with non-transparent section at leading edge.
  {
    SkBitmap bitmap;
    bitmap.allocN32Pixels(16, 14);
    bitmap.eraseColor(SK_ColorTRANSPARENT);
    bitmap.eraseArea(SkIRect::MakeLTRB(0, 3, 5, 5), SK_ColorYELLOW);
    gfx::ImageSkia img(gfx::ImageSkia::CreateFrom1xBitmap(bitmap));
    gfx::GetVisibleMargins(img, &left, &right);
    EXPECT_EQ(0, left);
    EXPECT_EQ(11, right);
  }

  // Image with non-transparent section at trailing edge.
  {
    SkBitmap bitmap;
    bitmap.allocN32Pixels(16, 14);
    bitmap.eraseColor(SK_ColorTRANSPARENT);
    bitmap.eraseArea(SkIRect::MakeLTRB(4, 3, 16, 13), SK_ColorYELLOW);
    gfx::ImageSkia img(gfx::ImageSkia::CreateFrom1xBitmap(bitmap));
    gfx::GetVisibleMargins(img, &left, &right);
    EXPECT_EQ(4, left);
    EXPECT_EQ(0, right);
  }

  // Image with narrow non-transparent section.
  {
    SkBitmap bitmap;
    bitmap.allocN32Pixels(16, 14);
    bitmap.eraseColor(SK_ColorTRANSPARENT);
    bitmap.eraseArea(SkIRect::MakeLTRB(8, 3, 9, 5), SK_ColorYELLOW);
    gfx::ImageSkia img(gfx::ImageSkia::CreateFrom1xBitmap(bitmap));
    gfx::GetVisibleMargins(img, &left, &right);
    EXPECT_EQ(8, left);
    EXPECT_EQ(7, right);
  }

  // Image with faint pixels.
  {
    SkBitmap bitmap;
    bitmap.allocN32Pixels(16, 14);
    bitmap.eraseColor(SkColorSetA(SK_ColorYELLOW, 0x02));
    gfx::ImageSkia img(gfx::ImageSkia::CreateFrom1xBitmap(bitmap));
    gfx::GetVisibleMargins(img, &left, &right);
    EXPECT_EQ(8, left);
    EXPECT_EQ(8, right);
  }

  // Fully transparent image with odd width.
  {
    SkBitmap bitmap;
    bitmap.allocN32Pixels(17, 14);
    bitmap.eraseColor(SK_ColorTRANSPARENT);
    gfx::ImageSkia img(gfx::ImageSkia::CreateFrom1xBitmap(bitmap));
    gfx::GetVisibleMargins(img, &left, &right);
    EXPECT_EQ(9, left);
    EXPECT_EQ(8, right);
  }
}

TEST(ImageUtilTest, ResizedImageForSearchByImage) {
  // Make sure the image large enough to let ResizedImageForSearchByImage to
  // resize the image.
  gfx::Image original_image =
      gfx::test::CreateImage(gfx::kSearchByImageMaxImageWidth * 2,
                             gfx::kSearchByImageMaxImageHeight * 2);

  gfx::Image resized_image = gfx::ResizedImageForSearchByImage(original_image);
  EXPECT_FALSE(resized_image.IsEmpty());
  EXPECT_EQ(resized_image.Width(), gfx::kSearchByImageMaxImageWidth);
  EXPECT_EQ(resized_image.Height(), gfx::kSearchByImageMaxImageHeight);
}

TEST(ImageUtilTest, ResizedImageForSearchByImageShouldKeepRatio) {
  // Make sure the image large enough to let ResizedImageForSearchByImage to
  // resize the image.
  gfx::Image original_image = gfx::test::CreateImage(600, 600);

  gfx::Image resized_image = gfx::ResizedImageForSearchByImage(original_image);
  EXPECT_EQ(resized_image.Width(), 400);
  EXPECT_EQ(resized_image.Height(), 400);
}


text:
#include "opt_ktrace.h"

#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");

#include <sys/param.h>
#include <sys/bus.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/signalvar.h>
#include <sys/ktr.h>
#ifdef KTRACE
#include <sys/uio.h>
#include <sys/ktrace.h>
#endif

#include <vm/vm.h>
#include <vm/pmap.h>
#include <vm/vm_kern.h>
#include <vm/vm_map.h>
#include <vm/vm_extern.h>
#include <vm/vm_param.h>

#include <machine/cpu.h>
#include <machine/cpu-v6.h>
#include <machine/frame.h>
#include <machine/machdep.h>
#include <machine/pcb.h>
#include <machine/vmparam.h>

#ifdef KDB
#include <sys/kdb.h>
#include <machine/db_machdep.h>
#endif

extern char fusubailout[];

#ifdef DEBUG
int last_fault_code;	/* For the benefit of pmap_fault_fixup() */
#endif

struct ksig {
	int sig;
	u_long code;
	vm_offset_t	addr;
};

typedef int abort_func_t(struct trapframe *, u_int, u_int, u_int, u_int,
    struct thread *, struct ksig *);

static abort_func_t abort_fatal;
static abort_func_t abort_align;
static abort_func_t abort_icache;

struct abort {
	abort_func_t	*func;
	const char	*desc;
};

/*
 * How are the aborts handled?
 *
 * Undefined Code:
 *  - Always fatal as we do not know what does it mean.
 * Imprecise External Abort:
 *  - Always fatal, but can be handled somehow in the future.
 *    Now, due to PCIe buggy harware, ignored.
 * Precise External Abort:
 *  - Always fatal, but who knows in the future???
 * Debug Event:
 *  - Special handling.
 * External Translation Abort (L1 & L2)
 *  - Always fatal as something is screwed up in page tables or harware.
 * Domain Fault (L1 & L2):
 *  - Always fatal as we do not play game with domains.
 * Alignment Fault:
 *  - Everything should be aligned in kernel including user to kernel and
 *    vice versa data copying, so we ignore pcb_onfault, and it's always fatal.
 *    We generate signal in case of abort from user mode.
 * Instruction cache maintenance:
 *  - According to manual, this is translation fault during cache maintenance
 *    operation. So, it could be really complex in SMP case and fuzzy too
 *    for cache operations working on virtual addresses. For now, we will
 *    consider this abort as fatal. In fact, no cache maintenance on
 *    not mapped virtual addresses should be called. As cache maintenance
 *    operation (except DMB, DSB, and Flush Prefetch Buffer) are priviledged,
 *    the abort is fatal for user mode as well for now. (This is good place to
 *    note that cache maintenance on virtual address fill TLB.)
 * Acces Bit (L1 & L2):
 *  - Fast hardware emulation for kernel and user mode.
 * Translation Fault (L1 & L2):
 *  - Standard fault mechanism is held including vm_fault().
 * Permission Fault (L1 & L2):
 *  - Fast harware emulation of modify bits and in other cases, standard
 *    fault mechanism is held including vm_fault().
 */

static const struct abort aborts[] = {
	{abort_fatal,	"Undefined Code (0x000)"},
	{abort_align,	"Alignment Fault"},
	{abort_fatal,	"Debug Event"},
	{NULL,		"Access Bit (L1)"},
	{abort_icache,	"Instruction cache maintenance"},
	{NULL,		"Translation Fault (L1)"},
	{NULL,		"Access Bit (L2)"},
	{NULL,		"Translation Fault (L2)"},

	{abort_fatal,	"External Abort"},
	{abort_fatal,	"Domain Fault (L1)"},
	{abort_fatal,	"Undefined Code (0x00A)"},
	{abort_fatal,	"Domain Fault (L2)"},
	{abort_fatal,	"External Translation Abort (L1)"},
	{NULL,		"Permission Fault (L1)"},
	{abort_fatal,	"External Translation Abort (L2)"},
	{NULL,		"Permission Fault (L2)"},

	{abort_fatal,	"TLB Conflict Abort"},
	{abort_fatal,	"Undefined Code (0x401)"},
	{abort_fatal,	"Undefined Code (0x402)"},
	{abort_fatal,	"Undefined Code (0x403)"},
	{abort_fatal,	"Undefined Code (0x404)"},
	{abort_fatal,	"Undefined Code (0x405)"},
	{abort_fatal,	"Asynchronous External Abort"},
	{abort_fatal,	"Undefined Code (0x407)"},

	{abort_fatal,	"Asynchronous Parity Error on Memory Access"},
	{abort_fatal,	"Parity Error on Memory Access"},
	{abort_fatal,	"Undefined Code (0x40A)"},
	{abort_fatal,	"Undefined Code (0x40B)"},
	{abort_fatal,	"Parity Error on Translation (L1)"},
	{abort_fatal,	"Undefined Code (0x40D)"},
	{abort_fatal,	"Parity Error on Translation (L2)"},
	{abort_fatal,	"Undefined Code (0x40F)"}
};

static __inline void
call_trapsignal(struct thread *td, int sig, int code, vm_offset_t addr)
{
	ksiginfo_t ksi;

	CTR4(KTR_TRAP, "%s: addr: %#x, sig: %d, code: %d",
	   __func__, addr, sig, code);

	/*
	 * TODO: some info would be nice to know
	 * if we are serving data or prefetch abort.
	 */

	ksiginfo_init_trap(&ksi);
	ksi.ksi_signo = sig;
	ksi.ksi_code = code;
	ksi.ksi_addr = (void *)addr;
	trapsignal(td, &ksi);
}

/*
 * abort_imprecise() handles the following abort:
 *
 *  FAULT_EA_IMPREC - Imprecise External Abort
 *
 * The imprecise means that we don't know where the abort happened,
 * thus FAR is undefined. The abort should not never fire, but hot
 * plugging or accidental harware failure can be the cause of it.
 * If the abort happens, it can even be on different (thread) context.
 * Without any additional support, the abort is fatal, as we do not
 * know what really happened.
 *
 * QQQ: Some additional functionality, like pcb_onfault but global,
 *      can be implemented. Imprecise handlers could be registered
 *      which tell us if the abort is caused by something they know
 *      about. They should return one of three codes like:
 *		FAULT_IS_MINE,
 *		FAULT_CAN_BE_MINE,
 *		FAULT_IS_NOT_MINE.
 *      The handlers should be called until some of them returns
 *      FAULT_IS_MINE value or all was called. If all handlers return
 *	FAULT_IS_NOT_MINE value, then the abort is fatal.
 */
static __inline void
abort_imprecise(struct trapframe *tf, u_int fsr, u_int prefetch, u_int usermode)
{
	/* XXXX  We can got imprecise abort as result of access
	 * to not-present PCI/PCIe configuration space.
	 */
#if 0
	goto out;
#endif
	abort_fatal(tf, FAULT_EA_IMPREC, fsr, 0, prefetch, curthread, NULL);

	/*
	 * Returning from this function means that we ignore
	 * the abort for good reason. Note that imprecise abort
	 * could fire any time even in user mode.
	 */

#if 0
out:
	if (usermode)
		userret(curthread, tf);
#endif
}

/*
 * abort_debug() handles the following abort:
 *
 *  FAULT_DEBUG - Debug Event
 *
 */
static __inline void
abort_debug(struct trapframe *tf, u_int fsr, u_int prefetch, u_int usermode,
    u_int far)
{
	if (usermode) {
		struct thread *td;

		td = curthread;
		call_trapsignal(td, SIGTRAP, TRAP_BRKPT, far);
		userret(td, tf);
	} else {
#ifdef KDB
		kdb_trap(T_BREAKPOINT, 0, tf);
#else
		printf("No debugger in kernel.\n");
#endif
	}
}

/*
 * Abort handler.
 *
 * FAR, FSR, and everything what can be lost after enabling
 * interrupts must be grabbed before the interrupts will be
 * enabled. Note that when interrupts will be enabled, we
 * could even migrate to another CPU ...
 *
 * TODO: move quick cases to ASM
 */
void
abort_handler(struct trapframe *tf, int prefetch)
{
	struct thread *td;
	vm_offset_t far, va;
	int idx, usermode;
	uint32_t fsr;
	struct ksig ksig;
	struct proc *p;
	struct pcb *pcb;
	struct vm_map *map;
	struct vmspace *vm;
	vm_prot_t ftype;
	int rv;
#ifdef INVARIANTS
	void *onfault;
#endif
	td = curthread;
	fsr = (prefetch) ? cp15_ifsr_get(): cp15_dfsr_get();
	far = (prefetch) ? TRAPF_PC(tf) : cp15_dfar_get();

	idx = FSR_TO_FAULT(fsr);
	usermode = TRAPF_USERMODE(tf);	/* Abort came from user mode? */
	if (usermode)
		td->td_frame = tf;

	CTR4(KTR_TRAP, "abort_handler: fsr %#x (idx %u) far %#x prefetch %u",
	fsr, idx, far, prefetch);

	/*
	 * Firstly, handle aborts that are not directly related to mapping.
	 */
	if (__predict_false(idx == FAULT_EA_IMPREC)) {
		abort_imprecise(tf, fsr, prefetch, usermode);
		return;
	}

	if (__predict_false(idx == FAULT_DEBUG)) {
		abort_debug(tf, fsr, prefetch, usermode, far);
		return;
	}

#ifdef ARM_NEW_PMAP
	rv = pmap_fault(PCPU_GET(curpmap), far, fsr, idx, usermode);
	if (rv == 0) {
		return;
	} else if (rv == EFAULT) {

		call_trapsignal(td, SIGSEGV, SEGV_MAPERR, far);
		userret(td, tf);
		return;
	}
#endif
	/*
	 * Now, when we handled imprecise and debug aborts, the rest of
	 * aborts should be really related to mapping.
	 *
	 */

	PCPU_INC(cnt.v_trap);

#ifdef KDB
	if (kdb_active) {
		kdb_reenter();
		goto out;
	}
#endif
	if (__predict_false((td->td_pflags & TDP_NOFAULTING) != 0)) {
		/*
		 * Due to both processor errata and lazy TLB invalidation when
		 * access restrictions are removed from virtual pages, memory
		 * accesses that are allowed by the physical mapping layer may
		 * nonetheless cause one spurious page fault per virtual page.
		 * When the thread is executing a "no faulting" section that
		 * is bracketed by vm_fault_{disable,enable}_pagefaults(),
		 * every page fault is treated as a spurious page fault,
		 * unless it accesses the same virtual address as the most
		 * recent page fault within the same "no faulting" section.
		 */
		if (td->td_md.md_spurflt_addr != far ||
		    (td->td_pflags & TDP_RESETSPUR) != 0) {
			td->td_md.md_spurflt_addr = far;
			td->td_pflags &= ~TDP_RESETSPUR;

			tlb_flush_local(far & ~PAGE_MASK);
			return;
		}
	} else {
		/*
		 * If we get a page fault while in a critical section, then
		 * it is most likely a fatal kernel page fault.  The kernel
		 * is already going to panic trying to get a sleep lock to
		 * do the VM lookup, so just consider it a fatal trap so the
		 * kernel can print out a useful trap message and even get
		 * to the debugger.
		 *
		 * If we get a page fault while holding a non-sleepable
		 * lock, then it is most likely a fatal kernel page fault.
		 * If WITNESS is enabled, then it's going to whine about
		 * bogus LORs with various VM locks, so just skip to the
		 * fatal trap handling directly.
		 */
		if (td->td_critnest != 0 ||
		    WITNESS_CHECK(WARN_SLEEPOK | WARN_GIANTOK, NULL,
		    "Kernel page fault") != 0) {
			abort_fatal(tf, idx, fsr, far, prefetch, td, &ksig);
			return;
		}
	}

	/* Re-enable interrupts if they were enabled previously. */
	if (td->td_md.md_spinlock_count == 0) {
		if (__predict_true(tf->tf_spsr & PSR_I) == 0)
			enable_interrupts(PSR_I);
		if (__predict_true(tf->tf_spsr & PSR_F) == 0)
			enable_interrupts(PSR_F);
	}

	p = td->td_proc;
	if (usermode) {
		td->td_pticks = 0;
		if (td->td_ucred != p->p_ucred)
			cred_update_thread(td);
	}

	/* Invoke the appropriate handler, if necessary. */
	if (__predict_false(aborts[idx].func != NULL)) {
		if ((aborts[idx].func)(tf, idx, fsr, far, prefetch, td, &ksig))
			goto do_trapsignal;
		goto out;
	}

	/*
	 * At this point, we're dealing with one of the following aborts:
	 *
	 *  FAULT_TRAN_xx  - Translation
	 *  FAULT_PERM_xx  - Permission
	 *
	 * These are the main virtual memory-related faults signalled by
	 * the MMU.
	 */

	/* fusubailout is used by [fs]uswintr to avoid page faulting */
	pcb = td->td_pcb;
	if (__predict_false(pcb->pcb_onfault == fusubailout)) {
		tf->tf_r0 = EFAULT;
		tf->tf_pc = (register_t)pcb->pcb_onfault;
		return;
	}

	/*
	 * QQQ: ARM has a set of unprivileged load and store instructions
	 *      (LDRT/LDRBT/STRT/STRBT ...) which are supposed to be used
	 *      in other than user mode and OS should recognize their
	 *      aborts and behaved appropriately. However, there is no way
	 *      how to do that reasonably in general unless we restrict
	 *      the handling somehow. One way is to limit the handling for
	 *      aborts which come from undefined mode only.
	 *
	 *      Anyhow, we do not use these instructions and do not implement
	 *      any special handling for them.
	 */

	va = trunc_page(far);
	if (va >= KERNBASE) {
		/*
		 * Don't allow user-mode faults in kernel address space.
		 */
		if (usermode)
			goto nogo;

		map = kernel_map;
	} else {
		/*
		 * This is a fault on non-kernel virtual memory. If curproc
		 * is NULL or curproc->p_vmspace is NULL the fault is fatal.
		 */
		vm = (p != NULL) ? p->p_vmspace : NULL;
		if (vm == NULL)
			goto nogo;

		map = &vm->vm_map;
		if (!usermode && (td->td_intr_nesting_level != 0 ||
		    pcb->pcb_onfault == NULL)) {
			abort_fatal(tf, idx, fsr, far, prefetch, td, &ksig);
			return;
		}
	}

	ftype = (fsr & FSR_WNR) ? VM_PROT_WRITE : VM_PROT_READ;
	if (prefetch)
		ftype |= VM_PROT_EXECUTE;

#ifdef DEBUG
	last_fault_code = fsr;
#endif

#ifndef ARM_NEW_PMAP
	if (pmap_fault_fixup(vmspace_pmap(td->td_proc->p_vmspace), va, ftype,
	    usermode)) {
		goto out;
	}
#endif

#ifdef INVARIANTS
	onfault = pcb->pcb_onfault;
	pcb->pcb_onfault = NULL;
#endif
	if (map != kernel_map) {
		/*
		 * Keep swapout from messing with us during this
		 *	critical time.
		 */
		PROC_LOCK(p);
		++p->p_lock;
		PROC_UNLOCK(p);

		/* Fault in the user page: */
		rv = vm_fault(map, va, ftype, VM_FAULT_NORMAL);

		PROC_LOCK(p);
		--p->p_lock;
		PROC_UNLOCK(p);
	} else {
		/*
		 * Don't have to worry about process locking or stacks in the
		 * kernel.
		 */
		rv = vm_fault(map, va, ftype, VM_FAULT_NORMAL);
	}

#ifdef INVARIANTS
	pcb->pcb_onfault = onfault;
#endif

	if (__predict_true(rv == KERN_SUCCESS))
		goto out;
nogo:
	if (!usermode) {
		if (td->td_intr_nesting_level == 0 &&
		    pcb->pcb_onfault != NULL) {
			tf->tf_r0 = rv;
			tf->tf_pc = (int)pcb->pcb_onfault;
			return;
		}
		CTR2(KTR_TRAP, "%s: vm_fault() failed with %d", __func__, rv);
		abort_fatal(tf, idx, fsr, far, prefetch, td, &ksig);
		return;
	}

	ksig.sig = (rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV;
	ksig.code = 0;
	ksig.addr = far;

do_trapsignal:
	call_trapsignal(td, ksig.sig, ksig.code, ksig.addr);
out:
	if (usermode)
		userret(td, tf);
}

/*
 * abort_fatal() handles the following data aborts:

 *  FAULT_DEBUG		- Debug Event
 *  FAULT_ACCESS_xx	- Acces Bit
 *  FAULT_EA_PREC	- Precise External Abort
 *  FAULT_DOMAIN_xx	- Domain Fault
 *  FAULT_EA_TRAN_xx	- External Translation Abort
 *  FAULT_EA_IMPREC	- Imprecise External Abort
 *  + all undefined codes for ABORT
 *
 * We should never see these on a properly functioning system.
 *
 * This function is also called by the other handlers if they
 * detect a fatal problem.
 *
 * Note: If 'l' is NULL, we assume we're dealing with a prefetch abort.
 */
static int
abort_fatal(struct trapframe *tf, u_int idx, u_int fsr, u_int far, u_int prefetch,
    struct thread *td, struct ksig *ksig)
{
	u_int usermode;
	const char *mode;
	const char *rw_mode;

	usermode = TRAPF_USERMODE(tf);
	mode = usermode ? "user" : "kernel";
	rw_mode  = fsr & FSR_WNR ? "write" : "read";
	disable_interrupts(PSR_I|PSR_F);

	if (td != NULL) {
		printf("Fatal %s mode data abort: '%s' on %s\n", mode,
		    aborts[idx].desc, rw_mode);
		printf("trapframe: %p\nFSR=%08x, FAR=", tf, fsr);
		if (idx != FAULT_EA_IMPREC)
			printf("%08x, ", far);
		else
			printf("Invalid,  ");
		printf("spsr=%08x\n", tf->tf_spsr);
	} else {
		printf("Fatal %s mode prefetch abort at 0x%08x\n",
		    mode, tf->tf_pc);
		printf("trapframe: %p, spsr=%08x\n", tf, tf->tf_spsr);
	}

	printf("r0 =%08x, r1 =%08x, r2 =%08x, r3 =%08x\n",
	    tf->tf_r0, tf->tf_r1, tf->tf_r2, tf->tf_r3);
	printf("r4 =%08x, r5 =%08x, r6 =%08x, r7 =%08x\n",
	    tf->tf_r4, tf->tf_r5, tf->tf_r6, tf->tf_r7);
	printf("r8 =%08x, r9 =%08x, r10=%08x, r11=%08x\n",
	    tf->tf_r8, tf->tf_r9, tf->tf_r10, tf->tf_r11);
	printf("r12=%08x, ", tf->tf_r12);

	if (usermode)
		printf("usp=%08x, ulr=%08x",
		    tf->tf_usr_sp, tf->tf_usr_lr);
	else
		printf("ssp=%08x, slr=%08x",
		    tf->tf_svc_sp, tf->tf_svc_lr);
	printf(", pc =%08x\n\n", tf->tf_pc);

#ifdef KDB
	if (debugger_on_panic || kdb_active)
		kdb_trap(fsr, 0, tf);
#endif
	panic("Fatal abort");
	/*NOTREACHED*/
}

/*
 * abort_align() handles the following data abort:
 *
 *  FAULT_ALIGN - Alignment fault
 *
 * Every memory access should be correctly aligned in kernel including
 * user to kernel and vice versa data copying, so we ignore pcb_onfault,
 * and it's always fatal. We generate a signal in case of abort from user mode.
 */
static int
abort_align(struct trapframe *tf, u_int idx, u_int fsr, u_int far, u_int prefetch,
    struct thread *td, struct ksig *ksig)
{
	u_int usermode;

	usermode = TRAPF_USERMODE(tf);

	/*
	 * Alignment faults are always fatal if they occur in any but user mode.
	 *
	 * XXX The old trap code handles pcb fault even for alignment traps.
	 * Unfortunately, we don't known why and if is this need.
	 */
	if (!usermode) {
		if (td->td_intr_nesting_level == 0 && td != NULL &&
		    td->td_pcb->pcb_onfault != NULL) {
			printf("%s: Got alignment fault with pcb_onfault set"
			    ", please report this issue\n", __func__);
			tf->tf_r0 = EFAULT;;
			tf->tf_pc = (int)td->td_pcb->pcb_onfault;
			return (0);
		}
		abort_fatal(tf, idx, fsr, far, prefetch, td, ksig);
	}
	/* Deliver a bus error signal to the process */
	ksig->code = 0;
	ksig->sig = SIGBUS;
	ksig->addr = far;
	return (1);
}

/*
 * abort_icache() handles the following data abort:
 *
 * FAULT_ICACHE - Instruction cache maintenance
 *
 * According to manual, FAULT_ICACHE is translation fault during cache
 * maintenance operation. In fact, no cache maintenance operation on
 * not mapped virtual addresses should be called. As cache maintenance
 * operation (except DMB, DSB, and Flush Prefetch Buffer) are priviledged,
 * the abort is concider as fatal for now. However, all the matter with
 * cache maintenance operation on virtual addresses could be really complex
 * and fuzzy in SMP case, so maybe in future standard fault mechanism
 * should be held here including vm_fault() calling.
 */
static int
abort_icache(struct trapframe *tf, u_int idx, u_int fsr, u_int far, u_int prefetch,
    struct thread *td, struct ksig *ksig)
{
	abort_fatal(tf, idx, fsr, far, prefetch, td, ksig);
	return(0);
}


text:
require 'spec_helper'

module Cuporter

  describe "Single Feature Tag Reports" do

    context "one scenario one tag" do
      it "returns one tag mapped to one scenario name" do
        report = one_feature( "fixtures/one_scenario_one_tag.feature")
        report.should == <<EOF
  @wip
    Feature: foo
      Scenario: bar the great foo
EOF
      end
    end

    context "one scenario two tags" do
      it "returns two tags mapped to the same scenario" do
        report = one_feature( "fixtures/one_scenario_two_tags.feature")
        report.should  == <<EOF
  @smoke
    Feature: foo
      Scenario: some test of something
  @wip
    Feature: foo
      Scenario: some test of something
EOF
      end
    end

    context "two scenarios one tag" do
      it "returns one tag mapped to one scenario" do
        report = one_feature( "fixtures/two_scenarios_one_tag.feature")
        report.should == <<EOF
  @smoke
    Feature: foo
      Scenario: another test
EOF
      end
    end

    context "difficult input: the apostrophe" do

      it "raises no error if a cuke name has a single quote" do
        report = ""
        expect do
          report = one_feature("fixtures/apostrophe.feature")
        end.to_not raise_error
        report.should == <<EOF
  @apostrophe
    Feature: What's the point of it all, Charlie?
      Scenario: I sport an apostrophe this evening, Sir!
  @encoding
    Feature: What's the point of it all, Charlie?
      Scenario: I sport an apostrophe this evening, Sir!
EOF
      end
    end

  end
end


text:
<?php
/**
 * Returns the HTML for the Campaign Action page.
 *
 * Available Variables
 * - $campaign: A campaign object. @see dosomething_campaign_load()
 * - $scholarship: Scholarship amount (string).
 * - $classes: Additional classes passed for output (string).
 * - $campaign_creator: HTML for the Campaign Creator link/modal.
 */
?>

<header role="banner" class="header -hero header--action <?php print $classes; ?>">

    <?php print $campaign_headings; ?>

    <?php print $promotions; ?>

    <?php print $campaign_scholarship; ?>

<?php print t('Know'); ?>

<?php print t('Plan'); ?>

<?php print t('Do'); ?>

<?php print t('Prove It'); ?>

  <?php // FOMO SUITE MODULES ////////////////////////////////////////////////////// ?>
  <?php if (isset($win_module)): ?>
    <?php print $win_module; ?>
  <?php endif; ?>

  <?php if (isset($hot_module)): ?>
    <?php print $hot_module; ?>
  <?php endif; ?>

  <?php // KNOW IT ////////////////////////////////////////////////////// ?>

<?php print t('Step 1: Know It'); ?>

        <?php if (isset($campaign->fact_problem)): ?>

<?php print t('The Problem'); ?>

<?php print $campaign->fact_problem['fact']; ?><?php print $campaign->fact_problem['footnotes']; ?>

          <?php // Show problem social share buttons if feature flag is turned on. ?>
          <?php if ($show_problem_shares && !isset($hot_module) && !isset($win_module)): ?>

<?php print $problem_share_prompt; ?>

            <?php print $share_bar; ?>
          <?php endif; ?>
        <?php endif; ?>

        <?php if ($show_problem_shares && !isset($hot_module) && !isset($win_module)): ?>
          <?php // If there's a PSA image or video, output it in this column. ?>
          <?php if (isset($psa)): ?>
            <p <?php if ($is_video_psa) echo 'class="media-video"'; ?>>
              <?php print $psa; ?>

          <?php endif; ?>
        <?php else: ?>
          <?php // If there's a PSA image or video, output it in this column, otherwise output the modals list if it exists. ?>
          <?php if (isset($psa)): ?>
            <p <?php if ($is_video_psa) echo 'class="media-video"'; ?>>
              <?php print $psa; ?>

          <?php else: ?>
            <?php if (isset($modals)): ?>
              <?php print $modals; ?>
            <?php endif; ?>
          <?php endif; ?>
        <?php endif; ?>

        <?php if (isset($campaign->fact_solution) || isset($campaign->solution_copy)): ?>

<?php print t('The Solution'); ?>

          <?php if (isset($campaign->fact_solution)): ?>

<?php print $campaign->fact_solution['fact']; ?><?php print $campaign->fact_solution['footnotes']; ?>

          <?php elseif (isset($campaign->solution_copy)): ?>
            <?php print $campaign->solution_copy; ?>
          <?php endif; ?>

          <?php if (isset($campaign->solution_support)): ?>
            <?php print $campaign->solution_support; ?>
          <?php endif; ?>

        <?php endif; ?>

        <?php if ($show_problem_shares && !isset($hot_module) && !isset($win_module)): ?>
          <?php // Alway output modals in the second column. ?>
          <?php if (isset($modals)): ?>
           <?php print $modals; ?>
          <?php endif; ?>
        <?php else: ?>
          <?php // If there's a PSA image or video, then it was output in the first column above and thus need to output the modals in this second column instead. ?>
          <?php if (isset($psa)): ?>
            <?php if (isset($modals)): ?>
              <?php print $modals; ?>
            <?php endif; ?>
          <?php endif; ?>
        <?php endif; ?>

        <?php if (isset($campaign->fact_sources)): ?>

<?php print t('Sources'); ?>

              <?php foreach ($campaign->fact_sources as $key => $source): ?>

<?php print($key + 1); ?> <?php print $source; ?>

              <?php endforeach; ?>

        <?php endif; ?>

  <?php // PLAN IT ////////////////////////////////////////////////////// ?>

<?php print t('Step 2: Plan It'); ?>

        <?php if (isset($starter)) : ?>
          <?php print $starter['safe_value']; ?>
        <?php endif; ?>

      <?php if (isset($plan)): ?>
      <?php foreach ($plan as $index => $content): ?>
        <?php if($index % 2 === 0) : ?>
 <?php endif; ?>

<?php print $content['title']; ?>

              <?php print $content['content']; ?>

              <?php // Start: Content specifically for Materials content section. ?>
              <?php if ($content['category'] === 'materials'): ?>

                  <?php if(isset($action_guides)): ?>
                    <?php  foreach ($action_guides as $delta => $action_guide): ?>

<a href="#" data-modal-href="#modal-action-guide-<?php print $delta; ?>"><?php print $action_guide['desc']; ?>

                    <?php endforeach; ?>
                  <?php endif; ?>

                  <?php if (!empty($campaign->downloads)): ?>
                    <?php foreach ($campaign->downloads as $link): ?>

<?php print l($link['description'], $link['url']); ?>

                    <?php endforeach; ?>
                  <?php endif; ?>

                  <?php if (isset($signup_data_form_link)): ?>

<?php print $signup_data_form_link; ?>

                  <?php endif; ?>

                  <?php if (isset($shipment_form_link)): ?>

<?php print $shipment_form_link; ?>

                  <?php endif; ?>

              <?php endif; ?>
              <?php  // End: Materials content section. ?>

        <?php if($index % 2 === 1 || $index + 1 === $plan_count) : ?>
 <?php endif; ?>
      <?php endforeach; ?>
      <?php endif; ?>

      <?php if (isset($location_finder['url'])) : ?>

<?php print t('Find a Location'); ?>

          <?php if (isset($location_finder['copy'])) : ?>
            <?php print $location_finder['copy']; ?>
          <?php endif; ?>

<a class="button -secondary" href="<?php print $location_finder['url']; ?>" target="_blank"><?php print t('Locate'); ?>

      <?php endif; ?>

      <?php // "Plan It" Section Modals ?>
      <?php if (isset($action_guides)): ?>
        <?php foreach ($action_guides as $delta => $action_guide): ?>
        <div data-modal id="modal-action-guide-<?php print $delta; ?>" role="dialog">

            <?php print $action_guide['content']; ?>

              <?php print t('Back to main page'); ?>

        <?php endforeach; ?>
      <?php endif; ?>

      <?php if (isset($signup_data_form)): ?>

<?php print render($signup_data_form); ?>

          <?php if (isset($skip_signup_data_form)): ?>

<?php print render($skip_signup_data_form); ?>

          <?php endif; ?>

      <?php endif; ?>

      <?php if (isset($shipment_form)): ?>

<?php print render($shipment_form); ?>

      <?php endif; ?>

  <?php // DO IT ////////////////////////////////////////////////////// ?>
  <?php if (!empty($do)): ?>

<?php print t('Step 3: Do It'); ?>

        <?php foreach ($do as $key => $content): ?>

            <?php if (isset($content['image'])): ?>

                <?php print $content['image']; ?>

            <?php endif; ?>

            <?php if (isset($content['header'])): ?>

<?php print $content['header']; ?>

            <?php endif; ?>

            <?php if (isset($content['copy'])): ?>
              <?php print $content['copy']; ?>
            <?php endif; ?>

            <?php if (isset($content['tips'])): ?>
              <section id="<?php print 'tips-' . $key ?>" class="tabs tabs--campaign js-tabs">
                <a href="#" data-modal-href="#modal-tips-<?php print $key; ?>" class="tabs__modal-toggle"><?php print t('View Tips'); ?>

<?php print t('Tips'); ?>

                      <?php foreach ($content['tips'] as $delta => $tip): ?>
                        <?php $delta++; ?>
                        <li class="<?php if ($delta === 1) print ' is-active'?>">
                          <a href="#tip-<?php print $delta; ?>" data-tab="<?php print $delta; ?>"><?php print $tip['header']; ?>

                      <?php endforeach; ?>

                    <?php foreach ($content['tips'] as $delta => $tip): ?>
                      <?php $delta++; ?>
                      <li id="tip-<?php print $delta; ?>" class="tabs__tab">

<?php print $tip['header']; ?>

                        <?php print $tip['copy']; ?>

                    <?php endforeach; ?>

              <div data-modal id="modal-tips-<?php print $key; ?>" class="modal--tips" role="dialog">

Tips

                  <?php foreach ($content['tips'] as $delta => $tip): ?>

<?php print $tip['header']; ?>

                    <?php print $tip['copy']; ?>
                  <?php endforeach; ?>

                    <?php print t('Back to main page'); ?>

            <?php endif; ?>

        <?php endforeach; ?>

  <?php endif; ?>

  <?php // PROVE IT ////////////////////////////////////////////////////// ?>

<?php print t('Step 4: Prove It'); ?>

<?php print t('Pics or It Didn’t Happen'); ?>

        <?php if (isset($reportback_copy)): ?>

<?php print $reportback_copy; ?>

        <?php endif; ?>

      <div id="reportback" class="reportback" data-nid="<?php print $campaign->nid; ?>" data-ids="<?php print implode(',', $reportbacks_gallery['item_ids']); ?>" data-remaining="<?php print $reportbacks_gallery['remaining']; ?>" data-admin="<?php print $reportbacks_gallery['admin_access']; ?>">

            <?php for ($i = 0; $i < count($reportbacks_gallery['items']); $i++): ?>
              <li <?php if ($i === 1) print ' class="-second"'; ?>>
                <?php print $reportbacks_gallery['items'][$i]; ?>

            <?php endfor; ?>

          <?php if (isset($reportback_form)): ?>
            <?php print render($reportback_form); ?>
          <?php endif; ?>

<?php print t('Edit your photo'); ?>

                <?php print t('rotate photo'); ?>

                    <?php print t('change photo'); ?>

              <?php /*
              This is a purely frontend form that will grab crop options and a caption
              And then when the user submits the form, it will populate the drupal form with these values.
              */?>

                    <?php print t('Caption'); ?>
                    <input class="text-field" placeholder="<?php print $reportback_form['reportback_inputs']['caption']['#attributes']['placeholder'] ?>" type="text" id="modal-caption" name="modal-caption" data-validate="caption" data-validate-required maxlength="60" >

                    <button class="button -done"><?php print t('Crop'); ?></button>

      <?php if (isset($official_rules)): ?>

            <a class="official-rules" href="<?php print $official_rules_src; ?>"><?php print t('Official Rules'); ?>

      <?php endif; ?>

    <?php if ($info_bar): ?>
      <?php print $info_bar; ?>
    <?php endif; ?>


text:
package org.aikodi.chameleon.oo.method.exception;
public class StubAnchoredExceptionDeclaration{}
//package be.kuleuven.cs.distrinet.chameleon.core.method.exception;
//
//import be.kuleuven.cs.distrinet.chameleon.core.expression.Invocation;
//import be.kuleuven.cs.distrinet.chameleon.core.type.TypeDescendant;
//
///**
// * @author marko
// */
//public class StubAnchoredExceptionDeclaration extends AnchoredExceptionDeclaration {
//
//  public StubAnchoredExceptionDeclaration(Invocation invocation) {
//    super(null);
//    _inv = invocation;
//  }
//
//  private Invocation _inv;
//
//  public Invocation getInvocation() {
//    return _inv;
//  }
//
//  public TypeDescendant getMyParent() {
//  	//FIXME: filthy hack
//  	return getInvocation();
//  }
//
//}


text:
const express = require('express');
const router = express.Router();
const gameRoutes = require("./games");
const Game = require("../models").Game;
//const Auth = require("./auth");
const passport = require('passport');
//contains register, login, and roleAuthorization handlers

const requireAuth = passport.authenticate('jwt', {session: false});
const requireLogin = passport.authenticate('local', {session: false});

const game = new Game({
	decklist1: [{name: "Island", quantity: 60}],
		decklist2: [{name: "Forest", quantity: 60}],
		sideboard1: [{name: "Counterspell", quantity: 4}],
		sideboard2: [{name: "Counterspell", quantity: 4}],
		winner: 1,
		boardstates: [
{
	theStack: [
{name: "Grapeshot", quantity: 1},
{name: "Grapeshot", quantity: 1},
{name: "Grapeshot", quantity: 1},
{name: "Grapeshot", quantity: 1},
{name: "Grapeshot", quantity: 1},
{name: "Grapeshot", quantity: 1},
{name: "Grapeshot", quantity: 1},
{name: "Grapeshot", quantity: 1},
{name: "Grapeshot", quantity: 1},
{name: "Grapeshot", quantity: 1},
{name: "Grapeshot", quantity: 1},
{name: "Grapeshot", quantity: 1},
{name: "Grapeshot", quantity: 1},
{name: "Grapeshot", quantity: 1},
{name: "Grapeshot", quantity: 1},
{name: "Grapeshot", quantity: 1},
{name: "Grapeshot", quantity: 1},
{name: "Grapeshot", quantity: 1},
{name: "Grapeshot", quantity: 1},
{name: "Grapeshot", quantity: 1} ],
	p1Library: [],
	p2Library: [],
	p1Hand: [],
	p2Hand: [],
	p1Graveyard: [],
	p2Graveyard: [],
	p1Battlefield: [],
	p2Battlefield: [],
	p1Exile: [],
	p2Exile: [],
	p1Life: 20,
	p2Life: 20
	} ],
	actions: [
{
	player: 1,
	turn: 1,
	description: "First turn kill (this is a test action)",
	cardName: "Grapeshot",
	zoneTo: "theStack",
	zoneFrom: "p1Hand",
	boardstates: [],  //normally, would put a before/after boardstate here.

	subActions: []   //holds all actions related to casting a spell
		//e.g. cleaning up the board after a Wrath of God
}],
	comments: [{text: "Ow." }]
	});
/*
	 router.get("/", function (req,res, next) {
	 console.log("Blablabla");
	 next();
	 });
 */

/*
	 router.param("gID", function(req, res, next, id) {
	 Game.findById(id, function(err, doc) {
	 if (err) return next(err);
	 if (!doc) {
	 err = new Error("Not Found");
	 err.status = 404;
	 return next(err);
	 } else {
	 req.game = doc;
	 console.log(req.game);
	 next();
	 }
	 });
	 });
 */

/*

	 router.get('/', function(req, res, next) {
	 Game.find({}, function(err, doc) {
	 if (!doc) {
	 err = new Error("Not Found!");
	 err.status = 404;
	 return next(err);
	 } else if (!err) {
	 res.json(doc);
	 }
	 });
	 });
 */

/* GET all games? */

router.get('/api/v1/games/', requireAuth, gameRoutes.getGames);

/* GET game */

router.get('/api/v1/games/:gID', requireAuth, gameRoutes.getGame);

/* PUT game */
router.put('/api/v1/games/:gID/', requireAuth, gameRoutes.putGame);

/* GET game containing card */

/* GET game with tag */

/*POST game */
// i.e. create new game

router.post('/api/v1/games/new', requireAuth, gameRoutes.newGame);

/* DELETE game */

router.delete('/api/v1/games/:gID', requireAuth, gameRoutes.deleteGame);

/* GET comments for game :id */
/* POST comment for game :id */

/* GET subcomments for :comment_id */
/* POST subcomment for :comment_id */
/* PUT subcomment for :comment_id */

/* DELETE comment/subcomment :id */

module.exports = router;


text:
package controlador;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;

import modelo.Materia;
import persistencia.MateriaDAO;
import spark.ModelAndView;
import spark.Request;
import spark.Response;
import spark.TemplateViewRoute;

public class EditarSalvar implements TemplateViewRoute{

	MateriaDAO dao = new MateriaDAO();

	public ModelAndView handle(Request req, Response resp) {
		Materia materia = new Materia();
		materia.setNumero(Integer.parseInt(req.queryParams("codigo"))); //valendo 0
		materia.setTitulo(req.queryMap("titulo").value());
		materia.setLocal(req.queryMap("local").value());
		materia.setData(req.queryMap("data").value());
		materia.setSinopse(req.queryMap("sinopse").value());
		ArrayList<Materia> array = dao.findAll();
		for (int i = 0; i < array.size(); i++) {
			if(array.get(i).getTitulo().equals(materia.getTitulo()) && array.get(i).getNumero() != materia.getNumero()){
				String erro = "";
				try {
					erro = URLEncoder.encode("Fato já existe", "UTF-8");
				} catch (UnsupportedEncodingException e){
					e.printStackTrace();
				}
				resp.redirect("/editar/"+ Integer.parseInt(req.queryParams("codigo")) +"?erro=" + erro);
			}
		}
		dao.update(materia);
		resp.redirect("/lista");
		return null;
	}

}


text:
#ifndef __SPATAmbipanningSOURCE_H__
#define __SPATAmbipanningSOURCE_H__

#include "TTDSP.h"
#include "TTSpatEntity.h"

class TTSpatAmbipanningSource : public TTSpatSource {

public:

	TTSpatAmbipanningSource();
	~TTSpatAmbipanningSource();

	/** Order of ambipanning processing
	 */
	void getOrder(TTFloat64& aOrder);
	/** Order of ambipanning processing
	 */
	void setOrder(TTFloat64 aOrder);

};

/** Pointer to a vector of #TTSpatEntity points.
 @ingroup typedefs
 */
typedef std::vector<TTSpatAmbipanningSource>	TTSpatAmbipanningSourceVector;

#endif // __SPATAmbipanningSOURCE_H__


text:
package info.u_team.u_team_core.item.armor;

import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.item.ArmorMaterial;
import net.minecraft.world.item.CreativeModeTab;

public class UHelmetItem extends UArmorItem {

	public UHelmetItem(String textureName, Properties properties, ArmorMaterial material) {
		this(textureName, null, properties, material);
	}

	public UHelmetItem(String textureName, CreativeModeTab creativeTab, Properties properties, ArmorMaterial material) {
		super(textureName, creativeTab, properties, material, EquipmentSlot.HEAD);
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="match_parent"
              android:layout_height="match_parent">

    <GridView
        android:id="@+id/gallery_gridView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:numColumns="5"/>

</FrameLayout>


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Changes in daily life patterns in Great Britain, 1983-2015 – The-mismeasure-of-things</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Time Use">
    <meta name="author" content="Giacomo Vagni">
    <meta name="keywords" content="">
    <link rel="canonical" href="giacomovagni.github.io/the-mismeasure-of-things/the-mismeasure-of-things//2017/03/10/mtus-1/">
    <link rel="alternate" type="application/rss+xml" title="RSS Feed for The-mismeasure-of-things" href="/the-mismeasure-of-things//feed.xml" />

    <link rel="stylesheet" href="/the-mismeasure-of-things//css/pixyll.css?201804061106" type="text/css">

    <link href='//fonts.googleapis.com/css?family=Merriweather:900,900italic,300,300italic' rel='stylesheet' type='text/css'>
    <link href='//fonts.googleapis.com/css?family=Lato:900,300' rel='stylesheet' type='text/css'>

    <meta property="og:locale" content="en_US">
    <meta property="og:type" content="article">
    <meta property="og:title" content="Changes in daily life patterns in Great Britain, 1983-2015">
    <meta property="og:description" content="Sociology, statistics and marxism">
    <meta property="og:url" content="giacomovagni.github.io/the-mismeasure-of-things/2017/03/10/mtus-1/">
    <meta property="og:site_name" content="The-mismeasure-of-things">

    <meta name="twitter:card" content="summary" />

        <meta name="twitter:site" content="@giacomo.ecce" />

    <meta name="twitter:title" content="Changes in daily life patterns in Great Britain, 1983-2015" />
    <meta name="twitter:description" content="Time Use" />
    <meta name="twitter:url" content="giacomovagni.github.io/the-mismeasure-of-things/2017/03/10/mtus-1/" />

    <link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png">
    <link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114x114.png">
    <link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144x144.png">
    <link rel="apple-touch-icon" sizes="60x60" href="/apple-touch-icon-60x60.png">
    <link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-120x120.png">
    <link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon-76x76.png">
    <link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152.png">
    <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-180x180.png">
    <link rel="icon" type="image/png" href="/favicon-192x192.png" sizes="192x192">
    <link rel="icon" type="image/png" href="/favicon-160x160.png" sizes="160x160">
    <link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96">
    <link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16">
    <link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32">

       Archive
Sociology
R stats
Misc

Changes in daily life patterns in Great Britain, 1983-2015

  Mar 10, 2017

  Tweet


text:
for i in `find ./ -name \*.jpg`; do
	outputFile=${i%.jpg}_optimized.jpg;
	jpegtran -optimize $i > $outputFile;
done


text:
<!--
  Copyright 2016 The AMP HTML Authors. All Rights Reserved.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS-IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the license.
-->
<!--
  Test Description:
  Tests for the amp-carousel tag. See the inline comments.
-->
<!doctype html>
<html ⚡>
<head>
  <meta charset="utf-8">
  <link rel="canonical" href="./regular-html-version.html" />
  <meta name="viewport" content="width=device-width,minimum-scale=1">
  <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
  <script async src="https://cdn.ampproject.org/v0.js"></script>
  <script async custom-element="amp-carousel" src="https://cdn.ampproject.org/v0/amp-carousel-0.1.js"></script>
</head>
<body>
  <!-- Invalid: Wrong delay attribute usage -->
  <amp-carousel layout="fixed" width=500 height=500 autoplay delay>
  </amp-carousel>
  <!-- Valid: Correct delay attribute usage -->
  <amp-carousel layout="fixed" width=500 height=500 autoplay delay=5000>
  </amp-carousel>
  <!-- Valid: default carousel autoplay usage w/o delay -->
  <amp-carousel layout="fixed" width=500 height=500 autoplay>
  </amp-carousel>
  <!-- Valid: amp-carousel with bindable [slide] attr -->
  <amp-carousel type="slides" layout="fixed" width=500 height=500
      [slide]="foo.bar">
  </amp-carousel>
</body>
</html>


text:
@implementation FIRStorageGetMetadataTask {
 @private
  FIRStorageVoidMetadataError _completion;
}

- (instancetype)initWithReference:(FIRStorageReference *)reference
                   fetcherService:(GTMSessionFetcherService *)service
                       completion:(FIRStorageVoidMetadataError)completion {
  self = [super initWithReference:reference fetcherService:service];
  if (self) {
    _completion = [completion copy];
  }
  return self;
}

- (void)enqueue {
  NSMutableURLRequest *request = [self.baseRequest mutableCopy];
  request.HTTPMethod = @"GET";
  request.timeoutInterval = self.reference.storage.maxDownloadRetryTime;

  FIRStorageVoidMetadataError callback = _completion;
  _completion = nil;

  GTMSessionFetcher *fetcher = [self.fetcherService fetcherWithRequest:request];
  fetcher.comment = @"GetMetadataTask";
  [fetcher beginFetchWithCompletionHandler:^(NSData *data, NSError *error) {
    if (error) {
      if (!self.error) {
        self.error = [FIRStorageErrors errorWithServerError:error reference:self.reference];
      }
      if (callback) {
        callback(nil, self.error);
      }
      return;
    }

    NSDictionary *responseDictionary = [NSDictionary frs_dictionaryFromJSONData:data];
    if (responseDictionary != nil) {
      FIRStorageMetadata *metadata =
          [[FIRStorageMetadata alloc] initWithDictionary:responseDictionary];
      [metadata setType:FIRStorageMetadataTypeFile];
      if (callback) {
        callback(metadata, nil);
      }
    } else {
      NSString *returnedData = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
      NSString *invalidDataString =
          [NSString stringWithFormat:kFIRStorageInvalidDataFormat, returnedData];
      NSDictionary *dict;
      if (invalidDataString.length > 0) {
        dict = @{NSLocalizedFailureReasonErrorKey : invalidDataString};
      }
      self.error = [FIRStorageErrors errorWithCode:FIRStorageErrorCodeUnknown infoDictionary:dict];
      if (callback) {
        callback(nil, self.error);
      }
    }
  }];
}

@end


text:
title: Eclipse bndtools
layout: default
summary: The most famous of them all, the one and only bndtools!
---


text:
//! @file
//! @author Alexis Royer
//! @brief Traces management system definition.
//!
//! Defined by Traces and TraceClass classes.
//! Use the singleton cli::GetTraces.

#ifndef _CLI_TRACES_H_
#define _CLI_TRACES_H_

#include "cli/namespace.h"
#include "cli/object.h"
#include "cli/help.h"
#include "cli/tk.h"

CLI_NS_BEGIN(cli)

    // Forward declarations.
    class OutputDevice;

    //! @brief Trace class object.
    class TraceClass : public Object
    {
    public:
        //! @brief Trace class list typedef.
        //! @return N/A (doxygen warning)
        typedef tk::Queue<TraceClass> List;

    private:
        //! @brief No default constructor.
        explicit TraceClass(void);

    public:
        //! @brief Copy constructor.
        TraceClass(
            const TraceClass& CLI_Class         //!< Source class object.
            );

        //! @brief Constructor.
        explicit TraceClass(
            const char* const STR_ClassName,    //!< Class name.
            const Help& CLI_Help                //!< Help description.
            );

        //! @brief Destructor.
        virtual ~TraceClass(void);

    public:
        //! @brief Class name accessor.
        //! @return Class name.
        const tk::String GetName(void) const;

        //! @brief Description accessor.
        //! @return Trace class description.
        const Help& GetHelp(void) const;

    public:
        //! @brief Assignment operator.
        //! @return The TraceClass instance itself.
        TraceClass& operator=(const TraceClass&);

    private:
        //! Class name.
        tk::String m_strName;

        //! Description.
        Help m_cliHelp;
    };

    //! @brief Classes equivalence operator.
    //! @return true if trace classes are equivalent, false otherwise.
    bool operator==(
        const TraceClass& CLI_Class1,   //!< First member.
        const TraceClass& CLI_Class2    //!< Second member.
        );

    //! @brief Internal error common trace class singleton redirection.
    #define INTERNAL_ERROR GetInternalErrorTraceClass()
    //! @brief Internal error common trace class singleton.
    //! @return Internal error common trace class instance.
    const TraceClass& GetInternalErrorTraceClass();

    //! @brief Traces service.
    class Traces : public Object
    {
    public:
        //! @brief Singleton.
        //! @return Only one instance of the kind.
        static Traces& GetInstance(void);

    protected:
        //! @brief Default constructor.
        explicit Traces(void);

    public:
        //! @brief Destructor.
        virtual ~Traces(void);

    private:
        //! @brief No copy constructor.
        Traces(const Traces&);
        //! @brief No assignment operator.
        Traces& operator=(const Traces&);

    public:
        //! @brief Stream access.
        //! @return Trace stream reference.
        const OutputDevice& GetStream(void) const;

        //! @brief Stream positionning (if not already set).
        //! @return true: success, false: failure.
        //! @warning For consistency reasons, if you use this method, you should better call UnsetStream() before program termination.
        //!
        //! When SetStream() has not been called previously, then it takes CLI_Stream in account immediately for tracing.
        //! Otherwise it stacks the stream (for consistency concerns) and waits for the previous ones to be released possibly.
        bool SetStream(
            OutputDevice& CLI_Stream                //!< Stream reference.
            );

        //! @brief Stream dereferencing.
        //! @return true: success, false: failure.
        //!
        //! This method should be called if you have previously called SetStream().
        bool UnsetStream(
            OutputDevice& CLI_Stream                //!< Stream reference.
            );

    public:
        //! @brief Trace class declaration.
        //! @return true if the class has been declared successfully or the class was already declared.
        //! @return false if an error as occured.
        bool Declare(
            const TraceClass& CLI_Class     //!< Trace class to declare.
            );

        //! @brief All classes accessor.
        //! @return List of all trace classes that have been registered.
        TraceClass::List GetAllClasses(void) const;

        //! @brief Current filter retrieval.
        //! @return List of trace classes that constitutes the current trace filter.
        TraceClass::List GetCurrentFilter(void) const;

        //! @brief Current filter modification.
        //! @return true if the filter has been set (or was set previously), false otherwise.
        bool SetFilter(
            const TraceClass& CLI_Class,    //!< Trace class.
            const bool B_ShowTraces         //!< Show traces flag.
            );

        //! @brief All filter management.
        //! @return true for success, false otherwise.
        //!
        //! Same as above but for all filters in one operation.
        bool SetAllFilter(
            const bool B_ShowTraces         //!< Show traces flag.
            );

    public:
        //! @brief Trace status.
        //! @return true if the trace is active, false otherwise.
        bool IsTraceOn(
            const TraceClass& CLI_Class     //!< Trace class.
            ) const;

        //! @brief Trace routine.
        //! @return Trace output stream prepared to receive the trace.
        //! @note If enabled, the trace is directed to the output stream of the shell corresponding to context element.
        const OutputDevice& Trace(
            const TraceClass& CLI_Class     //!< Trace class.
            );

        //! @brief Safe trace routine.
        //! @return Trace output stream prepared to receive the trace. Null device if trace is avoided.
        //! @note Prevents output from infinite loops.
        const OutputDevice& SafeTrace(
            const TraceClass& CLI_Class,        //!< Trace class.
            const Object& CLI_AvoidStream       //!< Avoid stream from being sent characters.
            );

    private:
        //! @brief Internal trace routine.
        //! @return Trace output stream prepared to receive the trace
        //!
        //! Does not check whether the filter matches.
        const OutputDevice& BeginTrace(
            const TraceClass& CLI_Class     //!< Trace class.
            );

        //! @brief Trace filter state display.
        bool TraceFilterState(
            const TraceClass& CLI_Class,    //!< Trace class.
            const bool B_ShowTraces         //!< Show traces flag.
            );

    private:
        //! @brief Trace class + show flag aggregation.
        class TraceClassFlag : public TraceClass
        {
        public:
            explicit TraceClassFlag(void);
            explicit TraceClassFlag(const TraceClass& CLI_Source, const bool B_Show);
            TraceClassFlag(const TraceClassFlag& CLI_Source);
            virtual ~TraceClassFlag(void);
        public:
            TraceClassFlag& operator=(const TraceClassFlag& CLI_Class);
        public:
            bool IsVisible(void) const;
        private:
            bool m_bShow;
        };

        //! @brief Trace class map typedef.
        typedef tk::Map<tk::String, TraceClassFlag> ClassMap;

        //! List of available classes.
        ClassMap m_mapClasses;

        //! Trace all flag.
        bool m_bTraceAll;

        //! Traces output streams LIFO. Pushed from head.
        tk::Queue<OutputDevice*> m_qStreams;
    };

    //! @brief Singleton.
    //! @return The only one Traces instance.
    Traces& GetTraces(void);

CLI_NS_END(cli)

#endif // _CLI_TRACES_H_


text:
package org.motechproject.nms.kilkari.repository;

import org.motechproject.mds.service.MotechDataService;
import org.motechproject.nms.kilkari.domain.InboxCallData;

public interface InboxCallDataDataService extends MotechDataService<InboxCallData> {
}


text:
**Namespace:** [OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201605](OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201605.md)
**Assembly:** OfficeDevPnP.Core.dll
## Syntax
```C#
public enum PublishingAutoCheckRequirements
```
## Members
|**Member Name**|**Description**|
|:-----|:-----|
| MakeCompliant |
| SkipIfNotCompliant |
| FailIfNotCompliant |

## See also
- [OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201605](OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201605.md)