query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Inflate the layout for this fragment
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_home, container, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_main_allinfo, container, false);\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup...
[ "0.6739604", "0.67235583", "0.6721706", "0.6698254", "0.6691869", "0.6687986", "0.66869223", "0.6684548", "0.66766286", "0.6674615", "0.66654444", "0.66654384", "0.6664403", "0.66596216", "0.6653321", "0.6647136", "0.66423255", "0.66388357", "0.6637491", "0.6634193", "0.66251...
0.0
-1
Creates new form SpriteClipperGUI
public SpriteClipperGUI() { initComponents(); /* Set up the button group */ rsAnchorGroup = new ButtonGroup(); rsAnchorGroup.add(tlRadioButton); rsAnchorGroup.add(tcRadioButton); rsAnchorGroup.add(trRadioButton); rsAnchorGroup.add(clRadioButton); rsAnchorGroup.add(crRadioButton); rsAnchorGroup.add(blRadioButton); rsAnchorGroup.add(bcRadioButton); rsAnchorGroup.add(brRadioButton); rsAnchorGroup.add(ccRadioButton); rsAnchorGroup.setSelected(blRadioButton.getModel(), true); connSelector.setSelectedIndex(1); spriteClipper.addObserver(this); clippedList.addListSelectionListener(spriteDetailer); addKeyListener(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CreateGUI() throws IOException{\r\n\t\tthis.setFocusable(false);\r\n\t\tthis.setTitle(\"Dance Dance Revolution - 201B Edition\");\r\n\t\tthis.setSize(800, 600);\t\t \t\r\n\t\tthis.setLocation(100, 100); \t\r\n\t\tthis.setVisible(true);\r\n\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tthis....
[ "0.6984784", "0.667116", "0.66189057", "0.6545113", "0.6513546", "0.64383155", "0.6435154", "0.64002055", "0.6395499", "0.6386384", "0.6368835", "0.6347641", "0.6345228", "0.6340357", "0.63291705", "0.6315935", "0.6288399", "0.62700695", "0.62653", "0.62515795", "0.62417835",...
0.7169308
0
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { rsAnchorGroup = new javax.swing.ButtonGroup(); sheetPanel = new javax.swing.JPanel(); spriteSheetScrollPane = new javax.swing.JScrollPane(); jPanel1 = new javax.swing.JPanel(); selectNoneButton = new javax.swing.JButton(); selectAllButton = new javax.swing.JButton(); findSpritesButton = new javax.swing.JButton(); openButton = new javax.swing.JButton(); reshapeButton = new javax.swing.JButton(); closeButton = new javax.swing.JButton(); mergeButton = new javax.swing.JButton(); connLabel = new javax.swing.JLabel(); connSelector = new javax.swing.JComboBox(); storeClipsButton = new javax.swing.JButton(); filterLabel = new javax.swing.JLabel(); filterSelector = new javax.swing.JComboBox(); jPanel2 = new javax.swing.JPanel(); trRadioButton = new javax.swing.JRadioButton(); tlRadioButton = new javax.swing.JRadioButton(); clRadioButton = new javax.swing.JRadioButton(); crRadioButton = new javax.swing.JRadioButton(); tcRadioButton = new javax.swing.JRadioButton(); brRadioButton = new javax.swing.JRadioButton(); blRadioButton = new javax.swing.JRadioButton(); bcRadioButton = new javax.swing.JRadioButton(); ccRadioButton = new javax.swing.JRadioButton(); storedPanel = new javax.swing.JPanel(); jScrollPane2 = new javax.swing.JScrollPane(); clippedList = new javax.swing.JList(); removeButton = new javax.swing.JButton(); saveToButton = new javax.swing.JButton(); spriteDetailer = new com.fluffynukeit.SpriteClipper.GUI.SpriteDetailer(); packButton = new javax.swing.JButton(); packerLabel = new javax.swing.JLabel(); packerSelector = new javax.swing.JComboBox(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Sprite Clipper"); setBounds(new java.awt.Rectangle(0, 0, 800, 600)); setFocusable(false); setName("mainFrame"); // NOI18N sheetPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Sprite Sheet")); sheetPanel.setFocusable(false); spriteSheetScrollPane.setFocusable(false); jPanel1.setFocusable(false); selectNoneButton.setText("None"); selectNoneButton.setToolTipText("<html><div align=\"center\">Deselects all found sprites. (Ctrl+N)</div></html>"); selectNoneButton.setEnabled(false); selectNoneButton.setFocusable(false); selectNoneButton.setName("findSpritesButton"); // NOI18N selectNoneButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { selectNoneButtonActionPerformed(evt); } }); selectAllButton.setText("All"); selectAllButton.setToolTipText("<html><div align=\"center\">Selects all found sprites. (Ctrl+A)</div></html>"); selectAllButton.setEnabled(false); selectAllButton.setFocusable(false); selectAllButton.setName("findSpritesButton"); // NOI18N selectAllButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { selectAllButtonActionPerformed(evt); } }); findSpritesButton.setFont(new java.awt.Font("DejaVu Sans", 0, 14)); findSpritesButton.setText("<html><div align=\"center\">Find<br>Sprites!</div></html>"); findSpritesButton.setToolTipText("<html><div align=\"center\">Identifies sprites in the sprite sheet using selected <br> background filter and connectedness criterion. (Ctrl+F)</div></html>"); findSpritesButton.setEnabled(false); findSpritesButton.setFocusable(false); findSpritesButton.setName("findSpritesButton"); // NOI18N findSpritesButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { findSpritesButtonActionPerformed(evt); } }); openButton.setText("Open"); openButton.setToolTipText("<html><div align=\"center\">Opens a sprite sheet. (Ctrl+O)</div></html>"); openButton.setFocusable(false); openButton.setName("openButton"); // NOI18N openButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { openButtonActionPerformed(evt); } }); reshapeButton.setText("Reshape"); reshapeButton.setToolTipText("<html><div align=\"center\">Select multiple sprites on the sheet, an anchor point, then press reshape.<br>The bounds of all selected clips will be expanded to the same size. (Ctrl+R)</div></html>"); reshapeButton.setEnabled(false); reshapeButton.setFocusable(false); reshapeButton.setName("findSpritesButton"); // NOI18N reshapeButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { reshapeButtonActionPerformed(evt); } }); closeButton.setText("Close"); closeButton.setToolTipText("<html><div align=\"center\">Closes the open sprite sheet. (Ctrl+W)</div></html>"); closeButton.setEnabled(false); closeButton.setFocusable(false); closeButton.setName("closeButton"); // NOI18N closeButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { closeButtonActionPerformed(evt); } }); mergeButton.setText("Merge"); mergeButton.setToolTipText("<html><div align=\"center\">Combines multiple selected sprites. (Ctrl+M)</div></html>"); mergeButton.setEnabled(false); mergeButton.setFocusable(false); mergeButton.setName("findSpritesButton"); // NOI18N mergeButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { mergeButtonActionPerformed(evt); } }); connLabel.setText("Connected criterion:"); connSelector.setModel(new DefaultComboBoxModel(spriteClipper.getAvailableFinders())); connSelector.setFocusable(false); connSelector.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { connSelectorActionPerformed(evt); } }); storeClipsButton.setFont(new java.awt.Font("DejaVu Sans", 0, 14)); storeClipsButton.setText("Clip!"); storeClipsButton.setToolTipText("<html><div align=\"center\">Adds selected sprites to the clipped sprites. (Ctrl+C)</div></html>"); storeClipsButton.setEnabled(false); storeClipsButton.setFocusable(false); storeClipsButton.setName("findSpritesButton"); // NOI18N storeClipsButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { storeClipsButtonActionPerformed(evt); } }); filterLabel.setText("Background is..."); filterSelector.setModel(new DefaultComboBoxModel(spriteClipper.getAvailableFilters())); filterSelector.setFocusable(false); filterSelector.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { filterSelectorActionPerformed(evt); } }); jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("RS Anchor")); jPanel2.setFocusable(false); trRadioButton.setEnabled(false); trRadioButton.setFocusable(false); tlRadioButton.setEnabled(false); tlRadioButton.setFocusable(false); clRadioButton.setEnabled(false); clRadioButton.setFocusable(false); crRadioButton.setEnabled(false); crRadioButton.setFocusable(false); tcRadioButton.setEnabled(false); tcRadioButton.setFocusable(false); brRadioButton.setEnabled(false); brRadioButton.setFocusable(false); blRadioButton.setEnabled(false); blRadioButton.setFocusable(false); bcRadioButton.setEnabled(false); bcRadioButton.setFocusable(false); ccRadioButton.setEnabled(false); ccRadioButton.setFocusable(false); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup() .addComponent(clRadioButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(ccRadioButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(crRadioButton)) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup() .addComponent(tlRadioButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(tcRadioButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(trRadioButton))) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(blRadioButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(bcRadioButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(brRadioButton))) .addContainerGap()) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(tlRadioButton) .addComponent(tcRadioButton) .addComponent(trRadioButton)) .addGap(6, 6, 6) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(clRadioButton) .addComponent(crRadioButton) .addComponent(ccRadioButton)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(bcRadioButton) .addComponent(blRadioButton) .addComponent(brRadioButton))) ); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(openButton) .addGap(8, 8, 8) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(filterLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 145, Short.MAX_VALUE) .addComponent(filterSelector, 0, 145, Short.MAX_VALUE) .addComponent(connLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 145, Short.MAX_VALUE))) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(closeButton) .addGap(8, 8, 8) .addComponent(connSelector, 0, 145, Short.MAX_VALUE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(findSpritesButton, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(selectNoneButton, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(reshapeButton, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(selectAllButton, javax.swing.GroupLayout.DEFAULT_SIZE, 74, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(mergeButton, javax.swing.GroupLayout.DEFAULT_SIZE, 74, Short.MAX_VALUE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(storeClipsButton, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(24, 24, 24)) ); jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {mergeButton, reshapeButton, selectAllButton, selectNoneButton}); jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {closeButton, openButton}); jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {findSpritesButton, storeClipsButton}); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(selectAllButton, javax.swing.GroupLayout.DEFAULT_SIZE, 39, Short.MAX_VALUE) .addComponent(mergeButton, javax.swing.GroupLayout.DEFAULT_SIZE, 39, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(selectNoneButton, javax.swing.GroupLayout.DEFAULT_SIZE, 39, Short.MAX_VALUE) .addComponent(reshapeButton, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(filterLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(openButton) .addComponent(filterSelector, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(connLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(closeButton) .addComponent(connSelector, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addComponent(findSpritesButton, javax.swing.GroupLayout.DEFAULT_SIZE, 87, Short.MAX_VALUE) .addContainerGap()) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addComponent(storeClipsButton, javax.swing.GroupLayout.DEFAULT_SIZE, 87, Short.MAX_VALUE)) .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {mergeButton, reshapeButton, selectAllButton, selectNoneButton}); jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {closeButton, openButton}); javax.swing.GroupLayout sheetPanelLayout = new javax.swing.GroupLayout(sheetPanel); sheetPanel.setLayout(sheetPanelLayout); sheetPanelLayout.setHorizontalGroup( sheetPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(sheetPanelLayout.createSequentialGroup() .addContainerGap() .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) .addComponent(spriteSheetScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 674, Short.MAX_VALUE) ); sheetPanelLayout.setVerticalGroup( sheetPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, sheetPanelLayout.createSequentialGroup() .addComponent(spriteSheetScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 490, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)) ); storedPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Clipped Sprites")); storedPanel.setFocusable(false); clippedList.setModel(new DefaultListModel()); clippedList.setCellRenderer(new ClipCellRenderer()); clippedList.setFocusable(false); clippedList.setLayoutOrientation(javax.swing.JList.HORIZONTAL_WRAP); clippedList.setVisibleRowCount(-1); jScrollPane2.setViewportView(clippedList); removeButton.setText("Remove"); removeButton.setToolTipText("<html><div align=\"center\">Removes the selected clipped sprites. (Delete)</div></html>"); removeButton.setEnabled(false); removeButton.setFocusable(false); removeButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { removeButtonActionPerformed(evt); } }); saveToButton.setText("Save To..."); saveToButton.setToolTipText("<html><div align=\"center\">Saves all selected clipped sprites to a directory. (Ctrl+S)</div></html>"); saveToButton.setEnabled(false); saveToButton.setFocusable(false); saveToButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveToButtonActionPerformed(evt); } }); spriteDetailer.setFocusable(false); packButton.setText("Pack..."); packButton.setToolTipText("<html><div align=\"center\">Packs the selected sprite clips into a new, dense sheet using the<br>selected packing method, and writes definition text file. (Ctrl+P)</div></html>"); packButton.setEnabled(false); packButton.setFocusable(false); packButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { packButtonActionPerformed(evt); } }); packerLabel.setText("Packing method:"); packerSelector.setModel(new DefaultComboBoxModel(spriteClipper.getAvailablePackers())); packerSelector.setFocusable(false); packerSelector.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { packerSelectorActionPerformed(evt); } }); javax.swing.GroupLayout storedPanelLayout = new javax.swing.GroupLayout(storedPanel); storedPanel.setLayout(storedPanelLayout); storedPanelLayout.setHorizontalGroup( storedPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 216, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, storedPanelLayout.createSequentialGroup() .addComponent(packerSelector, 0, 156, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(packButton)) .addGroup(storedPanelLayout.createSequentialGroup() .addComponent(packerLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) .addGroup(storedPanelLayout.createSequentialGroup() .addComponent(saveToButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 72, Short.MAX_VALUE) .addComponent(removeButton, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(spriteDetailer, javax.swing.GroupLayout.DEFAULT_SIZE, 216, Short.MAX_VALUE) ); storedPanelLayout.setVerticalGroup( storedPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(storedPanelLayout.createSequentialGroup() .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 316, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(spriteDetailer, javax.swing.GroupLayout.DEFAULT_SIZE, 190, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(storedPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(saveToButton) .addComponent(removeButton)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(packerLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(storedPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(packerSelector, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(packButton))) ); storedPanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {removeButton, saveToButton}); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(sheetPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(storedPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(sheetPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(storedPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); pack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n ...
[ "0.7321245", "0.7292375", "0.7292375", "0.7292375", "0.7286756", "0.7250393", "0.7215278", "0.7208825", "0.7197639", "0.71918", "0.7185626", "0.716065", "0.71489197", "0.7094757", "0.7081307", "0.7057363", "0.69892997", "0.6978972", "0.6956389", "0.69543713", "0.69465107", ...
0.0
-1
Scanner sc = new Scanner(System.in);
public static void main(String[] args) { String s = ""; try { File file = new File("C:\\Users\\DELL\\Desktop\\bridgelabz\\example\\sample.txt"); Scanner sc = new Scanner(file); while (sc.hasNextLine()) { s = sc.nextLine(); } System.out.println(s); String[] splt = s.split(""); for (int i = 0; i < splt.length; i++) { System.out.println(splt[i]); } } catch(Exception e) { System.out.println("Not Found"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n Scanner scan=new Scanner(System.in);\n\n\n\n }", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t}", "public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n Strin...
[ "0.8116788", "0.7859288", "0.7456636", "0.7390904", "0.7370572", "0.726009", "0.7220934", "0.7188939", "0.71190596", "0.7016008", "0.6999161", "0.69791657", "0.6916052", "0.6864569", "0.6834009", "0.6791698", "0.6791698", "0.6768515", "0.6752971", "0.67184204", "0.6700116", ...
0.0
-1
Initialisation de la case zero
public CaseZero(List<Player> listPlayer){ this.index = 0; this.listePlayer = listPlayer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private final int initializeInt() {\n\t\treturn 0;\r\n\t}", "@Override\r\n\tprotected Integer zero() {\n\t\treturn 0;\r\n\t}", "abstract void assignZero();", "public Case() {}", "public final void setZero() {\n \t\n\t\tthis.m00 = 0.0F;\n\t\tthis.m01 = 0.0F;\n\t\tthis.m02 = 0.0F;\n\t\tthis.m10 = 0.0F;\n\...
[ "0.66070014", "0.6597632", "0.6337283", "0.62080187", "0.62028366", "0.6199818", "0.61612785", "0.6153866", "0.6131067", "0.6083478", "0.6049052", "0.59878117", "0.5981126", "0.5942302", "0.5909666", "0.59056723", "0.5856427", "0.5849949", "0.5846553", "0.58392686", "0.582021...
0.5857538
16
TODO Autogenerated method stub
@Override public boolean canBeLeft() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override public int consequence(int diceThrow) { return diceThrow; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override public Player getPlayer() { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override public boolean isBusy() { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override public void setPlayer(Player player) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
Informe l'utilisateur des joueurs se trouvant sur cette case
public String getMessage(int i){ return this.listePlayer.get(i).toString()+" is in cell "+this.index+", "+this.listePlayer.get(i).toString() +" throws "+dice+", reaches cell " +this.consequence(this.diceGet()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void accionUsuario() {\n\t\t\r\n\t}", "private boolean correctUser() {\n // TODO mirar si l'usuari es unic a la base de dades\n return true;\n }", "@Override\n public void onClick(View v) {\n trasferisci_utente();\n\n // controlla se tutti i d...
[ "0.65321577", "0.6416484", "0.6382367", "0.6261694", "0.6257801", "0.61809057", "0.6063848", "0.6042494", "0.6007278", "0.6005662", "0.6003697", "0.59868973", "0.5976392", "0.5970561", "0.59679383", "0.59260356", "0.5899063", "0.5861863", "0.5851763", "0.5835986", "0.58323216...
0.0
-1
end of run() NITE events
private void setSessionEvents(SessionManager sessionMan) // create session callback... { try { // session end sessionMan.getSessionEndEvent().addObserver( new IObserver<NullEventArgs>() { public void update(IObservable<NullEventArgs> observable, NullEventArgs args) { isRunning = false; } }); } catch (StatusException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void onEnd() {}", "protected abstract void trace_end_run();", "protected void end() {\n \t// theres nothing to end\n }", "protected void end() {\n \n \n }", "protected void end()\n\t{\n\t}", "protected void end() {\r\n }", "protected void end() {\r\n }", "protec...
[ "0.69295365", "0.6870028", "0.68090487", "0.6759695", "0.67460966", "0.6745858", "0.6745858", "0.6745858", "0.6745858", "0.67318785", "0.67318785", "0.67318785", "0.67318785", "0.67318785", "0.67318785", "0.67278874", "0.6700703", "0.6684921", "0.6667145", "0.6667145", "0.666...
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { Employee emp1 = new Employee(); Employee emp2 = new Employee(); emp1.empName = "Rob"; emp1.empid = 200; emp1.empsalary = 12345; emp1.displayEmployeebonus(); emp2.empName = "Rob"; emp2.empid = 300; emp2.empsalary = 98765; emp2.displayEmployeebonus(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
varifies whether an assignment is valid.
private void checkAssignment(Assignment node) { String nodeName = node.name.name; boolean error = false; // check whether assignment would cause a loop if (node.value instanceof ConstantReference) { ConstantReference reference = ((ConstantReference) node.value); if (reference.name.equals(nodeName)) { node.setError("You can't assign a constant to itself."); error = true; } else { isCircularReference(reference); } } // if assignment is an operation, check the operation if (node.value instanceof Operation) { checkOperation((Operation) node.value); } // if no error has been found add it to symboltable. if (!error) { symboltable.put(nodeName, node.value); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isAssignment() {\n\t\treturn true;\n\t}", "public boolean isPureAssignment() {\n return (commandElement() == null) && hasAssignments();\n }", "public static boolean assignment(FileInputStream f) {\n if(observer != null){\n observer.parser.setCurrentRule(\"assignment\"...
[ "0.68622935", "0.6480059", "0.62896264", "0.62288094", "0.6208413", "0.6191428", "0.61874187", "0.61303174", "0.6114139", "0.6063006", "0.6023723", "0.6023723", "0.6023723", "0.6023723", "0.6023723", "0.6020997", "0.60202324", "0.60135245", "0.6002455", "0.60018337", "0.59984...
0.5957654
23
checks whether reference is a circular reference
private boolean isCircularReference(ConstantReference node) { ArrayList<String> trail = new ArrayList<>(); trail.add(node.name); String previousName = node.name; boolean running = true; boolean isCircular = false; while ((symboltable.get(previousName) instanceof ConstantReference) && running) { ConstantReference newReference = (ConstantReference) symboltable.get(previousName); if (!trail.contains(newReference.name)) { trail.add(newReference.name); previousName = newReference.name; } else { node.setError("Circular reference detected."); running = false; isCircular = true; } } return isCircular; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean isCircular();", "public boolean isCircular() {\n\t\treturn false;\n\n\t}", "boolean hasReference();", "boolean hasRef();", "public final boolean isReference() {\n \treturn !isPrimitive();\n }", "public boolean isReference() {\n return isReference;\n }", "public boolean isReferen...
[ "0.7245392", "0.7244165", "0.7137154", "0.6922349", "0.6797001", "0.67711484", "0.6728945", "0.6556256", "0.6494718", "0.6487357", "0.64802223", "0.644663", "0.6371065", "0.6299234", "0.6251143", "0.62431544", "0.62401026", "0.61586964", "0.6135155", "0.6024982", "0.6018778",...
0.78703946
0
Check whether reference is used but never assigned
private void checkReference(ConstantReference node) { if (!symboltable.containsKey(node.name)) { node.setError(String.format("Constant %s used but not assigned", node.name)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasRef();", "boolean hasReference();", "boolean isZeroReference() {\n return refCount == 0;\n }", "private void checkReference()\r\n {\r\n if (myKeyRef.get() == null)\r\n {\r\n myValue = null;\r\n }\r\n }", "boolean isSetRef();", "private boolean isRe...
[ "0.6952191", "0.69505227", "0.67305905", "0.67155707", "0.6664676", "0.66153336", "0.66096526", "0.6537659", "0.6428299", "0.63770616", "0.63577265", "0.6302729", "0.6250227", "0.6120879", "0.61195546", "0.61195546", "0.61180156", "0.60786486", "0.6067953", "0.60428864", "0.6...
0.643583
8
creation des objets+initialisation des parametres
public static void main(String[] args) { Hero aventurier = new Hero(200, 100); Equipement epee = new Equipement("epee", 0); Monsters sorciere = new Monsters("witch", 180, 0); Monsters barbare = new Monsters("olaf", 160, 0);//Degat et point attaque sont à 0 car ils prendront les valeurs du random System.out.println("Bienvenue dans le dongeon"); System.out.println("Vous avez " + aventurier.getPointDeVie() + " Point de vie, " + aventurier.getFlasqueDeau() + " flasques pour combatre vos ennemies et une "); // i=room ;si pointdevie > room-->room+1 sinon game over(pas besoin de creer une classe) int i = 1; do { if (aventurier.getPointDeVie() > 0) ; { System.out.println("Room" + i); Monsters enemieActuel = barbare; //nbr aleatoire entre sorcier et monster Random random = new Random(); int nbrAl = random.nextInt(2 ); //si nbr=0 = sorcier sinon barbare if (nbrAl == 0) { enemieActuel = sorciere; //sinon barbare } else { enemieActuel = barbare; } //Si barbare faire le do while if (enemieActuel == barbare) { do { //Faire des degats aleatoire grace au random à l'aide de l'epee epee.setDegat((int) (5 + (Math.random() * 30)));//comme .set dega=0 on lui donne la valeur de math.random int degat = epee.getDegat(); //.get renvoi la valeur au int nommer degat barbare.setPointDeVie(barbare.getPointDeVie() - degat);//vie - degat System.out.println("Il reste au barbare " + barbare.getPointDeVie());//nouvelle valeur de point de vie //idem avec l'aventurier barbare.setPointAttaque((int) (5 + (Math.random() * 30))); int pointDattaque = barbare.getPointAttaque(); aventurier.setPointDeVie(aventurier.getPointDeVie() - pointDattaque); System.out.println("il vous reste " + aventurier.getPointDeVie()); // tant que les Pvie de l'aventurier >= 0 et idem barbare continuer le combat } while (aventurier.getPointDeVie() >= 0 && barbare.getPointDeVie() >= 0); //à la fin du combat si pvie de l'aventurier sont >0 et que i (room) egale 5 "gagné" if (aventurier.getPointDeVie() > 0 && i==5) { System.out.println("Bravo vous avez gagné ! =)"); //Si juste pvie de l'aventurier > 0 --->room suivante }else if (aventurier.getPointDeVie() > 0 ){ System.out.println("Bravo tu passes à la pièce suivante"); //on redonne les valeurs de depart pdeVie pour la nouvelle room aventurier.setPointDeVie(200); barbare.setPointDeVie(180); i+=1; } // sinon room = 6 pour envoyer le sout "game over" else { System.out.println("Game Over"); i = 6; } } //IDEM avec sorciere else { do { aventurier.setFlasqueDeau((int) (5 + (Math.random() * 30))); int degat = aventurier.getFlasqueDeau(); sorciere.setPointDeVie(sorciere.getPointDeVie() - degat); System.out.println("Il reste à la sorciere " + sorciere.getPointDeVie()); sorciere.setPointAttaque((int) (5 + (Math.random() * 30))); int pointDattaque = sorciere.getPointAttaque(); aventurier.setPointDeVie(aventurier.getPointDeVie() - pointDattaque); System.out.println("il vous reste " + aventurier.getPointDeVie()); } while (aventurier.getPointDeVie() >= 0 && sorciere.getPointDeVie() >= 0); if (aventurier.getPointDeVie() > 0 && i==5) { System.out.println("Bravo vous avez gagné ! =)"); }else if (aventurier.getPointDeVie() > 0 ){ System.out.println("Bravo tu passes à la pièce suivante"); aventurier.setPointDeVie(200); sorciere.setPointDeVie(160); i+=1; } else { System.out.println("Game Over"); i = 6; } } } } while (i <= 5 && aventurier.getPointDeVie() > 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public TParametrosVOImpl() {\r\n }", "public Parameters() {\n\t}", "public void init(Object[] parameters) {\n\n\t}", "private void prepare()\n {\n Victoria victoria = new Victoria();\n addObject(victoria,190,146);\n Salir salir = new Salir();\n addObject(salir,200,533);\n ...
[ "0.6691094", "0.65038514", "0.6500137", "0.64892906", "0.647681", "0.63497096", "0.63317436", "0.6300511", "0.6288437", "0.62867844", "0.6286124", "0.6274608", "0.62738955", "0.6253334", "0.6188737", "0.61876935", "0.6159943", "0.6158305", "0.61524844", "0.61366314", "0.61364...
0.0
-1
Use this factory method to create a new instance of this fragment using the provided parameters.
public static CartFragment newInstance(String param1, String param2) { CartFragment fragment = new CartFragment(); Bundle args = new Bundle(); args.putString(ARG_PARAM1, param1); args.putString(ARG_PARAM2, param2); fragment.setArguments(args); return fragment; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static FragmentTousWanted newInstance() {\n FragmentTousWanted fragment = new FragmentTousWanted();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }", "protected abstract Fragment createFragment();", "public void createFragment() {\n\n ...
[ "0.7259329", "0.72331375", "0.71140355", "0.69909847", "0.69902235", "0.6834592", "0.683074", "0.68134046", "0.6801526", "0.6801054", "0.67653185", "0.6739714", "0.6739714", "0.6727412", "0.6717231", "0.6705855", "0.6692112", "0.6691661", "0.66869426", "0.66606814", "0.664618...
0.0
-1
Create places for the petrinet
public void buildPointPetriNet(){ createPlace(pnet, "int", 3); createPlace(pnet, "Point", 2); createPlace(pnet, "MyPoint", 2); createPlace(pnet, "void", 2); // Create transitions for the petri-net pnet.createTransition("int<-getX(Point)"); pnet.createTransition("int<-getY(Point)"); pnet.createTransition("void<-setX(Point,int)"); pnet.createTransition("void<-setY(Point,int)"); pnet.createTransition("Point<-Point(void)"); pnet.createTransition("int<-getX(MyPoint)"); pnet.createTransition("int<-getY(MyPoint)"); pnet.createTransition("MyPoint<-MyPoint(int,int)"); // Create clone transitions for the petri-net pnet.createTransition("int<-clone(int)"); pnet.createTransition("Point<-clone(Point)"); pnet.createTransition("MyPoint<-clone(MyPoint)"); pnet.createTransition("void<-clone(void)"); // Create flows for the petri-net pnet.createFlow("Point","int<-getX(Point)",1); pnet.createFlow("int<-getX(Point)","int",1); pnet.createFlow("Point","int<-getY(Point)",1); pnet.createFlow("int<-getY(Point)","int",1); pnet.createFlow("Point","void<-setX(Point,int)",1); pnet.createFlow("int","void<-setX(Point,int)",1); pnet.createFlow("void<-setX(Point,int)","void",1); pnet.createFlow("Point","void<-setY(Point,int)",1); pnet.createFlow("int","void<-setY(Point,int)",1); pnet.createFlow("void<-setY(Point,int)","void",1); pnet.createFlow("void","Point<-Point(void)",1); pnet.createFlow("Point<-Point(void)","Point",1); pnet.createFlow("MyPoint","int<-getX(MyPoint)",1); pnet.createFlow("int<-getX(MyPoint)","int",1); pnet.createFlow("MyPoint","int<-getY(MyPoint)",1); pnet.createFlow("int<-getY(MyPoint)","int",1); pnet.createFlow("int","MyPoint<-MyPoint(int,int)",2); pnet.createFlow("MyPoint<-MyPoint(int,int)","MyPoint",1); // Create flows for the clone edges pnet.createFlow("int","int<-clone(int)",1); pnet.createFlow("int<-clone(int)","int",2); pnet.createFlow("Point","Point<-clone(Point)",1); pnet.createFlow("Point<-clone(Point)","Point",2); pnet.createFlow("MyPoint","MyPoint<-clone(MyPoint)",1); pnet.createFlow("MyPoint<-clone(MyPoint)","MyPoint",2); pnet.createFlow("void","void<-clone(void)",1); pnet.createFlow("void<-clone(void)","void",2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void createLocations() {\n createAirports();\n createDocks();\n createEdges();\n createCrossroads();\n }", "private static void createPlace(Place place) {\r\n\t\tint tempInt = -1;\r\n\t\tContainerNII placeNii = new ContainerNII();\r\n\t\tGeoCoordinate position = new GeoCoord...
[ "0.7036062", "0.67250323", "0.67071366", "0.60838985", "0.6064514", "0.5964835", "0.594365", "0.5883921", "0.5788858", "0.5756271", "0.56953835", "0.5681603", "0.5645718", "0.5637629", "0.56345344", "0.56327236", "0.56169665", "0.5604356", "0.55851865", "0.5584265", "0.557513...
0.5252975
60
Here I define the callback interface
public interface MyCallbackInterface { //its supposed to send the JSON object on request completed void onRequestCompleted(JSONArray result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\tpublic void callbackCall() {\n\t\t\t}", "public void callback();", "public void callback() {\n }", "public interface Callback {\n }", "@Override\n\tpublic void callback() {\n\t}", "@Override\n\tpublic void callback(Object o) {}", "@Override\n\tpublic void onCallback() {\n\t\t\n\t...
[ "0.8121364", "0.8074135", "0.8007718", "0.79711086", "0.7809902", "0.77962357", "0.76086783", "0.75892717", "0.74566555", "0.7369693", "0.73455036", "0.73286563", "0.72813284", "0.72630614", "0.725146", "0.7246145", "0.72365326", "0.721983", "0.7216395", "0.71877944", "0.7183...
0.7530286
8
its supposed to send the JSON object on request completed
void onRequestCompleted(JSONArray result);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void sendJson(Object data);", "@Override\n\t\t\tpublic void onResponseReceived(Request request, Response response) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\t\tpublic void onResponseReceived(Request request, Response response) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n\t\t\t\t\t\t\tpublic void onComplete(String r...
[ "0.67955345", "0.6695014", "0.66372275", "0.6500939", "0.6419808", "0.6410074", "0.6380651", "0.6165908", "0.6164591", "0.6162349", "0.61541384", "0.61524516", "0.6151851", "0.6151764", "0.61516076", "0.60637105", "0.6055338", "0.6055338", "0.60515577", "0.6032265", "0.598841...
0.6331005
7
To handle low speed internet
public JSONArray getJSONFromUrl(String url) { HttpParams httpParameters = new BasicHttpParams(); // Set the timeout in milliseconds until a connection is established. // The default value is zero, that means the timeout is not used. int timeoutConnection = 3000; HttpConnectionParams.setConnectionTimeout(httpParameters, timeoutConnection); // Set the default socket timeout (SO_TIMEOUT) // in milliseconds which is the timeout for waiting for data. int timeoutSocket = 5000; HttpConnectionParams.setSoTimeout(httpParameters, timeoutSocket); DefaultHttpClient httpclient = new DefaultHttpClient(httpParameters); HttpGet httpget = new HttpGet(url); // Depends on your web service httpget.setHeader("Content-type", "application/json"); InputStream inputStream = null; String result = null; try { HttpResponse response = httpclient.execute(httpget); HttpEntity entity = response.getEntity(); inputStream = entity.getContent(); BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"), 8); StringBuilder sb = new StringBuilder(); String line; while ((line = reader.readLine()) != null) { sb.append(line).append("\n"); } result = sb.toString(); } catch (Exception e) { // Oops Log.i(TAG,e.toString()); Log.i(TAG,"reader read line didn't work"); } finally { try{ if(inputStream != null)inputStream.close(); } catch(Exception squish){ Log.i(TAG,squish.toString()); Log.i(TAG,"sqish! inputstream did not work!"); } } if(result == null){ Log.i(TAG,"result was NULL"); return null; } try { Log.i(TAG,"WE fetched this data "+result); // Send the url along with article data return new JSONArray(result); } catch (JSONException e) { e.printStackTrace(); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void internetConnectionProble()\n\t\t{\n\n\n\t\t}", "public final void mo6817a(String str) {\n HttpURLConnection httpURLConnection;\n try {\n String valueOf = String.valueOf(str);\n C0633h.m5664a(valueOf.length() == 0 ? new String(\"Pinging URL: \") : \"Pinging URL: \"...
[ "0.7008818", "0.6484574", "0.64390725", "0.6338007", "0.633282", "0.62834513", "0.62807006", "0.62687296", "0.6263559", "0.6178791", "0.6141765", "0.6117252", "0.6100832", "0.6095726", "0.60671574", "0.604398", "0.6025337", "0.6013015", "0.60126096", "0.59886914", "0.5966601"...
0.0
-1
this accepts multiple strings as argument the first string is fed into the function getJSONFromUrl where the whole "Work" takes place
@Override protected JSONArray doInBackground(String... params) { String url = params[0]; Log.i(TAG,"do In Background is called"); return getJSONFromUrl(url); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void accessWebService() {\n\r\n JsonReadTask task = new JsonReadTask();\r\n // passes values for the urls string array\r\n task.execute(new String[] { url });\r\n }", "public void loadJson(){\n new DownloadJsonTask().execute(URL3);\n// new DownloadJsonTask().execute(U...
[ "0.6533901", "0.62588054", "0.60686004", "0.60300475", "0.5999955", "0.5938868", "0.5911953", "0.5803443", "0.5786321", "0.572462", "0.56884307", "0.56583905", "0.56037074", "0.5547759", "0.55187356", "0.55131716", "0.55071443", "0.550429", "0.5484666", "0.5473916", "0.544293...
0.5393398
27
Project: ExtendingInterface File: InterfaceA.java Date: Apr 14, 2017 Time: 12:33:48 PM
public interface InterfaceA { public void methodFromInterfaceA(); // Before Java 8, the interface only contains method signatures. // With Java 8 new feature Default Methods or Defender Methods, // you can include method body within the interface. default void defaultMethod() { System.out.println("from InterfaceA, default method..."); } static void someStaticMethod() { System.out.println("from InterfaceA static method..."); } /* * Why do we need to implement a method within the interface? * * Let's say you have an interface which has multiple methods, * and multiple classes are implementing this interface. One * of the method implementations can be common across the classes, * we can make that method as a default method, so that the * implementation is common for all classes. * * How to work with existing interfaces? * * Second scenario where you have already existing application, * for a new requirement we have to add a method to the existing * interface. If we add new method then we need to implement it * through out the implementation classes. By using the Java 8 * default method we can add a default implementation of that * method which resolves the problem. */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface a extends IInterface {\n}", "public interface AbstractC2502fH1 extends IInterface {\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "interface InterfaceA {\n\tint a = 5;\n\tvoid show();\n\tint display();\n}", "public interface B exten...
[ "0.76261514", "0.75863343", "0.73357844", "0.7104458", "0.7080626", "0.7079362", "0.7035694", "0.7030901", "0.702816", "0.7014919", "0.6996861", "0.69687617", "0.695268", "0.6950941", "0.6891856", "0.68904155", "0.6879966", "0.68163383", "0.6790852", "0.6760945", "0.6758958",...
0.69203234
14
Before Java 8, the interface only contains method signatures. With Java 8 new feature Default Methods or Defender Methods, you can include method body within the interface.
default void defaultMethod() { System.out.println("from InterfaceA, default method..."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "interface Sample {\n\tvoid method(String a);\n\t// New in Java 1.8 - default interface methods\n\tdefault void method_default() {\n\t System.out.println(\"Hello from default method!\");\n\t}\n }", "interface DefaultMethod extends SingleMethod {\r\n\tdefault public void myMethod() {\r\n\t\tSystem.out.printl...
[ "0.7810409", "0.7798962", "0.7699293", "0.75252324", "0.7406081", "0.73538005", "0.7306378", "0.7274506", "0.72701526", "0.71884865", "0.7159974", "0.7108855", "0.7069239", "0.70610297", "0.70407957", "0.7005152", "0.6997123", "0.6979473", "0.6960497", "0.6875339", "0.6855019...
0.7046971
14
/ renamed from: a
public E m58942a() { E b = m58945b(); m58944a(null); return b; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "interface C33292a {\n /* renamed fr...
[ "0.62497115", "0.6242887", "0.61394435", "0.61176854", "0.6114027", "0.60893", "0.6046901", "0.6024682", "0.60201293", "0.5975212", "0.59482527", "0.59121317", "0.5883635", "0.587841", "0.58703005", "0.5868436", "0.5864884", "0.5857492", "0.58306104", "0.5827752", "0.58272064...
0.0
-1
/ renamed from: b
public E m58945b() { return this.f48622a; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void mo2508a(bxb bxb);", "@Override\n public void func_104112_b() {\n \n }", "@Override\n public void b() {\n }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "@Override\n\tpublic void b2() {\n\t\t\n\t}", "v...
[ "0.64558864", "0.6283203", "0.6252635", "0.6250949", "0.6244743", "0.6216273", "0.6194491", "0.6193556", "0.61641675", "0.6140157", "0.60993093", "0.60974354", "0.6077849", "0.6001867", "0.5997364", "0.59737104", "0.59737104", "0.5905105", "0.5904295", "0.58908087", "0.588663...
0.0
-1
/ renamed from: a
public void m58944a(E e) { this.f48622a = e; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "interface C33292a {\n /* renamed fr...
[ "0.62497115", "0.6242887", "0.61394435", "0.61176854", "0.6114027", "0.60893", "0.6046901", "0.6024682", "0.60201293", "0.5975212", "0.59482527", "0.59121317", "0.5883635", "0.587841", "0.58703005", "0.5868436", "0.5864884", "0.5857492", "0.58306104", "0.5827752", "0.58272064...
0.0
-1
/ renamed from: a
public void m58943a(LinkedQueueNode<E> linkedQueueNode) { lazySet(linkedQueueNode); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "interface C33292a {\n /* renamed fr...
[ "0.62497115", "0.6242887", "0.61394435", "0.61176854", "0.6114027", "0.60893", "0.6046901", "0.6024682", "0.60201293", "0.5975212", "0.59482527", "0.59121317", "0.5883635", "0.587841", "0.58703005", "0.5868436", "0.5864884", "0.5857492", "0.58306104", "0.5827752", "0.58272064...
0.0
-1
/ renamed from: c
public LinkedQueueNode<E> m58946c() { return (LinkedQueueNode) get(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void mo5289a(C5102c c5102c);", "public static void c0() {\n\t}", "void mo57278c();", "private static void cajas() {\n\t\t\n\t}", "void mo5290b(C5102c c5102c);", "void mo80457c();", "void mo12638c();", "void mo28717a(zzc zzc);", "void mo21072c();", "@Override\n\tpublic void ccc() {\n\t\t\n\t}", ...
[ "0.64592767", "0.644052", "0.6431582", "0.6418656", "0.64118475", "0.6397491", "0.6250796", "0.62470585", "0.6244832", "0.6232792", "0.618864", "0.61662376", "0.6152657", "0.61496663", "0.6138441", "0.6137171", "0.6131197", "0.6103783", "0.60983956", "0.6077118", "0.6061723",...
0.0
-1
/ renamed from: a
LinkedQueueNode<T> m66550a() { return (LinkedQueueNode) this.f57344a.get(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "interface C33292a {\n /* renamed fr...
[ "0.62497115", "0.6242887", "0.61394435", "0.61176854", "0.6114027", "0.60893", "0.6046901", "0.6024682", "0.60201293", "0.5975212", "0.59482527", "0.59121317", "0.5883635", "0.587841", "0.58703005", "0.5868436", "0.5864884", "0.5857492", "0.58306104", "0.5827752", "0.58272064...
0.0
-1
/ renamed from: a
LinkedQueueNode<T> m66551a(LinkedQueueNode<T> linkedQueueNode) { return (LinkedQueueNode) this.f57344a.getAndSet(linkedQueueNode); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "interface C33292a {\n /* renamed fr...
[ "0.62497115", "0.6242887", "0.61394435", "0.61176854", "0.6114027", "0.60893", "0.6046901", "0.6024682", "0.60201293", "0.5975212", "0.59482527", "0.59121317", "0.5883635", "0.587841", "0.58703005", "0.5868436", "0.5864884", "0.5857492", "0.58306104", "0.5827752", "0.58272064...
0.0
-1
/ renamed from: b
LinkedQueueNode<T> m66552b() { return (LinkedQueueNode) this.f57345b.get(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void mo2508a(bxb bxb);", "@Override\n public void func_104112_b() {\n \n }", "@Override\n public void b() {\n }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "@Override\n\tpublic void b2() {\n\t\t\n\t}", "v...
[ "0.64558864", "0.6283203", "0.6252635", "0.6250949", "0.6244743", "0.6216273", "0.6194491", "0.6193556", "0.61641675", "0.6140157", "0.60993093", "0.60974354", "0.6077849", "0.6001867", "0.5997364", "0.59737104", "0.59737104", "0.5905105", "0.5904295", "0.58908087", "0.588663...
0.0
-1
/ renamed from: c
LinkedQueueNode<T> m66554c() { return (LinkedQueueNode) this.f57345b.get(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void mo5289a(C5102c c5102c);", "public static void c0() {\n\t}", "void mo57278c();", "private static void cajas() {\n\t\t\n\t}", "void mo5290b(C5102c c5102c);", "void mo80457c();", "void mo12638c();", "void mo28717a(zzc zzc);", "void mo21072c();", "@Override\n\tpublic void ccc() {\n\t\t\n\t}", ...
[ "0.64592767", "0.644052", "0.6431582", "0.6418656", "0.64118475", "0.6397491", "0.6250796", "0.62470585", "0.6244832", "0.6232792", "0.618864", "0.61662376", "0.6152657", "0.61496663", "0.6138441", "0.6137171", "0.6131197", "0.6103783", "0.60983956", "0.6077118", "0.6061723",...
0.0
-1
/ renamed from: b
void m66553b(LinkedQueueNode<T> linkedQueueNode) { this.f57345b.lazySet(linkedQueueNode); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void mo2508a(bxb bxb);", "@Override\n public void func_104112_b() {\n \n }", "@Override\n public void b() {\n }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "@Override\n\tpublic void b2() {\n\t\t\n\t}", "v...
[ "0.64558864", "0.6283203", "0.6252635", "0.6250949", "0.6244743", "0.6216273", "0.6194491", "0.6193556", "0.61641675", "0.6140157", "0.60993093", "0.60974354", "0.6077849", "0.6001867", "0.5997364", "0.59737104", "0.59737104", "0.5905105", "0.5904295", "0.58908087", "0.588663...
0.0
-1
/ select coffee of flavor A
public void selectA() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void select() {\n\t\tif (selected.equals(mealSelect) && !eating) {\n\t\t\tmakeMeal();\n\t\t} else if (selected.equals(snackSelect) && !eating) {\n\t\t\tmakeSnack();\n\t\t} else if (selected.equals(medicineSelect) && !eating){\n\t\t\tmakeMedicine();\n\t\t} else if (selected.equals(playSelect) && !eating){\n...
[ "0.5478433", "0.5377722", "0.52951473", "0.523389", "0.5211489", "0.520234", "0.5175973", "0.51738834", "0.5082764", "0.50752556", "0.50686204", "0.5054971", "0.5000083", "0.49855918", "0.49841398", "0.4966026", "0.4900955", "0.4859021", "0.48385715", "0.4837721", "0.4832078"...
0.53808624
1
/ select coffee of flavor B
public void selectB() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "default Cocartesian<A, Choice2<A, B>, P> choose() {\n return this.<A>cocartesian().contraMap(Choice2::b);\n }", "private void select() {\n\t\tif (selected.equals(mealSelect) && !eating) {\n\t\t\tmakeMeal();\n\t\t} else if (selected.equals(snackSelect) && !eating) {\n\t\t\tmakeSnack();\n\t\t} else if (s...
[ "0.527008", "0.52698696", "0.524057", "0.5223746", "0.51484984", "0.51447755", "0.5130769", "0.5125749", "0.51056904", "0.5040523", "0.50168765", "0.5009976", "0.49892262", "0.4977164", "0.4975657", "0.49361765", "0.493396", "0.48516387", "0.48231938", "0.48164552", "0.481029...
0.5585474
0
System.out.println("Key pressed code=" + e.getKeyCode() + ", char=" + e.getKeyChar());
public void keyTyped(KeyEvent e) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "char getKeyPressChar();", "public void keyPressed(KeyEvent e) { }", "public void keyPressed( KeyEvent e ) { }", "public void keyPressed(KeyEvent e) {}", "@Override\n\tpublic void keyTyped(KeyEvent e) {\n\t\tchar letra= e.getKeyChar();\n\t\tSystem.out.println(letra);\n\t\n\t}", "public void keyPressed...
[ "0.81076646", "0.79259557", "0.7881503", "0.7873582", "0.77672195", "0.77543", "0.7662576", "0.76613426", "0.7571282", "0.7571282", "0.7535061", "0.7535061", "0.7535061", "0.75241816", "0.750966", "0.750966", "0.750966", "0.7503464", "0.7493192", "0.747914", "0.7477473", "0...
0.0
-1
System.out.println("Key pressed code=" + e.getKeyCode() + ", char=" + e.getKeyChar());
public void keyReleased(KeyEvent e) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "char getKeyPressChar();", "public void keyPressed(KeyEvent e) { }", "public void keyPressed( KeyEvent e ) { }", "public void keyPressed(KeyEvent e) {}", "@Override\n\tpublic void keyTyped(KeyEvent e) {\n\t\tchar letra= e.getKeyChar();\n\t\tSystem.out.println(letra);\n\t\n\t}", "public void keyPressed...
[ "0.8107658", "0.79258585", "0.78813684", "0.78734213", "0.7767288", "0.7754341", "0.76626796", "0.76614106", "0.7571343", "0.7571343", "0.75350934", "0.75350934", "0.75350934", "0.7524203", "0.7509737", "0.7509737", "0.7509737", "0.7503435", "0.7493203", "0.74788034", "0.7477...
0.0
-1
Default Key Fields Constructor for class News
public News ( Long in_newsId ) { this.setNewsId(in_newsId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Generated\n public NewsModel() {\n }", "public ContentKey() {}", "public MultiKey() {}", "public ArticleData() {\r\n\t\tid = Constants.EMPTY_STRING;\r\n\t\tname = Constants.EMPTY_STRING;\r\n\t\turl = Constants.EMPTY_STRING;\r\n\t\tdesc = Constants.EMPTY_STRING;\r\n\t\tlevels = Constants.EMPTY_STRING;\...
[ "0.66236645", "0.6494774", "0.62801445", "0.62124354", "0.6116499", "0.6092313", "0.60685086", "0.6025565", "0.59951556", "0.594239", "0.5933515", "0.59246105", "0.59106505", "0.59094924", "0.5900762", "0.5877653", "0.58612865", "0.5834462", "0.58305895", "0.5828652", "0.5804...
0.60065645
8
Constructs one individual. Takes Simulation class as parameter. By using world, it has access to shared properties of world. Initialize individual with random values. Initial current state is moving state. When individual is created, it is healthy, so set state to healthy and inform world to you are healthy.
public Individual(Simulation world) { moving = new Moving(this); inConversation = new InConversation(this); inHospital = new InHospital(this); dead = new Dead(this); currentState = moving; speed = random.nextInt(25)+1; xSpeed = (int) (Math.pow(-1, random.nextInt(2)) * speed * Math.cos(Math.PI/4)); ySpeed = (int) (Math.pow(-1, random.nextInt(2)) * speed * Math.cos(Math.PI/4)); socialDistance = random.nextInt(10); conversationTime = random.nextInt(5) + 1; double[] maskChoice = {0.2, 1}; maskIndicator = maskChoice[random.nextInt(2)]; individualSize = 5; healthStatus = HealthStatus.HEALTHY; this.world = world; x = random.nextInt(world.getSIMULATION_WIDTH() - individualSize); y = random.nextInt(world.getSIMULATION_HEIGHT() - individualSize); timerList = new ArrayList<>(); hospitalNeed = new Thread(new Runnable() { @Override public void run() { try { world.getHospital().acceptIndividual(); synchronized (this) { currentState.goHospital(); } } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }); world.healthy(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public MyAgent(World world)\n {\n w = world; \n }", "public Simulation(String simulationName) {\n LOG.info(\"New simulation: \" + simulationName);\n initState(simulationName);\n }", "protected Individual(Infrastructure infra)\n\t\t{\tint num_genes = 0;\n\t\t\tfor(int i=0;i<num_n...
[ "0.60829633", "0.59133697", "0.5908927", "0.5853801", "0.57904965", "0.5769797", "0.57522225", "0.5689441", "0.56709635", "0.5637154", "0.561743", "0.5606852", "0.56043106", "0.55612385", "0.55589086", "0.55507576", "0.5542658", "0.55337113", "0.55173385", "0.54830205", "0.54...
0.78637385
0
This is update function of individual. This function called by simulation map view. Every update of GUI, if current state of individual is "moving", it is position increased by x and y speeds. If individual reaches edge of map dimension, it changes its direction against current direction, if individual already exceeds dimension, it return back to visible place. Also this swing timer update, timer list timers so, individual can change state according to this timer updates. Also this update method broadcast to world its location update and world uses that information to check any collision with another individual.
public void update() { if(currentState == moving) { x += xSpeed; y += ySpeed; if(x < 0 || x > world.getSIMULATION_WIDTH() - individualSize) randomizeDirection(); if(y < 0 || y > world.getSIMULATION_HEIGHT() - individualSize) randomizeDirection(); if(x < 0) x = 0; if(x > world.getSIMULATION_WIDTH() - individualSize) x = world.getSIMULATION_WIDTH() - individualSize; if(y < 0) y = 0; if(y > world.getSIMULATION_HEIGHT() - individualSize) y = world.getSIMULATION_HEIGHT() - individualSize; } for(PlayPauseTimer timer: timerList) timer.update(); world.locationUpdate(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void update()\r\n {\n for (MapObject mo : gameData.getMap().getObjects())\r\n {\r\n mo.getAI().advance();\r\n }\r\n \r\n // update the UI\r\n for (UIElement uiEl : ui.getUIElements())\r\n {\r\n uiEl.update();\r\n }\r\n\r\n ...
[ "0.6973446", "0.6676728", "0.6561598", "0.6466679", "0.638319", "0.6360021", "0.63518935", "0.626477", "0.62259406", "0.6223419", "0.62178177", "0.62144595", "0.62123525", "0.62083304", "0.61644584", "0.61291957", "0.6107186", "0.6096032", "0.60908324", "0.6090447", "0.608628...
0.7305059
0
This function used check any collision with another individual. It uses rectangle bound of individual and using rectangle method intersects to check collision.
public boolean collision(Individual otherIndividual) { Rectangle other = otherIndividual.bounds(); if(this.bounds().intersects(other)) return true; else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Rectangle getCollisionBox();", "public void checkCollision() {}", "Rectangle getCollisionRectangle();", "Rectangle getCollisionRectangle();", "public abstract boolean collisionWith(CollisionObject obj);", "void checkCollision(Entity other);", "private boolean collision1() {\n return game.racket1...
[ "0.6818854", "0.6762192", "0.66404384", "0.66404384", "0.6639898", "0.66057354", "0.6597147", "0.64562595", "0.64539206", "0.6441223", "0.6425566", "0.64243746", "0.63832504", "0.63758713", "0.6360161", "0.63296413", "0.6268443", "0.6262487", "0.61970085", "0.6173882", "0.617...
0.6965447
0
Gets bounds of current individual
public Rectangle bounds() { return (new Rectangle(x, y, 10, 10)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Bounds getBounds () { return (bounds); }", "Rectangle getBounds();", "public int getBound();", "public Rectangle getBounds();", "public Rectangle getBounds();", "public final BoundingBox getBounds() {\n\t\tif (bounds==null) {\n\t\t\tint srsID =( (Geometry)this.get(0).getDefaultGeometry()).getSRID(...
[ "0.78879124", "0.7684051", "0.76107746", "0.7550256", "0.7550256", "0.7504835", "0.7462285", "0.74454325", "0.742858", "0.7409983", "0.74079865", "0.7384373", "0.7384373", "0.7384373", "0.73785585", "0.7362133", "0.7356691", "0.7317764", "0.72989964", "0.7291646", "0.7288883"...
0.73451763
17
This method used to draw individual on simulation map. If current state is moving or in conversation, individual must appear on map. It uses health status to give more information about health state of individual. Black used for healthiness, red used for infected.
public void paint(Graphics2D g2d) { if(currentState == moving || currentState == inConversation) { switch (healthStatus) { case HEALTHY: g2d.setColor(Color.BLACK); break; case INFLECTED: g2d.setColor(Color.RED); break; default: break; } g2d.fillRect(x, y, individualSize, individualSize); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public synchronized void draw()\n\t{\n\t\t// First update the lighting of the world\n\t\t//int x = avatar.getX();\n\t\t//int y = avatar.getY();\t\t\n\n\t\tfor (int x = 0; x < width; x++)\n\t\t{\n\t\t\tfor (int y = 0; y < height; y++)\n\t\t\t{\n\t\t\t\ttiles[x][y].draw(x, y);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (int i =...
[ "0.593635", "0.58882946", "0.5811165", "0.5692994", "0.56511974", "0.56468815", "0.5621262", "0.561455", "0.5596332", "0.5540516", "0.5539735", "0.5505524", "0.54961246", "0.5485481", "0.54799193", "0.5464711", "0.54338914", "0.5428428", "0.5427983", "0.5425516", "0.54186594"...
0.59121
1
After collision and investigation, if individual is get infected, its states and timers updated by that event. First health status is changed to infected to infected other individuals and indicate its color. Then individual's death timer is starts with according to current mortality rate of world. This timer has action that call justDie() function to set state to dead and parameters and removes timer from timer list of individual. It also sets up hospital need thread to prepare for starting when goHospital timer is finished. This thread function uses world's hospital reference and tries to go hospital. If hospital is available individual will accepted and tries to set up and change state to "in hospital" state by using goHospital() function. Also for start that thread there must be some time to spend. This time 25 second. After 25 second individual understand it is infected and tries to go hospital by starting hospitalNeed thread. At the end individual inform word with its infection to update statistics.
public void getCovid() { setHealthStatus(HealthStatus.INFLECTED); deathTimer = new PlayPauseTimer((int) (100*(1 - world.getMortalityRate())), new ActionListener() { @Override public void actionPerformed(ActionEvent e) { justDie(); timerList.remove(deathTimer); } }, world.getRefreshTime()); timerList.add(deathTimer); hospitalNeed = new Thread(new Runnable() { @Override public void run() { try { world.getHospital().acceptIndividual(); goHospital(); } catch (InterruptedException e) { } } }); goHospitalTimer = new PlayPauseTimer(25, new ActionListener() { @Override public void actionPerformed(ActionEvent e) { hospitalNeed.start(); timerList.remove(goHospitalTimer); } }, world.getRefreshTime()); timerList.add(goHospitalTimer); world.infect(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void goHospital()\n\t{\n\t\tsynchronized (this) {\n\t\tworld.hospitalizedIndividual();\n\t\tcurrentState.goHospital();\n\t\t}\n\t}", "public void burry()\n\t{\n\t\tworld.death();\n\t\ttimerList.clear();\n\t\tif(hospitalNeed != null && hospitalNeed.isAlive())\n\t\t\thospitalNeed.interrupt();\n\t}", "publ...
[ "0.60824025", "0.605935", "0.5989367", "0.5901637", "0.57742983", "0.5771291", "0.5696809", "0.56708777", "0.56501305", "0.56389624", "0.5621051", "0.5620243", "0.56025845", "0.548589", "0.5473542", "0.54027814", "0.5365722", "0.5312319", "0.5306677", "0.52866054", "0.5246413...
0.61129713
0
Go hospital called when individual is accepted by hospital. It also inform world to its hospitalization. Since state can change, it happens in synchronized block. Current state define action. If user is already dead, hospitalization doesn't effect anything and individual exits hospital immediately. Otherwise in case moving or conversation, individual is get into hospital immediately to start healing process.
public void goHospital() { synchronized (this) { world.hospitalizedIndividual(); currentState.goHospital(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\t\tpublic void action() {\n\t\t\tswitch (state) {\r\n\t\t\tcase REGISTER:\r\n\t\t\t\tSystem.out.println(\"Philosopher Agent \"\r\n\t\t\t\t\t\t+ myAgent.getAID().getName()\r\n\t\t\t\t\t\t+ \" trying to register\");\r\n\t\t\t\t\r\n\t\t\t\t// searching for waiter agent\r\n\t\t\t\twhile(waiter == null) {...
[ "0.6256287", "0.592419", "0.58466864", "0.5737568", "0.5725186", "0.5717976", "0.5712651", "0.5649383", "0.5582351", "0.5555276", "0.5525043", "0.5523344", "0.5502297", "0.54701966", "0.54434407", "0.5439606", "0.54269016", "0.5397927", "0.53825295", "0.53672457", "0.535018",...
0.7431002
0
Removes death timer from timer list to prevent individual to death. Called in case of succesfully get into hospital.
public void dontDie() { timerList.remove(deathTimer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void onDeath() {\n\t\tsuper.onDeath();\n\n\t\ttentacles.stream().filter(npc -> !npc.isDead()).forEach(npc -> npc.setDead(true));\n\t\trespiratorySystems.stream().filter(npc -> !npc.isDead()).forEach(npc -> npc.setDead(true));\n\t\tspawns.stream().filter(npc -> !npc.isDead()).forEach(npc -> npc....
[ "0.65099543", "0.64018655", "0.6285464", "0.6265112", "0.6262794", "0.6198268", "0.6184677", "0.615131", "0.6118025", "0.61076564", "0.595637", "0.59161884", "0.5912129", "0.5839179", "0.5797022", "0.57764655", "0.57447565", "0.57440674", "0.5720181", "0.5715429", "0.5696304"...
0.79325736
0
When individual is healed, it discharge from hospital to open place for other individuals. Also a user can get into hospital which is already dead. It immediately call that function to open place for already living individuals.
public void exitHospital() { world.getHospital().dischargeIndividual(); world.dischargedIndividual(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void goHospital()\n\t{\n\t\tsynchronized (this) {\n\t\tworld.hospitalizedIndividual();\n\t\tcurrentState.goHospital();\n\t\t}\n\t}", "void financialDistrict() {\n location = \"financialDistrict\";\n\n System.out.print(\"______________________________________________________________\\n\");\n ...
[ "0.6631422", "0.5501416", "0.54838043", "0.5430207", "0.5366517", "0.53589875", "0.5356882", "0.5349171", "0.5343307", "0.5340172", "0.5314547", "0.5258821", "0.52263975", "0.5198683", "0.5188352", "0.5179164", "0.51718736", "0.5154377", "0.51376927", "0.5133627", "0.5132119"...
0.6078436
1
This function used to start healing process when individual is get into hospital right in time. It removes all timer list of individual, and starts a 10 second healing process. After that healing, individual inform world of its healthiness, change state to "moving" to return back to population and exits hospital to open place for other infected individuals.
public void startHealing() { timerList.clear(); inHospitalTimer = new PlayPauseTimer(10, new ActionListener() { @Override public void actionPerformed(ActionEvent e) { world.heal(); x = random.nextInt(world.getSIMULATION_WIDTH() - individualSize); y = random.nextInt(world.getSIMULATION_HEIGHT() - individualSize); moveInPopulation(); exitHospital(); healthStatus = HealthStatus.HEALTHY; timerList.remove(inHospitalTimer); } }, world.getRefreshTime()); timerList.add(inHospitalTimer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void burry()\n\t{\n\t\tworld.death();\n\t\ttimerList.clear();\n\t\tif(hospitalNeed != null && hospitalNeed.isAlive())\n\t\t\thospitalNeed.interrupt();\n\t}", "public void goHospital()\n\t{\n\t\tsynchronized (this) {\n\t\tworld.hospitalizedIndividual();\n\t\tcurrentState.goHospital();\n\t\t}\n\t}", "publ...
[ "0.620196", "0.5923339", "0.584562", "0.58155143", "0.573788", "0.56981206", "0.5661526", "0.56198424", "0.56187016", "0.55956876", "0.55714995", "0.5567657", "0.55484384", "0.5533682", "0.545823", "0.5427777", "0.5427481", "0.54041886", "0.53936034", "0.53793645", "0.5378477...
0.738636
0
Gets current state reference of individual
public State getCurrentState() { return currentState; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public S getCurrentState();", "public State getMyCurrentState () {\n return myCurrentState;\n }", "public com.commercetools.api.models.state.StateReference getState() {\n return this.state;\n }", "protected S state() {\n return state;\n }", "String getCurrentState() {\n ...
[ "0.7248866", "0.7042768", "0.6907899", "0.67855173", "0.6784747", "0.6756054", "0.6739173", "0.6732434", "0.67026436", "0.66894627", "0.6677965", "0.6656877", "0.6648968", "0.6645237", "0.6643603", "0.66053534", "0.6591014", "0.6589014", "0.6553646", "0.6545427", "0.6544144",...
0.6530912
22
Sets current state reference of individual.
public void setCurrentState(State currentState) { this.currentState = currentState; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setState(final StateReference state);", "public void setState(States s) {\n\t\tthis.state = s;\n\t}", "public void setMyState(MesiStates theMesiState)\n\t{\n\t\tmyMesiState = theMesiState;\n\t}", "void setState(Object state);", "public synchronized void set() {\n this.currentState = Even...
[ "0.6687555", "0.61251175", "0.6033773", "0.60186404", "0.59976023", "0.5996908", "0.5955009", "0.59484553", "0.5946919", "0.5911214", "0.5890197", "0.58702177", "0.5841882", "0.5840959", "0.58225733", "0.58225733", "0.5818711", "0.5818241", "0.58093727", "0.5794156", "0.57774...
0.0
-1
Gets moving state reference of individual
public State getMoving() { return moving; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Object GetMove (Object game_state);", "public int getStateOfMovement(){ return stateOfMovement; }", "public static MovingShape getInstance() {\n return state;\n }", "State getTarget();", "public IPlacementState getState();", "public Boolean getMovingState()\r\n\t{\r\n\t\tObject[] result = pPare...
[ "0.7015389", "0.69814986", "0.6540957", "0.65024483", "0.6281976", "0.60958475", "0.6069328", "0.6056186", "0.60482335", "0.60452557", "0.5992575", "0.5955563", "0.5941617", "0.59336144", "0.58808786", "0.58698756", "0.58493626", "0.582298", "0.57998174", "0.57998174", "0.579...
0.72874683
0
Gets in conversation state reference of individual
public State getInConversation() { return inConversation; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getStateId(Conversation conversation);", "ConnectionState getContactState();", "public StateID GetTarget()\n {\n return targetID;\n }", "public State getState()\n\t\t{\n\t\t\treturn ConferenceInfoDocument.this.getState(userElement);\n\t\t}", "public AtomicReference<LocatableInquiry>...
[ "0.6797476", "0.62337786", "0.599451", "0.5956028", "0.58489096", "0.5837287", "0.5723923", "0.56855047", "0.5677839", "0.56698173", "0.5664533", "0.56434715", "0.56434715", "0.563379", "0.56206954", "0.5620246", "0.5589381", "0.5588587", "0.5581946", "0.5581369", "0.5557513"...
0.7017717
0
Gets in hospital state reference of individual
public State getInHospital() { return inHospital; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Reference individual() {\n return getObject(Reference.class, FhirPropertyNames.PROPERTY_INDIVIDUAL);\n }", "AdministrativeState adminsatratveState();", "AdministrativeState adminsatratveState();", "public AtomicReference<LocatableInquiry> getReferenceGroundItemInquiry();", "public ...
[ "0.6197126", "0.58904344", "0.58904344", "0.58295584", "0.581103", "0.5711587", "0.5710527", "0.56926394", "0.56778955", "0.56668603", "0.56595254", "0.56373525", "0.5620847", "0.55941945", "0.5578323", "0.5567744", "0.55299366", "0.5518182", "0.5493417", "0.5471566", "0.5470...
0.74303955
0
Gets dead state reference of individual
public State getDead() { return dead; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean getDead();", "void dead() { this.alive = false; }", "default public boolean dead() {\n return life().dead();\n }", "public State who()\r\n\t{\r\n\t\tState temp = State.DEER;\r\n\t\r\n\t\treturn temp; \r\n\t}", "public boolean isDead() {\n return this.isDead;\n }", "publ...
[ "0.6616717", "0.6133997", "0.5829411", "0.5782331", "0.5760682", "0.5741245", "0.5733422", "0.57133466", "0.57090497", "0.56970435", "0.56673324", "0.56564385", "0.56384486", "0.56083417", "0.56083417", "0.5586958", "0.5520177", "0.55177253", "0.5513183", "0.5491715", "0.5490...
0.7278497
0
This process used change current state to in conversation state
public void startConversation(int conversationTime) { synchronized (this) { currentState.startConversation(conversationTime); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void updateConversationState() {\n Conversation.State state = this.anonymousConversation.getState();\n conversationStateTextView.setText(state.toString());\n switch (state) {\n case ESTABLISHED:\n this.meetingJoined = true;\n break;\n ...
[ "0.69980097", "0.652291", "0.6502802", "0.6212999", "0.6140483", "0.6130991", "0.6126959", "0.6102246", "0.60845613", "0.6049614", "0.60118455", "0.59040093", "0.58927566", "0.588431", "0.5879537", "0.5872784", "0.587265", "0.5871172", "0.5848075", "0.58479196", "0.5844988", ...
0.0
-1
If individual successfully change its state to conversation, it starts conversation timer. This timer's duration determined by both communicating individual. After time is up, individual tries to change state to again moving by calling moveInPopulation() function. Timer also added to timer list to get updates.
public void startConversationTimer(int conversationTime) { conversationTimer = new PlayPauseTimer(conversationTime, new ActionListener() { @Override public void actionPerformed(ActionEvent e) { moveInPopulation(); timerList.remove(conversationTimer); } }, world.getRefreshTime()); timerList.add(conversationTimer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void pickUpTimer()\r\n\t{\t\t\r\n\t\tSystem.out.println(timer.get());\r\n\t\tif(timer.get() < Config.Auto.timeIntakeOpen)\r\n\t\t{\r\n\t\t\t//claw.openClaw();\r\n\t\t\tSystem.out.println(\"in second if\");\r\n\t\t}\r\n\t\t\t\t\r\n\t\telse if(timer.get() < Config.Auto.timeElevatorStack)\r\n\t\t{\r\n\t\t\t//e...
[ "0.584548", "0.5604632", "0.5580702", "0.55683094", "0.5418984", "0.535996", "0.5357539", "0.5352888", "0.5313491", "0.5311396", "0.525725", "0.52314645", "0.51944804", "0.5190477", "0.51805687", "0.51787573", "0.51775753", "0.5157829", "0.5132049", "0.5122746", "0.5105628", ...
0.65114266
0
This function tries to change current state to moving state. If change is valid, individual starts moving on simulation map.
public void moveInPopulation() { synchronized (this) { currentState.moveInPopulation(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract boolean changeMove();", "@Override\r\n\tpublic void move() {\n\t\tPoint target = strategy.search(this.getLocation(), new Point(0,0));\r\n\r\n\t\tint tries = 0;\r\n\t\t\r\n\t\twhile(!state.equals(\"Inactive\") && !game.movement(this, target.x, target.y)){\r\n\t\t\ttarget = strategy.search(new Poin...
[ "0.68265575", "0.67821", "0.6780207", "0.6679596", "0.66268444", "0.6555612", "0.6552218", "0.648701", "0.6419093", "0.63942784", "0.63768876", "0.6357664", "0.6357511", "0.63356423", "0.63347423", "0.63272786", "0.6307144", "0.62755036", "0.6254761", "0.62383664", "0.623573"...
0.5837139
87
This function tries to change current state to dead state. If this change is valid, individual start dead process.
public void justDie() { synchronized (this) { currentState.justDie(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void dead() { this.alive = false; }", "private void bringToLife(){\n this.dead = false;\n }", "public void setDead(boolean dead) {\n isDead = dead;\n }", "@Override\n\t\tpublic void processStatusChanged(ProcessStatusEvent event) {\n\t\t\tif (event.getNewStatus().isDead() && event.getOldSt...
[ "0.6216395", "0.6095912", "0.595953", "0.5958203", "0.5936186", "0.58984095", "0.58938986", "0.5876889", "0.5782702", "0.57718587", "0.5754661", "0.56813025", "0.56768495", "0.5672775", "0.5630747", "0.5596882", "0.5571793", "0.5566986", "0.5547864", "0.55118245", "0.55118245...
0.0
-1
When individual is died, it state must be removed from simulation. Its timers must be stopped, its death must be broadcasted to world. Its hospital need thread must end if it is alive.
public void burry() { world.death(); timerList.clear(); if(hospitalNeed != null && hospitalNeed.isAlive()) hospitalNeed.interrupt(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void Die() {\n this.setAlive(false);\n }", "public void death() {\n\t\t\tif (died==false) {\n\t\t\t\tlives-=1;\n\t\t\t\tdeathSound.play();//play the death sound\n\t\t\t\t\n\t\t\t}\n\t\t\tpauseGame(deathSound.getLength());//pause the game until the death sound is over\n\t\t\tif (li...
[ "0.6537985", "0.6381778", "0.63507223", "0.6346385", "0.634548", "0.63345873", "0.63160795", "0.6304596", "0.6172492", "0.61713", "0.6153195", "0.61440927", "0.61196387", "0.608031", "0.604367", "0.60421604", "0.6004541", "0.5992693", "0.59856695", "0.59790796", "0.5976957", ...
0.70409566
0
This function randomize speed of individual.
public void randomizeDirection() { xSpeed = (int) (Math.pow(-1, random.nextInt(2)) * speed); ySpeed = (int) (Math.pow(-1, random.nextInt(2)) * speed); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void changeSpeed() {\n Random gen = new Random();\n speedX += gen.nextInt(3);\n speedY += gen.nextInt(3);\n }", "public abstract void randomize();", "private void random() {\n\n\t}", "SimulatedAnnealing() {\n generator = new Random(System.currentTimeMillis());\n }", ...
[ "0.6987475", "0.69424266", "0.688719", "0.65247816", "0.650006", "0.64666826", "0.6435978", "0.6384021", "0.638321", "0.63819426", "0.6377878", "0.631877", "0.631482", "0.6307231", "0.62815017", "0.6245866", "0.62257224", "0.61873245", "0.61695457", "0.6169535", "0.6151379", ...
0.6232258
16
This function check if healthy individual is get infected or not, by using parameters of both communicating individuals and world's current spreading factor. If probability is bigger than 0 user is get infected by calling getCovid() function.
public void checkInflected(Individual other) { double probability = world.getSpreadingFactor() * (1+(Math.max(other.getConversationTime(), getConversationTime()) / 10)) * getMaskIndicator() * other.getMaskIndicator() * (1-(Math.min(other.getSocialDistance(), getSocialDistance()) / 10)); if(Math.min(probability, 1) > 0.3) getCovid(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public States infectProb(int numInfected, int numInfectedV2, int V2infectivity){\n //TODO maybe adjust probability, currently each infected neighbor adds 5% chance of infection\n int risk = numInfected * 10; // 10/100 (10% chance)\n int riskV2 = numInfectedV2 * V2infectivity;\n int risk...
[ "0.62936133", "0.6258434", "0.5638628", "0.5610572", "0.56089634", "0.5414434", "0.53554887", "0.53152347", "0.5192314", "0.5157958", "0.5156981", "0.5103788", "0.50637674", "0.5059335", "0.50442", "0.50431764", "0.5025768", "0.49866617", "0.49731913", "0.48913735", "0.488429...
0.64497983
0
metoda vraca:trueracun uspesno postavljen ; false ako nije usp postavljen
public boolean setRacun(Racun racun){ // info da li je racun postavljen uspesno if(this.racun!=null){ System.out.println("za osobu "+this.ime+ " je vec registrovan racun."); return false; } this.racun=racun; //this->return return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean tienePrepaga() {\r\n\t\treturn obraSocial != null;\r\n\t}", "public boolean souvislost(){\n\t\t\n\t\tif(pole.size() != pocetVrcholu){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t\t\n\t}", "public boolean aufnehmen (T posten)\n {\n // Pruefen, ob der Posten mit Bezeichnung und Ausfueh...
[ "0.67805463", "0.6545113", "0.62588173", "0.6242854", "0.6222457", "0.61925715", "0.61894035", "0.6150073", "0.61396277", "0.6131026", "0.6122011", "0.6068874", "0.60378224", "0.60250396", "0.59890825", "0.5970443", "0.5952085", "0.5950928", "0.59161395", "0.591142", "0.58991...
0.60680306
12
Devuelve las reservas segun el id de la sala
@GetMapping("/{sala}") public List<ReservasEntity> findBySalaEquals(@PathVariable Integer sala) { return reservaRepo.findBySalaEquals(sala); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void loadReserva() {\r\n\t\tif(listaReservas.size() != 0) {\r\n\r\n\t\t}else {\r\n\t\t\tfor(int i = 0; i < 8; i++) {\r\n\t\t\t\tReservaDAO aux = new ReservaDAO();\r\n\t\t\t\taux.load_reserva(i+1);\r\n\t\t\t\tif(aux.getTitulo() != null) {\r\n\t\t\t\t\tlistaReservas.add(aux);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\...
[ "0.69616634", "0.6294376", "0.62084544", "0.6189069", "0.614088", "0.607596", "0.6061222", "0.59510916", "0.5861261", "0.5854316", "0.58444625", "0.5745437", "0.5739007", "0.5737929", "0.5730324", "0.57290673", "0.56851184", "0.5680945", "0.567818", "0.56735235", "0.5670945",...
0.5547821
31
Devuelve las reservas realizadas entre la primera fecha y la segunda
@GetMapping("/fechaBetween/{fecha1}/{fecha2}") List<ReservasEntity> findByFechaBetween(@PathVariable("fecha1") @DateTimeFormat(pattern = "yyyy-MM-dd") Date fecha1, @PathVariable("fecha2") @DateTimeFormat(pattern = "yyyy-MM-dd") Date fecha2) { return reservaRepo.findByFechaBetween(fecha1, fecha2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void ReservaEfetivadas () {\n Date hoje = new Date ();\n for (int z = 0; z < vecReserva.size(); z++) {\n if (((int) ((((entReserva)vecReserva.elementAt(z)).getDatain().getTime() - (hoje.getTime())) / 86400000L)) == 0){// Reserva será relaizada hj\n if (((entReserva)...
[ "0.693388", "0.62206846", "0.6186512", "0.6092534", "0.6000415", "0.5913931", "0.5885763", "0.57746947", "0.5732669", "0.56811285", "0.56622505", "0.5611913", "0.5598388", "0.55606073", "0.5533897", "0.55324876", "0.5507671", "0.55059874", "0.55057913", "0.5461551", "0.544226...
0.0
-1
Devuelve las reservas con motivos nulos
@GetMapping("/motivos/null") List<ReservasEntity> findByMotivoIsNull() { return reservaRepo.findByMotivoIsNull(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void dibujarArregloCamionetas() {\n\n timerCrearEnemigo += Gdx.graphics.getDeltaTime();\n if (timerCrearEnemigo>=TIEMPO_CREA_ENEMIGO) {\n timerCrearEnemigo = 0;\n TIEMPO_CREA_ENEMIGO = tiempoBase + MathUtils.random()*2;\n if (tiempoBase>0) {\n t...
[ "0.631799", "0.62278104", "0.62169814", "0.61534137", "0.60624623", "0.6022929", "0.5933793", "0.5912118", "0.58820564", "0.587177", "0.58611476", "0.5858021", "0.58525544", "0.58484334", "0.58481926", "0.58362025", "0.582724", "0.58000934", "0.5794183", "0.5791404", "0.57617...
0.0
-1
Devuelve las reservas que han sido aceptadas (true)
@GetMapping("/aceptada") List<ReservasEntity> findByAceptadaTrue() { return reservaRepo.findByAceptadaTrue(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isReserved(){\n\t\treturn reserved;\n\t}", "boolean isReserved();", "@Override\n\tpublic boolean isReserveResults() {\n\t\treturn model.isReserveResults();\n\t}", "private boolean noVacancy() {\r\n\t\t\treturn removed = false;\r\n\t\t}", "@Test\r\n\tpublic void venderVariasPiezasReservadas()...
[ "0.5976391", "0.5971003", "0.5948886", "0.5921321", "0.5912351", "0.582696", "0.5784981", "0.5744561", "0.57401454", "0.5732193", "0.57122535", "0.5692742", "0.5660351", "0.5658711", "0.56270236", "0.5626651", "0.56261605", "0.5619954", "0.56143594", "0.55932283", "0.5568182"...
0.0
-1
Devuelve las reservas con fechas posteriores a la que se inserta
@GetMapping("/fechas/{fecha}") List<ReservasEntity> findByFechaGreaterThan(@PathVariable("fecha") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date fecha) { return reservaRepo.findByFechaGreaterThan(fecha); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void BajarPieza1posicion() {\n for (int i = 0; i < 4; ++i) {\r\n int x = posicionX + piezaActual.x(i);\r\n int y = posicionY - piezaActual.y(i);\r\n piezas[(y * anchoTablero) + x] = piezaActual.getPieza();\r\n }\r\n\r\n BorrarLineas();\r\n\r\n if...
[ "0.5811786", "0.5773883", "0.5745791", "0.56538534", "0.5585351", "0.5508232", "0.548796", "0.54877687", "0.54794645", "0.5456716", "0.5414121", "0.5384237", "0.5380679", "0.53773516", "0.53725797", "0.5366702", "0.53463644", "0.5338659", "0.5330674", "0.53194064", "0.5286797...
0.0
-1
Devuelve las reservas realizadas segun el nombre y apellido
@GetMapping("/prueba/{nombre}/{apellido}") public List<ReservasEntity> findReservasByUser(@PathVariable("nombre") String nombre,@PathVariable("apellido") String apellido){ return reservaRepo.findReservasByUser(nombre,apellido); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void loadReserva() {\r\n\t\tif(listaReservas.size() != 0) {\r\n\r\n\t\t}else {\r\n\t\t\tfor(int i = 0; i < 8; i++) {\r\n\t\t\t\tReservaDAO aux = new ReservaDAO();\r\n\t\t\t\taux.load_reserva(i+1);\r\n\t\t\t\tif(aux.getTitulo() != null) {\r\n\t\t\t\t\tlistaReservas.add(aux);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\...
[ "0.621324", "0.61553824", "0.59605914", "0.58454245", "0.58108026", "0.5787472", "0.57851744", "0.57541585", "0.56516916", "0.56512725", "0.5633586", "0.56235445", "0.5589853", "0.5572178", "0.5500801", "0.5498725", "0.54685557", "0.543382", "0.54228914", "0.5418998", "0.5374...
0.6239032
0
Post que realizamos para agregar una reserva de una sala
@PostMapping("reservar") public ReservasEntity add(@RequestBody ReservasEntity reserva ) { return reservaService.add(reserva); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void ingresarReserva() throws Exception {\r\n\t\tif (mngRes.existeReservaPeriodo(getSitio().getId())) {\r\n\t\t\tif (mayorEdad) {\r\n\t\t\t\tmngRes.crearReserva(getEstudiante(), getSitio(), periodo.getPrdId(), null);\r\n\t\t\t\tlibres = mngRes.traerLibres(getSitio().getId().getArtId());\r\n\t\t\t} else {\r...
[ "0.62042457", "0.60428023", "0.59491825", "0.594874", "0.5771968", "0.5741549", "0.57219315", "0.5692098", "0.56787556", "0.5668839", "0.56539774", "0.5644233", "0.56424445", "0.5631398", "0.55722445", "0.55718356", "0.5566401", "0.55221653", "0.5481528", "0.54639447", "0.546...
0.6303657
0
TODO Autogenerated method stub
public static void main(String[] args) { SpringApplication.run(userManagementStart.class, args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
/ Test de stack stack
@Test public void testStackstack() { StackArrayList<Integer> stack = new StackArrayList<Integer>(); stack.push(1); stack.push(2); stack.push(3); stack.push(4); stack.push(5); assertEquals(5, stack.peek()); assertEquals(5, stack.pop()); assertEquals(4, stack.size()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void deleteStack(){\n // check if there is any stack present or not\n if(this.arr==null){\n System.out.println(\"No stack present, first create a stack\");\n return;\n }\n // if stack is present\n topOfStack=-1;\n arr=null;\n System.out....
[ "0.7154337", "0.6963489", "0.6858587", "0.6719213", "0.6717482", "0.6670034", "0.66611147", "0.66449064", "0.66427517", "0.6586373", "0.6566242", "0.6546642", "0.65436614", "0.6501338", "0.6438919", "0.6418129", "0.6410533", "0.6378543", "0.63678974", "0.63670456", "0.6359942...
0.6022786
63
/ Test de stack Lista Encadenada
@Test public void testStackListaEncadenada() { StackListaEncadenada<Integer> stack = new StackListaEncadenada<Integer>(); stack.push(1); stack.push(2); stack.push(3); stack.push(4); stack.push(5); assertEquals(5, stack.peek()); assertEquals(5, stack.pop()); assertEquals(4, stack.size()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void pushOnStackTest_Correct(){\n assertEquals(stack.getTop().getData() , stack.getStack().returnFirst());\n }", "@Test\r\n public void testStackListaDobleEncadenada() {\r\n StackListaDobleEncadenada<Integer> stack = new StackListaDobleEncadenada<Integer>();\r\n\r\n s...
[ "0.7053237", "0.704571", "0.67384064", "0.6691952", "0.66667897", "0.6513621", "0.6475161", "0.64173234", "0.6337412", "0.6313889", "0.6270945", "0.6236521", "0.62022173", "0.6197192", "0.61378485", "0.6131064", "0.6129885", "0.6074258", "0.6050875", "0.6037952", "0.6026106",...
0.72690415
0
/ Test de stack Lista Doblemente Encadenada
@Test public void testStackListaDobleEncadenada() { StackListaDobleEncadenada<Integer> stack = new StackListaDobleEncadenada<Integer>(); stack.push(1); stack.push(2); stack.push(3); stack.push(4); stack.push(5); assertEquals(5, stack.peek()); assertEquals(5, stack.pop()); assertEquals(4, stack.size()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n public void testStackListaEncadenada() {\r\n StackListaEncadenada<Integer> stack = new StackListaEncadenada<Integer>();\r\n\r\n stack.push(1);\r\n stack.push(2);\r\n stack.push(3);\r\n stack.push(4);\r\n stack.push(5);\r\n\r\n assertEquals(5, stack.peek...
[ "0.68948317", "0.6102008", "0.6092188", "0.5890671", "0.58711314", "0.5754108", "0.5711736", "0.5671152", "0.56666815", "0.56453425", "0.5613913", "0.56069326", "0.560654", "0.5593514", "0.55313694", "0.5523208", "0.5469645", "0.544308", "0.5440731", "0.5439417", "0.5431478",...
0.6980468
0
/ Test de stack Lista Doblemente Encadenada
@Test public void testStackVector() { StackVector<Integer> stack = new StackVector<Integer>(); stack.push(1); stack.push(2); stack.push(3); stack.push(4); stack.push(5); assertEquals(5, stack.peek()); assertEquals(5, stack.pop()); assertEquals(4, stack.size()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n public void testStackListaDobleEncadenada() {\r\n StackListaDobleEncadenada<Integer> stack = new StackListaDobleEncadenada<Integer>();\r\n\r\n stack.push(1);\r\n stack.push(2);\r\n stack.push(3);\r\n stack.push(4);\r\n stack.push(5);\r\n\r\n assertEqual...
[ "0.6979757", "0.68936217", "0.6098149", "0.6088722", "0.5886073", "0.5866866", "0.5749474", "0.5708746", "0.56684655", "0.5664044", "0.56469136", "0.56115913", "0.56045103", "0.56032807", "0.5589689", "0.5527721", "0.5520961", "0.5466615", "0.5440436", "0.5438404", "0.5437463...
0.50675637
84
chiamati dal controller Chiede all'utente su quale corsia vuole scommettere,quanto, e se piazzato o vincente
String[] chiediScommessa();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void estiloAcierto() {\r\n\t\t /**Bea y Jose**/\t\t\r\n \r\n\t}", "private void inToTrinh(HttpServletRequest request, ApplicationContext appConText, GiaHanForm giaHanForm, HttpServletResponse reponse) throws Exception {\r\n\t\tCuocTtktService service = new CuocTtktService();\r\n\t\tString cuocTtktId=giaHa...
[ "0.67590266", "0.6414793", "0.6382561", "0.6376566", "0.63227504", "0.62508863", "0.62424475", "0.62408674", "0.62307084", "0.6110489", "0.6102347", "0.60683864", "0.60621893", "0.6047526", "0.6047526", "0.6046013", "0.60440904", "0.6043073", "0.60279924", "0.6024611", "0.601...
0.0
-1
Se il giocatore vuole fare una seconda scommessa,viene lanciato il metodo per scommettere. Altrimenti setta il paramentro vincente/piazzato a valore nullo (N)
String[] chiediSecondaScommessa();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void pridejNovePivo ()\n\t{\n\t\n\t\tpivo = pivo + PRODUKCE;\n\t\t\n\t}", "PrimitivaComunicacion(String simbolo){\r\n this.simbolo = simbolo;\r\n }", "public void carroNoAgregado(){\n System.out.println(\"No hay un parqueo para su automovil\");\n }", "public void limpiarProcesoBusqueda...
[ "0.6692232", "0.6545629", "0.64959", "0.62777704", "0.6235652", "0.6116787", "0.6100717", "0.6080742", "0.60790265", "0.60545075", "0.6050223", "0.60495037", "0.59880817", "0.5973789", "0.596958", "0.5969554", "0.59562194", "0.59005326", "0.589959", "0.58990383", "0.5895133",...
0.0
-1
Stampa a video una stringa generica
void stampaMessaggio(String messaggio);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void printOut(String s)\n {\n outVideo.println(s);\n outVideo.flush();\n }", "public void recordVideo() {\n\n }", "@Override\n\tprotected Object doInBackground() throws Exception {\n\t\tString cmd=\"ffmpeg -y -i \"+videoFile+ \" -vf \\\"drawtext=/usr/share/fonts/truetype/dejavu/D...
[ "0.6206718", "0.6034032", "0.60005367", "0.59344983", "0.588379", "0.5819913", "0.5790428", "0.57777065", "0.5772725", "0.5769684", "0.5727721", "0.57247007", "0.5687637", "0.56848735", "0.56477547", "0.55813354", "0.5570483", "0.556895", "0.55607456", "0.5539935", "0.5534584...
0.5168625
48
Metodo per bloccare la logica in attesa di un comando dell'utente
void prosegui(String messaggio);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void logUser() {\n }", "public void logincredentials() {\n\t\tutil.entertext(prop.getValue(\"locators.text.uname\"), \"admin\");\n\t\tutil.entertext(prop.getValue(\"locators.text.password\"), \"Admin123\");\n\t\tutil.ClickElement(prop.getValue(\"locators.button.regdesk\"));\n\t\tutil.ClickElement(prop...
[ "0.6162745", "0.6102149", "0.609986", "0.6029971", "0.601797", "0.59057975", "0.5869252", "0.584452", "0.58166957", "0.57912105", "0.57510525", "0.5735639", "0.56993777", "0.56914854", "0.5686074", "0.5660823", "0.56346387", "0.5615803", "0.5615061", "0.5606851", "0.5599192",...
0.0
-1
chiamati dal model Metodo per gestire le notifiche in arrivo dal model
void notify(HorseFeverEvent e);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void paso0() {\n n = graph.getNodeIndices().indexOf(actual);\n nodo = graph.getNodes().get(n);\n nodo.setEstado(Node.State.CURRENT);\n nodo.pintarNodo(g);\n // comprueba si es objetivo\n if (nodo.getEsObjetivo()) {\n // establece el objetiv...
[ "0.6000608", "0.58047956", "0.56970406", "0.55994594", "0.5564809", "0.5546096", "0.5536125", "0.5492582", "0.54904824", "0.5488643", "0.5477612", "0.54392636", "0.54141104", "0.5413945", "0.5410896", "0.54092723", "0.540606", "0.5401643", "0.53972626", "0.53712034", "0.53695...
0.0
-1
Instantiates a new User.
public User() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public User() {\n log.debug(\"Create a User object\");\n }", "public User createUser() {\n printer.println(\"Welcome! Enter you name and surname:\");\n printer.println(\"Name:\");\n String name = input.nextString();\n printer.println(\"Surname:\");\n String surname = ...
[ "0.7582088", "0.73480594", "0.7273225", "0.7200439", "0.71243304", "0.71243304", "0.71243304", "0.711101", "0.71006274", "0.707437", "0.70445484", "0.70134807", "0.70035017", "0.6995122", "0.6994287", "0.69751424", "0.69751424", "0.69751424", "0.69751424", "0.69751424", "0.69...
0.71821743
6
Instantiates a new User no id
public User(String firstName, String lastName, String email, String password, String userName) { this(); this.firstName = firstName; this.lastName = lastName; this.email = email; this.password = password; this.userName = userName; createContributorPrivilege(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Appuser newUser() {\n //TODO: get logged user from security context\n String createdBy = \"REST\";\n Appuser au = new Appuser();\n Userdetails ud = new Userdetails();\n boolean idOK = false;\n Long id = 0L;\n while (!idOK) {\n id = EntityIdGenerat...
[ "0.7650244", "0.7557491", "0.7554049", "0.7554049", "0.7554049", "0.7508155", "0.7470328", "0.7452072", "0.74396074", "0.74396074", "0.74396074", "0.73701435", "0.73642164", "0.7355061", "0.7332894", "0.72844154", "0.72647625", "0.72606534", "0.72603697", "0.7258802", "0.7250...
0.0
-1
Instantiates a new User.
public User(String firstName, String lastName, Long userid, String email, String password, String userName) { this(); this.firstName = firstName; this.lastName = lastName; this.userid = userid; this.email = email; this.password = password; this.userName = userName; createContributorPrivilege(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public User() {\n log.debug(\"Create a User object\");\n }", "public User createUser() {\n printer.println(\"Welcome! Enter you name and surname:\");\n printer.println(\"Name:\");\n String name = input.nextString();\n printer.println(\"Surname:\");\n String surname = ...
[ "0.7582088", "0.73480594", "0.7273225", "0.7200439", "0.71821743", "0.71821743", "0.71821743", "0.71243304", "0.71243304", "0.71243304", "0.711101", "0.71006274", "0.707437", "0.70445484", "0.70134807", "0.70035017", "0.6995122", "0.6994287", "0.69751424", "0.69751424", "0.69...
0.65357715
72
FirefoxProfile newProfile = new FirefoxProfile(); newProfile.setPreference("browser.cache.disk.enable", false); driver = new FirefoxDriver(newProfile); driver = new FirefoxDriver();
public WebDriver initializeDriver(WebDriver driver) { ChromeOptions options = new ChromeOptions(); options.addArguments("disable-infobars"); Map<String, Object> prefs = new HashMap<>(); prefs.put("credentials_enable_service", false); prefs.put("profile.password_manager_enabled", false); options.setExperimentalOption("prefs", prefs); driver = new ChromeDriver(options); driver.manage().window().maximize(); return driver; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setFirefoxDriver() throws Exception {\n\t\t// Disable cache\n\t\tffProfile.setPreference(\"browser.cache.disk.enable\", false);\n\t\tffProfile.setPreference(\"browser.cache.disk_cache_ssl\", false);\n\t\tffProfile.setPreference(\"browser.cache.memory.enable\", false);\n\t\tffProfile.setPreference(\"br...
[ "0.757007", "0.6764399", "0.666708", "0.64646167", "0.644841", "0.64482886", "0.64480627", "0.64236563", "0.6398326", "0.6393131", "0.6373735", "0.63440704", "0.6335465", "0.632778", "0.63101596", "0.6290352", "0.6285155", "0.6281913", "0.62736654", "0.62579644", "0.62502164"...
0.0
-1
TODO Autogenerated method stub System.out.println(args[0]); System.out.println(args[1]);
public static void main(String[] args) throws IOException{ Scanner sc = new Scanner(System.in); ValuesRecords values = new ValuesRecords(args[1]); BTreeStructure btree = new BTreeStructure(args[0]); while(sc.hasNext()) { //get command here! String commline = sc.nextLine(); //split, then check comm[0] if exit; break if true, else commandLine String[] comm = commline.split(" "); if(comm[0].equals("exit")) { break; } //invalid command rejector else if (!comm[0].equals("insert")||!comm[0].equals("select")||!comm[0].equals("update")) { System.out.println("ERROR: invalid command"); } else { commandLine(values, btree, commline); } } sc.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n System.out.println(\"args[0] = \" + args[0]);\n System.out.println(\"args[1] = \" + args[1]);\n System.out.println(\"args[2] = \" + args[2]);\n }", "public static void main(String[] args) {\n\t\tfor (int i =0; i<args.length; i++) {\r\n\t\t\tSyste...
[ "0.82079196", "0.8010626", "0.79416114", "0.79365647", "0.7897008", "0.7886174", "0.787778", "0.7863757", "0.7861694", "0.7835075", "0.78246176", "0.78155005", "0.7808297", "0.7808297", "0.7808297", "0.7808297", "0.78004515", "0.7796408", "0.7793028", "0.7793028", "0.7793028"...
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { Outer o=new Outer(); Outer.inner in=o.new inner(); in.disp_inner(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
Constructor for objects of class Triangulo
public Triangulo(double l1, double l2, double l3) { // initialise instance variables lado1=l1; lado2=l2; lado3=l3; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Triangulo(int L1, int b, float h) { // el metodo constructor con su parametros que me se servira para inicializar mis atributos\r\n lado = L1;\r\n base = b;\r\n haltura = h;\r\n }", "public Triangle() {}", "public Triangles()\n {\n this.triangles = new ArrayList<>();\n ...
[ "0.7647777", "0.73118705", "0.7301778", "0.7180028", "0.7180028", "0.71081626", "0.70190525", "0.690407", "0.6854283", "0.6844558", "0.6801465", "0.67831063", "0.67674", "0.6740422", "0.65786695", "0.6569161", "0.6562382", "0.6550363", "0.6544397", "0.65413076", "0.6529382", ...
0.78182894
0
constructor with folder log path
public Methods(String sLogFolderPath) { try { initialize(); setLogFolderPath(sLogFolderPath); } catch (Exception e) { println("Methods(String sLogFolderPath) : " + e.toString()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Log()\n {\n filePath = String.format(\"log-%d.sl\", System.currentTimeMillis());\n\n open();\n }", "LogFile(File file)\n {\n this.file = file;\n }", "public Journal(String folder, String imageFileName, String editLogFileName) throws IOException {\n if (!folder.endsWith(Consta...
[ "0.69587964", "0.6678341", "0.66414094", "0.6589537", "0.652467", "0.6479276", "0.64294225", "0.6397152", "0.6392707", "0.63789564", "0.63353825", "0.63330495", "0.6267654", "0.6230912", "0.6172341", "0.61679965", "0.60822594", "0.6043182", "0.60347277", "0.6029315", "0.60033...
0.5727002
50
GENERIC GLOABL UNIVERSAL METHODS method to check if remote host is reachable
public boolean isHostReachable(String sIPAddress) { try { Process p1 = java.lang.Runtime.getRuntime().exec("ping " + sIPAddress); int iRetVal = p1.waitFor(); if (iRetVal == 0) { return true; } else { return false; } //InetAddress inet = InetAddress.getByName(sIPAddress); //return (inet.isReachable(5000) ? true : false); } catch (Exception e) { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasRemoteHost();", "public boolean isNetworkReachable();", "boolean hasHost();", "boolean hasHost();", "boolean isIsRemote();", "private Callable<Boolean> isReachable() {\n return () -> {\n try {\n if (!isOnline()) {\n return false;\n ...
[ "0.792365", "0.72935843", "0.7221975", "0.7221975", "0.6999861", "0.6934642", "0.67724806", "0.6713218", "0.6667102", "0.6584197", "0.65185946", "0.6515461", "0.6487275", "0.64275557", "0.6415608", "0.6412925", "0.6408252", "0.63926226", "0.6310154", "0.62990904", "0.62424684...
0.62895024
20
OBJECT SERIALIZATION method to Serialize an Object
public boolean SerializeObject(Object object, String sFilePath) { boolean bRetVal = false; File f = null; FileOutputStream fos = null; ObjectOutputStream oos = null; try { f = new File(sFilePath); if (f.exists()) { f.delete(); } File dir = new File(f.getParent()); dir.mkdirs(); f.createNewFile(); fos = new FileOutputStream(f); oos = new ObjectOutputStream(fos); } catch (Exception e) { } finally { try { oos.writeObject(object); } catch (Exception e) { } try { oos.close(); } catch (Exception e) { } try { fos.close(); } catch (Exception e) { } f = null; return bRetVal; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void serialize(Object obj, OutputStream stream) throws IOException;", "@Override\n\tpublic byte[] serialize(Object obj) throws SerializationException {\n\t\tif(obj==null) \n\t\t{\n\t\t\treturn EMPTY_BYTE_ARRAY;\n\t\t}\n\t\treturn serializingConverter.convert(obj);\n\t}", "byte[] serialize(Serializable object);...
[ "0.7680304", "0.72406435", "0.7222007", "0.71976495", "0.71556056", "0.708579", "0.7082425", "0.7027859", "0.7007", "0.6988329", "0.69455975", "0.68831974", "0.6844032", "0.68399465", "0.67786497", "0.6772004", "0.67394245", "0.671282", "0.6664245", "0.6660006", "0.6644331", ...
0.0
-1
method to De Serialize an Object
public Object DeSerializeObject(String sFilePath) { File f = null; FileInputStream fis = null; ObjectInputStream ois = null; Object object = null; try { f = new File(sFilePath); if (!f.exists()) { throw new Exception("File Not found for " + sFilePath); } fis = new FileInputStream(f); ois = new ObjectInputStream(fis); try { object = ois.readObject(); } catch (Exception e) { } } catch (Exception e) { } finally { try { ois.close(); } catch (Exception e) { } try { fis.close(); } catch (Exception e) { } f = null; return object; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void decodeObject();", "public abstract Object deserialize(Object object);", "Object decodeObject(Object value);", "void decodeObjectArray();", "public static java.lang.Object decodeObject(com.webobjects.foundation.NSCoder coder){\n return null; //TODO codavaj!!\n }", "void serialize(Object obj...
[ "0.71930426", "0.68498313", "0.64852464", "0.6320442", "0.6297155", "0.6146381", "0.60562545", "0.59342325", "0.5918672", "0.5835254", "0.582334", "0.58085537", "0.58038086", "0.5629777", "0.5627965", "0.56184876", "0.5595363", "0.55874264", "0.55725926", "0.55606866", "0.555...
0.6021429
7
STRING/STREAM METHODS convert InputStream to String Array
public String[] getStringArrayFromInputStream(InputStream is) { BufferedReader br = null; ArrayList<String> al = new ArrayList<String>(); String line; String[] sa = null; try { br = new BufferedReader(new InputStreamReader(is)); while ((line = br.readLine()) != null) { al.add(line); } } catch (Exception e) { } finally { try { br.close(); } catch (Exception e) { } br = null; sa = al.toArray(new String[al.size()]); return sa; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String[] m36409a(InputStream inputStream) {\n try {\n BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream, \"UTF-8\"));\n String[] strArr = new String[100];\n int i = 0;\n while (true) {\n String readLi...
[ "0.655288", "0.6314459", "0.6182138", "0.6170136", "0.6158518", "0.61321", "0.6066609", "0.60502553", "0.60484636", "0.59871125", "0.5935393", "0.59330744", "0.5926688", "0.5889671", "0.5885252", "0.5878955", "0.5841479", "0.58380306", "0.5826374", "0.5819795", "0.5819382", ...
0.76581734
0
convert InputStream to String
public String getStringFromInputStream(InputStream is) { BufferedReader br = null; StringBuilder sb = new StringBuilder(); String line; try { br = new BufferedReader(new InputStreamReader(is)); while ((line = br.readLine()) != null) { sb.append(line); } } catch (Exception e) { } finally { try { br.close(); } catch (Exception e) { } br = null; return sb.toString(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String convertStreamToString(InputStream is) throws IOException {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n StringBuilder builder = new StringBuilder();\n String line;\n while ((line = reader.readLine()) != null) {\n builder.append(lin...
[ "0.8287886", "0.8158139", "0.81556314", "0.8113989", "0.8075132", "0.8070196", "0.8050584", "0.8034654", "0.8028828", "0.8010856", "0.8005428", "0.8005033", "0.7989694", "0.7987228", "0.7977151", "0.79752237", "0.7971573", "0.7952899", "0.79171985", "0.7911311", "0.7907695", ...
0.7693746
40
method replace all 'n' space & 'tab' characters into single space.
public String getSingleSpaceString(String sInputString) { String sOutputString = ""; try { //loop replace all TAB by single space while (sInputString.contains(" ")) { sInputString = sInputString.replaceAll(" ", " ").trim(); } //loop to replace all double space by single space while (sInputString.contains(" ")) { sInputString = sInputString.replaceAll(" ", " ").trim(); } } catch (Exception e) { } finally { sOutputString = sInputString; sInputString = null; return sOutputString; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected final String space(int n) {\n StringBuffer buf = new StringBuffer(0);\n for (int i = 0; i < n; i++) {\n buf.append(\" \");\n }\n return buf.toString();\n }", "private static void processTab() {\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tif (charCount == MAX_W) ...
[ "0.6953138", "0.6846682", "0.66882914", "0.66065246", "0.657741", "0.6423301", "0.62439823", "0.61423886", "0.612835", "0.61000615", "0.6035646", "0.6034102", "0.6022887", "0.5988832", "0.5984698", "0.59247684", "0.5914094", "0.58662343", "0.5861261", "0.5789072", "0.573677",...
0.58138543
19
method remove/vannish all 'n' space & 'tab' characters
public String getSpaceFreeString(String sInputString) { String sOutputString = ""; try { //loop to remove all 'tab's while (sInputString.contains(" ")) { sInputString = sInputString.replaceAll(" ", "").trim(); } //loop to remove all space space while (sInputString.contains(" ")) { sInputString = sInputString.replaceAll(" ", "").trim(); } } catch (Exception e) { } finally { sOutputString = sInputString; sInputString = null; return sOutputString; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void removeWhiteSpaceFromTabs() {\n\t\tString input = \"two tousand \" + \"\\t\" + \"\\t\" + \" sixteen\" \n\t\t\t\t+ \"new \" + \"\\t\" + \" lines!\" + \"\\n\" + \" \" + \"\\n\";\n\t\tSystem.out.println(input);\n\t\tStringUtility string...
[ "0.7071539", "0.6893322", "0.6438535", "0.6418886", "0.63886833", "0.63422364", "0.6310011", "0.62551296", "0.62527716", "0.62075394", "0.6206543", "0.613743", "0.6118753", "0.6089791", "0.605813", "0.60147", "0.60039467", "0.5998672", "0.5991294", "0.59734017", "0.5936911", ...
0.0
-1
GENERIC UTILITY METHODS method to get absolute class/jar path for class object passed as parameter
public String getClassPath(Object ClassObject) { try { String temp = null; temp = new File(ClassObject.getClass().getProtectionDomain().getCodeSource().getLocation().getPath()).getParent(); temp = URLDecoder.decode(temp, "UTF-8"); return temp; } catch (Exception e) { return ""; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ClassPath getClassPath();", "public String getClassPath();", "public static String getJarPath() {\n String classPath = \"/\" + JavaUtils.class.getName();\n classPath = classPath.replace(\".\", \"/\") + \".class\";\n try {\n URL url = JavaUtils.class.getResource(classPath);\n ...
[ "0.718757", "0.70566946", "0.67305624", "0.65908533", "0.6432008", "0.64013916", "0.6397098", "0.6358527", "0.63558984", "0.6259728", "0.621858", "0.62168884", "0.61998767", "0.6159947", "0.6135468", "0.6135468", "0.60413635", "0.60259295", "0.60259295", "0.5994583", "0.59911...
0.7061388
1
method to sort hashmap by values
public HashMap sortByValues(HashMap map) { List list = new LinkedList(map.entrySet()); // Defined Custom Comparator here Collections.sort(list, new Comparator() { public int compare(Object o1, Object o2) { return ((Comparable) ((Map.Entry) (o1)).getValue()) .compareTo(((Map.Entry) (o2)).getValue()); } }); List array = new LinkedList(); if (list.size() >= 3) // Make sure you really have 3 elements { array.add(list.get(list.size() - 1)); // The last array.add(list.get(list.size() - 2)); // The one before the last array.add(list.get(list.size() - 3)); // The one before the one before the last } else { array = list; } // Here I am copying the sorted list in HashMap // using LinkedHashMap to preserve the insertion order HashMap sortedHashMap = new LinkedHashMap(); for (Iterator it = array.iterator(); it.hasNext();) { Map.Entry entry = (Map.Entry) it.next(); sortedHashMap.put(entry.getKey(), entry.getValue()); } return sortedHashMap; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private HashMap<String, Double> sortByValues(HashMap<String, Double> map) {\n List<Map.Entry<String, Double>> list =\n new LinkedList<>(map.entrySet());\n\n Collections.sort(list, new Comparator<Map.Entry<String, Double>>() {\n @Override\n public i...
[ "0.77224314", "0.75962603", "0.74931103", "0.7470882", "0.74581534", "0.7443384", "0.74374795", "0.7428125", "0.7337419", "0.72233593", "0.71969616", "0.71769255", "0.71038854", "0.7048397", "0.7021415", "0.70093155", "0.7003645", "0.7003645", "0.7002201", "0.6980485", "0.697...
0.74015075
8
method to get exception string with class & method name
public String getExceptionString(Exception e) { StringBuffer sb = new StringBuffer(); int icount = 0; try { sb.append("Exception : "); for (int i = e.getStackTrace().length - 1; i >= 0; i--) { sb.append(e.getStackTrace()[i].getClassName()); sb.append("."); sb.append(e.getStackTrace()[i].getMethodName()); sb.append(" at Line "); sb.append(e.getStackTrace()[i].getLineNumber()); sb.append(" : "); } sb.append(e.getMessage().toUpperCase().replaceAll("JAVA.LANG.", "")); return sb.toString(); } catch (Exception e1) { return (e.toString() + " : " + e1.toString()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getException();", "String getException();", "String getCauseException();", "@Override\r\n\tpublic String toString() {\n\t\treturn \"Exception is..\" + msg;\r\n\t}", "@Override\r\n\tpublic String toString() {\n\t\treturn \"com.cg.Exercise4Exception\"+super.getMessage();\r\n\t}", "public String toSt...
[ "0.8019808", "0.8019808", "0.733962", "0.6920058", "0.66937345", "0.65841025", "0.656692", "0.65313786", "0.64800435", "0.6463635", "0.64245015", "0.63578725", "0.63046974", "0.6293853", "0.6280747", "0.6278641", "0.6277364", "0.62636745", "0.62392944", "0.6196774", "0.619677...
0.66975474
4
LOGGING PRINTING/CONSOLE DISPLAY METHODS
public boolean println(String sMessage) { String sLogFilePath = ""; String sLogFileName = ""; String sLogFolderPath = ""; try { //check for log file name if (gsLogFileName.trim().equalsIgnoreCase("")) { if (user.trim().equalsIgnoreCase("")) { sLogFileName = getDateTime("yyyyMMdd") + ".log"; } else { sLogFileName = getDateTime("yyyyMMdd") + "_" + user + ".log"; } } else { sLogFileName = gsLogFileName; } //check for user log if (user.trim().equalsIgnoreCase("")) { } ///check for log folder path if (gsLogFolderPath.trim().equalsIgnoreCase("")) { sLogFolderPath = gsRootPath + File.separator + "logs"; } else { sLogFolderPath = gsLogFolderPath; } //check for log file path if (gsLogFilePath.trim().equalsIgnoreCase("")) { sLogFilePath = sLogFolderPath + File.separator + sLogFileName; } else { sLogFilePath = gsLogFilePath; } //writing log file println(sMessage, sLogFilePath, false); return true; } catch (Exception exp) { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void displayLog() {\n if (!consoleDisplayed) {\n splitter.setDividerLocation(defaultSliderPosition);\n consoleDisplayed=true;\n }\n }", "protected void logToScreen() {\r\n\t\tif (smscListener != null) {\r\n\t\t\tsynchronized (processors) {\r\n\t\t\t\tdisplayI...
[ "0.6936917", "0.66906995", "0.6653939", "0.66280985", "0.6615863", "0.65833616", "0.6571589", "0.65610766", "0.65484273", "0.6542892", "0.6535205", "0.6535205", "0.64977014", "0.6474593", "0.646485", "0.6462232", "0.64377654", "0.6429682", "0.6418816", "0.64101076", "0.640593...
0.0
-1