text:
package nl.rutgerkok.blocklocker.impl.profile;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.util.Optional;
import java.util.UUID;

import org.junit.jupiter.api.Test;

import com.google.gson.JsonObject;

import nl.rutgerkok.blocklocker.ProfileFactory;
import nl.rutgerkok.blocklocker.Translator.Translation;
import nl.rutgerkok.blocklocker.group.CombinedGroupSystem;
import nl.rutgerkok.blocklocker.impl.JsonSecretSignEntry;
import nl.rutgerkok.blocklocker.profile.PlayerProfile;
import nl.rutgerkok.blocklocker.profile.Profile;

public class TestPlayerProfile {

    private ProfileFactoryImpl getProfileFactory() {
        return new ProfileFactoryImpl(new CombinedGroupSystem(), new NullTranslator());
    }

    @Test
    public void testIncludes() {
        ProfileFactoryImpl factory = getProfileFactory();
        UUID bobId = UUID.randomUUID();
        String everyoneTag = "[" + new NullTranslator().getWithoutColor(Translation.TAG_EVERYONE) + "]";

        Profile bob = factory.fromNameAndUniqueId("Bob", Optional.of(bobId));
        Profile bobRenamed = factory.fromNameAndUniqueId("Bob2", Optional.of(bobId));
        Profile jane = factory.fromNameAndUniqueId("Jane", Optional.of(UUID.randomUUID()));
        Profile janeWithoutId = factory.fromDisplayText("jane");
        Profile everyone = factory.fromDisplayText(everyoneTag);

        assertTrue(bob.includes(bobRenamed), "Same id");
        assertTrue(bobRenamed.includes(bob), "Same id");
        assertFalse(jane.includes(janeWithoutId), "Known id, not present in other");
        assertTrue(janeWithoutId.includes(jane), "Unknown id, same name");
        assertFalse(bob.includes(jane), "Different id and name");
        assertFalse(bob.includes(janeWithoutId), "Different id and name");

        // Everyone includes everyone, but is never included
        assertTrue(everyone.includes(bob));
        assertTrue(everyone.includes(jane));
        assertTrue(everyone.includes(janeWithoutId));
        assertFalse(bob.includes(everyone));
        assertFalse(jane.includes(everyone));
        assertFalse(janeWithoutId.includes(everyone));
    }

    @Test
    public void testNameAndId() {
        String name = "test";
        UUID uuid = UUID.randomUUID();
        ProfileFactory factory = getProfileFactory();
        Profile profile = factory.fromNameAndUniqueId(name, Optional.of(uuid));

        // Test object properties
        assertEquals(name, profile.getDisplayName());
        assertEquals(uuid, ((PlayerProfile) profile).getUniqueId().get());
    }

    @Test
    public void testNameAndIdJson() {
        String name = "test";
        UUID uuid = UUID.randomUUID();
        ProfileFactory factory = getProfileFactory();
        Profile profile = factory.fromNameAndUniqueId(name, Optional.of(uuid));
        JsonSecretSignEntry object = new JsonSecretSignEntry(new JsonObject());
        profile.getSaveObject(object);

        assertEquals(name, object.getString(PlayerProfileImpl.NAME_KEY).get());
        assertEquals(uuid, object.getUniqueId(PlayerProfileImpl.UUID_KEY).get());
    }

    @Test
    public void testPlayerProfileRoundtrip() {
        String name = "test";
        UUID uuid = UUID.randomUUID();
        ProfileFactoryImpl factory = getProfileFactory();
        Profile profile = factory.fromNameAndUniqueId(name, Optional.of(uuid));

        testRoundtrip(factory, profile);
    }

    private void testRoundtrip(ProfileFactoryImpl factory, Profile profile) {
        JsonSecretSignEntry object = new JsonSecretSignEntry(new JsonObject());
        profile.getSaveObject(object);
        Profile newProfile = factory.fromSavedObject(object).get();
        assertEquals(profile, newProfile);
    }

    @Test
    public void testWithoutId() {
        String name = "test";
        ProfileFactoryImpl factory = getProfileFactory();
        Profile profile = factory.fromDisplayText(name);

        assertEquals(name, profile.getDisplayName());
        assertFalse(((PlayerProfile) profile).getUniqueId().isPresent());
    }

    @Test
    public void testWithoutIdJson() {
        String name = "test";
        ProfileFactoryImpl factory = getProfileFactory();
        Profile profile = factory.fromDisplayText(name);
        JsonSecretSignEntry object = new JsonSecretSignEntry(new JsonObject());
        profile.getSaveObject(object);

        assertEquals(name, object.getString(PlayerProfileImpl.NAME_KEY).get());
        assertFalse(object.getUniqueId(PlayerProfileImpl.UUID_KEY).isPresent());
    }
}


text:
package mars.tools;

import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.MouseInfo;
import java.awt.PointerInfo;
import java.awt.RenderingHints;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.font.FontRenderContext;
import java.awt.font.TextLayout;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Vector;

import javax.imageio.ImageIO;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.Timer;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;

import mars.Globals;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;

class UnitAnimation extends JPanel
    implements ActionListener {
    /**
     *
     */
    private static final long serialVersionUID = -2681757800180958534L;

//config variables
    private int PERIOD = 8;    // velocity of frames in ms
    private static final int PWIDTH = 1000;     // size of this panel
    private static final int PHEIGHT = 574;
    private GraphicsConfiguration gc;
    private GraphicsDevice gd;   	// for reporting accl. memory usage
    private int accelMemory;
    private DecimalFormat df;

    private int counter;			//verify then remove.
    private boolean justStarted; 	//flag to start movement

    private int indexX;	//counter of screen position
    private int indexY;
    private boolean xIsMoving, yIsMoving; 		//flag for mouse movement.

// private Vertex[][] inputGraph;
    private Vector<Vector<Vertex>>  outputGraph;
    private ArrayList<Vertex> vertexList;
    private ArrayList<Vertex> vertexTraversed;
//Screen Label variables

    private HashMap<String, String> registerEquivalenceTable;

    private String instructionCode;

    private int countRegLabel;
    private int countALULabel;
    private int countPCLabel;

    private int register = 1;
    private int control = 2;
    private int aluControl = 3;
    private int alu = 4;
    private int datapatTypeUsed;

    private Boolean cursorInIM, cursorInALU, cursorInDataMem, cursorInReg;

    private Graphics2D g2d;

    private BufferedImage datapath;

    class Vertex {
        private int numIndex;
        private int init;
        private int end;
        private int current;
        private String name;
        public static final int movingUpside = 1;
        public static final int movingDownside = 2;
        public static final int movingLeft = 3;
        public static final int movingRight = 4;
        public int direction;
        public int oppositeAxis;
        private boolean isMovingXaxis;
        private Color color;
        private boolean first_interaction;
        private boolean active;
        private boolean isText;
        private ArrayList<Integer> targetVertex;

        public Vertex(int index, int init, int end, String name, int oppositeAxis, boolean isMovingXaxis,
                      String listOfColors, String listTargetVertex, boolean isText) {
            this.numIndex = index;
            this.init = init;
            this.current = this.init;
            this.end = end;
            this.name = name;
            this.oppositeAxis = oppositeAxis;
            this.isMovingXaxis = isMovingXaxis;
            this.first_interaction = true;
            this.active = false;
            this.isText = isText;
            this.color = new Color(0,153,0);
            if(isMovingXaxis == true) {
                if( init < end)
                    direction = movingLeft;
                else
                    direction = movingRight;

            } else {
                if( init < end)
                    direction = movingUpside;
                else
                    direction = movingDownside;
            }
            String[] list =  listTargetVertex.split("#");
            targetVertex = new ArrayList<Integer>();
            for(int i = 0; i < list.length; i++) {
                targetVertex.add(Integer.parseInt(list[i]));
                //	System.out.println("Adding " + i + " " +  Integer.parseInt(list[i])+ " in target");
            }
            String[] listColor =  listOfColors.split("#");
            this.color = new Color(Integer.parseInt(listColor[0]) , Integer.parseInt(listColor[1]),  Integer.parseInt(listColor[2]) );
        }

        public int getDirection() {
            return direction;
        }

        public boolean isText() {
            return this.isText;
        }

        public ArrayList<Integer> getTargetVertex() {
            return targetVertex;
        }

        public int getNumIndex() {
            return numIndex;
        }
        public void setNumIndex(int numIndex) {
            this.numIndex = numIndex;
        }
        public int getInit() {
            return init;
        }
        public void setInit(int init) {
            this.init = init;
        }
        public int getEnd() {
            return end;
        }
        public void setEnd(int end) {
            this.end = end;
        }
        public int getCurrent() {
            return current;
        }
        public void setCurrent(int current) {
            this.current = current;
        }
        public String getName() {
            return name;
        }
        public void setName(String name) {
            this.name = name;
        }
        public int getOppositeAxis() {
            return oppositeAxis;
        }
        public void setOppositeAxis(int oppositeAxis) {
            this.oppositeAxis = oppositeAxis;
        }
        public boolean isMovingXaxis() {
            return isMovingXaxis;
        }
        public void setMovingXaxis(boolean isMovingXaxis) {
            this.isMovingXaxis = isMovingXaxis;
        }
        public Color getColor() {
            return color;
        }
        public void setColor(Color color) {
            this.color = color;
        }
        public boolean isFirst_interaction() {
            return first_interaction;
        }
        public void setFirst_interaction(boolean first_interaction) {
            this.first_interaction = first_interaction;
        }
        public boolean isActive() {
            return active;
        }
        public void setActive(boolean active) {
            this.active = active;
        }
    }

    public UnitAnimation(String instructionBinary, int datapathType) {
        datapatTypeUsed = datapathType;
        cursorInIM = false;
        cursorInALU = false;
        cursorInDataMem = false;
        df = new DecimalFormat("0.0");  // 1 dp
        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
        gd = ge.getDefaultScreenDevice();
        gc = ge.getDefaultScreenDevice().getDefaultConfiguration();

        accelMemory = gd.getAvailableAcceleratedMemory();  // in bytes
        setBackground(Color.white);
        setPreferredSize( new Dimension(PWIDTH, PHEIGHT) );

        // load and initialise the images
        initImages();

        vertexList = new ArrayList<Vertex>();
        counter = 0;
        justStarted = true;
        instructionCode = instructionBinary;

        //declaration of labels definition.
        registerEquivalenceTable = new  HashMap<String, String>();

        countRegLabel = 400;
        countALULabel = 380;
        countPCLabel = 380;
        loadHashMapValues();

    } // end of ImagesTests()

//set the binnary opcode value of the basic instructions of MIPS instruction set
    public void loadHashMapValues() {
        if(datapatTypeUsed == register) {
            importXmlStringData("/registerDatapath.xml", registerEquivalenceTable, "register_equivalence",  "bits", "mnemonic");
            importXmlDatapathMap("/registerDatapath.xml", "datapath_map");
        } else if(datapatTypeUsed == control) {
            importXmlStringData("/controlDatapath.xml", registerEquivalenceTable, "register_equivalence",  "bits", "mnemonic");
            importXmlDatapathMap("/controlDatapath.xml", "datapath_map");
        }

        else if(datapatTypeUsed == aluControl) {
            importXmlStringData("/ALUcontrolDatapath.xml", registerEquivalenceTable, "register_equivalence",  "bits", "mnemonic");
            importXmlDatapathMapAluControl("/ALUcontrolDatapath.xml", "datapath_map");
        }
    }

//import the list of opcodes of mips set of instructions
    public void importXmlStringData(String xmlName, HashMap table, String elementTree, String tagId, String tagData) {
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        dbf.setNamespaceAware(false);
        DocumentBuilder docBuilder;
        try {
            //System.out.println();
            docBuilder = dbf.newDocumentBuilder();
            Document doc = docBuilder.parse(getClass().getResource(xmlName).toString());
            Element root = doc.getDocumentElement();
            Element equivalenceItem;
            NodeList bitsList,  mnemonic;
            NodeList equivalenceList = root.getElementsByTagName(elementTree);
            for(int i = 0; i < equivalenceList.getLength(); i++) {
                equivalenceItem =  (Element)equivalenceList.item(i);
                bitsList = equivalenceItem.getElementsByTagName(tagId);
                mnemonic = equivalenceItem.getElementsByTagName(tagData);
                for(int j= 0; j < bitsList.getLength(); j++) {
                    table.put(bitsList.item(j).getTextContent(),mnemonic.item(j).getTextContent());
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

//import the parameters of the animation on datapath
    public void importXmlDatapathMap(String xmlName, String elementTree) {
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        dbf.setNamespaceAware(false);
        DocumentBuilder docBuilder;
        try {
            docBuilder = dbf.newDocumentBuilder();
            Document doc = docBuilder.parse(getClass().getResource(xmlName).toString());
            Element root = doc.getDocumentElement();
            Element datapath_mapItem;
            NodeList index_vertex,  name, init, end,color, other_axis, isMovingXaxis, targetVertex, sourceVertex, isText ;
            NodeList datapath_mapList = root.getElementsByTagName(elementTree);
            for(int i = 0; i < datapath_mapList.getLength(); i++) { //extract the vertex of the xml input and encapsulate into the vertex object
                datapath_mapItem =  (Element)datapath_mapList.item(i);
                index_vertex = datapath_mapItem.getElementsByTagName("num_vertex");
                name = datapath_mapItem.getElementsByTagName("name");
                init = datapath_mapItem.getElementsByTagName("init");
                end = datapath_mapItem.getElementsByTagName("end");
                //definition of colors line

                if(instructionCode.substring(0,6).equals("000000")) { //R-type instructions
                    color = datapath_mapItem.getElementsByTagName("color_Rtype");
                    //System.out.println("rtype");
                } else if(instructionCode.substring(0,6).matches("00001[0-1]")) { //J-type instructions
                    color = datapath_mapItem.getElementsByTagName("color_Jtype");
                    //System.out.println("jtype");
                } else if(instructionCode.substring(0,6).matches("100[0-1][0-1][0-1]")) { //LOAD type instructions
                    color = datapath_mapItem.getElementsByTagName("color_LOADtype");
                    //System.out.println("load type");
                } else if(instructionCode.substring(0,6).matches("101[0-1][0-1][0-1]")) { //LOAD type instructions
                    color = datapath_mapItem.getElementsByTagName("color_STOREtype");
                    //System.out.println("store type");
                } else if(instructionCode.substring(0,6).matches("0001[0-1][0-1]")) { //BRANCH type instructions
                    color = datapath_mapItem.getElementsByTagName("color_BRANCHtype");
                    //System.out.println("branch type");
                } else { //BRANCH type instructions
                    color = datapath_mapItem.getElementsByTagName("color_Itype");
                    //System.out.println("immediate type");
                }

                other_axis = datapath_mapItem.getElementsByTagName("other_axis");
                isMovingXaxis = datapath_mapItem.getElementsByTagName("isMovingXaxis");
                targetVertex = datapath_mapItem.getElementsByTagName("target_vertex");
                isText = datapath_mapItem.getElementsByTagName("is_text");

                for(int j= 0; j < index_vertex.getLength(); j++) {
                    Vertex vert = new Vertex(Integer.parseInt(index_vertex.item(j).getTextContent()), Integer.parseInt(init.item(j).getTextContent()),
                                             Integer.parseInt(end.item(j).getTextContent()), name.item(j).getTextContent(), Integer.parseInt(other_axis.item(j).getTextContent()),
                                             Boolean.parseBoolean(isMovingXaxis.item(j).getTextContent()), color.item(j).getTextContent(), targetVertex.item(j).getTextContent(), Boolean.parseBoolean(isText.item(j).getTextContent()));
                    vertexList.add(vert);
                }
            }
            //loading matrix of control of vertex.
            outputGraph = new Vector<Vector<Vertex>>();
            vertexTraversed = new ArrayList<Vertex>();
            int size = vertexList.size();
            Vertex vertex;
            ArrayList<Integer> targetList;
            for(int i = 0; i < vertexList.size(); i++) {
                vertex = vertexList.get(i);
                targetList = vertex.getTargetVertex();
                Vector<Vertex> vertexOfTargets = new Vector<Vertex>();
                for(int k = 0; k < targetList.size(); k++) {
                    vertexOfTargets.add(vertexList.get(targetList.get(k)));
                }
                outputGraph.add(vertexOfTargets);
            }
            for(int i=0; i< outputGraph.size(); i++) {
                Vector<Vertex> vert = outputGraph.get(i);
            }

            vertexList.get(0).setActive(true);
            vertexTraversed.add(vertexList.get(0));
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

    public void importXmlDatapathMapAluControl(String xmlName, String elementTree) {
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        dbf.setNamespaceAware(false);
        DocumentBuilder docBuilder;
        try {
            docBuilder = dbf.newDocumentBuilder();
            Document doc = docBuilder.parse(getClass().getResource(xmlName).toString());
            Element root = doc.getDocumentElement();
            Element datapath_mapItem;
            NodeList index_vertex,  name, init, end,color, other_axis, isMovingXaxis, targetVertex, sourceVertex, isText ;
            NodeList datapath_mapList = root.getElementsByTagName(elementTree);
            for(int i = 0; i < datapath_mapList.getLength(); i++) { //extract the vertex of the xml input and encapsulate into the vertex object
                datapath_mapItem =  (Element)datapath_mapList.item(i);
                index_vertex = datapath_mapItem.getElementsByTagName("num_vertex");
                name = datapath_mapItem.getElementsByTagName("name");
                init = datapath_mapItem.getElementsByTagName("init");
                end = datapath_mapItem.getElementsByTagName("end");
                //definition of colors line

                if(instructionCode.substring(0,6).equals("000000")) { //R-type instructions
                    if(instructionCode.substring(28,32).matches("0000")) { //BRANCH type instructions
                        color = datapath_mapItem.getElementsByTagName("ALU_out010");
                        System.out.println("ALU_out010 type " + instructionCode.substring(28,32));
                    } else if(instructionCode.substring(28,32).matches("0010")) { //BRANCH type instructions
                        color = datapath_mapItem.getElementsByTagName("ALU_out110");
                        System.out.println("ALU_out110 type " + instructionCode.substring(28,32));
                    } else if(instructionCode.substring(28,32).matches("0100")) { //BRANCH type instructions
                        color = datapath_mapItem.getElementsByTagName("ALU_out000");
                        System.out.println("ALU_out000 type " + instructionCode.substring(28,32));
                    } else if(instructionCode.substring(28,32).matches("0101")) { //BRANCH type instructions
                        color = datapath_mapItem.getElementsByTagName("ALU_out001");
                        System.out.println("ALU_out001 type " + instructionCode.substring(28,32));
                    } else { //BRANCH type instructions
                        color = datapath_mapItem.getElementsByTagName("ALU_out111");
                        System.out.println("ALU_out111 type " + instructionCode.substring(28,32));
                    }
                } else if(instructionCode.substring(0,6).matches("00001[0-1]")) { //J-type instructions
                    color = datapath_mapItem.getElementsByTagName("color_Jtype");
                    System.out.println("jtype");
                } else if(instructionCode.substring(0,6).matches("100[0-1][0-1][0-1]")) { //LOAD type instructions
                    color = datapath_mapItem.getElementsByTagName("color_LOADtype");
                    System.out.println("load type");
                } else if(instructionCode.substring(0,6).matches("101[0-1][0-1][0-1]")) { //LOAD type instructions
                    color = datapath_mapItem.getElementsByTagName("color_STOREtype");
                    System.out.println("store type");
                } else if(instructionCode.substring(0,6).matches("0001[0-1][0-1]")) { //BRANCH type instructions
                    color = datapath_mapItem.getElementsByTagName("color_BRANCHtype");
                    System.out.println("branch type");
                } else {
                    color = datapath_mapItem.getElementsByTagName("color_Itype");
                    System.out.println("immediate type");
                }

                other_axis = datapath_mapItem.getElementsByTagName("other_axis");
                isMovingXaxis = datapath_mapItem.getElementsByTagName("isMovingXaxis");
                targetVertex = datapath_mapItem.getElementsByTagName("target_vertex");
                isText = datapath_mapItem.getElementsByTagName("is_text");

                for(int j= 0; j < index_vertex.getLength(); j++) {
                    Vertex vert = new Vertex(Integer.parseInt(index_vertex.item(j).getTextContent()), Integer.parseInt(init.item(j).getTextContent()),
                                             Integer.parseInt(end.item(j).getTextContent()), name.item(j).getTextContent(), Integer.parseInt(other_axis.item(j).getTextContent()),
                                             Boolean.parseBoolean(isMovingXaxis.item(j).getTextContent()), color.item(j).getTextContent(), targetVertex.item(j).getTextContent(), Boolean.parseBoolean(isText.item(j).getTextContent()));
                    vertexList.add(vert);
                }
            }
            //loading matrix of control of vertex.
            outputGraph = new Vector<Vector<Vertex>>();
            vertexTraversed = new ArrayList<Vertex>();
            int size = vertexList.size();
            Vertex vertex;
            ArrayList<Integer> targetList;
            for(int i = 0; i < vertexList.size(); i++) {
                vertex = vertexList.get(i);
                targetList = vertex.getTargetVertex();
                Vector<Vertex> vertexOfTargets = new Vector<Vertex>();
                for(int k = 0; k < targetList.size(); k++) {
                    vertexOfTargets.add(vertexList.get(targetList.get(k)));
                }
                outputGraph.add(vertexOfTargets);
            }
            for(int i=0; i< outputGraph.size(); i++) {
                Vector<Vertex> vert = outputGraph.get(i);
            }

            vertexList.get(0).setActive(true);
            vertexTraversed.add(vertexList.get(0));
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

//set the initial state of the variables that controls the animation, and start the timer that triggers the animation.
    public void startAnimation(String codeInstruction) {
        instructionCode = codeInstruction;
        new Timer(PERIOD, this).start();    // start timer
        this.repaint();
    }

//initialize the image of datapath.
    private void initImages() {
        try {
            BufferedImage im;
            if(datapatTypeUsed == register) {
                im =  ImageIO.read(
                          getClass().getResource(Globals.imagesPath+"register.png") );
            } else if(datapatTypeUsed == control) {
                im =  ImageIO.read(
                          getClass().getResource(Globals.imagesPath+"control.png") );
            } else if(datapatTypeUsed == aluControl) {
                im =  ImageIO.read(
                          getClass().getResource(Globals.imagesPath+"ALUcontrol.png") );
            } else {
                im =  ImageIO.read(
                          getClass().getResource(Globals.imagesPath+"alu.png") );
            }

            int transparency = im.getColorModel().getTransparency();
            datapath =  gc.createCompatibleImage(
                            im.getWidth(), im.getHeight(),
                            transparency );
            g2d = datapath.createGraphics();
            g2d.drawImage(im,0,0,null);
            g2d.dispose();
        } catch(IOException e) {
            System.out.println("Load Image error for " +
                               getClass().getResource(Globals.imagesPath+"register.png") + ":\n" + e);
        }
    }

    public void updateDisplay() {
        this.repaint();
    }

    public void actionPerformed(ActionEvent e)
// triggered by the timer: update, repaint
    {
        if (justStarted)
            justStarted = false;
        if(xIsMoving)
            indexX++;
        if(yIsMoving)
            indexY--;
        repaint();
    }

    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        g2d = (Graphics2D)g;
        // use antialiasing
        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                             RenderingHints.VALUE_ANTIALIAS_ON);
        // smoother (and slower) image transformations  (e.g. for resizing)
        g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
                             RenderingHints.VALUE_INTERPOLATION_BILINEAR);
        g2d = (Graphics2D)g;
        drawImage(g2d, datapath, 0,0,null);
        executeAnimation(g);
        counter = (counter + 1)% 100;
        g2d.dispose();

    }

    private void drawImage(Graphics2D g2d, BufferedImage im, int x, int y,Color c) {
        if (im == null) {
            g2d.setColor(c);
            g2d.fillOval(x, y, 20, 20);
            g2d.setColor(Color.black);
            g2d.drawString("   ", x, y);
        } else
            g2d.drawImage(im, x, y, this);
    }

//draw lines.
//method to draw the lines that run from left to right.
    public void printTrackLtoR(Vertex v) {
        int size;
        int[] track;
        size = v.getEnd() - v.getInit();
        track =  new int[size];
        for(int i = 0; i < size; i++)
            track[i] = v.getInit()+i;
        if(v.isActive() == true) {
            v.setFirst_interaction(false);
            for(int i = 0; i < size; i++) {
                if(track[i] <= v.getCurrent()) {
                    g2d.setColor(v.getColor());
                    g2d.fillRect(track[i], v.getOppositeAxis(), 3, 3);
                }
            }
            if (v.getCurrent() == track[size-1])
                v.setActive(false);
            v.setCurrent(v.getCurrent()+1);
        } else if(v.isFirst_interaction() == false) {
            for(int i = 0; i < size ; i++) {
                g2d.setColor(v.getColor());
                g2d.fillRect(track[i],v.getOppositeAxis(),  3, 3);
            }
        }

    }

//method to draw the lines that run from right to left.
//public boolean printTrackRtoL(int init, int end ,int currentIndex, Graphics2D g2d, Color color, int otherAxis,
//		 boolean active, boolean firstInteraction){
    public void printTrackRtoL(Vertex v) {
        int size;
        int[] track;
        size = v.getInit() - v.getEnd();
        track =  new int[size];

        for(int i = 0; i < size; i++)
            track[i] = v.getInit()-i;

        if(v.isActive() == true) {
            v.setFirst_interaction(false);
            for(int i = 0; i < size; i++) {
                if(track[i] >= v.getCurrent()) {
                    g2d.setColor(v.getColor());
                    g2d.fillRect(track[i], v.getOppositeAxis(), 3, 3);
                }
            }
            if (v.getCurrent() == track[size-1])
                v.setActive(false);

            v.setCurrent(v.getCurrent()-1);
        } else if(v.isFirst_interaction() == false) {
            for(int i = 0; i < size ; i++) {
                g2d.setColor(v.getColor());
                g2d.fillRect(track[i],v.getOppositeAxis(),  3, 3);
            }
        }
    }

//method to draw the lines that run from down to top.
// public boolean printTrackDtoU(int init, int end ,int currentIndex, Graphics2D g2d, Color color, int otherAxis,
//		 boolean active, boolean firstInteraction){
    public void printTrackDtoU(Vertex v) {
        int size;
        int[] track;

        if(v.getInit() > v.getEnd()) {
            size = v.getInit() - v.getEnd();
            track =  new int[size];
            for(int i = 0; i < size; i++)
                track[i] = v.getInit()-i;
        } else {
            size = v.getEnd() - v.getInit();
            track =  new int[size];
            for(int i = 0; i < size; i++)
                track[i] = v.getInit()+i;
        }

        if(v.isActive() == true) {
            v.setFirst_interaction(false);
            for(int i = 0; i < size; i++) {
                if(track[i] >= v.getCurrent()) {
                    g2d.setColor(v.getColor());
                    g2d.fillRect(v.getOppositeAxis(), track[i], 3, 3);
                }
            }
            if (v.getCurrent() == track[size-1])
                v.setActive(false);
            v.setCurrent(v.getCurrent()-1);

        } else if(v.isFirst_interaction() == false) {
            for(int i = 0; i < size; i++) {
                g2d.setColor(v.getColor());
                g2d.fillRect(v.getOppositeAxis(), track[i], 3, 3);
            }
        }
    }
//method to draw the lines that run from top to down.
// public boolean printTrackUtoD(int init, int end ,int currentIndex, Graphics2D g2d, Color color, int otherAxis,
//		 boolean active,  boolean firstInteraction){
    public void printTrackUtoD(Vertex v) {

        int size;
        int[] track;
        size = v.getEnd() - v.getInit();
        track =  new int[size];

        for(int i = 0; i < size; i++)
            track[i] = v.getInit()+i;

        if(v.isActive() == true) {
            v.setFirst_interaction(false);
            for(int i = 0; i < size; i++) {
                if(track[i] <= v.getCurrent()) {
                    g2d.setColor(v.getColor());
                    g2d.fillRect(v.getOppositeAxis(), track[i], 3, 3);
                }

            }
            if (v.getCurrent() == track[size-1])
                v.setActive(false);
            v.setCurrent(v.getCurrent()+1);
        } else if(v.isFirst_interaction() == false) {
            for(int i = 0; i < size; i++) {
                g2d.setColor(v.getColor());
                g2d.fillRect(v.getOppositeAxis(), track[i], 3, 3);
            }
        }
    }

//convert binnary value to integer.
    public String parseBinToInt(String code) {
        int value = 0;

        for(int i =code.length()-1; i >= 0; i--) {
            if("1".equals(code.substring(i,i+1))) {
                value = value + (int)Math.pow(2,code.length()-i-1);
            }
        }

        return Integer.toString(value);
    }

//set and execute the information about the current position of each line of information in the animation,
//verifies the previous status of the animation and increment the position of each line that interconnect the unit function.
    private void executeAnimation(Graphics g) {
        g2d = (Graphics2D)g;
        Vertex vert;
        for(int i = 0; i < vertexTraversed.size(); i++) {
            vert = vertexTraversed.get(i);
            if(vert.isMovingXaxis == true) {
                if(vert.getDirection() == vert.movingLeft) {
                    printTrackLtoR(vert);
                    if(vert.isActive() == false) {
                        int j = vert.getTargetVertex().size();
                        Vertex tempVertex;
                        for(int k = 0; k < j; k++) {
                            tempVertex = outputGraph.get(vert.getNumIndex()).get(k);
                            Boolean hasThisVertex = false;
                            for(int m = 0 ; m < vertexTraversed.size(); m++) {
                                if(tempVertex.getNumIndex() == vertexTraversed.get(m).getNumIndex())
                                    hasThisVertex = true;
                            }
                            if(hasThisVertex == false) {
                                outputGraph.get(vert.getNumIndex()).get(k).setActive(true);
                                vertexTraversed.add( outputGraph.get(vert.getNumIndex()).get(k));
                            }
                        }
                    }
                } else {
                    printTrackRtoL(vert);
                    if(vert.isActive() == false) {
                        int j = vert.getTargetVertex().size();
                        Vertex tempVertex;
                        for(int k = 0; k < j; k++) {
                            tempVertex = outputGraph.get(vert.getNumIndex()).get(k);
                            Boolean hasThisVertex = false;
                            for(int m = 0 ; m < vertexTraversed.size(); m++) {
                                if(tempVertex.getNumIndex() == vertexTraversed.get(m).getNumIndex())
                                    hasThisVertex = true;
                            }
                            if(hasThisVertex == false) {
                                outputGraph.get(vert.getNumIndex()).get(k).setActive(true);
                                vertexTraversed.add( outputGraph.get(vert.getNumIndex()).get(k));
                            }
                        }
                    }
                }
            } //end of condition of X axis
            else {
                if(vert.getDirection() == vert.movingDownside) {
                    if(vert.isText == true)
                        ;
                    else
                        printTrackDtoU(vert);

                    if(vert.isActive() == false) {
                        int j = vert.getTargetVertex().size();
                        Vertex tempVertex;
                        for(int k = 0; k < j; k++) {
                            tempVertex = outputGraph.get(vert.getNumIndex()).get(k);
                            Boolean hasThisVertex = false;
                            for(int m = 0 ; m < vertexTraversed.size(); m++) {
                                if(tempVertex.getNumIndex() == vertexTraversed.get(m).getNumIndex())
                                    hasThisVertex = true;
                            }
                            if(hasThisVertex == false) {
                                outputGraph.get(vert.getNumIndex()).get(k).setActive(true);
                                vertexTraversed.add( outputGraph.get(vert.getNumIndex()).get(k));
                            }
                        }
                    }

                } else {
                    printTrackUtoD(vert);
                    if(vert.isActive() == false) {
                        int j = vert.getTargetVertex().size();
                        Vertex tempVertex;
                        for(int k = 0; k < j; k++) {
                            tempVertex = outputGraph.get(vert.getNumIndex()).get(k);
                            Boolean hasThisVertex = false;
                            for(int m = 0 ; m < vertexTraversed.size(); m++) {
                                if(tempVertex.getNumIndex() == vertexTraversed.get(m).getNumIndex())
                                    hasThisVertex = true;
                            }
                            if(hasThisVertex == false) {
                                outputGraph.get(vert.getNumIndex()).get(k).setActive(true);
                                vertexTraversed.add( outputGraph.get(vert.getNumIndex()).get(k));
                            }
                        }
                    }
                }
            }
        }
    }

}

redpajama_set_name: RedPajamaGithub


text:
from __future__ import unicode_literals

from django.apps import AppConfig

class RadiusUserConfig(AppConfig):
    name = 'radiusUser'
    verbose_name = 'Radius用户管理系统'


text:
<?php
namespace Cheetahmail\Campaigns\ImageHosting;

class UpdateResponse
{

    /**
     * @var boolean $UpdateResult
     */
    protected $UpdateResult = null;

    /**
     * @param boolean $UpdateResult
     */
    public function __construct($UpdateResult)
    {
        $this->UpdateResult = $UpdateResult;
    }

    /**
     * @return boolean
     */
    public function getUpdateResult()
    {
        return $this->UpdateResult;
    }

    /**
     * @param boolean $UpdateResult
     * @return \Cheetahmail\Campaigns\ImageHosting\UpdateResponse
     */
    public function setUpdateResult($UpdateResult)
    {
        $this->UpdateResult = $UpdateResult;
        return $this;
    }
}


text:
""" This module runs toposub

Example:
      as import:

Attributes:$gridpath $samples $file1 $targV

Todo:

"""
path2script = "./rsrc/toposub_post_1.R"

# main
def main(gridpath, samples, file1, targV):
    """Main entry point for the script."""
    run_rscript_fileout(path2script,[gridpath, samples, file1, targV])

# functions
def run_rscript_stdout(path2script , args):
    """ Function to define comands to run an Rscript. Returns an object. """
    import subprocess
    command = 'Rscript'
    cmd     = [command, path2script] + args
    print("Running:" + str(cmd))
    x = subprocess.check_output(cmd, universal_newlines=True)
    return(x)

def run_rscript_fileout(path2script , args):
    """ Function to define comands to run an Rscript. Outputs a file. """
    import subprocess
    command = 'Rscript'
    cmd     = [command, path2script] + args
    print("Running:" + str(cmd))
    subprocess.check_output(cmd)

# calling main
if __name__ == '__main__':
    import sys
    gridpath           = sys.argv[1]
    samples         = sys.argv[2]
    file1   = sys.argv[3]
    targV   = sys.argv[4]
    main(gridpath, samples, file1, targV)


text:
Facebook comment template

Accessible from

SFTP & Develop Mode: /ModuleTemplates/SocialMedia/FacebookComments/Default/container.html

Renders these tags

            {tag_colorscheme}	Social plug-in color scheme

            {tag_locale}	Current locale

            {tag_posts}	Number of the posts to show by default

            {tag_url}	URL for Comments social plug-in

            {tag_width}	Width for Facebook Comments in pixels


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.
 */
package org.flowable.editor.language.xml;

import static org.junit.Assert.assertEquals;

import java.io.ByteArrayInputStream;
import java.io.InputStream;

import org.flowable.bpmn.BpmnAutoLayout;
import org.flowable.bpmn.converter.BpmnXMLConverter;
import org.flowable.bpmn.model.BpmnModel;
import org.flowable.engine.common.api.io.InputStreamProvider;
import org.junit.Test;

/**
 * @author Vasile Dirla
 */
public class ProcessWithCompensationConverterTest {

  @Test
  public void testConvertingAfterAutoLayout() {

    final InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ProcessWithCompensationAssociation.bpmn20.xml");

    BpmnXMLConverter bpmnXMLConverter = new BpmnXMLConverter();

    BpmnModel bpmnModel1 = bpmnXMLConverter.convertToBpmnModel(new InputStreamProvider() {

      @Override
      public InputStream getInputStream() {
        return inputStream;
      }
    }, false, false);

    if (bpmnModel1.getLocationMap().size() == 0) {
      BpmnAutoLayout bpmnLayout = new BpmnAutoLayout(bpmnModel1);
      bpmnLayout.execute();
    }

    byte[] xmlByte = bpmnXMLConverter.convertToXML(bpmnModel1);
    final InputStream byteArrayInputStream = new ByteArrayInputStream(xmlByte);

    BpmnModel bpmnModel2 = bpmnXMLConverter.convertToBpmnModel(new InputStreamProvider() {

      @Override
      public InputStream getInputStream() {
        return byteArrayInputStream;
      }
    }, false, false);

    assertEquals(10, bpmnModel1.getLocationMap().size());
    assertEquals(10, bpmnModel2.getLocationMap().size());

    assertEquals(7, bpmnModel1.getFlowLocationMap().size());
    assertEquals(7, bpmnModel2.getFlowLocationMap().size());
  }

}


text:
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using MatterHackers.Agg.UI;
using MatterHackers.GuiAutomation;
using MatterHackers.MatterControl.PrinterCommunication;
using MatterHackers.MatterControl.PrinterCommunication.Io;
using MatterHackers.MatterControl.PrintHistory;
using MatterHackers.MatterControl.SlicerConfiguration;
using MatterHackers.PrinterEmulator;
using MatterHackers.VectorMath;
using NUnit.Framework;

namespace MatterHackers.MatterControl.Tests.Automation
{
	[TestFixture, Category("MatterControl.UI.Automation"), RunInApplicationDomain, Apartment(ApartmentState.STA)]
	public class PrintingTests
	{
		[Test, Category("Emulator")]
		public async Task CompletingPrintTurnsoffHeat()
		{
			await MatterControlUtilities.RunTest((testRunner) =>
			{
				testRunner.WaitForName("Cancel Wizard Button", 1);

				using (var emulator = testRunner.LaunchAndConnectToPrinterEmulator())
				{
					Assert.AreEqual(1, ApplicationController.Instance.ActivePrinters.Count(), "One printer should be defined after add");

					testRunner.SelectSliceSettingsField(PrinterSettings.Layout.Printer, "end_gcode");

					testRunner.Type("^a");
					testRunner.Type("{BACKSPACE}");
					testRunner.Type("G28");

					testRunner.SelectSliceSettingsField(PrinterSettings.Layout.Printer, "start_gcode");

					var printer = testRunner.FirstPrinter();

					// Validate GCode fields persist values
					Assert.AreEqual(
						"G28",
						printer.Settings.GetValue(SettingsKey.end_gcode),
						"Failure persisting GCode/MultilineTextField value");

					testRunner.AddItemToBedplate();

					// Shorten the delay so the test runs in a reasonable time
					printer.Connection.TimeToHoldTemperature = 5;

					testRunner.StartPrint(printer);

					// Wait for print to finish
					testRunner.WaitForPrintFinished(printer);

					// Wait for expected temp
					testRunner.WaitFor(() => printer.Connection.GetActualHotendTemperature(0) <= 0, 10);
					Assert.Less(printer.Connection.GetActualHotendTemperature(0), 30);

					// Wait for expected temp
					testRunner.WaitFor(() => printer.Connection.ActualBedTemperature <= 10);
					Assert.Less(printer.Connection.ActualBedTemperature, 10);

					// Make sure we can run this whole thing again
					testRunner.StartPrint(printer);

					// Wait for print to finish
					testRunner.WaitForPrintFinished(printer);

					// Wait for expected temp
					testRunner.WaitFor(() => printer.Connection.GetActualHotendTemperature(0) <= 0, 10);
					Assert.Less(printer.Connection.GetActualHotendTemperature(0), 30);

					// Wait for expected temp
					testRunner.WaitFor(() => printer.Connection.ActualBedTemperature <= 10);
					Assert.Less(printer.Connection.ActualBedTemperature, 10);
				}

				return Task.CompletedTask;
			}, maxTimeToRun: 95);
		}

		[Test, Category("Emulator")]
		public async Task PulseLevelingTest()
		{
			// Validates the Pulse profile requires leveling and it works as expected
			await MatterControlUtilities.RunTest((testRunner) =>
			{
				AutomationRunner.TimeToMoveMouse = .2;
				testRunner.WaitForName("Cancel Wizard Button", 1);

				using (var emulator = testRunner.LaunchAndConnectToPrinterEmulator("Pulse", "A-134"))
				{
					Assert.AreEqual(1, ApplicationController.Instance.ActivePrinters.Count(), "One printer should be defined after add");

					testRunner.OpenPrintPopupMenu()
						.ClickByName("SetupPrinter")
						.Complete9StepLeveling()
						.AddItemToBedplate();

					var printer = testRunner.FirstPrinter();

					var currentSettings = printer.Settings;
					currentSettings.SetValue(SettingsKey.pause_gcode, "");
					currentSettings.SetValue(SettingsKey.resume_gcode, "");

					testRunner.StartPrint(printer, pauseAtLayers: "2");

					testRunner.WaitForName("Yes Button", 20); // the yes button is 'Resume'

					// the user types in the pause layer 1 based and we are 0 based, so we should be on: user 2, printer 1.
					Assert.AreEqual(1, printer.Connection.CurrentlyPrintingLayer);

					// assert the leveling is working
					Assert.AreEqual(11.25, emulator.Destination.Z);

					testRunner.CancelPrint();

					// now run leveling again and make sure we get the same result
					testRunner.SwitchToControlsTab();
					testRunner.ClickByName("Printer Calibration Button");

					testRunner.ClickByName("Print Leveling Row");

					testRunner.Complete9StepLeveling(2);

					testRunner.StartPrint(printer, pauseAtLayers: "2");

					testRunner.WaitForName("Yes Button", 20); // the yes button is 'Resume'

					// the user types in the pause layer 1 based and we are 0 based, so we should be on: user 2, printer 1.
					Assert.AreEqual(1, printer.Connection.CurrentlyPrintingLayer);
					// assert the leveling is working
					Assert.AreEqual(12.25, emulator.Destination.Z);

					testRunner.CancelPrint();

					// now modify the leveling data manually and assert that it is applied when printing
					testRunner.SwitchToControlsTab();

					testRunner.ClickByName("Printer Calibration Button");

					testRunner.ClickByName("Edit Leveling Data Button");
					for (int i = 0; i < 3; i++)
					{
						var name = $"z Position {i}";
						testRunner.ClickByName(name);
						testRunner.Type("^a"); // select all
						testRunner.Type("5");
					}

					testRunner.ClickByName("Save Leveling Button");

					testRunner.ClickByName("Cancel Wizard Button");

					testRunner.StartPrint(printer, pauseAtLayers: "2");

					testRunner.WaitForName("Yes Button", 20); // the yes button is 'Resume'

					// the user types in the pause layer 1 based and we are 0 based, so we should be on: user 2, printer 1.
					Assert.AreEqual(1, printer.Connection.CurrentlyPrintingLayer);

					// assert the leveling is working
					Assert.AreEqual(5.25, emulator.Destination.Z);
				}

				return Task.CompletedTask;
			}, maxTimeToRun: 130);
		}

		[Test, Category("Emulator")]
		public void ExpectedEmulatorResponses()
		{
			// TODO: Emulator behavior should emulate actual printer firmware and use configuration rather than M104/M109 sends to set extruder count
			//
			// Quirky emulator returns single extruder M105 responses until after the first M104, at which point it extends its extruder count to match
			string M105ResponseBeforeM104 = "ok T:27.0 / 0.0";
			string M105ResponseAfterM104 = "ok T0:27.0 / 0.0 T1:27.0 / 0.0";

			string[] test1 = new string[]
			{
				"N1 M110 N1 * 125",
				"ok",
				"N2 M114 * 37",
				"X:0.00 Y: 0.00 Z: 0.00 E: 0.00 Count X: 0.00 Y: 0.00 Z: 0.00",
				"ok",
				"N3 M105 * 36",
				M105ResponseBeforeM104,
				"N1 M110 N1*125",
				"ok",
				"N2 M115 * 36",
				"MatterControl Printer Emulator",
				"Commands:",
				"    SLOW // make the emulator simulate actual printing speeds (default)",
				"    FAST // run as fast as possible",
				"Emulating:",
				"FIRMWARE_NAME:Marlin V1; Sprinter/grbl mashup for gen6 FIRMWARE_URL:https://github.com/MarlinFirmware/Marlin PROTOCOL_VERSION:1.0 MACHINE_TYPE:Framelis v1 EXTRUDER_COUNT:1 UUID:155f84b5-d4d7-46f4-9432-667e6876f37a",
				"ok",
				"N3 M104 T0 S0 * 34",
				"ok",
				"N4 M104 T1 S0 * 36",
				"ok",
				"N5 M105 * 34",
				M105ResponseAfterM104,
				"N6 M105 * 45",
				"Error:checksum mismatch, Last Line: 5",
				"Resend: 6",
				"ok",
				"N6 M105 * 33",
				M105ResponseAfterM104,
				"N7 M105 * 32",
				M105ResponseAfterM104,
				"N8 M105 * 47",
				M105ResponseAfterM104,
				"N9 M105 * 46",
				M105ResponseAfterM104,
				"N10 M105 * 22",
				M105ResponseAfterM104,
				"N11 M105 * 23",
				M105ResponseAfterM104,
				"N12 M105 * 20",
				M105ResponseAfterM104,
				"N13 M105 * 21",
				M105ResponseAfterM104,
				"N14 M105 * 18",
				M105ResponseAfterM104,
				"N15 M105 * 19",
				M105ResponseAfterM104,
				"N16 M105 * 16",
				M105ResponseAfterM104,
				"N17 M105 * 40",
				"Error:checksum mismatch, Last Line: 16",
				"Resend: 17",
				"ok",
				"N17 M105 * 17",
				M105ResponseAfterM104,
			};

			string[] test2 = new string[]
			{
				"N1 M110 N1*125",
				"ok",
				"N1 M110 N1*125",
				"ok",
				"N1 M110 N1*125",
				"ok",
				"N2 M114*37",
				"X:0.00 Y: 0.00 Z: 0.00 E: 0.00 Count X: 0.00 Y: 0.00 Z: 0.00",
				"ok",
			};

			SimulatePrint(test1);
			SimulatePrint(test2);
		}

		private static void SimulatePrint(string[] sendRecieveLog)
		{
			using (var emulator = new Emulator())
			{
				emulator.HasHeatedBed = false;

				int lineIndex = 0;
				while (lineIndex < sendRecieveLog.Length)
				{
					var sentCommand = sendRecieveLog[lineIndex];
					string response = emulator.GetCorrectResponse(sentCommand);
					lineIndex++;
					var lines = response.Split('\n');
					for (int i = 0; i < lines.Length; i++)
					{
						if (!string.IsNullOrEmpty(lines[i]))
						{
							Assert.AreEqual(sendRecieveLog[lineIndex], lines[i]);
							lineIndex++;
						}
					}
				}
			}
		}

		[Test, Category("Emulator")]
		public async Task PrinterRequestsResumeWorkingAsExpected()
		{
			await MatterControlUtilities.RunTest((testRunner) =>
			{
				using (var emulator = testRunner.LaunchAndConnectToPrinterEmulator())
				{
					Assert.AreEqual(1, ApplicationController.Instance.ActivePrinters.Count(), "One printer should be defined after add");

					// print a part
					testRunner.AddItemToBedplate();

					testRunner.StartPrint(testRunner.FirstPrinter(), pauseAtLayers: "2;6");

					// turn on line error simulation
					emulator.SimulateLineErrors = true;

					// close the pause dialog pop-up (resume)
					testRunner.WaitForName("Yes Button", 20); // the yes button is 'Resume'
					testRunner.ClickByName("Yes Button");

					// simulate board reboot
					emulator.SimulateReboot();

					// close the pause dialog pop-up (resume)
					testRunner.Delay(3);
					testRunner.WaitForName("Yes Button", 20);
					testRunner.ClickByName("Yes Button");

					// Wait for done
					testRunner.WaitForPrintFinished(testRunner.FirstPrinter());
				}

				return Task.CompletedTask;
			}, maxTimeToRun: 90);
		}

		[Test, Category("Emulator")]
		public async Task PrinterDeletedWhilePrinting()
		{
			await MatterControlUtilities.RunTest((testRunner) =>
			{
				using (var emulator = testRunner.LaunchAndConnectToPrinterEmulator())
				{
					Assert.AreEqual(1, ApplicationController.Instance.ActivePrinters.Count(), "One printer should exist after add");

					var printer = testRunner.FirstPrinter();

					// print a part
					testRunner.AddItemToBedplate();
					testRunner.StartPrint(printer, pauseAtLayers: "2");
					ProfileManager.DebugPrinterDelete = true;

					// Wait for pause dialog
					testRunner.ClickResumeButton(printer, true, 1);

					// Wait for done
					testRunner.WaitForPrintFinished(printer);
				}

				return Task.CompletedTask;
			}, maxTimeToRun: 180);
		}

		[Test, Category("Emulator")]
		public async Task PrinterRecoveryTest()
		{
			await MatterControlUtilities.RunTest((testRunner) =>
			{
				using (var emulator = testRunner.LaunchAndConnectToPrinterEmulator())
				{
					Assert.AreEqual(1, ApplicationController.Instance.ActivePrinters.Count(), "One printer should exist after add");

					var printer = testRunner.FirstPrinter();
					printer.Settings.SetValue(SettingsKey.recover_is_enabled, "1");
					printer.Settings.SetValue(SettingsKey.has_hardware_leveling, "0");

					Assert.IsTrue(printer.Connection.RecoveryIsEnabled);

					// print a part
					testRunner.AddItemToBedplate()
						.StartPrint(printer, pauseAtLayers: "2;4;6")
						.ClickResumeButton(printer, true, 1) // Resume
						.ClickResumeButton(printer, false, 3) // close the pause dialog pop-up do not resume
						.ClickByName("Disconnect from printer button")
						.ClickByName("Connect to printer button") // Reconnect
						.WaitFor(() => printer.Connection.CommunicationState == CommunicationStates.Connected);

					// Assert that recovery happens
					Assert.IsTrue(PrintRecovery.RecoveryAvailable(printer), "Recovery should be enabled after Disconnect while printing");

					// Recover the print
					testRunner.ClickButton("Yes Button", "Recover Print")
						.ClickResumeButton(printer, true, 5) // The first pause that we get after recovery should be layer 6.
						.WaitForPrintFinished(printer);
				}

				return Task.CompletedTask;
			}, maxTimeToRun: 180);
		}

		[Test, Category("Emulator")]
		public async Task RecoveryT1NoProbe()
		{
			await ExtruderT1RecoveryTest("Airwolf 3D", "HD");
		}

		[Test, Category("Emulator")]
		public async Task RecoveryT1WithProbe()
		{
			await ExtruderT1RecoveryTest("Pulse", "S-500");
		}

		public async Task ExtruderT1RecoveryTest(string make, string model)
		{
			await MatterControlUtilities.RunTest((testRunner) =>
			{
				using (var emulator = testRunner.LaunchAndConnectToPrinterEmulator(make, model))
				{
					Assert.AreEqual(1, ApplicationController.Instance.ActivePrinters.Count(), "One printer should exist after add");

					var printer = testRunner.FirstPrinter();
					testRunner.ChangeSettings(
						new (string, string)[]
						{
							(SettingsKey.recover_is_enabled, "1"),
							(SettingsKey.extruder_count, "2"),
							(SettingsKey.has_hardware_leveling, "0"),
						}, printer);

					Assert.IsTrue(printer.Connection.RecoveryIsEnabled);

					// print a part
					testRunner.AddItemToBedplate()
						.ClickByName("ItemMaterialButton")
						.ClickByName("Material 2 Button")
						.StartPrint(printer, pauseAtLayers: "2;3;4;5");

					testRunner.ClickResumeButton(printer, true, 1); // Resume
																	// make sure we are printing with extruder 2 (T1)
					Assert.AreEqual(0, printer.Connection.GetTargetHotendTemperature(0));
					Assert.Greater(printer.Connection.GetTargetHotendTemperature(1), 0);

					testRunner.ClickResumeButton(printer, false, 2) // close the pause dialog pop-up do not resume
						.ClickByName("Disconnect from printer button")
						.ClickByName("Connect to printer button") // Reconnect
						.WaitFor(() => printer.Connection.CommunicationState == CommunicationStates.Connected);

					// Assert that recovery happens
					Assert.IsTrue(PrintRecovery.RecoveryAvailable(printer), "Recovery should be enabled after Disconnect while printing");

					// Recover the print
					testRunner.ClickButton("Yes Button", "Recover Print");

					// The first pause that we get after recovery should be layer 4 (index 3).
					testRunner.ClickResumeButton(printer, true, 3);
					// make sure we are printing with extruder 2 (T1)
					Assert.AreEqual(0, printer.Connection.GetTargetHotendTemperature(0));
					Assert.Greater(printer.Connection.GetTargetHotendTemperature(1), 0);

					testRunner.ClickResumeButton(printer, true, 4);

					testRunner.WaitForPrintFinished(printer);
				}

				return Task.CompletedTask;
			}, maxTimeToRun: 180);
		}

		[Test, Category("Emulator")]
		public async Task TuningAdjustmentsDefaultToOneAndPersists()
		{
			double targetExtrusionRate = 1.5;
			double targetFeedRate = 2;

			await MatterControlUtilities.RunTest((testRunner) =>
			{
				testRunner.WaitForName("Cancel Wizard Button");

				using (var emulator = testRunner.LaunchAndConnectToPrinterEmulator())
				{
					Assert.AreEqual(1, ApplicationController.Instance.ActivePrinters.Count(), "One printer should be defined after add");

					testRunner.AddItemToBedplate();

					testRunner.SwitchToControlsTab();

					var printer = testRunner.FirstPrinter();

					// Wait for printing to complete
					var printFinishedResetEvent = new AutoResetEvent(false);
					printer.Connection.PrintFinished += (s, e) =>
					{
						printFinishedResetEvent.Set();
					};

					testRunner.StartPrint(printer)
						.ScrollIntoView("Extrusion Multiplier NumberEdit")
						.ScrollIntoView("Feed Rate NumberEdit");

					// Tuning values should default to 1 when missing
					ConfirmExpectedSpeeds(testRunner, 1, 1, "Initial case");

					testRunner.Delay()
						.ClickByName("Extrusion Multiplier NumberEdit")
						.Type(targetExtrusionRate.ToString())
						.ClickByName("Feed Rate NumberEdit")
						.Type(targetFeedRate.ToString())
						// Force focus away from the feed rate field, causing an persisted update
						.ClickByName("Extrusion Multiplier NumberEdit");

					ConfirmExpectedSpeeds(testRunner, targetExtrusionRate, targetFeedRate, "After setting TextEdit values");

					// Wait for slicing to complete before setting target values
					testRunner.WaitFor(() => printer.Connection.DetailedPrintingState == DetailedPrintingState.Printing, 8);
					testRunner.Delay();

					ConfirmExpectedSpeeds(testRunner, targetExtrusionRate, targetFeedRate, "While printing");

					// Wait up to 60 seconds for the print to finish
					printFinishedResetEvent.WaitOne(60 * 1000);

					// Values should match entered values
					ConfirmExpectedSpeeds(testRunner, targetExtrusionRate, targetFeedRate, "After print finished");

					testRunner.WaitForPrintFinished(printer)
						.StartPrint(printer) // Restart the print
						.Delay(1);

					// Values should match entered values
					ConfirmExpectedSpeeds(testRunner, targetExtrusionRate, targetFeedRate, "After print restarted");

					testRunner.CancelPrint()
						.Delay(1);

					// Values should match entered values
					ConfirmExpectedSpeeds(testRunner, targetExtrusionRate, targetFeedRate, "After canceled print");
				}

				return Task.CompletedTask;
			}, overrideHeight: 900, maxTimeToRun: 120);
		}

		[Test, Category("Emulator")]
		public async Task TuningAdjustmentControlsBoundToStreamValues()
		{
			double targetExtrusionRate = 1.5;
			double targetFeedRate = 2;

			double initialExtrusionRate = 0.6;
			double initialFeedRate = 0.7;

			await MatterControlUtilities.RunTest((testRunner) =>
			{
				testRunner.WaitForName("Cancel Wizard Button");

				// Then validate that they are picked up
				using (var emulator = testRunner.LaunchAndConnectToPrinterEmulator())
				{
					Assert.AreEqual(1, ApplicationController.Instance.ActivePrinters.Count(), "One printer should be defined after add");

					testRunner.AddItemToBedplate();

					testRunner.SwitchToControlsTab();

					var printer = testRunner.FirstPrinter();

					// Set custom adjustment values
					printer.Settings.SetValue(SettingsKey.feedrate_ratio, initialFeedRate.ToString());
					printer.Settings.SetValue(SettingsKey.extrusion_ratio, initialExtrusionRate.ToString());

					var printFinishedResetEvent = new AutoResetEvent(false);
					printer.Connection.PrintFinished += (s, e) => printFinishedResetEvent.Set();

					testRunner.StartPrint(printer);

					var container = testRunner.GetWidgetByName("ManualPrinterControls.ControlsContainer", out _, 5);

					// Scroll the widget into view
					var scrollable = container.Parents<ManualPrinterControls>().FirstOrDefault() as ScrollableWidget;
					var width = scrollable.Width;

					// Workaround needed to scroll to the bottom of the Controls panel
					// scrollable.ScrollPosition = new Vector2();
					scrollable.ScrollPosition = new Vector2(0, 30);

					// Workaround to force layout to fix problems with size of Tuning Widgets after setting ScrollPosition manually
					scrollable.Width = width - 1;
					scrollable.Width = width;

					// Tuning values should match
					ConfirmExpectedSpeeds(testRunner, initialExtrusionRate, initialFeedRate, "Initial case");

					testRunner.Delay();
					testRunner.ClickByName("Extrusion Multiplier NumberEdit");
					testRunner.Type(targetExtrusionRate.ToString());

					testRunner.ClickByName("Feed Rate NumberEdit");
					testRunner.Type(targetFeedRate.ToString());

					// Force focus away from the feed rate field, causing an persisted update
					testRunner.ClickByName("Extrusion Multiplier NumberEdit");

					ConfirmExpectedSpeeds(testRunner, targetExtrusionRate, targetFeedRate, "After setting TextEdit values");

					// Wait for slicing to complete before setting target values
					testRunner.WaitFor(() => printer.Connection.DetailedPrintingState == DetailedPrintingState.Printing, 8);
					testRunner.Delay();

					// Values should remain after print completes
					ConfirmExpectedSpeeds(testRunner, targetExtrusionRate, targetFeedRate, "While printing");

					// Wait for printing to complete
					printFinishedResetEvent.WaitOne();

					testRunner.WaitForPrintFinished(printer);

					// Values should match entered values
					testRunner.StartPrint(printer);
					testRunner.WaitFor(() => printer.Connection.CommunicationState == CommunicationStates.Printing, 15);

					// Values should match entered values
					ConfirmExpectedSpeeds(testRunner, targetExtrusionRate, targetFeedRate, "While reprinting");

					testRunner.CancelPrint();
					testRunner.WaitFor(() => printer.Connection.CommunicationState == CommunicationStates.Connected, 15);

					// Values should match entered values
					ConfirmExpectedSpeeds(testRunner, targetExtrusionRate, targetFeedRate, "After cancel");
				}

				return Task.CompletedTask;
			}, overrideHeight: 900, maxTimeToRun: 120);
		}

		[Test, Category("Emulator")]
		public async Task CloseShouldNotStopSDPrint()
		{
			await MatterControlUtilities.RunTest((testRunner) =>
			{
				testRunner.WaitForName("Cancel Wizard Button");

				using (var emulator = testRunner.LaunchAndConnectToPrinterEmulator(runSlow: true))
				{
					testRunner.NavigateToFolder("SD Card Row Item Collection");

					testRunner.ClickByName("Row Item Item 1.gcode");

					testRunner.ClickByName("Print Library Overflow Menu");
					testRunner.ClickByName("Print Menu Item");

					testRunner.Delay(2);

					int tempChangedCount = 0;
					int fanChangedCount = 0;
					emulator.ExtruderTemperatureChanged += (s, e) =>
					{
						tempChangedCount++;
					};
					emulator.FanSpeedChanged += (s, e) =>
					{
						fanChangedCount++;
					};

					testRunner.CloseMatterControl();

					testRunner.ClickByName("Yes Button");

					testRunner.Delay(2);
					Assert.AreEqual(0, tempChangedCount, "We should not change this while exiting an sd card print.");
					Assert.AreEqual(0, fanChangedCount, "We should not change this while exiting an sd card print.");
				}

				return Task.CompletedTask;
			}, maxTimeToRun: 90);
		}

		[Test, Category("Emulator")]
		public async Task CancelingPrintTurnsHeatAndFanOff()
		{
			await MatterControlUtilities.RunTest((testRunner) =>
			{
				testRunner.WaitForName("Cancel Wizard Button");

				using (var emulator = testRunner.LaunchAndConnectToPrinterEmulator())
				{
					var resetEvent = new AutoResetEvent(false);

					Assert.AreEqual(1, ApplicationController.Instance.ActivePrinters.Count(), "One printer should exist after add");

					testRunner.AddItemToBedplate();

					var printer = testRunner.FirstPrinter();

					testRunner.StartPrint(printer);

					int fanChangedCount = 0;
					emulator.FanSpeedChanged += (s, e) =>
					{
						fanChangedCount++;
					};

					emulator.WaitForLayer(printer.Settings, 2);
					emulator.RunSlow = true;

					// Click close but cancel
					testRunner.CloseMatterControl();
					testRunner.ClickByName("No Button");

					// Wait for close
					testRunner.WaitForWidgetDisappear("Yes Button", 4);
					testRunner.Delay(2);

					// Confirm abort
					Assert.IsFalse(AppContext.RootSystemWindow.HasBeenClosed, "Canceling Close dialog should *not* close MatterControl");

					// Close MatterControl and cancel print
					testRunner.CloseMatterControl();
					testRunner.ClickByName("Yes Button");

					// Wait for Disconnected CommunicationState which occurs after PrinterConnection.Disable()
					testRunner.WaitForCommunicationStateDisconnected(printer, maxSeconds: 30);

					// Wait for close
					testRunner.WaitForWidgetDisappear("Yes Button", 4);
					testRunner.Delay(2);

					// Confirm close
					Assert.IsTrue(AppContext.RootSystemWindow.HasBeenClosed, "Confirming Close dialog *should* close MatterControl");

					// Wait for M106 change
					testRunner.WaitFor(() => fanChangedCount > 0, 15, 500);

					// Assert expected temp targets and fan transitions
					Assert.AreEqual(0, (int) emulator.CurrentExtruder.TargetTemperature, "Unexpected target temperature - MC close should call Connection.Disable->TurnOffBedAndExtruders to shutdown heaters");
					Assert.AreEqual(0, (int) emulator.HeatedBed.TargetTemperature, "Unexpected target temperature - MC close should call Connection.Disable->TurnOffBedAndExtruders to shutdown heaters");
					Assert.AreEqual(1, fanChangedCount, "Unexpected fan speed change count - MC close should call Connection.Disable which shuts down fans via M106");
				}

				return Task.CompletedTask;
			}, overrideHeight: 900, maxTimeToRun: 90);
		}

		private static void ConfirmExpectedSpeeds(AutomationRunner testRunner, double targetExtrusionRate, double targetFeedRate, string scope)
		{
			SolidSlider slider;

			// Assert the UI has the expected values
			slider = testRunner.GetWidgetByName("Extrusion Multiplier Slider", out _) as SolidSlider;
			testRunner.WaitFor(() => targetExtrusionRate == slider.Value);

			Assert.AreEqual(targetExtrusionRate, slider.Value, $"Unexpected Extrusion Rate Slider Value - {scope}");

			slider = testRunner.GetWidgetByName("Feed Rate Slider", out _) as SolidSlider;
			testRunner.WaitFor(() => targetFeedRate == slider.Value);
			Assert.AreEqual(targetFeedRate, slider.Value, $"Unexpected Feed Rate Slider Value - {scope}");

			var printer = testRunner.FirstPrinter();

			// Assert the changes took effect on the model
			testRunner.WaitFor(() => targetExtrusionRate == printer.Connection.ExtrusionMultiplierStream.ExtrusionRatio);
			Assert.AreEqual(targetExtrusionRate, printer.Connection.ExtrusionMultiplierStream.ExtrusionRatio, $"Unexpected Extrusion Rate - {scope}");

			testRunner.WaitFor(() => targetFeedRate == printer.Connection.FeedRateMultiplierStream.FeedRateRatio);
			Assert.AreEqual(targetFeedRate, printer.Connection.FeedRateMultiplierStream.FeedRateRatio, $"Unexpected Feed Rate - {scope}");
		}
	}
}


text:
You call the Command using `/packmode newMode` with `newMode` being the name of the new packMode

## Usage

You use the command to set your game's packmode.
Please note that you will need to restart your game in order for the changes to occur!


text:
@interface ZJModelTool : NSObject
+(void)createModelWithDictionary:(NSDictionary *)dict modelName:(NSString *)modelName;
@end


text:
var langs = ['es', 'eus'];
var langCode = 'automatic';			//Write the default Value from langs into it
var langJS = null;

var translate = function (jsdata)
{
	$("[tkey]").each (function (index)
	{
		var strTr = jsdata [$(this).attr ('tkey')];
	    $(this).html (strTr);
	});
}

if(langCode == 'automatic'){
	langCode = navigator.language.substr (0, 2);
}

if ($.inArray( langCode, langs ) >= 0){
	$.getJSON('lang/'+langCode+'.json', translate);
}


text:
<?php

namespace Base\BledvoyageBundle\DataFixtures\ORM;

use Doctrine\Common\DataFixtures\FixtureInterface;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Base\BledvoyageBundle\Entity\Picture;

class PictureData extends AbstractFixture implements FixtureInterface, ContainerAwareInterface, OrderedFixtureInterface
{
    private $container;

    public function setContainer(ContainerInterface $container = null)
    {
        $this->container = $container;
    }

    public function load(ObjectManager $manager)
    {
        $picture1 = new Picture();
        $picture1->setAlt('quad.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture1);

        $picture2 = new Picture();
        $picture2->setAlt('quad.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture2);

        $picture3 = new Picture();
        $picture3->setAlt('quad_couv.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture3);

        $picture4 = new Picture();
        $picture4->setAlt('quad_couv.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture4);

        $picture5 = new Picture();
        $picture5->setAlt('cerf_volant.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture5);

        $picture6 = new Picture();
        $picture6->setAlt('cerf_volant.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture6);

        $picture7 = new Picture();
        $picture7->setAlt('cerf_volant_cover.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture7);

        $picture8 = new Picture();
        $picture8->setAlt('cerf_volant_cover.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture8);

        $picture9 = new Picture();
        $picture9->setAlt('cover_balade_sous.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture9);

        $picture10 = new Picture();
        $picture10->setAlt('sortie_aventure_sous.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture10);

        $picture11 = new Picture();
        $picture11->setAlt('sortie_aventure_sous.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture11);

        $picture12 = new Picture();
        $picture12->setAlt('sortie_sousmarine_balade_cover.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture12);

        $picture13 = new Picture();
        $picture13->setAlt('decolage.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture13);

        $picture14 = new Picture();
        $picture14->setAlt('decolage_cover.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture14);

        $picture15 = new Picture();
        $picture15->setAlt('decolage.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture15);

        $picture16 = new Picture();
        $picture16->setAlt('decolage_cover.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture16);

        $picture17 = new Picture();
        $picture17->setAlt('ico_vtt.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture17);

        $picture18 = new Picture();
        $picture18->setAlt('randonnee_vtt.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture18);

        $picture19 = new Picture();
        $picture19->setAlt('randonee_vtt_cover.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture19);

        $picture20 = new Picture();
        $picture20->setAlt('randonee_vtt_cover.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture20);

        $picture21 = new Picture();
        $picture21->setAlt('forma_1.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture21);

        $picture22 = new Picture();
        $picture22->setAlt('forma_1.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture22);

        $picture23 = new Picture();
        $picture23->setAlt('forma_2.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture23);

        $picture24 = new Picture();
        $picture24->setAlt('forma_2.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture24);

        $picture25 = new Picture();
        $picture25->setAlt('quad.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture25);

        $picture26 = new Picture();
        $picture26->setAlt('quad.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture26);

        $picture27 = new Picture();
        $picture27->setAlt('quad_couv.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture27);

        $picture28 = new Picture();
        $picture28->setAlt('quad_couv.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture28);

        $picture29 = new Picture();
        $picture29->setAlt('cerf_volant.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture29);

        $picture30 = new Picture();
        $picture30->setAlt('cerf_volant.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture30);

        $picture31 = new Picture();
        $picture31->setAlt('cerf_volant_cover.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture31);

        $picture32 = new Picture();
        $picture32->setAlt('cerf_volant_cover.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture32);

        $picture33 = new Picture();
        $picture33->setAlt('cover_balade_sous.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture33);

        $picture34 = new Picture();
        $picture34->setAlt('sortie_aventure_sous.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture34);

        $picture35 = new Picture();
        $picture35->setAlt('sortie_aventure_sous.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture35);

        $picture36 = new Picture();
        $picture36->setAlt('sortie_aventure_sous.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture36);

        $picture37 = new Picture();
        $picture37->setAlt('sortie_sousmarine_balade_cover.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture37);

        $picture38 = new Picture();
        $picture38->setAlt('decolage.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture38);

        $picture39 = new Picture();
        $picture39->setAlt('decolage_cover.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture39);

        $picture40 = new Picture();
        $picture40->setAlt('decolage.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture40);

        $picture41 = new Picture();
        $picture41->setAlt('decolage_cover.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture41);

        $picture42 = new Picture();
        $picture42->setAlt('ico_vtt.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture42);

        $picture43 = new Picture();
        $picture43->setAlt('randonnee_vtt.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture43);

        $picture44 = new Picture();
        $picture44->setAlt('randonee_vtt_cover.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture44);

        $picture45 = new Picture();
        $picture45->setAlt('randonee_vtt_cover.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture45);

        $picture46 = new Picture();
        $picture46->setAlt('forma_1.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture46);

        $picture47 = new Picture();
        $picture47->setAlt('forma_1.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture47);

        $picture48 = new Picture();
        $picture48->setAlt('forma_2.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture48);

        $picture49 = new Picture();
        $picture49->setAlt('forma_2.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture49);

        $picture50 = new Picture();
        $picture50->setAlt('quad.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture50);

        $picture51 = new Picture();
        $picture51->setAlt('quad.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture51);

        $picture52 = new Picture();
        $picture52->setAlt('quad_couv.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture52);

        $picture53 = new Picture();
        $picture53->setAlt('quad_couv.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture53);

        $picture54 = new Picture();
        $picture54->setAlt('cerf_volant.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture54);

        $picture55 = new Picture();
        $picture55->setAlt('cerf_volant.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture55);

        $picture56 = new Picture();
        $picture56->setAlt('cerf_volant_cover.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture56);

        $picture57 = new Picture();
        $picture57->setAlt('cerf_volant_cover.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture57);

        $picture58 = new Picture();
        $picture58->setAlt('cover_balade_sous.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture58);

        $picture59 = new Picture();
        $picture59->setAlt('sortie_aventure_sous.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture59);

        $picture60 = new Picture();
        $picture60->setAlt('sortie_aventure_sous.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture60);

        $picture61 = new Picture();
        $picture61->setAlt('quad.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture61);

        $picture62 = new Picture();
        $picture62->setAlt('quad_couv.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture62);

        $picture63 = new Picture();
        $picture63->setAlt('quad_couv.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture63);

        $picture64 = new Picture();
        $picture64->setAlt('cerf_volant.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture64);

        $picture65 = new Picture();
        $picture65->setAlt('cerf_volant.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture65);

        $picture66 = new Picture();
        $picture66->setAlt('cerf_volant_cover.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture66);

        $picture67 = new Picture();
        $picture67->setAlt('cerf_volant_cover.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture67);

        $picture68 = new Picture();
        $picture68->setAlt('cover_balade_sous.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture68);

        $picture69 = new Picture();
        $picture69->setAlt('sortie_aventure_sous.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture69);

        $picture70 = new Picture();
        $picture70->setAlt('sortie_aventure_sous.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture70);

        $picture71 = new Picture();
        $picture71->setAlt('quand_sensation.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture71);

        $picture72 = new Picture();
        $picture72->setAlt('quad_sensation_couv.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture72);

        $picture73 = new Picture();
        $picture73->setAlt('quand_sensation.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture73);

        $picture74 = new Picture();
        $picture74->setAlt('quad_sensation_couv.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture74);

        $picture75 = new Picture();
        $picture75->setAlt('quand_sensation.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture75);

        $picture76 = new Picture();
        $picture76->setAlt('quad_sensation_couv.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture76);

        $picture77 = new Picture();
        $picture77->setAlt('quand_sensation.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture77);

        $picture78 = new Picture();
        $picture78->setAlt('quad_sensation_couv.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture78);

        $picture79 = new Picture();
        $picture79->setAlt('jetski_discovery.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture79);

        $picture80 = new Picture();
        $picture80->setAlt('jetski_discovery_cover.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture80);

        $picture81 = new Picture();
        $picture81->setAlt('jetski_discovery.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture81);

        $picture82 = new Picture();
        $picture82->setAlt('jetski_discovery_cover.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture82);

        $picture83 = new Picture();
        $picture83->setAlt('jetski_ride.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture83);

        $picture84 = new Picture();
        $picture84->setAlt('jetski_ride_couv.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture84);

        $picture85 = new Picture();
        $picture85->setAlt('jetski_ride.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture85);

        $picture86 = new Picture();
        $picture86->setAlt('jetski_ride_couv.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture86);

        $picture87 = new Picture();
        $picture87->setAlt('jetski_sensation.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture87);

        $picture88 = new Picture();
        $picture88->setAlt('jetski_sensation_couv.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture88);

        $picture89 = new Picture();
        $picture89->setAlt('jetski_sensation.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture89);

        $picture90 = new Picture();
        $picture90->setAlt('jetski_sensation_couv.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture90);

        $picture91 = new Picture();
        $picture91->setAlt('jetski_trip.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture91);

        $picture92 = new Picture();
        $picture92->setAlt('jetski_trip_couv.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture92);

        $picture93 = new Picture();
        $picture93->setAlt('jetski_trip.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture93);

        $picture94 = new Picture();
        $picture94->setAlt('jetski_trip_couv.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture94);

        $picture95 = new Picture();
        $picture95->setAlt('jetski_evasion.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture95);

        $picture96 = new Picture();
        $picture96->setAlt('jetski_evasion_couv.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture96);

        $picture97 = new Picture();
        $picture97->setAlt('jetski_evasion.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture97);

        $picture98 = new Picture();
        $picture98->setAlt('jetski_evasion_couv.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture98);

        $picture99 = new Picture();
        $picture99->setAlt('bouee_sensation_vit.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture99);

        $picture100 = new Picture();
        $picture100->setAlt('bouee_aout.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture100);

        $picture101 = new Picture();
        $picture101->setAlt('bouee_tentation.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture101);

        $picture102 = new Picture();
        $picture102->setAlt('bouee_sensation_vit.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture102);

        $picture103 = new Picture();
        $picture103->setAlt('quad_trip.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture103);

        $picture104 = new Picture();
        $picture104->setAlt('quad_trip_couv.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture104);

        $picture105 = new Picture();
        $picture105->setAlt('quad_trip.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture105);

        $picture106 = new Picture();
        $picture106->setAlt('quad_trip_couv.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture106);

        $picture107 = new Picture();
        $picture107->setAlt('quad_trip_afterwork.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture107);

        $picture108 = new Picture();
        $picture108->setAlt('sortie_afterwork_couv.jpg')
                 ->setUrl('jpg');
        $manager->persist($picture108);

        $picture109 = new Picture();
        $picture109->setAlt('quad_trip_afterwork.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture109);

        $picture110 = new Picture();
        $picture110->setAlt('sortie_afterwork_couv.jpg')
                  ->setUrl('jpg');
        $manager->persist($picture110);

        $manager->flush();

        $this->addReference('picture1',   $picture1);
        $this->addReference('picture2',   $picture2);
        $this->addReference('picture3',   $picture3);
        $this->addReference('picture4',   $picture4);
        $this->addReference('picture5',   $picture5);
        $this->addReference('picture6',   $picture6);
        $this->addReference('picture7',   $picture7);
        $this->addReference('picture8',   $picture8);
        $this->addReference('picture9',   $picture9);
        $this->addReference('picture10',  $picture10);
        $this->addReference('picture11',  $picture11);
        $this->addReference('picture12',  $picture12);
        $this->addReference('picture13',  $picture13);
        $this->addReference('picture14',  $picture14);
        $this->addReference('picture15',  $picture15);
        $this->addReference('picture16',  $picture16);
        $this->addReference('picture17',  $picture17);
        $this->addReference('picture18',  $picture18);
        $this->addReference('picture19',  $picture19);
        $this->addReference('picture20',  $picture20);
        $this->addReference('picture21',  $picture21);
        $this->addReference('picture22',  $picture22);
        $this->addReference('picture23',  $picture23);
        $this->addReference('picture24',  $picture24);
        $this->addReference('picture25',  $picture25);
        $this->addReference('picture26',  $picture26);
        $this->addReference('picture27',  $picture27);
        $this->addReference('picture28',  $picture28);
        $this->addReference('picture29',  $picture29);
        $this->addReference('picture30',  $picture30);
        $this->addReference('picture31',  $picture31);
        $this->addReference('picture32',  $picture32);
        $this->addReference('picture33',  $picture33);
        $this->addReference('picture34',  $picture34);
        $this->addReference('picture35',  $picture35);
        $this->addReference('picture36',  $picture36);
        $this->addReference('picture37',  $picture37);
        $this->addReference('picture38',  $picture38);
        $this->addReference('picture39',  $picture39);
        $this->addReference('picture40',  $picture40);
        $this->addReference('picture41',  $picture41);
        $this->addReference('picture42',  $picture42);
        $this->addReference('picture43',  $picture43);
        $this->addReference('picture44',  $picture44);
        $this->addReference('picture45',  $picture45);
        $this->addReference('picture46',  $picture46);
        $this->addReference('picture47',  $picture47);
        $this->addReference('picture48',  $picture48);
        $this->addReference('picture49',  $picture49);
        $this->addReference('picture50',  $picture50);
        $this->addReference('picture51',  $picture51);
        $this->addReference('picture52',  $picture52);
        $this->addReference('picture53',  $picture53);
        $this->addReference('picture54',  $picture54);
        $this->addReference('picture55',  $picture55);
        $this->addReference('picture56',  $picture56);
        $this->addReference('picture57',  $picture57);
        $this->addReference('picture58',  $picture58);
        $this->addReference('picture59',  $picture59);
        $this->addReference('picture60',  $picture60);
        $this->addReference('picture61',  $picture61);
        $this->addReference('picture62',  $picture62);
        $this->addReference('picture63',  $picture63);
        $this->addReference('picture64',  $picture64);
        $this->addReference('picture65',  $picture65);
        $this->addReference('picture66',  $picture66);
        $this->addReference('picture67',  $picture67);
        $this->addReference('picture68',  $picture68);
        $this->addReference('picture69',  $picture69);
        $this->addReference('picture70',  $picture70);
        $this->addReference('picture71',  $picture71);
        $this->addReference('picture72',  $picture72);
        $this->addReference('picture73',  $picture73);
        $this->addReference('picture74',  $picture74);
        $this->addReference('picture75',  $picture75);
        $this->addReference('picture76',  $picture76);
        $this->addReference('picture77',  $picture77);
        $this->addReference('picture78',  $picture78);
        $this->addReference('picture79',  $picture39);
        $this->addReference('picture80',  $picture80);
        $this->addReference('picture81',  $picture81);
        $this->addReference('picture82',  $picture82);
        $this->addReference('picture83',  $picture83);
        $this->addReference('picture84',  $picture84);
        $this->addReference('picture85',  $picture85);
        $this->addReference('picture86',  $picture86);
        $this->addReference('picture87',  $picture87);
        $this->addReference('picture88',  $picture88);
        $this->addReference('picture89',  $picture89);
        $this->addReference('picture90',  $picture90);
        $this->addReference('picture91',  $picture91);
        $this->addReference('picture92',  $picture92);
        $this->addReference('picture93',  $picture93);
        $this->addReference('picture94',  $picture94);
        $this->addReference('picture95',  $picture95);
        $this->addReference('picture96',  $picture96);
        $this->addReference('picture97',  $picture97);
        $this->addReference('picture98',  $picture98);
        $this->addReference('picture99',  $picture99);
        $this->addReference('picture100', $picture100);
        $this->addReference('picture101', $picture101);
        $this->addReference('picture102', $picture102);
        $this->addReference('picture103', $picture103);
        $this->addReference('picture104', $picture104);
        $this->addReference('picture105', $picture105);
        $this->addReference('picture106', $picture106);
        $this->addReference('picture107', $picture107);
        $this->addReference('picture108', $picture108);
        $this->addReference('picture109', $picture109);
        $this->addReference('picture110', $picture110);
    }

    public function getOrder()
    {
        return 1; // l'ordre dans lequel les fichiers sont chargés
    }
}


text:
@import url(../../bower_modules/jquery-ui/themes/base/all.css);
@import url(../../bower_modules/jquery-ui/themes/black-tie/theme.css);
@media all {
  .page-break {
    display: none; } }

.print {
  visibility: hidden;
  display: none; }

@media print {
  .page-break {
    display: block;
    page-break-before: always; }
  .page-break-after {
    display: block;
    page-break-after: always; }
  .no-print {
    visibility: hidden; }
  .print {
    visibility: visible;
    display: block; } }

body {
  padding-top: 50px;
  padding-bottom: 20px; }

/* Wrapping element */
/* Set some basic padding to keep content from hitting the edges */
.body-content {
  padding-left: 15px;
  padding-right: 15px; }

/* Carousel */
.carousel-caption {
  z-index: 10 !important; }

.carousel-caption p {
  font-size: 20px;
  line-height: 1.4; }

@media (min-width: 768px) {
  .carousel-caption {
    z-index: 10 !important; } }

/* Bootstrap Overrides */
.form-horizontal .control-label {
  text-align: left; }

/* Site Styles */
.table .form-group {
  margin-bottom: 0; }

.table-navigation i {
  visibility: hidden; }

.table-navigation tbody tr:hover {
  cursor: pointer; }

.table-navigation tr:hover i {
  visibility: visible; }

.title-container {
  padding: .5em 2em 0; }

.desc-container {
  padding: 0 2em .5em; }

.dataform-designer-container {
  overflow: hidden;
  zoom: 1; }

.dataform-designer-container:hover {
  background-color: #f5f5f5;
  -webkit-transition: background-color linear .15s;
  -moz-transition: background-color linear .15s;
  -ms-transition: background-color linear .15s;
  -o-transition: background-color linear .15s;
  transition: background-color linear .15s; }

.dataform-designer-container-editor.active {
  -webkit-box-shadow: 1px 0 10px 1px rgba(0, 0, 0, 0.3);
  -ms-box-shadow: 1px 0 10px 1px rgba(0, 0, 0, 0.3);
  box-shadow: 1px 0 10px 1px rgba(0, 0, 0, 0.3);
  margin-bottom: 10px;
  background-color: #fbfbfb;
  -ms-border-radius: 3px;
  border-radius: 3px;
  border: 1px dashed #ccc; }

.dataform-desiger-field-widget {
  padding: .5em 2em 1.5em;
  position: relative;
  zoom: 1;
  z-index: 1; }

.dataform-designer-container .form-fieldset {
  padding: 2px 2em;
  margin: 0;
  zoom: 1; }

.designer-fields-container .field-controls {
  padding: 5px; }

.designer-fields-container .active > .field-controls {
  visibility: visible; }

.designer-fields-container .preview > .field-controls {
  visibility: hidden; }

.designer-fields-container .preview:hover > .field-controls {
  visibility: visible; }

.clickable {
  cursor: pointer; }

.ui-datepicker {
  z-index: 1151 !important; }

.ui-autocomplete {
  z-index: 215000000 !important; }

p.message, div.message {
  padding: 15px;
  font-size: 1.2em; }

/* iPhone fix for scrolling on Bootstrap modals */
.modal {
  overflow-y: scroll; }

@media (max-width: 480px) {
  .modal {
    height: 500px;
    /* Set a default max height of the modal (adjusted later)*/
    position: fixed;
    /* Display modal in the centre of your screen */
    overflow-y: scroll;
    /*  Ensure that the modal is scroll-able */
    -webkit-overflow-scrolling: touch;
    /* Avoid having to use 2 finger scroll on iOS    */ }
  .modal.fade.in {
    top: 5px;
    /* Use more screen real estate */ }
  .modal-body {
    /* Increase the max height of the modal body to try & avoid both it,
             * and the modal container having scroll bars which results in odd behavior */
    max-height: 2400px; } }

/* Now adjust the height so it handles various screen sizes & orientations */
/* You could make this as granular as you like, or have it more granular at common screen sizes
     * but it should start at the height we set on .modal (i.e. 500px) & work down */
@media (max-width: 480px) and (max-height: 500px) {
  .modal {
    height: 450px; } }

@media (max-width: 480px) and (max-height: 450px) {
  .modal {
    height: 400px; } }

@media (max-width: 480px) and (max-height: 400px) {
  .modal {
    height: 350px; } }

@media (max-width: 480px) and (max-height: 350px) {
  .modal {
    height: 300px; } }

@media (max-width: 480px) and (max-height: 300px) {
  .modal {
    height: 250px; } }

@media (max-width: 480px) and (max-height: 250px) {
  .modal {
    height: 200px; } }

@media (max-width: 480px) and (max-height: 200px) {
  .modal {
    height: 150px; } }

/* end iPhone fix for scrolling on Bootstrap modals */


text:
package org.sisioh.aws4s.s3.model

import com.amazonaws.services.s3.model.{ AccessControlList, CannedAccessControlList, SetBucketAclRequest }
import org.sisioh.aws4s.PimpedType

object SetBucketAclRequestFactory {

  def create(bucketName: String, acl: AccessControlList): SetBucketAclRequest =
    new SetBucketAclRequest(bucketName, acl)

  def create(bucketName: String, acl: CannedAccessControlList): SetBucketAclRequest =
    new SetBucketAclRequest(bucketName, acl)

}

class RichSetBucketAclRequest(val underlying: SetBucketAclRequest) extends AnyVal with PimpedType[SetBucketAclRequest] {

  def bucketName: String = underlying.getBucketName

  // ---

  def aclOpt: Option[AccessControlList] = Option(underlying.getAcl)

  // ---

  def cannedAclOpt = Option(underlying.getCannedAcl)

}


text:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">

    <item
        android:id="@+id/save"
        android:icon="@drawable/ic_save_36dp"
        android:title="@string/action_export_playlist"
        app:showAsAction="ifRoom" />

    <item
        android:id="@+id/add_to_playlist"
        android:icon="@drawable/ic_playlist_add_36dp"
        android:title="@string/action_add_to_playlist"
        app:showAsAction="ifRoom" />

</menu>