text:
package eu.h2020.symbiote.security.swagger;

import eu.h2020.symbiote.security.AuthenticationAuthorizationManager;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.MvcResult;

import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import java.io.BufferedWriter;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;

import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

@WebAppConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = {AuthenticationAuthorizationManager.class, SwaggerConfig.class},
        properties = {"eureka.client.enabled=false",
                "spring.sleuth.enabled=false"})
@AutoConfigureMockMvc
@TestPropertySource("/core.properties")
public class Swagger2MarkupTest {

    @Autowired
    private MockMvc mockMvc;

    @Before
    public void setUp() throws
            Exception {
        // Create a trust manager that does not validate certificate chains
        TrustManager[] trustAllCerts = new TrustManager[]{
                new X509TrustManager() {
                    public java.security.cert.X509Certificate[] getAcceptedIssuers() {
                        return null;
                    }

                    public void checkClientTrusted(
                            java.security.cert.X509Certificate[] certs, String authType) {
                    }

                    public void checkServerTrusted(
                            java.security.cert.X509Certificate[] certs, String authType) {
                    }
                }
        };

        // Install the all-trusting trust manager
        SSLContext sc = SSLContext.getInstance("SSL");
        sc.init(null, trustAllCerts, new java.security.SecureRandom());
        HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
    }

    @Test
    public void createSpringfoxSwaggerJson() throws
            Exception {
        String outputDir = "build/swagger";
        MvcResult mvcResult = this.mockMvc.perform(get("/swagger/v2/api-docs")
                .header("Origin", "localhost")
                .accept(MediaType.APPLICATION_JSON))
                .andExpect(status().isOk())
                .andReturn();

        MockHttpServletResponse response = mvcResult.getResponse();
        String swaggerJson = response.getContentAsString();
        Files.createDirectories(Paths.get(outputDir));
        try (BufferedWriter writer = Files.newBufferedWriter(Paths.get(outputDir, "swagger.json"), StandardCharsets.UTF_8)) {
            writer.write(swaggerJson);
        }
    }
}


text:
package com.ead.model;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="de_answer")
public class Answer implements Serializable {

	private static final long serialVersionUID = 5508173583999726620L;

	@Id
	@GeneratedValue
	@Column(name="idAsset", unique=true, nullable=false)
	private Integer id;

	@ManyToOne(optional=false,cascade=CascadeType.REMOVE)
	@JoinColumn(name="IdQuestion",nullable=false)
	private Question question;

	@Column(name="description",columnDefinition="TEXT")
	private String description;

	@Column(name="isCorrect")
	private Boolean isCorrect;

	@ManyToOne(optional=false,cascade=CascadeType.REMOVE)
	@JoinColumn(name="IdExam",nullable=false)
	private Exam exam;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Question getQuestion() {
		return question;
	}

	public void setQuestion(Question question) {
		this.question = question;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Boolean getIsCorrect() {
		return isCorrect;
	}

	public void setIsCorrect(Boolean isCorrect) {
		this.isCorrect = isCorrect;
	}

	public Exam getExam() {
		return exam;
	}

	public void setExam(Exam exam) {
		this.exam = exam;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Answer other = (Answer) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "Answer [id=" + id + ", description=" + description + ", exam=" + exam + ", question=" + question + ", isCorrect=" + isCorrect
				 + "]";
	}

}

redpajama_set_name: RedPajamaGithub


text:
package com.github.jinahya.database.metadata.bind;

class ResultSetConcurrencyTest extends IntFieldEnumTest<ResultSetConcurrency> {

    ResultSetConcurrencyTest() {
        super(ResultSetConcurrency.class);
    }
}


text:
package kendzi.swing.ui.panel.equation;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.RenderingHints;
import java.awt.Stroke;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
import java.awt.geom.GeneralPath;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.text.NumberFormat;
import java.util.LinkedList;
import java.util.List;

import javax.swing.JComponent;

/**
 * @author  kendzi
 */
public class EquationDisplay extends JComponent implements PropertyChangeListener {
    private static final Color COLOR_BACKGROUND = Color.WHITE;
    private static final Color COLOR_MAJOR_GRID = Color.GRAY.brighter();
    private static final Color COLOR_MINOR_GRID = new Color(220, 220, 220);
    private static final Color COLOR_AXIS = Color.BLACK;

    private static final float STROKE_AXIS = 1.2f;
    private static final float STROKE_GRID = 1.0f;

    private static final float COEFF_ZOOM = 1.1f;

    private List<DrawableEquation> equations;

    protected double minX;
    protected double maxX;
    protected double minY;
    protected double maxY;

    protected double originX;
    protected double originY;

    protected double majorX;
    protected int minorX;
    protected double majorY;
    protected int minorY;

    private double oldWidth;
    private double oldHeight;

    private boolean sameRatio;

    /**
	 * @uml.property  name="drawText"
	 */
    private boolean drawText = true;

    private Point dragStart;

    private NumberFormat formatter;
    /**
	 * @uml.property  name="zoomHandler"
	 * @uml.associationEnd
	 */
    private ZoomHandler zoomHandler;
    /**
	 * @uml.property  name="resizeHandler"
	 * @uml.associationEnd
	 */
    private ComponentResizeHandler resizeHandler;
    /**
	 * @uml.property  name="panMotionHandler"
	 * @uml.associationEnd
	 */
    private PanMotionHandler panMotionHandler;
    /**
	 * @uml.property  name="panHandler"
	 * @uml.associationEnd
	 */
    private PanHandler panHandler;
    private double startMinX;
    private double startMaxX;
    private double startMinY;
    private double startMaxY;
    private int startWidth;
    private int startHeight;

    /**
     * @param originX pozycja srodka mapy x
     * @param originY pozycja srodka mapy x
     * @param minX widoczna czesc
     * @param maxX widoczna czesc
     * @param minY widoczna czesc
     * @param maxY widoczna czesc
     * @param majorX wielkosc podzialu glownej siatki x
     * @param minorX ilosc lini podzednego podzialu x
     * @param majorY wielkosc podzialu glownej siatki y
     * @param minorY ilosc lini podzednego podzialu y
     */
    public EquationDisplay(double originX, double originY,
                           double minX, double maxX,
                           double minY, double maxY,
                           double majorX, int minorX,
                           double majorY, int minorY, boolean sameRatio) {

    	setParms(originX, originY, minX, maxX, minY, maxY, majorX, minorX, majorY, minorY);

        this.equations = new LinkedList<DrawableEquation>();

        this.formatter = NumberFormat.getInstance();
        this.formatter.setMaximumFractionDigits(2);

        this.oldWidth = getWidth();
        this.oldHeight = getHeight();

        panHandler = new PanHandler();
        addMouseListener(panHandler);
        panMotionHandler = new PanMotionHandler();
        addMouseMotionListener(panMotionHandler);
        zoomHandler = new ZoomHandler();
        addMouseWheelListener(zoomHandler);
        resizeHandler = new ComponentResizeHandler();
        addComponentListener(resizeHandler);

        this.sameRatio = sameRatio;
    }

    public void setParms(
    		double originX, double originY,
            double minX, double maxX,
            double minY, double maxY,
            double majorX, int minorX,
            double majorY, int minorY) {

    	if (originX < minX || originX > maxX) {
            throw new IllegalArgumentException("originX must be between minX and maxX");
        }

        if (minY >= maxY) {
            throw new IllegalArgumentException("minY must be < to maxY");
        }

        if (originY < minY || originY > maxY) {
            throw new IllegalArgumentException("originY must be between minY and maxY");
        }

        if (minorX <= 0) {
            throw new IllegalArgumentException("minorX must be > 0");
        }

        if (minorY <= 0) {
            throw new IllegalArgumentException("minorY must be > 0");
        }

        if (majorX <= 0.0) {
            throw new IllegalArgumentException("majorX must be > 0.0");
        }

        if (majorY <= 0.0) {
            throw new IllegalArgumentException("majorY must be > 0.0");
        }

        this.originX = originX;
        this.originY = originY;

        this.minX = minX;
        this.maxX = maxX;
        this.minY = minY;
        this.maxY = maxY;

        this.startMinX = minX;
        this.startMaxX = maxX;
        this.startMinY = minY;
        this.startMaxY = maxY;

        this.startWidth = getWidth();
        this.startHeight = getHeight();

        this.majorX = majorX;
        this.minorX = minorX;
        this.majorY = majorY;
        this.minorY = minorY;
    }

    @Override
    public void setEnabled(boolean enabled) {
        if (isEnabled() != enabled) {
            //super.setEnabled(enabled);

            if (enabled) {
                addMouseListener(panHandler);
                addMouseMotionListener(panMotionHandler);
                addMouseWheelListener(zoomHandler);
            } else {
                removeMouseListener(panHandler);
                removeMouseMotionListener(panMotionHandler);
                removeMouseWheelListener(zoomHandler);
            }
        }
    }

    /**
	 * @return
	 * @uml.property  name="drawText"
	 */
    public boolean isDrawText() {
        return drawText;
    }

    /**
	 * @param drawText
	 * @uml.property  name="drawText"
	 */
    public void setDrawText(boolean drawText) {
        this.drawText = drawText;
    }

    public void addEquation(AbstractEquation equation, Color color) {
        if (equation != null && !equations.contains(equation)) {
            equation.addPropertyChangeListener(this);
            equations.add(new DrawableEquation(equation, color));
            repaint();
        }
    }

    public void removeEquation(AbstractEquation equation) {
        if (equation != null) {
            DrawableEquation toRemove = null;
            for (DrawableEquation drawable: equations) {
                if (drawable.getEquation() == equation) {
                    toRemove = drawable;
                    break;
                }
            }

            if (toRemove != null) {
                equation.removePropertyChangeListener(this);
                equations.remove(toRemove);
                repaint();
            }
        }
    }

    @Override
    public Dimension getPreferredSize() {
        return new Dimension(400, 400);
    }

    @Override
    public void propertyChange(PropertyChangeEvent evt) {
        repaint();
    }

    public double yPositionToPixel(double position) {
        double height = getHeight();
        return height - ((position - minY) * height / (maxY - minY));
    }

    public double xPositionToPixel(double position) {
        return (position - minX) * getWidth() / (maxX - minX);
    }

    public double xPixelToPosition(double pixel) {
        double axisV = xPositionToPixel(originX);
        return (pixel - axisV) * (maxX - minX) / getWidth();
    }

    public double yPixelToPosition(double pixel) {
        double axisH = yPositionToPixel(originY);
        return (getHeight() - pixel - axisH) * (maxY - minY) / getHeight();
    }

    @Override
    protected void paintComponent(Graphics g) {
        if (!isVisible()) {
            return;
        }

        Graphics2D g2 = (Graphics2D) g;
        setupGraphics(g2);

        paintBackground(g2);
//        drawGrid(g2);
//        drawAxis(g2);
//
//        drawEquations(g2);

        paintInformation(g2);
    }

    protected void paintInformation(Graphics2D g2) {
    }

    private void drawEquations(Graphics2D g2) {
        for (DrawableEquation drawable: equations) {
            g2.setColor(drawable.getColor());
            drawEquation(g2, drawable.getEquation());
        }
    }

    private void drawEquation(Graphics2D g2, AbstractEquation equation) {
        float x = 0.0f;
        float y = (float) yPositionToPixel(equation.compute(xPixelToPosition(0.0)));

        GeneralPath path = new GeneralPath();
        path.moveTo(x, y);

        for (x = 0.0f; x < getWidth(); x += 1.0f) {
            double position = xPixelToPosition(x);
            y = (float) yPositionToPixel(equation.compute(position));
            path.lineTo(x, y);
        }

        g2.draw(path);
    }

    public void drawGrid(Graphics2D g2) {
        Stroke stroke = g2.getStroke();

        drawVerticalGrid(g2);
        drawHorizontalGrid(g2);

        if (drawText) {
            drawVerticalLabels(g2);
            drawHorizontalLabels(g2);
        }

        g2.setStroke(stroke);
    }

    private void drawHorizontalLabels(Graphics2D g2) {
        double axisV = xPositionToPixel(originX);

        g2.setColor(COLOR_AXIS);
        for (double y = originY + majorY; y < maxY + majorY; y += majorY) {
            int position = (int) yPositionToPixel(y);
            g2.drawString(formatter.format(y), (int) axisV + 5, position);
        }

        for (double y = originY - majorY; y > minY - majorY; y -= majorY) {
            int position = (int) yPositionToPixel(y);
            g2.drawString(formatter.format(y), (int) axisV + 5, position);
        }
    }

    private void drawHorizontalGrid(Graphics2D g2) {
        double minorSpacing = majorY / minorY;
        double axisV = xPositionToPixel(originX);

        Stroke gridStroke = new BasicStroke(STROKE_GRID);
        Stroke axisStroke = new BasicStroke(STROKE_AXIS);

        for (double y = originY + majorY; y < maxY + majorY; y += majorY) {
            g2.setStroke(gridStroke);
            g2.setColor(COLOR_MINOR_GRID);
            for (int i = 0; i < minorY; i++) {
                int position = (int) yPositionToPixel(y - i * minorSpacing);
                g2.drawLine(0, position, getWidth(), position);
            }

            int position = (int) yPositionToPixel(y);
            g2.setColor(COLOR_MAJOR_GRID);
            g2.drawLine(0, position, getWidth(), position);

            g2.setStroke(axisStroke);
            g2.setColor(COLOR_AXIS);
            g2.drawLine((int) axisV - 3, position, (int) axisV + 3, position);
        }

        for (double y = originY - majorY; y > minY - majorY; y -= majorY) {
            g2.setStroke(gridStroke);
            g2.setColor(COLOR_MINOR_GRID);
            for (int i = 0; i < minorY; i++) {
                int position = (int) yPositionToPixel(y + i * minorSpacing);
                g2.drawLine(0, position, getWidth(), position);
            }

            int position = (int) yPositionToPixel(y);
            g2.setColor(COLOR_MAJOR_GRID);
            g2.drawLine(0, position, getWidth(), position);

            g2.setStroke(axisStroke);
            g2.setColor(COLOR_AXIS);
            g2.drawLine((int) axisV - 3, position, (int) axisV + 3, position);
        }
    }

    private void drawVerticalLabels(Graphics2D g2) {
        double axisH = yPositionToPixel(originY);
        FontMetrics metrics = g2.getFontMetrics();

        g2.setColor(COLOR_AXIS);

        for (double x = originX + majorX; x < maxX + majorX; x += majorX) {
            int position = (int) xPositionToPixel(x);
            g2.drawString(formatter.format(x), position, (int) axisH + metrics.getHeight());
        }

        for (double x = originX - majorX; x > minX - majorX; x -= majorX) {
            int position = (int) xPositionToPixel(x);
            g2.drawString(formatter.format(x), position, (int) axisH + metrics.getHeight());
        }
    }

    private void drawVerticalGrid(Graphics2D g2) {
        double minorSpacing = majorX / minorX;
        double axisH = yPositionToPixel(originY);

        Stroke gridStroke = new BasicStroke(STROKE_GRID);
        Stroke axisStroke = new BasicStroke(STROKE_AXIS);

        for (double x = originX + majorX; x < maxX + majorX; x += majorX) {
            g2.setStroke(gridStroke);
            g2.setColor(COLOR_MINOR_GRID);
            for (int i = 0; i < minorX; i++) {
                int position = (int) xPositionToPixel(x - i * minorSpacing);
                g2.drawLine(position, 0, position, getHeight());
            }

            int position = (int) xPositionToPixel(x);
            g2.setColor(COLOR_MAJOR_GRID);
            g2.drawLine(position, 0, position, getHeight());

            g2.setStroke(axisStroke);
            g2.setColor(COLOR_AXIS);
            g2.drawLine(position, (int) axisH - 3, position, (int) axisH + 3);
        }

        for (double x = originX - majorX; x > minX - majorX; x -= majorX) {
            g2.setStroke(gridStroke);
            g2.setColor(COLOR_MINOR_GRID);
            for (int i = 0; i < minorX; i++) {
                int position = (int) xPositionToPixel(x + i * minorSpacing);
                g2.drawLine(position, 0, position, getHeight());
            }

            int position = (int) xPositionToPixel(x);
            g2.setColor(COLOR_MAJOR_GRID);
            g2.drawLine(position, 0, position, getHeight());

            g2.setStroke(axisStroke);
            g2.setColor(COLOR_AXIS);
            g2.drawLine(position, (int) axisH - 3, position, (int) axisH + 3);
        }
    }

    public void drawAxis(Graphics2D g2) {
        double axisH = yPositionToPixel(originY);
        double axisV = xPositionToPixel(originX);

        g2.setColor(COLOR_AXIS);
        Stroke stroke = g2.getStroke();
        g2.setStroke(new BasicStroke(STROKE_AXIS));

        g2.drawLine(0, (int) axisH, getWidth(), (int) axisH);
        g2.drawLine((int) axisV, 0, (int) axisV, getHeight());

        FontMetrics metrics = g2.getFontMetrics();
        g2.drawString(formatter.format(0.0), (int) axisV + 5, (int) axisH + metrics.getHeight());

        g2.setStroke(stroke);
    }

    protected void setupGraphics(Graphics2D g2) {
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                            RenderingHints.VALUE_ANTIALIAS_ON);
    }

    protected void paintBackground(Graphics2D g2) {
        g2.setColor(COLOR_BACKGROUND);
        g2.fill(g2.getClipBounds());
    }

    /**
	 * @author  kendzi
	 */
    private class DrawableEquation {

        private AbstractEquation equation;

        private Color color;

        DrawableEquation(AbstractEquation equation, Color color) {
            this.equation = equation;
            this.color = color;
        }

        AbstractEquation getEquation() {
            return equation;
        }

        Color getColor() {
            return color;
        }
    }

    private class ZoomHandler implements MouseWheelListener {
        @Override
        public void mouseWheelMoved(MouseWheelEvent e) {
            double distanceX = maxX - minX;
            double distanceY = maxY - minY;

            double cursorX = minX + distanceX / 2.0;
            double cursorY = minY + distanceY / 2.0;

            int rotation = e.getWheelRotation();
            if (rotation < 0) {
                distanceX /= COEFF_ZOOM;
                distanceY /= COEFF_ZOOM;
            } else {
                distanceX *= COEFF_ZOOM;
                distanceY *= COEFF_ZOOM;
            }

            minX = cursorX - distanceX / 2.0;
            maxX = cursorX + distanceX / 2.0;
            minY = cursorY - distanceY / 2.0;
            maxY = cursorY + distanceY / 2.0;

            repaint();
        }
    }

    private class PanHandler extends MouseAdapter {
        @Override
        public void mousePressed(MouseEvent e) {
            dragStart = e.getPoint();
        }
    }

    private class ComponentResizeHandler extends ComponentAdapter {

		@Override
		public void componentResized(ComponentEvent arg0) {
			super.componentResized(arg0);

            int w = getWidth();
            int h = getHeight();
			double width = w;
			double height = h;

            if (( startWidth == 0) || (startHeight == 0)) {
				startWidth = w;
				startHeight = h;

                double dX = startMaxX - startMinX;
                double dY = startMaxY - startMinY;

                double radioX = (startMaxX - startMinX) / width;
                double radioY = (startMaxY - startMinY) / height;

                if (sameRatio) {
                    if (radioY > radioX) {
                        // powiekszamy obszar osi x tak aby zachowac radio
                        double dX2 = radioY * width;
                        double srX = startMinX + dX /2;

                        startMaxX = srX + dX2/2;
                        startMinX = srX - dX2/2;

                        maxX = startMaxX;
                        minX = startMinX;

                    }else {
                        // powiekszamy obszar osi x tak aby zachowac radio
                        double dY2 = radioX * height;
                        double srY = startMinY + dY /2;

                        startMaxY = srY + dY2/2;
                        startMinY = srY - dY2/2;

                        maxY = startMaxY;
                        minY = startMinY;

                    }
                }

			}

			if (( oldWidth == 0) || (oldHeight == 0)) {
				oldWidth = width;
				oldHeight = height;
			}

			double distanceX = (maxX - minX) * (width/oldWidth);
            double distanceY = (maxY - minY) * (height/oldHeight);

            if ((distanceX == 0) || ( distanceY == 0)) {
                distanceX = (startMaxX - startMinX) * (width/startWidth);
                distanceY = (startMaxY - startMinY) * (height/startHeight);
            }

            double cursorX = minX + distanceX / 2.0;
            double cursorY = maxY - distanceY / 2.0;

            minX = cursorX - distanceX / 2.0;
            maxX = cursorX + distanceX / 2.0;
            minY = cursorY - distanceY / 2.0;
            maxY = cursorY + distanceY / 2.0;

            oldWidth = width;
			oldHeight = height;

            repaint();

		}

    }

    private class PanMotionHandler extends MouseMotionAdapter {
        @Override
        public void mouseDragged(MouseEvent e) {
            Point dragEnd = e.getPoint();

            double distance = xPixelToPosition(dragEnd.getX()) -
                              xPixelToPosition(dragStart.getX());
            minX -= distance;
            maxX -= distance;

            distance = yPixelToPosition(dragEnd.getY()) -
                       yPixelToPosition(dragStart.getY());
            minY -= distance;
            maxY -= distance;

            repaint();
            dragStart = dragEnd;
        }
    }

	public double getMinX() {
		return minX;
	}

	public void setMinX(double minX) {
		this.minX = minX;
	}

	public double getMaxX() {
		return maxX;
	}

	public void setMaxX(double maxX) {
		this.maxX = maxX;
	}

	public double getMinY() {
		return minY;
	}

	public void setMinY(double minY) {
		this.minY = minY;
	}

	public double getMaxY() {
		return maxY;
	}

	public void setMaxY(double maxY) {
		this.maxY = maxY;
	}

	public double getMajorX() {
		return majorX;
	}

	public void setMajorX(double majorX) {
		this.majorX = majorX;
	}

	public int getMinorX() {
		return minorX;
	}

	public void setMinorX(int minorX) {
		this.minorX = minorX;
	}

	public double getMajorY() {
		return majorY;
	}

	public void setMajorY(double majorY) {
		this.majorY = majorY;
	}

	public int getMinorY() {
		return minorY;
	}

	public void setMinorY(int minorY) {
		this.minorY = minorY;
	}
}


text:
<?php

namespace Fine47\Util;

/**
 * Utility functions related to SQL, like escaping, building queries, etc.
 *
 * @since 1.0
 * @author Noor Dawod <noor@fine47.com>
 */
class Sql {

  /**
   * Prepares a SQL query by substituting placeholders with their parameters.
   * A placeholder follow same formatting rules as {@see \sprintf()}.
   *
   * @param string|array $query to prepare
   * @param array $params for substituting placeholders (optional)
   * @return string prepared query
   */
  public static function prepare(
    /*string|array*/ $query,
    array $params = null
  ) {
    if(is_array($query)) {
      $query = implode(' ', $query);
    }
    $query = @trim($query);
    if($query && !empty($params)) {
      array_unshift($params, $query);
      $query = call_user_func_array('sprintf', $params);
    }
    return $query;
  }
}


text:
NSString *const AWSCognitoIdentityErrorDomain = @"com.amazonaws.AWSCognitoIdentityErrorDomain";

@implementation AWSCognitoIdentityCognitoIdentityProvider

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"clientId" : @"ClientId",
             @"providerName" : @"ProviderName",
             };
}

@end

@implementation AWSCognitoIdentityCreateIdentityPoolInput

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"allowUnauthenticatedIdentities" : @"AllowUnauthenticatedIdentities",
             @"cognitoIdentityProviders" : @"CognitoIdentityProviders",
             @"developerProviderName" : @"DeveloperProviderName",
             @"identityPoolName" : @"IdentityPoolName",
             @"openIdConnectProviderARNs" : @"OpenIdConnectProviderARNs",
             @"samlProviderARNs" : @"SamlProviderARNs",
             @"supportedLoginProviders" : @"SupportedLoginProviders",
             };
}

+ (NSValueTransformer *)cognitoIdentityProvidersJSONTransformer {
	return [NSValueTransformer awsmtl_JSONArrayTransformerWithModelClass:[AWSCognitoIdentityCognitoIdentityProvider class]];
}

@end

@implementation AWSCognitoIdentityCredentials

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"accessKeyId" : @"AccessKeyId",
             @"expiration" : @"Expiration",
             @"secretKey" : @"SecretKey",
             @"sessionToken" : @"SessionToken",
             };
}

+ (NSValueTransformer *)expirationJSONTransformer {
	return [AWSMTLValueTransformer reversibleTransformerWithForwardBlock:^id(NSNumber *number) {
        return [NSDate dateWithTimeIntervalSince1970:[number doubleValue]];
    } reverseBlock:^id(NSDate *date) {
        return [NSString stringWithFormat:@"%f", [date timeIntervalSince1970]];
    }];
}

@end

@implementation AWSCognitoIdentityDeleteIdentitiesInput

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"identityIdsToDelete" : @"IdentityIdsToDelete",
             };
}

@end

@implementation AWSCognitoIdentityDeleteIdentitiesResponse

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"unprocessedIdentityIds" : @"UnprocessedIdentityIds",
             };
}

+ (NSValueTransformer *)unprocessedIdentityIdsJSONTransformer {
	return [NSValueTransformer awsmtl_JSONArrayTransformerWithModelClass:[AWSCognitoIdentityUnprocessedIdentityId class]];
}

@end

@implementation AWSCognitoIdentityDeleteIdentityPoolInput

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"identityPoolId" : @"IdentityPoolId",
             };
}

@end

@implementation AWSCognitoIdentityDescribeIdentityInput

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"identityId" : @"IdentityId",
             };
}

@end

@implementation AWSCognitoIdentityDescribeIdentityPoolInput

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"identityPoolId" : @"IdentityPoolId",
             };
}

@end

@implementation AWSCognitoIdentityGetCredentialsForIdentityInput

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"customRoleArn" : @"CustomRoleArn",
             @"identityId" : @"IdentityId",
             @"logins" : @"Logins",
             };
}

@end

@implementation AWSCognitoIdentityGetCredentialsForIdentityResponse

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"credentials" : @"Credentials",
             @"identityId" : @"IdentityId",
             };
}

+ (NSValueTransformer *)credentialsJSONTransformer {
	return [NSValueTransformer awsmtl_JSONDictionaryTransformerWithModelClass:[AWSCognitoIdentityCredentials class]];
}

@end

@implementation AWSCognitoIdentityGetIdInput

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"accountId" : @"AccountId",
             @"identityPoolId" : @"IdentityPoolId",
             @"logins" : @"Logins",
             };
}

@end

@implementation AWSCognitoIdentityGetIdResponse

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"identityId" : @"IdentityId",
             };
}

@end

@implementation AWSCognitoIdentityGetIdentityPoolRolesInput

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"identityPoolId" : @"IdentityPoolId",
             };
}

@end

@implementation AWSCognitoIdentityGetIdentityPoolRolesResponse

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"identityPoolId" : @"IdentityPoolId",
             @"roles" : @"Roles",
             };
}

@end

@implementation AWSCognitoIdentityGetOpenIdTokenForDeveloperIdentityInput

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"identityId" : @"IdentityId",
             @"identityPoolId" : @"IdentityPoolId",
             @"logins" : @"Logins",
             @"tokenDuration" : @"TokenDuration",
             };
}

@end

@implementation AWSCognitoIdentityGetOpenIdTokenForDeveloperIdentityResponse

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"identityId" : @"IdentityId",
             @"token" : @"Token",
             };
}

@end

@implementation AWSCognitoIdentityGetOpenIdTokenInput

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"identityId" : @"IdentityId",
             @"logins" : @"Logins",
             };
}

@end

@implementation AWSCognitoIdentityGetOpenIdTokenResponse

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"identityId" : @"IdentityId",
             @"token" : @"Token",
             };
}

@end

@implementation AWSCognitoIdentityIdentityDescription

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"creationDate" : @"CreationDate",
             @"identityId" : @"IdentityId",
             @"lastModifiedDate" : @"LastModifiedDate",
             @"logins" : @"Logins",
             };
}

+ (NSValueTransformer *)creationDateJSONTransformer {
	return [AWSMTLValueTransformer reversibleTransformerWithForwardBlock:^id(NSNumber *number) {
        return [NSDate dateWithTimeIntervalSince1970:[number doubleValue]];
    } reverseBlock:^id(NSDate *date) {
        return [NSString stringWithFormat:@"%f", [date timeIntervalSince1970]];
    }];
}

+ (NSValueTransformer *)lastModifiedDateJSONTransformer {
	return [AWSMTLValueTransformer reversibleTransformerWithForwardBlock:^id(NSNumber *number) {
        return [NSDate dateWithTimeIntervalSince1970:[number doubleValue]];
    } reverseBlock:^id(NSDate *date) {
        return [NSString stringWithFormat:@"%f", [date timeIntervalSince1970]];
    }];
}

@end

@implementation AWSCognitoIdentityIdentityPool

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"allowUnauthenticatedIdentities" : @"AllowUnauthenticatedIdentities",
             @"cognitoIdentityProviders" : @"CognitoIdentityProviders",
             @"developerProviderName" : @"DeveloperProviderName",
             @"identityPoolId" : @"IdentityPoolId",
             @"identityPoolName" : @"IdentityPoolName",
             @"openIdConnectProviderARNs" : @"OpenIdConnectProviderARNs",
             @"samlProviderARNs" : @"SamlProviderARNs",
             @"supportedLoginProviders" : @"SupportedLoginProviders",
             };
}

+ (NSValueTransformer *)cognitoIdentityProvidersJSONTransformer {
	return [NSValueTransformer awsmtl_JSONArrayTransformerWithModelClass:[AWSCognitoIdentityCognitoIdentityProvider class]];
}

@end

@implementation AWSCognitoIdentityIdentityPoolShortDescription

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"identityPoolId" : @"IdentityPoolId",
             @"identityPoolName" : @"IdentityPoolName",
             };
}

@end

@implementation AWSCognitoIdentityListIdentitiesInput

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"hideDisabled" : @"HideDisabled",
             @"identityPoolId" : @"IdentityPoolId",
             @"maxResults" : @"MaxResults",
             @"nextToken" : @"NextToken",
             };
}

@end

@implementation AWSCognitoIdentityListIdentitiesResponse

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"identities" : @"Identities",
             @"identityPoolId" : @"IdentityPoolId",
             @"nextToken" : @"NextToken",
             };
}

+ (NSValueTransformer *)identitiesJSONTransformer {
	return [NSValueTransformer awsmtl_JSONArrayTransformerWithModelClass:[AWSCognitoIdentityIdentityDescription class]];
}

@end

@implementation AWSCognitoIdentityListIdentityPoolsInput

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"maxResults" : @"MaxResults",
             @"nextToken" : @"NextToken",
             };
}

@end

@implementation AWSCognitoIdentityListIdentityPoolsResponse

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"identityPools" : @"IdentityPools",
             @"nextToken" : @"NextToken",
             };
}

+ (NSValueTransformer *)identityPoolsJSONTransformer {
	return [NSValueTransformer awsmtl_JSONArrayTransformerWithModelClass:[AWSCognitoIdentityIdentityPoolShortDescription class]];
}

@end

@implementation AWSCognitoIdentityLookupDeveloperIdentityInput

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"developerUserIdentifier" : @"DeveloperUserIdentifier",
             @"identityId" : @"IdentityId",
             @"identityPoolId" : @"IdentityPoolId",
             @"maxResults" : @"MaxResults",
             @"nextToken" : @"NextToken",
             };
}

@end

@implementation AWSCognitoIdentityLookupDeveloperIdentityResponse

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"developerUserIdentifierList" : @"DeveloperUserIdentifierList",
             @"identityId" : @"IdentityId",
             @"nextToken" : @"NextToken",
             };
}

@end

@implementation AWSCognitoIdentityMergeDeveloperIdentitiesInput

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"destinationUserIdentifier" : @"DestinationUserIdentifier",
             @"developerProviderName" : @"DeveloperProviderName",
             @"identityPoolId" : @"IdentityPoolId",
             @"sourceUserIdentifier" : @"SourceUserIdentifier",
             };
}

@end

@implementation AWSCognitoIdentityMergeDeveloperIdentitiesResponse

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"identityId" : @"IdentityId",
             };
}

@end

@implementation AWSCognitoIdentitySetIdentityPoolRolesInput

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"identityPoolId" : @"IdentityPoolId",
             @"roles" : @"Roles",
             };
}

@end

@implementation AWSCognitoIdentityUnlinkDeveloperIdentityInput

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"developerProviderName" : @"DeveloperProviderName",
             @"developerUserIdentifier" : @"DeveloperUserIdentifier",
             @"identityId" : @"IdentityId",
             @"identityPoolId" : @"IdentityPoolId",
             };
}

@end

@implementation AWSCognitoIdentityUnlinkIdentityInput

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"identityId" : @"IdentityId",
             @"logins" : @"Logins",
             @"loginsToRemove" : @"LoginsToRemove",
             };
}

@end

@implementation AWSCognitoIdentityUnprocessedIdentityId

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
	return @{
             @"errorCode" : @"ErrorCode",
             @"identityId" : @"IdentityId",
             };
}

+ (NSValueTransformer *)errorCodeJSONTransformer {
    return [AWSMTLValueTransformer reversibleTransformerWithForwardBlock:^NSNumber *(NSString *value) {
        if ([value isEqualToString:@"AccessDenied"]) {
            return @(AWSCognitoIdentityErrorCodeAccessDenied);
        }
        if ([value isEqualToString:@"InternalServerError"]) {
            return @(AWSCognitoIdentityErrorCodeInternalServerError);
        }
        return @(AWSCognitoIdentityErrorCodeUnknown);
    } reverseBlock:^NSString *(NSNumber *value) {
        switch ([value integerValue]) {
            case AWSCognitoIdentityErrorCodeAccessDenied:
                return @"AccessDenied";
            case AWSCognitoIdentityErrorCodeInternalServerError:
                return @"InternalServerError";
            case AWSCognitoIdentityErrorCodeUnknown:
            default:
                return nil;
        }
    }];
}

@end


text:
from datetime import timedelta
from functools import update_wrapper
import json
import uuid

from bson.json_util import dumps
from flask import Blueprint, current_app, jsonify, make_response, request
from flask import session

from . import db

mws = Blueprint('mws', __name__, url_prefix='/mws')

CLIENTS_COLLECTION = 'clients'
REQUEST_ORIGIN = '*'  # TODO: Get this value from app config.

# TODO: Look over this method; remove unnecessary bits, check convention, etc.
# via http://flask.pocoo.org/snippets/56/
def crossdomain(origin=None, methods=None, headers=None,
                max_age=21600, attach_to_all=True,
                automatic_options=True):
    if methods is not None:
        methods = ', '.join(sorted(x.upper() for x in methods))
    if headers is not None and not isinstance(headers, basestring):
        headers = ', '.join(x.upper() for x in headers)
    if not isinstance(origin, basestring):
        origin = ', '.join(origin)
    if isinstance(max_age, timedelta):
        max_age = max_age.total_seconds()

    def get_methods():
        if methods is not None:
            return methods

        options_resp = current_app.make_default_options_response()
        return options_resp.headers['allow']

    def decorator(f):
        def wrapped_function(*args, **kwargs):
            if automatic_options and request.method == 'OPTIONS':
                resp = current_app.make_default_options_response()
            else:
                resp = make_response(f(*args, **kwargs))
            if not attach_to_all and request.method != 'OPTIONS':
                return resp

            h = resp.headers

            h['Access-Control-Allow-Origin'] = origin
            h['Access-Control-Allow-Methods'] = get_methods()
            h['Access-Control-Max-Age'] = str(max_age)
            if headers is not None:
                h['Access-Control-Allow-Headers'] = headers
            return resp

        f.provide_automatic_options = False
        return update_wrapper(wrapped_function, f)
    return decorator

@mws.route('/', methods=['POST'])
@crossdomain(origin=REQUEST_ORIGIN)
def create_mws_resource():
    res_id = generate_res_id()
    session_id = session.get('session_id', str(uuid.uuid4()))
    session['session_id'] = session_id
    result = {'res_id': res_id, 'session_id': session_id}
    db.get_db()[CLIENTS_COLLECTION].insert(result)
    return jsonify(res_id=res_id)

@mws.route('/<res_id>/keep-alive', methods=['POST'])
@crossdomain(origin=REQUEST_ORIGIN)
def keep_mws_alive(res_id):
    # TODO: Reset timeout period on mws resource with the given id.
    return '{}'

@mws.route('/<res_id>/db/<collection_name>/find', methods=['GET'])
@crossdomain(origin=REQUEST_ORIGIN)
def db_collection_find(res_id, collection_name):
    # TODO: Should we specify a content type? Then we have to use an options
    # header, and we should probably get the return type from the content-type
    # header.
    # TODO: Is there an easier way to convert these JSON args? Automatically?
    try:
        query = json.loads(request.args.get('query', '{}')) or None
        projection = json.loads(request.args.get('projection', '{}')) or None
    except ValueError:
        # TODO: Return proper error to client.
        error = 'Error parsing JSON parameters.'
        return jsonify(status=-1, result=error)
    session_id = session.get('session_id', None)
    if session_id is None:
        error = 'There is no session_id cookie'
        return jsonify(status=-1, result=error)
    internal_collection_name = get_internal_collection_name(res_id,
                                                            collection_name)
    if not user_has_access(res_id, session_id):
        error = 'Session error. User does not have access to res_id'
        return jsonify(status=-1, result=error)
    cursor = db.get_db()[internal_collection_name].find(query, projection)
    documents = list(cursor)
    result = {'status': 0, 'result': documents}
    try:
        result = dumps(result)
    except ValueError:
        error = 'Error in find while trying to convert the results to ' + \
            'JSON format.'
        return jsonify(status=-1, result=error)
    return result

@mws.route('/<res_id>/db/<collection_name>/insert',
           methods=['POST', 'OPTIONS'])
@crossdomain(headers='Content-type', origin=REQUEST_ORIGIN)
def db_collection_insert(res_id, collection_name):
    # TODO: Ensure request.json is not None.
    if 'document' in request.json:
        document = request.json['document']
    else:
        error = '\'document\' argument not found in the insert request.'
        return jsonify(status=-1, result=error)
    session_id = session.get('session_id', None)
    if session_id is None:
        error = 'There is no session_id cookie'
        return jsonify(status=-1, result=error)
    internal_collection_name = get_internal_collection_name(res_id,
                                                            collection_name)
    if not user_has_access(res_id, session_id):
        error = 'Session error. User does not have access to res_id'
        return jsonify(status=-1, result=error)
    objIDs = db.get_db()[internal_collection_name].insert(document)
    result = {'status': 0, 'result': objIDs}
    try:
        result = dumps(result)
    except ValueError:
        error = 'Error in insert function while trying to convert the ' + \
            'results to JSON format.'
        return jsonify(status=-1, result=error)
    return result

def get_internal_collection_name(res_id, collection_name):
    return res_id + collection_name

def generate_res_id():
    return str(uuid.uuid4())

def user_has_access(res_id, session_id):
    query = {'res_id': res_id, 'session_id': session_id}
    return_value = db.get_db()[CLIENTS_COLLECTION].find_one(query)
    return False if return_value is None else True


text:
'use strict';

module.exports = function (app) {
    // Root routing
    var core = require('../../app/controllers/core.server.controller');
    var tracks = require('../../app/controllers/tracks.server.controller');
    app.route('/').get(core.index);
};


text:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using C5;
using Manos.Collections;
using Manos.Http;

namespace Manos.Routing
{
    public class RouteHandler : IEnumerable<RouteHandler>
    {
        private IMatchOperation[] match_ops;
        private List<HttpMethod> methods;

        public RouteHandler()
        {
            SetupChildrenCollection();
        }

        public RouteHandler(IMatchOperation op, HttpMethod[] methods) : this(new[] {op}, methods)
        {
        }

        public RouteHandler(IMatchOperation op, HttpMethod[] methods, IManosTarget target)
            : this(new[] {op}, methods, target)
        {
        }

        public RouteHandler(IMatchOperation op, HttpMethod method) : this(new[] {op}, new[] {method})
        {
        }

        public RouteHandler(IMatchOperation op, HttpMethod method, IManosTarget target)
            : this(new[] {op}, new[] {method}, target)
        {
        }

        public RouteHandler(IMatchOperation[] ops, HttpMethod[] methods) : this(ops, methods, null)
        {
        }

        public RouteHandler(IMatchOperation[] ops, HttpMethod[] methods, IManosTarget target)
        {
            Target = target;

            match_ops = ops;
            this.methods = new List<HttpMethod>(methods);

            SetupChildrenCollection();
        }

        public bool IsImplicit { get; internal set; }

        public IMatchOperation[] MatchOps
        {
            get { return match_ops; }
            set { match_ops = value; }
        }

        public System.Collections.Generic.IList<HttpMethod> Methods
        {
            get { return methods; }
            set
            {
                if (value == null)
                    methods = null;
                else
                    methods = new List<HttpMethod>(value);
            }
        }

        public IManosTarget Target { get; set; }

        //
        // TODO: These also need to be an observable collection
        // so we can throw an exception if someone tries to add
        // a child when we already have a Target
        //
        public System.Collections.Generic.IList<RouteHandler> Children { get; private set; }

        public bool HasPatterns
        {
            get { return match_ops != null && match_ops.Length > 0; }
        }

        #region IEnumerable<RouteHandler> Members

        IEnumerator IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }

        public IEnumerator<RouteHandler> GetEnumerator()
        {
            yield return this;
            foreach (RouteHandler child in Children)
            {
                foreach (RouteHandler subchild in child)
                {
                    yield return subchild;
                }
            }
        }

        #endregion

        private void HandleChildrenCollectionChanged(object sender, EventArgs e)
        {
            if (Target != null)
                throw new InvalidOperationException("Can not add Children to a RouteHandler that has a Target set.");
        }

        private void SetupChildrenCollection()
        {
            var children = new ArrayList<RouteHandler>();

            children.ItemInserted += HandleChildrenCollectionChanged;
            children.ItemsAdded += HandleChildrenCollectionChanged;
            children.ItemRemovedAt += HandleChildrenCollectionChanged;
            children.ItemsRemoved += HandleChildrenCollectionChanged;
            Children = children;
        }

        public void Add(RouteHandler child)
        {
            Children.Add(child);
        }

        public IManosTarget Find(IHttpRequest request)
        {
            return Find(request, 0);
        }

        private IManosTarget Find(IHttpRequest request, int uri_start)
        {
            if (!IsMethodMatch(request))
                return null;

            DataDictionary uri_data = null;
            if (HasPatterns)
            {
                int end;

                if (!FindPatternMatch(request.Path, uri_start, out uri_data, out end))
                {
                    return null;
                }

                if (Target != null)
                {
                    if (uri_data != null)
                        request.UriData.Children.Add(uri_data);
                    return Target;
                }

                uri_start = end;
            }

            foreach (RouteHandler handler in Children)
            {
                IManosTarget res = handler.Find(request, uri_start);
                if (res != null)
                {
                    if (uri_data != null)
                        request.UriData.Children.Add(uri_data);
                    return res;
                }
            }

            return null;
        }

        public bool FindPatternMatch(string input, int start, out DataDictionary uri_data, out int end)
        {
            if (match_ops == null)
            {
                uri_data = null;
                end = start;
                return false;
            }

            foreach (IMatchOperation op in match_ops)
            {
                if (op.IsMatch(input, start, out uri_data, out end))
                {
                    if (Children.Count() > 0 || end == input.Length)
                    {
                        return true;
                    }
                }
            }

            uri_data = null;
            end = start;
            return false;
        }

        public bool IsMethodMatch(IHttpRequest request)
        {
            if (methods != null)
                return methods.Contains(request.Method);

            return true;
        }
    }
}


text:
using Xemio.GameLibrary.Common;
using Xemio.GameLibrary.Config;
using Xemio.GameLibrary.Content;
using Xemio.GameLibrary.Content.FileSystem;
using Xemio.GameLibrary.Content.FileSystem.Disk;
using Xemio.GameLibrary.Content.Formats;
using Xemio.GameLibrary.Events;
using Xemio.GameLibrary.Plugins.Implementations;

namespace Xemio.GameLibrary
{
    public class BasicConfigurator
    {
        #region Static Methods
        /// <summary>
        /// Configures the XGL core components to provide access to core functionality.
        /// </summary>
        public static void Configure()
        {
            var config = Fluently.Configure()
                .ContentFormat(Format.Xml)
                .CreatePlayerInput()
                .DisableSplashScreen()
                .FileSystem(new DiskFileSystem());

            XGL.Run(config);
        }
        #endregion
    }
}


text:
/**
 * @file
 * @author Jernej Kovacic
 *
 * Default settings for implemented algorithms that compute
 * various matrix properties, such as inverse, determinat or rank.
 */

#ifndef _MATH_MATRIX_SETTINGS_H_
#define _MATH_MATRIX_SETTINGS_H_

/*
 * Default settings, specifying whether internal pivoting
 * implementation for the Gauss - Jordan algorithm based operations
 * performs full pivoting. Note that full pivoting is more complex
 * but numerically more stable.
 */
#define MATRIX_INVERSE_FULL_PIVOT             ( true )
#define MATRIX_DET_FULL_PIVOT                 ( true )

/**
 * Default setting, specifying whether the internal pivoting
 * implementation for the Gauss - Jordan algorithm based operations
 * (such as matrix inversion, determinant and rank) internally physically
 * swap elements of the coefficient matrix when pivoting rows
 * and/or columns. When set to TRUE, the algorithm requires less
 * additional storage for book keeping of swaps.
 */
#define MATRIX_PHYSSWAP_COEF                  ( false )

#endif  /* _MATH_MATRIX_SETTINGS_H_ */


text:
* Installing PyLith on a cluster

  PyLith uses the Message Passing Interface for parallel processing. The implementation of this interface depends on the cluster hardware. As a result, we cannot provide binary packages that run on clusters and you must build PyLith from source.

* User developers

  Anyone interested in contributing to PyLith development should build PyLith from source using the GitHub repositories. This makes it possible to contribute back to the main PyLith source code.

  :::{tip}
  The [PyLith Docker Development Environment](/developer/docker-devenv.md) is an easy way to setup the PyLith development environment.
  :::


text:
name "dev"
description "Dev Envirnment"
cookbook "apache", "= 0.2.0"


text:
<resources>

    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>

        <!--设置窗口背景-->
        <item name="android:windowBackground">@color/colorBackground</item>
    </style>

    <style name="Theme.FF.NoActionBar" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>

        <!--设置窗口背景-->
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
        <item name="android:windowBackground">@color/colorBackground</item>
    </style>

    <style name="CollapsingToolbarTitleStyle" parent="@android:style/TextAppearance">
        <item name="android:textColor">@android:color/transparent</item>
    </style>

</resources>


text:
import React from 'react';
import localization from '../../helpers/localization';

const renderCustomers = (customers, handler) => {

  return _.map(customers, (customer, prop) => {
    const {tcVergiNo, isCompany, title, name, surname, contactNumber, createDate} = customer;

    return (

 handler(prop)}>
        <i className={`icon-${isCompany ? 'briefcase': 'user'}`}>
        {isCompany ? title : name + ' ' + surname}
        {tcVergiNo}
        {contactNumber}

    );
  });
}

const CustomersList = props => {
  return (

          {localization.displayName}
          {localization.tcVergiNo}
          {localization.contactNumber}

        {renderCustomers(props.customers, props.onClick)}

  );
}

export default CustomersList;


text:
import React, {PureComponent} from "react";
import axios from "axios";
import validateErrorResponse from "../../../../../utility/HttpResponseValidator";
import ToolkitProvider from "react-bootstrap-table2-toolkit";
import BootstrapTable from "react-bootstrap-table-next";
import PaginationFactory from "react-bootstrap-table2-paginator";
import {mockResponseStatusFormatter} from "../../utility/SoapFormatter"
import {faCheckCircle} from "@fortawesome/free-solid-svg-icons";
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";

class UpdateStatusModal extends PureComponent {

    constructor(props) {
        super(props);
        this.setUpdateStatus = this.setUpdateStatus.bind(this);
        this.onUpdateStatusClick = this.onUpdateStatusClick.bind(this);

        this.columns = [{
            dataField: 'id',
            text: 'id',
            hidden: true
        }, {
            dataField: 'name',
            text: 'Name',
            sort: true
        }];

        this.defaultSort = [{
            dataField: 'name',
            order: 'asc'
        }];

        this.state = {
            updateStatus: "ENABLED"
        };
    }

    setUpdateStatus(status) {
        this.setState({
            updateStatus: status
        });
    }

    onUpdateStatusClick(){
        let mockResponseIds = this.props.selectedMockResponses.map(mockResponse => mockResponse.id);
        axios
            .put(process.env.PUBLIC_URL + "/api/rest/soap/project/" + this.props.projectId + "/port/" +
                this.props.portId + "/operation/" + this.props.operationId + "/mockresponse/status", {
                status: this.state.updateStatus,
                mockResponseIds: mockResponseIds
            })
            .then(response => {
                this.props.getOperation();
            })
            .catch(error => {
                validateErrorResponse(error)
            });
    }

    render() {
        return (

Update status?

                            <button type="button" className="close" data-dismiss="modal" aria-label="Close">
                                ×
                            </button>

Do you want update the status for the following mock responses?

                                <ToolkitProvider bootstrap4
                                                 columns={ this.columns}
                                                 data={ this.props.selectedMockResponses }
                                                 keyField="id">
                                    {
                                        (props) => (

                                                <BootstrapTable { ...props.baseProps } bootstrap4 data={this.props.selectedMockResponses} columns={this.columns}
                                                                defaultSorted={ this.defaultSort } keyField='id' hover
                                                                striped
                                                                pagination={ PaginationFactory({hideSizePerPage: true}) }/>

                                        )}
                                </ToolkitProvider>

                                Status

                                    <select id="inputStatus" className="form-control" defaultValue="MOCKED" onChange={event => this.setUpdateStatus(event.target.value)}>
                                        <option value={"ENABLED"}>{mockResponseStatusFormatter("ENABLED")}</option>
                                        <option value={"DISABLED"}>{mockResponseStatusFormatter("DISABLED")}</option>
                                    </select>

                            <button className="btn btn-primary" data-dismiss="modal" onClick={this.onUpdateStatusClick}><FontAwesomeIcon icon={faCheckCircle} className="button-icon"/>Update</button>

        );
    }
}

export default UpdateStatusModal;