text:
/* eslint-disable */
import { Timestamp } from '../../../google/protobuf/timestamp';
import { Any } from '../../../google/protobuf/any';
import { Writer, Reader } from 'protobufjs/minimal';
export const protobufPackage = 'cosmos.authz.v1beta1';
const baseGenericAuthorization = { msg: '' };
export const GenericAuthorization = {
    encode(message, writer = Writer.create()) {
        if (message.msg !== '') {
            writer.uint32(10).string(message.msg);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof Uint8Array ? new Reader(input) : input;
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = { ...baseGenericAuthorization };
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.msg = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = { ...baseGenericAuthorization };
        if (object.msg !== undefined && object.msg !== null) {
            message.msg = String(object.msg);
        }
        else {
            message.msg = '';
        }
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.msg !== undefined && (obj.msg = message.msg);
        return obj;
    },
    fromPartial(object) {
        const message = { ...baseGenericAuthorization };
        if (object.msg !== undefined && object.msg !== null) {
            message.msg = object.msg;
        }
        else {
            message.msg = '';
        }
        return message;
    }
};
const baseGrant = {};
export const Grant = {
    encode(message, writer = Writer.create()) {
        if (message.authorization !== undefined) {
            Any.encode(message.authorization, writer.uint32(10).fork()).ldelim();
        }
        if (message.expiration !== undefined) {
            Timestamp.encode(toTimestamp(message.expiration), writer.uint32(18).fork()).ldelim();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof Uint8Array ? new Reader(input) : input;
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = { ...baseGrant };
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.authorization = Any.decode(reader, reader.uint32());
                    break;
                case 2:
                    message.expiration = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = { ...baseGrant };
        if (object.authorization !== undefined && object.authorization !== null) {
            message.authorization = Any.fromJSON(object.authorization);
        }
        else {
            message.authorization = undefined;
        }
        if (object.expiration !== undefined && object.expiration !== null) {
            message.expiration = fromJsonTimestamp(object.expiration);
        }
        else {
            message.expiration = undefined;
        }
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.authorization !== undefined && (obj.authorization = message.authorization ? Any.toJSON(message.authorization) : undefined);
        message.expiration !== undefined && (obj.expiration = message.expiration !== undefined ? message.expiration.toISOString() : null);
        return obj;
    },
    fromPartial(object) {
        const message = { ...baseGrant };
        if (object.authorization !== undefined && object.authorization !== null) {
            message.authorization = Any.fromPartial(object.authorization);
        }
        else {
            message.authorization = undefined;
        }
        if (object.expiration !== undefined && object.expiration !== null) {
            message.expiration = object.expiration;
        }
        else {
            message.expiration = undefined;
        }
        return message;
    }
};
function toTimestamp(date) {
    const seconds = date.getTime() / 1000;
    const nanos = (date.getTime() % 1000) * 1000000;
    return { seconds, nanos };
}
function fromTimestamp(t) {
    let millis = t.seconds * 1000;
    millis += t.nanos / 1000000;
    return new Date(millis);
}
function fromJsonTimestamp(o) {
    if (o instanceof Date) {
        return o;
    }
    else if (typeof o === 'string') {
        return new Date(o);
    }
    else {
        return fromTimestamp(Timestamp.fromJSON(o));
    }
}


text:
// Package
///////////////
package jena.examples.ontology.describeClass;

// Imports
///////////////
import java.util.Iterator;

import com.hp.hpl.jena.ontology.*;
import com.hp.hpl.jena.rdf.model.ModelFactory;

/**
 *

 * Execution wrapper for describe-class example
 *

 *
 * @author Ian Dickinson, HP Labs
 *         (email)
 * @version CVS $Id: Main.java,v 1.3 2009/10/06 13:04:44 ian_dickinson Exp $
 */
public class Main {
    // Constants
    //////////////////////////////////

    // Static variables
    //////////////////////////////////

    // Instance variables
    //////////////////////////////////

    // Constructors
    //////////////////////////////////

    // External signature methods
    //////////////////////////////////

    public static void main( String[] args ) {
        // read the argument file, or the default
        String source = (args.length == 0) ? "http://www.w3.org/2001/sw/WebOnt/guide-src/wine" : args[0];

        OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM, null );

        // we have a local copy of the wine ontology
        addFoodWineAltPaths( m.getDocumentManager() );

        // read the source document
        m.read( source );

        DescribeClass dc = new DescribeClass();

        if (args.length >= 2) {
            // we have a named class to describe
            OntClass c = m.getOntClass( args[1] );
            dc.describeClass( System.out, c );
        }
        else {
            for (Iterator<OntClass> i = m.listClasses();  i.hasNext(); ) {
                // now list the classes
                dc.describeClass( System.out, i.next() );
            }
        }
    }

    // Internal implementation methods
    //////////////////////////////////

    /**
     * Add alternate paths to save downloading the default ontologies from the Web
     */
    protected static void addFoodWineAltPaths( OntDocumentManager odm ) {
        odm.addAltEntry( "http://www.w3.org/2001/sw/WebOnt/guide-src/wine",
                         "file:testing/reasoners/bugs/wine.owl" );
        odm.addAltEntry( "http://www.w3.org/2001/sw/WebOnt/guide-src/wine.owl",
                         "file:testing/reasoners/bugs/wine.owl" );
        odm.addAltEntry( "http://www.w3.org/2001/sw/WebOnt/guide-src/food",
                         "file:testing/reasoners/bugs/food.owl" );
        odm.addAltEntry( "http://www.w3.org/2001/sw/WebOnt/guide-src/food.owl",
                         "file:testing/reasoners/bugs/food.owl" );
    }

    //==============================================================================
    // Inner class definitions
    //==============================================================================

}

/*
    (c) Copyright 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
    All rights reserved.

    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:

    1. Redistributions of source code must retain the above copyright
       notice, this list of conditions and the following disclaimer.

    2. Redistributions in binary form must reproduce the above copyright
       notice, this list of conditions and the following disclaimer in the
       documentation and/or other materials provided with the distribution.

    3. The name of the author may not be used to endorse or promote products
       derived from this software without specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
    INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
    NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
    THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

redpajama_set_name: RedPajamaGithub


text:
// SAXNotSupportedException.java - unsupported feature or value.
// http://www.saxproject.org
// Written by David Megginson
// NO WARRANTY!  This class is in the Public Domain.
// $Id: SAXNotSupportedException.java,v 1.7 2002/01/30 21:13:48 dbrownell Exp $

package org.xml.sax;

/**
 * Exception class for an unsupported operation.
 *
 *
 This module, both source code and documentation, is in the
 * Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further
 * information.

 *
 *

 * An XMLReader will throw this exception when it recognizes a feature or
 * property identifier, but cannot perform the requested operation (setting a
 * state or value). Other SAX2 applications and extensions may use this class
 * for similar purposes.
 *

 *
 * @since SAX 2.0
 * @author David Megginson
 * @version 2.0.1 (sax2r2)
 * @see org.xml.sax.SAXNotRecognizedException
 */
public class SAXNotSupportedException extends SAXException {

	/**
	 * Construct a new exception with no message.
	 */
	public SAXNotSupportedException() {
		super();
	}

	/**
	 * Construct a new exception with the given message.
	 *
	 * @param message
	 *            The text message of the exception.
	 */
	public SAXNotSupportedException(String message) {
		super(message);
	}

}

// end of SAXNotSupportedException.java


text:
package org.uberfire.ext.editor.commons.client.file.exports.jso;

import jsinterop.annotations.JsOverlay;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;

/**
 * The jsPDF' settings,
 * It's being exported just as an Object with the following properties:
 * - orientation
 * - unit
 * - format
 */
@JsType(isNative = true, name = "Object", namespace = JsPackage.GLOBAL)
public class JsPdfSettings {

    /**
     * Factory method for the jsPdf' settings.
     * @param orientation The document's orientation. It can be portrait or <ocde>landscape</ocde>.
     * @param unit Values are pm, mm, cm or in.
     * @param format Any of the allowed PDF page formats. See PdfSettings.Format.
     * @return A new jsPdf' settings instance.
     */
    @JsOverlay
    public static JsPdfSettings create(String orientation,
                                       String unit,
                                       String format) {
        final JsPdfSettings instance = new JsPdfSettings();
        instance.setOrientation(orientation);
        instance.setUnit(unit);
        instance.setFormat(format);
        return instance;
    }

    @JsProperty
    public native String getOrientation();

    @JsProperty
    public native void setOrientation(String orientation);

    @JsProperty
    public native String getUnit();

    @JsProperty
    public native void setUnit(String unit);

    @JsProperty
    public native String getFormat();

    @JsProperty
    public native void setFormat(String format);
}


text:
'use strict';

var ReactDOMFeatureFlags = require('ReactDOMFeatureFlags');
var describeStack = ReactDOMFeatureFlags.useFiber ? describe.skip : describe;

// ReactPerf is currently not supported on Fiber.
// Use browser timeline integration instead.
describeStack('ReactPerf', () => {
  var React;
  var ReactDOM;
  var ReactPerf;
  var ReactTestUtils;
  var emptyFunction;

  var App;
  var Box;
  var Div;
  var LifeCycle;

  beforeEach(() => {
    var now = 0;
    jest.setMock('fbjs/lib/performanceNow', function() {
      return now++;
    });

    if (typeof console.table !== 'function') {
      console.table = () => {};
      console.table.isFake = true;
    }

    React = require('react');
    ReactDOM = require('react-dom');
    ReactPerf = require('react-dom/lib/ReactPerf');
    ReactTestUtils = require('ReactTestUtils');
    emptyFunction = require('fbjs/lib/emptyFunction');

    App = class extends React.Component {
      render() {
        return
<Box /><Box flip={this.props.flipSecond} />
;
      }
    };

    Box = class extends React.Component {
      render() {
        return
<input />
;
      }
    };

    // ReactPerf only measures composites, so we put everything in one.
    Div = class extends React.Component {
      render() {
        return
;
      }
    };

    LifeCycle = React.createClass({
      shouldComponentUpdate: emptyFunction.thatReturnsTrue,
      componentWillMount: emptyFunction,
      componentDidMount: emptyFunction,
      componentWillReceiveProps: emptyFunction,
      componentWillUpdate: emptyFunction,
      componentDidUpdate: emptyFunction,
      componentWillUnmount: emptyFunction,
      render: emptyFunction.thatReturnsNull,
    });
  });

  afterEach(() => {
    if (console.table.isFake) {
      delete console.table;
    }
  });

  function measure(fn) {
    ReactPerf.start();
    fn();
    ReactPerf.stop();

    // Make sure none of the methods crash.
    ReactPerf.getWasted();
    ReactPerf.getInclusive();
    ReactPerf.getExclusive();
    ReactPerf.getOperations();

    return ReactPerf.getLastMeasurements();
  }

  it('should count no-op update as waste', () => {
    var container = document.createElement('div');
    ReactDOM.render(<App />, container);
    var measurements = measure(() => {
      ReactDOM.render(<App />, container);
    });

    var summary = ReactPerf.getWasted(measurements);
    expect(summary).toEqual([
      {
        key: 'App',
        instanceCount: 1,
        inclusiveRenderDuration: 3,
        renderCount: 1,
      },
      {
        key: 'App > Box',
        instanceCount: 2,
        inclusiveRenderDuration: 2,
        renderCount: 2,
      },
    ]);
  });

  it('should count no-op update in child as waste', () => {
    var container = document.createElement('div');
    ReactDOM.render(<App />, container);

    // Here, we add a Box -- two of the <Box /> updates are wasted time (but the
    // addition of the third is not)
    var measurements = measure(() => {
      ReactDOM.render(<App flipSecond={true} />, container);
    });

    var summary = ReactPerf.getWasted(measurements);
    expect(summary).toEqual([
      {
        key: 'App > Box',
        instanceCount: 1,
        inclusiveRenderDuration: 1,
        renderCount: 1,
      },
    ]);
  });

  function expectNoWaste(fn) {
    var measurements = measure(fn);
    var summary = ReactPerf.getWasted(measurements);
    expect(summary).toEqual([]);
  }

  it('should not count initial render as waste', () => {
    expectNoWaste(() => {
      ReactTestUtils.renderIntoDocument(<App />);
    });
  });

  it('should not count unmount as waste', () => {
    var container = document.createElement('div');
    ReactDOM.render(
hello
, container);
    expectNoWaste(() => {
      ReactDOM.unmountComponentAtNode(container);
    });
  });

  it('should not count content update as waste', () => {
    var container = document.createElement('div');
    ReactDOM.render(
hello
, container);
    expectNoWaste(() => {
      ReactDOM.render(
hello world
, container);
    });
  });

  it('should not count child addition as waste', () => {
    var container = document.createElement('div');
    ReactDOM.render(

, container);
    expectNoWaste(() => {
      ReactDOM.render(

, container);
    });
  });

  it('should not count child removal as waste', () => {
    var container = document.createElement('div');
    ReactDOM.render(

, container);
    expectNoWaste(() => {
      ReactDOM.render(

, container);
    });
  });

  it('should not count property update as waste', () => {
    var container = document.createElement('div');
    ReactDOM.render(
hey
, container);
    expectNoWaste(() => {
      ReactDOM.render(
hey
, container);
    });
  });

  it('should not count style update as waste', () => {
    var container = document.createElement('div');
    ReactDOM.render(
hey
, container);
    expectNoWaste(() => {
      ReactDOM.render(
hey
, container);
    });
  });

  it('should not count property removal as waste', () => {
    var container = document.createElement('div');
    ReactDOM.render(
hey
, container);
    expectNoWaste(() => {
      ReactDOM.render(
hey
, container);
    });
  });

  it('should not count raw HTML update as waste', () => {
    var container = document.createElement('div');
    ReactDOM.render(

,
      container,
    );
    expectNoWaste(() => {
      ReactDOM.render(

,
        container,
      );
    });
  });

  it('should not count child reordering as waste', () => {
    var container = document.createElement('div');
    ReactDOM.render(

, container);
    expectNoWaste(() => {
      ReactDOM.render(

, container);
    });
  });

  it('should not count text update as waste', () => {
    var container = document.createElement('div');
    ReactDOM.render(
{'hello'}{'world'}
, container);
    expectNoWaste(() => {
      ReactDOM.render(
{'hello'}{'friend'}
, container);
    });
  });

  it('should not count replacing null with a host as waste', () => {
    var element = null;
    function Foo() {
      return element;
    }
    var container = document.createElement('div');
    ReactDOM.render(<Foo />, container);
    expectNoWaste(() => {
      element =
;
      ReactDOM.render(<Foo />, container);
    });
  });

  it('should not count replacing a host with null as waste', () => {
    var element =
;
    function Foo() {
      return element;
    }
    var container = document.createElement('div');
    ReactDOM.render(<Foo />, container);
    expectNoWaste(() => {
      element = null;
      ReactDOM.render(<Foo />, container);
    });
  });

  it('should include stats for components unmounted during measurement', () => {
    var container = document.createElement('div');
    var measurements = measure(() => {
      ReactDOM.render(

, container);
      ReactDOM.render(

, container);
    });
    expect(ReactPerf.getExclusive(measurements)).toEqual([
      {
        key: 'Div',
        instanceCount: 3,
        counts: {ctor: 3, render: 4},
        durations: {ctor: 3, render: 4},
        totalDuration: 7,
      },
    ]);
  });

  it('should include lifecycle methods in measurements', () => {
    var container = document.createElement('div');
    var measurements = measure(() => {
      var instance = ReactDOM.render(<LifeCycle />, container);
      ReactDOM.render(<LifeCycle />, container);
      instance.setState({});
      ReactDOM.unmountComponentAtNode(container);
    });
    expect(ReactPerf.getExclusive(measurements)).toEqual([
      {
        key: 'LifeCycle',
        instanceCount: 1,
        totalDuration: 14,
        counts: {
          ctor: 1,
          shouldComponentUpdate: 2,
          componentWillMount: 1,
          componentDidMount: 1,
          componentWillReceiveProps: 1,
          componentWillUpdate: 2,
          componentDidUpdate: 2,
          componentWillUnmount: 1,
          render: 3,
        },
        durations: {
          ctor: 1,
          shouldComponentUpdate: 2,
          componentWillMount: 1,
          componentDidMount: 1,
          componentWillReceiveProps: 1,
          componentWillUpdate: 2,
          componentDidUpdate: 2,
          componentWillUnmount: 1,
          render: 3,
        },
      },
    ]);
  });

  it('should include render time of functional components', () => {
    function Foo() {
      return null;
    }

    var container = document.createElement('div');
    var measurements = measure(() => {
      ReactDOM.render(<Foo />, container);
    });
    expect(ReactPerf.getExclusive(measurements)).toEqual([
      {
        key: 'Foo',
        instanceCount: 1,
        totalDuration: 1,
        counts: {
          render: 1,
        },
        durations: {
          render: 1,
        },
      },
    ]);
  });

  it('should not count time in a portal towards lifecycle method', () => {
    function Foo() {
      return null;
    }

    var portalContainer = document.createElement('div');
    class Portal extends React.Component {
      componentDidMount() {
        ReactDOM.render(<Foo />, portalContainer);
      }
      render() {
        return null;
      }
    }

    var container = document.createElement('div');
    var measurements = measure(() => {
      ReactDOM.render(<Portal />, container);
    });

    expect(ReactPerf.getExclusive(measurements)).toEqual([
      {
        key: 'Portal',
        instanceCount: 1,
        totalDuration: 6,
        counts: {
          ctor: 1,
          componentDidMount: 1,
          render: 1,
        },
        durations: {
          ctor: 1,
          // We want to exclude nested imperative ReactDOM.render() from lifecycle hook's own time.
          // Otherwise it would artificially float to the top even though its exclusive time is small.
          // This is how we get 4 as a number with the performanceNow() mock:
          // - we capture the time we enter componentDidMount (n = 0)
          // - we capture the time when we enter a nested flush (n = 1)
          // - in the nested flush, we call it twice: before and after <Foo /> rendering. (n = 3)
          // - we capture the time when we exit a nested flush (n = 4)
          // - we capture the time we exit componentDidMount (n = 5)
          // Time spent in componentDidMount = (5 - 0 - (4 - 3)) = 4.
          componentDidMount: 4,
          render: 1,
        },
      },
      {
        key: 'Foo',
        instanceCount: 1,
        totalDuration: 1,
        counts: {
          render: 1,
        },
        durations: {
          render: 1,
        },
      },
    ]);
  });

  it('warns once when using getMeasurementsSummaryMap', () => {
    var measurements = measure(() => {});
    spyOn(console, 'error');
    ReactPerf.getMeasurementsSummaryMap(measurements);
    expectDev(console.error.calls.count()).toBe(1);
    expectDev(console.error.calls.argsFor(0)[0]).toContain(
      '`ReactPerf.getMeasurementsSummaryMap(...)` is deprecated. Use ' +
        '`ReactPerf.getWasted(...)` instead.',
    );

    ReactPerf.getMeasurementsSummaryMap(measurements);
    expectDev(console.error.calls.count()).toBe(1);
  });

  it('warns once when using printDOM', () => {
    var measurements = measure(() => {});
    spyOn(console, 'error');
    ReactPerf.printDOM(measurements);
    expectDev(console.error.calls.count()).toBe(1);
    expectDev(console.error.calls.argsFor(0)[0]).toContain(
      '`ReactPerf.printDOM(...)` is deprecated. Use ' +
        '`ReactPerf.printOperations(...)` instead.',
    );

    ReactPerf.printDOM(measurements);
    expectDev(console.error.calls.count()).toBe(1);
  });

  it('returns isRunning state', () => {
    expect(ReactPerf.isRunning()).toBe(false);

    ReactPerf.start();
    expect(ReactPerf.isRunning()).toBe(true);

    ReactPerf.stop();
    expect(ReactPerf.isRunning()).toBe(false);
  });

  it('start has no effect when already running', () => {
    expect(ReactPerf.isRunning()).toBe(false);

    ReactPerf.start();
    expect(ReactPerf.isRunning()).toBe(true);

    ReactPerf.start();
    expect(ReactPerf.isRunning()).toBe(true);

    ReactPerf.stop();
    expect(ReactPerf.isRunning()).toBe(false);
  });

  it('stop has no effect when already stopped', () => {
    expect(ReactPerf.isRunning()).toBe(false);

    ReactPerf.stop();
    expect(ReactPerf.isRunning()).toBe(false);

    ReactPerf.stop();
    expect(ReactPerf.isRunning()).toBe(false);
  });

  it('should print console error only once', () => {
    __DEV__ = false;

    spyOn(console, 'error');

    expect(ReactPerf.getLastMeasurements()).toEqual([]);
    expect(ReactPerf.getExclusive()).toEqual([]);
    expect(ReactPerf.getInclusive()).toEqual([]);
    expect(ReactPerf.getWasted()).toEqual([]);
    expect(ReactPerf.getOperations()).toEqual([]);
    expect(ReactPerf.printExclusive()).toEqual(undefined);
    expect(ReactPerf.printInclusive()).toEqual(undefined);
    expect(ReactPerf.printWasted()).toEqual(undefined);
    expect(ReactPerf.printOperations()).toEqual(undefined);
    expect(ReactPerf.start()).toBe(undefined);
    expect(ReactPerf.stop()).toBe(undefined);
    expect(ReactPerf.isRunning()).toBe(false);

    expectDev(console.error.calls.count()).toBe(1);

    __DEV__ = true;
  });

  it('should work when measurement starts during reconciliation', () => {
    // https://github.com/facebook/react/issues/6949#issuecomment-230371009
    class Measurer extends React.Component {
      componentWillMount() {
        ReactPerf.start();
      }

      componentDidMount() {
        ReactPerf.stop();
      }

      componentWillUpdate() {
        ReactPerf.start();
      }

      componentDidUpdate() {
        ReactPerf.stop();
      }

      render() {
        // Force reconciliation despite constant element
        return React.cloneElement(this.props.children);
      }
    }

    var container = document.createElement('div');
    ReactDOM.render(<Measurer><App /></Measurer>, container);
    expect(ReactPerf.getWasted()).toEqual([]);

    ReactDOM.render(<Measurer><App /></Measurer>, container);
    expect(ReactPerf.getWasted()).toEqual([
      {
        key: 'Measurer',
        instanceCount: 1,
        inclusiveRenderDuration: 4,
        renderCount: 1,
      },
      {
        key: 'App',
        instanceCount: 1,
        inclusiveRenderDuration: 3,
        renderCount: 1,
      },
      {
        key: 'App > Box',
        instanceCount: 2,
        inclusiveRenderDuration: 2,
        renderCount: 2,
      },
    ]);
  });

  it('should not print errant warnings if render() throws', () => {
    var container = document.createElement('div');
    var thrownErr = new Error('Muhaha!');

    class Evil extends React.Component {
      render() {
        throw thrownErr;
      }
    }

    ReactPerf.start();
    try {
      ReactDOM.render(

          <LifeCycle />
          <Evil />

,
        container,
      );
    } catch (err) {
      if (err !== thrownErr) {
        throw err;
      }
    }
    ReactPerf.stop();
  });

  it('should not print errant warnings if componentWillMount() throws', () => {
    var container = document.createElement('div');
    var thrownErr = new Error('Muhaha!');

    class Evil extends React.Component {
      componentWillMount() {
        throw thrownErr;
      }
      render() {
        return
;
      }
    }

    ReactPerf.start();
    try {
      ReactDOM.render(

          <LifeCycle />
          <Evil />

,
        container,
      );
    } catch (err) {
      if (err !== thrownErr) {
        throw err;
      }
    }
    ReactPerf.stop();
  });

  it('should not print errant warnings if componentDidMount() throws', () => {
    var container = document.createElement('div');
    var thrownErr = new Error('Muhaha!');

    class Evil extends React.Component {
      componentDidMount() {
        throw thrownErr;
      }
      render() {
        return
;
      }
    }

    ReactPerf.start();
    try {
      ReactDOM.render(

          <LifeCycle />
          <Evil />

,
        container,
      );
    } catch (err) {
      if (err !== thrownErr) {
        throw err;
      }
    }
    ReactPerf.stop();
  });

  it('should not print errant warnings if portal throws in render()', () => {
    var container = document.createElement('div');
    var thrownErr = new Error('Muhaha!');

    class Evil extends React.Component {
      render() {
        throw thrownErr;
      }
    }
    class EvilPortal extends React.Component {
      componentDidMount() {
        var portalContainer = document.createElement('div');
        ReactDOM.render(<Evil />, portalContainer);
      }
      render() {
        return
;
      }
    }

    ReactPerf.start();
    try {
      ReactDOM.render(

          <LifeCycle />
          <EvilPortal />

,
        container,
      );
    } catch (err) {
      if (err !== thrownErr) {
        throw err;
      }
    }
    ReactDOM.unmountComponentAtNode(container);
    ReactPerf.stop();
  });

  it('should not print errant warnings if portal throws in componentWillMount()', () => {
    var container = document.createElement('div');
    var thrownErr = new Error('Muhaha!');

    class Evil extends React.Component {
      componentWillMount() {
        throw thrownErr;
      }
      render() {
        return
;
      }
    }
    class EvilPortal extends React.Component {
      componentWillMount() {
        var portalContainer = document.createElement('div');
        ReactDOM.render(<Evil />, portalContainer);
      }
      render() {
        return
;
      }
    }

    ReactPerf.start();
    try {
      ReactDOM.render(

          <LifeCycle />
          <EvilPortal />

,
        container,
      );
    } catch (err) {
      if (err !== thrownErr) {
        throw err;
      }
    }
    ReactDOM.unmountComponentAtNode(container);
    ReactPerf.stop();
  });

  it('should not print errant warnings if portal throws in componentDidMount()', () => {
    var container = document.createElement('div');
    var thrownErr = new Error('Muhaha!');

    class Evil extends React.Component {
      componentDidMount() {
        throw thrownErr;
      }
      render() {
        return
;
      }
    }
    class EvilPortal extends React.Component {
      componentDidMount() {
        var portalContainer = document.createElement('div');
        ReactDOM.render(<Evil />, portalContainer);
      }
      render() {
        return
;
      }
    }

    ReactPerf.start();
    try {
      ReactDOM.render(

          <LifeCycle />
          <EvilPortal />

,
        container,
      );
    } catch (err) {
      if (err !== thrownErr) {
        throw err;
      }
    }
    ReactDOM.unmountComponentAtNode(container);
    ReactPerf.stop();
  });
});


text:
namespace boost
{
  namespace signals2
  {
    namespace detail
    {
      struct std_functional_base
      {};
    } // namespace detail
  } // namespace signals2
} // namespace boost

#endif // BOOST_SIGNALS2_PREPROCESSED_ARG_TYPE_HPP


text:
import java.io.*;
class Foo {
    void foo(String s) throws IOException {
        throw new IOException("ex");
    }
}

class MyEx extends IOException {
    MyEx() {
        this("my ex");
    }

    MyEx(String s) {
        super("my ex");
    }

}


text:
using System;

using Aragas.Core.Data;
using Aragas.Core.IO;
using Aragas.Core.Packets;

using ProtocolModern.Enum;

namespace ProtocolModern.Packets.Client.Play
{
    public class TeamsPacket : ProtobufPacket
    {
		public String TeamName;
		public SByte Mode;
		public String TeamDisplayName;
		public String TeamPrefix;
		public String TeamSuffix;
		public SByte FriendlyFire;
		//public NotSupportedType Players;

        public override VarInt ID => ClientPlayPacketTypes.Teams;

        public override ProtobufPacket ReadPacket(ProtobufDataReader reader)
        {
			TeamName = reader.Read(TeamName);
			Mode = reader.Read(Mode);
			TeamDisplayName = reader.Read(TeamDisplayName);
			TeamPrefix = reader.Read(TeamPrefix);
			TeamSuffix = reader.Read(TeamSuffix);
			FriendlyFire = reader.Read(FriendlyFire);
			var PlayersLength = reader.Read<short>();
			//Players = reader.Read(Players);

            return this;
        }

        public override ProtobufPacket WritePacket(ProtobufStream stream)
        {
			stream.Write(TeamName);
			stream.Write(Mode);
			stream.Write(TeamDisplayName);
			stream.Write(TeamPrefix);
			stream.Write(TeamSuffix);
			stream.Write(FriendlyFire);
			//stream.Write((short) Players.Length);
			//stream.Write(Players);

            return this;
        }

    }
}


text:
The wb01 project

General info

Project description

Data source

The About view

The lifeExpectancy view

Database

General info

This project provides a chart of the life expectancy at birth in Germany.

Project description

Data source

The project declares an SQL data source consisting of an embedded Derby database stored in a zip file located in the project's directory.

Because Viewreka sets the value of the system property 'user.dir' to the directory of the current project, this property is used in the connection string to locate the database.

The About View

The About view provides an HTML chart with information about this project. The chart content is retrieved from an external file (and it is the document you are currently reading).

The lifeExpectancy View

The lifeExpectancy view provides an XY chart based on the dataset dsLifeExp, which is defined by a simple inline query.

Database

This project uses a Derby database compiled from data provided by the World Bank.

The database consists of four tables, as seen in the figure below:

Below is a sample of the data contained in these tables:

    TA_COUNTRY

    TA_REGION

TA_INCOME

TA_INDICATOR

The database also contains two views that present the data in a user friendly form, as illustrated by the samples below:

V_COUNTRY

V_INDICATOR


text:
__TIB_DEFINITION_java_lang_reflect_Modifier __TIB_java_lang_reflect_Modifier = {
    0, // classInitializationBegan
    0, // classInitialized
    -1, // initializerThreadId
    __INIT_java_lang_reflect_Modifier, // classInitializer
    "java.lang.reflect.Modifier", // className
    "java.lang.reflect", // package
    JAVA_NULL, // enclosingClassName
    JAVA_NULL, // enclosingMethodName
    JAVA_NULL, // signature
    (__TIB_DEFINITION_TEMPLATE*) &__TIB_java_lang_Object, // extends
    sizeof(java_lang_reflect_Modifier), // sizeInstance
    XMLVM_TYPE_CLASS};

JAVA_OBJECT __CLASS_java_lang_reflect_Modifier;
JAVA_OBJECT __CLASS_java_lang_reflect_Modifier_1ARRAY;
JAVA_OBJECT __CLASS_java_lang_reflect_Modifier_2ARRAY;
JAVA_OBJECT __CLASS_java_lang_reflect_Modifier_3ARRAY;
//XMLVM_BEGIN_IMPLEMENTATION
//XMLVM_END_IMPLEMENTATION

static JAVA_INT _STATIC_java_lang_reflect_Modifier_PUBLIC;
static JAVA_INT _STATIC_java_lang_reflect_Modifier_PRIVATE;
static JAVA_INT _STATIC_java_lang_reflect_Modifier_PROTECTED;
static JAVA_INT _STATIC_java_lang_reflect_Modifier_STATIC;
static JAVA_INT _STATIC_java_lang_reflect_Modifier_FINAL;
static JAVA_INT _STATIC_java_lang_reflect_Modifier_SYNCHRONIZED;
static JAVA_INT _STATIC_java_lang_reflect_Modifier_VOLATILE;
static JAVA_INT _STATIC_java_lang_reflect_Modifier_TRANSIENT;
static JAVA_INT _STATIC_java_lang_reflect_Modifier_NATIVE;
static JAVA_INT _STATIC_java_lang_reflect_Modifier_INTERFACE;
static JAVA_INT _STATIC_java_lang_reflect_Modifier_ABSTRACT;
static JAVA_INT _STATIC_java_lang_reflect_Modifier_STRICT;
static JAVA_INT _STATIC_java_lang_reflect_Modifier_BRIDGE;
static JAVA_INT _STATIC_java_lang_reflect_Modifier_VARARGS;
static JAVA_INT _STATIC_java_lang_reflect_Modifier_SYNTHETIC;
static JAVA_INT _STATIC_java_lang_reflect_Modifier_ANNOTATION;
static JAVA_INT _STATIC_java_lang_reflect_Modifier_ENUM;

#include "xmlvm-reflection.h"

static XMLVM_FIELD_REFLECTION_DATA __field_reflection_data[] = {
};

static XMLVM_CONSTRUCTOR_REFLECTION_DATA __constructor_reflection_data[] = {
};

static JAVA_OBJECT constructor_dispatcher(JAVA_OBJECT constructor, JAVA_OBJECT arguments)
{
    XMLVM_NOT_IMPLEMENTED();
}

static XMLVM_METHOD_REFLECTION_DATA __method_reflection_data[] = {
};

static JAVA_OBJECT method_dispatcher(JAVA_OBJECT method, JAVA_OBJECT receiver, JAVA_OBJECT arguments)
{
    XMLVM_NOT_IMPLEMENTED();
}

void __INIT_java_lang_reflect_Modifier()
{
    staticInitializerLock(&__TIB_java_lang_reflect_Modifier);

    // While the static initializer mutex is locked, locally store the value of
    // whether class initialization began or not
    int initBegan = __TIB_java_lang_reflect_Modifier.classInitializationBegan;

    // Whether or not class initialization had already began, it has begun now
    __TIB_java_lang_reflect_Modifier.classInitializationBegan = 1;

    staticInitializerUnlock(&__TIB_java_lang_reflect_Modifier);

    JAVA_LONG curThreadId = (JAVA_LONG)pthread_self();
    if (initBegan) {
        if (__TIB_java_lang_reflect_Modifier.initializerThreadId != curThreadId) {
            // Busy wait until the other thread finishes initializing this class
            while (!__TIB_java_lang_reflect_Modifier.classInitialized) {
                // do nothing
            }
        }
    } else {
        __TIB_java_lang_reflect_Modifier.initializerThreadId = curThreadId;
        XMLVM_CLASS_USED("java.lang.reflect.Modifier")
        __INIT_IMPL_java_lang_reflect_Modifier();
    }
}

void __INIT_IMPL_java_lang_reflect_Modifier()
{
    // Initialize base class if necessary
    XMLVM_CLASS_INIT(java_lang_Object)
    __TIB_java_lang_reflect_Modifier.newInstanceFunc = __NEW_INSTANCE_java_lang_reflect_Modifier;
    // Copy vtable from base class
    XMLVM_MEMCPY(__TIB_java_lang_reflect_Modifier.vtable, __TIB_java_lang_Object.vtable, sizeof(__TIB_java_lang_Object.vtable));
    // Initialize vtable for this class
    // Initialize interface information
    __TIB_java_lang_reflect_Modifier.numImplementedInterfaces = 0;
    __TIB_java_lang_reflect_Modifier.implementedInterfaces = (__TIB_DEFINITION_TEMPLATE* (*)[1]) XMLVM_MALLOC(sizeof(__TIB_DEFINITION_TEMPLATE*) * 0);

    // Initialize interfaces if necessary and assign tib to implementedInterfaces
    _STATIC_java_lang_reflect_Modifier_PUBLIC = 1;
    _STATIC_java_lang_reflect_Modifier_PRIVATE = 2;
    _STATIC_java_lang_reflect_Modifier_PROTECTED = 4;
    _STATIC_java_lang_reflect_Modifier_STATIC = 8;
    _STATIC_java_lang_reflect_Modifier_FINAL = 16;
    _STATIC_java_lang_reflect_Modifier_SYNCHRONIZED = 32;
    _STATIC_java_lang_reflect_Modifier_VOLATILE = 64;
    _STATIC_java_lang_reflect_Modifier_TRANSIENT = 128;
    _STATIC_java_lang_reflect_Modifier_NATIVE = 256;
    _STATIC_java_lang_reflect_Modifier_INTERFACE = 512;
    _STATIC_java_lang_reflect_Modifier_ABSTRACT = 1024;
    _STATIC_java_lang_reflect_Modifier_STRICT = 2048;
    _STATIC_java_lang_reflect_Modifier_BRIDGE = 64;
    _STATIC_java_lang_reflect_Modifier_VARARGS = 128;
    _STATIC_java_lang_reflect_Modifier_SYNTHETIC = 4096;
    _STATIC_java_lang_reflect_Modifier_ANNOTATION = 8192;
    _STATIC_java_lang_reflect_Modifier_ENUM = 16384;

    __TIB_java_lang_reflect_Modifier.declaredFields = &__field_reflection_data[0];
    __TIB_java_lang_reflect_Modifier.numDeclaredFields = sizeof(__field_reflection_data) / sizeof(XMLVM_FIELD_REFLECTION_DATA);
    __TIB_java_lang_reflect_Modifier.constructorDispatcherFunc = constructor_dispatcher;
    __TIB_java_lang_reflect_Modifier.declaredConstructors = &__constructor_reflection_data[0];
    __TIB_java_lang_reflect_Modifier.numDeclaredConstructors = sizeof(__constructor_reflection_data) / sizeof(XMLVM_CONSTRUCTOR_REFLECTION_DATA);
    __TIB_java_lang_reflect_Modifier.methodDispatcherFunc = method_dispatcher;
    __TIB_java_lang_reflect_Modifier.declaredMethods = &__method_reflection_data[0];
    __TIB_java_lang_reflect_Modifier.numDeclaredMethods = sizeof(__method_reflection_data) / sizeof(XMLVM_METHOD_REFLECTION_DATA);
    __CLASS_java_lang_reflect_Modifier = XMLVM_CREATE_CLASS_OBJECT(&__TIB_java_lang_reflect_Modifier);
    __TIB_java_lang_reflect_Modifier.clazz = __CLASS_java_lang_reflect_Modifier;
    __TIB_java_lang_reflect_Modifier.baseType = JAVA_NULL;
    __CLASS_java_lang_reflect_Modifier_1ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_java_lang_reflect_Modifier);
    __CLASS_java_lang_reflect_Modifier_2ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_java_lang_reflect_Modifier_1ARRAY);
    __CLASS_java_lang_reflect_Modifier_3ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_java_lang_reflect_Modifier_2ARRAY);
    //XMLVM_BEGIN_WRAPPER[__INIT_java_lang_reflect_Modifier]
    //XMLVM_END_WRAPPER

    __TIB_java_lang_reflect_Modifier.classInitialized = 1;
}

void __DELETE_java_lang_reflect_Modifier(void* me, void* client_data)
{
    //XMLVM_BEGIN_WRAPPER[__DELETE_java_lang_reflect_Modifier]
    //XMLVM_END_WRAPPER
}

void __INIT_INSTANCE_MEMBERS_java_lang_reflect_Modifier(JAVA_OBJECT me, int derivedClassWillRegisterFinalizer)
{
    __INIT_INSTANCE_MEMBERS_java_lang_Object(me, 0 || derivedClassWillRegisterFinalizer);
    //XMLVM_BEGIN_WRAPPER[__INIT_INSTANCE_MEMBERS_java_lang_reflect_Modifier]
    //XMLVM_END_WRAPPER
}

JAVA_OBJECT __NEW_java_lang_reflect_Modifier()
{    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
java_lang_reflect_Modifier* me = (java_lang_reflect_Modifier*) XMLVM_MALLOC(sizeof(java_lang_reflect_Modifier));
    me->tib = &__TIB_java_lang_reflect_Modifier;
    __INIT_INSTANCE_MEMBERS_java_lang_reflect_Modifier(me, 0);
    //XMLVM_BEGIN_WRAPPER[__NEW_java_lang_reflect_Modifier]
    //XMLVM_END_WRAPPER
    return me;
}

JAVA_OBJECT __NEW_INSTANCE_java_lang_reflect_Modifier()
{
    JAVA_OBJECT me = JAVA_NULL;
    me = __NEW_java_lang_reflect_Modifier();
    java_lang_reflect_Modifier___INIT___(me);
    return me;
}

JAVA_INT java_lang_reflect_Modifier_GET_PUBLIC()
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    return _STATIC_java_lang_reflect_Modifier_PUBLIC;
}

void java_lang_reflect_Modifier_PUT_PUBLIC(JAVA_INT v)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
_STATIC_java_lang_reflect_Modifier_PUBLIC = v;
}

JAVA_INT java_lang_reflect_Modifier_GET_PRIVATE()
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    return _STATIC_java_lang_reflect_Modifier_PRIVATE;
}

void java_lang_reflect_Modifier_PUT_PRIVATE(JAVA_INT v)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
_STATIC_java_lang_reflect_Modifier_PRIVATE = v;
}

JAVA_INT java_lang_reflect_Modifier_GET_PROTECTED()
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    return _STATIC_java_lang_reflect_Modifier_PROTECTED;
}

void java_lang_reflect_Modifier_PUT_PROTECTED(JAVA_INT v)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
_STATIC_java_lang_reflect_Modifier_PROTECTED = v;
}

JAVA_INT java_lang_reflect_Modifier_GET_STATIC()
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    return _STATIC_java_lang_reflect_Modifier_STATIC;
}

void java_lang_reflect_Modifier_PUT_STATIC(JAVA_INT v)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
_STATIC_java_lang_reflect_Modifier_STATIC = v;
}

JAVA_INT java_lang_reflect_Modifier_GET_FINAL()
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    return _STATIC_java_lang_reflect_Modifier_FINAL;
}

void java_lang_reflect_Modifier_PUT_FINAL(JAVA_INT v)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
_STATIC_java_lang_reflect_Modifier_FINAL = v;
}

JAVA_INT java_lang_reflect_Modifier_GET_SYNCHRONIZED()
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    return _STATIC_java_lang_reflect_Modifier_SYNCHRONIZED;
}

void java_lang_reflect_Modifier_PUT_SYNCHRONIZED(JAVA_INT v)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
_STATIC_java_lang_reflect_Modifier_SYNCHRONIZED = v;
}

JAVA_INT java_lang_reflect_Modifier_GET_VOLATILE()
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    return _STATIC_java_lang_reflect_Modifier_VOLATILE;
}

void java_lang_reflect_Modifier_PUT_VOLATILE(JAVA_INT v)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
_STATIC_java_lang_reflect_Modifier_VOLATILE = v;
}

JAVA_INT java_lang_reflect_Modifier_GET_TRANSIENT()
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    return _STATIC_java_lang_reflect_Modifier_TRANSIENT;
}

void java_lang_reflect_Modifier_PUT_TRANSIENT(JAVA_INT v)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
_STATIC_java_lang_reflect_Modifier_TRANSIENT = v;
}

JAVA_INT java_lang_reflect_Modifier_GET_NATIVE()
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    return _STATIC_java_lang_reflect_Modifier_NATIVE;
}

void java_lang_reflect_Modifier_PUT_NATIVE(JAVA_INT v)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
_STATIC_java_lang_reflect_Modifier_NATIVE = v;
}

JAVA_INT java_lang_reflect_Modifier_GET_INTERFACE()
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    return _STATIC_java_lang_reflect_Modifier_INTERFACE;
}

void java_lang_reflect_Modifier_PUT_INTERFACE(JAVA_INT v)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
_STATIC_java_lang_reflect_Modifier_INTERFACE = v;
}

JAVA_INT java_lang_reflect_Modifier_GET_ABSTRACT()
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    return _STATIC_java_lang_reflect_Modifier_ABSTRACT;
}

void java_lang_reflect_Modifier_PUT_ABSTRACT(JAVA_INT v)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
_STATIC_java_lang_reflect_Modifier_ABSTRACT = v;
}

JAVA_INT java_lang_reflect_Modifier_GET_STRICT()
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    return _STATIC_java_lang_reflect_Modifier_STRICT;
}

void java_lang_reflect_Modifier_PUT_STRICT(JAVA_INT v)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
_STATIC_java_lang_reflect_Modifier_STRICT = v;
}

JAVA_INT java_lang_reflect_Modifier_GET_BRIDGE()
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    return _STATIC_java_lang_reflect_Modifier_BRIDGE;
}

void java_lang_reflect_Modifier_PUT_BRIDGE(JAVA_INT v)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
_STATIC_java_lang_reflect_Modifier_BRIDGE = v;
}

JAVA_INT java_lang_reflect_Modifier_GET_VARARGS()
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    return _STATIC_java_lang_reflect_Modifier_VARARGS;
}

void java_lang_reflect_Modifier_PUT_VARARGS(JAVA_INT v)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
_STATIC_java_lang_reflect_Modifier_VARARGS = v;
}

JAVA_INT java_lang_reflect_Modifier_GET_SYNTHETIC()
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    return _STATIC_java_lang_reflect_Modifier_SYNTHETIC;
}

void java_lang_reflect_Modifier_PUT_SYNTHETIC(JAVA_INT v)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
_STATIC_java_lang_reflect_Modifier_SYNTHETIC = v;
}

JAVA_INT java_lang_reflect_Modifier_GET_ANNOTATION()
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    return _STATIC_java_lang_reflect_Modifier_ANNOTATION;
}

void java_lang_reflect_Modifier_PUT_ANNOTATION(JAVA_INT v)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
_STATIC_java_lang_reflect_Modifier_ANNOTATION = v;
}

JAVA_INT java_lang_reflect_Modifier_GET_ENUM()
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    return _STATIC_java_lang_reflect_Modifier_ENUM;
}

void java_lang_reflect_Modifier_PUT_ENUM(JAVA_INT v)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
_STATIC_java_lang_reflect_Modifier_ENUM = v;
}

void java_lang_reflect_Modifier___INIT___(JAVA_OBJECT me)
{
    //XMLVM_BEGIN_WRAPPER[java_lang_reflect_Modifier___INIT___]
    XMLVM_ENTER_METHOD("java.lang.reflect.Modifier", "<init>", "?")
    XMLVMElem _r0;
    _r0.o = me;
    XMLVM_SOURCE_POSITION("Modifier.java", 110)
    XMLVM_CHECK_NPE(0)
    java_lang_Object___INIT___(_r0.o);
    XMLVM_SOURCE_POSITION("Modifier.java", 111)
    XMLVM_EXIT_METHOD()
    return;
    //XMLVM_END_WRAPPER
}

JAVA_BOOLEAN java_lang_reflect_Modifier_isAbstract___int(JAVA_INT n1)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    //XMLVM_BEGIN_WRAPPER[java_lang_reflect_Modifier_isAbstract___int]
    XMLVM_ENTER_METHOD("java.lang.reflect.Modifier", "isAbstract", "?")
    XMLVMElem _r0;
    XMLVMElem _r1;
    _r1.i = n1;
    XMLVM_SOURCE_POSITION("Modifier.java", 123)
    _r0.i = _r1.i & 1024;
    if (_r0.i == 0) goto label6;
    _r0.i = 1;
    label5:;
    XMLVM_EXIT_METHOD()
    return _r0.i;
    label6:;
    _r0.i = 0;
    goto label5;
    //XMLVM_END_WRAPPER
}

JAVA_BOOLEAN java_lang_reflect_Modifier_isFinal___int(JAVA_INT n1)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    //XMLVM_BEGIN_WRAPPER[java_lang_reflect_Modifier_isFinal___int]
    XMLVM_ENTER_METHOD("java.lang.reflect.Modifier", "isFinal", "?")
    XMLVMElem _r0;
    XMLVMElem _r1;
    _r1.i = n1;
    XMLVM_SOURCE_POSITION("Modifier.java", 136)
    _r0.i = _r1.i & 16;
    if (_r0.i == 0) goto label6;
    _r0.i = 1;
    label5:;
    XMLVM_EXIT_METHOD()
    return _r0.i;
    label6:;
    _r0.i = 0;
    goto label5;
    //XMLVM_END_WRAPPER
}

JAVA_BOOLEAN java_lang_reflect_Modifier_isInterface___int(JAVA_INT n1)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    //XMLVM_BEGIN_WRAPPER[java_lang_reflect_Modifier_isInterface___int]
    XMLVM_ENTER_METHOD("java.lang.reflect.Modifier", "isInterface", "?")
    XMLVMElem _r0;
    XMLVMElem _r1;
    _r1.i = n1;
    XMLVM_SOURCE_POSITION("Modifier.java", 149)
    _r0.i = _r1.i & 512;
    if (_r0.i == 0) goto label6;
    _r0.i = 1;
    label5:;
    XMLVM_EXIT_METHOD()
    return _r0.i;
    label6:;
    _r0.i = 0;
    goto label5;
    //XMLVM_END_WRAPPER
}

JAVA_BOOLEAN java_lang_reflect_Modifier_isNative___int(JAVA_INT n1)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    //XMLVM_BEGIN_WRAPPER[java_lang_reflect_Modifier_isNative___int]
    XMLVM_ENTER_METHOD("java.lang.reflect.Modifier", "isNative", "?")
    XMLVMElem _r0;
    XMLVMElem _r1;
    _r1.i = n1;
    XMLVM_SOURCE_POSITION("Modifier.java", 162)
    _r0.i = _r1.i & 256;
    if (_r0.i == 0) goto label6;
    _r0.i = 1;
    label5:;
    XMLVM_EXIT_METHOD()
    return _r0.i;
    label6:;
    _r0.i = 0;
    goto label5;
    //XMLVM_END_WRAPPER
}

JAVA_BOOLEAN java_lang_reflect_Modifier_isPrivate___int(JAVA_INT n1)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    //XMLVM_BEGIN_WRAPPER[java_lang_reflect_Modifier_isPrivate___int]
    XMLVM_ENTER_METHOD("java.lang.reflect.Modifier", "isPrivate", "?")
    XMLVMElem _r0;
    XMLVMElem _r1;
    _r1.i = n1;
    XMLVM_SOURCE_POSITION("Modifier.java", 175)
    _r0.i = _r1.i & 2;
    if (_r0.i == 0) goto label6;
    _r0.i = 1;
    label5:;
    XMLVM_EXIT_METHOD()
    return _r0.i;
    label6:;
    _r0.i = 0;
    goto label5;
    //XMLVM_END_WRAPPER
}

JAVA_BOOLEAN java_lang_reflect_Modifier_isProtected___int(JAVA_INT n1)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    //XMLVM_BEGIN_WRAPPER[java_lang_reflect_Modifier_isProtected___int]
    XMLVM_ENTER_METHOD("java.lang.reflect.Modifier", "isProtected", "?")
    XMLVMElem _r0;
    XMLVMElem _r1;
    _r1.i = n1;
    XMLVM_SOURCE_POSITION("Modifier.java", 188)
    _r0.i = _r1.i & 4;
    if (_r0.i == 0) goto label6;
    _r0.i = 1;
    label5:;
    XMLVM_EXIT_METHOD()
    return _r0.i;
    label6:;
    _r0.i = 0;
    goto label5;
    //XMLVM_END_WRAPPER
}

JAVA_BOOLEAN java_lang_reflect_Modifier_isPublic___int(JAVA_INT n1)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    //XMLVM_BEGIN_WRAPPER[java_lang_reflect_Modifier_isPublic___int]
    XMLVM_ENTER_METHOD("java.lang.reflect.Modifier", "isPublic", "?")
    XMLVMElem _r0;
    XMLVMElem _r1;
    _r1.i = n1;
    XMLVM_SOURCE_POSITION("Modifier.java", 201)
    _r0.i = _r1.i & 1;
    if (_r0.i == 0) goto label6;
    _r0.i = 1;
    label5:;
    XMLVM_EXIT_METHOD()
    return _r0.i;
    label6:;
    _r0.i = 0;
    goto label5;
    //XMLVM_END_WRAPPER
}

JAVA_BOOLEAN java_lang_reflect_Modifier_isStatic___int(JAVA_INT n1)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    //XMLVM_BEGIN_WRAPPER[java_lang_reflect_Modifier_isStatic___int]
    XMLVM_ENTER_METHOD("java.lang.reflect.Modifier", "isStatic", "?")
    XMLVMElem _r0;
    XMLVMElem _r1;
    _r1.i = n1;
    XMLVM_SOURCE_POSITION("Modifier.java", 214)
    _r0.i = _r1.i & 8;
    if (_r0.i == 0) goto label6;
    _r0.i = 1;
    label5:;
    XMLVM_EXIT_METHOD()
    return _r0.i;
    label6:;
    _r0.i = 0;
    goto label5;
    //XMLVM_END_WRAPPER
}

JAVA_BOOLEAN java_lang_reflect_Modifier_isStrict___int(JAVA_INT n1)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    //XMLVM_BEGIN_WRAPPER[java_lang_reflect_Modifier_isStrict___int]
    XMLVM_ENTER_METHOD("java.lang.reflect.Modifier", "isStrict", "?")
    XMLVMElem _r0;
    XMLVMElem _r1;
    _r1.i = n1;
    XMLVM_SOURCE_POSITION("Modifier.java", 227)
    _r0.i = _r1.i & 2048;
    if (_r0.i == 0) goto label6;
    _r0.i = 1;
    label5:;
    XMLVM_EXIT_METHOD()
    return _r0.i;
    label6:;
    _r0.i = 0;
    goto label5;
    //XMLVM_END_WRAPPER
}

JAVA_BOOLEAN java_lang_reflect_Modifier_isSynchronized___int(JAVA_INT n1)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    //XMLVM_BEGIN_WRAPPER[java_lang_reflect_Modifier_isSynchronized___int]
    XMLVM_ENTER_METHOD("java.lang.reflect.Modifier", "isSynchronized", "?")
    XMLVMElem _r0;
    XMLVMElem _r1;
    _r1.i = n1;
    XMLVM_SOURCE_POSITION("Modifier.java", 240)
    _r0.i = _r1.i & 32;
    if (_r0.i == 0) goto label6;
    _r0.i = 1;
    label5:;
    XMLVM_EXIT_METHOD()
    return _r0.i;
    label6:;
    _r0.i = 0;
    goto label5;
    //XMLVM_END_WRAPPER
}

JAVA_BOOLEAN java_lang_reflect_Modifier_isTransient___int(JAVA_INT n1)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    //XMLVM_BEGIN_WRAPPER[java_lang_reflect_Modifier_isTransient___int]
    XMLVM_ENTER_METHOD("java.lang.reflect.Modifier", "isTransient", "?")
    XMLVMElem _r0;
    XMLVMElem _r1;
    _r1.i = n1;
    XMLVM_SOURCE_POSITION("Modifier.java", 253)
    _r0.i = _r1.i & 128;
    if (_r0.i == 0) goto label6;
    _r0.i = 1;
    label5:;
    XMLVM_EXIT_METHOD()
    return _r0.i;
    label6:;
    _r0.i = 0;
    goto label5;
    //XMLVM_END_WRAPPER
}

JAVA_BOOLEAN java_lang_reflect_Modifier_isVolatile___int(JAVA_INT n1)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    //XMLVM_BEGIN_WRAPPER[java_lang_reflect_Modifier_isVolatile___int]
    XMLVM_ENTER_METHOD("java.lang.reflect.Modifier", "isVolatile", "?")
    XMLVMElem _r0;
    XMLVMElem _r1;
    _r1.i = n1;
    XMLVM_SOURCE_POSITION("Modifier.java", 266)
    _r0.i = _r1.i & 64;
    if (_r0.i == 0) goto label6;
    _r0.i = 1;
    label5:;
    XMLVM_EXIT_METHOD()
    return _r0.i;
    label6:;
    _r0.i = 0;
    goto label5;
    //XMLVM_END_WRAPPER
}

JAVA_OBJECT java_lang_reflect_Modifier_toString___int(JAVA_INT n1)
{
    XMLVM_CLASS_INIT(java_lang_reflect_Modifier)
    //XMLVM_BEGIN_WRAPPER[java_lang_reflect_Modifier_toString___int]
    XMLVM_ENTER_METHOD("java.lang.reflect.Modifier", "toString", "?")
    XMLVMElem _r0;
    XMLVMElem _r1;
    XMLVMElem _r2;
    XMLVMElem _r3;
    _r3.i = n1;
    XMLVM_SOURCE_POSITION("Modifier.java", 282)
    _r0.o = __NEW_java_lang_StringBuilder();
    XMLVM_CHECK_NPE(0)
    java_lang_StringBuilder___INIT___(_r0.o);
    XMLVM_SOURCE_POSITION("Modifier.java", 284)
    _r1.i = java_lang_reflect_Modifier_isPublic___int(_r3.i);
    if (_r1.i == 0) goto label16;
    XMLVM_SOURCE_POSITION("Modifier.java", 285)
    // "public "
    _r1.o = xmlvm_create_java_string_from_pool(650);
    XMLVM_CHECK_NPE(0)
    java_lang_StringBuilder_append___java_lang_String(_r0.o, _r1.o);
    label16:;
    XMLVM_SOURCE_POSITION("Modifier.java", 287)
    _r1.i = java_lang_reflect_Modifier_isProtected___int(_r3.i);
    if (_r1.i == 0) goto label27;
    XMLVM_SOURCE_POSITION("Modifier.java", 288)
    // "protected "
    _r1.o = xmlvm_create_java_string_from_pool(651);
    XMLVM_CHECK_NPE(0)
    java_lang_StringBuilder_append___java_lang_String(_r0.o, _r1.o);
    label27:;
    XMLVM_SOURCE_POSITION("Modifier.java", 290)
    _r1.i = java_lang_reflect_Modifier_isPrivate___int(_r3.i);
    if (_r1.i == 0) goto label38;
    XMLVM_SOURCE_POSITION("Modifier.java", 291)
    // "private "
    _r1.o = xmlvm_create_java_string_from_pool(652);
    XMLVM_CHECK_NPE(0)
    java_lang_StringBuilder_append___java_lang_String(_r0.o, _r1.o);
    label38:;
    XMLVM_SOURCE_POSITION("Modifier.java", 293)
    _r1.i = java_lang_reflect_Modifier_isAbstract___int(_r3.i);
    if (_r1.i == 0) goto label49;
    XMLVM_SOURCE_POSITION("Modifier.java", 294)
    // "abstract "
    _r1.o = xmlvm_create_java_string_from_pool(653);
    XMLVM_CHECK_NPE(0)
    java_lang_StringBuilder_append___java_lang_String(_r0.o, _r1.o);
    label49:;
    XMLVM_SOURCE_POSITION("Modifier.java", 296)
    _r1.i = java_lang_reflect_Modifier_isStatic___int(_r3.i);
    if (_r1.i == 0) goto label60;
    XMLVM_SOURCE_POSITION("Modifier.java", 297)
    // "static "
    _r1.o = xmlvm_create_java_string_from_pool(654);
    XMLVM_CHECK_NPE(0)
    java_lang_StringBuilder_append___java_lang_String(_r0.o, _r1.o);
    label60:;
    XMLVM_SOURCE_POSITION("Modifier.java", 299)
    _r1.i = java_lang_reflect_Modifier_isFinal___int(_r3.i);
    if (_r1.i == 0) goto label71;
    XMLVM_SOURCE_POSITION("Modifier.java", 300)
    // "final "
    _r1.o = xmlvm_create_java_string_from_pool(655);
    XMLVM_CHECK_NPE(0)
    java_lang_StringBuilder_append___java_lang_String(_r0.o, _r1.o);
    label71:;
    XMLVM_SOURCE_POSITION("Modifier.java", 302)
    _r1.i = java_lang_reflect_Modifier_isTransient___int(_r3.i);
    if (_r1.i == 0) goto label82;
    XMLVM_SOURCE_POSITION("Modifier.java", 303)
    // "transient "
    _r1.o = xmlvm_create_java_string_from_pool(656);
    XMLVM_CHECK_NPE(0)
    java_lang_StringBuilder_append___java_lang_String(_r0.o, _r1.o);
    label82:;
    XMLVM_SOURCE_POSITION("Modifier.java", 305)
    _r1.i = java_lang_reflect_Modifier_isVolatile___int(_r3.i);
    if (_r1.i == 0) goto label93;
    XMLVM_SOURCE_POSITION("Modifier.java", 306)
    // "volatile "
    _r1.o = xmlvm_create_java_string_from_pool(657);
    XMLVM_CHECK_NPE(0)
    java_lang_StringBuilder_append___java_lang_String(_r0.o, _r1.o);
    label93:;
    XMLVM_SOURCE_POSITION("Modifier.java", 308)
    _r1.i = java_lang_reflect_Modifier_isSynchronized___int(_r3.i);
    if (_r1.i == 0) goto label104;
    XMLVM_SOURCE_POSITION("Modifier.java", 309)
    // "synchronized "
    _r1.o = xmlvm_create_java_string_from_pool(658);
    XMLVM_CHECK_NPE(0)
    java_lang_StringBuilder_append___java_lang_String(_r0.o, _r1.o);
    label104:;
    XMLVM_SOURCE_POSITION("Modifier.java", 311)
    _r1.i = java_lang_reflect_Modifier_isNative___int(_r3.i);
    if (_r1.i == 0) goto label115;
    XMLVM_SOURCE_POSITION("Modifier.java", 312)
    // "native "
    _r1.o = xmlvm_create_java_string_from_pool(659);
    XMLVM_CHECK_NPE(0)
    java_lang_StringBuilder_append___java_lang_String(_r0.o, _r1.o);
    label115:;
    XMLVM_SOURCE_POSITION("Modifier.java", 314)
    _r1.i = java_lang_reflect_Modifier_isStrict___int(_r3.i);
    if (_r1.i == 0) goto label126;
    XMLVM_SOURCE_POSITION("Modifier.java", 315)
    // "strictfp "
    _r1.o = xmlvm_create_java_string_from_pool(660);
    XMLVM_CHECK_NPE(0)
    java_lang_StringBuilder_append___java_lang_String(_r0.o, _r1.o);
    label126:;
    XMLVM_SOURCE_POSITION("Modifier.java", 317)
    _r1.i = java_lang_reflect_Modifier_isInterface___int(_r3.i);
    if (_r1.i == 0) goto label137;
    XMLVM_SOURCE_POSITION("Modifier.java", 318)
    // "interface "
    _r1.o = xmlvm_create_java_string_from_pool(661);
    XMLVM_CHECK_NPE(0)
    java_lang_StringBuilder_append___java_lang_String(_r0.o, _r1.o);
    label137:;
    XMLVM_SOURCE_POSITION("Modifier.java", 320)
    XMLVM_CHECK_NPE(0)
    _r1.i = java_lang_AbstractStringBuilder_length__(_r0.o);
    if (_r1.i != 0) goto label146;
    XMLVM_SOURCE_POSITION("Modifier.java", 321)
    // ""
    _r0.o = xmlvm_create_java_string_from_pool(21);
    label145:;
    XMLVM_SOURCE_POSITION("Modifier.java", 324)
    XMLVM_EXIT_METHOD()
    return _r0.o;
    label146:;
    XMLVM_SOURCE_POSITION("Modifier.java", 323)
    XMLVM_CHECK_NPE(0)
    _r1.i = java_lang_AbstractStringBuilder_length__(_r0.o);
    _r2.i = 1;
    _r1.i = _r1.i - _r2.i;
    XMLVM_CHECK_NPE(0)
    java_lang_AbstractStringBuilder_setLength___int(_r0.o, _r1.i);
    //java_lang_StringBuilder_toString__[5]
    XMLVM_CHECK_NPE(0)
    _r0.o = (*(JAVA_OBJECT (*)(JAVA_OBJECT)) ((java_lang_StringBuilder*) _r0.o)->tib->vtable[5])(_r0.o);
    goto label145;
    //XMLVM_END_WRAPPER
}


text:
using System;
using System.Collections.Generic;
using System.IO;
using MingleTransitionMonitor.Domain;
using MingleTransitionMonitor.Infrastructure;
using NUnit.Framework;
using Rhino.Mocks;
using ThoughtWorksMingleLib;

namespace Tests.Infrastructure
{
    [TestFixture]
    public class MingleTransitionRepositoryTests
    {
        private const string USERNAME = "user";
        private const string PASSWORD = "password";
        private const string MINGLE_EVENT_FEED_URL = "http://mingle/api/v2/projects/project1/feeds/events.xml";
        private const string MINGLE_EVENT_FEED_PAGE2_URL = "http://mingle/api/v2/projects/project1/feeds/events.xml?page=8";

        private MingleTransitionRepository _repository;
        private IWebSession _session;
        private IMingleProjectConnectionInformation _feedConnectionInformation;
        private IMingleEventsFeedFactory _mingleEventsFeedFactor;
        private IMingleCardPropertyChangedBuilder _mingleCardPropertyChangedBuilder;

        [SetUp]
        public void Setup()
        {
            _session = MockRepository.GenerateMock<IWebSession>();
            _mingleEventsFeedFactor = MockRepository.GenerateMock<IMingleEventsFeedFactory>();
            _mingleCardPropertyChangedBuilder = MockRepository.GenerateMock<IMingleCardPropertyChangedBuilder>();

            SetupFeedConnectionStub();

            _repository = new MingleTransitionRepository(_session, _mingleEventsFeedFactor, _mingleCardPropertyChangedBuilder);
        }

        private void SetupFeedConnectionStub()
        {
            _feedConnectionInformation = MockRepository.GenerateStub<IMingleProjectConnectionInformation>();
            _feedConnectionInformation.Stub(p => p.EventFeedUrl).Return(MINGLE_EVENT_FEED_URL);
            _feedConnectionInformation.Stub(p => p.Password).Return(PASSWORD);
            _feedConnectionInformation.Stub(p => p.Username).Return(USERNAME);
        }

        [TearDown]
        public void TearDown()
        {
            _session.VerifyAllExpectations();
            _mingleEventsFeedFactor.VerifyAllExpectations();
        }

        [Test]
        public void LoadsAtomFeedAndReturnsMinglePropertyChangedForEachEntryThatHappendSinceLastId()
        {
            TransitionId since = new TransitionId(DateTime.MinValue, 739064);

            StubRetrievingFirstPageOfXml();
            StubEntries739065And739066();

            var transitions = _repository.GetAllSince(_feedConnectionInformation, since);

            Assert.AreEqual(3, transitions.Count);
        }

        [Test]
        public void ProceedsToNextPageIfLastIdProcessedIsNotOnCurrentPage()
        {
            TransitionId since = new TransitionId(DateTime.MinValue, 739059);

            StubRetrievingFirstPageOfXml();
            StubEntries739065And739066();

            StubRetrievingSecondPageOfXml();
            StubEntries739064And739061();

            var transitions = _repository.GetAllSince(_feedConnectionInformation, since);

            Assert.AreEqual(5, transitions.Count);
        }

        private void StubRetrievingFirstPageOfXml()
        {
            string feedContent = "feed content";

            _session.Stub(s => s.GetContentsFrom(MINGLE_EVENT_FEED_URL, USERNAME, PASSWORD)).Return(feedContent);
            _mingleEventsFeedFactor.Stub(f => f.Create(feedContent)).Return(new MingleEventsFeed(File.ReadAllText("MingleChangeAtomFeed3Entries.xml")));
        }

        private void StubRetrievingSecondPageOfXml()
        {
            string feedContent = "feed content page 2";

            _session.Stub(s => s.GetContentsFrom(MINGLE_EVENT_FEED_PAGE2_URL, USERNAME, PASSWORD)).Return(feedContent);
            _mingleEventsFeedFactor.Stub(f => f.Create(feedContent)).Return(new MingleEventsFeed(File.ReadAllText("MingleChangeAtomFeed3Page2Entries.xml")));
        }

        private void StubEntries739065And739066()
        {
            var mingleCardPropertyChangesForEntry739065 = new List<MingleCardPropertyChanged>()
            {
                new MingleCardPropertyChanged(739065,int.MinValue,null,DateTime.MinValue,null,null,null,null,null,null,null,null),
                new MingleCardPropertyChanged(739065,int.MinValue,null,DateTime.MinValue,null,null,null,null,null,null,null,null)
            };
            var mingleCardPropertyChangesForEntry739066 = new List<MingleCardPropertyChanged>()
            {
                new MingleCardPropertyChanged(739066,int.MinValue,null,DateTime.MinValue,null,null,null,null,null,null,null,null),
            };

            _mingleCardPropertyChangedBuilder.Stub(b => b.BuildFrom(Arg<MingleEventsFeedEntry>.Matches(e => e.Id == 739066))).Return(mingleCardPropertyChangesForEntry739066);
            _mingleCardPropertyChangedBuilder.Stub(b => b.BuildFrom(Arg<MingleEventsFeedEntry>.Matches(e => e.Id == 739065))).Return(mingleCardPropertyChangesForEntry739065);
        }

        private void StubEntries739064And739061()
        {
            var propertyChanges739061 = new List<MingleCardPropertyChanged>()
            {
                new MingleCardPropertyChanged(739061,int.MinValue,null,DateTime.MinValue,null,null,null,null,null,null,null,null),
            };

            var propertyChanges739064 = new List<MingleCardPropertyChanged>()
            {
                new MingleCardPropertyChanged(739064,int.MinValue,null,DateTime.MinValue,null,null,null,null,null,null,null,null),
            };

            _mingleCardPropertyChangedBuilder.Stub(b => b.BuildFrom(Arg<MingleEventsFeedEntry>.Matches(e => e.Id == 739061))).Return(propertyChanges739061);
            _mingleCardPropertyChangedBuilder.Stub(b => b.BuildFrom(Arg<MingleEventsFeedEntry>.Matches(e => e.Id == 739064))).Return(propertyChanges739064);

        }
    }
}


text:
package org.hawkular.apm.instrumenter.rules;

import org.hawkular.apm.api.model.config.instrumentation.jvm.InstrumentAction;
import org.hawkular.apm.api.model.config.instrumentation.jvm.Suppress;

/**
 * This class transforms the Suppress action type.
 *
 * @author gbrown
 */
public class SuppressTransformer implements InstrumentActionTransformer {

    @Override
    public Class<? extends InstrumentAction> getActionType() {
        return Suppress.class;
    }

    @Override
    public String convertToRuleAction(InstrumentAction action) {
        return "suppress()";
    }

}


text:
module PactasItero
  module Api
    module Customers
      def customers(options = {})
        options = options.camelize_keys
        get "api/v1/customers", options
      end

      def update_customer(customer_id, options = {})
        options = options.camelize_keys
        patch "api/v1/customers/#{customer_id}", options
      end

      def customer(customer_id, options = {})
        options = options.camelize_keys
        get "api/v1/customers/#{customer_id}", options
      end
    end
  end
end


text:
package net.cassite.style.aggregation;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;

import net.cassite.style.Entry;
import net.cassite.style.interfaces.VFunc1;
import net.cassite.style.ptr;

import static net.cassite.style.Style.*;
import static net.cassite.style.aggregation.Aggregation.*;

public class JoinedList<E> implements List<E> {
        private List<List<E>> lists;

        @SafeVarargs
        public JoinedList(List<E>... toJoin) {
                lists = new ArrayList<>(toJoin.length);
                $(toJoin).forEach((VFunc1<List<E>>) lists::add);
        }

        @Override
        public int size() {
                return $(lists).forEach((list, i) -> avoidNull(i.lastRes, 0) + list.size());
        }

        @Override
        public boolean isEmpty() {
                return lists.isEmpty() ? true : $(lists).forEach(list -> {
                        if (!list.isEmpty())
                                BreakWithResult(false);
                        return true;
                });
        }

        @Override
        public boolean contains(Object o) {
                return lists.isEmpty() ? false : $(lists).forEach(list -> {
                        if (list.contains(o))
                                BreakWithResult(true);
                        return false;
                });
        }

        @Override
        public Iterator<E> iterator() {
                return listIterator(0);
        }

        @Override
        public Object[] toArray() {
                Object[] arr = new Object[size()];
                $(this).forEach((e, i) -> {
                        arr[$(i)] = e;
                });
                return arr;
        }

        @SuppressWarnings("unchecked")
        @Override
        public <T> T[] toArray(T[] arr) {
                $(lists).forEach((list, i) -> {
                        int res = $(list).forEach((e, j) -> {
                                int index = (int) avoidNull(i.lastRes, 0) + avoidNull(j.lastRes, 0);
                                if (index >= arr.length)
                                        BreakWithResult(-1);
                                arr[index] = (T) e;
                                return (int) avoidNull(i.lastRes, 0) + 1;
                        });
                        return res == -1 ? Break() : res;
                });
                $(this).forEach((e, i) -> {
                        if ($(i) >= arr.length)
                                Break();
                        arr[$(i)] = (T) e;
                });
                return arr;
        }

        @Override
        public boolean add(E e) {
                throw new UnsupportedOperationException();
        }

        @Override
        public boolean remove(Object o) {
                throw new UnsupportedOperationException();
        }

        @Override
        public boolean containsAll(Collection<?> c) {
                return lists.isEmpty() ? false : $(c).forEach(e -> {
                        if (!contains(e))
                                BreakWithResult(false);
                        return true;
                });
        }

        @Override
        public boolean addAll(Collection<? extends E> c) {
                throw new UnsupportedOperationException();
        }

        @Override
        public boolean addAll(int index, Collection<? extends E> c) {
                throw new UnsupportedOperationException();
        }

        @Override
        public boolean removeAll(Collection<?> c) {
                throw new UnsupportedOperationException();
        }

        @Override
        public boolean retainAll(Collection<?> c) {
                throw new UnsupportedOperationException();
        }

        @Override
        public void clear() {
                throw new UnsupportedOperationException();
        }

        private Entry<List<E>, Integer> getListAndPos(int index) {
                int baseIndex = 0;
                int current = 0;
                while (index - baseIndex >= lists.get(current).size()) {
                        baseIndex += lists.get(current).size();
                        ++current;
                }
                return new Entry<>(lists.get(current), index - baseIndex);
        }

        @Override
        public E get(int index) {
                Entry<List<E>, Integer> entry = getListAndPos(index);
                return entry.key.get(entry.value);
        }

        @Override
        public E set(int index, E element) {
                Entry<List<E>, Integer> entry = getListAndPos(index);
                return entry.key.set(entry.value, element);
        }

        @Override
        public void add(int index, E element) {
                throw new UnsupportedOperationException();
        }

        @Override
        public E remove(int index) {
                throw new UnsupportedOperationException();
        }

        @Override
        public int indexOf(Object o) {
                ptr<Integer> count = ptr(0);
                return lists.size() == 0 ? -1 : $(lists).forEach((list, i) -> {
                        int indexJ = list.size() == 0 ? -1 : $(list).forEach((e, j) -> e.equals(o) ? BreakWithResult($(j)) : -1);
                        try {
                                return indexJ == -1 ? -1 : BreakWithResult(indexJ + $(count));
                        } finally {
                                $(count, $(count) + list.size());
                        }
                });
        }

        @Override
        public int lastIndexOf(Object o) {
                return lists.size() == 0 ? -1 : For(lists.size() - 1).to(0).step(-1).loop(i -> {
                        int index = avoidNull(For(lists.get(i).size() - 1).to(0).step(-1).loop(j -> lists.get(i).get(j).equals(o) ? BreakWithResult(j) : -1), -1);
                        return index == -1 ? -1
                                : BreakWithResult(index + avoidNull(
                                For(0).to(i - 1).step(1).loop((k, info) -> avoidNull(info.lastRes, 0) + lists.get(k).size()),
                                0));
                });
        }

        @Override
        public ListIterator<E> listIterator() {
                return listIterator(0);
        }

        @Override
        public ListIterator<E> listIterator(int index) {
                return new JoinedListIterator(index);
        }

        @Override
        public List<E> subList(int fromIndex, int toIndex) {
                if (fromIndex > toIndex)
                        throw new IllegalArgumentException();
                List<E> toReturn = new ArrayList<>();
                For(fromIndex).to(toIndex).step(1).loop(i -> {
                        Entry<List<E>, Integer> listAndPos = getListAndPos(i);
                        toReturn.add(listAndPos.key.get(listAndPos.value));
                });
                return toReturn;
        }

        public String toString() {
                StringBuilder sb = new StringBuilder();
                sb.append("[");
                boolean isFirst = true;
                for (E e : this) {
                        if (isFirst) {
                                sb.append(e);
                                isFirst = false;
                        } else {
                                sb.append(", ").append(e);
                        }
                }

                sb.append("]");
                return sb.toString();
        }

        private class JoinedListIterator implements ListIterator<E> {
                private int cursor;
                private int size = size();

                public JoinedListIterator(int index) {
                        this.cursor = index - 1;
                }

                @Override
                public boolean hasNext() {
                        return cursor < size - 1;
                }

                @Override
                public E next() {
                        return get(++cursor);
                }

                @Override
                public boolean hasPrevious() {
                        return cursor >= 0;
                }

                @Override
                public E previous() {
                        return cursor == 0 ? null : get(--cursor);
                }

                @Override
                public int nextIndex() {
                        return cursor + 1;
                }

                @Override
                public int previousIndex() {
                        return cursor - 1;
                }

                @Override
                public void remove() {
                        throw new UnsupportedOperationException();
                }

                @Override
                public void set(E e) {
                        if (cursor >= 0 && cursor < size)
                                JoinedList.this.set(cursor, e);
                }

                @Override
                public void add(E e) {
                        throw new UnsupportedOperationException();
                }

        }

}


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

<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
           id="com.scigit.plugins.downloader"
      version="0.2.2">
    <name>Downloader</name>
    <description>Downloader Plugin</description>
    <license>Apache 2.0</license>
    <keywords>download,downloader</keywords>

    <js-module src="www/downloader.js" name="Downloader">
        <clobbers target="downloader" />
    </js-module>

    <!-- android -->
    <platform name="android">
        <config-file target="res/xml/config.xml" parent="/*">
            <feature name="Downloader">
                <param name="android-package" value="com.scigit.plugins.Downloader" />
            </feature>
        </config-file>

        <source-file src="src/android/Downloader.java" target-dir="src/com/scigit/plugins" />
    </platform>
</plugin>


text:
Handy Stylesheets/Javascripts/Templates/Helpers accumulated throughout different Rails projects.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'karma', github: 'pinglamb/karma'
```

And then execute:

    $ bundle install

To copy over the scaffold template files, execute:

    $ bundle exec rails g karma:install

## Usage

You can bootstrap the application using this gem by using the template.rb in this project:

    $ rails new depot -m https://raw.githubusercontent.com/pinglamb/karma/master/template.rb

## Development

Checkout this project and just mess around.

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/pinglamb/karma. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.

## License

MIT


text:
using System;
using System.Runtime.ExceptionServices;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Interop;
using System.Windows.Shell;

namespace YUI.WPF.YUtil
{
    /// <summary>
    /// 窗口辅助类
    /// </summary>
    public static class YWindowHelper
    {
        private const int WS_EX_TRANSPARENT = 0x20;

        /// <summary>
        /// 带有外边框和标题的windows的样式
        /// </summary>
        private const int WS_CAPTION = 0X00C0000;

        // public const long WS_BORDER = 0X0080000L;

        /// <summary>
        /// 带有alpha的样式
        /// </summary>
        private const int LWA_ALPHA = 0x00000002;

        /// <summary>
        /// window的基本样式
        /// </summary>
        private const int GWL_STYLE = -16;

        /// <summary>
        /// 工具窗口
        /// </summary>
        private const int WS_EX_TOOLWINDOW = 0x80;

        /// <summary>
        /// window的扩展样式
        /// </summary>
        private const int GWL_EXSTYLE = -20;

        [DllImport("user32", EntryPoint = "SetWindowLong", SetLastError = true)]
        [HandleProcessCorruptedStateExceptions]
        private static extern int SetWindowLong(IntPtr hwnd, int nIndex, int dwNewLong);

        [DllImport("user32", EntryPoint = "GetWindowLong", SetLastError = true)]
        [HandleProcessCorruptedStateExceptions]
        private static extern int GetWindowLong(IntPtr hwnd, int nIndex);

        /// <summary>
        /// 窗口从最小化恢复
        /// </summary>
        private const int SW_RESTORE = 9;

        [DllImport("user32.dll", SetLastError = true)]
        [HandleProcessCorruptedStateExceptions]
        private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);

        /// <summary>
        /// Sets the layered window attributes.
        /// </summary>
        /// <param name="handle">要进行操作的窗口句柄</param>
        /// <param name="colorKey">RGB的值</param>
        /// <param name="alpha">Alpha的值,透明度</param>
        /// <param name="flags">附带参数</param>
        /// <returns>true or false</returns>
        [DllImport("User32.dll", SetLastError = true)]
        [HandleProcessCorruptedStateExceptions]
        public static extern bool SetLayeredWindowAttributes(IntPtr handle, int colorKey, byte alpha, int flags);

        /// <summary>
        /// 设置窗口边框用于拖拽改变大小
        /// </summary>
        /// <param name="window"></param>
        /// <param name="wc"></param>
        public static void SetWindowChrome(this Window window, WindowChrome wc = null)
        {
            if (window == null) return;

            if (wc == null)
            {
                switch (window.ResizeMode)
                {
                    case ResizeMode.NoResize:
                    case ResizeMode.CanResizeWithGrip:
                    case ResizeMode.CanMinimize:
                        wc = new WindowChrome
                        {
                            CaptionHeight = 0,
                            GlassFrameThickness = new Thickness(0),
                            CornerRadius = new CornerRadius(0),
                            UseAeroCaptionButtons = true,
                            ResizeBorderThickness = new Thickness(0)
                        };
                        break;
                    case ResizeMode.CanResize:
                        wc = new WindowChrome
                        {
                            CaptionHeight = 0,
                            GlassFrameThickness = new Thickness(7),
                            CornerRadius = new CornerRadius(0),
                            UseAeroCaptionButtons = true,
                            ResizeBorderThickness = new Thickness(6)
                        };
                        break;
                }
            }

            WindowChrome.SetWindowChrome(window, wc);
        }

        /// <summary>
        /// 窗口穿透
        /// </summary>
        /// <param name="window"></param>
        /// <param name="canPenetrate"></param>
        public static void SetWindowCanPenetrate(this Window window, bool canPenetrate)
        {
            if (window == null) return;

            var hwnd = new WindowInteropHelper(window).Handle;
            var extendedStyle = GetWindowLong(hwnd, GWL_EXSTYLE);

            if (canPenetrate)
                SetWindowLong(hwnd, GWL_EXSTYLE, extendedStyle | WS_EX_TRANSPARENT);
            else
                SetWindowLong(hwnd, GWL_EXSTYLE, extendedStyle & (~WS_EX_TRANSPARENT));
        }

        /// <summary>
        /// 设置窗口无边框
        /// </summary>
        /// <param name="window"></param>
        /// <param name="isNoBorder"></param>
        public static void SetWindowNoBorder(this Window window, bool isNoBorder)
        {
            if (window == null) return;

            // 获取窗体句柄
            var hwnd = new WindowInteropHelper(window).Handle;

            // 获得窗体的 样式
            var oldstyle = GetWindowLong(hwnd, GWL_STYLE);

            // 创建圆角窗体  12 这个值可以根据自身项目进行设置
            //NativeMethods.SetWindowRgn(hwnd, NativeMethods.CreateRoundRectRgn(0, 0, Convert.ToInt32(this.ActualWidth), Convert.ToInt32(this.ActualHeight), 12, 12), true);

            if (isNoBorder)
                SetWindowLong(hwnd, GWL_STYLE, oldstyle & ~WS_CAPTION);
            else
                SetWindowLong(hwnd, GWL_STYLE, oldstyle | WS_CAPTION);
        }

        /// <summary>
        /// 设置窗口背景透明
        /// </summary>
        /// <param name="window"></param>
        public static void SetWindowTransparent(this Window window)
        {
            if (window == null) return;

            // 获取窗体句柄
            var hwnd = new WindowInteropHelper(window).Handle;

            // 创建圆角窗体  12 这个值可以根据自身项目进行设置
            //NativeMethods.SetWindowRgn(hwnd, NativeMethods.CreateRoundRectRgn(0, 0, Convert.ToInt32(this.ActualWidth), Convert.ToInt32(this.ActualHeight), 12, 12), true);

            SetLayeredWindowAttributes(hwnd, 1 | 2 << 8 | 3 << 16, 0, LWA_ALPHA);
        }

        /// <summary>
        /// 设置窗口为工具窗口
        /// </summary>
        /// <param name="window"></param>
        public static void SetWindowToolWindow(this Window window)
        {
            if (window == null) return;

            var hWnd = new WindowInteropHelper(window).Handle;

            var extendedStyle = GetWindowLong(hWnd, GWL_EXSTYLE);

            SetWindowLong(hWnd, GWL_EXSTYLE, extendedStyle | WS_EX_TOOLWINDOW);
        }

        /// <summary>
        /// 设置窗口从最小化恢复
        /// </summary>
        /// <param name="window"></param>
        public static void SetWindowRestore(this Window window)
        {
            if (window == null || window.WindowState != WindowState.Minimized) return;

            ShowWindow(new WindowInteropHelper(window).Handle, SW_RESTORE);
        }
    }
}


text:
"""Pull data from an Elasticluster cluster to generate graphs from."""
from __future__ import print_function

import contextlib
import os
import re
import subprocess

import elasticluster
import paramiko

from bcbiovm.aws.common import ecluster_config
from bcbiovm.aws import icel
from bcbio.graph import graph as bcbio_graph

@contextlib.contextmanager
def ssh_agent(private_key_paths=[]):
    output = subprocess.check_output(['ssh-agent', '-s'])
    for line in output.split('\n'):
        matches = re.search(r'^([A-Z0-9_]+)=(.+?);.*', line)
        if matches:
            os.environ[matches.group(1)] = matches.group(2)

    with open('/dev/null', 'w') as dev_null:
        for key_path in private_key_paths:
            subprocess.check_call(
                ['ssh-add', key_path], stdout=dev_null, stderr=dev_null)

    yield

    with open('/dev/null', 'w') as dev_null:
        subprocess.call(['ssh-agent', '-k'], stdout=dev_null)

def _pull_collectl_data(host, username, datadir, bcbio_log, ssh_client,
                        bastion_host=None, verbose=False):
    if verbose:
        print('Connecting to {}{}...'.format(
            host, ' via {}'.format(bastion_host) if bastion_host else ''))

    proxy_command = None
    if bastion_host:
        proxy_command = paramiko.ProxyCommand(
            'ssh -o VisualHostKey=no -W {}:22 ec2-user@{}'.format(
                host, bastion_host))
    ssh_client.connect(host, username=username, allow_agent=True,
        sock=proxy_command)

    command = 'stat -c "%s %Y %n" /var/log/collectl/*.raw.gz'
    if verbose:
        print('Running "{}"...'.format(command))
    stdin, stdout, stderr = ssh_client.exec_command(command)
    raws = stdout.read().strip()
    if not raws:
        return

    # Only load filenames withing sampling timerage
    time_frame = bcbio_graph.log_time_frame(bcbio_log)

    for raw in raws.split('\n'):
        if bcbio_graph.rawfile_within_timeframe(raw, time_frame):
            size, mtime, remote_raw = raw.split()
            mtime = int(mtime)
            size = int(size)

            raw_basename = os.path.basename(remote_raw)
            local_raw = os.path.join(datadir, raw_basename)
            if (os.path.exists(local_raw) and
                int(os.path.getmtime(local_raw)) == mtime and
                os.path.getsize(local_raw) == size):
                # Remote file hasn't changed, don't re-fetch it.
                continue

            command = 'cat {}'.format(remote_raw)
            # Only transfer the remote raw locally if it falls within our
            # sampling timeframe.

            if verbose:
                print('Running "{}" on {}...'.format(command, host))
            stdin, stdout, stderr = ssh_client.exec_command(command)
            with open(local_raw, 'wb') as fp:
                fp.write(stdout.read())
            os.utime(local_raw, (mtime, mtime))

    ssh_client.close()

def _mgt_addr_for_scratch_on(cluster, ssh):
    node = cluster.get_all_nodes()[0]
    if not node.preferred_ip:
        return None

    ssh.connect(node.preferred_ip, username=node.image_user, allow_agent=True)
    stdin, stdout, stderr = ssh.exec_command('df -t lustre /scratch')

    df_scratch = stdout.read().strip()
    if not df_scratch:
        return None

    return df_scratch.split('\n')[1].split()[0].split(':')[0]

def _fetch_collectl_lustre(cluster, ssh, datadir, aws_config, verbose):
    mgt_addr = _mgt_addr_for_scratch_on(cluster, ssh)
    if not mgt_addr:
        return

    stack_name = icel.get_stack_name(mgt_addr, aws_config)
    if not stack_name:
        raise Exception('Unable to determine stack name '
            'for ICEL MGT %s'.format(mgt_addr))

    icel_hosts = icel.get_instances(stack_name, aws_config)
    for name, addr in icel_hosts.items():
        if name == 'NATDevice':
            continue
        _pull_collectl_data(
            addr, 'ec2-user', datadir, bcbio_log, ssh,
            bastion_host=icel_hosts['NATDevice'], verbose=verbose)

def fetch_collectl(econfig_file, cluster_name, bcbio_log, datadir, verbose=False):
    # local cluster, bypassing elasticluster
    if "local" in cluster_name:
	import getpass
        with ssh_agent():
            ssh = paramiko.client.SSHClient()
            ssh.set_missing_host_key_policy(paramiko.client.AutoAddPolicy())

	    for host in bcbio_graph.get_bcbio_nodes(bcbio_log):
		_pull_collectl_data(host, getpass.getuser(), datadir,
                                    bcbio_log, ssh, verbose=verbose)

    # elasticluster
    else:
	config = ecluster_config(econfig_file)
	cluster = config.load_cluster(cluster_name)

	keys = set()
	for type in cluster.nodes:
	    for node in cluster.nodes[type]:
		keys.add(node.user_key_private)

	with ssh_agent(keys):
	    ssh = paramiko.client.SSHClient()
	    ssh.set_missing_host_key_policy(paramiko.client.RejectPolicy())
	    ssh.load_host_keys(cluster.known_hosts_file)

	    for node in cluster.get_all_nodes():
		if not node.preferred_ip:
		    # Instance is unavailable.
		    continue
		_pull_collectl_data(
		    node.preferred_ip, node.image_user, datadir,
                    bcbio_log, ssh, verbose=verbose)

	    # FIXME: load SSH host keys from ICEL instances.
	    ssh.set_missing_host_key_policy(paramiko.client.AutoAddPolicy())
	    aws_config = config.cluster_conf[cluster_name]['cloud']
	    _fetch_collectl_lustre(cluster, ssh, datadir, aws_config, verbose)