text:
/* This example is for experimenting with ellipsoid contact which was
introduced in Simbody 2.2.
*/

#include "Simbody.h"

#include <cstdio>
#include <exception>
#include <algorithm>
#include <iostream>
#include <fstream>
using std::cout; using std::endl;

using namespace SimTK;

Array_<State> saveEm;

const Real Cm2m     = 1e-2;
const Real CmSq2mSq = Cm2m*Cm2m; // conversion from sq cm to sq m
const Real Deg2Rad  = (Real)SimTK_DEGREE_TO_RADIAN;
const Real Rad2Deg  = (Real)SimTK_RADIAN_TO_DEGREE;

static const Real TimeScale = 1;
static const Real FrameRate = 30;
static const Real ReportInterval = TimeScale/FrameRate;
static const Real ForceScale = .25;
static const Real MomentScale = .5;

class ForceArrowGenerator : public DecorationGenerator {
public:
    ForceArrowGenerator(const MultibodySystem& system,
                        const CompliantContactSubsystem& complCont)
    :   m_system(system), m_compliant(complCont) {}

    virtual void generateDecorations(const State& state, Array_<DecorativeGeometry>& geometry) override {
        const Vec3 frcColors[] = {Red,Orange,Cyan};
        const Vec3 momColors[] = {Blue,Green,Purple};
        m_system.realize(state, Stage::Velocity);

        const int ncont = m_compliant.getNumContactForces(state);
        for (int i=0; i < ncont; ++i) {
            const ContactForce& force = m_compliant.getContactForce(state,i);
            const ContactId     id    = force.getContactId();
            const Vec3& frc = force.getForceOnSurface2()[1];
            const Vec3& mom = force.getForceOnSurface2()[0];
            Real  frcMag = frc.norm(), momMag=mom.norm();
            int frcThickness = 1, momThickness = 1;
            Real frcScale = ForceScale, momScale = ForceScale;
            while (frcMag > 10)
                frcThickness++, frcScale /= 10, frcMag /= 10;
            while (momMag > 10)
                momThickness++, momScale /= 10, momMag /= 10;
            DecorativeLine frcLine(force.getContactPoint(),
                force.getContactPoint() + frcScale*frc);
            DecorativeLine momLine(force.getContactPoint(),
                force.getContactPoint() + momScale*mom);
            frcLine.setColor(frcColors[id%3]);
            momLine.setColor(momColors[id%3]);
            frcLine.setLineThickness(2*frcThickness);
            momLine.setLineThickness(2*momThickness);
            geometry.push_back(frcLine);
            geometry.push_back(momLine);

            ContactPatch patch;
            const bool found = m_compliant.calcContactPatchDetailsById(state,id,patch);
            //cout << "patch for id" << id << " found=" << found << endl;
            //cout << "resultant=" << patch.getContactForce() << endl;
            //cout << "num details=" << patch.getNumDetails() << endl;
            for (int i=0; i < patch.getNumDetails(); ++i) {
                const ContactDetail& detail = patch.getContactDetail(i);
                const Real peakPressure = detail.getPeakPressure();
                // Make a black line from the element's contact point in the normal
                // direction, with length proportional to log(peak pressure)
                // on that element.
                DecorativeLine normal(detail.getContactPoint(),
                    detail.getContactPoint()+ std::log10(peakPressure)
                                                * detail.getContactNormal());
                normal.setColor(Black);
                geometry.push_back(normal);
                // Make a red line that extends from the contact
                // point in the direction of the slip velocity, of length 3*slipvel.
                DecorativeLine slip(detail.getContactPoint(),
                    detail.getContactPoint()+3*detail.getSlipVelocity());
                slip.setColor(Red);
                geometry.push_back(slip);
            }
        }
    }
private:
    const MultibodySystem&              m_system;
    const CompliantContactSubsystem&    m_compliant;
};

class MyReporter : public PeriodicEventReporter {
public:
    MyReporter(const MultibodySystem& system,
               const CompliantContactSubsystem& complCont,
               Real reportInterval)
    :   PeriodicEventReporter(reportInterval), m_system(system),
        m_compliant(complCont)
    {}

    ~MyReporter() {}

    void handleEvent(const State& state) const override {
        m_system.realize(state, Stage::Dynamics);
        cout << state.getTime() << ": E = " << m_system.calcEnergy(state)
             << " Ediss=" << m_compliant.getDissipatedEnergy(state)
             << " E+Ediss=" << m_system.calcEnergy(state)
                               +m_compliant.getDissipatedEnergy(state)
             << endl;
        cout << " q0(Deg): " << state.getQ()[0]*Rad2Deg << endl;
        const int ncont = m_compliant.getNumContactForces(state);
        cout << "Num contacts: " << m_compliant.getNumContactForces(state) << endl;
        for (int i=0; i < ncont; ++i) {
            const ContactForce& force = m_compliant.getContactForce(state,i);
            //cout << force;
        }
        saveEm.push_back(state);
    }
private:
    const MultibodySystem&           m_system;
    const CompliantContactSubsystem& m_compliant;
};

// These are the item numbers for the entries on the Run menu.
static const int RunMenuId = 3, HelpMenuId = 7;
static const int GoItem = 1, ReplayItem=2, QuitItem=3;

// This is a periodic event handler that interrupts the simulation on a regular
// basis to poll the InputSilo for user input. If there has been some, process it.
// This one does nothing but look for the Run->Quit selection.
class UserInputHandler : public PeriodicEventHandler {
public:
    UserInputHandler(Visualizer::InputSilo& silo, Real interval)
    :   PeriodicEventHandler(interval), m_silo(silo) {}

    virtual void handleEvent(State& state, Real accuracy,
                             bool& shouldTerminate) const override
    {
        int menuId, item;
        if (m_silo.takeMenuPick(menuId, item) && menuId==RunMenuId && item==QuitItem)
            shouldTerminate = true;
    }

private:
    Visualizer::InputSilo& m_silo;
};

int main() {
  try
  { // Create the system.

    MultibodySystem         system;
    SimbodyMatterSubsystem  matter(system);
    GeneralForceSubsystem   forces(system);
    Force::Gravity   gravity(forces, matter, UnitVec3(-1,0,0), 9.81);

    ContactTrackerSubsystem  tracker(system);
    CompliantContactSubsystem contactForces(system, tracker);
    contactForces.setTrackDissipatedEnergy(true);
    contactForces.setTransitionVelocity(1e-2); // m/s

    // Ground's normal is +x for this model
    system.setUpDirection(+XAxis);

    // Uncomment this if you want a more elegant movie.
    //matter.setShowDefaultGeometry(false);

    const Real ud = .3; // dynamic
    const Real us = .6; // static
    const Real uv = 0;  // viscous (force/velocity)
    const Real k = 1e8; // pascals
    const Real c = 0.01; // dissipation (1/v)

    // Halfspace default is +x, this one occupies -x instead, so flip.
    const Rotation R_xdown(Pi,ZAxis);

    matter.Ground().updBody().addContactSurface(
        Transform(R_xdown, Vec3(0,0,0)),
        ContactSurface(ContactGeometry::HalfSpace(),
                       ContactMaterial(k,c,us,ud,uv)));

    const Real ellipsoidMass = 1; // kg
    const Vec3 halfDims(2*Cm2m, 20*Cm2m, 3*Cm2m); // m (read in cm)
    const Vec3 comLoc(-1*Cm2m, 0, 0);
    const Inertia centralInertia(Vec3(17,2,16)*CmSq2mSq, Vec3(0,0,.2)*CmSq2mSq); // now kg-m^2
    const Inertia inertia(centralInertia.shiftFromMassCenter(-comLoc, ellipsoidMass)); // in S
    Body::Rigid ellipsoidBody(MassProperties(ellipsoidMass, comLoc, inertia));

    ellipsoidBody.addDecoration(Transform(),
        DecorativeEllipsoid(halfDims).setColor(Cyan)
         //.setOpacity(.5)
         .setResolution(3));
    ellipsoidBody.addContactSurface(Transform(),
        ContactSurface(ContactGeometry::Ellipsoid(halfDims),
                       ContactMaterial(k,c,us,ud,uv))
                       );
    MobilizedBody::Free ellipsoid(matter.Ground(), Transform(Vec3(0,0,0)),
        ellipsoidBody, Transform(Vec3(0)));

    Visualizer viz(system);
    viz.addDecorationGenerator(new ForceArrowGenerator(system,contactForces));
    viz.setMode(Visualizer::RealTime);
    viz.setDesiredFrameRate(FrameRate);
    viz.setCameraClippingPlanes(0.1, 10);

    Visualizer::InputSilo* silo = new Visualizer::InputSilo();
    viz.addInputListener(silo);
    Array_<std::pair<String,int> > runMenuItems;
    runMenuItems.push_back(std::make_pair("Go", GoItem));
    runMenuItems.push_back(std::make_pair("Replay", ReplayItem));
    runMenuItems.push_back(std::make_pair("Quit", QuitItem));
    viz.addMenu("Run", RunMenuId, runMenuItems);

    Array_<std::pair<String,int> > helpMenuItems;
    helpMenuItems.push_back(std::make_pair("TBD - Sorry!", 1));
    viz.addMenu("Help", HelpMenuId, helpMenuItems);

    system.addEventReporter(new MyReporter(system,contactForces,ReportInterval));
    system.addEventReporter(new Visualizer::Reporter(viz, ReportInterval));

    // Check for a Run->Quit menu pick every 1/4 second.
    system.addEventHandler(new UserInputHandler(*silo, .25));

    // Initialize the system and state.

    system.realizeTopology();
    State state = system.getDefaultState();
    matter.setUseEulerAngles(state, true);
    system.realizeModel(state);

    ellipsoid.setQToFitTransform(state, Transform(
        Rotation(BodyRotationSequence,  0  *Deg2Rad, XAxis,
                                        0.5*Deg2Rad, YAxis,
                                       -0.5*Deg2Rad, ZAxis),
        Vec3(2.1*Cm2m, 0, 0)));

    ellipsoid.setUToFitAngularVelocity(state, 2*Vec3(5,0,0)); // rad/s

    viz.report(state);
    printf("Default state\n");

    cout << "\nChoose 'Go' from Run menu to simulate:\n";
    int menuId, item;
    do { silo->waitForMenuPick(menuId, item);
         if (menuId != RunMenuId || item != GoItem)
             cout << "\aDude ... follow instructions!\n";
    } while (menuId != RunMenuId || item != GoItem);

    // Simulate it.

    //ExplicitEulerIntegrator integ(system);
    //CPodesIntegrator integ(system,CPodes::BDF,CPodes::Newton);
    //RungeKuttaFeldbergIntegrator integ(system);
    RungeKuttaMersonIntegrator integ(system);
    //RungeKutta3Integrator integ(system);
    //VerletIntegrator integ(system);
    //integ.setMaximumStepSize(1e-0001);
    integ.setAccuracy(1e-4); // minimum for CPodes
    //integ.setAccuracy(.01);
    TimeStepper ts(system, integ);

    ts.initialize(state);
    double cpuStart = cpuTime();
    double realStart = realTime();

    ts.stepTo(10.0);

    const double timeInSec = realTime() - realStart;
    const int evals = integ.getNumRealizations();
    cout << "Done -- took " << integ.getNumStepsTaken() << " steps in " <<
        timeInSec << "s elapsed for " << ts.getTime() << "s sim (avg step="
        << (1000*ts.getTime())/integ.getNumStepsTaken() << "ms) "
        << (1000*ts.getTime())/evals << "ms/eval\n";
    cout << "  CPU time was " << cpuTime() - cpuStart << "s\n";

    printf("Using Integrator %s at accuracy %g:\n",
        integ.getMethodName(), integ.getAccuracyInUse());
    printf("# STEPS/ATTEMPTS = %d/%d\n", integ.getNumStepsTaken(), integ.getNumStepsAttempted());
    printf("# ERR TEST FAILS = %d\n", integ.getNumErrorTestFailures());
    printf("# REALIZE/PROJECT = %d/%d\n", integ.getNumRealizations(), integ.getNumProjections());

    viz.dumpStats(std::cout);

    // Add as slider to control playback speed.
    viz.addSlider("Speed", 1, 0, 4, 1);
    viz.setMode(Visualizer::PassThrough);

    silo->clear(); // forget earlier input
    double speed = 1; // will change if slider moves
    while(true) {
        cout << "Choose Run/Replay to see that again ...\n";

        int menuId, item;
        silo->waitForMenuPick(menuId, item);

        if (menuId != RunMenuId) {
            cout << "\aUse the Run menu!\n";
            continue;
        }

        if (item == QuitItem)
            break;
        if (item != ReplayItem) {
            cout << "\aHuh? Try again.\n";
            continue;
        }

        for (double i=0; i < (int)saveEm.size(); i += speed ) {
            int slider; Real newValue;
            if (silo->takeSliderMove(slider,newValue)) {
                speed = newValue;
            }
            viz.report(saveEm[(int)i]);
        }
    }

  } catch (const std::exception& e) {
    std::printf("EXCEPTION THROWN: %s\n", e.what());
    exit(1);

  } catch (...) {
    std::printf("UNKNOWN EXCEPTION THROWN\n");
    exit(1);
  }

    return 0;
}


text:
local dim = 2
local args = {
	app = self,
	eqn = 'euler',
	flux = 'roe',
	dim = 2,
	integrator = 'forward Euler',
	cfl = .3/dim,
	fluxLimiter = 'superbee',

	coord = 'cartesian',
	coordArgs = {vectorComponent='anholonomic'},
	mins = {-1, -1, -1},
	maxs = {1, 1, 1},

	gridSize = cmdline.gridSize,

	boundary = {
		xmin = 'periodic',
		xmax = 'periodic',
		ymin = 'periodic',
		ymax = 'periodic',
		zmin = 'periodic',
		zmax = 'periodic',
	},
	initCond = 'shock bubble interaction',
}

self.solvers:insert(require 'hydro.solver.fvsolver'(args))

redpajama_set_name: RedPajamaGithub


text:
from django.shortcuts import render
from django.http import Http404

from inventory.models import Item
from django.http import HttpResponse

# Create your views here.

def index(request):
	#return HttpResponse('<p> In index view </p>')
	items = Item.objects.exclude(amount=0)
	return render(request, 'inventory/index.html', {
			'items':items,
		})

def item_detail(request, id):
	try:
		item = Item.objects.get(id=id)
	except Item.DoesNotExist:
		raise Http404('This Item does not exist')
	return render(request, 'inventory/item_detail.html', {
			'item': item,
		})
	#return HttpResponse('<p> In index_detail view with id {0} </p>'.format(id))


text:
package org.jboss.shrinkwrap.descriptor.metadata.filter;

/**
 * Enum class which defines all XSD w3c elements.
 *
 * @author Ralf Battenfeld
 */
public enum XsdElementEnum {

    all              ("Specifies that the child elements can appear in any order. Each child element can occur 0 or 1 time"),
    annotation       ("Specifies the top-level element for schema comments"),
    any              ("Enables the author to extend the XML document with elements not specified by the schema"),
    anyAttribute     ("Enables the author to extend the XML document with attributes not specified by the schema"),
    appinfo          ("Specifies information to be used by the application (must go inside annotation)"),
    attribute        ("Defines an attribute"),
    attributeGroup   ("Defines an attribute group to be used in complex type definitions"),
    choice           ("Allows only one of the elements contained in the <choice> declaration to be present within the containing element"),
    complexContent   ("Defines extensions or restrictions on a complex type that contains mixed content or elements only"),
    complexType      ("Defines a complex type element"),
    documentation    ("Defines text comments in a schema (must go inside annotation)"),
    element          ("Defines an element"),
    enumeration      (" "),
    extension        ("Extends an existing simpleType or complexType element"),
    field            ("Specifies an XPath expression that specifies the value used to define an identity constraint"),
    group            ("Defines a group of elements to be used in complex type definitions"),
//   import  ("Adds multiple schemas with different target namespace to a document"), --> java key word
    include          ("Adds multiple schemas with the same target namespace to a document"),
    key              ("Specifies an attribute or element value as a key (unique, non-nullable, and always present) within the containing element in an instance document"),
    keyref           ("Specifies that an attribute or element value correspond to those of the specified key or unique element"),
    list             ("Defines a simple type element as a list of values"),
    notation         ("Describes the format of non-XML data within an XML document"),
    redefine         ("Redefines simple and complex types, groups, and attribute groups from an external schema"),
    restriction      ("Defines restrictions on a simpleType, simpleContent, or a complexContent"),
    schema           ("Defines the root element of a schema"),
    selector         ("Specifies an XPath expression that selects a set of elements for an identity constraint"),
    sequence         ("Specifies that the child elements must appear in a sequence. Each child element can occur from 0 to any number of times"),
    simpleContent    ("Contains extensions or restrictions on a text-only complex type or on a simple type as content and contains no elements"),
    simpleType       ("Defines a simple type and specifies the constraints and information about the values of attributes or text-only elements"),
    union            ("Defines a simple type as a collection (union) of values from specified simple data types"),
    unique           ("Defines that an element or an attribute value must be unique within the scope");

    private String description;

    XsdElementEnum(final String description) {
        this.description = description;
    }

    public String getDescription() {
        return description;
    }

    public boolean isTagNameEqual(final String tagName) {
        if (tagName != null) {
            final String[] items = tagName.split(":", -1);
            if (items.length == 2 && items[1].equals(name()))
                return true;
            if (items.length == 1 && items[0].equals(name()))
                return true;
        }
        return false;
    }
}


text:
namespace System.Net.WebSockets
{
    public sealed partial class ClientWebSocket : System.Net.WebSockets.WebSocket
    {
        public ClientWebSocket() { }
        public override System.Nullable<System.Net.WebSockets.WebSocketCloseStatus> CloseStatus { get { throw null; } }
        public override string CloseStatusDescription { get { throw null; } }
        public System.Net.WebSockets.ClientWebSocketOptions Options { get { throw null; } }
        public override System.Net.WebSockets.WebSocketState State { get { throw null; } }
        public override string SubProtocol { get { throw null; } }
        public override void Abort() { }
        public override System.Threading.Tasks.Task CloseAsync(System.Net.WebSockets.WebSocketCloseStatus closeStatus, string statusDescription, System.Threading.CancellationToken cancellationToken) { throw null; }
        public override System.Threading.Tasks.Task CloseOutputAsync(System.Net.WebSockets.WebSocketCloseStatus closeStatus, string statusDescription, System.Threading.CancellationToken cancellationToken) { throw null; }
        public System.Threading.Tasks.Task ConnectAsync(System.Uri uri, System.Threading.CancellationToken cancellationToken) { throw null; }
        public override void Dispose() { }
        public override System.Threading.Tasks.Task<System.Net.WebSockets.WebSocketReceiveResult> ReceiveAsync(System.ArraySegment<byte> buffer, System.Threading.CancellationToken cancellationToken) { throw null; }
        public override System.Threading.Tasks.Task SendAsync(System.ArraySegment<byte> buffer, System.Net.WebSockets.WebSocketMessageType messageType, bool endOfMessage, System.Threading.CancellationToken cancellationToken) { throw null; }
    }
    public sealed partial class ClientWebSocketOptions
    {
        internal ClientWebSocketOptions() { }
        public System.Security.Cryptography.X509Certificates.X509CertificateCollection ClientCertificates { get { throw null; } set { } }
        public System.Net.CookieContainer Cookies { get { throw null; } set { } }
        public System.Net.ICredentials Credentials { get { throw null; } set { } }
        public System.TimeSpan KeepAliveInterval { get { throw null; } set { } }
        public System.Net.IWebProxy Proxy { get { throw null; } set { } }
        public bool UseDefaultCredentials { get { throw null; } set { } }
        public void AddSubProtocol(string subProtocol) { }
        public void SetBuffer(int receiveBufferSize, int sendBufferSize) { }
        public void SetBuffer(int receiveBufferSize, int sendBufferSize, System.ArraySegment<byte> buffer) { }
        public void SetRequestHeader(string headerName, string headerValue) { }
    }
    public partial class HttpListenerWebSocketContext : System.Net.WebSockets.WebSocketContext
    {
        internal HttpListenerWebSocketContext() { }
        public override System.Net.CookieCollection CookieCollection { get { throw null; } }
        public override System.Collections.Specialized.NameValueCollection Headers { get { throw null; } }
        public override bool IsAuthenticated { get { throw null; } }
        public override bool IsLocal { get { throw null; } }
        public override bool IsSecureConnection { get { throw null; } }
        public override string Origin { get { throw null; } }
        public override System.Uri RequestUri { get { throw null; } }
        public override string SecWebSocketKey { get { throw null; } }
        public override System.Collections.Generic.IEnumerable<string> SecWebSocketProtocols { get { throw null; } }
        public override string SecWebSocketVersion { get { throw null; } }
        public override System.Security.Principal.IPrincipal User { get { throw null; } }
        public override System.Net.WebSockets.WebSocket WebSocket { get { throw null; } }
    }
    public abstract partial class WebSocket : System.IDisposable
    {
        protected WebSocket() { }
        public abstract System.Nullable<System.Net.WebSockets.WebSocketCloseStatus> CloseStatus { get; }
        public abstract string CloseStatusDescription { get; }
        public static System.TimeSpan DefaultKeepAliveInterval { get { throw null; } }
        public abstract System.Net.WebSockets.WebSocketState State { get; }
        public abstract string SubProtocol { get; }
        public abstract void Abort();
        public abstract System.Threading.Tasks.Task CloseAsync(System.Net.WebSockets.WebSocketCloseStatus closeStatus, string statusDescription, System.Threading.CancellationToken cancellationToken);
        public abstract System.Threading.Tasks.Task CloseOutputAsync(System.Net.WebSockets.WebSocketCloseStatus closeStatus, string statusDescription, System.Threading.CancellationToken cancellationToken);
        public static System.ArraySegment<byte> CreateClientBuffer(int receiveBufferSize, int sendBufferSize) { throw null; }
        [System.ComponentModel.EditorBrowsableAttribute((System.ComponentModel.EditorBrowsableState)(1))]
        public static System.Net.WebSockets.WebSocket CreateClientWebSocket(System.IO.Stream innerStream, string subProtocol, int receiveBufferSize, int sendBufferSize, System.TimeSpan keepAliveInterval, bool useZeroMaskingKey, System.ArraySegment<byte> internalBuffer) { throw null; }
        public static System.ArraySegment<byte> CreateServerBuffer(int receiveBufferSize) { throw null; }
        public abstract void Dispose();
        protected static bool IsStateTerminal(System.Net.WebSockets.WebSocketState state) { throw null; }
        public abstract System.Threading.Tasks.Task<System.Net.WebSockets.WebSocketReceiveResult> ReceiveAsync(System.ArraySegment<byte> buffer, System.Threading.CancellationToken cancellationToken);
        [System.ComponentModel.EditorBrowsableAttribute((System.ComponentModel.EditorBrowsableState)(1))]
        public static void RegisterPrefixes() { }
        public abstract System.Threading.Tasks.Task SendAsync(System.ArraySegment<byte> buffer, System.Net.WebSockets.WebSocketMessageType messageType, bool endOfMessage, System.Threading.CancellationToken cancellationToken);
        protected static void ThrowOnInvalidState(System.Net.WebSockets.WebSocketState state, params System.Net.WebSockets.WebSocketState[] validStates) { }
    }
    public enum WebSocketCloseStatus
    {
        Empty = 1005,
        EndpointUnavailable = 1001,
        InternalServerError = 1011,
        InvalidMessageType = 1003,
        InvalidPayloadData = 1007,
        MandatoryExtension = 1010,
        MessageTooBig = 1009,
        NormalClosure = 1000,
        PolicyViolation = 1008,
        ProtocolError = 1002,
    }
    public abstract partial class WebSocketContext
    {
        protected WebSocketContext() { }
        public abstract System.Net.CookieCollection CookieCollection { get; }
        public abstract System.Collections.Specialized.NameValueCollection Headers { get; }
        public abstract bool IsAuthenticated { get; }
        public abstract bool IsLocal { get; }
        public abstract bool IsSecureConnection { get; }
        public abstract string Origin { get; }
        public abstract System.Uri RequestUri { get; }
        public abstract string SecWebSocketKey { get; }
        public abstract System.Collections.Generic.IEnumerable<string> SecWebSocketProtocols { get; }
        public abstract string SecWebSocketVersion { get; }
        public abstract System.Security.Principal.IPrincipal User { get; }
        public abstract System.Net.WebSockets.WebSocket WebSocket { get; }
    }
    public enum WebSocketError
    {
        ConnectionClosedPrematurely = 8,
        Faulted = 2,
        HeaderError = 7,
        InvalidMessageType = 1,
        InvalidState = 9,
        NativeError = 3,
        NotAWebSocket = 4,
        Success = 0,
        UnsupportedProtocol = 6,
        UnsupportedVersion = 5,
    }
    public sealed partial class WebSocketException : System.ComponentModel.Win32Exception
    {
        public WebSocketException() { }
        public WebSocketException(int nativeError) { }
        public WebSocketException(int nativeError, System.Exception innerException) { }
        public WebSocketException(int nativeError, string message) { }
        public WebSocketException(System.Net.WebSockets.WebSocketError error) { }
        public WebSocketException(System.Net.WebSockets.WebSocketError error, System.Exception innerException) { }
        public WebSocketException(System.Net.WebSockets.WebSocketError error, int nativeError) { }
        public WebSocketException(System.Net.WebSockets.WebSocketError error, int nativeError, System.Exception innerException) { }
        public WebSocketException(System.Net.WebSockets.WebSocketError error, int nativeError, string message) { }
        public WebSocketException(System.Net.WebSockets.WebSocketError error, int nativeError, string message, System.Exception innerException) { }
        public WebSocketException(System.Net.WebSockets.WebSocketError error, string message) { }
        public WebSocketException(System.Net.WebSockets.WebSocketError error, string message, System.Exception innerException) { }
        public WebSocketException(string message) { }
        public WebSocketException(string message, System.Exception innerException) { }
        public override int ErrorCode { get { throw null; } }
        public System.Net.WebSockets.WebSocketError WebSocketErrorCode { get { throw null; } }
        public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
    }
    public enum WebSocketMessageType
    {
        Binary = 1,
        Close = 2,
        Text = 0,
    }
    public partial class WebSocketReceiveResult
    {
        public WebSocketReceiveResult(int count, System.Net.WebSockets.WebSocketMessageType messageType, bool endOfMessage) { }
        public WebSocketReceiveResult(int count, System.Net.WebSockets.WebSocketMessageType messageType, bool endOfMessage, System.Nullable<System.Net.WebSockets.WebSocketCloseStatus> closeStatus, string closeStatusDescription) { }
        public System.Nullable<System.Net.WebSockets.WebSocketCloseStatus> CloseStatus { get { throw null; } }
        public string CloseStatusDescription { get { throw null; } }
        public int Count { get { throw null; } }
        public bool EndOfMessage { get { throw null; } }
        public System.Net.WebSockets.WebSocketMessageType MessageType { get { throw null; } }
    }
    public enum WebSocketState
    {
        Aborted = 6,
        Closed = 5,
        CloseReceived = 4,
        CloseSent = 3,
        Connecting = 1,
        None = 0,
        Open = 2,
    }
}


text:
#include "modules/localization/msf/local_map/lossless_map/lossless_map.h"

#include "cyber/common/log.h"
#include "modules/localization/msf/local_map/lossless_map/lossless_map_node.h"

namespace apollo {
namespace localization {
namespace msf {
LosslessMap::LosslessMap(LosslessMapConfig* config) : BaseMap(config) {}

LosslessMap::~LosslessMap() {}

void LosslessMap::SetValue(const Eigen::Vector3d& coordinate, int zone_id,
                           unsigned char intensity) {
  for (size_t i = 0; i < map_config_->map_resolutions_.size(); ++i) {
    MapNodeIndex index = MapNodeIndex::GetMapNodeIndex(
        *map_config_, coordinate, static_cast<unsigned int>(i), zone_id);
    LosslessMapNode* node =
        static_cast<LosslessMapNode*>(GetMapNodeSafe(index));
    node->SetValue(coordinate, intensity);
  }
}

void LosslessMap::SetValueLayer(const Eigen::Vector3d& coordinate, int zone_id,
                                unsigned char intensity) {
  for (size_t i = 0; i < map_config_->map_resolutions_.size(); ++i) {
    MapNodeIndex index = MapNodeIndex::GetMapNodeIndex(
        *map_config_, coordinate, static_cast<unsigned int>(i), zone_id);
    LosslessMapNode* node =
        static_cast<LosslessMapNode*>(GetMapNodeSafe(index));
    node->SetValueLayer(coordinate, intensity);
  }
}

void LosslessMap::GetValue(const Eigen::Vector3d& coordinate, int zone_id,
                           unsigned int resolution_id,
                           std::vector<unsigned char>* values) {
  DCHECK_LT(resolution_id, map_config_->map_resolutions_.size());
  MapNodeIndex index = MapNodeIndex::GetMapNodeIndex(*map_config_, coordinate,
                                                     resolution_id, zone_id);
  LosslessMapNode* node = static_cast<LosslessMapNode*>(GetMapNode(index));
  node->GetValue(coordinate, values);
}

void LosslessMap::GetValueSafe(const Eigen::Vector3d& coordinate, int zone_id,
                               unsigned int resolution_id,
                               std::vector<unsigned char>* values) {
  DCHECK_LT(resolution_id, map_config_->map_resolutions_.size());
  MapNodeIndex index = MapNodeIndex::GetMapNodeIndex(*map_config_, coordinate,
                                                     resolution_id, zone_id);
  LosslessMapNode* node = static_cast<LosslessMapNode*>(GetMapNodeSafe(index));
  node->GetValue(coordinate, values);
}

void LosslessMap::GetVar(const Eigen::Vector3d& coordinate, int zone_id,
                         unsigned int resolution_id, std::vector<float>* vars) {
  DCHECK_LT(resolution_id, map_config_->map_resolutions_.size());
  MapNodeIndex index = MapNodeIndex::GetMapNodeIndex(*map_config_, coordinate,
                                                     resolution_id, zone_id);
  LosslessMapNode* node = static_cast<LosslessMapNode*>(GetMapNode(index));
  node->GetVar(coordinate, vars);
}

void LosslessMap::GetVarSafe(const Eigen::Vector3d& coordinate, int zone_id,
                             unsigned int resolution_id,
                             std::vector<float>* vars) {
  DCHECK_LT(resolution_id, map_config_->map_resolutions_.size());
  MapNodeIndex index = MapNodeIndex::GetMapNodeIndex(*map_config_, coordinate,
                                                     resolution_id, zone_id);
  LosslessMapNode* node = static_cast<LosslessMapNode*>(GetMapNodeSafe(index));
  node->GetVar(coordinate, vars);
}

void LosslessMap::GetAlt(const Eigen::Vector3d& coordinate, int zone_id,
                         unsigned int resolution_id, std::vector<float>* alts) {
  DCHECK_LT(resolution_id, map_config_->map_resolutions_.size());
  MapNodeIndex index = MapNodeIndex::GetMapNodeIndex(*map_config_, coordinate,
                                                     resolution_id, zone_id);
  LosslessMapNode* node = static_cast<LosslessMapNode*>(GetMapNode(index));
  node->GetAlt(coordinate, alts);
}

void LosslessMap::GetAltSafe(const Eigen::Vector3d& coordinate, int zone_id,
                             unsigned int resolution_id,
                             std::vector<float>* alts) {
  DCHECK_LT(resolution_id, map_config_->map_resolutions_.size());
  MapNodeIndex index = MapNodeIndex::GetMapNodeIndex(*map_config_, coordinate,
                                                     resolution_id, zone_id);
  LosslessMapNode* node = static_cast<LosslessMapNode*>(GetMapNodeSafe(index));
  node->GetAlt(coordinate, alts);
}

void LosslessMap::GetAltVar(const Eigen::Vector3d& coordinate, int zone_id,
                            unsigned int resolution_id,
                            std::vector<float>* alt_vars) {
  DCHECK_LT(resolution_id, map_config_->map_resolutions_.size());
  MapNodeIndex index = MapNodeIndex::GetMapNodeIndex(*map_config_, coordinate,
                                                     resolution_id, zone_id);
  LosslessMapNode* node = static_cast<LosslessMapNode*>(GetMapNode(index));
  node->GetAltVar(coordinate, alt_vars);
}

void LosslessMap::GetAltVarSafe(const Eigen::Vector3d& coordinate, int zone_id,
                                unsigned int resolution_id,
                                std::vector<float>* alt_vars) {
  DCHECK_LT(resolution_id, map_config_->map_resolutions_.size());
  MapNodeIndex index = MapNodeIndex::GetMapNodeIndex(*map_config_, coordinate,
                                                     resolution_id, zone_id);
  LosslessMapNode* node = static_cast<LosslessMapNode*>(GetMapNodeSafe(index));
  node->GetAltVar(coordinate, alt_vars);
}

void LosslessMap::GetCount(const Eigen::Vector3d& coordinate, int zone_id,
                           unsigned int resolution_id,
                           std::vector<unsigned int>* counts) {
  DCHECK_LT(resolution_id, map_config_->map_resolutions_.size());
  MapNodeIndex index = MapNodeIndex::GetMapNodeIndex(*map_config_, coordinate,
                                                     resolution_id, zone_id);
  LosslessMapNode* node = static_cast<LosslessMapNode*>(GetMapNode(index));
  node->GetCount(coordinate, counts);
}

void LosslessMap::GetCountSafe(const Eigen::Vector3d& coordinate, int zone_id,
                               unsigned int resolution_id,
                               std::vector<unsigned int>* counts) {
  DCHECK_LT(resolution_id, map_config_->map_resolutions_.size());
  MapNodeIndex index = MapNodeIndex::GetMapNodeIndex(*map_config_, coordinate,
                                                     resolution_id, zone_id);
  LosslessMapNode* node = static_cast<LosslessMapNode*>(GetMapNodeSafe(index));
  node->GetCount(coordinate, counts);
}

unsigned char LosslessMap::GetValue(const Eigen::Vector3d& coordinate,
                                    int zone_id, unsigned int resolution_id) {
  DCHECK_LT(resolution_id, map_config_->map_resolutions_.size());
  MapNodeIndex index = MapNodeIndex::GetMapNodeIndex(*map_config_, coordinate,
                                                     resolution_id, zone_id);
  LosslessMapNode* node = static_cast<LosslessMapNode*>(GetMapNode(index));
  return node->GetValue(coordinate);
}

unsigned char LosslessMap::GetValueSafe(const Eigen::Vector3d& coordinate,
                                        int zone_id,
                                        unsigned int resolution_id) {
  DCHECK_LT(resolution_id, map_config_->map_resolutions_.size());
  MapNodeIndex index = MapNodeIndex::GetMapNodeIndex(*map_config_, coordinate,
                                                     resolution_id, zone_id);
  LosslessMapNode* node = static_cast<LosslessMapNode*>(GetMapNodeSafe(index));
  return node->GetValue(coordinate);
}

float LosslessMap::GetVar(const Eigen::Vector3d& coordinate, int zone_id,
                          unsigned int resolution_id) {
  DCHECK_LT(resolution_id, map_config_->map_resolutions_.size());
  MapNodeIndex index = MapNodeIndex::GetMapNodeIndex(*map_config_, coordinate,
                                                     resolution_id, zone_id);
  LosslessMapNode* node = static_cast<LosslessMapNode*>(GetMapNode(index));
  return node->GetVar(coordinate);
}

float LosslessMap::GetVarSafe(const Eigen::Vector3d& coordinate, int zone_id,
                              unsigned int resolution_id) {
  DCHECK_LT(resolution_id, map_config_->map_resolutions_.size());
  MapNodeIndex index = MapNodeIndex::GetMapNodeIndex(*map_config_, coordinate,
                                                     resolution_id, zone_id);
  LosslessMapNode* node = static_cast<LosslessMapNode*>(GetMapNodeSafe(index));
  return node->GetVar(coordinate);
}

float LosslessMap::GetAlt(const Eigen::Vector3d& coordinate, int zone_id,
                          unsigned int resolution_id) {
  DCHECK_LT(resolution_id, map_config_->map_resolutions_.size());
  MapNodeIndex index = MapNodeIndex::GetMapNodeIndex(*map_config_, coordinate,
                                                     resolution_id, zone_id);
  LosslessMapNode* node = static_cast<LosslessMapNode*>(GetMapNode(index));
  return node->GetAlt(coordinate);
}

float LosslessMap::GetAltSafe(const Eigen::Vector3d& coordinate, int zone_id,
                              unsigned int resolution_id) {
  DCHECK_LT(resolution_id, map_config_->map_resolutions_.size());
  MapNodeIndex index = MapNodeIndex::GetMapNodeIndex(*map_config_, coordinate,
                                                     resolution_id, zone_id);
  LosslessMapNode* node = static_cast<LosslessMapNode*>(GetMapNodeSafe(index));
  return node->GetAlt(coordinate);
}

float LosslessMap::GetAltVar(const Eigen::Vector3d& coordinate, int zone_id,
                             unsigned int resolution_id) {
  DCHECK_LT(resolution_id, map_config_->map_resolutions_.size());
  MapNodeIndex index = MapNodeIndex::GetMapNodeIndex(*map_config_, coordinate,
                                                     resolution_id, zone_id);
  LosslessMapNode* node = static_cast<LosslessMapNode*>(GetMapNode(index));
  return node->GetAltVar(coordinate);
}

float LosslessMap::GetAltVarSafe(const Eigen::Vector3d& coordinate, int zone_id,
                                 unsigned int resolution_id) {
  DCHECK_LT(resolution_id, map_config_->map_resolutions_.size());
  MapNodeIndex index = MapNodeIndex::GetMapNodeIndex(*map_config_, coordinate,
                                                     resolution_id, zone_id);
  LosslessMapNode* node = static_cast<LosslessMapNode*>(GetMapNodeSafe(index));
  return node->GetAltVar(coordinate);
}

unsigned int LosslessMap::GetCount(const Eigen::Vector3d& coordinate,
                                   int zone_id, unsigned int resolution_id) {
  DCHECK_LT(resolution_id, map_config_->map_resolutions_.size());
  MapNodeIndex index = MapNodeIndex::GetMapNodeIndex(*map_config_, coordinate,
                                                     resolution_id, zone_id);
  LosslessMapNode* node = static_cast<LosslessMapNode*>(GetMapNode(index));
  return node->GetCount(coordinate);
}

unsigned int LosslessMap::GetCountSafe(const Eigen::Vector3d& coordinate,
                                       int zone_id,
                                       unsigned int resolution_id) {
  DCHECK_LT(resolution_id, map_config_->map_resolutions_.size());
  MapNodeIndex index = MapNodeIndex::GetMapNodeIndex(*map_config_, coordinate,
                                                     resolution_id, zone_id);
  LosslessMapNode* node = static_cast<LosslessMapNode*>(GetMapNodeSafe(index));
  return node->GetCount(coordinate);
}

void LosslessMap::PreloadMapArea(const Eigen::Vector3d& location,
                                 const Eigen::Vector3d& trans_diff,
                                 unsigned int resolution_id,
                                 unsigned int zone_id) {
  BaseMap::PreloadMapArea(location, trans_diff, resolution_id, zone_id);
}

bool LosslessMap::LoadMapArea(const Eigen::Vector3d& seed_pt3d,
                              unsigned int resolution_id, unsigned int zone_id,
                              int filter_size_x, int filter_size_y) {
  BaseMap::LoadMapArea(seed_pt3d, resolution_id, zone_id, filter_size_x,
                       filter_size_y);
  return true;
}

}  // namespace msf
}  // namespace localization
}  // namespace apollo


text:
/*
 * 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.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.toolresults.model;

/**
 * A warning that Robo encountered a screen that has overlapping clickable elements; this may
 * indicate a potential UI issue.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Cloud Tool Results API. For a detailed explanation
 * see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class OverlappingUIElements extends com.google.api.client.json.GenericJson {

  /**
   * Resource names of the overlapping screen elements
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<java.lang.String> resourceName;

  /**
   * The screen id of the elements
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String screenId;

  /**
   * Resource names of the overlapping screen elements
   * @return value or {@code null} for none
   */
  public java.util.List<java.lang.String> getResourceName() {
    return resourceName;
  }

  /**
   * Resource names of the overlapping screen elements
   * @param resourceName resourceName or {@code null} for none
   */
  public OverlappingUIElements setResourceName(java.util.List<java.lang.String> resourceName) {
    this.resourceName = resourceName;
    return this;
  }

  /**
   * The screen id of the elements
   * @return value or {@code null} for none
   */
  public java.lang.String getScreenId() {
    return screenId;
  }

  /**
   * The screen id of the elements
   * @param screenId screenId or {@code null} for none
   */
  public OverlappingUIElements setScreenId(java.lang.String screenId) {
    this.screenId = screenId;
    return this;
  }

  @Override
  public OverlappingUIElements set(String fieldName, Object value) {
    return (OverlappingUIElements) super.set(fieldName, value);
  }

  @Override
  public OverlappingUIElements clone() {
    return (OverlappingUIElements) super.clone();
  }

}


text:
<?php

namespace deluxcms\comment\widgets;

use Yii;
use yii\base\InvalidConfigException;
use yii\base\Widget;
use deluxcms\comment\assets\CommentListAsset;

class CommentListWidget extends Widget
{
    public $title = '评论列表';
    public $dataProvider;
    public $layout = '{items}
{pager}
';
    public $options = [
        'tag' => 'ul',
        'class' => 'media-list mt15 pl15',
    ];
    public $itemOptions = [
        'tag' => 'li',
        'class' => 'media'
    ];

    public $itemView;
    public $commentSwitch = true;

    public function init()
    {
        if ($this->dataProvider === null) {
            throw new InvalidConfigException("DataProvider不能为空");
        }

        if ($this->itemView === null) {
            $this->itemView = function ($model, $key, $index, $widget) {
                return $this->renderFile('@vendor/deluxcms/comment/widgets/views/comment.php', [
                    'model' => $model,
                    'commentSwitch' => $this->commentSwitch,
                ]);
            };
        }
    }

    public function run()
    {
        $listView = \yii\widgets\ListView::widget([
            'dataProvider' => $this->dataProvider,
            'layout' => $this->layout,
            'options' => $this->options,
            'itemOptions' => $this->itemOptions,
            'itemView' => $this->itemView,
        ]);

        $this->registerClientOptions();
        return $this->preJs() . $this->renderFile('@vendor/deluxcms/comment/widgets/views/commentList.php', [
            'listView' => $listView,
            'title' => $this->title,
        ]);
    }

    protected function registerClientOptions()
    {
        CommentListAsset::register(Yii::$app->view);
    }

    protected function preJs()
    {
        return '';
    }
}


text:
var app = angular.module("ethics-app");

// Help controller
app.controller("helpController", function($scope, $rootScope, $filter, $translate, $location, config, $window, $authenticationService, $documentService) {

    /*************************************************
        FUNCTIONS
     *************************************************/

    /**
     * [redirect description]
     * @param  {[type]} path [description]
     * @return {[type]}      [description]
     */
    $scope.redirect = function(path){
        $location.url(path);
    };

    /**
     * [cancel description]
     * @return {[type]} [description]
     */
    $scope.cancel = function(){
        if($authenticationService.get()){
            $scope.redirect("/documents/" + $documentService.getId() + "/status/" + $documentService.getStatus());
        } else {
            $scope.redirect("/");
        }
    };

    /*************************************************
        INIT
     *************************************************/
    $scope.$parent.loading = { status: false, message: "" };

});


text:
package org.apache.ignite.visor.plugin;

import ro.fortsoft.pf4j.ExtensionPoint;

/**
 * Abstract base class for Visor plugin extension point.
 */
public abstract class VisorExtensionPoint implements ExtensionPoint {
    /** */
    private final VisorPluginModel model;

    /**
     * @param model Visor model.
     */
    protected VisorExtensionPoint(VisorPluginModel model) {
        this.model = model;
    }

    /**
     * @return Visor model.
     */
    public VisorPluginModel model() {
        return model;
    }

    /**
     * @return Plugin name.
     */
    public abstract String name();

    /**
     * Will be executed on Visor model changed.
     */
    public void onModelChanged() {
        // No-op.
    }

    /**
     * Will be executed on Visor events changed.
     */
    public void onEventsChanged() {
        // No-op.
    }

    /**
     * Will be executed on Visor connect to grid.
     */
    public void onConnected() {
        // No-op.
    }

    /**
     * Will be executed on Visor disconnect from grid.
     */
    public void onDisconnected() {
        // No-op.
    }
}


text:
"""
This module interfaces with PROJ to produce a pythonic interface
to the coordinate reference system (CRS) information through the CRS
class.
"""

from pyproj._crs import (  # noqa: F401  pylint: disable=unused-import
    CoordinateOperation,
    CoordinateSystem,
    Datum,
    Ellipsoid,
    PrimeMeridian,
    is_proj,
    is_wkt,
)
from pyproj.crs.crs import (  # noqa: F401  pylint: disable=unused-import
    CRS,
    BoundCRS,
    CompoundCRS,
    CustomConstructorCRS,
    DerivedGeographicCRS,
    GeocentricCRS,
    GeographicCRS,
    ProjectedCRS,
    VerticalCRS,
)
from pyproj.exceptions import CRSError  # noqa: F401  pylint: disable=unused-import


text:
#include "asio_server_tls_context.h"

#include <openssl/ssl.h>

#include <boost/asio/ssl.hpp>

#include "ssl.h"
#include "util.h"

namespace nghttp2 {
namespace asio_http2 {
namespace server {

namespace {
std::vector<unsigned char> &get_alpn_token() {
  static auto alpn_token = util::get_default_alpn();
  return alpn_token;
}
} // namespace

boost::system::error_code
configure_tls_context_easy(boost::system::error_code &ec,
                           boost::asio::ssl::context &tls_context) {
  ec.clear();

  auto ctx = tls_context.native_handle();

  auto ssl_opts = (SSL_OP_ALL & ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS) |
                  SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_COMPRESSION |
                  SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION |
                  SSL_OP_SINGLE_ECDH_USE | SSL_OP_NO_TICKET |
                  SSL_OP_CIPHER_SERVER_PREFERENCE;

  SSL_CTX_set_options(ctx, ssl_opts);
  SSL_CTX_set_mode(ctx, SSL_MODE_AUTO_RETRY);
  SSL_CTX_set_mode(ctx, SSL_MODE_RELEASE_BUFFERS);

  SSL_CTX_set_cipher_list(ctx, ssl::DEFAULT_CIPHER_LIST);

#ifndef OPENSSL_NO_EC
  auto ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
  if (ecdh) {
    SSL_CTX_set_tmp_ecdh(ctx, ecdh);
    EC_KEY_free(ecdh);
  }
#endif /* OPENSSL_NO_EC */

  SSL_CTX_set_next_protos_advertised_cb(
      ctx,
      [](SSL *s, const unsigned char **data, unsigned int *len, void *arg) {
        auto &token = get_alpn_token();

        *data = token.data();
        *len = token.size();

        return SSL_TLSEXT_ERR_OK;
      },
      nullptr);

  return ec;
}

} // namespace server
} // namespace asio_http2
} // namespace nghttp2


text:
import importlib

def get_model(alias, test=False):
    module = importlib.import_module('models.' + alias)
    return module.Model


text:
        <title>Fakultas</title>

Daftar Fakultas

 Home

Daftar Fakultas

                            Tambah Fakultas

                                <form th:action="@{/fakultas/list}" method="get">

                                        <input type="text" name="value" class="form-control pull-right" placeholder="Pencarian Berdasarkan Nama" th:if="${key} == null"/>
                                        <input type="text" name="value" class="form-control pull-right" placeholder="Pencarian Berdasarkan Nama" th:if="${key} != null" th:value="${key}" />

                                            <button type="submit" class="btn btn-default"></button>

                                </form>

                                        Nama
                                        Keterangan

                                        Jabatan
                                        Keterangan

«

1 (current)


text:
// Copyright (c) The Perspex Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.

using System;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Resources;
using Perspex.Platform;

namespace Perspex.Win32
{
    /// <summary>
    /// Loads assets compiled into the application binary.
    /// </summary>
    public class AssetLoader : IAssetLoader
    {
        /// <summary>
        /// Opens the resource with the requested URI.
        /// </summary>
        /// <param name="uri">The URI.</param>
        /// <returns>A stream containing the resource contents.</returns>
        /// <exception cref="FileNotFoundException">
        /// The resource was not found.
        /// </exception>
        public Stream Open(Uri uri)
        {
            var assembly = Assembly.GetEntryAssembly();
            var resourceName = assembly.GetName().Name + ".g";
            var manager = new ResourceManager(resourceName, assembly);

            using (var resourceSet = manager.GetResourceSet(CultureInfo.CurrentCulture, true, true))
            {
                var stream = (Stream)resourceSet.GetObject(uri.ToString(), true);

                if (stream == null)
                {
                    throw new FileNotFoundException($"The requested asset could not be found: {uri}");
                }

                return stream;
            }
        }
    }
}


text:
/*!
	@file
	@author		Albert Semenov
	@date		05/2010
*/
/*
	This file is part of MyGUI.

	MyGUI is free software: you can redistribute it and/or modify
	it under the terms of the GNU Lesser General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	MyGUI is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU Lesser General Public License for more details.

	You should have received a copy of the GNU Lesser General Public License
	along with MyGUI.  If not, see <http://www.gnu.org/licenses/>.
*/
#include "pch.h"
#include "MyGUI_Precompiled.h"
#include "MyGUI_LevelLogFilter.h"

namespace MyGUI
{

	LevelLogFilter::LevelLogFilter() :
		mLevel(LogLevel::Info)
	{
	}

	LevelLogFilter::~LevelLogFilter()
	{
	}

	bool LevelLogFilter::shouldLog(const std::string& _section, LogLevel _level, const struct tm* _time, const std::string& _message, const char* _file, int _line)
	{
		return mLevel <= _level;
	}

	void LevelLogFilter::setLoggingLevel(LogLevel _value)
	{
		mLevel = _value;
	}

	LogLevel LevelLogFilter::getLoggingLevel() const
	{
		return mLevel;
	}

} // namespace MyGUI


text:
package com.intellij.application.options.editor;

import com.intellij.codeInsight.CodeInsightSettings;
import com.intellij.codeInsight.JavaProjectCodeInsightSettings;
import com.intellij.execution.util.ListTableWithButtons;
import com.intellij.openapi.application.ApplicationBundle;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.ComboBox;
import com.intellij.openapi.ui.ComboBoxTableRenderer;
import com.intellij.openapi.wm.IdeFocusManager;
import com.intellij.ui.DocumentAdapter;
import com.intellij.ui.GuiUtils;
import com.intellij.ui.JBColor;
import com.intellij.ui.ScrollingUtil;
import com.intellij.util.ArrayUtil;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.ui.ColumnInfo;
import com.intellij.util.ui.ListTableModel;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;
import java.awt.*;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.regex.Pattern;

class ExcludeTable extends ListTableWithButtons<ExcludeTable.Item> {
  private static final Pattern ourPackagePattern = Pattern.compile("(\\w+\\.)*\\w+");
  private static final ColumnInfo<Item, String> NAME_COLUMN = new ColumnInfo<Item, String>("Class or package") {
    @Nullable
    @Override
    public String valueOf(Item pair) {
      return pair.exclude;
    }

    @Nullable
    @Override
    public TableCellEditor getEditor(Item pair) {
      final JTextField field = GuiUtils.createUndoableTextField();
      field.getDocument().addDocumentListener(new DocumentAdapter() {
        @Override
        protected void textChanged(DocumentEvent e) {
          field.setForeground(
            ourPackagePattern.matcher(field.getText()).matches() ? UIUtil.getTableForeground() : JBColor.RED);
        }
      });
      return new DefaultCellEditor(field);
    }

    @Nullable
    @Override
    public TableCellRenderer getRenderer(Item pair) {
      return new DefaultTableCellRenderer() {
        @NotNull
        @Override
        public Component getTableCellRendererComponent(JTable table,
                                                       Object value,
                                                       boolean isSelected,
                                                       boolean hasFocus,
                                                       int row,
                                                       int column) {
          Component component = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
          if (!ourPackagePattern.matcher((String)value).matches()) {
            component.setForeground(JBColor.RED);
          }
          return component;
        }
      };
    }

    @Override
    public boolean isCellEditable(Item pair) {
      return true;
    }

    @Override
    public void setValue(Item item, String value) {
      item.exclude = value;
    }
  };
  private static final ColumnInfo<Item, ExclusionScope> SCOPE_COLUMN = new ColumnInfo<Item, ExclusionScope>("Scope") {
    @Nullable
    @Override
    public ExclusionScope valueOf(Item pair) {
      return pair.scope;
    }

    @Nullable
    @Override
    public TableCellRenderer getRenderer(Item pair) {
      return new ComboBoxTableRenderer<ExclusionScope>(ExclusionScope.values());
    }

    @Nullable
    @Override
    public TableCellEditor getEditor(Item pair) {
      return new DefaultCellEditor(new ComboBox(ExclusionScope.values()));
    }

    @Override
    public boolean isCellEditable(Item pair) {
      return true;
    }

    @Override
    public void setValue(Item pair, ExclusionScope value) {
      pair.scope = value;
    }

    @Nullable
    @Override
    public String getMaxStringValue() {
      return "Project";
    }
  };
  private final Project myProject;

  public ExcludeTable(@NotNull Project project) {
    myProject = project;
    getTableView().getEmptyText().setText(ApplicationBundle.message("exclude.from.imports.no.exclusions"));
  }

  @Override
  protected ListTableModel createListModel() {
    return new ListTableModel<Item>(NAME_COLUMN, SCOPE_COLUMN);
  }

  @Override
  protected Item createElement() {
    return new Item("", ExclusionScope.IDE);
  }

  @Override
  protected boolean isEmpty(Item element) {
    return element.exclude.isEmpty();
  }

  @Override
  protected Item cloneElement(Item variable) {
    return new Item(variable.exclude, variable.scope);
  }

  @Override
  protected boolean canDeleteElement(Item selection) {
    return true;
  }

  void addExcludePackage(String packageName) {
    if (packageName == null) {
      return;
    }

    int index = 0;
    while (index < getTableView().getListTableModel().getRowCount()) {
      if (getTableView().getListTableModel().getItem(index).exclude.compareTo(packageName) > 0) {
        break;
      }
      index++;
    }

    getTableView().getListTableModel().insertRow(index, new Item(packageName, ExclusionScope.IDE));
    getTableView().clearSelection();
    getTableView().addRowSelectionInterval(index, index);
    ScrollingUtil.ensureIndexIsVisible(getTableView(), index, 0);
    IdeFocusManager.getGlobalInstance().requestFocus(getTableView(), false);
  }

  void reset() {
    java.util.List<Item> rows = ContainerUtil.newArrayList();
    for (String s : CodeInsightSettings.getInstance().EXCLUDED_PACKAGES) {
      rows.add(new Item(s, ExclusionScope.IDE));
    }
    for (String s : JavaProjectCodeInsightSettings.getSettings(myProject).excludedNames) {
      rows.add(new Item(s, ExclusionScope.Project));
    }
    Collections.sort(rows, new Comparator<Item>() {
      @Override
      public int compare(Item o1, Item o2) {
        return o1.exclude.compareTo(o2.exclude);
      }
    });

    setValues(rows);
  }

  void apply() {
    CodeInsightSettings.getInstance().EXCLUDED_PACKAGES = ArrayUtil.toStringArray(getExcludedPackages(ExclusionScope.IDE));
    JavaProjectCodeInsightSettings.getSettings(myProject).excludedNames = getExcludedPackages(ExclusionScope.Project);
  }

  private List<String> getExcludedPackages(ExclusionScope scope) {
    List<String> result = ContainerUtil.newArrayList();
    for (Item pair : getTableView().getListTableModel().getItems()) {
      if (scope == pair.scope) {
        result.add(pair.exclude);
      }
    }
    Collections.sort(result);
    return result;
  }

  boolean isModified() {
    return !getExcludedPackages(ExclusionScope.IDE).equals(Arrays.asList(CodeInsightSettings.getInstance().EXCLUDED_PACKAGES))
           ||
           !getExcludedPackages(ExclusionScope.Project).equals(JavaProjectCodeInsightSettings.getSettings(myProject).excludedNames);

  }

  private enum ExclusionScope {Project, IDE}

  static class Item {
    String exclude;
    ExclusionScope scope;

    Item(@NotNull String exclude, ExclusionScope scope) {
      this.exclude = exclude;
      this.scope = scope;
    }
  }
}


text:
package tools.xor.jpa;

import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.api.Test;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.transaction.annotation.Transactional;

import tools.xor.logic.DefaultIdVersion;

@ExtendWith(SpringExtension.class)
@ContextConfiguration(locations = { "classpath:/spring-jpa-test.xml" })
@Transactional
public class JPAIdVersionTest extends DefaultIdVersion {

	@Test
	public void checkId() {
		super.checkId();
	}

	@Test
	public void checkVersion() {
		super.checkVersion();
	}

    @Test
    public void checkTypeInheritanceValue() {
        super.checkTypeInheritanceValue();
    }
}


text:
@implementation DGOrderItem (Mapping)

+ (RKMapping *)mapping {
    RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[DGOrderItem class]];
    [mapping addAttributeMappingsFromDictionary:@{
                                                  @"id"                    : @"ID",
                                                  @"release.id"            : @"releaseID",
                                                  @"release.description"   : @"releaseDescription"
                                                  }];

    [mapping addPropertyMapping:[RKRelationshipMapping relationshipMappingFromKeyPath:@"price" toKeyPath:@"price" withMapping:[DGPrice mapping]]];
    return mapping;
}

@end

@implementation DGOrder (Mapping)

+ (RKMapping *)mapping {
    RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[DGOrder class]];
    [mapping addAttributeMappingsFromDictionary:@{
                                                  @"id"             : @"ID",
                                                  @"uri"            : @"uri",
                                                  @"resource_url"   : @"resourceURL",
                                                  @"message_url"    : @"messageURL",
                                                  @"status"         : @"status",
                                                  @"next_status"    : @"nextStatus",
                                                  @"created"        : @"created",
                                                  @"shipping_address" : @"shippingAddress",
                                                  @"additional_instructions" : @"additionalInstructions",
                                                  @"last_activity"  : @"lastActivity"
                                                  }];

    [mapping addPropertyMapping:[RKRelationshipMapping relationshipMappingFromKeyPath:@"free" toKeyPath:@"fee" withMapping:[DGPrice mapping]]];
    [mapping addPropertyMapping:[RKRelationshipMapping relationshipMappingFromKeyPath:@"shipping" toKeyPath:@"shipping" withMapping:[DGPrice mapping]]];
    [mapping addPropertyMapping:[RKRelationshipMapping relationshipMappingFromKeyPath:@"items" toKeyPath:@"items" withMapping:[DGOrderItem mapping]]];
    [mapping addPropertyMapping:[RKRelationshipMapping relationshipMappingFromKeyPath:@"seller" toKeyPath:@"seller" withMapping:[DGProfile mapping]]];
    [mapping addPropertyMapping:[RKRelationshipMapping relationshipMappingFromKeyPath:@"buyer" toKeyPath:@"buyer" withMapping:[DGProfile mapping]]];
    [mapping addPropertyMapping:[RKRelationshipMapping relationshipMappingFromKeyPath:@"total" toKeyPath:@"total" withMapping:[DGPrice mapping]]];
    return mapping;
}

+ (RKResponseDescriptor *)responseDescriptor {
    return [RKResponseDescriptor responseDescriptorWithMapping:[DGOrder mapping] method:RKRequestMethodGET pathPattern:nil keyPath:nil statusCodes:RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful)];
}

+ (RKRequestDescriptor *)requestDescriptor {
    RKObjectMapping *mapping = [RKObjectMapping requestMapping];
    mapping.assignsDefaultValueForMissingAttributes = NO;

    [mapping addAttributeMappingsFromDictionary:@{
                                                  @"ID"         : @"order_id",
                                                  @"status"     : @"status",
                                                  @"shipping"   : @"shipping.value"
                                                  }];

    return [RKRequestDescriptor requestDescriptorWithMapping:mapping objectClass:[DGOrder class] rootKeyPath:nil method:RKRequestMethodPOST];
}

@end

@implementation DGListOrdersRequest (Mapping)

- (NSDictionary *)parameters {
    NSMutableDictionary *parameters = [NSMutableDictionary dictionary];

    if( self.status ) {
        parameters[@"status"] = self.status;
    }
    parameters[@"sort"] = DGSortOrdersAsString(self.sort);
    parameters[@"sort_order"] = DGSortOrderAsString(self.sortOrder);

    [parameters addEntriesFromDictionary:self.pagination.parameters];

    return parameters;
}

@end

@implementation DGListOrdersResponse (Mapping)

+ (RKResponseDescriptor *)responseDescriptor {
    RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[DGListOrdersResponse class]];

    [mapping addPropertyMapping:[RKRelationshipMapping relationshipMappingFromKeyPath:@"pagination" toKeyPath:@"pagination" withMapping:[DGPagination mapping]]];

    [mapping addPropertyMapping:[RKRelationshipMapping relationshipMappingFromKeyPath:@"orders" toKeyPath:@"orders" withMapping:[DGOrder mapping]]];

    return [RKResponseDescriptor responseDescriptorWithMapping:mapping method:RKRequestMethodAny pathPattern:nil keyPath:nil statusCodes:RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful)];
}

@end


text:
© {{ .Site.Params.author }} 2016 | All rights reserved

Theme by James Reuss. Generated with Hugo.


text:
using System;

namespace Lucene.Net.Index
{

	/// <summary>Used by DocumentsWriter to implemented a StringReader
	/// that can be reset to a new string; we use this when
	/// tokenizing the string value from a Field.
	/// </summary>
    sealed class ReusableStringReader : System.IO.TextReader
    {
        internal int upto;
        internal int left;
        internal System.String s;
        internal void Init(System.String s)
        {
            this.s = s;
            left = s.Length;
            this.upto = 0;
        }
        public int Read(char[] c)
        {
            return Read(c, 0, c.Length);
        }
        public override int Read(System.Char[] c, int off, int len)
        {
            if (left > len)
            {
                SupportClass.TextSupport.GetCharsFromString(s, upto, upto + len, c, off);
                upto += len;
                left -= len;
                return len;
            }
            else if (0 == left)
            {
                s = null;
                return 0;
            }
            else
            {
                SupportClass.TextSupport.GetCharsFromString(s, upto, upto + left, c, off);
                int r = left;
                left = 0;
                upto = s.Length;
                return r;
            }
        }
        public override void Close()
        {
        }

        public override int Read()
        {
            throw new NotImplementedException("This method is not implemented");
        }

        public override int ReadBlock(char[] buffer, int index, int count)
        {
            throw new NotImplementedException("This method is not implemented");
        }

        public override string ReadLine()
        {
            throw new NotImplementedException("This method is not implemented");
        }

        public override int Peek()
        {
            throw new NotImplementedException("This method is not implemented");
        }

        public override string ReadToEnd()
        {
            left = 0;
            return s;
        }
    }
}


text:
module Hamlit
  class SyntaxError < StandardError; end
  class CompileError < StandardError; end

  module Concerns
    module Error
      # Template engine should raise Exception on runtime to
      # show template's error backtrace.
      def syntax_error(message)
        code = %Q{raise Hamlit::SyntaxError.new(%q{#{message}})}
        [:code, code]
      end

      def syntax_error!(message)
        raise Hamlit::SyntaxError.new(message)
      end

      def copmile_error!(message)
        raise CompileError.new(message)
      end

      def assert_scan!(scanner, regexp)
        result = scanner.scan(regexp)
        unless result
          raise CompileError.new("Expected to scan #{regexp} but got nil")
        end
        result
      end
    end
  end
end


text:
cask "blender" do
  version "2.93.4"

  if Hardware::CPU.intel?
    sha256 "9aab9e161e326f02d5ca51b9f77187e931ebc779bd85a604d797c187cd1611f4"

    url "https://download.blender.org/release/Blender#{version.major_minor}/blender-#{version}-macos-x64.dmg"
  else
    sha256 "0478a156829213a683b6be92cd12fe63c4f58fce3d0c2b4b839c157737eb14bf"

    url "https://download.blender.org/release/Blender#{version.major_minor}/blender-#{version}-macos-arm64.dmg"
  end

  name "Blender"
  desc "3D creation suite"
  homepage "https://www.blender.org/"

  livecheck do
    url "https://www.blender.org/download/"
    regex(%r{href=.*?/blender[._-]v?(\d+(?:\.\d+)+)[._-]macos[._-]}i)
  end

  conflicts_with cask: "homebrew/cask-versions/blender-lts"

  app "Blender.app"
  # shim script (https://github.com/Homebrew/homebrew-cask/issues/18809)
  shimscript = "#{staged_path}/blender.wrapper.sh"
  binary shimscript, target: "blender"

  preflight do
    # make __pycache__ directories writable, otherwise uninstall fails
    FileUtils.chmod "u+w", Dir.glob("#{staged_path}/*.app/**/__pycache__")

    IO.write shimscript, <<~EOS
      #!/bin/bash
      '#{appdir}/Blender.app/Contents/MacOS/Blender' "$@"
    EOS
  end

  zap trash: [
    "~/Library/Application Support/Blender",
    "~/Library/Saved Application State/org.blenderfoundation.blender.savedState",
  ]
end


text:
module Lokalise
  URLS = {
    alive: "project/list",
    project_list: "project/list",
    import: "project/import",
    export: "project/export",
    project_languages: "language/list",
  }
end


text:
package com.cloud.vpc;

import com.cloud.configuration.ConfigurationManager;
import com.cloud.network.Network;
import com.cloud.network.NetworkManager;
import com.cloud.network.NetworkModel;
import com.cloud.network.dao.NetworkDao;
import com.cloud.network.dao.NetworkVO;
import com.cloud.network.element.NetworkACLServiceProvider;
import com.cloud.network.vpc.NetworkACLItem;
import com.cloud.network.vpc.NetworkACLItemDao;
import com.cloud.network.vpc.NetworkACLItemVO;
import com.cloud.network.vpc.NetworkACLManager;
import com.cloud.network.vpc.NetworkACLManagerImpl;
import com.cloud.network.vpc.NetworkACLVO;
import com.cloud.network.vpc.VpcManager;
import com.cloud.network.vpc.dao.NetworkACLDao;
import com.cloud.network.vpc.dao.VpcGatewayDao;
import com.cloud.tags.dao.ResourceTagDao;
import com.cloud.user.Account;
import com.cloud.user.AccountManager;
import com.cloud.user.AccountVO;
import com.cloud.user.UserContext;
import com.cloud.utils.component.ComponentContext;
import com.cloud.utils.exception.CloudRuntimeException;
import junit.framework.TestCase;
import org.apache.cloudstack.test.utils.SpringUtils;
import org.apache.log4j.Logger;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.core.type.classreading.MetadataReader;
import org.springframework.core.type.classreading.MetadataReaderFactory;
import org.springframework.core.type.filter.TypeFilter;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.support.AnnotationConfigContextLoader;

import javax.inject.Inject;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(loader = AnnotationConfigContextLoader.class)
public class NetworkACLManagerTest extends TestCase{
    @Inject
    NetworkACLManager _aclMgr;

    @Inject
    AccountManager _accountMgr;
    @Inject
    VpcManager _vpcMgr;
    @Inject
    NetworkACLDao _networkACLDao;
    @Inject
    NetworkACLItemDao _networkACLItemDao;
    @Inject
    NetworkDao _networkDao;
    @Inject
    ConfigurationManager _configMgr;
    @Inject
    NetworkModel _networkModel;
    @Inject
    List<NetworkACLServiceProvider> _networkAclElements;

    private NetworkACLVO acl;
    private NetworkACLItemVO aclItem;

    private static final Logger s_logger = Logger.getLogger( NetworkACLManagerTest.class);

    @Before
    public void setUp() {
        ComponentContext.initComponentsLifeCycle();
        Account account = new AccountVO("testaccount", 1, "testdomain", (short) 0, UUID.randomUUID().toString());
        UserContext.registerContext(1, account, null, true);
        acl = Mockito.mock(NetworkACLVO.class);
        aclItem = Mockito.mock(NetworkACLItemVO.class);
    }

    @Test
    public void testCreateACL() throws Exception {
        Mockito.when(_networkACLDao.persist(Mockito.any(NetworkACLVO.class))).thenReturn(acl);
        assertNotNull(_aclMgr.createNetworkACL("acl_new", "acl desc", 1L));
    }

    @Test
    public void testApplyACL() throws Exception {
        NetworkVO network = Mockito.mock(NetworkVO.class);
        Mockito.when(_networkDao.findById(Mockito.anyLong())).thenReturn(network);
        Mockito.when(_networkModel.isProviderSupportServiceInNetwork(Mockito.anyLong(), Mockito.any(Network.Service.class), Mockito.any(Network.Provider.class))).thenReturn(true);
        Mockito.when(_networkAclElements.get(0).applyNetworkACLs(Mockito.any(Network.class), Mockito.anyList())).thenReturn(true);
        assertTrue(_aclMgr.applyACLToNetwork(1L));
    }

    @Test
    public void testRevokeACLItem() throws Exception {
        Mockito.when(_networkACLItemDao.findById(Mockito.anyLong())).thenReturn(aclItem);
        assertTrue(_aclMgr.revokeNetworkACLItem(1L));
    }

    @Test
    public void testUpdateACLItem() throws Exception {
        Mockito.when(_networkACLItemDao.findById(Mockito.anyLong())).thenReturn(aclItem);
        Mockito.when(_networkACLItemDao.update(Mockito.anyLong(), Mockito.any(NetworkACLItemVO.class))).thenReturn(true);
        assertNotNull(_aclMgr.updateNetworkACLItem(1L, "UDP", null, NetworkACLItem.TrafficType.Ingress, "Deny", 10, 22, 32, null, null));
    }

    @Test(expected = CloudRuntimeException.class)
    public void deleteNonEmptyACL() throws Exception {
        List<NetworkACLItemVO> aclItems = new ArrayList<NetworkACLItemVO>();
        aclItems.add(aclItem);
        Mockito.when(_networkACLItemDao.listByACL(Mockito.anyLong())).thenReturn(aclItems);
        _aclMgr.deleteNetworkACL(acl);
    }

    @Configuration
    @ComponentScan(basePackageClasses={NetworkACLManagerImpl.class},
            includeFilters={@ComponentScan.Filter(value=NetworkACLTestConfiguration.Library.class, type= FilterType.CUSTOM)},
            useDefaultFilters=false)
    public static class NetworkACLTestConfiguration extends SpringUtils.CloudStackTestConfiguration{

        @Bean
        public AccountManager accountManager() {
            return Mockito.mock(AccountManager.class);
        }

        @Bean
        public NetworkManager networkManager() {
            return Mockito.mock(NetworkManager.class);
        }

        @Bean
        public NetworkModel networkModel() {
            return Mockito.mock(NetworkModel.class);
        }

        @Bean
        public VpcManager vpcManager() {
            return Mockito.mock(VpcManager.class);
        }

        @Bean
        public ResourceTagDao resourceTagDao() {
            return Mockito.mock(ResourceTagDao.class);
        }

        @Bean
        public NetworkACLDao networkACLDao() {
            return Mockito.mock(NetworkACLDao.class);
        }

        @Bean
        public NetworkACLItemDao networkACLItemDao() {
            return Mockito.mock(NetworkACLItemDao.class);
        }

        @Bean
        public NetworkDao networkDao() {
            return Mockito.mock(NetworkDao.class);
        }

        @Bean
        public ConfigurationManager configMgr() {
            return Mockito.mock(ConfigurationManager.class);
        }

        @Bean
        public NetworkACLServiceProvider networkElements() {
            return Mockito.mock(NetworkACLServiceProvider.class);
        }

        @Bean
        public VpcGatewayDao vpcGatewayDao () {
            return Mockito.mock(VpcGatewayDao.class);
        }

        public static class Library implements TypeFilter {
            @Override
            public boolean match(MetadataReader mdr, MetadataReaderFactory arg1) throws IOException {
                mdr.getClassMetadata().getClassName();
                ComponentScan cs = NetworkACLTestConfiguration.class.getAnnotation(ComponentScan.class);
                return SpringUtils.includedInBasePackageClasses(mdr.getClassMetadata().getClassName(), cs);
            }
        }
    }

}


text:
package io.teknek.driver;

import io.teknek.model.ITuple;
import io.teknek.model.Operator;

public class CloseDetectOperator extends Operator {

  public static volatile boolean CLOSED = false;

  @Override
  public void handleTuple(ITuple tuple) { }

  public void close(){
    CLOSED = true;
  }

}


text:
1. [](#new)

2. [](#improved)

3. [](#bugfix)
    * Issue #57 - Series should now be restricted to the channel they are in.

# v3.0.7
## 03/19/2021

1. [](#new)

2. [](#improved)
    * Some minor PSR2 fixes.
    * Updated a few hardcoded paths to use Grav's locator instead.
    * Remote files are now downloaded to Grav's tmp folder instead of the system's /tmp folder.

3. [](#bugfix)
    * Bandaid fixed feed.rss.twig override clobbering regular rss feeds.

# v3.0.6
## 03/16/2021

1. [](#new)

2. [](#improved)
    * French and Portugese languages added.

3. [](#bugfix)
    * Fixed a harcoded text string.

# v3.0.5
## 02/05/2021

1. [](#new)

2. [](#improved)
    * Removed admin plugin as dependency.

3. [](#bugfix)
    * Fixed an h3 closing tag

# v3.0.4
## 10/04/2021

1. [](#new)

2. [](#improved)
    * Issue #44 Series and Episode author information is prepopulated based on info in the currently signed in Grav user.

3. [](#bugfix)

# v3.0.3
## 10/02/2021

1. [](#new)

2. [](#improved)

3. [](#bugfix)
    * Fix for Series and Channel pages rss feeds.
    * Fix for incorrect publish date time calculations.

# v3.0.2
## 10/01/2021

1. [](#new)

2. [](#improved)

3. [](#bugfix)
    * Invalid "Explicit content" flag validation check removed

# v3.0.1
## 01/25/2021

1. [](#new)

2. [](#improved)

3. [](#bugfix)
    * Series images now loading properly
    * Subtitle field label now say "Subtitle" vs "Title" in languages.yaml
    * Small fix for mini list of episodes if no parent series (e.g. parent page is a channel page)
# v3.0.0
## 01/25/2021

1. [](#new)
    * Grav v1.7 support.  Grav v1.6 is no longer supported.
    * Individual file field uploads are no longer supported in Grav v1.7.  Instead, use the general media upoader and then the filepicker fields to select the appropriate audio/ image files.
2. [](#improved)
    * Better multi-language support while creating new content via the admin plugin.
    * Twig theming is improved considerably.
    * Updated README to indicate that admin is now required.  If this becomes a problem, I can revisit the requirements.
    * Removed `max_upload` audio file size value from plugin configuration.
3. [](#bugfix)
    * Episode subtitle in the rss feed now points to the correct field in the admin form.  You may need to re-save this data on v2 Podcast episodes to update them to the v3 Podcast format.

# v2.1.10
## 01/21/2021

1. [](#new)

2. [](#improved)
    * Changed some more settings in the plugin blueprint to utilize the core's ML labels.
3. [](#bugfix)
    * Fixes for 0byte sized feeds for RSS feeds by using `page.template` vs `page.name`

# v2.1.9
## 01/20/2021

1. [](#new)
    * Adding a languages.yaml file to begin work on multi-language support.
2. [](#improved)

3. [](#bugfix)
    * Multilanguage fixes for RSS feeds.

# v2.1.8
## 01/20/2021

1. [](#new)

2. [](#improved)

3. [](#bugfix)
    * Grav 1.7 compatibility fix for podcast-episode content field.

# v2.1.7
## 10/19/2020

1. [](#new)

2. [](#improved)

3. [](#bugfix)
    * Added missing twig brackets (thanks to [PalmTreeVI](https://github.com/PalmTreeVI))

# v2.1.6
## 09/20/2020

1. [](#new)
    * Added podcast episode number to feed.

2. [](#improved)
    * Updated News category options

3. [](#bugfix)
    * Updated field name to disable page media upload field on channels, series, and episodes.

# v2.1.5
## 01/28/2020

1. [](#new)

2. [](#improved)

3. [](#bugfix)
    * Fixed multi-language support while saving a podcast episode
    * Fixed incompatibility with Spotify ellipsis support
    * Added check for image on channel page if no image exists

# v2.1.4
## 02/11/2019

1. [](#new)

2. [](#improved)

3. [](#bugfix)
    * Updated gemfiles.  Fixes ffi security warning.

# v2.1.3
## 05/25/2018

1. [](#new)

2. [](#improved)

3. [](#bugfix)
    * Fixed remote media urls in the media player.

# v2.1.2
## 05/14/2018

1. [](#new)
    * New podcast configuration field for max podcast filesize.

2. [](#improved)
    * More audio tags supported (audio/* vs. just mp3).

3. [](#bugfix)
    * Fixed various typos.
    * Fixed media paths for episodes to use base_url's.
    * Fixed truncation of summaries.

# v2.1.1
## 08/05/2017

1. [](#new)
    * No new features.

2. [](#improved)
    * No new improvements.

3. [](#bugfix)
    * Removed broken podcast-host blueprint

# v2.1.0
## 10/23/2017
1. [](#new)
    * External hosting of audio is now supported. (Thanks to apotropaic)

2. [](#improved)
    * Audio metadata calculated on page save rather than initial page view.  Defaults to local for calculations.

3. [](#bugfix)

# v2.0.0
## 10/03/2017
1. [](#new)
    * New page type for podcast-series.  Folder structure follows Channel->Series->Episode. (Issue #4)
    * New RSS feed available at podcast-series for child episodes of a series.

2. [](#improved)
    * Vastly improved Twig templates for all three page types

3. [](#bugfix)
    * Removed references to "speaker" (Issue #5)

# v1.0.1
## 08/05/2017

1. [](#new)
    * No new features.

2. [](#improved)
    * Cleaned up code for media display of individual podcast.

3. [](#bugfix)
    * Version number in blueprints updated correctly.

# v1.0.0
## 07/12/2017

1. [](#new)
    * Audio duration now calculated via get-id3 Grav plugin
    * Dependencies added to blueprints.yaml

2. [](#improved)
    * Unessential GUID PHP functions removed

3. [](#bugfix)
    * Spacing for duration meta data insertion fixed

# v0.9.2
## 07/11/2017

1. [](#new)

2. [](#improved)
    * GUID now properly defined

3. [](#bugfix)
    * Fixed typo in README file
    * Spacing issue on rss feed item tag
    * Updated blueprints.yaml to match correct version
    * Added sub categories underneath some of the entries in iTunesCategories.yaml

# v0.9.1
## 07/06/2017

1. [](#new)
    * Language selection now follows the codes found [here](http://www.loc.gov/standards/iso639-2/php/code_list.php)
2. [](#improved)
    * Podcast category and sub-categories now populate into the RSS feed.
3. [](#bugfix)
    * Removed non-working call in podcast channel blueprint.

# v0.9.0
## 07/05/2017

1. [](#new)
    * Groundwork for calculating episode duration.
    * CSS striping added to podcast_archive_list.html.twig partial.
2. [](#improved)
    * Rss feed as well as the partial render an episode's duration.
3. [](#bugfix)
    * Added self-referencing atom tag for rss feed.
    * Collections now use the correct header date for published date.  Falls back to header.date if header.publish_date is not avilable.
    * Removed a few debug lines.
    * Removed auto-generated 'text_var' from podcast.yaml

# v0.1.0
##  06/30/2017

1. [](#new)
    * ChangeLog started...


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>ru.appliedtech.webappbootstrap</groupId>
  <artifactId>webappbootstrap-application</artifactId>
  <version>1.0.0-SNAPSHOT</version>
  <name>Application Core</name>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <build>
    <sourceDirectory>target/generated-sources/delombok</sourceDirectory>
    <resources>
      <resource>
        <directory>src</directory>
        <excludes>
          <exclude>**/*.java</exclude>
        </excludes>
      </resource>
    </resources>
    <pluginManagement>
	  <plugins>
	    <plugin>
	      <groupId>org.projectlombok</groupId>
	      <artifactId>lombok-maven-plugin</artifactId>
	      <version>0.11.6.0</version>
	      <executions>
	        <execution>
	          <phase>generate-sources</phase>
	          <goals>
	            <goal>delombok</goal>
	          </goals>
	        </execution>
	      </executions>
	      <configuration>
	        <sourceDirectory>src</sourceDirectory>
	      </configuration>
	    </plugin>
	    <plugin>
	      <groupId>org.apache.maven.plugins</groupId>
	      <artifactId>maven-compiler-plugin</artifactId>
	      <configuration>
	        <compilerVersion>1.7</compilerVersion>
	        <source>1.7</source>
	        <target>1.7</target>
	      </configuration>
	    </plugin>
	    <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
	    <plugin>
	    	<groupId>org.eclipse.m2e</groupId>
	    	<artifactId>lifecycle-mapping</artifactId>
	    	<version>1.0.0</version>
	    	<configuration>
	    		<lifecycleMappingMetadata>
	    			<pluginExecutions>
	    				<pluginExecution>
	    					<pluginExecutionFilter>
	    						<groupId>org.projectlombok</groupId>
	    						<artifactId>
	    							lombok-maven-plugin
	    						</artifactId>
	    						<versionRange>[0.11.6.0,)</versionRange>
	    						<goals>
	    							<goal>delombok</goal>
	    						</goals>
	    					</pluginExecutionFilter>
	    					<action>
	    						<ignore></ignore>
	    					</action>
	    				</pluginExecution>
	    			</pluginExecutions>
	    		</lifecycleMappingMetadata>
	    	</configuration>
	    </plugin>
	  </plugins>
    </pluginManagement>
  </build>
  <profiles>
    <profile>
	  <id>lombok-needs-tools-jar</id>
	  <activation>
	    <file>
	      <exists>${java.home}/../lib/tools.jar</exists>
	    </file>
	  </activation>
	  <build>
	    <plugins>
	      <plugin>
	        <groupId>org.projectlombok</groupId>
	        <artifactId>lombok-maven-plugin</artifactId>
	        <configuration>
	          <sourceDirectory>src</sourceDirectory>
  	        </configuration>
	        <dependencies>
	          <dependency>
	            <groupId>sun.jdk</groupId>
	            <artifactId>tools</artifactId>
	            <version>1.7</version>
	            <scope>system</scope>
	            <systemPath>${java.home}/../lib/tools.jar</systemPath>
	          </dependency>
	        </dependencies>
	      </plugin>
	    </plugins>
	  </build>
    </profile>
  </profiles>
  <dependencies>
  	<dependency>
  		<groupId>org.projectlombok</groupId>
  		<artifactId>lombok</artifactId>
  		<version>0.11.6</version>
  		<scope>provided</scope>
  	</dependency>
  </dependencies>
</project>


text:
<?php

namespace CachetHQ\Cachet\Handlers\Commands\Incident;

use CachetHQ\Cachet\Commands\Incident\ReportIncidentCommand;
use CachetHQ\Cachet\Events\Incident\IncidentWasReportedEvent;
use CachetHQ\Cachet\Models\Component;
use CachetHQ\Cachet\Models\Incident;
use Illuminate\Support\Facades\Config;
use Jenssegers\Date\Date;

class ReportIncidentCommandHandler
{
    /**
     * Handle the report incident command.
     *
     * @param \CachetHQ\Cachet\Commands\Incident\ReportIncidentCommand $command
     *
     * @return \CachetHQ\Cachet\Models\Incident
     */
    public function handle(ReportIncidentCommand $command)
    {
        $data = [
            'name'    => $command->name,
            'status'  => $command->status,
            'message' => $command->message,
            'visible' => $command->visible,
        ];

        // Link with the component.
        if ($command->component_id) {
            $data['component_id'] = $command->component_id;
        }

        // The incident occurred at a different time.
        if ($command->incident_date) {
            $incidentDate = Date::createFromFormat('d/m/Y H:i', $command->incident_date, config('cachet.timezone'))->setTimezone(Config::get('app.timezone'));

            $data['created_at'] = $incidentDate;
            $data['updated_at'] = $incidentDate;
        }

        // Create the incident
        $incident = Incident::create($data);

        // Update the component.
        if ($command->component_id) {
            Component::find($command->component_id)->update([
                'status' => $command->component_status,
            ]);
        }

        // Notify subscribers.
        if ($command->notify) {
            event(new IncidentWasReportedEvent($incident));
        }

        return $incident;
    }
}


text:
require 'pygments.rb'
require 'nokogiri'

module Transmuter
  module Format
    class Html

      def initialize(html, options = {})
        parse_options(options)
        @html = html
      end

      def to_pdf
        html = process
        pdf = Pdf.new(html, get_options)
        pdf.process
      end

      def process
        include_inline_stylesheets(syntax_highlighter)
      end

      protected
        def get_options
          options = @options.dup
          options.delete(:redcarpet_options)
          options
        end

        def parse_options(options)
          @options = options.dup
        end

        def read_stylesheet_files
          case @options[:stylesheets]
          when Array
            @options[:stylesheets].collect do |f|
              File.read(f)
            end.join("\n")
          when String
            File.read @options[:stylesheets]
          when NilClass
            # Apparently no stylesheets has been requested
          end
        end

        def include_inline_stylesheets(html)
          if @options[:stylesheets].present?
            stylesheet_contents = read_stylesheet_files

            doc = Nokogiri::HTML(html)
            head = doc.xpath('/html/head').first

            style = Nokogiri::XML::Node.new "style", doc
            style['type'] = "text/css"
            style.content = stylesheet_contents

            unless head.present?
              head = Nokogiri::XML::Node.new "head", doc
              body = doc.xpath('/html/body').first
              body.add_previous_sibling head
            end

            style.parent = head

            html = doc.to_s
          end

          html
        end

        def syntax_highlighter
          doc = Nokogiri::HTML(@html)
          doc.search("//pre[@lang]").each do |pre|
            pre.replace Pygments.highlight(pre.text.rstrip, :lexer => pre[:lang].downcase.to_sym)
          end
          doc.to_s
        end
    end
  end
end


text:
#
# PoshRSJob
# Version 1.7.4.4
#
# Boe Prox (c) 2014
# http://learn-powershell.net
#
#################################

@{

# Script module or binary module file associated with this manifest
ModuleToProcess = 'PoshRSJob.psm1'

# Version number of this module.
ModuleVersion = '1.7.4.5'

# ID used to uniquely identify this module
GUID = '9b17fb0f-e939-4a5c-b194-3f2247452972'

# Author of this module
Author = 'Boe Prox'

# Company or vendor of this module
CompanyName = 'NA'

# Copyright statement for this module
Copyright = '(c) 2014 Boe Prox. All rights reserved.'

# Description of the functionality provided by this module
Description = 'Module designed to use PowerShell runspaces to create jobs that allow throttling and quicker execution of commands'

# Minimum version of the Windows PowerShell engine required by this module
#PowerShellVersion = ''

# Name of the Windows PowerShell host required by this module
#PowerShellHostName = ''

# Minimum version of the Windows PowerShell host required by this module
#PowerShellHostVersion = ''

# Minimum version of the .NET Framework required by this module
#DotNetFrameworkVersion = ''

# Minimum version of the common language runtime (CLR) required by this module
#CLRVersion = ''

# Processor architecture (None, X86, Amd64, IA64) required by this module
#ProcessorArchitecture = ''

# Modules that must be imported into the global environment prior to importing this module
#RequiredModules = @()

# Assemblies that must be loaded prior to importing this module
#RequiredAssemblies = @()

# Script files (.ps1) that are run in the caller's environment prior to importing this module
ScriptsToProcess = @('Scripts\TabExpansion.ps1')

# Type files (.ps1xml) to be loaded when importing this module
#TypesToProcess = 'TypeData\PoshRSJob.Types.ps1xml'

# Format files (.ps1xml) to be loaded when importing this module
#FormatsToProcess = 'TypeData\PoshRSJob.Format.ps1xml'

# Modules to import as nested modules of the module specified in ModuleToProcess
#NestedModules = @()

# Functions to export from this module
FunctionsToExport = 'Get-RSJob','Receive-RSJob','Remove-RSJob',
    'Start-RSJob','Stop-RSJob','Wait-RSJob'

# Cmdlets to export from this module
#CmdletsToExport = '*'

# Variables to export from this module
VariablesToExport = 'PoshRS_Jobs','PoshRS_JobCleanup','PoshRS_JobID','PoshRS_RunspacePools','PoshRS_RunspacePoolCleanup'

# Aliases to export from this module
AliasesToExport = 'gsj','rmsj','rsj','spsj','ssj','wsj'

# List of all modules packaged with this module
#ModuleList = @()

# List of all files packaged with this module
FileList = 'PoshRSJob.psd1', 'PoshRSJob.psm1', 'en-US\about_PoshRSJob.help.txt', 'Private\ConvertScript.ps1', 'Private\ConvertScriptBlockV2.ps1',
'Private\FindFunction.ps1', 'Private\GetFunctionByFile.ps1', 'Private\GetFunctionDefinitionByFunction.ps1', 'Private\GetParamVariable.ps1', 'Private\GetUsingVariables.ps1', 'Private\GetUsingVariablesV2.ps1',
'Private\Increment.ps1', 'Private\RegisterScriptScopeFunction.ps1', 'Public\Get-RSJob.ps1', 'Public\Receive-RSJob.ps1',
'Public\Remove-RSJob.ps1', 'Public\Start-RSJob.ps1', 'Public\Stop-RSJob.ps1', 'Public\Wait-RSJob.ps1', 'TypeData\PoshRSJob.Format.ps1xml', 'TypeData\PoshRSJob.Types.ps1xml',
'Private\SetIsReceived.ps1'

# Private data to pass to the module specified in ModuleToProcess
PrivateData = @{
    PSData = @{
            # The primary categorization of this module (from the TechNet Gallery tech tree).
            Category = "Multithreading"

            # Keyword tags to help users find this module via navigations and search.
            Tags = @('PoshRSJob', 'Runspace','RunspacePool', 'Linux', 'PowerShellCore', 'RSJob')

            # The web address of an icon which can be used in galleries to represent this module
            #IconUri = ''

            # The web address of this module's project or support homepage.
            ProjectUri = "https://github.com/proxb/PoshRSJob"

            # The web address of this module's license. Points to a page that's embeddable and linkable.
            LicenseUri = "https://opensource.org/licenses/MIT"

            # Release notes for this particular version of the module
            # ReleaseNotes = False

            # If true, the LicenseUrl points to an end-user license (not just a source license) which requires the user agreement before use.
            RequireLicenseAcceptance = "False"

            # Indicates this is a pre-release/testing version of the module.
            IsPrerelease = 'False'
        }
    }
}


text:
  Novion-Porcien est
       un village
       localisé dans le département des Ardennes en Champagne-Ardenne. On dénombrait 494 habitants en 2008.

Si vous pensez venir habiter à Novion-Porcien, vous pourrez aisément trouver une maison à acheter.

La ville propose quelques  équipements, elle propose entre autres un terrain de tennis et un terrain de sport.

À coté de Novion-Porcien sont positionnées géographiquement les villes de
Sery située à 5 km, 330 habitants,
Mesmont située à 2 km, 96 habitants,
Novy-Chevrières à 6 km, 632 habitants,
Corny-Machéroménil située à 2 km, 121 habitants,
Wasigny à 6 km, 345 habitants,
Saulces-Monclin située à 5 km, 617 habitants,
 entre autres. De plus, Novion-Porcien est située à seulement 28 km de Charleville-Mézières.

Le parc de logements, à Novion-Porcien, se décomposait en 2011 en douze appartements et 214 maisons soit
 un marché relativement équilibré.


text:
import glob
from distutils.core import setup, Extension

netmap_bindings_module = Extension('netmap',
            include_dirs = ['../../sys'],
            sources = glob.glob('*.c'),
            extra_compile_args = [])

setup(name = 'NetmapBindings',
        version = '11.0',
        description = 'python bindings for netmap',
        author = 'Vincenzo Maffione',
        author_email = 'v.maffione@gmail.com',
        url = 'http://info.iet.unipi.it/~luigi/netmap/',
        ext_modules = [netmap_bindings_module])