query
stringlengths
8
1.54M
document
stringlengths
9
312k
negatives
listlengths
19
20
metadata
dict
Method Name : convertDOSFileToUnix Description : The Method "convertDOSFileToUnix" is used for Date : May 20, 2016, 2:56:53 PM.
@Override public boolean convertDOSFileToUnix(String filePath) throws FileSystemUtilException { try { return new ConvertFiles().dosToUnix(filePath); } catch (Exception e) { logger.error("Exception::",e); throw new FileSystemUtilException("F00002",null,Level.ERROR,e); } }
[ "@Override\r\n\tpublic boolean convertUnixFileToDOS(String filePath) throws FileSystemUtilException {\r\n\t\ttry {\r\n\t\t\treturn new ConvertFiles().unixToDos(filePath);\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(\"Exception::\",e);\r\n\t\t\tthrow new FileSystemUtilException(\"F00002\",null,Level.ERROR,e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the type of room
public void setRoomType (RoomType t) { this.type = t; }
[ "public void setType(RoomType type) {\n this.type = type;\n }", "public void setRoomType(String type){roomType = type;}", "public void setRoomType(String roomType ){\n\tthis.roomType = roomType;\n}", "public void setRoomType(java.lang.String roomType) {\n this.roomType = roomType;\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Look for a build file using the candidates suffix.
private File buildFile(final String baseUrl, final String baseName, final String... suffixes) { for (String suffix : suffixes) { if (suffix != null) { File build = new File(baseUrl, baseName + "." + suffix + ".js"); logger.debug("Searching for build's profile: {}", build.getName()); ...
[ "public void prepareLoadSearch(final String file) {\n if (file.lastIndexOf('.') > file.lastIndexOf('/')) {\n Matcher matcher = null;\n if ((matcher = sourcePattern.matcher(file)).find()) {\n // source extensions\n suffixType = Suffi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The tooltip is hidden with a delay. This value is the delay in milliseconds. Defaults to 0 (no delay). Usually this method is called internally by the JSF engine.
public void setTooltipDelayHide(int _tooltipDelayHide) { getStateHelper().put(PropertyKeys.tooltipDelayHide, _tooltipDelayHide); }
[ "public int getTooltipDelayHide() {\n\t\treturn (int) (Integer) getStateHelper().eval(PropertyKeys.tooltipDelayHide, 0);\n\t}", "public void hide() {\n\t\ttoolTipHide(CURRENT_TOOLTIP, null);\n\t}", "public void setTooltipDelayShow(int _tooltipDelayShow) {\n\t\tgetStateHelper().put(PropertyKeys.tooltipDelayShow,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get a PEMencoded X.509 crl from a string.
public static X509CRL getCRLFromString(String crl) throws CertificateException, CRLException { byte[] crlBytes = crl.getBytes(); ByteArrayInputStream bais = new ByteArrayInputStream(crlBytes); return (X509CRL) CertificateFactory.getInstance("X.509").generateCRL(bais); ...
[ "X509CRL getCrl(X509Certificate cert);", "public static X509Certificate getCertificateFromBase64String(String string) \n throws CertificateException, javax.security.cert.CertificateException \n{\n if(string.equals(\"\") || string == null) {\n return null;\n }\n\n byte[] certBytes = Base64.d...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO: remove the ifelse logic and make this more dynamic Provide input reader.
@Provides public DataInput provideInputReader() { DataInput input = null; final Reader inRdr = inReader; if ((inRdr != null) && (inputFormat != null)) { if ("csv".equalsIgnoreCase(inputFormat)) input = new CSVD...
[ "protected abstract InputReader<I> createInputReader(Context context);", "private static void readInput(){\n\t\treadInput(false);\n\t}", "java.lang.String getInput();", "protected abstract T parseInputForEntry(String input);", "public interface Input {\n /**\n * Defines method of data input\n * @...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get sink data source's table identifier
protected String getTableIdentifier(SinkConnection sinkConnection) { String quote = sinkConnection.getProperties().getQuote(); return quote + sinkConnection.getSchema() + quote + "." + quote + sinkConnection.getTable() + quote; }
[ "public String getSourceTableId() {\n return NameUtil.extractTableIdFromTableName(proto.getSourceTable());\n }", "private String getQualifiedSrcDsTableName() {\n return sourceDB + \".\" + DATASET_TABLE_NAME;\n }", "String getSourceId();", "java.lang.String getHeaderTableId();", "long getSource...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Callback invoked when first camera frame is available after camera is started.
void onFirstFrameAvailable();
[ "@Override\n public void onFrameAvailable(int cameraId) {\n }", "@Override public void onNewFrame( CameraCaptureSession session, CameraCaptureRequest request, CameraFrame cameraFrame) {\n Bitmap bmp = captureRequest.createEmptyBitmap();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the keyExpressions for the operation. Clears any existing keyExpressions
public void setKeyExpressions(List<String> keyExpressions) { if (keyExpressions == null) throw new NullPointerException(); if (m_keyExpressions == null) m_keyExpressions = new ArrayList<String>(); m_keyExpressions.clear(); m_keyExpressions.addAll(keyExpressions); }
[ "public PutItemRequest clearExpressionAttributeNamesEntries() {\n this.expressionAttributeNames = null;\n return this;\n }", "public PutItemRequest clearExpressionAttributeValuesEntries() {\n this.expressionAttributeValues = null;\n return this;\n }", "public List<String> getKe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Boucle principale du processus. le recevoir des DatagramPacket ( messages) Ecouter le groupe et recevez le message
public void run() { DatagramPacket message; byte[] messageContent; String text; while(true) { messageContent = new byte[256]; message = new DatagramPacket(messageContent, messageContent.length); try { //Recevez le message a partir du Socket socketRecep...
[ "public void run(){\n\t\tLOGGER.log(Level.INFO, \"ready to recive and send message\");\n\t\twhile(true){\t\t\n\t\t\t\n\t\t\t// se ci sono messaggi in coda li spedisco sul relativo socket\n\t\t\twhile(!MessageManager.getInstance().getSocketSendQueue().isEmpty()){\n\t\t\t\t\t\t\t\t\n\t\t\t\ttry{ // send packet in ord...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Goal: To test that the getTile() method works as expected. Testing Method: Check it returns null when no tile on the square. Check returns the right tile when there is one placed.
@Test public void testGetTile() { try { Square s = new Square(); assertNull(s.getTile()); // Should return null as no tile placed yet. s.setTile(Tile.E); // Add a tile assertEquals(Tile.E, s.getTile()); // Check the tile is now on the square ...
[ "public void testGetValidTile() {\n int testX = 0;\n int testY = 0;\n board.addTile(tree, testX, testY);\n Tile retrievedTile = board.getTile(testX, testY);\n assertSame(tree, retrievedTile);\n }", "public void testGetNullTile() {\n // Place a tile in one spot\n board.addTile(tree, 1, 1);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
call waitForStart, then handleMessage(SimStart)
@Test void testHandleMessageSimStartA () { assertFalse(uut.checkForStart()); SimStart msg = new SimStart(null); //MessageSender sender = new MessageSender(msg, 3000); System.out.println("starting"); dispatch(uut, "handleMessage", msg); //sender.start(); System.out.println("started"); ...
[ "void sendStartMessage();", "public void start() {\n notifyStart();\n simloop();\n notifyStop();\n }", "public void RequestStart() {\n\t\tif (this.simulationState == SimulationState.Idle) {\n\t\t\tsendControlMessage(\"START\");\n\t\t}\n\t}", "private void handleStart(ActionEvent action...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all the gameRules.
@Override @Transactional(readOnly = true) public List<GameRuleDTO> findAll() { log.debug("Request to get all GameRules"); List<GameRuleDTO> result = gameRuleRepository.findAll().stream() .map(gameRuleMapper::gameRuleToGameRuleDTO) .collect(Collectors.toCollection(LinkedLi...
[ "public synchronized List<Rule> getAllRules() {\n checkSafeToUpdate();\n return ruleStore.getAllRules();\n }", "public List<Rule> getRules() {\n return rules;\n }", "public LinkedHashMap<String, ArrayList<Rule>> getAllLanguageRules () {\r\n \t\treturn langRules;\r\n \t}", "public Co...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a method that decrypts the duplicatedchars.txt
public static void main(String[] args) { decryptFile("duplicated-chars.txt"); }
[ "public int problem59() {\n Path path = FileSystems.getDefault().getPath(\"./src\", \"p059_cipher.txt\");\n ArrayList<Character> charCodes = new ArrayList<>();\n\n try {\n //Split the single line on \",\" and then remove the quotations.\n List<String> lines = Files.readAll...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Insert batch transitive closure.
public void insertBatchTransitiveClosure(final String codingSchemeId, final List<TransitiveClosureBatchInsertItem> batch) { final String prefix = this.getPrefixResolver().resolvePrefixForCodingScheme(codingSchemeId); this.getSqlMapClientTemplate().execute(new SqlMapClientCallback(){ publi...
[ "public void transitiveClosure()\r\n\t{\r\n\t\tSet<Integer> t = descendantMap.keySet();\r\n\t\tint lastCount = 0;\r\n\t\tfor(int distance = 1; lastCount != descendantMap.size(); distance++)\r\n\t\t{\r\n\t\t\tlastCount = descendantMap.size();\r\n\t\t\tfor(Integer i : t)\r\n\t\t\t{\r\n\t\t\t\tVector<Integer> childs =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FCFS is a function which calculates the wait time, start time, and finished time of the jobs.
public int[][] FCFS( int arrival_time [], int job_size[] ,int n) { int[] job_wait_time= new int[n]; int[] job_start_at= new int[n]; int[] job_finished_at= new int[n]; int[][] result=new int[n][5]; job_wait_time[0]=0; job_start_at[0]=arrival_time[0]; ...
[ "public void FCFS() {\n\t\t//each simulation method shall reset the processes data\n\t\tfor (int i = 0; i < 12; i++) {\n\t\t\ta[i].reset();\n\t\t}\n\t\tint t;\n\t\t//this queue represent the ready queue\n\t\tQueue<Process> queue = new LinkedList<Process>();\n\t\t\n\t\t//sort the array in term of the arrival time of...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Getter for property adjustedStat.
public int getAdjustedStat() { return (int)Math.floor( (baseCP + adjustedCPOffset) / cpPerPoint + adjustedStartingValue); }
[ "public int getAdjustedStat() {\n return (int)Math.round( (baseCP + adjustedCPOffset) / cpPerPoint + startingValue);\n }", "public Integer getStat() {\n return stat;\n }", "public double getAdjustedStatCP() {\n return baseCP + adjustedCPOffset;\n }", "protected double asRelativeV...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Random anime for the quizz and a set of answer in a spinner
public List<String> Randomizer(ImageView anime_Image,int number) { List<String> spinner = new ArrayList<>(); new AsyncBitmapDownloader(anime_Image).execute(fourAnime.get(number).urlImage); List<Integer> listOfAnswer = Arrays.asList(0,1,2,3); // shuffle the list Collections.shuf...
[ "private void generateQuestion() {\n\n editTextUserInput.setText(null);\n\n Random random = new Random();\n int operand1 = random.nextInt(10);\n int operand2 = random.nextInt(10);\n String operator = \"\";\n\n if(operand1 == 0 || operand2 == 0)\n operator = gener...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Actions Returns the IncomingReport from the database matching the given ID, otherwise null.
public IncomingReport find(Integer id) throws DAOException;
[ "@Override\n @Transactional(readOnly = true)\n public Optional<CaseReport> findOne(Long id) {\n log.debug(\"Request to get CaseReport : {}\", id);\n return caseReportRepository.findById(id);\n }", "public ScrapReport_1 find(Integer id) throws DAOException;", "public Report getOneReport(Lo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates new form Frm_EliminaProducto
public Frm_EliminaProducto() { initComponents(); try{ actualizarTabla(); }catch(Exception e){ } }
[ "public FrmNuevoProducto() {\n initComponents();\n llenaCategorias();\n }", "public frmRegistroProductos() {\n initComponents();\n\n jTxtCodigo.setDocument(new JTextFieldLimit(20));\n jTxtNombreProducto.setDocument(new JTextFieldLimit(45));\n jTxtPrecioUnitario.setDocu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new instance of FileState
private FileState(String name,int stateId) { this.name = name; this.stateId = stateId; }
[ "public TFileFactory() {\n this(PhysicalFileSystem.instance);\n }", "@InterfaceAudience.Private\n public FileContext() {}", "public static TFileFactory inMemory() {\n return new TFileFactory(new InMemoryFileSystem());\n }", "public void setState(File state) {\r\n\t\tthis.state = state;\r\n\t}", "vo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
3. If pending alarm and all sensors are inactive, return to no alarm state
@Test public void test_3_ifPendingAlarmAndAllSensorsInactive_putSystemIntoNoAlarmStatus () { Mockito.when(securityRepository.getAlarmStatus()).thenReturn(AlarmStatus.PENDING_ALARM); sensor.setActive(true); securityService.changeSensorActivationStatus(sensor, false); Mockito.verify(s...
[ "private void handleSensorDeactivated() {\n if (securityRepository.getAlarmStatus() == AlarmStatus.PENDING_ALARM) {\n setAlarmStatus(AlarmStatus.NO_ALARM);\n }\n// switch (securityRepository.getAlarmStatus()) {\n// case PENDING_ALARM -> setAlarmStatus(AlarmStatus.NO_ALARM)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the first term in the ordered set where uuid = &63;.
public static Term findByUuid_First( String uuid, OrderByComparator<Term> orderByComparator) throws com.liferay.cm.exception.NoSuchTermException { return getPersistence().findByUuid_First(uuid, orderByComparator); }
[ "public static Term fetchByUuid_First(\n\t\tString uuid, OrderByComparator<Term> orderByComparator) {\n\n\t\treturn getPersistence().fetchByUuid_First(uuid, orderByComparator);\n\t}", "@Override\n\tpublic Arret fetchByUuid_First(\n\t\tString uuid, OrderByComparator<Arret> orderByComparator) {\n\n\t\tList<Arret> l...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the XML representation of the document (from the conferenceinfo element down), or an error string in case the XML cannot be generated for some reason.
@Override public String toString() { String s = toXml(); return s == null ? "Could not get conference-info XML" : s; }
[ "public String toXml()\n\t{\n\t\ttry {\n\t\t\tTransformer transformer = TransformerFactory.newInstance().newTransformer();\n\t\t\tStringWriter buffer = new StringWriter();\n\t\t\ttransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, \"yes\");\n\t\t\ttransformer.transform(new DOMSource(conferenceInfo), new ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "furcas_tcs_atomexp" $ANTLR start "furcas_tcs_equalsexp" ./generationTemp/generated/TCS.g:1550:1: furcas_tcs_equalsexp returns [Object ret2] : ( (temp= furcas_tcs_propertyreference )? EQ (temp= furcas_tcs_value ) ) ;
public final Object furcas_tcs_equalsexp() throws RecognitionException { Object ret2 = null; Object temp = null; IModelElementProxy ret; List<String> metaType=list("FURCAS","TCS","EqualsExp"); ret=(getBacktrackingLevel()==0) ? createModelElementProxy(metaType, false, false) : ...
[ "public final Object furcas_tcs_atomexp() throws RecognitionException {\n Object ret2 = null;\n\n Object ret = null;\n\n\n try {\n // ./generationTemp/generated/TCS.g:1538:3: ( (ret= furcas_tcs_equalsexp | ret= furcas_tcs_booleanpropertyexp | ret= furcas_tcs_isdefinedexp | ret= furca...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clears the value of the 'last_name' field.
public com.hcl.uob.poc.model.CustomerDetails.Builder clearLastName() { last_name = null; fieldSetFlags()[5] = false; return this; }
[ "public com.politrons.avro.AvroPerson.Builder clearLastName() {\n last_name = null;\n fieldSetFlags()[5] = false;\n return this;\n }", "void unsetLastname();", "public Builder clearLastName() {\n last_name = null;\n fieldSetFlags()[5] = false;\n return this;\n }", "public n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Service Interface for managing Enrollment.
public interface EnrollmentService { /** * Save a enrollment. * * @param enrollment the entity to save * @return the persisted entity */ Enrollment save(Enrollment enrollment); /** * Get all the enrollments. * * @param pageable the pagination information * @ret...
[ "public void setEnrollmentService(ProviderEnrollmentService enrollmentService) {\n this.enrollmentService = enrollmentService;\n }", "public interface EnrolmentPersistence extends BasePersistence<Enrolment> {\n\t/*\n\t * NOTE FOR DEVELOPERS:\n\t *\n\t * Never modify or reference this interface directly....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the "cost" element
void setCost(double cost);
[ "double setCost(double cost);", "public void setCost(double cost)\n\t{\n\t\tthis.cost=cost;\t\n\t}", "public void setCost(double d);", "public void setCost(){\n\n\t\t//set the cost of a tent to the following equation. 3 is the\n\t\t//daily rate.\n\t\tthis.cost = (3 * duration) * numTenters;\n\n\t}", "public...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check status of definite null assignment for a field.
final public boolean isDefinitelyNull(FieldBinding field) { // Dependant of CodeStream.isDefinitelyAssigned(..) // We do not want to complain in unreachable code if ((this.reachMode & UNREACHABLE) != 0) return false; return isDefinitelyNull(field.id); }
[ "private static boolean isEmpty(String field)\n {\n boolean status = true;\n\n if (!isNull(field))\n {\n status = (field.equalsIgnoreCase(\"NULL\") || field.equalsIgnoreCase(\"\"));\n }\n\n return status;\n }", "boolean getRequiredNull();", "void checkAgainstN...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create an array of ItemStacks with the same data as this object, but grouped into stacks.
public ItemStack[] toItemStackArray() { int maxStackSize = Material.getMaterial(itemId).getMaxStackSize(); ItemStack[] stacks; int quotient = amount / maxStackSize; if(amount % maxStackSize == 0) { stacks = new ItemStack[quotient]; } else { // If it...
[ "ItemStack createStack(int amount, int metadata);", "ItemStack createStack(int amount);", "@ZenCodeType.Method\n @ZenCodeType.Getter(\"itemStacks\")\n public Collection<IItemStack> getItemStacks() {\n \n return getItems()\n .stream()\n .map(Item::getDefaultInsta...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Copies the ArchiveEntry to the Output stream
private void copyStream(final InputStream in, final ArchiveOutputStream out, final ArchiveEntry entry) throws IOException { out.putArchiveEntry(entry); IOUtils.copy(in, out); out.closeArchiveEntry(); }
[ "public OutputArchive(ObjectOutput output) {\n this.output = output;\n }", "public void copyEntryContents( final OutputStream output )\n throws IOException\n {\n final byte[] buffer = new byte[ 32 * 1024 ];\n while( true )\n {\n final int numRead = read( buffer, 0, bu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the jobsRunning value for this RoxieCluster.
public java.lang.Integer getJobsRunning() { return jobsRunning; }
[ "public Integer concurrentJobsRunning() {\n return this.concurrentJobsRunning;\n }", "public java.lang.Integer getJobsInQueue() {\n return jobsInQueue;\n }", "public int getNumJobs() {\n return numJobs;\n }", "public Integer jobCount() {\n return this.jobCount;\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method returns the value of the database column hb_org.orgaddr
public String getOrgaddr() { return orgaddr; }
[ "public String getOrgAddress()\n\t{\n\t\treturn orgAddress;\n\t}", "String getOrganizationAddress();", "public void setOrgaddr(String orgaddr) {\n this.orgaddr = orgaddr == null ? null : orgaddr.trim();\n }", "public String getLeadOrg() {\n return (String)getAttributeInternal(LEADORG);\n }", "...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
============== Generate all paths======================== paths are represented by nodeIDs
public LinkedList<LinkedList<CNode>> computeAllPathsUsingNodeID(CNode startNode, CNode endNode) { LinkedList<LinkedList<CNode>> paths = new LinkedList<LinkedList<CNode>>(); LinkedList<CNode> visited = new LinkedList<CNode>(); visited.add(startNode); breadthFirst(visited, endNode, paths); return paths; }
[ "private void computeAllPaths()\n {\n for (Station src : this.graph.stations)\n {\n List<Station> visited = new ArrayList<Station>();\n computePathsForNode(src, null, null, visited);\n }\n Print.printTripList(this.tripList);\n }", "private void generatePath(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method deletes the attributes to an existing Class.
public XML deleteAttributes(Class<?> aClass,String[] attributes){ checksAttributesExistence(aClass,attributes); if(isEmpty(findXmlClass(aClass).attributes) || findXmlClass(aClass).attributes.size()<=1) Error.xmlWrongMethod(aClass); for (String attributeName : attributes) { XmlAttribute attribut...
[ "public void unsetJavaClass()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_attribute(JAVACLASS$24);\r\n }\r\n }", "@Override\n public void removeAttributes()\n {\n attributes.clear();...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new part and replaces old part. For use when changing InHouse to Outsources or vice versa.
public void replacePart(Part modifiedPart) { Part newPart; String name, compName; double price; int id, inv, max, min, machId; //Gets the ID of the last part in the inventory and adds 1 to it id = Inventory.getAllParts().get(Inventory.getAllParts().size() - 1).getI...
[ "private void createNewPart() {\n\t\tint newX, newY;\n\t\tDirection newDir;\n\t\tif (!parts.isEmpty()) {\n\t\t\tint lastPart = parts.size() - 1;\n\t\t\tRectangle lastPartsBounds = parts.get(lastPart).getLastBounds();\n\t\t\tnewX = (int) lastPartsBounds.getX();\n\t\t\tnewY = (int) lastPartsBounds.getY();\n\t\t\tnewD...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ blocklocal class not found
public hk a(String s, a a1) { class c {} c c1 = new c(null); /* block-local class not found */ class b {} b.a(new b(s, a1, c1)); return c1; }
[ "private ClassParser() {\n\t}", "private static Class<?> self() {\n\t\treturn new Object() { }.getClass().getEnclosingClass();\n\t}", "public void methodForLocalCls() {\n\t\tclass localCls{\n\t\t\tlocalCls(){} //얘들은 어차피 메소드 안에 있는 class이므로 접근 제한자가 필요없음.\n\t\t\tint field1;\n\t\t\t//static int field2; \n\t\t\tvoid...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
askYN() Ask user if the user want to continue.
@SuppressWarnings("resource") public static boolean askYN() { Scanner scanner = new Scanner(System.in); System.out.print("Continue(Y/N)?"); while (true) { char ans = Character.toUpperCase(scanner.nextLine().charAt(0)); if (ans == 'Y' || ans == 'N') ...
[ "public boolean nextYN() {\n this.inputStr = this.s.nextLine();\n\n if (inputStr.toLowerCase().contains(\"yes\")) {\n return true;\n } else if (inputStr.toLowerCase().contains(\"y\")) {\n return true;\n }\n return false;\n }", "public static char askYN(S...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
int num1 = 5, num2 = 7;
public int addNumbers(int num1, int num2) { return num1 + num2; }
[ "public static void main(String[] args) {\n\t\n\t int num1 = 20;\n\t int num3 = 30;\n\t int max = num3;\n\t System.out.println(max);\n \n int num = 40;\n int num2 = 100;\n int max1 = num2;\n System.out.println(max1);\n\t}", "public int addTwoNumber(int input1,int input2)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns the placement string for a piece
public String getPlacementString(){ return "There isn't a game yet"; }
[ "public String toString() {\n\t\treturn \"Piece \" + num + \" - x: \" + x + \" y: \" + y;\n\t}", "public String getPieceLocation()\n\t{\n\t\treturn getValue(StoragePlan.PIECELOCATION).toString();\n\t}", "String getPositionStr();", "public String getSpawnLocationString(){\n\t\tStringBuilder sb = new StringBuil...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Changes the state of the navigator. If a user isn't logged in, do not allow navigation to views that require authentication
public void setAuthenticated(boolean authenticated) { if (getNavigator() != null) getNavigator().destroy(); navigator = new Navigator(this, uiLayout.getContentContainer()); navigator.addViewChangeListener(new NimbusViewChangeListener(this)); extShareController = new ExternalShareController(); log.debug("Cr...
[ "public void authenticated() {\n loginView.resetView();\n SecureFXMLApplication.showPage(firstView);\n }", "public void isLoggedIn(){\n boolean login = currUser.length() > 0;\n\n navigationView.getMenu().getItem(0).setVisible(!login);\n navigationView.getMenu().getItem(1).set...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Construct a new Instance of the ShopNode
public ShopNode(JPanel parent, Shop shop, Direction direction) { if (img == null) { img = GameAssets.getShopNodeImage(shop.getType(), direction); } this.shop = shop; this.direction = direction; this.parent = parent; }
[ "public Shop() {\r\n\t\tthis.inventory = new Inventory();\r\n\t\tthis.suppliers = new ArrayList<Supplier>();\r\n\t}", "public void createShop() {\n\t\tmyShop = ShopFactory.eINSTANCE.createShop();\n\n\t\tmyCountry1 = ShopFactory.eINSTANCE.createCountry();\n\t\tmyCountry1.setName(\"1\");\n\t\tmyShop.getCountries()....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sends a position packet and a velocity packet, with the position packet _only_ effecting position and not rotation.
private void resendPosition(Player player) { PacketContainer positionPacket = protocolManager.createPacket(PacketType.Play.Server.POSITION); Location location = player.getLocation(); positionPacket.getDoubles().write(0, location.getX()); positionPacket.getDoubles().write(1, location.getY()); positionPa...
[ "private void sendPackets()\n\t{\n\t\ttry {\n\t\t\t//System.out.println(\"Sending packet vector\");\n\t\t\toos.reset();\n\t\t\toos.writeObject(packets);\n\t\t\t//System.out.println(\"Packet vector sent\");\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tSystem.out.println(\"Error sen...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Forward the stream, using a thread, with name "name"
private void forwardStream(final String name, final InputStream in, final OutputStream out) { try { while (in.available() > 0) { out.write(in.read()); } out.flush(); } catch (IOException e) { LOGGER.warning(e.getMessage()); } }
[ "void run(AsyncResultHandler<Void> startupHandler, Handler<DuplexStream<Buffer, Buffer>> duplexStreamHandler);", "public RedirectThread(Socket s){\n this.connection = s;\n }", "public abstract void stream(int port);", "void syncronizeViewWithStream(String viewName, String stream) throws IOEx...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all sentences match a given pattern from the data holder
public Set<SentenceStructure> getTaggedSentenceByPattern(String pattern) { Set<SentenceStructure> sentences = new HashSet<SentenceStructure>(); Iterator<SentenceStructure> iter = getSentenceHolderIterator(); while (iter.hasNext()) { SentenceStructure sentenceItem = iter.next(); String tag = sentenceItem....
[ "public static void testFindPatternInSentence() {\r\n\t\tString [] pattern1 = { \"computer\"};\r\n\t\tString [] sentence1 = {\"are\", \"you\", \"a\", \"computer\"};\r\n\r\n\t\tString [] matches = Eliza.findPatternInSentence( pattern1, sentence1);\r\n\t\tif ( matches != null && matches.length == 2 \r\n\t\t\t\t&& mat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the designated parameter to a Reader object. This method differs from the setCharacterStream (int, Reader) method because it informs the driver that the parameter value should be sent to the server as a NCLOB. When the setCharacterStream method is used, the driver may have to do extra work to determine whether the...
@Override public void setNClob(String parameterName, Reader reader) throws SQLException { }
[ "@Override\n\tpublic void setCharacterStream(String parameterName, Reader reader, long length) throws SQLException {\n\n\t}", "@Override\n\tpublic void setClob(String parameterName, Reader reader) throws SQLException {\n\n\t}", "void setCharacterStream(int parameterIndex, java.io.Reader reader, long length) thr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test of removeAssoFromAssoList method, of class DecidePeriodServiceController.
@Test public void testRemoveAssoFromAssoList() throws FileNotFoundException { System.out.println("removeAssoFromAssoList"); int num = 0; DecidePeriodServiceController instance = new DecidePeriodServiceController(); AssociationProviderRequestRecords aprr = AppGPSD.getInstance().getCom...
[ "@Test\n public void testRemoveAirplane() {\n System.out.println(\"removeAirplane\");\n cta.removeAirplane(airplane);\n Assert.assertEquals(\"Airplane should not be found in the list\", null, cta.GetAirplane((int) airplane.getId()));\n }", "@Test\r\n public void testRemoveAccionEnAre...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if field limitPrice is set (has been assigned a value) and false otherwise
public boolean isSetLimitPrice() { return EncodingUtils.testBit(__isset_bitfield, __LIMITPRICE_ISSET_ID); }
[ "public boolean isSetPriceLimit();", "public boolean isSetPrice() {\n return this.price != null;\n }", "public void setIsSetPriceLimit (boolean IsSetPriceLimit);", "public boolean hasPrice() {\n return price != UNDEFINED;\n }", "public boolean isSetLimit() {\n return org.apache.thrift.Enc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove a provider panel
public void removeProvider(TimelineProviderPanel panel) { int height = panel.getHeight(); providersPanel.remove(panel); providersPanel.setSize(providersPanel.getWidth(), providersPanel.getHeight() - height); validate(); }
[ "public void removePanel() \n\t{\n\t\tgame.remove(this);\n\t}", "public void removeExtraPanel() {\n\t\tif(extraPanel != null) {\n\t\t\tremove(extraPanel);\n\t\t\textraPanel = null;\n\t\t\tupdate();\n\t\t}\n\t}", "public void removeExtraPanel() {\n\t\tif (extraPanel != null) {\n\t\t\tremove(extraPanel);\n\t\t\te...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Display the number of victories for player B.
public void displayVictoriesForPlayerB() { Resources res = getResources(); String text = res.getQuantityString(R.plurals.victory, victoriesForPlayerB, victoriesForPlayerB); TextView victoriesText = (TextView) findViewById(R.id.victoriesForPlayerBText); victoriesText.setText(text); }
[ "public void displayVictoriesForPlayerA() {\n Resources res = getResources();\n String text = res.getQuantityString(R.plurals.victory, victoriesForPlayerA, victoriesForPlayerA);\n TextView victoriesText = (TextView) findViewById(R.id.victoriesForPlayerAText);\n victoriesText.setText(text...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructor for class JdbcUtil.
public JdbcUtil() { }
[ "public PsvDaoImplJDBC() {\r\n }", "public JdbcAdapter() {\n // init defaults\n this.setSupportsBatchUpdates(false);\n this.setSupportsUniqueConstraints(true);\n this.setSupportsFkConstraints(true);\n\n this.pkGenerator = this.createPkGenerator();\n this.typesHandler =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Valida si la transaccion es valida. Una transaccion es valida si no es nula.
private boolean isTransaccionValida(TransaccionTO transaccion){ return transaccion != null; }
[ "private boolean isTransaccionCompleta(TransaccionDetallePagoTO transaccion) {\r\n StringBuilder error = new StringBuilder();\r\n \r\n if (!isValidString(transaccion.getIdTransaccion())) {\r\n error.append(\"El campo idTransaccion es obligatorio - \");\r\n }\r\n \r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine if a given child Component is a peer to exclude it from generic handling of child Components.
protected boolean isPeer(Component child) { return peerSet!=null && peerSet.contains(child); }
[ "boolean isDescendant(IComponent comp);", "public boolean hasChildComponent(Widget component) {\n return locationToWidget.containsValue(component);\n }", "@Override\n public boolean isDescendantOf(Actor actor) {\n return super.isDescendantOf(actor);\n }", "boolean isAncestor(IComponen...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
String patientName = getPatientNameFromPdf(imageFile); String date = getDateFromPdf(imageFile); String hour = getHourFromPdf(imageFile); String duration = getDurationFromPdf(imageFile); String faslseNegative = getFalseNegativeFromPdf(imageFile); String faslsePositive = getFalsePositiveFromPdf(imageFile); String fixatio...
public void loadDataFromPdf() { try { eyeSide = ConversorOCRHumphreyPdf.getEyeSideFromPdf(pdfFile); char[][] map = (eyeSide.charAt(0)=='E') ? Constants.MAP_LEFT : Constants.MAP_RIGHT; age = ConversorOCRHumphreyPdf.getPatientAgeFromPdf(pdfFile); intensities = ConversorOCRHumphreyPdf.getIntensitiesMapFrom...
[ "public static void main(String[] args) throws IOException, FileNotFoundException {\n\t\t\n\t\t\n\t\tString regex = \"[0-9]+\";\n\t\tString data = \"1313\";\n\t\tSystem.out.println(data.matches(regex));\n\t\tString regex1 = \"[0-9]+\";\n\t\tString data1 = \" 112121 sdf \";\n\t\tSystem.out.println(data1.ma...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Executes the runnable `f` and records the time taken.
default void record(Consumer<Long> f) { long id = start(); try { f.accept(id); } finally { stop(id); } }
[ "default void record(Runnable f) {\n long id = start();\n try {\n f.run();\n } finally {\n stop(id);\n }\n }", "public static <T> E2<T, Long> timeExecution (final Supplier<T> f)\n {\n final long nsStart = System.nanoTime ();\n\n // Execute oper...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates the current process instance list with current filter and returns this list. Doesn't change the current process instance when an error occures.
public DataRecord[] resetCurrentProcessList() throws ProcessManagerException { try { ProcessInstance[] processList = Workflow.getProcessInstanceManager() .getProcessInstances(peasId, currentUser, currentRole, getUserRoles()); currentProcessList = getCurrentFilter().filter(processLis...
[ "public ProcessFilter getCurrentFilter() throws ProcessManagerException {\r\n if (currentProcessFilter == null) {\r\n currentProcessFilter = new ProcessFilter(processModel, currentRole,\r\n getLanguage());\r\n }\r\n return currentProcessFilter;\r\n }", "public ProcessList getProcesse...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructs a Markov object from a given substring.
public Markov(String substring) { this.substring = substring; map = new TreeMap<Character, Integer>(); add(); }
[ "public Markov(String substring, Character suffix) {\n this.substring = substring;\n map = new TreeMap<Character, Integer>();\n add(suffix);\n }", "public MarkovModel(int n, String s) \n {\n ngram = new NgramModel(n, s);\n n1gram = new NgramModel(n+1, s);\n\n k = n;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a string representation of the Group which includes the group name, the names of its subgroups / users, and the contents of its subgroups.
@Override public String toString() { StringBuilder sb = new StringBuilder(); appendGroupContents(sb); sb.append("\n"); TreeMap<AclPrincipal, Group> map = new TreeMap<AclPrincipal, Group>( new AclPrincipalComparator()); map.putAll(groups); for (Entry<AclPrincipal, Group> e : map.entrySe...
[ "public java.lang.String getGrpDesc() {\n java.lang.Object ref = grpDesc_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n grpDesc_ = s;\n return s;\n } else {\n retur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the value of the 'shareId' field.
public java.lang.CharSequence getShareId() { return shareId; }
[ "public String shareId() {\n return this.shareId;\n }", "public String getShareId() {\n\t\treturn this.ShareId;\n\t}", "public java.lang.CharSequence getShareId() {\n return shareId;\n }", "public Integer getShareValueId() {\n return shareValueId;\n }", "public Integer getShareUs...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Define the input items necessary for the application of the plugin to offer its functionality to the user only in the right context. The EventModelMerge analysis plugin requires a HighLevelProcess that needs to be merged into an activity model.
public AnalysisInputItem[] getInputItems() { AnalysisInputItem[] items = { /* newly define an analysis input item .. */ new AnalysisInputItem("HighLevel process") { // .. including the accepts method, which actually evaluates // the validity of the context provided public boolean accepts(ProvidedObject o...
[ "public AnalysisInputItem[] getInputItems() {\n \n\tAnalysisInputItem[] items = {\n\t\n\t new AnalysisInputItem(\"Workflow log of a process\") {\n\t \n\t\tpublic boolean accepts(ProvidedObject object) {\n\t\t\n\t\t Object[] o = object.getObjects();\n\t\t boolean hasLogReader = false;\n\t\t\n\t\t f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Div with inline text
public Div(String text) { super(ComponentTypes.Div); setText(text); }
[ "public String getDivText(int index) {\n return getText(getDiv(index));\n }", "java.lang.String getRenderedText();", "private void text() {\n elements.add(SHARED_TEXT_ELEMENT);\n }", "public String getFormattedText() {\n String adjusted = text.replaceAll(\"(?m)^[ \\t]*\\r?\\n\", \"<...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the credit value for this My_AccountRes.
public void setCredit(java.lang.String credit) { this.credit = credit; }
[ "public void setCredit(int credit) {\n this.credit = credit;\n }", "public void setCredit(int credit){\n this.credit = credit;\n }", "public void setCredit(BigDecimal credit) {\n this.credit = credit;\n }", "public void setCredits(int credit) {\n\t\tcredits = credit;\n\t}", "vo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the designation value for this EaseyeMessageReceiveDTO.
public void setDesignation(String designation) { this.designation = designation; }
[ "public com.fretron.Model.Employee.Builder setDesignation(java.lang.String value) {\n validate(fields()[4], value);\n this.designation = value;\n fieldSetFlags()[4] = true;\n return this;\n }", "public void setDesignation(String designation) {\n\t\tthis.designation = designation;\n\t}", "...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ By pressing this function's button,we are changing scene guest scene to EServices scene
@FXML public void changeSceneToEServices(ActionEvent event) throws IOException{ Parent guestUser; guestUser = FXMLLoader.load(getClass().getResource("/menu/eServiceFXML.fxml")); Scene guestUserScene = new Scene(guestUser); Stage window = (Stage) ((Node)event....
[ "@FXML\n public void changeSceneToServices(ActionEvent event) throws IOException{\n Parent guestUser;\n guestUser = FXMLLoader.load(getClass().getResource(\"/menu/serviceFXML.fxml\"));\n Scene guestUserScene = new Scene(guestUser);\n\n Stage window = (Stage) ((...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called for each item to be plotted.
public void drawItem(Graphics2D g2, Rectangle2D plotArea, Plot plot, ValueAxis horizontalAxis, ValueAxis verticalAxis, XYDataset data, int series, int item, double translatedRangeZero);
[ "public void rawItemItemPlot(int itemIndex1, int itemIndex2){\n itemIndex1--;\n itemIndex2--;\n\n PlotGraph pg = new PlotGraph(this.scores0[itemIndex1], this.scores0[itemIndex2]);\n String graphTitle = \"Scores: plot of responses to the item, \" + this.itemNames[itemIndex1] + \", against...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test purchase a beverage with nonvalid recipe with mock recipeBook.
@Test public void testPurChaseBeverageWithNonValidRecipeMock() { // we simulate the out of range as null which is default in recipeBook when(recipeBook.getRecipes()).thenReturn(new Recipe[]{recipe1, recipe2, recipe3, recipe4, null}); // CoffeeMaker only contains 4 recipe, but we want to ...
[ "@Test\r\n public void testPurChaseBeverageWithNotEnoughMoneyMock() {\r\n when(recipeBook.getRecipes()).thenReturn(recipes);\r\n // recipe1 price is 50\r\n assertEquals(25, coffeeMaker2.makeCoffee(0, 25));\r\n // for unsuccessful purchase in the CoffeeMaker gerRecipes() is called at l...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Find Resources containing nameFragment in their name.
public List<Resource> findByNameContaining(String nameFragment) { Map<String, Object> nameFilter = new HashMap<>(); nameFilter.put("name", new ValueParameter("%" + nameFragment + "%")); return this.filter(nameFilter); }
[ "private Resource findResourceFromName(String name) {\n StmtIterator stmtIt = model.listStatements(null,nameProp,model.createLiteral(name));\n if (stmtIt.hasNext()) {\n Statement stmt = stmtIt.nextStatement();\n return (stmt.getSubject());\n }\n return null;\n }"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called when the activity is starting. Handles storing the latest chatId, stores the username of the user logged in into Shared Preferences also handles various UI in the activity.
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); int theme = ThemesU.getThemeId(mTheme); setTheme(theme); setContentView(R.layout.activity_home); Bundle bundle = getIntent().getExtras(); if (savedInstanceState == n...
[ "public void start() {\r\n Log.i(LOGGER, \"Starting chat with id: \" + chatId);\r\n scheduleRefresh();\r\n }", "public void startChat()\n {\n if (username.get() == null)\n {\n model.createClient(\"Anonymous user\");\n }\n else\n {\n model.createClient(username.get());\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generates a BAD_REQUEST response when the given payload does not match the expected classes.
public static final DeviceResponse generateWrongPayloadResponse(SpsCommand cmd) { StringBuilder sb = new StringBuilder(); sb.append("Expected Payload of Type "); sb.append(cmd.payloadClass.getSimpleName()); Object pojo = com.toennies.ci1429.app.util.Utils.instantiate(cmd.payloadClass.getName()); if (pojo ...
[ "public BadRequestResponse()\n {\n super();\n codeSubfield = 0;\n payload = \"Bad Request\";\n }", "default Response badRequest() {\n return status(400);\n }", "public static ResponseBuilder badRequest() {\n return response().status(BAD_REQUEST);\n }", "@Exceptio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a mapping of positions and count for the term given.
public Map<Float, Float> lookupTermPosition(LeafReader reader, int doc, BytesRef term) throws IOException { final PostingsEnum posting = reader.postings(new Term(this.privateField, term), PostingsEnum.POSITIONS); final Map<Float, Float> positions = new HashMap<Float, Float>(); if (posting != n...
[ "public TermToVertexCount[] getVertexMappings(String term)\n {\n if(stem)\n { // Stem if required\n term = PorterStemmerTokenizerFactory.stem(term);\n }\n \n int pos = Arrays.binarySearch(terms, new TermToVertexCount(term),\n new TermToVertexCountComparator());\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test of constructor ConfigurationObjectSpecificationFactory with single dimension complex type array.
public void testConstructorWithSingleDimensionComplexTypeArray() throws Exception { root .addChild(createArray("array1", TYPE_OBJECT, "1", "{object:ob1,object:ob2, object:ob1}")); root.addChild(createObject("object:ob1", TYPE_OBJECT)); root.addChild(createObject("object:ob2", TYP...
[ "public void testConstructorWithSingleDimensionSimpleTypeArray() throws Exception {\r\n root.addChild(createArray(\"array1\", TYPE_INT, \"1\", \"{1,2}\"));\r\n\r\n specificationFactory = new ConfigurationObjectSpecificationFactory(root);\r\n\r\n ObjectSpecification array = specificationFactory....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clears the value of the 'field645' field
public com.maxpoint.cascading.avro.TestExtraLarge.Builder clearField645() { field645 = null; fieldSetFlags()[645] = false; return this; }
[ "public com.maxpoint.cascading.avro.TestExtraLarge.Builder clearField123() {\n field123 = null;\n fieldSetFlags()[123] = false;\n return this;\n }", "public com.maxpoint.cascading.avro.TestExtraLarge.Builder clearField232() {\n field232 = null;\n fieldSetFlags()[232] = false;\n re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructor to set favor token count
public FavorTokens(int favtokenCount) { this.favtokenCount = favtokenCount; }
[ "public void setFavtokenCount(int favtokenCount) {\n\t\tthis.favtokenCount = favtokenCount;\n\t}", "public void setToken(int value){token = value;}", "public DistinctTokenCountsAnalyzer() {\n distinctTokenCounts = new HashMap<String, Integer>(100);\n }", "public void setNumTokens(int numTokens){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes the component of the given type from this entity.
public void remove(Class<? extends Component> componentType) { engine.componentManager.getMapper(componentType).remove(this); }
[ "public <T extends Component> T removeComponent(Class<T> componentType);", "<T extends Component> Optional<T> removeComponent(Class<T> type);", "public void removeByType(long typeId);", "public <T extends Component> T remove(Class<T> componentType, long entityID)\n\t{\n\t\tComponent component = null;\n\t\tMap...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates new form Terminal_Info
public Terminal_Info(ArrayList<T> terminals) { this.terminals = terminals; initComponents(); setVisible(true); }
[ "public Terminal(String name) {\r\n super(name);\r\n }", "public Terminal() {\n initComponents();\n }", "private static TerminalInfo readTerminalInfo(DataInputStream dis, \n BitStreamIO bio)\n throws IOException \n {\n TerminalIn...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns the name of the client with the given afm
public String findClientName(String afm) { String query = "SELECT name, surname FROM users WHERE afm = '" + afm + "'"; rs = getDBdata(query); String fullName = null; try { rs.next(); fullName = rs.getString("surname"); fu...
[ "String getClientName() {\n final String clientName =\n JsonUtils.getAsText(claimSet, IDCSOAuthUtils.CLIENT_CLAIM_NAME);\n if (clientName == null) {\n return null;\n }\n return clientName.trim();\n }", "public String clientName() {\n return this.client.g...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests method validateSubmission(submission) if submission is null.
public void testValidateSubmissionIfNull() { try { validator.validateSubmission(null); fail("Submission cannot be null."); } catch (IllegalArgumentException e) { //success } }
[ "public void testValidateActivityDiagramIfSubmissionNull() {\r\n try {\r\n activityDiagramNamingValidator.validateActivityDiagram(activityDiagram, null);\r\n fail(\"Submission cannot be null.\");\r\n } catch (IllegalArgumentException e) {\r\n //success\r\n }\r\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loads the suggested accounts page and goes down the list following each account (Follows
public void loadAndFollow() { if (isRunning) { driver.get(BASE_URL + "/explore/people/suggested/"); waitLoaded(); waitTime.until((driver) -> driver.findElements(FOLLOW_BUTTONS_SELECTOR).size() > 0); List<WebElement> buttons = driver.findElements(FOLLOW_BUTTONS_SEL...
[ "private void getFollowers() {\n hideError();\n setProgressIndicator();\n getEndpoint().getFollowingUser(user.getName(), new MembersCallback(userFragment, errorMsgView));\n }", "void getFollowersAndFollowing() {\n final ParseUser currUser = ParseUser.getCurrentUser();\n\n // ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Returns the current color of the Z Slice.
public Color3f getZSliceColor() { return boxSliceZ.getColor(); }
[ "private static int getColor(int[] buffer, int posX, int posZ) {\n float x = Math.abs((LOOP - (Math.abs(posX) % (2 * LOOP))) / LOOP);\n float z = Math.abs((LOOP - (Math.abs(posZ) % (2 * LOOP))) / LOOP);\n\n if (x < z) {\n float tmp = x;\n x = z;\n z = tmp;\n }\n\n return buffer[(int) (...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Funcion: Cards Descripcion: Constructor Cards para carta con solo un atributo de puntos (ataque o defensa) Parametros: String cardName String cardDes int puntosHabilidad
Cards(String cardName, String cardDes, int puntosHabilidad) { this.nombre = cardName; this.descripcion = cardDes; this.puntos = puntosHabilidad; }
[ "Cards(String cardName, String cardDes, int ataque, int defensa) {\n this.nombre = cardName;\n this.descripcion = cardDes;\n this.puntos = ataque;\n this.def = defensa;\n }", "public Card ()\n\t{\n\t\tcardName = \"blank\";\n\t\tcardType = \"blank\";\n\t}", "pub...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns an immutable list of occupied locations
private List<Integer> getOccupiedLocations() { ArrayList<Integer> output = new ArrayList<Integer>(); for (ScotlandYardPlayer player : mPlayers) { if (player.isDetective()) { output.add(player.location()); } } return Collections.unmodifiableList(out...
[ "public ArrayList<Location> getOccupiedLocations()\r\n\t{\r\n\t\treturn occupied;\r\n\t}", "private List<Coordinate> findOpenSpaces() {\n List<Coordinate> occupied = occupants.stream()\n .map(Entity::getPosition)\n .collect(Collectors.toList());\n\n return movements.stream()\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test of getTrackList method, of class MyStereo.
@Test public void testGetTrackList() throws IOException{ File trackListSource = File.createTempFile("temp-track-file", ".tmp"); trackListSource.deleteOnExit(); PrintWriter outputStream = new PrintWriter(new FileWriter(trackListSource)); outputStream.write("Track 1.mp3\...
[ "@Test\r\n public void testLoadTrackList() throws IOException{\r\n File trackListSource = File.createTempFile(\"temp-track-file\", \".tmp\");\r\n trackListSource.deleteOnExit();\r\n \r\n PrintWriter outputStream = new PrintWriter(new FileWriter(trackListSource));\r\n outputStre...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer.
public static Property<Boolean> symbolAvoidEdges(Boolean value) { return new LayoutProperty<>("symbol-avoid-edges", value); }
[ "public boolean isBorder() {\r\n //TODO: test if on edge of map\r\n for (int i = 1; i < provs.size(); i ++) {\r\n if (provs.get(i).getOwner() != provs.get(i - 1).getOwner()) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }", "protected ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Print the column headings.
public void printColumnHeadings() { System.out.println(); System.out.println( String.format(NAME_FORMAT,"Identifier") + NUMBERS_LABEL); System.out.println( String.format(NAME_FORMAT,"----------") + NUMBERS_UNDERLINE); }
[ "void displayColumnHeaders() {\n\t\tSystem.out.print(\" \");\n\t\tfor (int j = 0; j < 3; j++)\n\t\t\tSystem.out.print(\"|col \" + j);\n\t\tSystem.out.println();\n\t}", "public static void writeColumnHeaders()\r\n \t{\r\n\t\twrite( \" Minimum Maximum Mean ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test of getNAD1983CSRS98MTM6 method, of class NationalGridsCanada.
@Test public void testNAD1983CSRS98MTM6() { testToWGS84AndBack(PROJ.getNAD1983CSRS98MTM6()); }
[ "@Test\n public void testNAD1983CSRS98MTM9() {\n testToWGS84AndBack(PROJ.getNAD1983CSRS98MTM9());\n }", "@Test\n public void testNAD1983CSRS98MTM7() {\n testToWGS84AndBack(PROJ.getNAD1983CSRS98MTM7());\n }", "@Test\n public void testNAD1983CSRS98MTM8() {\n testToWGS84AndBack(PROJ.getNAD1983CSRS98M...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Methods Find an action by URI in a collection of actions.
public static ElementAction find(Iterable<ElementAction> actions, String s) throws ApplicationException { try { return ElementAction.find(actions, new URI(s)); } catch (URISyntaxException e) { throw new ApplicationException(e); } }
[ "public static ElementAction find(Iterable<ElementAction> actions, URI uri)\n\t{\n\t\tElementAction result=null;\n\n\t\tfor (ElementAction action : actions)\n\t\t{\n\t\t\tURI actionUri=action.getActionUri();\n\t\t\tif (actionUri.equals(uri))\n\t\t\t{\n\t\t\t\tresult=action;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tre...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Performs the disembark to settlement phase of the mission.
protected void performDisembarkToSettlementPhase(MissionMember member, Settlement disembarkSettlement) { disembark(member, getVehicle(), disembarkSettlement); }
[ "public void finalPhaseFortification() {\r\n\t\tFortification fortification = new Fortification(territory);\r\n\t\tString fromTerritory = territoryADropDown.getItemAt(territoryADropDown.getSelectedIndex());\r\n\t\tString toTerritory = territoryBDropDown.getItemAt(territoryBDropDown.getSelectedIndex());\r\n\t\tif (S...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Call typeSystemInit method on each component.
private void callTypeSystemInit() throws ResourceInitializationException { CAS cas = casPool.getCas(); try { if (collectionReader instanceof CollectionReader) { ((CollectionReader) collectionReader).typeSystemInit(cas.getTypeSystem()); CasInitializer casIni = ((CollectionReader) collect...
[ "private void initSubsystems() {\n changeStatus(ChunkWorldEngineStatus.INITIALIZING_SUBSYSTEMS);\n for (EngineSubsystem subsystem : allSubsystems) {\n changeStatus(() -> \"Initialising \" + subsystem.getName() + \" subsystem\");\n subsystem.initialise();\n }\n }", "pu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A method to control the video playback
public void videoControl(View v){ //connect ToggleButton controlVideo = (ToggleButton)findViewById(R.id.toggleButton); VideoView myVideo = (VideoView) findViewById(R.id.videoView); //configure a video controller to play the video myVideo.setVideoPath(filepath); ctlr = ...
[ "private void playVideo() {\r\n\r\n\t\tanimation.play();\r\n\t\tsoundtrack.play();\r\n\t}", "public void startBackgroundVideo() {\n }", "private void playVideo(float volume) {\n }", "private void setVideo(){\n // if the video is already running don't do anything\n if(mVideoView==null){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This constructor creates instance of animal to be called in the menu class, and passes name and environment
public static void main(String[] args) //Start of main method { Dog1 myDog = new Dog1("Rover", 4, "Urban"); //These statements pull from the base class to output the Animals' information System.out.println("The Dog's name is " + myDog.getName() + ". " + "He has " + myDog.getLegs() + " legs"); System.out.pr...
[ "public static void main(String[] argv) {\r\n\t startAnimal(argv);\r\n }", "AnimalSpecific(String category,String name,String type){\n\t\tsuper(category);\n\t\tanimalName = name;\n\t\tanimalType = type;\n\t}", "public Animal(String species) {\n super();\n this.species = species;\n }", "publ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Safely abort the current CRCL program and then disconnect from the robot's CRCL server. The abort will occur asynchronously in another thread after this method returns. The status of this action can be monitored with the returned future.
public XFutureVoid startSafeAbortAndDisconnect(String comment) { startingCheckEnabledCheck(); if (isAborting()) { String errMsg = "startSafeAbort(" + comment + ") called when already aborting"; setTitleErrorString(errMsg); throw new IllegalStateException(errMsg); ...
[ "public XFutureVoid abortCrclProgram() {\n if (null != crclClientJInternalFrame && crclClientJInternalFrame.isConnected()) {\n return crclClientJInternalFrame.abortProgram();\n } else {\n return XFutureVoid.completedFuture();\n }\n }", "public XFutureVoid startSafeAbo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Start the updateSuppressTimer. All property change listeners of PV_Value property will temporarily removed until timer is due.
protected synchronized void startUpdateSuppressTimer(){ AbstractWidgetProperty pvValueProperty = editpart.getWidgetModel().getProperty(controlPVValuePropId); pvValueListeners = pvValueProperty.getAllPropertyChangeListeners(); pvValueProperty.removeAllPropertyChangeListeners(); ...
[ "private static void resetTimerValues() {\n TIMER_EXPIRED = false;\n TIMER_COUNTER = 0;\n }", "public void startPoisonTimer()\n\t{\n\t\t_poisonTimer = ThreadPoolManager.getInstance().scheduleGeneral(new ScheduleTimerTask(\"Poison\", this), 3000);\n\t}", "public void markAsControlPV(String pvPro...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method will calculate the total value of your portfolio with the prices you paid for the shares.
public float getValue() { float value = 0; Queue<Transaction> temp = new LinkedQueue<>(); //Temp queue to keep all dequeued elements. while (!shares.isEmpty()) { Transaction t = shares.dequeue(); //Dequeue the first transaction from the portfolio value += t.getSharePrice() * t.getShares(); //Calculate the t...
[ "double getTotalPortfolioValue(){\n double total = 0.0;\n for (Listing<P, C> l : this.collectionOfCurrentListings) {\n total += l.getContract().getTotalPrice() * this.commissionRate;\n }\n return total;\n }", "public Double updatePortfolioValue() {\n\t\tDouble portVal = 0.0;\n\t\tfor(Stock s : s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ JM END Creates a new instance of SubcontractOtherController
public SubcontractOtherController(SubContractBean subContractBean, char functionType) { super(subContractBean); /* JM 2-27-2015 no access if not modifier */ userHasModify = subContractBean.getHasModify(); userHasCreate = subContractBean.getHasCreate(); if (!userHasModify && !userHasCreate...
[ "public OtherDetails() {\n initComponents();\n doctorController=(DoctorController) ControllerFactory.getInstance().getController(ControllerFactory.ControllerTypes.DOCTOR);\n specialityController=(SpecialityController) ControllerFactory.getInstance().getController(ControllerFactory.ControllerTyp...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a new GetServerInfoRequest
public static GetServerInfoRequest buildGetServerInfoRequest() { return GET_SERVER_INFO_REQUEST; }
[ "ConnectionRequestBuilder createConnectionRequest(@Nonnull ServerInfo info);", "public GetCapabilitiesRequest createGetCapabilities() {\n\n switch (getVersion()) {\n case v202:\n return new GetCapabilities202(serverURL.toString(),getClientSecurity());\n default:\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Agrega al log que termino el trial
private void logExitTrial() { trial.log.timeExitTrial = TimeUtils.millis(); trial.log.trialExitRecorded=true; trial.runningSound.stopReason="exit"; trial.runningSound.stop(); // Intenta enviar la info del trial y sino la guarda session.trialLogHistory.append(trial.log); }
[ "public static void endStep() {\n\t\tTestNotify.log(GenLogTC() + \"has been tested.\");\n\t}", "public void logTestEnd()\n\t{\n\t\tlogSeparatorLine();\n\t\tString timeStamp = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\").format(Calendar.getInstance().getTime());\n\t\tSystem.out.println(\"- Test completed: \" + ti...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the distribution samples for the arrival times
public double[] getArrivalTimesDistrib() { double[] samples = new double[queue[0].length]; samples[0] = queue[0][0]; for(int i = 1; i < samples.length; i++) { samples[i] = queue[0][i] - queue[0][i-1]; } return samples; }
[ "public double[] getServiceTimesDistrib() {\r\n \tdouble[] samples = new double[queue[0].length];\r\n \tfor(int i = 0; i < samples.length; i++) {\r\n \t\tsamples[i] = queue[2][i] - queue[1][i];\r\n \t}\r\n \treturn samples;\r\n }", "public double ProcessArrivalTime()\r\n\t{\r\n\t\tdouble U = Mat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an ordered range of all the agendas where uuid = &63;. Useful when paginating results. Returns a maximum of end start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtilALL_POS will return the f...
public java.util.List<Agenda> findByUuid( String uuid, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<Agenda> orderByComparator, boolean useFinderCache);
[ "public java.util.List<Agenda> findByUuid(\n\t\tString uuid, int start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator<Agenda>\n\t\t\torderByComparator);", "@Override\n\tpublic List<Arret> findByUuid(\n\t\tString uuid, int start, int end,\n\t\tOrderByComparator<Arret> orderByComparator) {\n\n\t\tr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the instrumentation components of this simulator.
public Collection<InstrumentationComponent> getInstrumentationComponents() { return Collections.unmodifiableCollection(instruComps); }
[ "public Instrumentation getInstrumentation() {\n return this.instrumentation;\n }", "public Instrumentation getInstrumentation() {\n return mInstrumentation;\n }", "public static Instrumentation getInstrumentation() {\n\treturn instrumentation;\n }", "public ArrayList<Simulator> getSimulators...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the value of the urbansimZoneRandomLocationDistributionByRadius property.
public double getUrbansimZoneRandomLocationDistributionByRadius() { return urbansimZoneRandomLocationDistributionByRadius; }
[ "public void setUrbansimZoneRandomLocationDistributionByRadius(double value) {\n this.urbansimZoneRandomLocationDistributionByRadius = value;\n }", "public double radius() {\n return radius;\n }", "public double getRadius() { return radius.get(); }", "@Basic\n\t@Raw\n\tpublic double getRadius() ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }