query
stringlengths 8
1.54M
| document
stringlengths 9
312k
| negatives
listlengths 19
20
| metadata
dict |
---|---|---|---|
Return a DigestedData object from a tagged object.
|
public static DigestedData getInstance(
ASN1TaggedObject ato,
boolean isExplicit)
{
return getInstance(ASN1Sequence.getInstance(ato, isExplicit));
}
|
[
"public interface ITaggedDataFactory\n{\n\t/** \n\t Get data for a specific tag value.\n\t \n\t @param tag The tag ID to find.\n\t @param data The data to search.\n\t @param offset The offset to begin extracting data from.\n\t @param count The number of bytes to extract.\n\t @return The located <see cref=\"ITaggedData\">value found</see>, or null if not found.\n\t*/\n\tITaggedData Create(short tag, byte[] data, int offset, int count);\n}",
"@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 13:00:13.509 -0500\", hash_original_method = \"F3F9FDCE1484676B88E382A49EC8877F\", hash_generated_method = \"E98CBD85708A9D853A0E84BBC5FA6CF1\")\n \npublic static ASN1Object fromByteArray(byte[] data)\n throws IOException\n {\n ASN1InputStream aIn = new ASN1InputStream(data);\n\n try\n {\n return (ASN1Object)aIn.readObject();\n }\n catch (ClassCastException e)\n {\n throw new IOException(\"cannot recognise object in stream\"); \n }\n }",
"public TagData(byte[] uidBytes) { super(uidBytes); }",
"public final Object get(String tag) {\n\t\treturn tags.get(tag).data;\n\t}",
"Tag read(long id);",
"public Asn1Object( int tag, int length, byte[] value ) {\n this.tag = tag;\n this.type = tag & 0x1F;\n this.length = length;\n this.value = value;\n }",
"CustomTag createCustomTag(byte[] tagData);",
"public void testTag()\r\n\t{\r\n\t\tTag input = new Tag();\r\n\t\tinput.tagid = 1L;\r\n\t\tinput.userid = 2L;\r\n\t\tinput.name = \"Name\";\r\n\t\tinput.type = \"type\";\r\n\t\tinput.exttagid = \"ExttagId\";\r\n\t\tinput.count = 3;\r\n\r\n\t\tHashtable<String, Object> hash = new Hashtable<String, Object>();\r\n\t\thash.put(\"tagid\", input.tagid);\r\n\t\thash.put(\"userid\", input.userid);\r\n\t\thash.put(\"name\", input.name);\r\n\t\thash.put(\"type\", input.type);\r\n\t\thash.put(\"exttagid\", input.exttagid);\r\n\t\thash.put(\"count\", input.count);\r\n\t\t\r\n\t\tTag output = Tag.createFromHashtable(hash);\r\n\t\t\r\n\t\tassertEquals(BaseDataType.TAG_DATATYPE, output.getType());\r\n\t\tassertEquals(input.tagid, output.tagid);\r\n\t\tassertEquals(input.userid, output.userid);\r\n\t\tassertEquals(input.name, output.name);\r\n\t\tassertEquals(input.type, output.type);\r\n\t\tassertEquals(input.exttagid, output.exttagid);\r\n\t\tassertEquals(input.count, output.count);\r\n\t}",
"Asn1Object(int tag, int length, byte[] value) {\n\t\t\tthis.tag = tag;\n\t\t\tthis.type = tag & 0x1F;\n\t\t\tthis.length = length;\n\t\t\tthis.value = value;\n\t\t}",
"protected abstract byte getDerefTag();",
"private Tagged tagged(E event) {\n Set<String> set = new HashSet<>();\n set.add(tagName);\n return new Tagged(event, set);\n }",
"public Tag(TagDTO tag) {\n\t\tthis.id = tag.getId();\n\t\tthis.tag = tag.getTag();\n\t}",
"private Object copyTaggedValue(TaggedValue source) {\r\n TaggedValue tv = createTaggedValue();\r\n tv.setType(source.getType());\r\n tv.getDataValue().addAll(source.getDataValue());\r\n tv.getReferenceValue().addAll(source.getReferenceValue());\r\n return tv;\r\n }",
"public Object fromTag(NBTBase value) {\n if (value == null) {\n return null;\n } else if (value instanceof NBTTagCompound) {\n // Recursive\n NBTTagCompound tag = (NBTTagCompound)value;\n Map<String, Object> result = new HashMap<>();\n for (String key: tag.c()) {\n result.put(key, fromTag(tag.get(key)));\n }\n return result;\n } else if (value instanceof NBTTagList) {\n // Recursive\n NBTTagList tag = (NBTTagList)value;\n List<Object> result = new ArrayList<>();\n for (int i = 0; i < tag.size(); i += 1) {\n result.add(fromTag(tag.get(i)));\n }\n return result;\n } else if (value instanceof NBTTagString) {\n return (String)((NBTTagString)value).c_();\n } else if (value instanceof NBTTagInt) {\n return (int)((NBTTagInt)value).e();\n } else if (value instanceof NBTTagLong) {\n return (long)((NBTTagLong)value).d();\n } else if (value instanceof NBTTagShort) {\n return (short)((NBTTagShort)value).f();\n } else if (value instanceof NBTTagFloat) {\n return (float)((NBTTagFloat)value).i();\n } else if (value instanceof NBTTagDouble) {\n return (double)((NBTTagDouble)value).asDouble();\n } else if (value instanceof NBTTagByte) {\n return (byte)((NBTTagByte)value).g();\n } else if (value instanceof NBTTagByteArray) {\n byte[] l = (byte[])((NBTTagByteArray)value).c();\n List<Byte> ls = new ArrayList<>(l.length);\n for (byte b: l) ls.add(b);\n return ls;\n } else if (value instanceof NBTTagIntArray) {\n int[] l = (int[])((NBTTagIntArray)value).d();\n return Arrays.stream(l).boxed().collect(Collectors.toList());\n // Hopefully unused\n // } else if (value instanceof NBTTagLongArray) {\n // long[] l = (long[])((NBTTagLongArray)value).d();\n // return Arrays.stream(l).boxed().collect(Collectors.toList());\n } else {\n throw new IllegalArgumentException(\"TagWrapper.fromTag: Unsupported value type: \" + value.getClass().getName());\n }\n }",
"public TagDTO getTagDTO() {\n\t\treturn new TagDTO(getTrack().getTrackDTO(), getTag());\n\t}",
"public TagData(byte[] epc)\n {\n this(epc, null);\n }",
"TagDto getTag(Long id);",
"public Digest getDigest() {\n Digest ret=null;\n\n synchronized(digest_mutex) {\n digest_promise.reset();\n passDown(Event.GET_DIGEST_EVT);\n try {\n ret=(Digest)digest_promise.getResultWithTimeout(digest_timeout);\n }\n catch(TimeoutException e) {\n if(log.isErrorEnabled()) log.error(\"digest could not be fetched from below\");\n }\n return ret;\n }\n }",
"public static ASN1Enumerated getInstance(\r\n final ASN1TaggedObject obj,\r\n final boolean explicit)\r\n {\r\n final ASN1Primitive o = obj.getObject();\r\n\r\n if (explicit || o instanceof ASN1Enumerated)\r\n {\r\n return getInstance(o);\r\n }\r\n else\r\n {\r\n return fromOctetString(((ASN1OctetString)o).getOctets());\r\n }\r\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Return the console area if available, null otherwise
|
public Console getConsole() {
if (previewEditor != null) {
return previewEditor.getConsole();
}
return null;
}
|
[
"public static Console getConsole() { \n return getConsole(null);\n }",
"public Console getConsole(String name)\n {\n WeakReference ref;\n\n /* Throw a NullPointerException if name is null. */\n name.getClass();\n\n ref = (WeakReference)consoles.get(name);\n if(ref!=null)\n {\n Console hold = (Console)ref.get();\n if(hold != null)\n {\n return (Console)ref.get();\n } else\n {\n return null;\n }\n }\n else\n return null;\n }",
"com.lxd.protobuf.msg.result.console.Console.Console_ getConsole();",
"public Console getConsole() {\n\t\treturn console;\n\t}",
"public Location getLocation() {\n\t\tif (isConsole())\n\t\t\treturn null;\n\t\t\n\t\t//every other command sender is an entity\n\t\treturn ((Entity) _handle).getLocation();\n\t}",
"public IConsole getConsole() {\n return console;\n }",
"public java.lang.String getOutputArea()\r\n {\r\n return this.outputArea;\r\n }",
"public com.lxd.protobuf.msg.result.console.Console.Console_OrBuilder getConsoleOrBuilder() {\n if (consoleBuilder_ != null) {\n return consoleBuilder_.getMessageOrBuilder();\n } else {\n return console_;\n }\n }",
"public PPConsole getConsole() {\n return console;\n }",
"private static boolean isTerminal() {\n return System.console() != null;\n }",
"public Screen getCurrentScreen();",
"public MapRectangle getScreenArea() {\n\t\treturn screenArea;\n\t}",
"public synchronized static ConsoleWindow getJavaConsole()\n {\n\t// Initialize tracing environment\n\tinitTraceEnvironment();\n\n\t// Obtain console from mainWriter\n\treturn mainWriter.getJavaConsole();\t \n }",
"public static Rectangle getScreenBounds ()\n\t{\n\t\tGraphicsEnvironment theGraphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment ();\n\t\tGraphicsDevice theScreenDevice = theGraphicsEnvironment.getDefaultScreenDevice ();\n\t\tGraphicsConfiguration theDefaultConfiguration = theScreenDevice.getDefaultConfiguration ();\n\t\treturn theDefaultConfiguration.getBounds ();\n\t}",
"boolean isConsole();",
"public final IConsole console()\n {\n return console;\n }",
"io.bloombox.schema.telemetry.context.DeviceContext.DeviceScreen getScreen();",
"public String getCurrentTerminal(){\n if (dotPointer == rightSide.length) return null;\n return rightSide[dotPointer];\n }",
"public com.lxd.protobuf.msg.result.console.Console.Console_ getConsole() {\n return console_;\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Valid range check when reading HostSecurityAttachmentPoint config from storage. Valid vlans are 14095. Macs must be at most 6 bytes.
|
@Test
public void
testHostSecurityAttachmentPointVlanMacRange() throws Exception {
HostSecurityAttachmentPointRow apRow;
EnumSet<DeviceField> keyFields =
EnumSet.of(IDeviceService.DeviceField.VLAN,
IDeviceService.DeviceField.MAC);
// vlan 0: invalid. ignored
apRow =
new HostSecurityAttachmentPointRow("default",
(short) 0,
1L,
1L,
"eth1",
keyFields);
doTestHostSecurityAttachmentPointRow(apRow, 0);
// vlan 1: ok
apRow =
new HostSecurityAttachmentPointRow("default",
(short) 1,
1L,
1L,
"eth1",
keyFields);
doTestHostSecurityAttachmentPointRow(apRow, 1);
// vlan 4095: ok
apRow =
new HostSecurityAttachmentPointRow("default",
(short) 4095,
1L,
1L,
"eth1",
keyFields);
doTestHostSecurityAttachmentPointRow(apRow, 1);
// vlan 4096: invalid. ignored
apRow =
new HostSecurityAttachmentPointRow("default",
(short) 4096,
1L,
1L,
"eth1",
keyFields);
doTestHostSecurityAttachmentPointRow(apRow, 0);
// MAC is all "1". Still allowed.
apRow =
new HostSecurityAttachmentPointRow("default",
(short) 1,
0xffffffffffffL,
1L,
"eth1",
keyFields);
doTestHostSecurityAttachmentPointRow(apRow, 1);
// MAC has more then 48 bits. Ignored.
apRow =
new HostSecurityAttachmentPointRow("default",
(short) 1,
0x1000000000000L,
1L,
"eth1",
keyFields);
doTestHostSecurityAttachmentPointRow(apRow, 0);
}
|
[
"@Test\n public void testHostSecurityIpAddressVlanMacRange() throws Exception {\n HostSecurityIpAddressRow ipRow;\n EnumSet<DeviceField> keyFields =\n EnumSet.of(IDeviceService.DeviceField.VLAN,\n IDeviceService.DeviceField.MAC);\n // vlan 0: invalid. ignored.\n ipRow =\n new HostSecurityIpAddressRow(\"default\",\n (short) 0,\n 1L,\n 1,\n keyFields);\n\n doTestHostSecurityIpAddressRow(ipRow, 0);\n\n // vlan 1: ok\n ipRow =\n new HostSecurityIpAddressRow(\"default\",\n (short) 1,\n 1L,\n 1,\n keyFields);\n doTestHostSecurityIpAddressRow(ipRow, 1);\n\n // vlan 4095: ok\n ipRow =\n new HostSecurityIpAddressRow(\"default\",\n (short) 4095,\n 1L,\n 1,\n keyFields);\n doTestHostSecurityIpAddressRow(ipRow, 1);\n\n // vlan 4096: invalid. ignored.\n ipRow =\n new HostSecurityIpAddressRow(\"default\",\n (short) 4096,\n 1L,\n 1,\n keyFields);\n doTestHostSecurityIpAddressRow(ipRow, 0);\n\n // MAC is all \"1\". largest valid mac.\n ipRow =\n new HostSecurityIpAddressRow(\"default\",\n (short) 1,\n 0xffffffffffffL,\n 1,\n keyFields);\n doTestHostSecurityIpAddressRow(ipRow, 1);\n\n // MAC is more then 48 bit. Invalid and ignored.\n ipRow =\n new HostSecurityIpAddressRow(\"default\",\n (short) 1,\n 0x1000000000000L,\n 1,\n keyFields);\n doTestHostSecurityIpAddressRow(ipRow, 0);\n }",
"@Test\n\tpublic void canCheckIfSizeIsInRange() {\n\t\tString errorMessage = \"Invalid Line Sintax: Size out of range [1-10]. \";\n\t\tassertEquals(\"LineReader returns error message if specified size is not in ranger.\", errorMessage,\n\t\t\t\tLineReader.checkLine(\"13,2\"));\n\t\tassertEquals(\"LineReader returns the orignal line if specified size is in range.\", \"2,3\",\n\t\t\t\tLineReader.checkLine(\"2,3\"));\n\t}",
"private void check_range(int offset, int byte_count) throws BadRangeException {\n int end_block = get_end_block(offset, byte_count);\n if (offset < 0 ||\n byte_count < 0 ||\n (final_block != -1 && final_block == end_block &&\n (offset+byte_count) % Constants.FILE_BLOCK_SIZE > content.get(end_block).length()) ||\n (final_block != -1 && end_block > final_block))\n {\n throw new BadRangeException();\n }\n }",
"@Test\n public void testGetFormattedMACAddress_MalformedString() {\n ScControllerPortIscsiConfiguration config = new ScControllerPortIscsiConfiguration();\n config.macAddress = \"abc123\";\n\n Assert.assertTrue(\"00:00:00:00:00:00\".equals(config.getFormattedMACAddress()));\n }",
"boolean checkLen(int epcbytes)\n {\n return true;\n }",
"Integer macAdressLearningRange();",
"@Test\n public void verifyResourceSizeAndRange() {\n assertThat(mListEntries.length).isEqualTo(mListValues.length);\n // Verify that list entries are formatted correctly\n final String defaultEntry = String.format(mListEntries[0].toString(),\n TEST_MAX_CONNECTED_AUDIO_DEVICES);\n assertThat(mListEntries[0]).isEqualTo(defaultEntry);\n // Update the preference\n mController.updateState(mPreference);\n // Verify default preference value, entry and summary\n assertThat(mPreference.getValue()).isEqualTo(mListValues[0]);\n assertThat(mPreference.getEntry()).isEqualTo(mListEntries[0]);\n assertThat(mPreference.getSummary()).isEqualTo(mListEntries[0]);\n // Verify that default system property is empty\n assertThat(SystemProperties.get(MAX_CONNECTED_AUDIO_DEVICES_PROPERTY)).isEmpty();\n // Verify default property integer value\n assertThat(SystemProperties.getInt(MAX_CONNECTED_AUDIO_DEVICES_PROPERTY,\n TEST_MAX_CONNECTED_AUDIO_DEVICES)).isEqualTo(TEST_MAX_CONNECTED_AUDIO_DEVICES);\n }",
"@Test\n public void rangeTest() {\n // Both IP and port ranges\n assertTrue(f.accept_packet(\"inbound\", \"tcp\", 445, \"255.126.67.1\"));\n assertTrue(f.accept_packet(\"inbound\", \"tcp\", 8000, \"0.0.3.0\"));\n assertFalse(f.accept_packet(\"inbound\", \"tcp\", 40, \"0.0.3.0\"));\n assertFalse(f.accept_packet(\"inbound\", \"tcp\", 445, \"255.255.5.5\"));\n }",
"public final void checkHostVariable(int declaredLength) throws StandardException\n\t{\n\t\t// stream length checking occurs at the JDBC layer\n\t\tint variableLength = -1;\n if ( _blobValue != null ) { variableLength = -1; }\n\t\telse if (stream == null)\n\t\t{\n\t\t\tif (dataValue != null)\n\t\t\t\tvariableLength = dataValue.length;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvariableLength = streamValueLength;\n\t\t}\n\n\t\tif (variableLength != -1 && variableLength > declaredLength)\n\t\t\t\tthrow StandardException.newException(SQLState.LANG_STRING_TRUNCATION, getTypeName(), \n\t\t\t\t\t\t\tMessageService.getTextMessage(\n\t\t\t\t\t\t\t\tMessageId.BINARY_DATA_HIDDEN),\n\t\t\t\t\t\t\tString.valueOf(declaredLength));\n\t}",
"java.lang.String getMasterIpv4ReservedRange();",
"public static boolean isValidIpAddress(String testIpAddress)\n {\n String a =\"0123456789\";\n if(testIpAddress.substring(testIpAddress.length()-1).contains(\".\") || !testIpAddress.contains(\".\"))\n {\n return false;\n } else {\n String[] test1 = testIpAddress.split(\"\\\\.\");\n if (test1.length != 4)\n {\n return false;\n }else {\n for(int b=0;b<=3;b++)\n {\n boolean test2 = isNumeric(test1[b]);\n if (test2)\n {\n for(int i = 0;i<=3;i++)\n {\n int num =Integer.parseInt(test1[i]);\n if (num >255)\n {\n return false;\n }\n }return true;\n }else\n {\n return false;\n }\n }\n }\n }return false;\n }",
"@Test(expected = ConfigException.class)\n public void testConfigParsingInvalidPortValue() {\n PowerMock.replayAll();\n Map<String, String> sampleConfig = new HashMap<>();\n sampleConfig.put(XENON_NAME, \"xenon-sink-connector\");\n sampleConfig.put(XENON_HOST, \"f3\");\n //port value is invalid as value is to be at least 1024.\n sampleConfig.put(XENON_PORT, \"1022\");\n sampleConfig.put(XENON_BUFFER_CAPACITY, \"164\");\n sampleConfig.put(SCHEMA_VERSION, \"1\");\n sampleConfig.put(TOPICS, \"topicA,topicB\");\n sampleConfig.put(XENON_DATASET_NAME, \"temp\");\n sampleConfig.put(XENON_DATASET_SCHEMA, \"{Date:CHAR, Type:CHAR, SymbolID:CHAR, \"\n + \"SequenceID:CHAR, BuySell:CHAR, Volume:CHAR, Symbol:CHAR, \"\n + \"Durationms:CHAR, Attribute:CHAR}\");\n Map<String, Object> checkConfig = connector.config().parse(sampleConfig);\n PowerMock.verifyAll();\n }",
"private static void validateWebcam() {\n String osName = System.getProperty(\"os.name\", \"\");\n String osVersion = System.getProperty(\"os.version\", \"\");\n if (osName.startsWith(\"Mac\") && osVersion.startsWith(\"10.15\")) {\n System.err.println(\"Demo doesn't currently work for os.version=\" + osVersion);\n System.err.println(\"See https://github.com/hazelcast/hazelcast-jet-demos/issues/88\");\n System.exit(1);\n }\n }",
"private static boolean isValidIp(String ip) {\n\t\tif (ip.indexOf(\".\") == -1) {\n\t\t\treturn false;\n\t\t}\n\n\t\tString[] arr = ip.split(\"\\\\.\");\n\n\t\t// if more than three dots\n\t\tif (arr.length < 4)\n\t\t\treturn false;\n\n\t\tfor (String str : arr) {\n\t\t\tint num;\n\n\t\t\t// if the section is not number return false\n\t\t\ttry {\n\t\t\t\tnum = Integer.valueOf(str);\n\t\t\t} catch (Exception e) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// number is out of range\n\t\t\tif (num < 0 || num > 255) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}",
"static void validateFileSize(int length) throws InvalidInputException {\n if (length < 0) {\n throw new InvalidInputException(\"File size is more than upper-limit\");\n } else if (length < 2) {\n throw new InvalidInputException(\"File size is less than lower-limit\");\n }\n }",
"public static void main(String[] args) {\n String demo = \"2001:0db8:85a3:0:0:8A2E:0370:7334:\";\n String demo1 = \":2001:0db8:85a3:0:0:8A2E:0370:7334:\";\n\n System.out.println(Arrays.toString(demo1.split(\":\")));\n System.out.println('f' - '0'); //49 54\n Q468_validate_ip_address s = new Q468_validate_ip_address();\n System.out.println(s.validIPAddress(demo));\n }",
"private static boolean validateApConfigPreSharedKey(String preSharedKey) {\n if (preSharedKey.length() < PSK_MIN_LEN || preSharedKey.length() > PSK_MAX_LEN) {\n Log.d(TAG, \"softap network password string size must be at least \" + PSK_MIN_LEN\n + \" and no more than \" + PSK_MAX_LEN);\n return false;\n }\n\n try {\n preSharedKey.getBytes(StandardCharsets.UTF_8);\n } catch (IllegalArgumentException e) {\n Log.e(TAG, \"softap network password verification failed: malformed string\");\n return false;\n }\n return true;\n }",
"public boolean validateStorageProviderConnection(String ipAddress, Integer portNumber, String interfaceType);",
"@Test\n public void testOverflowPort() {\n Assert.assertFalse(Utils.isValidPort(70000));\n Assert.assertFalse(Utils.isValidPort(65536));\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Returns the value of the ItemCollectionMetrics property for this object.
|
public java.util.Map<String,java.util.List<ItemCollectionMetrics>> getItemCollectionMetrics() {
return itemCollectionMetrics;
}
|
[
"public String getReturnItemCollectionMetrics() {\n return this.returnItemCollectionMetrics;\n }",
"public final Hashtable<String, Metric> getCollection() {\r\n\t\treturn metricsCollection;\r\n\t}",
"public void setItemCollectionMetrics(java.util.Map<String,java.util.List<ItemCollectionMetrics>> itemCollectionMetrics) {\n this.itemCollectionMetrics = itemCollectionMetrics;\n }",
"public Object disableMetricsCollection() {\n return this.disableMetricsCollection;\n }",
"public Metrics getMetrics() {\r\n\r\n return metrics;\r\n\r\n }",
"com.google.ads.googleads.v6.common.Metrics getMetrics();",
"public BundlerMetrics getMetrics() {\n return metrics;\n }",
"com.google.ads.googleads.v1.common.Metrics getMetrics();",
"public MetricsSet getfMetrics() {\r\n\t\treturn fMetrics;\r\n\t}",
"public abstract List getMetrics();",
"Metrics getMetrics();",
"public java.util.Enumeration enumerateMetricProperty()\n {\n return _metricPropertyList.elements();\n }",
"public void setReturnItemCollectionMetrics(String returnItemCollectionMetrics) {\n this.returnItemCollectionMetrics = returnItemCollectionMetrics;\n }",
"public void setReturnItemCollectionMetrics(ReturnItemCollectionMetrics returnItemCollectionMetrics) {\n this.returnItemCollectionMetrics = returnItemCollectionMetrics.toString();\n }",
"public Double getConsumedCapacityUnits() {\n return consumedCapacityUnits;\n }",
"Metrics getMetrics() {\n final String cacheKey = Metrics.getCacheKey(getRequestId());\n return (Metrics)Cache.get(cacheKey);\n }",
"public ClassMetrics getClassMetrics() {\n return classMetrics;\n }",
"public int getMetricPropertyCount()\n {\n return _metricPropertyList.size();\n }",
"public abstract CollectionStatistics getCollectionStatistics();"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
DB Constructors. Create a database with the specified number of pages where the page size is the default page size.
|
public void openDB( String fname, int num_pgs)
throws IOException,
InvalidPageNumberException,
FileIOException,
DiskMgrException {
name = new String(fname);
num_pages = (num_pgs > 2) ? num_pgs : 2;
File DBfile = new File(name);
DBfile.delete();
// Creaat a random access file
fp = new RandomAccessFile(fname, "rw");
// Make the file num_pages pages long, filled with zeroes.
fp.seek((long)(num_pages*MINIBASE_PAGESIZE-1));
fp.writeByte(0);
// Initialize space map and directory pages.
// Initialize the first DB page
Page apage = new Page();
PageId pageId = new PageId();
pageId.pid = 0;
pinPage(pageId, apage, true /*no diskIO*/);
DBFirstPage firstpg = new DBFirstPage(apage);
firstpg.setNumDBPages(num_pages);
unpinPage(pageId, true /*dirty*/);
// Calculate how many pages are needed for the space map. Reserve pages
// 0 and 1 and as many additional pages for the space map as are needed.
int num_map_pages = (num_pages + bits_per_page -1)/bits_per_page;
set_bits(pageId, 1+num_map_pages, 1);
}
|
[
"public void setNumDBPages(int num)\n throws IOException\t\n {\n Convert.setIntValue (num, NUM_DB_PAGE, data);\n }",
"long createDatabase(long actor, String nameToDisplay, long proteinDBType, long sizeInBytes, boolean bPublic, boolean bReversed, ExperimentCategory category);",
"public static synchronized NdexDatabase createNdexDatabase (String HostURI, String dbURL, String dbUserName,\n\t\t\tString dbPassword, int size) throws NdexException {\n\t\tif(INSTANCE == null) {\n\t INSTANCE = new NdexDatabase(HostURI, dbURL, dbUserName, dbPassword, size);\n\t return INSTANCE;\n\t\t} \n\t\t\n\t\tthrow new NdexException(\"Database has arlready been opened.\");\n\t\t\n\t}",
"private void initialiseDatabase() throws GooseException{\n \ttry{\n //Get Instance of Perst storage\n db = StorageFactory.getInstance().createStorage();\n //Use UTF-8 Encoding for string encoding\n db.setProperty(\"perst.string.encoding\", \"UTF-8\");\n //Open DB as a simple Database\n db.open(DATABASE_NAME, PAGE_POOL_SIZE);\n\n root = (Root) db.getRoot();\n if (root == null){\n //If the object was not specified, then storage is not yet initialized and it is necessary to register a new Root object\n root = new Root(db);\n //Register new root object\n db.setRoot(root);\n// //log.debug(\"New root object created\");\n }\n ctMgr= new ContactsManager(db);\n ntMgr = new NetworkManager(this);\n fwMgr = new ForwardingManager(db, this); \n// //log.debug(\"Data Base initialised\");\n }\n \tcatch(Exception e){\n \t\tthrow new GooseException(\"Error initialising DB: \"+e.getMessage());\n \t}\n }",
"public MemoryDatabase() {\r\n \t\tthis.initialize();\r\n \t}",
"Database createDatabase();",
"public DAO(String dbType){\n this.dbType = dbType;\n if(this.dbType.equals(\"MySQL\")){\n initialPool();\n\n // for q5 mysql use\n if(wholeUserIds == null){\n wholeUserIds = new TreeSet<Long>();\n }\n }\n else if(this.dbType.equals(\"Memory\")){\n // for q5 memory use\n if(wholeCountData == null){\n wholeCountData = new TreeMap<String, Integer>();\n }\n }\n\n }",
"public SongStudentDataBase createDatabase()\n {\n SongStudentDataBase db = \n new SongStudentDataBase(songList, studentSurvey);\n LinkedList<Song> songs = db.getSongsByHobby();\n songs.sortByGenre();\n for (Song song : songs)\n {\n printSongData(song);\n }\n\n songs.sortByTitle();\n for (Song song : songs)\n {\n printSongData(song);\n }\n return db;\n }",
"private Database createV5Database() {\n try {\n final V5DatabaseMetadata metaData =\n V5DatabaseMetadata.init(getMetadataFile(), V5DatabaseMetadata.v5Defaults());\n DatabaseNetwork.init(getNetworkFile(), Constants.GENESIS_FORK_VERSION, eth1Address);\n return RocksDbDatabase.createV4(\n metricsSystem,\n metaData.getHotDbConfiguration().withDatabaseDir(dbDirectory.toPath()),\n metaData.getArchiveDbConfiguration().withDatabaseDir(v5ArchiveDirectory.toPath()),\n stateStorageMode,\n stateStorageFrequency);\n } catch (final IOException e) {\n throw new DatabaseStorageException(\"Failed to read metadata\", e);\n }\n }",
"public PagesDao() {\n super(Pages.PAGES, net.redpipe.example.wiki.keycloakJooq.jooq.tables.pojos.Pages.class);\n }",
"public Database() {\n\t\tsuper();\n\t}",
"DB() throws IOException{\n\t\t//db_accounts = new DB_Accounts();\n\t\t//db_players = new DB_Players();\n\t}",
"public BufferPool(int numPages) {\n // some code goes here\n this.numPages = numPages;\n this.bufferPool = new PageBufferPool(numPages);\n }",
"private void createPages() {\n //TODO: make it dynamic\n //testing purposes only\n //System.out.println(howManyPoints/numOfEntries);\n // System.out.println(nodes.size());\n pages = new Page[nodes.size()/numOfEntries];\n for (int i = 0; i<pages.length;i++){\n pages[i]=new Page(numOfEntries);\n }\n }",
"public BufferPool(int numPages) {\n // some code goes here\n this.pageNum = numPages;\n this.bufferedPages = new ConcurrentHashMap<PageId, Node>();\n currentTransactions = new ConcurrentHashMap<TransactionId, Long>();\n lockManager = new LockManager();\n }",
"public Database(Properties prop) {\n if(!prop.getProperty(\"db_production_table_meetings\").matches(\"a4_[a-zA-Z]+\")\n || !prop.getProperty(\"db_production_table_persons\").matches(\"a4_[a-zA-Z]+\")){\n throw new IllegalArgumentException(\"Production tables may only contain letters\");\n }\n\n this.url = prop.getProperty(\"db_url\");\n this.user = prop.getProperty(\"db_user\");\n this.password = prop.getProperty(\"db_pass\");\n this.productionTableMeetings = prop.getProperty(\"db_production_table_meetings\");\n this.productionTablePersons = prop.getProperty(\"db_production_table_persons\");\n this.talkWeight = Double.parseDouble(prop.getProperty(\"talk_weight\"));\n this.meetingWeight = Double.parseDouble(prop.getProperty(\"meeting_weight\"));\n this.documentWeight = Double.parseDouble(prop.getProperty(\"document_weight\"));\n\n if(!this.createTable(productionTableMeetings, productionTablePersons)) throw new IllegalArgumentException(\"Could not create production table\");\n workingTableMeetings = productionTableMeetings;\n workingTablePersons = productionTablePersons;\n }",
"public DBDirectoryPage(Page page)\n throws IOException\n {\n super(page, DIR_PAGE_USED_BYTES);\n }",
"public int getNumDBPages()\n throws IOException {\n\n return (Convert.getIntValue(NUM_DB_PAGE, data));\n }",
"public static DiskFile create(final File fileName, final long numPages) {\n if (numPages < 2) {\n throw new IllegalArgumentException(\"Database size too small: \" + numPages);\n }\n try {\n final RandomAccessFile file = new RandomAccessFile(fileName, \"rw\");\n file.setLength(numPages * DiskManager.PAGE_SIZE);\n return new DiskFile(fileName, file, numPages);\n } catch (final IOException exc) {\n throw Minibase.haltSystem(exc);\n }\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
This returns a string representation of our test containing all the details.
|
public String toString() {
return "Name: " + sampleTest + "type: " + type + events.toString();
}
|
[
"@Test\n public void testToString() {\n System.out.println(\"toString\");\n VicePresident instance = new VicePresident(\"Federation\", \"Hakan\", \"Uyanik\", 201505, 421.612, 1965);\n String expResult = (\"Hakan\" + \" \" + \"Uyanik\" + \"\\n\"\n + \"ID: \" + 201505 + \"\\n\"\n + \"Salary: \" + 421.612 + \" $\" + \"\\n\"\n + \"Year Of Birth: \" + 1965 + \"\\n\"\n + \"Place of The Mission: \" + \"Federation\" + \"\\n\\n\");\n String result = instance.toString();\n assertEquals(expResult, result);\n }",
"public String getTestDescription() {\r\n\treturn \"\";\r\n }",
"protected String createBasicTestData() {\n BaseSignatureTestData baseData = baseTestInfo.getBaseTestData();\n String basicParameterBody = createBasicParameterRepresentation(baseData);\n StringBuilder basicTestDataPanel = new StringBuilder();\n basicTestDataPanel\n .append(\"<ul id=\\\"tabs\\\" class=\\\"nav nav-tabs\\\" data-tabs=\\\"tabs\\\">\");\n basicTestDataPanel\n .append(\"<li class=\\\"active\\\"><a href=\\\"#basic-parameters\\\" \"\n + \"data-toggle=\\\"tab\\\">Basic parameters</a></li>\");\n basicTestDataPanel\n .append(\"<li><a href=\\\"#std-out\\\" data-toggle=\\\"tab\\\">Standard output</a></li>\");\n basicTestDataPanel\n .append(\"<li><a href=\\\"#std-err\\\" data-toggle=\\\"tab\\\">Standard error</a></li>\");\n basicTestDataPanel.append(\"</ul>\");\n basicTestDataPanel\n .append(\"<div id=\\\"my-tab-content\\\" class=\\\"tab-content\\\">\");\n basicTestDataPanel\n .append(\"<div class=\\\"tab-pane active\\\" id=\\\"basic-parameters\\\">\");\n basicTestDataPanel.append(basicParameterBody);\n basicTestDataPanel.append(\"</div>\");\n basicTestDataPanel.append(\"<div class=\\\"tab-pane\\\" id=\\\"std-out\\\">\");\n basicTestDataPanel.append(\"<pre class=\\\"pre-scrollable\\\">\"\n + baseTestInfo.getStdOut() + \"</pre>\");\n basicTestDataPanel.append(\"</div>\");\n basicTestDataPanel.append(\"<div class=\\\"tab-pane\\\" id=\\\"std-err\\\">\");\n basicTestDataPanel.append(\"<pre class=\\\"pre-scrollable\\\">\"\n + baseTestInfo.getStdErr() + \"</pre>\");\n basicTestDataPanel.append(\"</div>\");\n basicTestDataPanel.append(\"</div>\");\n return basicTestDataPanel.toString();\n }",
"@Test\r\n public void testToString() {\r\n System.out.println(\"*****************\");\r\n System.out.println(\"Test : toString\");\r\n Cours_Reservation instance = new Cours_Reservation();\r\n instance.setFormation(\"Miage\");\r\n instance.setModule(\"programmation\");\r\n String expResult = instance.getFormation() + \"\\n\" + instance.getModule() ;\r\n String result = instance.toString();\r\n assertEquals(expResult, result);\r\n }",
"public void testToString() {\n\t\ttry {\n\t\t\tString result = test.toString(\"Freddie Catlay\");\t\t\t\n\t\t\tString value = \"Project Number: P1\\n\" +\n\t\t\t\t\t\t \"Team 1 Grade: 93\\n\" +\n\t\t\t\t\t\t \"Average Grade: 93.0\\n\" +\n\t\t\t\t\t\t \"Average Contribution: 9.25\";\t\t\t\n\t\t\tassertEquals(value, result);\n\t\t} catch (Exception e) {\n\t\t\tfail(\"Exception\");\n\t\t}\t\n\t}",
"@Test\n public void testToString() {\n System.out.println(\"toString\");\n Library instance = new Library();\n instance.setName(\"Test\");\n instance.setSize(5);\n String expResult = \"Library{\" + \"name=\" + instance.getName() + \", size=\" + instance.getSize() + \"}\";\n String result = instance.toString();\n assertEquals(expResult, result);\n \n }",
"@Test\n public void testToString() {\n System.out.println(\"toString\");\n String expResult = \"Country{\" + \"isoCode=\" + \"PRT\" + \", continent=\" + \"Europe\" + \", name=\" + \"Portugal\" + \", population=\" + 10196707 + \", aged65Older=\" + 21.502 + \", cardiovascularDeathRate=\" + 127.842 + \", diabetesPrevelance=\" + 9.85 + \", femaleSmokers=\" + 16.3 + \", maleSmokers=30.0\" + \", hospitalThousand=\" + 3.39 + \", lifeExpectancy=\" + 82.05 + '}';\n String result = instance.toString();\n System.out.println(\"exp: \" + expResult);\n System.out.println(\"rs: \" + result);\n assertEquals(expResult, result);\n \n }",
"public static String generateTAPTestResultDescription(ITestResult testResult) {\r\n StringBuilder description = new StringBuilder();\r\n description.append(\"- \"); // An extra space is added before the\r\n // description by the TAP Representer\r\n description.append(testResult.getTestClass().getName());\r\n description.append('#');\r\n description.append(testResult.getMethod().getMethodName());\r\n return description.toString();\r\n }",
"@Test\n\t@DisplayName(\"test toString\")\n\tvoid testToString() {\n\t\tassertEquals(\"SER515\", course.toString());\n\t}",
"public String getTestString() {\n return testString;\n }",
"public String getXmlSnippet()\r\n {\r\n StringBuffer sb = new StringBuffer(\"<testcase classname=\\\"\");\r\n sb.append(this.className);\r\n sb.append(\"\\\" name=\\\"\");\r\n sb.append(this.name);\r\n sb.append(\"\\\" time=\\\"0\\\">\");\r\n if (this.result.equals(Testcase.FAILURE))\r\n {\r\n sb.append(System.getProperty(\"line.separator\"));\r\n sb.append(\"<failure message=\\\"\");\r\n sb.append(StringEscapeUtils.escapeXml(message));\r\n sb.append(\"\\\" />\");\r\n sb.append(System.getProperty(\"line.separator\"));\r\n }\r\n sb.append(\"</testcase>\");\r\n sb.append(System.getProperty(\"line.separator\"));\r\n return sb.toString();\r\n }",
"public String createSuiteResultString() {\n\n\t\tString testsuiteResults, testcaseResults, totalExecutionTime, browserType;\n\n\t\tint passedCount, failedCount, totalExecutedCount;\n\n\t\tlong totalExecution, hr, min, sec, msec;\n\n\t\ttestsuiteResults = \"\";\n\t\ttestcaseResults = \"\";\n\n\t\t// Iterate through each of the TestSuite\n\t\t// Get the count of passed, failed test case in each suite\n\t\t// and prepare the result string with other details\n\n\t\tIterator<TestSuite> suiteIterator = ReportGenerator.getInstance()\n\t\t\t\t.getSuiteResult().iterator();\n\n\t\twhile (suiteIterator.hasNext()) {\n\n\t\t\tTestSuite suite = suiteIterator.next();\n\n\t\t\tList<TestScenario> testScenarios = suite.getTestScenariosArr();\n\n\t\t\tIterator<TestScenario> testScenarioIter = testScenarios.iterator();\n\n\t\t\t// initialize/reset the count\n\t\t\tpassedCount = 0;\n\t\t\tfailedCount = 0;\n\t\t\ttotalExecutedCount = 0;\n\t\t\t// get passed,failed,total test case count in the current suite\n\t\t\t// create string with results of each test case in the current suite\n\t\t\twhile (testScenarioIter.hasNext()) {\n\t\t\t\tTestScenario testScenario = testScenarioIter.next();\n\t\t\t\tif (testScenario != null) {\n\t\t\t\t\tif (testScenario.getExecutionResult().equalsIgnoreCase(\n\t\t\t\t\t\t\t\"Pass\")) {\n\t\t\t\t\t\tpassedCount++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfailedCount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ttotalExecutedCount++;\n\n\t\t\t\t// string with each test case results\n\t\t\t\ttestcaseResults = testcaseResults + \"\\nTest Case ID:\"\n\t\t\t\t\t\t+ testScenario.getBusinessScenarioId() + \" \"\n\t\t\t\t\t\t+ \"Test Case Description :\"\n\t\t\t\t\t\t+ testScenario.getBusinessScenarioDesc() + \" \"\n\t\t\t\t\t\t+ \"Execution Status :\"\n\t\t\t\t\t\t+ testScenario.getExecutionResult();\n\n\t\t\t}\n\n\t\t\t// total execution time of the current suite\n\t\t\ttotalExecution = suite.getExecutionTime();\n\t\t\thr = totalExecution / 1000 / 60 / 60;\n\t\t\tmin = totalExecution / 1000 / 60 - hr * 60;\n\t\t\tsec = totalExecution / 1000 - hr * 60 * 60 - min * 60;\n\t\t\tmsec = totalExecution - (hr * 60 * 60 - min * 60 - sec) * 1000;\n\n\t\t\ttotalExecutionTime = hr + \":\" + min + \":\" + sec + \":\" + msec;\n\n\t\t\t// build browser type\n\t\t\tbrowserType = getBrowserType(suite.getBrowserName());\n\n\t\t\t// append the current suite + test case results\n\t\t\ttestsuiteResults = testsuiteResults + \"\\n\\nTest Suite :\"\n\t\t\t\t\t+ suite.getTestSuiteName() + \" \" + \"Browser Type :\"\n\t\t\t\t\t+ browserType + \" \" + \"Application URL :\" + suite.geturl()\n\t\t\t\t\t+ \" \" + \"Test Cases Executed :\" + totalExecutedCount + \" \"\n\t\t\t\t\t+ \"Passed :\" + passedCount + \" \" + \"Failed :\" + failedCount\n\t\t\t\t\t+ \" \" + \"Total Execution Time :\" + totalExecutionTime\n\t\t\t\t\t+ testcaseResults;\n\n\t\t\t// reset testcaseResults\n\t\t\ttestcaseResults = \"\";\n\n\t\t}\n\n\t\treturn testsuiteResults;\n\t}",
"@Test\n public void testToString() {\n System.out.println(\"toString\");\n Suorakulmio instance = new Suorakulmio(99, 10);\n String expResult = \"leveys=99, korkeus=10\";\n String result = instance.toString();\n assertEquals(expResult, result);\n }",
"public String getAssertionSummary() {\n StringBuffer sb = new StringBuffer(\"******************Summary******************\\n\");\n sb.append(\"Passed: \" + assertionPassCount + \"\\n\");\n sb.append(\"Failed: \" + assertionFailCount + \"\\n\");\n sb.append(\"Total : \" + assertionTotal + \"\\n\");\n\n if (assertionTotal != assertionPassCount + assertionFailCount) {\n sb.append(\"\\n Some assertions were not executed, so you should probably increase the runtime. \\n\");\n }\n return sb.toString();\n }",
"public String toString(){\n\t\treturn summary;\n\t}",
"@Test\r\n public void testToString() {\r\n System.out.println(\"toString\");\r\n String expResult = \"Nome = Habilidade; Tipo = Fisica; Nivel = 0; Teste = 0; Custo = 0\";\r\n String result = instance.toString();\r\n assertEquals(expResult, result);\r\n // TODO review the generated test code and remove the default call to fail.\r\n //fail(\"The test case is a prototype.\");\r\n }",
"public static String getTestName() {\n return testName;\n }",
"@Test \n public void testToString() {\n System.out.println(\"toString\");\n ShoppingCart instance = new ShoppingCart(11, 50.5);\n String expResult = \"Numbers of Items 0 Subtotal 0.0\";\n String result = instance.toString();\n assertEquals(expResult, result);\n }",
"@Test\n public void testToString() {\n System.out.println(\"toString\");\n String expResult = \"User [userId=\" + instance.getUserId() + \", userName=\" + instance.getUserName() + \", emailId=\"\n + instance.getEmailId() + \"]\";\n String result = instance.toString();\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n //fail(\"The test case is a prototype.\");\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Unmodifiable view of an organizer
|
public interface ReadOnlyOrganizer {
/**
* Returns an unmodifiable view of the tasks list.
* This list will not contain any duplicate tasks.
*/
ObservableList<Task> getTaskList();
/**
* Returns an unmodifiable view of the current user's task list.
* This list will not contain any duplicate tasks.
*/
ObservableList<Task> getCurrentUserTaskList();
/**
* Returns an unmodifiable view of the tags list.
* This list will not contain any duplicate tags.
*/
ObservableList<Tag> getTagList();
/**
* Returns an unmodifiable view of the users list.
* This list will not contain any duplicate users.
*/
ObservableList<User> getUserList();
/**
* Returns the currently logged in user
*/
User getCurrentLoggedInUser();
}
|
[
"public String getOrganiser() {\n return organiser;\n }",
"public Organism getOrganism();",
"public IListOrganiser getOrganiser() {\n\t\treturn organiser;\n\t}",
"public String getOrgan() {\n\t\treturn this.organ;\n\t}",
"public String getOrganiserName() {\n return organiserName;\n }",
"SubstanceSourceMaterialOrganism getOrganism();",
"public Organizer getCurrOrganizer(){\n return (Organizer) getCurrAccount();\n }",
"public void setOrganism(Organism organism);",
"public String getOrg() {\n return org;\n }",
"public String getOrganizingPrinciple()\n {\n return organizingPrinciple;\n }",
"public void setOrgan(String organ) {\n\t\tthis.organ = organ;\n\t}",
"public abstract List<Organism> getOrganisms();",
"public final String getOrganisation() {\n return organisation;\n }",
"Identifier getOrganismId();",
"public void setOrganiser(IListOrganiser org) {\n\t\torganiser = org;\n\t}",
"public EmailAddress getOrganizer() throws ServiceLocalException {\n\t\treturn (EmailAddress) this.getPropertyBag()\n\t\t\t\t.getObjectFromPropertyDefinition(AppointmentSchema.Organizer);\n\t}",
"public List<T> getOrganisms();",
"public String getOrganization ()\n {\n return this.organization;\n }",
"public ArrayList<OrganismType> getOrganismList();"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
/ Commit and make it observable the obs state
|
private void commitObsStateChanges(){
//log("committing obs state changed:");
ArtifactObsProperty[] changed = obsPropertyMap.getPropsChanged();
ArtifactObsProperty[] added = obsPropertyMap.getPropsAdded();
ArtifactObsProperty[] removed = obsPropertyMap.getPropsRemoved();
try {
if (changed != null || added != null || removed != null){
wsp.notifyObsEvent(id, null, changed, added, removed);
guards.signalAll();
}
} catch (Exception ex){
ex.printStackTrace();
}
obsPropertyMap.commitChanges();
}
|
[
"private void commitObsStateChangesAndSignal(AgentId target, Tuple signal){\n //log(\"committing obs state changed:\");\n ArtifactObsProperty[] changed = obsPropertyMap.getPropsChanged();\n ArtifactObsProperty[] added = obsPropertyMap.getPropsAdded();\n ArtifactObsProperty[] removed = obsPropertyMap.getPropsRemoved(); \n try {\n if (target == null){\n wsp.notifyObsEvent(id, signal, changed, added, removed);\n } else {\n wsp.notifyObsEventToAgent(id, target, signal, changed, added, removed);\n }\n guards.signalAll();\n } catch (Exception ex){\n ex.printStackTrace();\n }\n obsPropertyMap.commitChanges();\n }",
"public Observable<M> updateAsObservable(){\n return updateAsObservable(null);\n }",
"void update(Loan observable);",
"private void notifyObservers() {\n BinStatusUpdate newStatus = buildNewStatus();\n observers.iterator().forEachRemaining(binStatusUpdateStreamObserver -> binStatusUpdateStreamObserver.onNext(newStatus));\n }",
"public IObservableValue getDirty();",
"public Observable() {\r\n\t\tthis.observers = new Vector<Observer>();\r\n\t}",
"public void update(){\n\t\tSystem.out.println(\"Return From Observer Pattern: \\n\" + theModel.getObserverState() \n\t\t+ \"\\n\");\n\t}",
"public void update(Observable observable) {\n ConcreteObservable concreteObservable = (ConcreteObservable) observable;\n System.out.println(\"El nuevo valor es: \" + concreteObservable.getValue());\n }",
"public void markChangesAsCommitted() {\n changeEventSubscriber.getChanges().clear();\n }",
"public void notifyObservers() {\n mProducts.setValue(mProducts.getValue());\n mCartItems.setValue(mCartItems.getValue());\n }",
"void disposeObservable();",
"void refreshObsData() {\n Observer<Pet> observer = this.pet::setValue;\n if (pet.getValue() == null) {return;}\n SingleLiveEvent<Pet> petRetrieved =\n petService.getPetById(this, pet.getValue().getPetId());\n petRetrieved.observeForever(observer);\n mapObservableObserver.put(petRetrieved, observer);\n }",
"public void actualizarEstadoAct() {\n estadoAct = estadoSig;\n setChanged();\n notifyObservers(estadoAct);\n }",
"private static void createColdObservable() {\n var observable = Observable.just(1, 2, 3, 4, 5);\n\n observable.subscribe(item -> LOG.info(\"Observer 1: {}\", item));\n\n pause(1000);\n\n observable.subscribe(item -> LOG.info(\"Observer 2: {}\", item));\n }",
"Observable<T> update(T item);",
"public void makeDirty() {\n\t\tif (!dirty) {\n\t\t\tthis.dirty = true;\n\t\t\tif (getProcess().getDebugMode() == DebugMode.COLLECT_METADATA_AFTER_EXECUTION) {\n\t\t\t\tclear(Port.CLEAR_REAL_METADATA);\n\t\t\t}\n\t\t\tdirtynessWasPropagated = false;\n\t\t\tfireUpdate();\n\t\t}\n\t}",
"public void doSomeChanges() {\n\n eventBus.publish(\"our.event.coming.from.model\", \"some data passed\");\n }",
"public Observable() {\n\n\t\tobservers = new ArrayList<Observer<C>>();\n\t}",
"public void commit() {\n if( dirty ) {\n value = textField.getText();\n notifyTextValueChanged();\n }\n dirty = false;\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Records the search engine type after the user chooses a different search engine.
|
public static boolean recordSearchEngineTypeAfterChoice() {
if (!isSearchEnginePossiblyDifferent()) return false;
@SearchEngineType
int previousSearchEngineType = getPreviousSearchEngineType();
@SearchEngineType
int currentSearchEngineType = getDefaultSearchEngineType();
boolean didChangeEngine = previousSearchEngineType != currentSearchEngineType;
if (didChangeEngine) {
RecordHistogram.recordEnumeratedHistogram(
"Android.SearchEngineChoice.ChosenSearchEngine", currentSearchEngineType,
SearchEngineType.SEARCH_ENGINE_MAX);
}
removePreviousSearchEngineType();
return didChangeEngine;
}
|
[
"public static void recordSearchEngineTypeBeforeChoice() {\n @SearchEngineType\n int currentSearchEngineType = getDefaultSearchEngineType();\n RecordHistogram.recordEnumeratedHistogram(\n \"Android.SearchEngineChoice.SearchEngineBeforeChoicePrompt\",\n currentSearchEngineType, SearchEngineType.SEARCH_ENGINE_MAX);\n setPreviousSearchEngineType(currentSearchEngineType);\n }",
"@VisibleForTesting\n static void setPreviousSearchEngineType(@SearchEngineType int engine) {\n SharedPreferencesManager.getInstance().writeInt(\n ChromePreferenceKeys.SEARCH_ENGINE_CHOICE_DEFAULT_TYPE_BEFORE, engine);\n }",
"@VisibleForTesting\n static @SearchEngineType int getPreviousSearchEngineType() {\n return SharedPreferencesManager.getInstance().readInt(\n ChromePreferenceKeys.SEARCH_ENGINE_CHOICE_DEFAULT_TYPE_BEFORE,\n SearchEngineType.SEARCH_ENGINE_UNKNOWN);\n }",
"public final void setTypeOfEngine(String typeOfEngine) {\n this.typeOfEngine = typeOfEngine;\n }",
"public String getSearchType() {\r\n\t\treturn searchType;\r\n\t}",
"public static String getType() {\n SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(App.getAppContext());\n String defaultValue = Strings.getStringByRId(R.string.c_elastic_search_type_name_default_value);\n String value = Strings.getStringByRId(R.string.c_select_elastic_search_type_name);\n String type = sp.getString(value, defaultValue);\n return type;\n }",
"private void getSelectedSearchType() {\n getSelectedSearchType(0);\n }",
"public void findSearchType() {\n\t\t\n\t\t\tif (customerView.getSearchParameter().getText().equals(\"\"))\n\t\t\t\tthis.customerView.getStatusText().setText(\"Please enter the parameter\");\n\t\t\telse if (customerView.getSearchCustomerID().isSelected())\n\t\t\t\tsearchClientID();\n\t\t\telse if (customerView.getSearchLastName().isSelected())\n\t\t\t\tsearchLastName();\n\t\t\telse if (customerView.getSearchCustomerType().isSelected())\n\t\t\t\tsearchType();\n\t\t\telse\n\t\t\t\tthis.customerView.getStatusText()\n\t\t\t\t\t\t.setText(\"Couldn't find an option on which valid search is to be made\");\n\t\t}",
"public void setSearchType(Integer searchType) {\n this.searchType = searchType;\n }",
"public Integer getSearchType() {\n return searchType;\n }",
"public void setEngineType(EngineType engineType) {\n this.engineType = engineType;\n }",
"public void setSearchType(final int searchType)\r\n\t{\r\n\t\tthis.searchType = searchType;\r\n\t}",
"public void typeSearchTerm(String searchTerm) {\n typeSearchTerm(searchTerm, searchTermFieldIndex++);\n }",
"void setSearchAlgorithm(SEARCHTYPE searchAlgorithm);",
"public void setQueryType(String queryType);",
"public void setSearchType(final String searchType) {\r\n\t\tif (searchType == null || !searchType.equals(Constants.SEARCH_TYPE_CAT)\r\n\t\t\t\t&& !searchType.equals(Constants.SEARCH_TYPE_KY_WD) && !searchType.equals(Constants.SEARCH_TYPE_PRD)) {\r\n\t\t\tthrow new IllegalArgumentException(\"Invalid value of Search Type: \" + searchType);\r\n\t\t}\r\n\t\tthis.searchType = searchType;\r\n\t}",
"public void setEngine(java.lang.String value) {\n this.engine = value;\n }",
"public String getResearchtype() {\r\n\t\treturn researchtype;\r\n\t}",
"public String getEngineType() {\n\t\treturn engineType;\n\t}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Sets the given legacy alternate bouncer to null if it's the current alternate bouncer. Else, does nothing. Only used if modern alternate bouncer is NOT enabled.
|
public void removeLegacyAlternateBouncer(
@NonNull LegacyAlternateBouncer alternateBouncerLegacy) {
if (!mIsModernAlternateBouncerEnabled) {
if (Objects.equals(mAlternateBouncerInteractor.getLegacyAlternateBouncer(),
alternateBouncerLegacy)) {
mAlternateBouncerInteractor.setLegacyAlternateBouncer(null);
hideAlternateBouncer(true);
}
}
}
|
[
"public void setLegacyAlternateBouncer(@NonNull LegacyAlternateBouncer alternateBouncerLegacy) {\n if (!mIsModernAlternateBouncerEnabled) {\n if (!Objects.equals(mAlternateBouncerInteractor.getLegacyAlternateBouncer(),\n alternateBouncerLegacy)) {\n mAlternateBouncerInteractor.setLegacyAlternateBouncer(alternateBouncerLegacy);\n hideAlternateBouncer(true);\n }\n }\n\n }",
"public void setLegacyOtherBlasting(String aLegacyOtherBlasting) {\n legacyOtherBlasting = aLegacyOtherBlasting;\n }",
"public boolean isLegacyFallback() {\n return mLegacyFallback;\n }",
"public void setLegacyAbrasiveFlowRate(String aLegacyAbrasiveFlowRate) {\n legacyAbrasiveFlowRate = aLegacyAbrasiveFlowRate;\n }",
"public void setFallbackTransport(Transport fallbackTransport);",
"public void setLegacyAbrasiveTypes(String aLegacyAbrasiveTypes) {\n legacyAbrasiveTypes = aLegacyAbrasiveTypes;\n }",
"public void setLegacyEngineFamily(String aLegacyEngineFamily) {\n legacyEngineFamily = aLegacyEngineFamily;\n }",
"public void setLegacySilosCrushers(String aLegacySilosCrushers) {\n legacySilosCrushers = aLegacySilosCrushers;\n }",
"public void setLegacyResident(String aLegacyResident) {\n legacyResident = aLegacyResident;\n }",
"public void setLegacyFuelConsumptionRate(Double aLegacyFuelConsumptionRate) {\n legacyFuelConsumptionRate = aLegacyFuelConsumptionRate;\n }",
"public void setLegacyNozzleDiameter(String aLegacyNozzleDiameter) {\n legacyNozzleDiameter = aLegacyNozzleDiameter;\n }",
"public void setLegacyCategory(String legacyCategory) {\n this.legacyCategory = legacyCategory;\n }",
"public void setLegacyEmissionControls(String aLegacyEmissionControls) {\n legacyEmissionControls = aLegacyEmissionControls;\n }",
"public void setLegacyEmissionPoints(String aLegacyEmissionPoints) {\n legacyEmissionPoints = aLegacyEmissionPoints;\n }",
"public void setLegacy_name(String legacy_name) {\n this.legacy_name = legacy_name == null ? null : legacy_name.trim();\n }",
"public void setFallback(boolean fallback) {\n\t\tthis.fallback = fallback;\n\t}",
"public void setLegacyNozzlePressure(String aLegacyNozzlePressure) {\n legacyNozzlePressure = aLegacyNozzlePressure;\n }",
"public String getLegacyOtherBlasting() {\n return legacyOtherBlasting;\n }",
"public void setAlternativeFactory(Converter.Factory alternativeFactory) {\n\t\tthis.alternativeFactory = alternativeFactory;\n\t}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
optional int64 apikey_op_id = 1;
|
public long getApikeyOpId() {
return apikeyOpId_;
}
|
[
"long getApikeyOpId();",
"public long getApikeyOpId() {\n return apikeyOpId_;\n }",
"boolean hasApikeyOpId();",
"public Builder setApikeyOpId(long value) {\n bitField0_ |= 0x00000001;\n apikeyOpId_ = value;\n onChanged();\n return this;\n }",
"com.google.protobuf.StringValue getApiKeyId();",
"java.lang.String getApikey();",
"public interface ApiKey {\n\n /**\n * Returns the public unique identifier. This can be publicly visible to anyone - it is not\n * considered secure information.\n *\n * @return the public unique identifier.\n */\n String getId();\n\n /**\n * Returns the raw SECRET used for API authentication. <b>NEVER EVER</b> print this value anywhere\n * - logs, files, etc. It is TOP SECRET. This should not be publicly visible to anyone other\n * than the person to whom the ApiKey is assigned. It is considered secure information.\n *\n * @return the raw SECRET used for API authentication.\n */\n String getSecret();\n\n}",
"java.lang.String getApiKeyId();",
"protected abstract Long requestKey();",
"com.google.protobuf.StringValueOrBuilder getApiKeyIdOrBuilder();",
"public String getAPIkey() {\n\t\treturn key1;\r\n\t}",
"public static void setAPIkey(String key) {\n\t\tkey1 = key;\r\n\r\n\r\n\t}",
"String getServiceOwnerApiKey();",
"String getServiceApiKey();",
"@Test\n public void keyStoresGenerateTokenFromKeyByIdTestQueryMap() {\n final String id;\n final Integer key;\n final KeyStoresApi.KeyStoresGenerateTokenFromKeyByIdQueryParams queryParams =\n new KeyStoresApi.KeyStoresGenerateTokenFromKeyByIdQueryParams().deviceMac(null);\n // String response = api.keyStoresGenerateTokenFromKeyById(id, key,\n // queryParams);\n // TODO: test validations\n }",
"private String getAPIkey() {\n\t\treturn apikey;\n\t}",
"public interface ApiKeyGenerator {\n /**\n * Generates and signs the apikey, which can be used for the authorization of APIs deployed at gateways\n * @param jwtTokenInfoDTO\n * @return the signed apikey as a string\n * @throws org.wso2.carbon.apimgt.api.APIManagementException\n */\n String generateToken(JwtTokenInfoDTO jwtTokenInfoDTO) throws APIManagementException;\n}",
"Object getAuthInfoKey();",
"yandex.cloud.api.iam.v1.ApiKeyOuterClass.ApiKey getApiKey();"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Emit the 3rd letter in the greek alphabet Gamma
|
public static void main(String[] args) {
Observable.from(DataGenerator.generateGreekAlphabet())
.elementAt(2)
.subscribe((letter) -> {
System.out.println(letter);
});
System.out.println();
// Emit the 50th letter in the greek alphabet
// ...there isn't a 50th letter, so we want to get "Unknown"
Observable.from(DataGenerator.generateGreekAlphabet())
.elementAtOrDefault(50, "Unknown")
.subscribe((letter) -> {
System.out.println(letter);
});
System.out.println();
System.exit(0);
}
|
[
"public String toString(){\r\n return Character.toLowerCase(this.getColor().charAt(0)) + \"K\";\r\n }",
"public String getIso3Char();",
"private String getLetter(BoggleBoard board, int i, int j) {\r\n char c = board.getLetter(i, j);\r\n if (c == 'Q') return \"QU\";\r\n else return \"\" + c;\r\n }",
"public String getAlpha3() {\n return alpha3;\n }",
"double getGamma();",
"String getLetterClosing();",
"public abstract char letterAverage();",
"public float getGamma();",
"public char getLetterAt(int i) {\r\n\t if (i < sequence.length) {\t \r\n\t return sequence[i];\r\n\t } else {\r\n\t return ' ';\r\n\t }\r\n\t }",
"public TurkicLetter getAsciiEquivalentLetter(TurkicLetter letter) {\r\n return ASCII_EQUIVALENT_LETTER_LOOKUP[letter.alphabeticIndex() - 1];\r\n }",
"public String ObjsGetCharFontName( int index )\n\t{\n\t\treturn objsGetCharFontName( hand, index );\n\t}",
"private char generateNextLetter( char previousLetter )\r\n {\r\n if ('A' <= previousLetter && previousLetter < 'Z')\r\n {\r\n int asciiPreviousLetter = (int) previousLetter;\r\n asciiPreviousLetter++;\r\n return (char) asciiPreviousLetter;\r\n }\r\n throw new IllegalArgumentException( String.valueOf(previousLetter) );\r\n }",
"public GreekCharacter[] getGreekChar() {\n GreekCharacter[] gc = new GreekCharacter[9];\n Collections.shuffle(greekChars);\n\n for(int i= 0; i < 9; i++){\n gc[i] = greekChars.get(i);\n }\n return gc;\n }",
"public void setLetter(char c){ this.letter = c; }",
"static String generateAlphabetLC(){\n\t\tfor (int i = 97; i <= 122; i++){\n\n\t\t\talphabetLowerCase = alphabetLowerCase + (char) i;\n\t\t}\n\t return alphabetLowerCase;\n\t}",
"char toChar(int index) {\n return alpha.charAt(index % size());\n }",
"private static char getLetter(int num) {\n switch (num) {\n case 10:\n return 'A';\n case 11:\n return 'B';\n case 12:\n return 'C';\n case 13:\n return 'D';\n case 14:\n return 'E';\n case 15:\n return 'F';\n case 16:\n return 'G';\n }\n return ' ';\n }",
"public void setLetter\n\t\t\t(char letter)\n\t\t\t{\n\t\t\tletters = letter == 'Q' ? \"QU\" : \"\"+letter;\n\t\t\tsetText (letters);\n\t\t\t}",
"static String generateSymbolsString(){\n\t\tfor (int i = 33; i <= 47; i++){\n\t\t\t\n\t\t\tsymbols = symbols + (char) i;\n\t\t}\n\t return symbols;\n\t}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Store a received video call.
|
public abstract void addReceivedVideo(Video video) throws UnsuportedOperationException;
|
[
"@Override\n public void onVideoTrackAdded(Call call) {\n mAcceptVideo = true;\n }",
"private void setVideo(){\n /* if(detailsBean==null){\n showToast(\"没有获取到信息\");\n return;\n }\n UserManager.getInstance().setDetailsBean(detailsBean);\n upCallShowSetVideoData = new UpCallShowSetVideoData();\n upCallShowSetVideoData.smobile = Preferences.getString(Preferences.UserMobile,null);\n upCallShowSetVideoData.iringid = detailsBean.iringid;\n if (callShowSetVideoProtocol == null) {\n callShowSetVideoProtocol = new CallShowSetVideoProtocol(null, upCallShowSetVideoData, handler);\n callShowSetVideoProtocol.showWaitDialog();\n }\n callShowSetVideoProtocol.stratDownloadThread(null, ServiceUri.Spcl, upCallShowSetVideoData, handler,true);*/\n }",
"Call createVideoCall(Contact callee)\n throws OperationFailedException;",
"private void sendVideoFile() {\n Bundle conData = new Bundle();\n Intent intent = new Intent();\n intent.setData(mVideoUri);\n intent.putExtras(conData);\n setResult(RESULT_OK, intent);\n finish();\n }",
"private void enableVideo(IKandyCall pCall) {\n pCall.startVideoSharing(new KandyCallResponseListener() {\n\n @Override\n public void onRequestSucceeded(IKandyCall call) {\n Log.i(TAG, \"enableVideo:onRequestSucceeded: true\");\n }\n\n @Override\n public void onRequestFailed(IKandyCall call, int responseCode, String err) {\n Log.i(TAG, \"enableVideo:onRequestFailed: \" + err + \" Response code: \" + responseCode);\n }\n });\n }",
"void onCallAccepted();",
"void addVideoListener(CallPeer peer, VideoListener listener);",
"Call createVideoCall(Contact callee, QualityPreset qualityPreferences)\n throws OperationFailedException;",
"void callAddVideoIntent() {\r\n Intent intent = new Intent(this, FileExplorerActivity.class);\r\n intent.putExtra(FileExplorerActivity.INTENT_EXTRA_KEY_FILEFILTER, new String[]{\r\n \".mp4\"\r\n });\r\n startActivityForResult(intent, REQUEST_ADD_VIDEO_FILE);\r\n\r\n }",
"public void setVideoReciever(VideoReciever videoReciever);",
"void saveReceivedPacket(int slot) {\r\n byte [] tmp = this.rbuf[slot];\r\n this.rbuf[slot] = this.receivedPacket;\r\n this.receivedPacket = tmp;\r\n }",
"public abstract void addSentVideo(Video video) throws UnsuportedOperationException;",
"void addPlayRecord(User user, String video_id);",
"public void testSuccessfulLastCommunicationVideo() {\n\t\ttestSuccessfulLastMadeCall(\n\t\t\t\tcommunicationRepresentation.getVideoCommunication(),\n\t\t\t\tEXPECTED_VIDEO_COST);\n\t}",
"private void acceptCall() {\n\t\ttry {\n\t\t\tupdateText(\"Pratar med \", call.getPeerProfile().getUserName());\n\t\t\tcall.answerCall(30);\n\t\t\tcall.startAudio();\n\t\t\tif (call.isMuted()) {\n\t\t\t\tcall.toggleMute();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tif (call != null) {\n\t\t\t\tcall.close();\n\t\t\t}\n\n\t\t}\n\t}",
"public boolean acceptEarlyMedia(LinphoneCall call);",
"boolean isLocalVideoStreaming(Call call);",
"void answerVideoCallPeer(CallPeer peer)\n throws OperationFailedException;",
"public void incomingCallReceived(CallEvent event) {}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
That method find the row when reading a board from a file.
|
public void findRow(String fileName) {
try {
int counter = 0;
FileInputStream file = new FileInputStream(fileName);
Scanner sc = new Scanner(file);
while(sc.hasNextLine())
{
sc.nextLine();
counter++;//returns the line that was skipped
}
sc.close(); //closes the scanner
row = counter;
}
catch(FileNotFoundException e) {
e.printStackTrace();
}
}
|
[
"public int locateRow(String val, int col);",
"private int getRowFor(File file) {\r\n\r\n\t\t// FIXME: Is there a better way to find the row of the specified\r\n\t\t// file???\r\n\t\t// We must do a linear search because the files will usually (always?)\r\n\t\t// not be listed in alphabetical order (i.e., folders come first, and\r\n\t\t// the user can sort by column).\r\n\t\tTableColumnModel columnModel = getColumnModel();\r\n\t\tint column = columnModel.getColumn(0).getModelIndex();\r\n\t\tTableModel tableModel = getModel();\r\n\t\tint rowCount = getRowCount();\r\n\t\tfor (int i=0; i<rowCount; i++) {\r\n\t\t\tFile temp = (File)tableModel.getValueAt(i, column);\r\n\t\t\tif (file.equals(temp))\r\n\t\t\t\treturn i;\r\n\t\t}\r\n\r\n\t\treturn -1;\r\n\r\n\t}",
"int getRow(int x, int y){\n return board[x][y].getRow();\n }",
"private int findLine(int row, Cell[][] cells) {\n\t\tfor (int i = 0; i < cells.length; i++) {\n\t\t\tif (cells[i][0].getAddress().getRow() == row) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}",
"private int rowFinder(Board board) {\n\t\tRandom myRandom = new Random();\n\t\twhile(true) {\n\t\t\tint row = myRandom.nextInt(board.getNumberOfRows()) + 1; /* random.nextInt(max - min + 1) + min,\n\t\t\trandom row with out 0 */\n\t\t\tif (this.isRowHasUnmarkedStick(row, board)) {\n\t\t\t\treturn row;\n\t\t\t}\n\t\t}\n\t}",
"private int findLine(int row, String[][] serverCells) {\n\t\tfor (int i = 1; i < serverCells.length; i++) {\n\t\t\tif (Integer.parseInt(serverCells[i][0]) == row) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}",
"public int getCurrentRow()\n {\n return rowOfPiece;\n }",
"public void readRow(String line);",
"com.whiuk.philip.mmorpg.shared.Messages.ServerMessage.GameData.ZoneInformation.TileData.TileRow getTileRow(int index);",
"public int getCurrentPawnRow(){\r\n GamePosition curPos = currentGame.getCurrentPosition();\n\t\tPlayer white = currentGame.getWhitePlayer();\n\t\tif(curPos.getPlayerToMove().equals(white)) {\n\t\t\treturn curPos.getWhitePosition().getTile().getRow();\n\t\t\t\n\t\t} else {\n\t\t\treturn curPos.getBlackPosition().getTile().getRow();\n\t\t}\r\n }",
"public void findColumn(String fileName) {\r\n\t\ttry {\r\n\t\t\tFileInputStream file = new FileInputStream(fileName); \r\n\t\t\tScanner input = new Scanner(file); \r\n\t\t\t int counter = 0;\r\n\t\t\t wall_number = 0;\r\n\t\t\t while (input.hasNext()) {\r\n\t\t\t String str = input.next();\r\n\t\t\t if(str == \"00\")\r\n\t\t\t \twall_number++;\r\n\t\t\t counter++;\r\n\t\t\t }\r\n\t\t\t input.close(); \r\n\t\t\t column = counter / row;\r\n\t\t}\r\n\t\tcatch(FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public boolean boardExists(String boardId){\n FileReader fr = null;\n BufferedReader br = null;\n boolean exists = false;\n try{\n fr = new FileReader(boardsDataFilePath);\n br = new BufferedReader(fr);\n String line;\n boolean nextIsId = false;\n while (((line = br.readLine()) != null) && !exists){\n String[] data = line.split(\" \");\n if(nextIsId){\n if(data[0].equals(boardId)) exists = true;\n else nextIsId = false;\n }\n else if (data[0].equals(\"board\")) nextIsId = true;\n }\n fr.close();\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n try {\n if (null != fr) {\n fr.close();\n }\n } catch (Exception e2) {\n e2.printStackTrace();\n }\n }\n return exists;\n }",
"private static Board loadBoard(File fileName, Scanner fileScanner, Player firstPlayer, Player secondPlayer) throws CorruptedFileException {\t\n\t\t\n\t\tBoard gameBoard = new Board();\n\t\t//Initialize the checkMatrix to the number of rows and columns of the board, so that it is like a mirror to the board\n\t\tIntegrityMatrix checkMatrix = new IntegrityMatrix(Board.getNumberOfRows(), Board.getNumberOfColumns());\n\t\t\n\t\t//First phase for identifying the statement \"Board\" and going forward\n\t\tfileScanner.next();\n\t\tfileScanner.nextLine();\n\t\t\n\t\t//Local variables \n\t\tint currentRow;\n\t\tint currentColumn;\n\t\tint redComp = 0;\n\t\tint greenComp = 0;\n\t\tint blueComp = 0;\n\t\tToken firstToken = firstPlayer.getToken();\n\t\tToken secondToken = secondPlayer.getToken();\n\t\t\n\t\t//Reads where are the tokens in the gameBoard from the provided file, fileName \n\t\twhile(fileScanner.hasNextLine()) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\tfileScanner.findInLine(\"Row: \"); //Searches for the statement \"Row\" \n\t\t\tcurrentRow = fileScanner.nextInt(); //Takes the row number\n\t \n\t\t\tfileScanner.findInLine(\"Col: \"); \n\t\t\tcurrentColumn = fileScanner.nextInt(); //Takes the column number \n\t\t\t\n\t\t\t//Check the integrity of the position. \n\t\t\t//checkMatrix is the IntegrityMatrix object used to verify that the file leads to a Legal State for the Board,\n\t\t\t//so if the Board recreated is properly formed, without errors like floating tokens or tokens above tokens.\n\t\t\t//For further details, consult the IntegrityMatrix class.\n\t\t\tif(checkMatrix.checkIntegrity(currentRow, currentColumn, Board.getNumberOfRows()-1, Board.getNumberOfColumns()-1)) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t//Token creation\n\t\t\t\tredComp = fileScanner.nextInt();\n\t\t\t\tgreenComp = fileScanner.nextInt();\n\t\t\t\tblueComp = fileScanner.nextInt();\n\t\t\t\t//If token belongs to firstPlayer or to secondPlayer. Inserting a new object of type token would lead to insert different objects at all, with different references\n\t\t\t\t//This would lead to n different tokens in the board, so logic would be completely gone.\n\t\t\t\tif(redComp == firstToken.getTokenColor().getRed() && greenComp == firstToken.getTokenColor().getGreen() && blueComp == firstToken.getTokenColor().getBlue()) {\n\t\t\t\t\t//Insert the token in the gameBoard\n\t\t\t\t\ttry {\n\t\t\t\t\t\tgameBoard.insert(firstToken, currentColumn);\n\t\t\t\t\t} catch (FullColumnException e) {\n\t\t\t\t\t\tthrow new CorruptedFileException();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(redComp == secondToken.getTokenColor().getRed() && greenComp == secondToken.getTokenColor().getGreen() && blueComp == secondToken.getTokenColor().getBlue()) {\t\n\t\t\t\t\t//Insert the token in the gameBoard\n\t\t\t\t\ttry {\n\t\t\t\t\t\tgameBoard.insert(secondToken, currentColumn);\n\t\t\t\t\t} catch (FullColumnException e) {\n\t\t\t\t\t\tthrow new CorruptedFileException();\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//Integrity matrix says it is not safe to open the file because the board was wrong. \n\t\t\t\tthrow new CorruptedFileException();\n\t\t\t}\n\t\t\t//Advances past the line\n\t\t\tfileScanner.nextLine();\t\n\t\t}\n\t\treturn gameBoard;\t\t\n\t}",
"public void loadBoard() {\n FileReader fr = null;\n String line;\n int i;\n\n try {\n fr = new FileReader(file.getPath());\n BufferedReader bf = new BufferedReader(fr);\n try {\n i = 0;\n while ((line = bf.readLine()) != null) {\n String[] numeros = line.split(\" \"); // get the numbers from the line\n\n for (int j = 0; j < numeros.length; j++) {\n m_board[i][j] = Integer.parseInt(numeros[j]); // inserts the numbers into the board\n }\n i++;\n }\n } catch (IOException e1) {\n System.out.println(\"Error reading file:\" + file.getName());\n }\n } catch (FileNotFoundException e2) {\n System.out.println(\"Error opening file: \" + file.getName());\n } finally {\n try {\n if (null != fr) {\n fr.close();\n }\n } catch (Exception e3) {\n System.out.println(\"Error closing file: \" + file.getName());\n }\n }\n }",
"private int locationNumber(int row, int col) {\n return (BOARD_SIZE * row) + col;\n }",
"public Row getRow(int idx) {\n return board.getRow(idx);\n }",
"public int getRow ()\r\n {\r\n return row;\r\n }",
"public int getRow(){ return this.row;}",
"long getCellRow();"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
returns how many ships are not destroyed
|
static int shipsUp()
{
int up = 5;
for (int i = 0; i < shipsDestroyed.length; i++)
{
if (shipsDestroyed[i])
up--;
}
return up;
}
|
[
"public int getShipsAlive() {\n return this.numberOfShips;\n }",
"public int getNumNotHit()\n {\n return shipCoordinates.size() - hitCoordinates.size();\n }",
"public int getNumberShips();",
"public int getNumberOfShips() {\r\n\t\treturn numberOfShips;\r\n\t}",
"public static Integer getNumberOfships() {\n\t\treturn NUMBEROFSHIPS;\n\t}",
"public int number_of_ships() {\n \treturn this.number_of_ships;\n }",
"private int getNumberOfBoxesOfAllShips() {\r\n int count = 30;\r\n return count;\r\n }",
"private int getShipsSunk() {\r\n return shipsSunk;\r\n }",
"public void checkShipsSunk() {\n int sunkships = 0;\n int pos = 0; \n Ship ship;\n for(int i =0; i<5; i++) {\n ship = ships.get(i); \n if(ship.getSunk() == true) {\n sunkships++;\n pos = pos + ship.getLength(); \n }\n else{\n ship.setSunk(isSunk(ship.getLength(), pos));\n pos = pos + ship.getLength(); \n if(ship.getSunk() == true) {\n sunkships++;\n }\n }\n }\n shipsRemaining = 5 - sunkships; \n }",
"public int getShipsLeft() {\n\t\treturn shipsLeft;\n\t}",
"protected boolean hasShips() {\n return shipsCount > 0;\n }",
"public int getOccupiedSlots() {\r\n\t\tint count = 0;\r\n\t\tfor(ItemStack is : items) {\r\n\t\t\tif(is.getItemType() != Items.NOTHING)\r\n\t\t\t\tcount++;\r\n\t\t}\r\n\t\treturn count;\r\n\t}",
"int getNumberOfStonesLeftToPlace();",
"public int getNotReservedShoes(){\r\n\t\treturn this.numOfOrderedShoes-this.numOfReservedShoes;\r\n\t}",
"public int getNumSweeps()\n \t{\n \t\treturn an.getNumSweeps();\n \t}",
"@Override\r\n\tpublic int getPegCount() {\r\n\t\tint shipSize = 3;\r\n\t\treturn shipSize;\r\n\t}",
"public int removeDeadGuppies() {\n Iterator<Guppy> guppyIterator = guppiesInPool.iterator();\n int numOfRemovedGuppies = 0;\n while (guppyIterator.hasNext()) {\n Guppy guppy = guppyIterator.next();\n if (!(guppy.getIsAlive())) {\n guppyIterator.remove();\n numOfRemovedGuppies++;\n }\n }\n return numOfRemovedGuppies;\n }",
"public boolean isShipFullyDestroyed() {\n return this.goodShipParts.size() <= 0;\n }",
"public int shipSquaresLeft() {\n int numShipsLeft = 0;\n for (int i = 0; i < height; i++) {\n for (int j = 0; j < width; j++) {\n if (board[i][j] == BOARD_SHIP) {\n numShipsLeft++;\n }\n }\n }\n return numShipsLeft;\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Should return a list of champs that user plays that is greater than 6
|
public List<String> getM7() {
ChampionMasteries masteries = summoner.getChampionMasteries();
List<ChampionMastery> good = masteries.filter((ChampionMastery mastery) -> {
assert mastery != null;
return mastery.getLevel() == 7;
});
return good.stream().map((ChampionMastery mastery) -> mastery.getChampion().getName()).collect(Collectors.toList());
}
|
[
"private List<Card> chooseMulligan() {\n return this.b.getPlayer(this.b.getLocalteam()).getHand().stream()\n .filter(c -> c.finalStats.get(Stat.COST) > 3 && c.finalStats.get(Stat.SPELLBOOSTABLE) == 0)\n .collect(Collectors.toList());\n }",
"public ArrayList<Player> getPlayers() {\n\n int totalPlayers = 0;\n int maxPlayers = teamMaximum * teamSize;\n int minPlayer = teamMinimum * teamSize;\n ArrayList<Player> players = new ArrayList<Player>();\n //Runs while the amount of players being grabbed is less than the max and while there are players to be grabbed\n while(totalPlayers <= maxPlayers && !playerList.isEmpty())\n {\n //Gets and removes the next group in the queue\n PlayerGroup group = playerList.element();\n playerList.remove();\n\n //TODO: Add a check to see if the group that is about to be added will be too large for the game.\n //and if so, dont remove them but skip them somehow\n\n ArrayList<Player> groupMembers = group.getMembers();\n for(Player p : groupMembers)\n {\n players.add(p);\n }\n }\n return players;\n }",
"private List<Card> findLargestSuitInHand()\n\t{\n\t\tCollections.sort(this.hearts, cardComparator); Collections.sort(this.diamonds, cardComparator);\n\t\tCollections.sort(this.spades, cardComparator); Collections.sort(this.clubs, cardComparator);\n\t\tList<Card> ls = ((this.spades.size() > this.clubs.size()) ? this.spades : this.clubs);\n\t\tls = ((ls.size() > this.hearts.size()) ?\n\t\t\t\tls : this.hearts);\n\t\tls = ((ls.size() > this.diamonds.size()) ?\n\t\t\t\tls : this.diamonds);\n\t\treturn ls;\n\t}",
"private WarPlayer tryGetPlayerWithLessThanThreeCards() {\n for (WarPlayer player : players) {\n if (player.getHand().size() < 3)\n return player;\n }\n return null;\n\n }",
"java.util.List<java.lang.Integer> getReleasePlayersList();",
"static int flushCheck() {\n\t\tLinkedList<Cards> flushCheck = new LinkedList<>();\n\t\tfor (Cards.suits p : Cards.suits.values()) {\n\t\t\tflushCheck = new LinkedList<>();\n\t\t\tIterator<Cards> it = totalHand.iterator();\n\t\t\twhile (it.hasNext()) {\n\t\t\t\tObject n = it.next();\n\t\t\t\tif (((Cards) n).getSuit().equals(String.valueOf(p))) {\n\t\t\t\t\tflushCheck.add((Cards) n);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (flushCheck.size() >= 5) {\n\t\t\t\treturn HandCombination.FLUSH.getPoints();\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}",
"public List<Player> getWinnersByPoints() {\r\n\t\tMap<Integer, List<Player>> pointsToPlayers =\r\n\t\t\t\tplayers.values().stream().collect(Collectors.groupingBy(p -> getPlayerPoints(p)));\r\n\t\tint maxPoints = pointsToPlayers.keySet().stream().max(Integer::compare).get();\r\n\t\tif (pointsToPlayers.get(maxPoints).size() == 1) {\r\n\t\t\tSystem.out.println(\"The game has a winner with \" + maxPoints + \" points.\");\r\n\t\t\treturn pointsToPlayers.get(maxPoints);\r\n\t\t}\r\n\t\t\t\r\n\t\t// Tie break: Check the highest-value building card owned\r\n\t\tMap<Integer, List<Player>> highestBuildingsToPlayers =\r\n\t\t\t\tplayers.values().stream().collect(Collectors.groupingBy(p -> p.getMoney()));\r\n\t\tint highestBuildingValue = highestBuildingsToPlayers.keySet().stream().max(Integer::compare).get();\r\n\t\tif (highestBuildingsToPlayers.get(highestBuildingValue).size() == 1) {\r\n\t\t\tSystem.out.println(\"The game has one winner with a building of value $\" + highestBuildingValue + \".\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"There are multiple winners to the game (same $, highest building value).\");\r\n\t\t}\r\n\r\n\t\treturn highestBuildingsToPlayers.get(highestBuildingValue);\r\n\t}",
"public List<Song> getTopPlayedSongs(int number) ;",
"public void teachersThatHaveStudentsWithLessThanACertainNumberOfPencils(int numOfPencils ){\n //FIXME\n for (String teacherName : teachers.keySet())\n {\n Teacher teacher = teachers.get(teacherName);\n for(String student : teacher.getStudents().keySet())\n {\n Student myS1 = teachers.get(teacherName).getStudents().get(student);\n\n if(myS1.getNumOfPencilsInPocket() < 3)\n {\n System.out.println(teacherName);\n }\n }\n }\n }",
"public void listCriticQuantities() {\n Iterator<Pair<Bottle, Integer>> iterList = this.beerList.iterator();\n while (iterList.hasNext()) {\n Pair<Bottle, Integer> pair = iterList.next();\n Bottle bottle = pair.getKey();\n Integer quantity = pair.getValue();\n \n if (quantity <= 10) {\n System.out.println(String.format(\"qte:%d, %s\", quantity, bottle));\n }\n }\n }",
"public static void gamePlayedCredit(Team a){\n\tPlayer p1 = a.getRoster()[0];\n\tPlayer p2 = a.getRoster()[1];\n\tPlayer p3 = a.getRoster()[2];\n\tPlayer p4 = a.getRoster()[3];\n\tPlayer p5 = a.getRoster()[4];\n\t\n\tp1.addGamePlayed();\n\tp2.addGamePlayed();\n\tp3.addGamePlayed();\n\tp4.addGamePlayed();\n\tp5.addGamePlayed();\n\t\n}",
"public synchronized List<String> getWinners() {\n\t\tint highest = Integer.MIN_VALUE;\n\t\tList<String> winners = new ArrayList<String>();\n\t\t// get highest number of points\n\t\tfor(Player player : playerData) {\n\t\t\tif(player.getScore() > highest)\n\t\t\t\thighest = player.getScore();\n\t\t}\n\t\t// check for players with the same high score\n\t\tfor(Player player : playerData) {\n\t\t\tif(player.getScore() == highest)\n\t\t\t\twinners.add(player.getName());\n\t\t}\n\t\treturn winners;\n\t}",
"public boolean usedAllFeatures(){\n open();\n\n Cursor c = myDatabase.rawQuery(\" Select count(*) from user_achievements where \" +\n \"achievement_id = 1 or achievement_id = 2 or achievement_id = 6 or \" +\n \"achievement_id = 7 or achievement_id = 8 or achievement_id = 14 or \" +\n \"achievement_id = 20\", null);\n\n c.moveToFirst();\n int count = c.getInt(0);\n\n c.close();\n close();\n\n // If the count is 7, all features have been used and achievements for them given\n if(count == 7) {\n return true;\n }\n else {\n return false;\n }\n }",
"public RoomSet filterCredits(int value)\n {\n RoomSet result = new RoomSet();\n \n for (Room obj : this)\n {\n if (value == obj.getCredits())\n {\n result.add(obj);\n }\n }\n \n return result;\n }",
"int getReleasePlayersCount();",
"public ArrayList<BoardGame> filterByTime(ArrayList<BoardGame> list) {\n int time = extractInt(playTime);\n ArrayList<BoardGame> tempList = new ArrayList<>();\n for (BoardGame game: list) {\n //Debug print out\n Log.i(\"FILTER TIME\", \"Game: \" + game.getName() + \" Min Time: \" + game.getMinPlayTime() +\n \" Max Time: \" + game.getMaxPlayTime() + \" Target Time: \" + time);\n if((game.getMinPlayTime() <= time && game.getMaxPlayTime() >= time) || game.getMaxPlayTime() <= time) {\n addGameToList(tempList, game);\n }\n }\n return tempList;\n }",
"public static void runExercise3() {\n students.stream().filter(student -> student.getAge() > 22).limit(5).forEach(y -> System.out.println(y.getName() + \" \" + y.getAge()));\n }",
"int getAllowedLevelsAbovePlayer();",
"public List<UserEntity> getHackathonWinners(int hackathon_id) {\n\t\t\t\n\t\t\tjavax.persistence.Query query = manager.createQuery(\"SELECT c FROM HackathonRegistrationEntity a, TeamMemberEntity b, UserEntity c\"\n\t\t\t\t\t+ \" WHERE a.hackathon_id = :hackathon_id AND a.id = b.team_id AND c.id = b.member_id ORDER BY a.score DESC\");\t\t\n\t\t\t\n\t\t\tquery.setParameter(\"hackathon_id\", hackathon_id);\n\t\t\tquery.setMaxResults(3);\n\t\t\tList<UserEntity> teamMembers = query.getResultList();\n\t\t\treturn teamMembers;\n\t\t\t\n\t\t\t//return null;\n\t\t}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Stops the timer used for the periodic display function
|
private static void stopDisplayTimer() {
displayTimer.stop();
}
|
[
"public void stop() {timer.stop();}",
"void stop() {\n timer.stop();\n }",
"public void stop(){\n\t\ttimer.stop();\n\t}",
"public void stopTime()\n {\n timeAction.stopAction();\n realtime = false;\n currentTimeField.setTextBackground(Color.BLACK);\n currentTimeField.setTextForeground(Color.GREEN);\n model.viewObjectChanged(this, this);\n }",
"void stopUpdateTimer();",
"public void stopTimer() {\r\n int now = getCurrentTimestamp();\r\n stopTimer(now);\r\n }",
"private void stopTimer(){\n miniPollTimer.cancel();\n }",
"TimeInstrument stop();",
"public void\nstopTimer() {\n\t\n\tSystemDesign.logInfo(\"MetroParams.stopTimer: Killing annealing timer.\");\n\t\n\tif (metroTimer_ != null) {\n metroTimer_.stopPlease();\n\t metroTimer_ = null;\n }\n\tmetroThread_ = null;\n}",
"public void stop()\n {\n stopwatch.stop();\n }",
"public void stop() {\r\n\t\tif (isOn == true) {\r\n\t\t\tSystem.out.println(\"Oven timer stopped\");\r\n\t\t\ttimer.stop();\r\n\t\t\tisOn = false;\r\n\t\t}\r\n\t}",
"public void stop(){\n // check for timer that isn't running\n if(!isRunning){\n return;\n }\n \n isRunning = false;\n long endTime = System.currentTimeMillis();\n elapsedTime += endTime - startTime; \n }",
"public static void stopClock()\n {\n\trunning = false;\n }",
"private void stopTimer() {\n\t\tthis.running = false;\n\t\tif(this.tickRateThread != null) {\n\t\t\ttry {\n\t\t\t\tthis.tickRateThread.join();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\tSystem.out.println(\"Failed stopping tickrate thread: \" + e);\n\t\t\t}\n\t\t}\n\t}",
"public void stop() {\n if (lastStart == -1) throw new IllegalStateException(\"Timer is not running!\");\n long time = System.nanoTime() - lastStart;\n lastStart = -1;\n timings.put(System.currentTimeMillis(), time);\n if (timings.size() > 100) {\n try {\n logTimings();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }",
"public synchronized void stop(){\n\t\tif (tickHandle != null){\n\t\t\ttickHandle.cancel(false);\n\t\t\ttickHandle = null;\n\t\t}\n\t}",
"private void stopCpuTimer() {\n cpuTimer.stop();\n }",
"private void stopTimer()\n {\n m_stopTime = System.currentTimeMillis();\n m_recordingCompleteTime = (m_stopTime - m_startTime)/1000;\n }",
"public void cancelTimer(){\n ViajandoController.timerTask.cancel();\n ViajandoController.timer.cancel();\n segundos=0;\n minutos=0;\n horas=0;\n cronometro.setText(\"00:00:00\");\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
calculates g^x mod n
|
int CalcKey(int g, int x, int n)
{
int rtn = 1;
for(int i = 0; i < x; i++)
rtn = (rtn * g) % n;
return rtn;
}
|
[
"private static int modExp(int a, int b, int n) {\n\n // get a char array of the bits in b\n char[] k = (Integer.toBinaryString(b)).toCharArray();\n\n // initialize variables\n int c = 0, f = 1;\n // loop over every bit in k\n for (int i = 0; i < k.length; i ++) {\n\n // for every bit, i.e. if 0 or 1, do this\n c *= 2;\n f = (f * f) % n;\n\n // If current bit is equal to 1, then do this\n if (k[i] == '1') {\n c += 1;\n f = (f * a) % n;\n }\n }\n\n // returns the remainder\n return f;\n }",
"public static long mod_exp(long base, long exp, long mod){\n long result = base%mod;\n for (long i=1;i<exp;i++){\n result = (result*base)%mod;\n }\n return result;\n }",
"private static BigInteger encrypt(BigInteger x, BigInteger e, BigInteger n) {\r\n\t\treturn x.modPow(e, n);\r\n\t}",
"public static int nCrModp(int n, int r)\n {\n // your code here\n \n if(r>n) {\n return 0;\n }\n \n if(r==0||n==r){\n return 1;\n }\n \n int dp[][] = new int[n+1][r+1];\n for(int arr[] : dp){\n Arrays.fill(arr,-1);\n }\n \n for(int j=0;j<=r;j++){\n dp[0][j]=0;\n }\n \n for(int i=1;i<=n;i++){\n dp[i][0]=1;\n }\n \n int mod = 1000000007;\n \n return cUtil(n,r,dp,mod);\n \n }",
"@Test\n public void test_modpow_0060() {\n long b = 71;\n long e = 10;\n long m = 23;\n\n long be = b;\n for (long i = 1; i < e; ++i) {\n be *= b;\n }\n\n long expected = be % m;\n long result = FunctionOps.modpow(b, e, m);\n assertEquals(expected, result);\n }",
"public int findModulusEffective(int n, int m){ // m >1\n int F_first = 0;\n int F_second = 1;\n int result = 0;\n for (int i = 2; i <= n; i++) {\n result = (F_first + F_second ) % m;\n F_first = F_second;\n F_second = result;\n\n }\n return result;\n }",
"private static long fibMod(long n, long m) {\n return fib(n % pisano(m), m) % m;\n }",
"public static int PowLog(int n, int x){\n if(x == 0){return 1;}\n int ans = n * PowLog(n,x/2);\n if( x % 2 == 1 ){\n ans = ans * n; \n }\n return ans;\n }",
"public static int mod(int a, int b, int n) {\n a %= n;\n int ans = 1;\n while (b > 0) {\n if ((b & 1) == 1) {\n ans = ans * a % n;\n }\n\n a = a * a % n;\n b >>= 1;\n }\n\n return ans;\n }",
"private static long modPow(long a, long b, long c) {\n long res = 1;\n for (int i = 0; i < b; i++)\n {\n res *= a;\n res %= c;\n }\n return res % c;\n }",
"public static int odwrotnoscModulo(int a, int n) {\r\n int a0, n0, p0, p1, q, r, t;\r\n\r\n p0 = 0;\r\n p1 = 1;\r\n a0 = a;\r\n n0 = n;\r\n q = n0 / a0;\r\n r = n0 % a0;\r\n while (r > 0) {\r\n t = p0 - q * p1;\r\n if (t >= 0) {\r\n t = t % n;\r\n } else {\r\n t = n - ((-t) % n);\r\n }\r\n p0 = p1;\r\n p1 = t;\r\n n0 = a0;\r\n a0 = r;\r\n q = n0 / a0;\r\n r = n0 % a0;\r\n }\r\n return p1;\r\n }",
"public int pow (int x, int n) {\n\tif (n == 0)\n\t\treturn 1;\n\tif (n == 1)\n\t\treturn x;\n\tint t = pow (x, n/2);\n\tt *= t;\n\tif (n % 2 == 1)\n\t\tt *= x;\n\treturn t;\n}",
"public static BigInteger ModulaExponentiation(BigInteger a, BigInteger b, BigInteger n) {\r\n\t\tBigInteger d = one;\r\n\t\tString bin = b.toString(2); // int to binary\r\n\r\n\t\tfor (int i = 0; i < bin.length(); i++) {\r\n\t\t\td = d.pow(2).mod(n); // d^2 mod n\r\n\r\n\t\t\tif (bin.charAt(i) == '1') // binary value = 1\r\n\t\t\t\td = d.multiply(a).mod(n); // d*a mod n\r\n\t\t}\r\n\r\n\t\treturn d;\r\n\t}",
"private int encode(int m, int e, int n)\n {\n return modpow(m, e, n);\n }",
"long perm(int n, int m, long mod) {\n long result = 1;\n for (int i = n - m + 1; i <= n; ++i) {\n result = result * i % mod;\n }\n return result;\n }",
"private static int fastExponentiation(long a, int b, long n){\n\t\tlong c = 1;\n\t\t\n\t\t// get binary rep of b\n\t\tArrayList<Boolean> binaryB = new ArrayList<Boolean>();\n\t\t\n\t\t// fill binaryB\n\t\tfor(int mask = 0x1; mask <= Integer.highestOneBit(b); mask <<= 1){\n\t\t\tbinaryB.add((mask & b) != 0);\n\t\t}\n\t\t\t\t\t\t\n\t\tfor(int i = binaryB.size() - 1; i >= 0; i--){\n\t\t\tif(binaryB.get(i).booleanValue() == false)\n\t\t\t\tc = (c*c)%n;\n\t\t\telse\n\t\t\t\tc = (((c*c)%n)*a)%n;\n\t\t}\n\t\t// c = a^b mod n\n\t\treturn (int)c;\n\t}",
"int modPowSimple(int num, int e, int m) {\n\t\tint count = 0;\n\t\tDebug.assume(e > 0 && e < 32);\n\t\tint result = 1;\n\t\tfor (int i = 0; i < e; i++) {\n\t\t\tresult = result * num;\n\t\t\tcount++;\n\t\t}\n\t\tresult = result % m;\n\t\tSystem.out.println(\"Cost is: \" + count);\n\t\t// System.out.println(Debug.getPC_prefix_notation());\n\t\treturn result;\n\t}",
"private double power(double x, int n) {\n calls += 1;\n if (n == 0) {return 1;}\n else {\n double smallerPower = power(x, n -1);\n return x * smallerPower;\n }\n }",
"@Test\n public void test_modpow_0050() {\n long b = 71;\n long e = 9;\n long m = 23;\n\n long be = b;\n for (long i = 1; i < e; ++i) {\n be *= b;\n }\n\n long expected = be % m;\n long result = FunctionOps.modpow(b, e, m);\n assertEquals(expected, result);\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
optional .ChatWithServer.Req chat_with_server_req = 3;
|
ChatWithServer.Req getChatWithServerReq();
|
[
"ChatRecord.Req getChatRecordReq();",
"private void setChatWithServerReq(ChatWithServer.Req value) {\n if (value == null) {\n throw new NullPointerException();\n }\n req_ = value;\n reqCase_ = 3;\n }",
"public ChatWithServer.Req getChatWithServerReq() {\n if (reqCase_ == 3) {\n return (ChatWithServer.Req) req_;\n }\n return ChatWithServer.Req.getDefaultInstance();\n }",
"pb4server.WorldChatAskReq getWorldChatAskReq();",
"io.yuri.yuriserver.packet.Protos.ChatOrBuilder getChatOrBuilder();",
"proto.Chat.ServerRequest.ResponseType getType();",
"com.whiuk.philip.mmorpg.shared.Messages.ServerMessage.ChatDataOrBuilder getChatDataOrBuilder();",
"io.yuri.yuriserver.packet.Protos.Chat getChat();",
"messages.Serverhello.ServerHello getServerHello();",
"SSIT.proto.Unetmgr.LobbyChatMessage getMessage();",
"com.whiuk.philip.mmorpg.shared.Messages.ServerMessage.ChatData getChatData();",
"proto.Chat.ClientRequest.RequestType getType();",
"messages.Clienthello.ClientHello getClientHello();",
"com.whiuk.philip.mmorpg.shared.Messages.ClientMessage.ChatDataOrBuilder getChatDataOrBuilder();",
"Gogirl.GoGirlChatDataPOrBuilder getChatdataOrBuilder();",
"pb4server.SendNoticeToLeaderAskReq getSendNoticeToLeaderAskReq();",
"private SendChatReq(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }",
"public void receiveChatRequest() {\n\t\t\r\n\t\tString message = \"Chat request details\";\r\n\t\t\r\n\t\t//Notify the chat request details to the GUI\r\n\t\tthis.observable.notifyObservers(message);\r\n\t}",
"void receivedUpdate(Chat chat);"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Access the entire set of values stored in the Structured Artifact
|
public Map getValues()
{
return m_structuredArtifact;
}
|
[
"public Object getValue(String name)\n\t\t{\n\t\t\tString[] names = name.split(ResourcesMetadata.DOT);\n\t\t\tObject rv = m_structuredArtifact;\n\t\t\tif(rv != null && (rv instanceof Map) && ((Map) rv).isEmpty())\n\t\t\t{\n\t\t\t\trv = null;\n\t\t\t}\n\t\t\tfor(int i = 1; rv != null && i < names.length; i++)\n\t\t\t{\n\t\t\t\tif(rv instanceof Map)\n\t\t\t\t{\n\t\t\t\t\trv = ((Map) rv).get(names[i]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\trv = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn rv;\n\n\t\t}",
"public StructuredData getStructuredDataAttribute();",
"@DISPID(164)\n @PropGet\n java.lang.Object getValues();",
"public ArtifactSet getArtifacts() {\n return artifacts;\n }",
"org.hl7.fhir.ValueSet getValueSet();",
"edu.stanford.slac.archiverappliance.PB.EPICSEvent.FieldValue getFieldvalues(int index);",
"Object getContainedValue();",
"public List getList(String name)\n\t\t{\n\t\t\tif(m_structuredArtifact == null)\n\t\t\t{\n\t\t\t\tm_structuredArtifact = new Hashtable();\n\t\t\t}\n\t\t\tObject value = m_structuredArtifact.get(name);\n\t\t\tList rv = new Vector();\n\t\t\tif(value == null)\n\t\t\t{\n\t\t\t\tm_structuredArtifact.put(name, rv);\n\t\t\t}\n\t\t\telse if(value instanceof Collection)\n\t\t\t{\n\t\t\t\trv.addAll((Collection)value);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\trv.add(value);\n\t\t\t}\n\t\t\treturn rv;\n\n\t\t}",
"public List<Value> getValues() {\n\t\tfinal List<Value> vl = new ArrayList<Value>();\n\t\tfor (final ANY a : getMdht().getValues()) {\n\t\t\tfinal Value v = new Value(a);\n\t\t\tvl.add(v);\n\t\t}\n\t\treturn vl;\n\t}",
"public List<CatalogInner> value() {\n return this.value;\n }",
"RDFProperty getOWLValuesFromProperty();",
"Collection<UMLTaggedValue> getTaggedValues();",
"com.google.protobuf.Struct getValues();",
"DataArtifact getDataArtifact() {\n return artifact;\n }",
"public String getXValues();",
"ItemOuterClass.Item.Attribute.Values getValues(int index);",
"pb.lyft.datacatalog.Datacatalog.Artifact getArtifact();",
"void printPlaceArtifacts()\r\n\t{\r\n\t\tfor( Map.Entry <String, Artifact> entry : artPlace.entrySet()) \r\n\t\t{\r\n\t\t\t String key = entry.getKey();\r\n\t\t\t Artifact value = entry.getValue();\r\n\t\t\t \r\n\t\t\t // System.out.println(\"Place Name: \" + this.name());\r\n\t\t\t \r\n\t\t\t System.out.println(\" Artifact Name----->\" + value.getName());\r\n\t\t\t System.out.println(\"Size-----> \" + value.getSize());\r\n\t\t\t System.out.println(\"Value-----> \" + value.getValue() + \" \\n\");\t\r\n\t\t}\r\n\t}",
"public ListVS<V> getValues() {\n ListVS<V> result = new ListVS<V>(getUniverse());\n for (V value : this.entries.values()) {\n result = result.add(value);\n }\n return result;\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Crear nuevo CuestionarioCovid19 en la base de datos
|
public void crearCuestionarioCovid19(CuestionarioCovid19 partcaso) throws Exception {
ContentValues cv = CuestionarioCovid19Helper.crearCuestionarioCovid19ContentValues(partcaso);
mDb.insertOrThrow(Covid19DBConstants.COVID_CUESTIONARIO_TABLE, null, cv);
}
|
[
"public void crearParticipanteCovid19(ParticipanteCovid19 partcaso) throws Exception {\n\t\tContentValues cv = ParticipanteCovid19Helper.crearParticipanteCovid19ContentValues(partcaso);\n\t\tmDb.insertOrThrow(Covid19DBConstants.PARTICIPANTE_COVID_TABLE, null, cv);\n\t}",
"public void crearDatosAislamientoVisitaCasoCovid19(DatosAislamientoVisitaCasoCovid19 DatosAislamientoVisitaCasoCovid19) throws Exception {\n\t\tContentValues cv = DatosAislamientoVisitaCasoCovid19Helper.crearDatosAislamientoVisitaCasoCovid19ContentValues(DatosAislamientoVisitaCasoCovid19);\n\t\tmDb.insertOrThrow(Covid19DBConstants.COVID_DATOS_AISLAMIENTO_VC_TABLE, null, cv);\n\t}",
"public void crearCasoCovid19(CasoCovid19 casacaso) throws Exception {\n\t\tContentValues cv = CasoCovid19Helper.crearCasoCovid19ContentValues(casacaso);\n\t\tmDb.insertOrThrow(Covid19DBConstants.COVID_CASOS_TABLE, null, cv);\n\t}",
"public org.oep.usermgt.model.Citizen create(long citizenId);",
"public void crearCandidatoTransmisionCovid19(CandidatoTransmisionCovid19 partcaso) throws Exception {\n\t\tContentValues cv = CandidatoTransmisionCovid19Helper.crearCandidatoTransmisionCovid19ContentValues(partcaso);\n\t\tmDb.insertOrThrow(Covid19DBConstants.COVID_CANDIDATO_TRANSMISION_TABLE, null, cv);\n\t}",
"public Convenio(int id){\n this.idConvenio=id;\n }",
"public void crearControladorInfoCriaturas(){\r\n this.contInfo = new ControladorInfoCriaturas (this);\r\n }",
"Vaisseau_estOrdonneeCouverte createVaisseau_estOrdonneeCouverte();",
"public CCuenta()\n {\n }",
"Vaisseau_estAbscisseCouverte createVaisseau_estAbscisseCouverte();",
"public void crearParticipanteCasoCovid19(ParticipanteCasoCovid19 partcaso) throws Exception {\n\t\tContentValues cv = ParticipanteCasoCovid19Helper.crearParticipanteCasoCovid19ContentValues(partcaso);\n\t\tmDb.insertOrThrow(Covid19DBConstants.COVID_PARTICIPANTES_CASOS_TABLE, null, cv);\n\t}",
"Compleja createCompleja();",
"Compuesta createCompuesta();",
"public void crearVisitaSeguimientoCasoCovid19(VisitaSeguimientoCasoCovid19 visitacaso) throws Exception {\n\t\tContentValues cv = VisitaSeguimientoCasoCovid19Helper.crearVisitaSeguimientoCasoCovid19ContentValues(visitacaso);\n\t\tmDb.insertOrThrow(Covid19DBConstants.COVID_VISITAS_CASOS_TABLE, null, cv);\n\t}",
"public void crearSintomasVisitaCasoCovid19(SintomasVisitaCasoCovid19 sintomasVisitaCasoCovid19) throws Exception {\n\t\tContentValues cv = SintomasVisitaCasoCovid19Helper.crearSintomasVisitaCasoCovid19ContentValues(sintomasVisitaCasoCovid19);\n\t\tmDb.insertOrThrow(Covid19DBConstants.COVID_SINTOMAS_VISITA_CASO_TABLE, null, cv);\n\t}",
"public CriticaEntity createCritica(CriticaEntity entity){\r\n LOGGER.log(Level.INFO, \"Inicia proceso de crear una CriticaEntity.\");\r\n return persistence.create(entity);\r\n }",
"public CuestionarioCovid19 getCuestionarioCovid19(String filtro, String orden) throws SQLException {\n\t\tCuestionarioCovid19 mCuestionarioCovid19 = null;\n\t\tCursor cursor = crearCursor(Covid19DBConstants.COVID_CUESTIONARIO_TABLE, filtro, null, orden);\n\t\tif (cursor != null && cursor.getCount() > 0) {\n\t\t\tcursor.moveToFirst();\n\t\t\tmCuestionarioCovid19=CuestionarioCovid19Helper.crearCuestionarioCovid19(cursor);\n\t\t\tParticipante participante = this.getParticipante(MainDBConstants.codigo + \"=\" +cursor.getInt(cursor.getColumnIndex(Covid19DBConstants.participante)), null);\n\t\t\tmCuestionarioCovid19.setParticipante(participante);\n\t\t}\n\t\tif (!cursor.isClosed()) cursor.close();\n\t\treturn mCuestionarioCovid19;\n\t}",
"public abstract Balise creerBalise(Contenu contenu);",
"public Candidatura (){\n \n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Gets the value of the iconID property.
|
public int getIconID() {
return iconID;
}
|
[
"public String getIconId(){\n\t\treturn iconId;\n\t}",
"public Integer getIconId() {\n return iconId;\n }",
"public int getIconId() {\n return iconId_;\n }",
"public int getIcon() {\n return Forecast.getIconId(icon);\n }",
"public void setIconID(int value) {\n this.iconID = value;\n }",
"int getIconId();",
"@Override\n\tpublic long getIconId() {\n\t\treturn _scienceApp.getIconId();\n\t}",
"public String getIcon() {\r\n\t\treturn icon;\r\n\t}",
"public String getIcon()\n\t\t{\n\t\t\treturn icon;\n\t\t}",
"public String getIcon() {\n return icon;\n }",
"public int getAppIconId() {\n loadLabelAndIcon();\n return mAppIconId;\n }",
"public int getMyIcon() {\n return myIcon;\n }",
"public int getIconIndex() {\n return iconIndex;\n }",
"public void setIconId(Integer iconId) {\n this.iconId = iconId;\n }",
"public int getCurrentIcon() {\n return currentIconCode;\n }",
"public int getIconImageNumber(){return iconImageNumber;}",
"public void setIconId(int iconId) {\r\n this.iconId = iconId;\r\n }",
"public char getIcon() {\r\n\t\treturn icon;\r\n\t}",
"public EntityIcon getIcon() {\r\n return icon;\r\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
This method updates keyword records to Keywords table.
|
@Transactional(propagation = Propagation.REQUIRED)
public void updateKeyword(Serpkeywords objKeyword) {
getHibernateTemplate().update(objKeyword);
}
|
[
"public void AddKeywords()\n\t{\n\t\ttry\n\t\t{\n\t\t\tConnector con = new Connector();\n\t\t\tString query; \n\t\t\t\n\t\t\tfor(int i = 0; i < keywords.size(); i++)\n\t\t\t{\n\t\t\t\tString keyword = keywords.get(i); \n\t\t\t\t\n\t\t\t\tint kid = GetKIDFromWord(keyword); \n\t\t\t\t\n\t\t\t\t//word is not already in table\n\t\t\t\tif(kid == -1)\n\t\t\t\t{\n\t\t\t\t\t//insert word into Keywords \n\t\t\t\t\tSystem.out.println(\"test\"); \n\t\t\t\t\tquery = \"INSERT INTO Keywords(word) VALUE ('\"+keyword+\"')\"; \n\t\t\t \tint intoTable = con.stmt.executeUpdate(query); \n\t\t\t \t\n\t\t\t \t//able to put it in the table\n\t\t\t \tif(intoTable > 0)\n\t\t\t \t{\n\t\t\t \t\t//insert into HasKeywords\n\t\t\t\t \tkid = GetKIDFromWord(keyword); \n\t\t\t\t\t\tquery = \"INSERT INTO HasKeywords(keyword_hid, keyword_kid) VALUE('\"+hid+\"', '\"+kid+\"')\";\n\t\t\t\t \tint hasKey = con.stmt.executeUpdate(query); \n\t\t\t \t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//word is already in table\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tList<Integer> hkCheck = GetHIDSFromKID(kid);\n\t\t\t\t\t\n\t\t\t\t\tboolean inHKTable = false; \n\t\t\t\t\tfor(int j = 0; j < hkCheck.size(); j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(hkCheck.get(j) == hid)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinHKTable = true; \n\t\t\t\t\t\t\tbreak; \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(inHKTable == false)\n\t\t\t\t\t{\n\t\t\t\t\t\tquery = \"INSERT INTO HasKeywords(keyword_hid, keyword_kid) VALUE('\"+hid+\"', '\"+kid+\"')\";\n\t\t\t\t \tint hasKey = con.stmt.executeUpdate(query); \n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tcon.closeConnection();\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t}",
"@Override\r\n\tpublic boolean update() {\r\n\t\tPreparedStatement ps = null;\r\n\t\ttry {\r\n\t\t\tif (!_data.has(ID)) {\r\n\t\t\t\tsetError(\"Keyword update field ID not found\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tlong keywordID = _data.getLong(ID);\r\n\t\t\tint status = _data.optInt( STATUS, 1);\r\n\t\t\tString description =_data.optString( DESCRIPTION, \"\");\r\n\r\n\t\t\tps = _dbi.getPreparedStatement(_sqlUpdate);\r\n\t\t\tint indx = 1;\r\n\t\t\tps.setInt(indx++, status);\r\n\t\t\tps.setString(indx++, description);\r\n\t\t\tps.setLong(indx, keywordID);\r\n\t\t\tps.execute();\r\n\t\t\treturn true;\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\tsetError(e);\r\n\t\t\treturn false;\r\n\t\t} finally {\r\n\t\t\tif (ps != null) {\r\n\t\t\t\ttry { ps.close();} catch (Exception dbe){}\r\n\t\t\t}\t\t}\r\n\t}",
"private void updateKeywordsList() {\n this.keywordList = demonstrationApplicationController.getKeywordsList();\n this.jListKeyword.setModel(new ModelListSelectable(this.keywordList));\n }",
"public void createOrUpdate(Keyword keyword) {\n\t\tgetHibernateTemplate().saveOrUpdate(keyword);\n\t}",
"com.callfire.api.data.KeywordDocument.Keyword addNewKeyword();",
"com.callfire.api.data.KeywordDocument.Keyword insertNewKeyword(int i);",
"void setKeywordArray(int i, com.callfire.api.data.KeywordDocument.Keyword keyword);",
"com.callfire.api.service.xsd.KeywordQueryResultDocument.KeywordQueryResult addNewKeywordQueryResult();",
"public void writeUrlKeywords (ArrayList<KeywordRecord> recordSet) throws SQLException {\n String sql = \"INSERT INTO tblKeywords (url, keyword, count, updated) VALUES (?, ?, ?, ?)\";\n PreparedStatement ps = con.prepareStatement(sql);\n\n for (KeywordRecord record : recordSet) {\n ps.setString(1, record.getUrl());\n ps.setString(2, record.getKeyword());\n ps.setInt(3, record.getCount());\n ps.setTimestamp(4, record.getUpdated());\n ps.addBatch();\n }\n ps.executeBatch();\n con.commit();\n }",
"private void insertKeyword(String keyword, String adId) {\n\n // If the target keyword is not in the DB, then insert the keyword\n UpdateOptions option = new UpdateOptions();\n option.upsert(true);\n keywordCollection.updateOne(new BasicDBObject(\"keyword\", keyword),\n new BasicDBObject(\"$push\", new BasicDBObject(\"adId\", adId)), option);\n }",
"public void addKeyword(Keyword keyword);",
"private static void saveSkillKeysInDB(String skillKeywords, int listing_id) throws SQLException {\n\t\tDB db = new DB();\n\t\tfor (String skillWord : skillKeywords.split(\",\")) {\n\t\t\t// check if skill exists\n\t\t\tskillWord = skillWord.toLowerCase().trim();\n\t\t\tString checkSkillSQL = \"SELECT id, title FROM public.skills where title = '\" + skillWord + \"';\";\n\t\t\tResultSet rs1 = db.runSql(checkSkillSQL);\n\t\t\tif (rs1.next()) {\n\t\t\t\tint skill_id = rs1.getInt(1);\n\t\t\t\tString skillMappingInsert = \"INSERT INTO public.skills_listing (skill_id, listing_id) VALUES(\"\n\t\t\t\t\t\t+ skill_id + \", \" + listing_id + \");\";\n\t\t\t\tdb.runSql2(skillMappingInsert);\n\t\t\t\tSystem.out.println(skillWord + \" ALREADY PRESENT\");\n\t\t\t} else {\n\t\t\t\tString skillInsertSQL = \"INSERT INTO public.skills (title) VALUES('\" + skillWord + \"');\";\n\t\t\t\tPreparedStatement stmt = db.conn.prepareStatement(skillInsertSQL, Statement.RETURN_GENERATED_KEYS);\n\t\t\t\tint affectedRows = stmt.executeUpdate();\n\t\t\t\tif (affectedRows > 0) {\n\t\t\t\t\tResultSet generatedKeys = stmt.getGeneratedKeys();\n\t\t\t\t\tif (generatedKeys.next()) {\n\t\t\t\t\t\tint skill_id = generatedKeys.getInt(1);\n\t\t\t\t\t\tString skillMappingInsertSQL = \"INSERT INTO public.skills_listing (skill_id, listing_id) VALUES(\"\n\t\t\t\t\t\t\t\t+ skill_id + \", \" + listing_id + \");\";\n\t\t\t\t\t\tdb.runSql2(skillMappingInsertSQL);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tSystem.err.println(\"Insertion into skill table failed, so skipping mapping entry too!\");\n\t\t\t\t}\n\t\t\t\tstmt.close();\n\t\t\t}\n\t\t}\n\t}",
"void setKeywordArray(com.callfire.api.data.KeywordDocument.Keyword[] keywordArray);",
"void updateWord(){\n word= s.nextLine();\n meaning=s.nextLine();\n meaning=\": \"+meaning;\n if(hm.containsKey(word)){\n hm.replace(word.trim(),meaning);\n writeChanges(); // fucntion to make the desired changes into the file\n System.out.println(\"The meaning of the word \"+word+\" is\"+meaning);\n }\n else \n System.out.println(\"The word \"+word+\" is not present in the dictionary hence can't be updated\");\n }",
"private void updateKeywords()\n {\n String[] enteredKeywords = getKeywordsFromBar();\n if(enteredKeywords == null)\n JOptionPane.showMessageDialog(null, \"Please enter some keywords to search for\");\n else\n spider.initKeywords(enteredKeywords);\n }",
"void setKeywordSearch();",
"@Override\n\tpublic void setKeywords(String keywords) {\n\t\tmodel.setKeywords(keywords);\n\t}",
"private void updateLastSearch_Keyword() {\n lastSearchQueue.offer(keyword);\n if (lastSearchQueue.size() == 3)\n lastSearchQueue.poll();\n return;\n }",
"private void saveKeyword(PSKeyword keyword, Integer version)\n {\n IPSContentService service = \n PSContentServiceLocator.getContentService();\n\n try\n {\n IPSGuid id = keyword.getGUID();\n \n // Load the existing keyword and copy data into it\n PSKeyword dbkeyword = service.loadKeyword(id, null);\n\n // Copy data object into \"live\" object\n dbkeyword.copy(keyword);\n \n keyword = dbkeyword;\n }\n catch (PSContentException e)\n {\n // No problem, new instance\n }\n \n // Restore version\n keyword.setVersion(null);\n keyword.setVersion(version);\n\n service.saveKeyword(keyword);\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Original signature : int ftrScanGetScanParameters(void, unsigned long, void) native declaration : line 460
|
int ftrScanGetScanParameters(Pointer ftrHandle, NativeLong dwParamCode, Pointer pOutBuffer);
|
[
"int ftrScanGetDeviceInfo(Pointer ftrHandle, FTRSCAN_DEVICE_INFO pDeviceInfo);",
"int ftrScanGetFrame(Pointer ftrHandle, Pointer pBuffer, FTRSCAN_FRAME_PARAMETERS pFrameParameters);",
"Pointer ftrScanOpenDevice();",
"int ftrScanGetOptions(Pointer ftrHandle, NativeLongByReference lpdwFlags);",
"int ftrScanGetSerialNumber(Pointer ftrHandle, Pointer pBuffer);",
"int ftrScanControlPin3(Pointer ftrHandle, NativeLongByReference pdwParam1, NativeLong dwParam2, NativeLong dwPeriod);",
"int ftrScanGetLFDParameters(FTRSCAN_LFD_CONSTANTS pLFDParameters);",
"Pointer ftrScanOpenDeviceOnInterface(int nInterface);",
"int ftrScanRollGetFrameParameters(Pointer ftrHandle, FTRSCAN_ROLL_FRAME_PARAMETERS pFrameParameters, Pointer pBuffer, NativeLong dwMilliseconds);",
"int ftrScanGetVersion(Pointer ftrHandle, FTRSCAN_VERSION_INFO pVersionInfo);",
"int ftrScanGetRegistryValues(Pointer ftrHandle, Pointer pBuffer);",
"int ftrScanSaveFirmwareMemory(Pointer ftrHandle, Pointer pBuffer, int nOffset, int nCount);",
"int ftrScanGetBacklightImage(Pointer ftrHandle, Pointer pBuffer);",
"int ftrScanGetButtonState(Pointer ftrHandle, NativeLongByReference pdwParam1);",
"int ftrScanGlobalGetOptions(NativeLong dwOption, Pointer pOptionData);",
"int ftrScanGet4in1Image(Pointer ftrHandle, Pointer pBuffer);",
"int ftrScanRestoreFirmwareMemory(Pointer ftrHandle, Pointer pBuffer, int nOffset, int nCount);",
"int ftrScanSave7Bytes(Pointer ftrHandle, Pointer pBuffer);",
"int ftrScanMainLEDsTimeout(Pointer ftrHandle, NativeLongByReference pwdParam1, byte byFlag);"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
generateExplicitAttributeMethodDeclarations: 1 attribute:BasisCurve, base type: entity IfcCurve
|
public boolean testBasiscurve(EIfctrimmedcurve type) throws SdaiException;
|
[
"protected void addBasisCurvePropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add\n\t\t\t(createItemPropertyDescriptor\n\t\t\t\t(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\n\t\t\t\t getResourceLocator(),\n\t\t\t\t getString(\"_UI_IfcOffsetCurve2D_BasisCurve_feature\"),\n\t\t\t\t getString(\"_UI_PropertyDescriptor_description\", \"_UI_IfcOffsetCurve2D_BasisCurve_feature\", \"_UI_IfcOffsetCurve2D_type\"),\n\t\t\t\t Ifc2x3tc1Package.eINSTANCE.getIfcOffsetCurve2D_BasisCurve(),\n\t\t\t\t true,\n\t\t\t\t false,\n\t\t\t\t true,\n\t\t\t\t null,\n\t\t\t\t null,\n\t\t\t\t null));\n\t}",
"curve createcurve();",
"public String getCurveName() {\n return _curveName;\n }",
"godot.wire.Wire.BasisOrBuilder getBasisOrBuilder();",
"IBezierCurve createBezierCurve(IPoint point, IPoint point2);",
"public List<ContractedGaussian> getBasisFunctions() {\n\t\treturn this.basisFunctions;\n\t}",
"public ECF2mGroupParams getCurve(){\r\n\t\treturn curve;\r\n\t}",
"public Cuadratica(){\r\n this.figura = new QuadCurve2D.Float();\r\n }",
"private CubicCurve createStartingCurve() {\n curve.setStartX(50);\n curve.setStartY(200);\n curve.setControlX1(150);\n curve.setControlY1(300);\n curve.setControlX2(250);\n curve.setControlY2(50);\n curve.setEndX(350);\n curve.setEndY(150);\n curve.setStroke(Color.FORESTGREEN);\n curve.setStrokeWidth(4);\n curve.setStrokeLineCap(StrokeLineCap.ROUND);\n // curve.setFill(Color.CORNSILK.deriveColor(0, 1.2, 1, 0.6));\n return curve;\n }",
"public net.opengis.www.gml._3_2.AbstractCurveType getAbstractCurve()\n {\n synchronized (monitor())\n {\n check_orphaned();\n net.opengis.www.gml._3_2.AbstractCurveType target = null;\n target = (net.opengis.www.gml._3_2.AbstractCurveType)get_store().find_element_user(ABSTRACTCURVE$1, 0);\n if (target == null)\n {\n return null;\n }\n return target;\n }\n }",
"godot.wire.Wire.Basis getBasis();",
"public net.opengis.www.gml._3_2.AbstractCurveType addNewAbstractCurve()\n {\n synchronized (monitor())\n {\n check_orphaned();\n net.opengis.www.gml._3_2.AbstractCurveType target = null;\n target = (net.opengis.www.gml._3_2.AbstractCurveType)get_store().add_element_user(ABSTRACTCURVE$0);\n return target;\n }\n }",
"IfcCompositeCurve getSpineCurve();",
"godot.wire.Wire.Basis getBasisValue();",
"RegressionCurveType createRegressionCurveType();",
"public int NbCurves() {\n return OCCwrapJavaJNI.ShapeExtend_ComplexCurve_NbCurves(swigCPtr, this);\n }",
"public Curve(CurveType type)\n\t{\n\t\tthis.type = type;\n\t}",
"public interface ISDACompliantCreditCurveBuilder {\n\n /**\n * Bootstrapper the credit curve, by making each market CDS in turn have zero clean price \n * @param cds The market CDSs - these are the reference instruments used to build the credit curve \n * @param marketFracSpreads The <b>fractional</b> spreads of the market CDSs \n * @param yieldCurve The yield (or discount) curve \n * @return The credit curve \n */\n ISDACompliantCreditCurve calibrateCreditCurve(final CDSAnalytic[] cds, final double[] fractionalSpreads, final ISDACompliantYieldCurve yieldCurve);\n\n /**\n * Bootstrapper the credit curve, by making each market CDS in turn have zero clean price \n * @param today The 'current' date\n * @param stepinDate Date when party assumes ownership. This is normally today + 1 (T+1). Aka assignment date or effective date.\n * @param valueDate The valuation date. The date that values are PVed to. Is is normally today + 3 business days. Aka cash-settle date.\n * @param startDate The protection start date. If protectStart = true, then protections starts at the beginning of the day, otherwise it\n * is at the end.\n * @param endDates The maturities (or end of protection) of each of the CDSs - must be ascending \n * @param fractionalParSpreads - the (fractional) coupon that makes each CDS worth par (i.e. zero clean price)\n * @param payAccOnDefault Is the accrued premium paid in the event of a default\n * @param tenor The nominal step between premium payments (e.g. 3 months, 6 months).\n * @param stubType stubType Options are FRONTSHORT, FRONTLONG, BACKSHORT, BACKLONG or NONE\n * - <b>Note</b> in this code NONE is not allowed\n * @param protectStart Does protection start at the beginning of the day\n * @param yieldCurve Curve from which payments are discounted\n * @param recoveryRate the recovery rate \n * @return The credit curve\n */\n ISDACompliantCreditCurve calibrateCreditCurve(final LocalDate today, final LocalDate stepinDate, final LocalDate valueDate, final LocalDate startDate, final LocalDate[] endDates,\n final double[] fractionalParSpreads, final boolean payAccOnDefault, final Period tenor, StubType stubType, final boolean protectStart, final ISDACompliantDateYieldCurve yieldCurve,\n final double recoveryRate);\n\n}",
"public T caseAssetPropertyCurve(AssetPropertyCurve object) {\n\t\treturn null;\n\t}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Adds a new byte node to the system. The path is specified by the parameter name.
|
public void addByte(String name, byte... value) {
if (value == null) {
addNode(name, DNHelper.BYTE, -1, value);
} else {
addNode(name, DNHelper.BYTE, value.length, value);
}
}
|
[
"public Tree add(byte value) {\r\n\t\treturn addObjectInternal(value);\r\n\t}",
"void addNode(String name);",
"public Tree put(String path, byte value) {\r\n\t\treturn putObjectInternal(path, value, false);\r\n\t}",
"public void addNode(String node);",
"public void addKB(String name) {\n addKB(name, true); \n }",
"public Tree add(byte[] value) {\r\n\t\treturn addObjectInternal(value);\r\n\t}",
"public void put(String name, byte value){\n\t fields.put(name, new Byte(value));\n\t}",
"public void addNode(String name){\n nodes.put(name, new Node(name));\n }",
"void addNode(Node node);",
"org.hl7.fhir.Binary addNewBinary();",
"public Tree put(String path, byte[] value) {\r\n\t\treturn putObjectInternal(path, value, false);\r\n\t}",
"IIdentity addNode(String name);",
"public void putBytes(NodePath nodePath, InputStream stream);",
"public void addByte(byte in) {\n addBytes(in);\n }",
"public void addNewNode() {\r\n\t\tout.println(\"Enter X: \");\r\n\t\tint x = getNextIntFromCommandLine();\r\n\t\tout.println(\"Enter Y: \");\r\n\t\tint y = getNextIntFromCommandLine();\r\n\t\tNodeContainer nodecont = this.handler.newNode(x, y);\r\n\t\tPoint nodeCoord = nodecont.getCoordinate();\r\n\t\tout.println(\"Node Created - X: \" + nodeCoord.x + \"\\tY: \" + nodeCoord.y);\r\n\t}",
"public void addNode(String name, int x, int y) {\n nodes.add(new Node(name, x, y));\n this.repaint();\n }",
"public Node(String name, String path) {\n this.name = name;\n this.path = path;\n }",
"void addNode(String item) {\r\n assert item != null;\r\n assert !item.isEmpty();\r\n\r\n add(item, \"Textures/icons/node.png\");\r\n }",
"public void setByte(final String path, final byte value)\n {\n final int index = path.indexOf('.');\n if (index == - 1)\n {\n this.addTag(new NbtTagByte(path, value));\n return;\n }\n this.getOrCreateCompound(path.substring(0, index)).setByte(path.substring(index + 1), value);\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
remove a book from the stock
|
public void removeBook(Book book) {
if (this.stock.size() > 0) {
this.stock.remove(book);
}
}
|
[
"private void removeBook() {\n InventoryBook bookToDelete = tableViewInventory.getSelectionModel().getSelectedItem();\n if (bookToDelete != null) {\n handler.deleteBook(bookToDelete);\n updateBookList();\n }\n }",
"public void removeBook(String isbn);",
"boolean removeBook(int bookId);",
"public void removeBook(Book book)\n {\n if (this.bookSeries.containsValue(book))\n {\n this.bookSeries.remove(book);\n }\n }",
"public void remove()\r\n {\r\n if(bookCount>0)\r\n {\r\n bookCount-=1;\r\n }\r\n }",
"void removeInBookNo(Object oldInBookNo);",
"@Override\n public void removeFromCart(Publication book) {\n if(shoppingCart.contains(book)){\n shoppingCart.remove(book);\n } else throw new NoSuchPublicationException();\n }",
"@Override\n public void remove_book(Book book) {\n String key = book.getId();\n\n mDatabase.child(key).removeValue();\n\n FirebaseDatabase.getInstance().getReference().child(\"books\").child(key).removeValue();\n }",
"public void removeBookFromCart(Book book){\n\t\tfor(int i = 0; i < cart.size(); i++){\n\t\t\tif(book.getTitle().equalsIgnoreCase(cart.get(i).getTitle())){\n\t\t\t\tcart.remove(i);\n\t\t\t\tSystem.out.println(\"Book was removed from cart\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Book was not found in cart\");\n\t}",
"private void deleteBook() {\n readViews();\n final BookEntry bookEntry = new BookEntry(mNameString, mQuantityString, mPriceString, mSupplier, mPhoneString);\n AppExecutors.getInstance().diskIO().execute(new Runnable() {\n @Override\n public void run() {\n // Delete the book only if mBookId matches DEFAULT_BOOK_ID\n if (mBookId != DEFAULT_BOOK_ID) {\n bookEntry.setId(mBookId);\n mDb.bookDao().deleteBook(bookEntry);\n }\n finish();\n }\n });\n\n }",
"public void removeBook(Book b){\n\t\tbookMap.get(b.getTitle()).remove(b);\n\t}",
"public void deleteBook(int num)\n { \n bookList.remove(num); \n }",
"public com.appuntivari.mylibrary.model.MyLibrary remove(long id_book)\n\t\tthrows com.appuntivari.mylibrary.NoSuchMyLibraryException,\n\t\t\tcom.liferay.portal.kernel.exception.SystemException;",
"public void removeBook(Book book) {\n if (isNull(book)) {\n return;\n }\n int bookCnt = _noOfBooks;\n for (int i = 0; i < bookCnt; i++) {\n if (_lib[i].equals(book)) {\n _lib[i] = null;\n _noOfBooks--;\n }\n }\n arrangeArray();\n }",
"void removeHadithBookNo(Object oldHadithBookNo);",
"public void removeBookFromInventory(String barcode){\n booksMap.remove(barcode);\n /**\n * removing book from\n * the json file\n */\n\n\n }",
"private void deletebook() {\n // Only perform the delete if this is an existing book.\n if (mCurrentBookUri != null) {\n // Call the ContentResolver to delete the book at the given content URI.\n // Pass in null for the selection and selection args because the mCurrentBookUri\n // content URI already identifies the book that we want.\n int rowsDeleted = getContentResolver().delete(mCurrentBookUri, null, null);\n\n // Show a toast message depending on whether or not the delete was successful.\n if (rowsDeleted == 0) {\n // If no rows were deleted, then there was an error with the delete.\n Toast.makeText(this, getString(R.string.editor_delete_book_failed), Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the delete was successful and we can display a toast.\n Toast.makeText(this, getString(R.string.editor_delete_book_successful), Toast.LENGTH_SHORT).show();\n }\n finish();\n }\n }",
"void removeStock(int i);",
"@Override\n public List<Book> removeBooks(Book removingBook) throws DaoException {\n DataBaseHelper helper = new DataBaseHelper();\n List<Book> removedBooks = new ArrayList<>();\n try (Connection connection = SqlConnector.connect();\n PreparedStatement statementSelect =\n helper.prepareStatementSelect(connection, removingBook);\n ResultSet resultSet = statementSelect.executeQuery()) {\n while (resultSet.next()) {\n BookCreator bookCreator = new BookCreator();\n Book book = bookCreator.create(resultSet);\n removedBooks.add(book);\n resultSet.deleteRow();\n }\n if (removedBooks.isEmpty()) {\n throw new DaoException(\"There is no such book in warehouse!\");\n }\n } catch (SQLException e) {\n throw new DaoException(e);\n }\n return removedBooks;\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Executes the hook and provides arguments, dependencies, and a ScrapeSpecification to ScrapeInstance map
|
void execute(@NotNull DIContainer dependencies, @NotNull String[] args,
@NotNull Map<ScrapeSpecification, ScrapeInstance> scraper) throws Exception;
|
[
"public interface Scraper {\n /**\n * Specify fields which will be generating when scraping.\n */\n FieldDef[] fields();\n /**\n * Scrape whatever necessary from given url and feed results to {@code scraperOutput::yield}.\n */\n void scrapeUrl(String url, ScraperBase.LoggerForScraper logger, ScraperOutput scraperOutput, ScraperInformation scraperInformation) throws IOException;\n}",
"abstract void hook(XC_LoadPackage.LoadPackageParam packageParam);",
"public abstract void setup(String[] args);",
"public StepHook(ScenarioHook scenarioHook) {\n\t\tselenium = scenarioHook.getSelenium();\n\t}",
"public static void main (String[] args) {\n\t\t\n \tTestRecordHelper datahelper = new TestRecordHelper();\n \tLogUtilities logs = new LogUtilities();\n \t\n \tProcessRequest requester = new ProcessRequest(\n datahelper, // TestRecordHelper\n logs, // LogUtilities\n new DriverCommandProcessor(), // use standard DriverCommandProcessor\n null, // disable standard TestStepProcessor\n null, // no custom driver command support\n null); // no custom test step support\n \t \n \tDDGUIUtilities gui_utils = new DCGUIUtilities();\n \t\n DCJavaHook hook = new DCJavaHook(\n SAFS_DRIVER_COMMANDS, // STAF process name for hook instance\n STAFHelper.SAFS_HOOK_TRD, // (default) SAFSVARS TestRecordData\n logs, // LogUtilities\n datahelper, // TestRecordHelper\n gui_utils, // DDGUIUtilities\n requester); // ProcessRequest\n \n // this should now be properly handled by the superclass...\n datahelper.setSTAFHelper(hook.getHelper());\n\n\t\t// HOOK INITIALIZATION COMPLETE\n\t\t \n if (args.length > 0 && args[0].equalsIgnoreCase(\"log\")) {\n Log.setHelper(hook.getHelper());\n logs.setCopyLogClass(true);\n }\n hook.start();\n }",
"public static void main (String[] args) {\n\t\t\tLog.ENABLED = true;\n\t\t\tLog.setLogLevel(Log.DEBUG);\n\n\t\t\tif(args.length > 0 && args[0].equalsIgnoreCase(\"SPC\")){\n\t\t\t\tRUNNING_SPC = true;\n\t\t\t\tSystem.out.println(\"Selenium Process Container starting...\");\n\t\t\t\tLogUtilities logs=new LogUtilities();\n\t\t\t\tSeleniumJavaHook hook = new SeleniumJavaHook(SELENIUM_COMMANDS, logs);\n\t\t\t\thook.setHelper(SELENIUM_COMMANDS);\n\t\t\t\thook.getTRDData();\n\t\t\t\thook.getRequestProcessor();\n\t\t\t\t// HOOK INITIALIZATION COMPLETE\n\t\t\t\thook.start();\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"SAFS/Selenium Hook starting...\");\n\t\t\t\tLogUtilities logs=new LogUtilities();\n\n\t\t\t\tSeleniumJavaHook hook = new SeleniumJavaHook(SELENIUM_COMMANDS, logs);\n\t\t\t\thook.setHelper(SELENIUM_COMMANDS);\n\t\t\t\thook.getTRDData();\n\t\t\t\thook.getRequestProcessor();\n\t\t\t\t// HOOK INITIALIZATION COMPLETE\n\t\t\t\thook.start();\n\t\t\t}\n\t\t}",
"public static void prepare(String[] args) {\n if (!preProcessing) {\n preProcessing = true;\n Utility util = Utility.getInstance();\n SimpleClassScanner scanner = SimpleClassScanner.getInstance();\n Set<String> packages = scanner.getPackages(true);\n for (String p : packages) {\n // sort loading sequence\n int n = 0;\n Map<String, Class<?>> steps = new HashMap<>();\n List<Class<?>> services = scanner.getAnnotatedClasses(p, BeforeApplication.class);\n for (Class<?> cls : services) {\n if (Feature.isRequired(cls)) {\n n++;\n BeforeApplication before = cls.getAnnotation(BeforeApplication.class);\n int seq = Math.min(MAX_SEQ, before.sequence());\n String key = util.zeroFill(seq, MAX_SEQ) + \".\" + util.zeroFill(n, MAX_SEQ);\n steps.put(key, cls);\n } else {\n log.debug(\"Skipping optional startup {}\", cls);\n }\n }\n List<String> list = new ArrayList<>(steps.keySet());\n if (list.size() > 1) {\n Collections.sort(list);\n }\n for (String seq : list) {\n Class<?> cls = steps.get(seq);\n try {\n Object o = cls.newInstance();\n if (o instanceof EntryPoint) {\n /*\n * execute preparation logic as a blocking operation\n * (e.g. setting up environment variable, override application.properties, etc.)\n */\n EntryPoint app = (EntryPoint) o;\n try {\n log.info(\"Starting {}\", app.getClass().getName());\n app.start(args);\n } catch (Exception e) {\n log.error(\"Unable to run \" + app.getClass().getName(), e);\n }\n } else {\n log.error(\"Unable to start {} because it is not an instance of {}\",\n cls.getName(), EntryPoint.class.getName());\n }\n\n } catch (InstantiationException | IllegalAccessException e) {\n log.error(\"Unable to start {} - {}\", cls.getName(), e.getMessage());\n }\n }\n }\n /*\n * In case values in application.properties are updated by the BeforeApplication modules,\n * the AppConfigReader must reload itself.\n */\n AppConfigReader.getInstance().reload();\n }\n }",
"public void testMultipleWeaversWithRankings() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\t//Called in proper order\n\t\thook3.setChangeTo(\"3 Finished\");\n\t\thook1.setExpected(\"3 Finished\");\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExpected(\"1 Finished\");\n\t\thook2.setChangeTo(\"Chain Complete\");\n\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\ttry {\n\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\treg3 = hook3.register(getContext(), 1);\n\t\t\tClass<?>clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"Chain Complete\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\n\t\t\t// We expect the order to change if we update our ranking\n\t\t\tHashtable<String, Object> table = new Hashtable<String, Object>();\n\t\t\ttable.put(Constants.SERVICE_RANKING, Integer.valueOf(2));\n\t\t\treg2.setProperties(table);\n\n\t\t\thook2.setExpected(DEFAULT_EXPECTED);\n\t\t\thook2.setChangeTo(\"2 Finished\");\n\t\t\thook3.setExpected(\"2 Finished\");\n\t\t\thook3.setChangeTo(\"3 Finished\");\n\t\t\thook1.setChangeTo(\"org.osgi.framework.hooks.weaving.WovenClass\");\n\n\t\t\thook2.addImport(\"org.osgi.framework.hooks.weaving\");\n\n\t\t\tclazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.hooks.weaving.WovenClass\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}",
"public void start(){\n CoffeeMakerHelper coffeeMakerHelper = new CoffeeMakerHelper(inputArgs[0]);\n coffeeMakerService = coffeeMakerHelper.parseJsonFile();\n computeCoffeeMaker();\n }",
"public SeleniumJavaHook(String process_name) {\n\t\t\tsuper(process_name);\n\t\t}",
"public static void main(String[] args) {\n for (int pageNumber =1; pageNumber<=51; pageNumber++){\n try {\n //System.out.println(\"Page number: \" + pageNumber);\n String pageContent = getPageContent(\"https://powerlist.talint.co.uk/talint-powerlist/search-companies/?sf_paged=\" + pageNumber);\n String [] linkSections = pageContent.split(\"</a></h2>\");\n for (String linkSection: linkSections) {\n if(linkSection.contains(\"<h2><a href=\\\"\")){\n String companyLink = linkSection.substring(linkSection.indexOf(\"<h2><a href=\\\"\")+13,\n linkSection.lastIndexOf(\"/\\\">\"));\n String companyDetailsContent = getPageContent(companyLink);\n processCompanyDetails(companyLink, companyDetailsContent);\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }",
"public SeleniumJavaHook() {\n\t\t\tsuper();\n\t\t}",
"protected abstract void populateTestSteps(TestRunner runner);",
"public SeleniumJavaHook (String process_name, String trd_name,\n\t\t LogUtilities logs,\n\t\t TestRecordHelper trd_data,\n\t\t DDGUIUtilities gui_utils,\n\t\t ProcessRequest aprocessor) {\n\n\t\t\tsuper(process_name, trd_name, logs, trd_data, gui_utils, aprocessor);\n\t\t}",
"protected void runBeforeStep() {}",
"public static void main(String[] args) {\n AbstractFactory engineFactory = getFactory(\"ENGINE\");\n IEngines engine1 = engineFactory.getEngine(\"DIESEL\");\n engine1.installEngine();\n IEngines engine2 = engineFactory.getEngine(\"OTTO\");\n engine2.installEngine();\n IEngines engine3 = engineFactory.getEngine(\"ELECTRIC\");\n engine3.installEngine();\n IEngines engine4 = engineFactory.getEngine(\"TURBO\");\n engine4.installEngine();\n\n // This part of code checks the installation procedure of all types of tires which have been implemented;\n // Several variables are being declared and initialized;\n AbstractFactory tireFactory = getFactory(\"TIRES\");\n ITires tire1 = tireFactory.getTires(\"WINTER\");\n tire1.installTires();\n ITires tire2 = tireFactory.getTires(\"CASUAL\");\n tire2.installTires();\n ITires tire3 = tireFactory.getTires(\"RACING\");\n tire3.installTires();\n\n\n }",
"@Setup(Level.Trial)\n @SuppressWarnings(\"SystemOut\")\n public void setup() {\n GenericContainer<?> collector =\n new GenericContainer<>(OTLP_COLLECTOR_IMAGE)\n .withExposedPorts(EXPOSED_PORT, HEALTH_CHECK_PORT)\n .waitingFor(Wait.forHttp(\"/\").forPort(HEALTH_CHECK_PORT))\n .withCopyFileToContainer(\n MountableFile.forClasspathResource(\"/otel.yaml\"), \"/etc/otel.yaml\")\n .withCommand(\"--config /etc/otel.yaml\");\n\n collector.start();\n\n SpanProcessor spanProcessor = makeSpanProcessor(collector);\n\n tracerProvider =\n SdkTracerProvider.builder()\n .setSampler(Sampler.alwaysOn())\n .addSpanProcessor(spanProcessor)\n .build();\n\n tracer = tracerProvider.get(\"PipelineBenchmarkTracer\");\n }",
"private void postProcess(MethodGen method) throws ClassNotFoundException {\n\t\t\tnew InstrumentMethodsOfSupportClasses(this, method);\n\t\t\tnew ReplaceFieldAccessesWithAccessors(this, method);\n\t\t\tnew AddExtraArgsToCallsToFromContract(this, method);\n\t\t\tnew SetCallerAndBalanceAtTheBeginningOfFromContracts(this, method);\n\t\t\tnew AddGasUpdates(this, method);\n\t\t}",
"public static void main(String[] args) {\n\t\tloadrunner load= new blackbox();\r\n\t\tload.testcases();\r\n\t\tload=new selenium();\r\n\t\tload.testcases();\r\n\t}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
$ANTLR end "rule__PieChart__Group__11__Impl" $ANTLR start "rule__PieChart__Group__12" InternalMyDsl.g:8861:1: rule__PieChart__Group__12 : rule__PieChart__Group__12__Impl rule__PieChart__Group__13 ;
|
public final void rule__PieChart__Group__12() throws RecognitionException {
int stackSize = keepStackSize();
try {
// InternalMyDsl.g:8865:1: ( rule__PieChart__Group__12__Impl rule__PieChart__Group__13 )
// InternalMyDsl.g:8866:2: rule__PieChart__Group__12__Impl rule__PieChart__Group__13
{
pushFollow(FOLLOW_9);
rule__PieChart__Group__12__Impl();
state._fsp--;
pushFollow(FOLLOW_2);
rule__PieChart__Group__13();
state._fsp--;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
restoreStackSize(stackSize);
}
return ;
}
|
[
"public final void rule__PieChart__Group__12__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:8877:1: ( ( ( rule__PieChart__Group_12__0 )* ) )\n // InternalMyDsl.g:8878:1: ( ( rule__PieChart__Group_12__0 )* )\n {\n // InternalMyDsl.g:8878:1: ( ( rule__PieChart__Group_12__0 )* )\n // InternalMyDsl.g:8879:2: ( rule__PieChart__Group_12__0 )*\n {\n before(grammarAccess.getPieChartAccess().getGroup_12()); \n // InternalMyDsl.g:8880:2: ( rule__PieChart__Group_12__0 )*\n loop46:\n do {\n int alt46=2;\n int LA46_0 = input.LA(1);\n\n if ( (LA46_0==RULE_COMA) ) {\n alt46=1;\n }\n\n\n switch (alt46) {\n \tcase 1 :\n \t // InternalMyDsl.g:8880:3: rule__PieChart__Group_12__0\n \t {\n \t pushFollow(FOLLOW_10);\n \t rule__PieChart__Group_12__0();\n\n \t state._fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop46;\n }\n } while (true);\n\n after(grammarAccess.getPieChartAccess().getGroup_12()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__PieChart__Group_12__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:9351:1: ( rule__PieChart__Group_12__1__Impl )\n // InternalMyDsl.g:9352:2: rule__PieChart__Group_12__1__Impl\n {\n pushFollow(FOLLOW_2);\n rule__PieChart__Group_12__1__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__PieChart__Group__11() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:8838:1: ( rule__PieChart__Group__11__Impl rule__PieChart__Group__12 )\n // InternalMyDsl.g:8839:2: rule__PieChart__Group__11__Impl rule__PieChart__Group__12\n {\n pushFollow(FOLLOW_9);\n rule__PieChart__Group__11__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__PieChart__Group__12();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__RadarChart__Group_12__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:8460:1: ( rule__RadarChart__Group_12__1__Impl )\n // InternalMyDsl.g:8461:2: rule__RadarChart__Group_12__1__Impl\n {\n pushFollow(FOLLOW_2);\n rule__RadarChart__Group_12__1__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__PieChart__Group_12__0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:9324:1: ( rule__PieChart__Group_12__0__Impl rule__PieChart__Group_12__1 )\n // InternalMyDsl.g:9325:2: rule__PieChart__Group_12__0__Impl rule__PieChart__Group_12__1\n {\n pushFollow(FOLLOW_8);\n rule__PieChart__Group_12__0__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__PieChart__Group_12__1();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__LineChart__Group_12__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:5760:1: ( rule__LineChart__Group_12__1__Impl )\n // InternalMyDsl.g:5761:2: rule__LineChart__Group_12__1__Impl\n {\n pushFollow(FOLLOW_2);\n rule__LineChart__Group_12__1__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__BarChart__Group_12__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:7407:1: ( rule__BarChart__Group_12__1__Impl )\n // InternalMyDsl.g:7408:2: rule__BarChart__Group_12__1__Impl\n {\n pushFollow(FOLLOW_2);\n rule__BarChart__Group_12__1__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__PieChart__Group__13() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:8892:1: ( rule__PieChart__Group__13__Impl rule__PieChart__Group__14 )\n // InternalMyDsl.g:8893:2: rule__PieChart__Group__13__Impl rule__PieChart__Group__14\n {\n pushFollow(FOLLOW_23);\n rule__PieChart__Group__13__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__PieChart__Group__14();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__PieChart__Group__20() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:9081:1: ( rule__PieChart__Group__20__Impl )\n // InternalMyDsl.g:9082:2: rule__PieChart__Group__20__Impl\n {\n pushFollow(FOLLOW_2);\n rule__PieChart__Group__20__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__PieChart__Group__13__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:8904:1: ( ( RULE_LIST_END ) )\n // InternalMyDsl.g:8905:1: ( RULE_LIST_END )\n {\n // InternalMyDsl.g:8905:1: ( RULE_LIST_END )\n // InternalMyDsl.g:8906:2: RULE_LIST_END\n {\n before(grammarAccess.getPieChartAccess().getLIST_ENDTerminalRuleCall_13()); \n match(input,RULE_LIST_END,FOLLOW_2); \n after(grammarAccess.getPieChartAccess().getLIST_ENDTerminalRuleCall_13()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__LineChart__Group__11() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:4626:1: ( rule__LineChart__Group__11__Impl rule__LineChart__Group__12 )\n // InternalMyDsl.g:4627:2: rule__LineChart__Group__11__Impl rule__LineChart__Group__12\n {\n pushFollow(FOLLOW_22);\n rule__LineChart__Group__11__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__LineChart__Group__12();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Dashboard__Group__11() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:1818:1: ( rule__Dashboard__Group__11__Impl )\n // InternalMyDsl.g:1819:2: rule__Dashboard__Group__11__Impl\n {\n pushFollow(FOLLOW_2);\n rule__Dashboard__Group__11__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__LineChart__Group_11__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:5706:1: ( rule__LineChart__Group_11__1__Impl )\n // InternalMyDsl.g:5707:2: rule__LineChart__Group_11__1__Impl\n {\n pushFollow(FOLLOW_2);\n rule__LineChart__Group_11__1__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__LineChart__Group__12__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:4665:1: ( ( ( rule__LineChart__Group_12__0 )? ) )\n // InternalMyDsl.g:4666:1: ( ( rule__LineChart__Group_12__0 )? )\n {\n // InternalMyDsl.g:4666:1: ( ( rule__LineChart__Group_12__0 )? )\n // InternalMyDsl.g:4667:2: ( rule__LineChart__Group_12__0 )?\n {\n before(grammarAccess.getLineChartAccess().getGroup_12()); \n // InternalMyDsl.g:4668:2: ( rule__LineChart__Group_12__0 )?\n int alt29=2;\n int LA29_0 = input.LA(1);\n\n if ( (LA29_0==84) ) {\n alt29=1;\n }\n switch (alt29) {\n case 1 :\n // InternalMyDsl.g:4668:3: rule__LineChart__Group_12__0\n {\n pushFollow(FOLLOW_2);\n rule__LineChart__Group_12__0();\n\n state._fsp--;\n\n\n }\n break;\n\n }\n\n after(grammarAccess.getLineChartAccess().getGroup_12()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__BarChart__Group__11() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:6192:1: ( rule__BarChart__Group__11__Impl rule__BarChart__Group__12 )\n // InternalMyDsl.g:6193:2: rule__BarChart__Group__11__Impl rule__BarChart__Group__12\n {\n pushFollow(FOLLOW_26);\n rule__BarChart__Group__11__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__BarChart__Group__12();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__RadarChart__Group__12() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:7920:1: ( rule__RadarChart__Group__12__Impl rule__RadarChart__Group__13 )\n // InternalMyDsl.g:7921:2: rule__RadarChart__Group__12__Impl rule__RadarChart__Group__13\n {\n pushFollow(FOLLOW_9);\n rule__RadarChart__Group__12__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__RadarChart__Group__13();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__RadarChart__Group__11() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:7893:1: ( rule__RadarChart__Group__11__Impl rule__RadarChart__Group__12 )\n // InternalMyDsl.g:7894:2: rule__RadarChart__Group__11__Impl rule__RadarChart__Group__12\n {\n pushFollow(FOLLOW_9);\n rule__RadarChart__Group__11__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__RadarChart__Group__12();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Company__Group__12() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:1224:1: ( rule__Company__Group__12__Impl rule__Company__Group__13 )\n // InternalMyDsl.g:1225:2: rule__Company__Group__12__Impl rule__Company__Group__13\n {\n pushFollow(FOLLOW_8);\n rule__Company__Group__12__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__Company__Group__13();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__LineChart__Group__12() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:4653:1: ( rule__LineChart__Group__12__Impl rule__LineChart__Group__13 )\n // InternalMyDsl.g:4654:2: rule__LineChart__Group__12__Impl rule__LineChart__Group__13\n {\n pushFollow(FOLLOW_22);\n rule__LineChart__Group__12__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__LineChart__Group__13();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
metodo para calcular el importe de todos los productos de una factura
|
public double calcularImporte() {
int cantidad;
double precio;
double total = 0;
for (int i = 0; i < articulosFactura.size(); i++) {
cantidad = articulosFactura.get(i).getCantidad();
precio = articulosFactura.get(i).getPrecio();
total = total + (cantidad * precio);
}
return total;
}
|
[
"private void calcularImportesDeFactura(){\r\n\t\t\r\n\t\tFacxp analisis=this;\r\n\t\t\r\n\t\t/*\r\n\t\tCantidadMonetaria importef=new CantidadMonetaria(analisis.getIMPORTEF(),analisis.getTipoDeMoneda());\r\n\t\tCantidadMonetaria totalf=new CantidadMonetaria(analisis.getTOTALF(),analisis.getTipoDeMoneda());\r\n\t\tCantidadMonetaria impuestof=new CantidadMonetaria(analisis.getIMPUESTOF(),analisis.getTipoDeMoneda());\r\n\t\t\r\n\t\tanalisis.setImporteEnFactura(importef);\r\n\t\tanalisis.setTotalEnFactura(totalf);\r\n\t\tanalisis.setImpuestoEnFactura(impuestof);\r\n\t\t*/\r\n\t\tif(analisis.getTipoDeMoneda().equals(CantidadMonetaria.DOLARES)){\r\n\t\t\tanalisis.setTC(analisis.getTC2());\r\n\t\t}else if(analisis.getTipoDeMoneda().equals(CantidadMonetaria.EUROS)){\r\n\t\t\tanalisis.setTC(analisis.getTC3());\r\n\t\t}\r\n\t\t\r\n\t\tBigDecimal tc=BigDecimal.valueOf(analisis.getTC().doubleValue());\r\n\t\tanalisis.setImporteMN(analisis.getImporteEnFactura().multiply(tc));\r\n\t\tanalisis.setImpuestoMN(analisis.getImpuestoEnFactura().multiply(tc));\r\n\t\tanalisis.setTotalMN(analisis.getTotalEnFactura().multiply(tc));\r\n\t\t\r\n\t}",
"public void calculaImportes(){\n ListIterator i = this.movimientosAlquier.listIterator();\n while ( i.hasNext() ){\n MovimientosAlquiler m = (MovimientosAlquiler) i.next();\n this.setTotalImporteAlquiler(this.getTotalImporteAlquiler()+m.getPrecio());\n this.setTotalPenalizacionRetraso(this.getTotalPenalizacionRetraso()+m.getPenalizacionRetraso());\n this.setTotalPenalizacionDeterioro(this.getTotalPenalizacionDeterioro()+m.getPenalizacionDeterioro());\n this.setTotalPenalizacionExtravio(this.getTotalPenalizacionExtravio()+m.getPenalizacionExtravio());\n this.setTotalPenalizacionOtra(this.getTotalPenalizacionOtra()+m.getPenalizacionOtra());\n this.setTotalDescuentos(this.getTotalDescuentos()+\n ((m.getPrecio()*m.getDescuentoPorcentaje()/100) + m.getDescuentoNeto()));\n }\n }",
"private void calcularPromedioEstudiantes() {\n promedioEstudiantes = BigDecimal.ZERO;\n int nroEstudiantesEspe = 0;\n String codCampus = proyectoSelected.getCampus().getStvcampCode();\n if (codCampus.equals(\"18\")) {\n codCampus = \"02\";\n }\n for (CarreraProyecto car : proyectoSelected.getCarreraProyectoList()) {\n if (!idPeriodoAereo.isEmpty()) {\n List<VEstudianteCarreraPregrado> temp1 = vEstudianteCarreraPregradoFacade.findByPeriodoCampusCarrera(idPeriodoAereo, codCampus, car.getCarrera().getStvmajrCode());\n for (VEstudianteCarreraPregrado est : temp1) {\n nroEstudiantesEspe += est.getNroEstudiantes();\n }\n }\n if (!idPeriodoNaval1.isEmpty()) {\n List<VEstudianteCarreraPregrado> temp2 = vEstudianteCarreraPregradoFacade.findByPeriodoCampusCarrera(idPeriodoNaval1, codCampus, car.getCarrera().getStvmajrCode());\n for (VEstudianteCarreraPregrado est : temp2) {\n nroEstudiantesEspe += est.getNroEstudiantes();\n }\n }\n if (!idPeriodoNaval2.isEmpty()) {\n List<VEstudianteCarreraPregrado> temp3 = vEstudianteCarreraPregradoFacade.findByPeriodoCampusCarrera(idPeriodoNaval2, codCampus, car.getCarrera().getStvmajrCode());\n for (VEstudianteCarreraPregrado est : temp3) {\n nroEstudiantesEspe += est.getNroEstudiantes();\n }\n }\n if (!idPeriodoNormal.isEmpty()) {\n List<VEstudianteCarreraPregrado> temp4 = vEstudianteCarreraPregradoFacade.findByPeriodoCampusCarrera(idPeriodoNormal, codCampus, car.getCarrera().getStvmajrCode());\n for (VEstudianteCarreraPregrado est : temp4) {\n nroEstudiantesEspe += est.getNroEstudiantes();\n }\n }\n }\n try {\n promedioEstudiantes = new BigDecimal(proyectoSelected.getTotalEstudiantesParticipantes()).divide(new BigDecimal(nroEstudiantesEspe), 10, RoundingMode.HALF_UP).multiply(new BigDecimal(100));\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"@Override\r\n public double getImporteTotal() {\r\n return getCantidad() * getPrecio();\r\n }",
"float getImporto();",
"private void calcularPromedioDocentes() {\n promedioDocentes = BigDecimal.ZERO;\n int nroDocentesEspe = 0;\n for (DepartamentoProyecto dep : proyectoSelected.getDepartamentoProyectoList()) {\n String codCampus = dep.getCampus().getStvcampCode();\n /*if (codCampus.equals(\"18\")){\n codCampus=\"02\";\n }*/\n nroDocentesEspe += vistaDocenteFacade.findCountByCampusDepartamento(codCampus, dep.getDepartamento().getStvsubjCode());\n }\n try {\n promedioDocentes = new BigDecimal(proyectoSelected.getTotalDocentesParticipantes()).divide(new BigDecimal(nroDocentesEspe), 10, RoundingMode.HALF_UP).multiply(new BigDecimal(100));\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }",
"public void calcularEntropia(){\n //Verificamos si será con la misma probabilida o con probabilidad\n //especifica\n if(contadorEstados == 0){\n //Significa que será con la misma probabilidad por lo que nosotros\n //calcularemos las probabilidades individuales\n for(int i = 0; i < numEstados; i++){\n probabilidadEstados[i] = 1.0 / numEstados;\n }\n }\n for(int i = 0; i < numEstados; i++){\n double logEstado = Math.log10(probabilidadEstados[i]);\n logEstado = logEstado * (-1);\n double logDos = Math.log10(2);\n double divisionLog = logEstado / logDos;\n double entropiaTmp = probabilidadEstados[i] * divisionLog;\n resultado += entropiaTmp;\n }\n }",
"public double getImporteTotal();",
"private double getImporteRepuestos() {\n\t\tdouble importe = 0.0;\n\t\tfor (Sustitucion sustitucion : sustituciones) {\n\t\t\timporte += sustitucion.getImporte();\n\t\t}\n\t\treturn importe;\n\t}",
"public void calcPrecioTotal() {\n try {\n float result = precioUnidad * Float.parseFloat(unidades.getText().toString());\n prTotal.setText(String.valueOf(result) + \"€\");\n }catch (Exception e){\n prTotal.setText(\"0.0€\");\n }\n }",
"public void totalFacturaVenta(){\n BigDecimal totalVentaFactura = new BigDecimal(0);\n \n try{\n //Recorremos la lista de detalle y calculamos la Venta total de la factura\n for(Detallefactura det: listDetalle){\n //Sumamos a la variable 'totalVentaFactura'\n totalVentaFactura = totalVentaFactura.add(det.getTotal());\n } \n }catch(Exception e){\n e.printStackTrace();\n }\n \n //Setemos al objeto Factura el valor de la variable 'totalFacturaVenta'\n factura.setTotalVenta(totalVentaFactura);\n \n }",
"public float calculaPrecioTotal(){\n float total=0;\n for(int i=0;i<cesta.size();++i){\n ItemCesta ic = cesta.get(i);\n total+=(ic.getCantidad()*ic.getPrecio());\n }\n return total;\n }",
"private double probaMetropolis(double deltaValeur) {\r\n\t\treturn Math.exp(-deltaValeur / temperature);\r\n\t}",
"public static void calcularSuma() {\n int cantidadDatos;\n double resultado = 0;\n ArrayList<Double> listaDatos = new ArrayList<>();\n System.out.printf(\"Ingrese cuantos numeros quiere sumar: \");\n cantidadDatos = reader.nextInt();\n for (int i = 0; i < cantidadDatos; i++) {\n System.out.println(\"Ingrese un numero: \");\n double valor = reader.nextDouble();\n listaDatos.add(valor);\n }\n for (int i = 0; i < listaDatos.size(); i++) {\n resultado += listaDatos.get(i);\n }\n System.out.println(\"El resultado de la suma es: \" + resultado);\n }",
"int calcularCantidadViajes(List<Double> pesoItems);",
"private void calcularTotal() {\n ZebraJTable vuelos = (ZebraJTable) this.ventana.getScrollVuelos().getViewport().getView();\n ZebraJTable viajes = (ZebraJTable) this.ventana.getScrollViajOrg().getViewport().getView();\n ZebraJTable hoteles = (ZebraJTable) this.ventana.getScrollHoteles().getViewport().getView();\n \n double total = 0;\n \n //Obtenemos los precios\n for(int i = 0; i < vuelos.getModel().getRowCount(); i++) {\n Object[] fila = vuelos.getRow(i);\n total += Double.parseDouble((String)fila[5]);\n }\n \n for(int i = 0; i < viajes.getModel().getRowCount(); i++) {\n Object[] fila = viajes.getRow(i);\n total += Double.parseDouble((String)fila[1]);\n }\n \n for(int i = 0; i < hoteles.getModel().getRowCount(); i++) {\n Object[] fila = hoteles.getRow(i);\n total += Double.parseDouble((String)fila[5]);\n }\n \n this.ventana.getPrecio().setText(\"\"+total);\n }",
"private Double calcularSumatoriaPotencias(LinkedList<Double> listaValores) throws NumberFormatException {\n\n Double sumatoria = new Double(0);\n for (Double valor : listaValores) {\n sumatoria = operateBinary(sumatoria, operateBinary(valor, 2, pow), addition);\n }\n return sumatoria;\n }",
"public BigDecimal calcolaImportoTotaleNoteCollegateSpesa(){\n\t\tBigDecimal result = BigDecimal.ZERO;\n\t\tfor(DocumentoSpesa ds : getListaNoteCreditoSpesaFiglio()){\n\t\t\tresult = result.add(ds.getImporto());\n\t\t}\n\t\treturn result;\n\t}",
"public int calcularVolumen(){\r\n return ancho * alto * profundo;\r\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
This method displays the given quantity value on the screen.
|
private void displayQuantity(int number) {
TextView quantityTextView = (TextView) findViewById(
R.id.quantity_text_view);
quantityTextView.setText("" + number);
}
|
[
"public void displayQuantity(int quantity) {\n TextView quantityTextView = (TextView) findViewById(R.id.quantity_text_view);\n quantityTextView.setText(String.valueOf(quantity));\n }",
"private void displayQuantity(int quantity) {\n TextView quantityTextView = (TextView) findViewById(R.id.quantity_text_view);\n quantityTextView.setText(\"\" + quantity);\n }",
"private void displayQuantity() {\n Log.d(\"Method\", \"displayQuantity()\");\n TextView quantityTextView = (TextView) findViewById(\n R.id.quantity_text_view);\n\n quantityTextView.setText(String.format(Locale.getDefault(), \"%d\", coffeeCount));\n displayTotal();\n }",
"private void displayQuantity(int number) {\r\n TextView quantityTextView = (TextView) findViewById(R.id.quantity_text_view);\r\n quantityTextView.setText(\"\" + number);\r\n }",
"void printQuantity(Quantity iQuantity)\n {\n System.out.println(iQuantity.getElementValue());\n }",
"private void displayQuantity(int numberOfCoffeeOrdered) {\n TextView quantityTextView = (TextView) findViewById(R.id.quantity_text_view);\n quantityTextView.setText(\"\" + numberOfCoffeeOrdered);\n }",
"BigDecimal getDisplayQuantity();",
"public void setQuantity(int value) {\n this.quantity = value;\n }",
"public void enterQuantityText(String quantity) {\n inputText(quantityTextBox, quantity);\n\n }",
"java.lang.String getQuantity();",
"@Override\n public String toString() {\n String output = quantity + \" x \" + product;\n\n return output;\n }",
"public void foodQuantityShow(Player player){\n\t\tSystem.out.println((\"1: \" + foodShopInventory.get(0).getName() + \" Quantity: \" + player.getFoodQuantity(new Bamboo())));\n\t\tSystem.out.println((\"2: \" + foodShopInventory.get(1).getName() + \" Quantity: \" + player.getFoodQuantity(new Salmon())));\n\t\tSystem.out.println((\"3: \" + foodShopInventory.get(2).getName() + \" Quantity: \" + player.getFoodQuantity(new Carrot())));\n\t\tSystem.out.println((\"4: \" + foodShopInventory.get(3).getName() + \" Quantity: \" + player.getFoodQuantity(new Laksa())));\n\t\tSystem.out.println((\"5: \" + foodShopInventory.get(4).getName() + \" Quantity: \" + player.getFoodQuantity(new Kebab())));\n\t\tSystem.out.println((\"6: \" + foodShopInventory.get(5).getName() + \" Quantity: \" + player.getFoodQuantity(new Chocolatecake())));\n\t}",
"void setDisplayQuantity(BigDecimal inDisplayQuantity);",
"public void showContents() {\r\n\t\tif (fruitsList.isEmpty()) {\r\n\t\t\tSystem.out.println(\"Fruit basket is empty.\");\r\n\t\t} else {\r\n\t\t\tfor (Fruit fruit:fruitsList) {\r\n\t\t\t\tSystem.out.println(fruit.getName() + \": \" + fruit.getQuantity() + \r\n\t\t\t\t\t\t\" at £\" + df2dp.format(fruit.getUnitCost()) + \" each = £\" +\r\n\t\t\t\t\t\tdf2dp.format(fruit.getQuantity()*fruit.getUnitCost()) );\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void setQuantity(int value)\n {\n this.quantity = value;\n this.isquantitySet = true;\n }",
"public String getQuantity(){\r\n\t\t\r\n\t\treturn String.valueOf(quantity);\r\n\t}",
"public static String formatQuantity(int quantity) {\n return formatQuantity((double) quantity);\n }",
"@Override\n public String toString() {\n\n return \"product=\" + product.getName() + \"(x\"+ quantity + \"): \" + (this.product.getPrice() * this.quantity) + \"\\n\";\n }",
"public void setQty(int value) {\n this.qty = value;\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Helper function for building bitmap indexes for integerencoded dimensions. Called by IncrementalIndexAdapter as it iterates through its sequence of rows. Given a row value array from a Row key, with the current row number indicated by "rowNum", set the index for "rowNum" in the bitmap index for each value that appears in the row value array. For example, if key is an int[] array with values [1,3,4] for a dictionaryencoded String dimension, and rowNum is 27, this function would set bit 27 in bitmapIndexes[1], bitmapIndexes[3], and bitmapIndexes[4] See StringDimensionIndexer.fillBitmapsFromUnsortedEncodedKeyComponent() for a reference implementation. If a dimension type does not support bitmap indexes, this function will not be called and can be left unimplemented.
|
void fillBitmapsFromUnsortedEncodedKeyComponent(
EncodedKeyComponentType key,
int rowNum,
MutableBitmap[] bitmapIndexes,
BitmapFactory factory
);
|
[
"void BuildItemIndices();",
"protected void buildIndex() {\r\n \t\t\r\n \t\trootIndex.clear();\r\n \t\tfor(Entry<Key, ICell> entry: data.entrySet()) {\r\n \t\t\tIDimensionElement elm = entry.getKey().getDimensionElement(0);\r\n \t\t\tIDimensionElement e = elm;\r\n \t\t\t// do not build a cache for the root element, as it would just include all keys.\r\n \t\t\twhile (!(e instanceof IDimension)) {\r\n \t\t\t\tSet<Key> keys = rootIndex.get(e);\r\n \t\t\t\tif (keys == null) {\r\n \t\t\t\t\tkeys = new HashSet<Key>();\r\n \t\t\t\t\trootIndex.put(e, keys);\r\n \t\t\t\t}\r\n \t\t\t\tkeys.add(entry.getKey());\r\n \t\t\t\te = e.getParent();\r\n \t\t\t}\r\n \t\t}\r\n \t\t\r\n \t}",
"private int indexForKey(final long key, final int i) {\n keyArr[0] = key;\n return columns * i + (((int) (MurmurHash3.hash(keyArr, i)[0])) >>> 1) % columns;\n }",
"public interface StringValueSetIndexes\n{\n /**\n * Get the {@link ImmutableBitmap} corresponding to the supplied value. Generates an empty bitmap when passed a\n * value that doesn't exist. Never returns null.\n */\n BitmapColumnIndex forValue(@Nullable String value);\n\n /**\n * Get an {@link Iterable} of {@link ImmutableBitmap} corresponding to the specified set of values (if they are\n * contained in the underlying column). The set must be sorted using\n * {@link org.apache.druid.java.util.common.guava.Comparators#naturalNullsFirst()}.\n */\n BitmapColumnIndex forSortedValues(SortedSet<String> values);\n}",
"public abstract IntBuffer getIndicesInt();",
"@SuppressWarnings(\"Duplicates\")\n private IntArray[] getIntArrayRawKeys(int index) {\n IntArray[] rawKeys = null;\n\n // Before having to transform to array, use single value raw key for better performance\n int[] dictIds = new int[_numGroupByExpressions];\n\n for (int i = 0; i < _numGroupByExpressions; i++) {\n if (_isSingleValueColumn[i]) {\n int dictId = _singleValueDictIds[i][index];\n if (rawKeys == null) {\n dictIds[i] = dictId;\n } else {\n for (IntArray rawKey : rawKeys) {\n rawKey._elements[i] = dictId;\n }\n }\n } else {\n int[] multiValueDictIds = _multiValueDictIds[i][index];\n int numValues = multiValueDictIds.length;\n\n // Specialize multi-value column with only one value inside\n if (numValues == 1) {\n int dictId = multiValueDictIds[0];\n if (rawKeys == null) {\n dictIds[i] = dictId;\n } else {\n for (IntArray rawKey : rawKeys) {\n rawKey._elements[i] = dictId;\n }\n }\n } else {\n if (rawKeys == null) {\n rawKeys = new IntArray[numValues];\n for (int j = 0; j < numValues; j++) {\n int dictId = multiValueDictIds[j];\n rawKeys[j] = new IntArray(dictIds.clone());\n rawKeys[j]._elements[i] = dictId;\n }\n } else {\n int currentLength = rawKeys.length;\n int newLength = currentLength * numValues;\n IntArray[] newRawKeys = new IntArray[newLength];\n System.arraycopy(rawKeys, 0, newRawKeys, 0, currentLength);\n for (int j = 1; j < numValues; j++) {\n int offset = j * currentLength;\n for (int k = 0; k < currentLength; k++) {\n newRawKeys[offset + k] = new IntArray(rawKeys[k]._elements.clone());\n }\n }\n for (int j = 0; j < numValues; j++) {\n int startOffset = j * currentLength;\n int dictId = multiValueDictIds[j];\n int endOffset = startOffset + currentLength;\n for (int k = startOffset; k < endOffset; k++) {\n newRawKeys[k]._elements[i] = dictId;\n }\n }\n rawKeys = newRawKeys;\n }\n }\n }\n }\n\n if (rawKeys == null) {\n return new IntArray[]{new IntArray(dictIds)};\n } else {\n return rawKeys;\n }\n }",
"public void setPixels(int bitsPerPixel, int colorMap[], int bytesPerRow,\n\n\tint numRows, int y, byte pixels[])\n\n\t{\n\n\tif(_awtImage == null) return;\n\tif (bitsPerPixel != 1 && bitsPerPixel != 4 && bitsPerPixel != 8)\n\n\t\treturn;\n\n\t// convert pixels to RGB values\n\n\tint rgb[] = new int[width * numRows];\n\n\tfor (int r = 0; r < numRows; r++)\n\n\t\tpixelsToRGB(bitsPerPixel, width, pixels, r * bytesPerRow,\n\n\t\t\trgb, r * width, colorMap);\n\n\tjava.awt.image.MemoryImageSource imageSource;\n\n\timageSource = new java.awt.image.MemoryImageSource(width, numRows, rgb, 0, width);\n\tif(imageSource == null) return;\n\n\tjava.awt.Toolkit awtToolkit = java.awt.Toolkit.getDefaultToolkit();\n\tif(awtToolkit == null) return;\n\n\tjava.awt.Image rowImage = awtToolkit.createImage(imageSource);\n\tif(rowImage == null) return;\n\n\tjava.awt.Graphics g = _awtImage.getGraphics();\n\tif(g == null) return;\n\n\tg.drawImage(rowImage, 0, y, null);\n\n\tg.dispose();\n\n\trowImage.flush();\n\n\t}",
"private void buildPKIndex() {\n // index PK\n Collection<DbAttribute> pks = getResolver()\n .getEntity()\n .getDbEntity()\n .getPrimaryKeys();\n this.idIndices = new int[pks.size()];\n\n // this is needed for checking that a valid index is made\n Arrays.fill(idIndices, -1);\n\n Iterator<DbAttribute> it = pks.iterator();\n for (int i = 0; i < idIndices.length; i++) {\n DbAttribute pk = it.next();\n\n for (int j = 0; j < columns.length; j++) {\n if (pk.getName().equals(columns[j].getName())) {\n idIndices[i] = j;\n break;\n }\n }\n\n // sanity check\n if (idIndices[i] == -1) {\n throw new CayenneRuntimeException(\"PK column is not part of result row: %s\", pk.getName());\n }\n }\n }",
"protected void setColorIndexOfPixel(final int x, final int y, final int width, final int clrIndex, final int alpha,\n final byte[] imagePixels, final byte[] imageAlphas) {\n int numColors = 32 * 32 * 32;\n int colorIndex = Math.max(clrIndex, 0);\n colorIndex = Math.min(colorIndex, numColors - 1);\n int pixelIndex = y * width + x;\n if (colorIndex >= 0 && colorIndex < numColors) {\n imagePixels[pixelIndex] = (byte) colorIndex;\n imageAlphas[pixelIndex] = (byte) alpha;\n } else {\n imageAlphas[pixelIndex] = Grid3dRenderer.FULLY_TRANSPARENT;\n }\n }",
"private void fillInMap(){\n // provide storage for each row of the inMap to indicate where to add the next location\n int[] curIndex = new int[inMap.length];\n int flatIndex;\n // fill matrix with -1, and the curIndex of each row with 0\n for (int i = 0; i < inMap.length; i++) {\n curIndex[i] = 0;\n for (int j = 0; j < inMap[0].length; j++) {\n for (int k = 0; k < inMap[0][0].length; k++){\n inMap[i][j][k] = -1;\n }\n }\n }\n\n // Iterate vertically (moving the filter)\n for (int i = 0; i + filterDim[0] <= inDim[1]; i += vertStride) {\n // Iterate horizontally (moving the filter)\n for (int j = 0; j + filterDim[1] <= inDim[2]; j += horStride) {\n // Iterate through layers of the filter\n for (int l = 0; l < inDim[0]; l++) {\n // Iterate through rows of the filter\n for (int r = 0; r < filterDim[0]; r++) {\n // Iterate through columns of the filter\n for (int c = 0; c < filterDim[1]; c++) {\n flatIndex = (l * (inDim[1] * inDim[2]) + (r + i) * inDim[2] + (c + j));\n inMap[flatIndex][curIndex[flatIndex]][0] = ((i / vertStride) * outDim[2] + (j / horStride));\n inMap[flatIndex][curIndex[flatIndex]][1] = l * filterDim[0] * filterDim[1] +\n r * filterDim[1] + c;\n curIndex[flatIndex]++;\n }\n }\n }\n }\n }\n }",
"void onSetMappedDataIndices(DrawableAnnotationPosition l, int[] idx);",
"protected void setColorIndexOfPixel(final int x, final int y, final int width, final ColorBar colorBar,\n final int clrIndex, final int alpha, final byte[] imagePixels, final byte[] imageAlphas) {\n int numColors = colorBar.getNumColors();\n int colorIndex = Math.max(clrIndex, 0);\n colorIndex = Math.min(colorIndex, numColors - 1);\n int pixelIndex = y * width + x;\n if (colorIndex >= 0 && colorIndex < numColors) {\n imagePixels[pixelIndex] = (byte) colorIndex;\n imageAlphas[pixelIndex] = (byte) alpha;\n } else {\n imageAlphas[pixelIndex] = Grid3dRenderer.FULLY_TRANSPARENT;\n }\n }",
"public void setPixels(int x, int y, int w, int h,\n int[] iArray, DataBuffer data) {\n int x1 = x + w;\n int y1 = y + h;\n\n if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width ||\n y < 0 || y >= height || h > height || y1 < 0 || y1 > height)\n {\n throw new ArrayIndexOutOfBoundsException\n (\"Coordinate out of bounds!\");\n }\n\n int lineOffset = y*scanlineStride + x;\n int srcOffset = 0;\n\n for (int i = 0; i < h; i++) {\n for (int j = 0; j < w; j++) {\n int value = data.getElem(lineOffset+j);\n for (int k=0; k < numBands; k++) {\n value &= ~bitMasks[k];\n int srcValue = iArray[srcOffset++];\n value |= ((srcValue << bitOffsets[k])\n & bitMasks[k]);\n }\n data.setElem(lineOffset+j, value);\n }\n lineOffset += scanlineStride;\n }\n }",
"public Map<ObservableList<String>, Integer> getRowToElementIdIndex() {\n return rowToElementIdIndex;\n }",
"final void buildIndices ()\n {\n if (!isEmpty())\n {\n\tindices = new int[count()];\n\tint index = 0;\n\tfor (int i = carrier.nextSetBit(0); i >= 0; i = carrier.nextSetBit(i+1))\t \n\t indices[index++] = i;\n }\n }",
"private void mapIndexes() {\n\t\tfastRecordGetter = new HashMap<>();\n\t\tfor(int i = 0, len = studentInfo.size(); i < len; i++) {\n\t\t\tfastRecordGetter.put(studentInfo.get(i).getJmbag(), i);\n\t\t}\n\t}",
"public void buildIndex() {\r\n \r\n \t\tSystem.out.println(\"BuildIndex\");\r\n \t\tmaxDepth = 0;\r\n \t\t\r\n \t\tif (indexData.size() == 0) {\r\n \t\t\treturn; // nothing to do\r\n \t\t}\r\n \t\t\r\n \t\tCollections.sort(indexData);\r\n \t\t\r\n \t\tint[][] pointers = new int[dimensionCount][50]; // max depth of 50 elements per dimension\r\n \t\tint[] lastDepth = new int[dimensionCount];\r\n \t\tString[][] lastKeys = new String[dimensionCount][50];\r\n \t\t\r\n \t\t// prefill pointers with -1, which means \"end\"\r\n \t\tfor (int di = 0; di < dimensionCount; di++) {\r\n \t\t\tfor (int elI = 0; elI < 50; elI++) {\r\n \t\t\t\tpointers[di][elI] = EOL;\r\n \t\t\t\tlastKeys[di][elI] = null;\r\n \t\t\t}\r\n \t\t}\r\n \t\tint max = indexData.size();\r\n \r\n \t\tKey lastKey = indexData.get(max - 1).getKey();\r\n \t\t// populate lastKeys\r\n \t\tfor (int di = 0; di < dimensionCount; di++) {\r\n \t\t\tIDimensionElement elm = lastKey.getDimensionElement(di);\r\n \t\t\tlastDepth[di] = elm.getDepth();\r\n \t\t\tint elI = lastDepth[di] - 1;\r\n \t\t\twhile (elI >= 0) {\r\n \t\t\t\tString sKey = elm.getKey();\r\n \t\t\t\tlastKeys[di][elI] = sKey;\r\n \t\t\t\telm = elm.getParent();\r\n \t\t\t\telI--;\r\n \t\t\t}\r\n \t\t}\r\n \t\t\r\n \t\t// walk through the list and build pointers to the \"next\" element switch\r\n \t\tfor (int idx = max - 1; idx >=0; idx--) {\r\n \t\t\t\r\n \t\t\tIndexedData id = indexData.get(idx);\r\n \t\t\tKey key = id.getKey();\r\n \t\t\t// compare all elements\r\n \t\t\tint[][] nextEntry = new int[dimensionCount][0];\r\n \t\t\t\r\n \t\t\tboolean changed = false;\r\n \t\t\tfor (int di = 0; di < dimensionCount; di++) {\r\n \t\t\t\tIDimensionElement elm = key.getDimensionElement(di);\r\n \t\t\t\tint depth = elm.getDepth();\r\n \t\t\t\tif (depth > maxDepth) {\r\n \t\t\t\t\tmaxDepth = depth;\r\n \t\t\t\t}\r\n \t\t\t\t\r\n \t\t\t\t\r\n \t\t\t\tString[] path = new String[depth];\r\n \t\t\t\tfor (int ed = depth - 1; ed >= 0; ed--) {\r\n \t\t\t\t\tpath[ed] = elm.getKey();\r\n \t\t\t\t\telm = elm.getParent();\r\n \t\t\t\t}\r\n \t\t\t\t// now walk forward. This is needed to properly recognize\r\n \t\t\t\t// child key changes (i.e. 2010/Q1 vs. 2011/Q1)\r\n \r\n \t\t\t\t// now copy the pointers\r\n \t\t\t\tnextEntry[di] = new int[depth];\r\n \t\t\t\tfor (int ed = 0; ed < depth; ed++) {\r\n \t\t\t\t\tif (changed || !path[ed].equals(lastKeys[di][ed])) {\r\n \t\t\t\t\t\t// there is a change!\r\n \t\t\t\t\t\t//if (changed) {\r\n \t\t\t\t\t\t//\tpointers[di][ed] = -1; // set subsequent elements to -1\r\n \t\t\t\t\t\t//} else {\r\n \t\t\t\t\t\t\tpointers[di][ed] = idx + 1; // set to previous record\r\n \t\t\t\t\t\t//}\r\n \t\t\t\t\t\tlastKeys[di][ed] = path[ed];\r\n \t\t\t\t\t\tchanged = true;\r\n \t\t\t\t\t}\r\n \t\t\t\t\tnextEntry[di][ed] = pointers[di][ed];\r\n \t\t\t\t}\r\n \t\t\t\t\r\n \t\t\t\t\r\n \t\t\t}\r\n \t\t\tid.setNextEntry(nextEntry);\r\n \t\t\t\r\n \t\t}\r\n \t\tindexDirty = false; // no longer dirty\r\n \t}",
"private void setUpRouteIDsAndIndexes() {\n\n\n for (int i = 0; i < routeIDsOfBillboards.size(); i++) {\n\n List<Integer> routeIDs = routeIDsOfBillboards.get(i);\n\n for (int j = 0; j < routeIDs.size(); j++) {\n\n int routeID = routeIDs.get(j);\n routeIDSet.add(routeID);\n }\n }\n\n buildHash();\n\n for (int i = 0; i < routeIDsOfBillboards.size(); i++) {\n\n List<Integer> routeIndexes = new ArrayList<>();\n List<Integer> routeIDs = routeIDsOfBillboards.get(i);\n for (int j = 0; j < routeIDs.size(); j++) {\n\n int routeID = routeIDs.get(j);\n int routeIndex = (int) routeIDMap.get(routeID);\n routeIndexes.add(routeIndex);\n }\n routeIndexesOfBillboards.add(routeIndexes);\n }\n }",
"static void getIndexSetBits(int[] setBits, long board) {\n\t\tint onBits = 0;\n\t\twhile (board != 0) {\n\t\t\tsetBits[onBits] = Long.numberOfTrailingZeros(board);\n\t\t\tboard ^= (1L << setBits[onBits++]);\n\t\t}\n\t\tsetBits[onBits] = -1;\n\t}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Gets the value of the 'AB' field.
|
public java.lang.Double getAB() {
return AB;
}
|
[
"public String getAbb() {\n return (String) getAttributeInternal(ABB);\n }",
"public java.lang.Double getAB() {\n return AB;\n }",
"java.lang.String getAbn();",
"public String getB() {\n return b;\n }",
"public String getBAA001() {\n return BAA001;\n }",
"public String getAba() {\n return (String) getAttributeInternal(ABA);\n }",
"@java.lang.Override\n public godot.wire.Wire.AABB getAabbValue() {\n if (typeCase_ == 12) {\n return (godot.wire.Wire.AABB) type_;\n }\n return godot.wire.Wire.AABB.getDefaultInstance();\n }",
"public double getB() {\n String strB = textfieldB.getText();\n double sideB = Double.parseDouble(strB);\n return sideB;\n }",
"public static char getA() {\n char aChar = 'B';\n return aChar;\n }",
"public String getCDTBC_ABREVIATURA(){\n\t\treturn this.myCdtbc_abreviatura;\n\t}",
"public boolean hasAB() {\n return fieldSetFlags()[12];\n }",
"java.lang.String getSbDFValue();",
"public java.lang.String getAbdomin () {\n\t\treturn abdomin;\n\t}",
"public String getBRIEF_NAME_ARAB()\r\n {\r\n\treturn BRIEF_NAME_ARAB;\r\n }",
"public java.lang.CharSequence getField88() {\n return field88;\n }",
"public String getBENEF_ACC() {\r\n return BENEF_ACC;\r\n }",
"public String getsBChar() {\n\t\treturn sBChar;\n\t}",
"public int getB() {\r\n return b;\r\n }",
"public java.lang.CharSequence getField988() {\n return field988;\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Gets the value of the gamma property.
|
public double getGamma() {
return gamma;
}
|
[
"public float getGamma() {\n\t\treturn gamma;\n\t}",
"public float getGamma();",
"double getGamma();",
"public void setGamma(float gamma);",
"public double getLightAbsorptionCoefficient(){\n return gamma;\n }",
"public FloatColumn getCellGamma() {\n return delegate.getColumn(\"cell_gamma\", DelegatingFloatColumn::new);\n }",
"public java.lang.Float getPuppiGammaIso() {\n return puppiGammaIso;\n }",
"public java.lang.Float getPuppiGammaIso() {\n return puppiGammaIso;\n }",
"public double getGpaValue() {\n return gpaValue;\n }",
"public static double gamma(double x) {\n double xcopy = x;\n double first = x + LANCZOS_SMALL_GAMMA + 0.5;\n double second = LANCZOS_COEFF[0];\n double fg = 0.0;\n\n if (x >= 0.0) {\n if (x >= 1.0 && x - (int) x == 0.0) {\n fg = Math.factorial((int) x - 1);\n } else {\n first = Math.pow(first, x + 0.5) * Math.exp(-first);\n for (int i = 1; i <= LANCZOS_N; i++) {\n second += LANCZOS_COEFF[i] / ++xcopy;\n }\n fg = first * Math.sqrt(2.0 * Math.PI) * second / x;\n }\n } else {\n fg = -Math.PI / (x * gamma(-x) * Math.sin(Math.PI * x));\n }\n return fg;\n }",
"public void setLightAbsorptionCoefficient(double gamma){\n this.gamma = gamma;\n }",
"public double getGpa(){\n return this.gpa;\n }",
"static public double computeBetaFromGamma(double gamma) {\n double beta = Math.sqrt(1.0 - 1.0/(gamma*gamma));\n\n return beta;\n }",
"public java.lang.Long getNSignalGamma() {\n return nSignalGamma;\n }",
"public java.lang.Long getNSignalGamma() {\n return nSignalGamma;\n }",
"public float getGamma(int component)\n {\n short[] data;\n switch (component)\n {\n case REDCOMPONENT:\n\tdata = getCurve(icSigRedTRCTag);\n\tbreak;\n case GREENCOMPONENT:\n\tdata = getCurve(icSigGreenTRCTag);\n\tbreak;\n case BLUECOMPONENT:\n\tdata = getCurve(icSigBlueTRCTag);\n\tbreak;\n default:\n\tthrow new IllegalArgumentException(\"Not a valid component\");\n }\n if (data == null)\n throw new IllegalArgumentException(\"Error reading TRC\");\n\n if (data.length != 1)\n throw new ProfileDataException(\"Not a single-gamma TRC\");\n\n // convert the unsigned 7.8 fixed-point gamma to a float.\n float gamma = (float) (((int) data[0] & 0xFF00) >> 8);\n double fraction = ((int) data[0] & 0x00FF) / 256.0;\n gamma += (float) fraction;\n return gamma;\n }",
"public Double getFGA() {\n return FGA;\n }",
"public float gpa() {\n\t\tif (Float.isNaN(this.gpa) || this.gpa == 0.0f) {\n\t\t\tthis.calculateGpa();\t\t\t\n\t\t}\n\t\t\n\t\treturn this.gpa;\n\t}",
"@Test\n public void testGamma() {\n System.out.println(\"gamma\");\n Assert.assertTrue(Double.isInfinite(Gamma.gamma(0)));\n Assert.assertEquals(1.0, Gamma.gamma(1), 1.0E-7);\n Assert.assertEquals(1.0, Gamma.gamma(2), 1.0E-7);\n Assert.assertEquals(2.0, Gamma.gamma(3), 1.0E-7);\n Assert.assertEquals(6.0, Gamma.gamma(4), 1.0E-7);\n Assert.assertEquals(0.886227, Gamma.gamma(1.5), 1.0E-6);\n Assert.assertEquals(1.32934, Gamma.gamma(2.5), 1.0E-6);\n Assert.assertEquals(3.323351, Gamma.gamma(3.5), 1.0E-6);\n Assert.assertEquals(11.63173, Gamma.gamma(4.5), 1.0E-5);\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Converts a line,offset pair into an x,y (pixel) point relative to the upper left corner (0,0) of the text area.
|
public Point offsetToXY(int line, int offset, Point retVal)
{
if(!displayManager.isLineVisible(line))
return null;
int screenLine = chunkCache.getScreenLineOfOffset(line,offset);
if(screenLine == -1)
return null;
FontMetrics fm = painter.getFontMetrics();
retVal.y = screenLine * fm.getHeight();
ChunkCache.LineInfo info = chunkCache.getLineInfo(screenLine);
retVal.x = (int)(horizontalOffset + Chunk.offsetToX(
info.chunks,offset));
return retVal;
}
|
[
"public Point offsetToXY(int line, int offset)\r\n\t{\r\n\t\treturn offsetToXY(line,offset,new Point());\r\n\t}",
"private int convertLocation(int x, int y) {\n\tchar[] text = _pa.getText().toCharArray();\n\tint c = 0;\n\tint curX = 0;\n\tint curY = 0;\n\n\ttry {\n\t while (curX != x || curY != y) {\n\t\tif (text[c] == '\\n') {\n\t\t curX++;\n\t\t curY = 0;\n\t\t} else {\n\t\t curY++;\n\t\t}\n\t\tc++;\n\t }\n\t} catch (ArrayIndexOutOfBoundsException oobex) {\n\t c = -1;\n\t}\n\treturn c;\n }",
"int LineSetPos(int id, int x1, int y1, int x2, int y2);",
"private void drawOffsetLine(Graphics g, double x1, double y1, double x2, double y2, double offset)\n {\n double alpha = Math.atan2(y2-y1, x2-x1) - Math.PI/2; //90 degree offset of angle of line\n int line1X1 = (int)(x1 + offset * Math.cos(alpha));\n int line1Y1 = (int)(y1 + offset * Math.sin(alpha));\n int line1X2 = (int)(x2 + offset * Math.cos(alpha));\n int line1Y2 = (int)(y2 + offset * Math.sin(alpha));\n\n g.drawLine(line1X1, line1Y1, line1X2, line1Y2);\n\n }",
"int TextSetPos(int id, int x, int y);",
"public int getOffsetForLine(int lineNum);",
"private int printCentered(String line, Font font, int x, int y) {\n final float LINE_HEIGHT_MULT = 1.2f;\n img.setFont(font);\n Graphics g = img.getAwtImage().getGraphics();\n g.setFont(font);\n FontMetrics fm = g.getFontMetrics();\n x += (img.getWidth() - fm.stringWidth(line)) / 2;\n y += Math.round(fm.getHeight() * LINE_HEIGHT_MULT);\n img.drawString(line, x, y);\n return y;\n }",
"public static Point getTextRowColAt(LwTextRender render, int x, int y)\n {\n int size = render.getTextModel().getSize();\n if (size == 0) return null;\n\n int lineHeight = render.getLineHeight();\n int lineIndent = render.getLineIndent();\n int lineNumber = (y<0)?0:(y + lineIndent)/(lineHeight + lineIndent) +\n ((y + lineIndent)%(lineHeight + lineIndent)>lineIndent?1:0) - 1;\n\n if (lineNumber >= size) return new Point (size - 1, render.getLine(size - 1).length());\n else\n if (lineNumber < 0) return new Point();\n\n if (x < 0) return new Point(lineNumber, 0);\n\n int x1 = 0, x2 = 0;\n String s = render.getLine(lineNumber);\n for(int c = 0; c < s.length(); c++)\n {\n x1 = x2;\n x2 = render.substrWidth(s, 0, c + 1);\n if (x >= x1 && x < x2) return new Point(lineNumber, c);\n }\n return new Point (lineNumber, s.length());\n }",
"private int computeLineOffset() {\r\n\t\tint offset = 0;\r\n\t\tif (lineCount - lines > 0) {\r\n\t\t\tif (y + lines < lineCount) {\r\n\t\t\t\toffset = y;\r\n\t\t\t} else {\r\n\t\t\t\toffset = lineCount - lines;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn offset;\r\n\t}",
"public static int[] getInitialPosition(String line) {\n String[] sizeGridTab = line.split(\" \");\n int xPosition = Integer.parseInt(sizeGridTab[0]);\n int yPosition = Integer.parseInt(sizeGridTab[1]);\n return new int[]{xPosition, yPosition};\n\n }",
"public void calculateXYPosition();",
"int getLineOffset(int line) throws BadLocationException;",
"private Point2D computeLayoutOrigin() {\r\n\r\n\t\tDimension size = getSize();\r\n\r\n\t\tPoint2D.Float origin = new Point2D.Float();\r\n\r\n\t\torigin.x = (float) (size.width - textLayout.getAdvance()) / 2;\r\n\t\torigin.y = (float) (size.height - textLayout.getDescent() + textLayout\r\n\t\t\t\t.getAscent()) / 2;\r\n\r\n\t\treturn origin;\r\n\t}",
"private Point2D computeLayoutOrigin() {\n Dimension size = getSize();\n Point2D.Float origin = new Point2D.Float();\n origin.x = (size.width - textLayout.getAdvance()) / 2;\n origin.y = (size.height - textLayout.getDescent() + textLayout.getAscent()) / 2;\n return origin;\n }",
"private Point2D computeLayoutOrigin() {\n Dimension size = getSize();\n Point2D.Float origin = new Point2D.Float();\n origin.x = (float) (size.width - textLayout.getAdvance()) / 2;\n origin.y = (float) (size.height - textLayout.getDescent() + textLayout.getAscent()) / 2;\n return origin;\n }",
"public int getYOffset();",
"private int findLineOffset(int line) {\n if (line == 1) {\n return 0;\n }\n if (line > 1 && line <= lineOffsets.size()) {\n return lineOffsets.get(line - 2);\n }\n return -1;\n }",
"Integer getYOFFSET();",
"public int getXOffset();"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Sets the value of the 'field665' field.
|
public void setField665(java.lang.CharSequence value) {
this.field665 = value;
}
|
[
"public com.maxpoint.cascading.avro.TestExtraLarge.Builder setField665(java.lang.CharSequence value) {\n validate(fields()[665], value);\n this.field665 = value;\n fieldSetFlags()[665] = true;\n return this; \n }",
"public void setField667(java.lang.CharSequence value) {\n this.field667 = value;\n }",
"public com.maxpoint.cascading.avro.TestExtraLarge.Builder setField658(java.lang.CharSequence value) {\n validate(fields()[658], value);\n this.field658 = value;\n fieldSetFlags()[658] = true;\n return this; \n }",
"public void setField668(java.lang.CharSequence value) {\n this.field668 = value;\n }",
"public void setField663(java.lang.CharSequence value) {\n this.field663 = value;\n }",
"public void setField658(java.lang.CharSequence value) {\n this.field658 = value;\n }",
"public com.maxpoint.cascading.avro.TestExtraLarge.Builder setField668(java.lang.CharSequence value) {\n validate(fields()[668], value);\n this.field668 = value;\n fieldSetFlags()[668] = true;\n return this; \n }",
"public void setField687(java.lang.CharSequence value) {\n this.field687 = value;\n }",
"public com.maxpoint.cascading.avro.TestExtraLarge.Builder setField663(java.lang.CharSequence value) {\n validate(fields()[663], value);\n this.field663 = value;\n fieldSetFlags()[663] = true;\n return this; \n }",
"public com.maxpoint.cascading.avro.TestExtraLarge.Builder setField678(java.lang.CharSequence value) {\n validate(fields()[678], value);\n this.field678 = value;\n fieldSetFlags()[678] = true;\n return this; \n }",
"public com.maxpoint.cascading.avro.TestExtraLarge.Builder setField687(java.lang.CharSequence value) {\n validate(fields()[687], value);\n this.field687 = value;\n fieldSetFlags()[687] = true;\n return this; \n }",
"public void setField666(java.lang.CharSequence value) {\n this.field666 = value;\n }",
"public com.maxpoint.cascading.avro.TestExtraLarge.Builder setField232(java.lang.CharSequence value) {\n validate(fields()[232], value);\n this.field232 = value;\n fieldSetFlags()[232] = true;\n return this; \n }",
"public void setField567(java.lang.CharSequence value) {\n this.field567 = value;\n }",
"public com.maxpoint.cascading.avro.TestExtraLarge.Builder setField654(java.lang.CharSequence value) {\n validate(fields()[654], value);\n this.field654 = value;\n fieldSetFlags()[654] = true;\n return this; \n }",
"public com.maxpoint.cascading.avro.TestExtraLarge.Builder setField230(java.lang.CharSequence value) {\n validate(fields()[230], value);\n this.field230 = value;\n fieldSetFlags()[230] = true;\n return this; \n }",
"public java.lang.CharSequence getField665() {\n return field665;\n }",
"public com.maxpoint.cascading.avro.TestExtraLarge.Builder setField693(java.lang.CharSequence value) {\n validate(fields()[693], value);\n this.field693 = value;\n fieldSetFlags()[693] = true;\n return this; \n }",
"public com.maxpoint.cascading.avro.TestExtraLarge.Builder setField574(java.lang.CharSequence value) {\n validate(fields()[574], value);\n this.field574 = value;\n fieldSetFlags()[574] = true;\n return this; \n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
This method was generated by MyBatis Generator. This method returns the value of the database column list.title_key
|
public String getTitle_key() {
return title_key;
}
|
[
"public List getTitle()\r\n {\r\n return get(getTitleId());\r\n }",
"String getTitle_id();",
"public java.lang.String getTitle() {\n\t\treturn getValue(org.jooq.examples.mysql.sakila.tables.FilmList.FILM_LIST.TITLE);\n\t}",
"protected String getKeyColumn()\n \t{\n \t\treturn p_keyColumn;\n \t}",
"public ObjectId getTitleId() {\n return getValue(\"titleId\", ObjectId.FACTORY);\n }",
"String getKeyColumn();",
"org.apache.calcite.avatica.proto.Common.DatabaseProperty getKey();",
"public String getKeycolumn();",
"public HexString getTitleId() {\n return titleId;\n }",
"@Override\n\tpublic long getTitleId() {\n\t\treturn _comment.getTitleId();\n\t}",
"public String getLocalizedTitleKey() { return localizedTitleKey;}",
"public int getAudit_name_title_id() {\n return audit_name_title_id;\n }",
"String getMetaDataKeyName();",
"public String listTitle();",
"public String getKeyName(){\n\n //returns the value of the keyName field\n return this.keyName;\n }",
"public com.zfoo.protocol.packet.ProtobufObject.ListListObjectA getKey() {\n return key_ == null ? com.zfoo.protocol.packet.ProtobufObject.ListListObjectA.getDefaultInstance() : key_;\n }",
"public String getTitle() {\r\n return (String) get(\"title\");\r\n }",
"public long getTitlesId();",
"public java.lang.String getTitleCode() {\n return titleCode;\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Sets i'th member of team to be the specified agent
|
public void setAgent(int i, Agent a) { scenario.team.agents.set(i, a); }
|
[
"public void setTeam(int i){\n\t\tteam = i;\n\t}",
"public void setAgent(IAgent agent);",
"public void setAgent(Integer agent) {\r\n this.agent = agent;\r\n }",
"public void setAgentArray(int i, org.biocatalogue.x2009.xml.rest.Agent agent)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.biocatalogue.x2009.xml.rest.Agent target = null;\r\n target = (org.biocatalogue.x2009.xml.rest.Agent)get_store().find_element_user(AGENT$0, i);\r\n if (target == null)\r\n {\r\n throw new IndexOutOfBoundsException();\r\n }\r\n target.set(agent);\r\n }\r\n }",
"public void setAgent(Agent[] arr) { scenario.team = new EquiTeam(arr); }",
"public void sendSetTeam(final String team);",
"public void setAgent(Agent agent) {\n\t\tthis.agent = agent;\n\t}",
"public void setTeam(Team team) {\r\n\t\tthis.team = team;\r\n\t}",
"public void setActor(Actor actor);",
"private void setCurrentTeam(String teamChosen) {\n for (Team team : mTeams.getTeams()) {\n if (team.getTeamName().equals(teamChosen)) {\n mCurrentTeam = team;\n }\n }\n }",
"public abstract void setAgentDestination(Agent agent);",
"public void setTeam(Team team, int teamSlot){ //teamSlot is the position in the array -1\n this.teams[teamSlot-1]=team;\n }",
"void setWinningTeam(TeamId winner) {\n winningTeam.set(winner);\n }",
"public void setfShipTeam(int _team){\n \tthis.fShipTeam = _team;\n }",
"public void setEnemy(Enemy enemy) {\n this.enemy = enemy;\n }",
"public synchronized void setTeamID(int teamID){this.teamID = teamID;}",
"public void setEnemy(Enemy enemy){ this.enemy = enemy; }",
"public void setTeam(String team){\r\n\t\tthis.team = team;\r\n\t}",
"public void setTeam(String team) {\r\n this.team = team;\r\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Returns the (optional) IDE Structure parameter. If none is set an instance is prepared with defaults for a bilevel image.
|
public IDEStructureParameter needIDEStructureParameter() {
if (this.ideStructureParameter == null) {
setIDEStructureParameter(new IDEStructureParameter());
}
return getIDEStructureParameter();
}
|
[
"public IDEStructureParameter getIDEStructureParameter() {\n return this.ideStructureParameter;\n }",
"public void setIDEStructureParameter(IDEStructureParameter parameter) {\n this.ideStructureParameter = parameter;\n }",
"public Parameter getParameter() {\n FlaggedOption result = new FlaggedOption(this.getId());\n\n result.setShortFlag(this.getShortflag());\n result.setLongFlag(this.getLongflag());\n result.setRequired(this.getRequired());\n result.setList(this.getIslist());\n if (this.declaredListSeparator()) {\n result.setListSeparator(this.getListseparator());\n }\n if (this.declaredAllowMultipleDeclarations) {\n result.setAllowMultipleDeclarations(this.allowMultipleDeclarations);\n }\n setupStringParser(result);\n result.setDefault(this.getDefaults());\n return (result);\n }",
"IFMLParameter createIFMLParameter();",
"ParameterStructInstance createParameterStructInstance();",
"ParameterableElement getOwnedDefault();",
"private JPanel getJPanelSetParameter() {\n\t\tif (jPanelSetParameter == null) {\n\t\t\tGridBagConstraints gridBagConstraints = new GridBagConstraints();\n\t\t\tgridBagConstraints.gridx = -1;\n\t\t\tgridBagConstraints.gridy = -1;\n\t\t\tjPanelSetParameter = new JPanel();\n\t\t\tjPanelSetParameter.setLayout(new GridBagLayout());\n\t\t\tjPanelSetParameter.add(getJPanelSetParameterAlgoritma(), gridBagConstraints);\n\t\t}\n\t\treturn jPanelSetParameter;\n\t}",
"Parameter createParameter();",
"public Structure getSelectedStructure() {\n return selectedStructure;\n }",
"Param createParam();",
"ParameterDef createParameterDef();",
"static XMLParameter getParameter(Distribution.Parameter distrPar) {\r\n \t\t\tObject valueObj = distrPar.getValue();\r\n \r\n \t\t\tif (valueObj != null) {\r\n \r\n \t\t\t\tif (distrPar.getValue() instanceof Distribution) {\r\n \r\n \t\t\t\t\tXMLParameter[] distribution = getDistributionParameter((Distribution) valueObj);\r\n \t\t\t\t\tXMLParameter returnValue = new XMLParameter(\r\n \t\t\t\t\t\t\tdistrPar.getName(), distributionContainerClasspath,\r\n \t\t\t\t\t\t\tnull, new XMLParameter[] { distribution[0],\r\n \t\t\t\t\t\t\t\t\tdistribution[1] }, true);\r\n \t\t\t\t\t/*\r\n \t\t\t\t\t * although this parameter contains several others, array\r\n \t\t\t\t\t * attribute must be set to \"false\", as their type are not\r\n \t\t\t\t\t * neccessarily equal\r\n \t\t\t\t\t */\r\n \t\t\t\t\treturnValue.parameterArray = \"false\";\r\n \t\t\t\t\treturn returnValue;\r\n \t\t\t\t} else {\r\n \t\t\t\t\tString value = valueObj.toString();\r\n \t\t\t\t\treturn new XMLParameter(distrPar.getName(), distrPar\r\n \t\t\t\t\t\t\t.getValueClass().getName(), null, value, true);\r\n \t\t\t\t}\r\n \r\n \t\t\t}\r\n \r\n \t\t\treturn null;\r\n \t\t}",
"public IParameter getInstance(String type){\n if(!initialized)\n throw new IllegalStateException(\"constructor never finished\");\n Class klass=(Class)paramList.get(type);\n if(klass==null)\n return null;\n else\n return getInstance(klass,false);\n }",
"Parameter getParameter();",
"ComponentParameterInstance createComponentParameterInstance();",
"public String getParamsoftwareimage() {\n\t\treturn this.paramsoftwareimage;\n\t}",
"protected Object getUiParameter(UIParameter key) {\n return null == uiCfg ? null : uiCfg.getParameter(key);\n }",
"private String getOptionalParameter(String name, Element elem) {\r\n\t\ttry {\r\n\t\t\treturn getRequieredParameter(name, elem);\r\n\t\t} catch (Ptolemy3DException e) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}",
"public abstract int getParameterValueMode();"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
EXTENSION method for finding hidden facets per class
|
public List<Resource> hiddenFacets(Set<?> forClasses) {
Vector<Resource> out = new Vector<Resource>();
if (this._facets.hasDefaultSet()) {
for (Iterator<Facet> fi = this._facets.getDefaultSet().hideIterator(); fi.hasNext(); ) {
out.add(fi.next().getIdentifier());
}
}
if (null != forClasses) {
for (Iterator<?> it = forClasses.iterator(); it.hasNext(); ) {
Iterator<FacetSet> fsi = this._facets.getFacetSetIterator((Resource) it.next());
if (null != fsi) {
while (fsi.hasNext()) {
for (Iterator<Facet> fi = fsi.next().hideIterator(); fi.hasNext(); ) {
Facet nextF = fi.next();
if (!out.contains(nextF))
out.add(nextF.getIdentifier());
}
}
}
}
}
return out;
}
|
[
"public Hashtable getFacets() {\n }",
"protected HashMap<Class<? extends TransformClassifier>, Boolean> getVisibleClassifiers() {\n if (visibleClassifiers == null) getClassifiers(); //Init visible classifiers\n return visibleClassifiers;\n }",
"public abstract Collection<FeedProvider> getVisibleFeedProviders();",
"public List<Facet> facets() {\n return this.facets;\n }",
"public Class<? extends Facet>[] facetTypes() {\r\n return facetHolder.getFacetTypes();\r\n }",
"public List<int[]> getFacets() {\n return facets;\n }",
"public Set<Trait> getVisibleTraits(){\n\t\tSet<Trait> traitSet = new HashSet<Trait>();\n\t\tfor(Trait trait : traits){\n\t\t\tif(isVisible(trait)){\n\t\t\t\ttraitSet.add(trait);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn traitSet;\n\t}",
"String[] getFacets(Object object);",
"public native String[] getFacetsHavingSelection() /*-{\r\n var self = this.@com.smartgwt.client.widgets.BaseWidget::getOrCreateJsObj()();\r\n var facets = self.getFacetsHavingSelection();\r\n if (facets == null) return null;\r\n return @com.smartgwt.client.util.JSOHelper::convertToArray(Lcom/google/gwt/core/client/JavaScriptObject;)(facets);\r\n }-*/;",
"public HashSet<Vehicle> getVisibleVehicles() {\r\n\t\tif (!visibleVehiclesFound) {\r\n\t\t\t// Set Detection rectangle\r\n\t\t\tneighborDetectionRegion.x1 = vehicle.pos.x\r\n\t\t\t\t\t- neighborDetectionRadius;\r\n\t\t\tneighborDetectionRegion.y1 = vehicle.pos.y\r\n\t\t\t\t\t- neighborDetectionRadius;\r\n\t\t\tneighborDetectionRegion.x2 = vehicle.pos.x\r\n\t\t\t\t\t+ neighborDetectionRadius;\r\n\t\t\tneighborDetectionRegion.y2 = vehicle.pos.y\r\n\t\t\t\t\t+ neighborDetectionRadius;\r\n\t\t\tneighborDetectionRegion.ensureOrder();\r\n\t\t\t\r\n\t\t\tcalculateNeighbobors(vehicle, visibleVehicles,\r\n\t\t\t\t\tneighborDetectionRegion);\r\n\t\t\t// Remove self\r\n\t\t\t//visibleVehicles.remove(vehicle);\r\n\r\n\t\t\tvisibleVehiclesFound = true;\r\n\t\t}\r\n\t\treturn visibleVehicles;\r\n\t}",
"public IScapSyncSearchFacet[] getFacets();",
"public abstract int getHiddenLayerCount();",
"List<IShape> getVisibleShapes();",
"private List<Facet<P>> getFacetsFromResponse(final QueryResponse queryResponse) {\n if (queryResponse.getFacetFields() != null) {\n List<FacetField> facetFields = queryResponse.getFacetFields();\n List<Facet<P>> facets = Lists.newArrayListWithCapacity(facetFields.size());\n for (final FacetField facetField : facetFields) {\n P facetParam = solrField2ParamEnumMap.get(facetField.getName());\n Facet<P> facet = new Facet<P>(facetParam);\n\n List<Facet.Count> counts = Lists.newArrayList();\n if (facetField.getValues() != null) {\n for (final FacetField.Count count : facetField.getValues()) {\n String value = count.getName();\n if (Enum.class.isAssignableFrom(facetParam.type())) {\n value = SolrQueryUtils.getFacetEnumValue(facetParam, value);\n }\n counts.add(new Facet.Count(value, count.getCount()));\n }\n }\n facet.setCounts(counts);\n facets.add(facet);\n }\n return facets;\n }\n return Lists.newArrayList();\n }",
"public com.dc.util.mysolr.config.bean.query.Facets getFacets() {\r\n return this.facets;\r\n }",
"public LACClass getHiddenClazz()\n\t{\n\t\treturn instances.getClassByIndex(indexedHiddenClass);\n\t}",
"private Predicate<Parameter> hiddenParams() {\n return Parameter::isHidden;\n }",
"public abstract Set<? extends PlaceableNode> getHiddenNodes();",
"private void filter(ProgressIndicator progressIndicator) {\n int i = 0;\n\n if (getVisibleInfos() == null)\n setVisibleInfos(new ArrayList<TransformationInfo>());\n else getVisibleInfos().clear();\n\n //Don't do anything if the infos are null\n if (getInfos() == null) return;\n\n int progress = 1;\n for (TransformationInfo info : getInfos()) {\n\n if (progressIndicator.isCanceled()) return;\n progressIndicator.setFraction((double) progress / (double) getInfos().size());\n progress++;\n\n\n for (TransplantInfo transplant : info.getTransplants()) {\n transplant.setVisibility(TransplantInfo.Visibility.unclassified);\n for (TransformClassifier c : getClassifiers()) {\n c.getProperties().setComponent(this);\n //c.getProperties().setClassifier(c);\n\n float v;\n //the only way classification functions modify the score assigned\n //is by user input, therefore only user filters must be reclassified each time\n if (!c.isUserFilter() && transplant.isAlreadyClassified(c.getDescription())) {\n //retrieve classification already assignment to the transformation\n v = transplant.getClassification(c.getDescription());\n } else {\n // evaluates the transformation\n v = c.value(transplant);\n transplant.setClassification(c.getDescription(), v);\n }\n\n //sets the visibility on/off depending on the show intersection option\n if (v != 0) {\n if (isFilterVisible(c.getClass())) {\n transplant.setVisibility(TransplantInfo.Visibility.show);\n if (isFilterVisible(UNCLASSIFIED)) break;\n } else {\n transplant.setVisibility(TransplantInfo.Visibility.hide);\n if (!isFilterVisible(UNCLASSIFIED)) break;\n }\n }\n }\n //If no classification functions and was able to classify the transplant\n //then the transplant become unclassified and its visibility is assignment depending\n //on a special case of classification function\n if (transplant.getVisibility() == TransplantInfo.Visibility.unclassified) {\n TransplantInfo.Visibility vis = isFilterVisible(UNCLASSIFIED) ?\n TransplantInfo.Visibility.show : TransplantInfo.Visibility.hide;\n transplant.setVisibility(vis);\n }\n\n\n }\n\n if (info.hasVisibleTransplants()) getVisibleInfos().add(info);\n }\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Get the the StoredProcedureInfo based on the fully qualified procedure name
|
IStoredProcedureInfo getStoredProcedureInfoForProcedure(String fullyQualifiedProcedureName) throws Exception;
|
[
"SqlProcedureEngine getProcedureEngine(String name);",
"public String getProcedureName()\n {\n return procedureName;\n }",
"io.dstore.values.StringValueOrBuilder getProcedureNameOrBuilder();",
"public String getProcedureName() {\r\n return procedureName;\r\n }",
"public String getProcedureSQL();",
"io.dstore.values.StringValue getProcedureName();",
"public java.lang.String sqlStatementForGettingProcedureNames(){\n return null; //TODO codavaj!!\n }",
"SqlProcedureEngine getStaticProcedureEngine(String name);",
"public String getProcName() {\n return procName;\n }",
"public ProcedureDeclaration getProcedure(String procedure)\n {\n if(global.procedures.containsKey(procedure))\n return global.procedures.get(procedure);\n else\n throw new IllegalArgumentException(\"No Procedure called: \" + procedure);\n }",
"SqlProcedureEngine getDynamicProcedureEngine(String name, String sqlStatement);",
"org.hl7.fhir.Procedure getProcedure();",
"@Override\n\tpublic String getProcedureName(String procId)\n\t{\n\t\treturn m_models.getProcedureName(procId);\n\t}",
"io.dstore.values.StringValue getProcedureNames();",
"public String getProcedureTerm() throws SQLException {\n // per \"Programming ODBC for SQLServer\" Appendix A\n return \"stored procedure\";\n }",
"SqlProcedureEngine getCheckedProcedureEngine(String name);",
"ProcedureFactory getProcedureFactory();",
"public java.lang.String storedProcedureCatalogPattern(){\n return null; //TODO codavaj!!\n }",
"public java.lang.String getProcedureCodeName() {\r\n return procedureCodeName;\r\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Add the selected role to the user.
|
private void onAddRole() {
roleProxy.addRoleToUser(user, selectedRole);
}
|
[
"void addRoleToUser(int userID,int roleID);",
"public void addRole( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.add(this.model, this.getResource(), ROLE, value);\r\n\t}",
"public void addRole(java.lang.String value) {\r\n\t\tBase.add(this.model, this.getResource(), ROLE, value);\r\n\t}",
"void addRole(Role role, int principalId) throws TalentStudioException;",
"public void addRoleName( String roleName );",
"public void setRole(Role role);",
"public void setRole(java.lang.String value) {\n this.role = value;\n }",
"void setRole(String role);",
"public void setRole(final String value) {\n this.role = value;\n }",
"public GraphNode addRole(String role){\n\t\tInteger intValue = addElement(role, 2);\n\t\t//System.out.println(role + \" Added with : \" + intValue);\n\t\tGraphNode roleVar = new GraphNode(intValue, 2);\n\t\tauthGraph.addVertex(roleVar);\n\t\treturn roleVar;\n\t}",
"public void setRole(User.Role role) {\n this.role = role;\n }",
"public void addExtraRole(ExtraRole newRole){\n extraRoles.add(newRole);\n }",
"public void add(Role e) {\r\n \tsubordinates.addElement(e);\r\n }",
"public UserRole createRole(UserRole newRole);",
"public void setRole(long value) {\n this.role = value;\n }",
"public IBusinessObject addToRole(IIID useriid, IIID roleiid, int ordernum)\n throws OculusException;",
"public void addRole(Role role) {\n roles.removeIf(existingRole -> Objects.equals(existingRole.getCode(), role.getCode()));\n\n roles.add(role);\n role.getGroups().add(this);\n }",
"public String createNewRole(Role newRole);",
"public void setRole(Role _role){ role = _role; }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Gets a number of the most recent challenges
|
public static List<Challenge> getMostRecentChallenges(int number) {
String sql = "select * " +
"from challenges ORDER BY challenge_id DESC LIMIT " + number + ";";
RawSql rawSql = RawSqlBuilder.unparsed(sql)
.columnMapping("challenge_id", "challengeId")
.columnMapping("challenger_username", "challengerUsername")
.columnMapping("challenged_username", "challengedUsername")
.columnMapping("wager", "wager")
.columnMapping("odds", "odds")
.columnMapping("location", "location")
.columnMapping("time", "time")
.columnMapping("subject", "subject")
.columnMapping("winner", "winner")
.create();
Query<Challenge> query = Ebean.find(Challenge.class).setRawSql(rawSql);
List<Challenge> challengeList = query.findList();
return challengeList;
}
|
[
"public int getRecentCompares() {\n return this.recentCompares;\n }",
"long getNumberOfComparisons();",
"public int getNextIdeaNum() {\n int max = 0;\n String query = \"select max( ideaNumber ) from ideas\";\n DBQueryHandler dbQue = new DBQueryHandler();\n try {\n ResultSet rs = dbQue.doQuery(query);\n rs.next();\n max = rs.getInt(1);\n\n } catch (SQLException ex) {\n\n Logger.getLogger(UserQuery.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n return max;\n }",
"Integer getMaximumResults();",
"public List<Story> getLatestChallengesUndertaken() {\n return storyRepository.findTop50ByApprovedIsTrueOrderByLastUpdatedDesc();\n }",
"int getTopkimprovedCount();",
"public long getMaxComparisons() {\n return maxComparisons;\n }",
"public int getChallengesPoints() {\n return this.challengesPoints;\n }",
"public int getMaxTweetsForHashtags();",
"int getTopN();",
"String getMaximumRedeliveries();",
"int getHerwinCount();",
"public int maxFollowers();",
"int getRemainingResearchStations();",
"int getLastScore();",
"int getMaxExplainPlans();",
"public int getRemainingGuesses() {\n\t\treturn MAX_GUESSES - guessCounter;\n\t}",
"int getLastValidatorPowersCount();",
"public static int getMaxUnchoked() {\n\t\treturn unchoked_max;\n\t}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Private method that maintains min/max values against new incoming amounts
|
private void setMinMax(double amt) {
min = (min > 0) && (min <= amt) ? min : amt;
max = amt >= max ? amt : max;
}
|
[
"public void updateMinMax( ) {\r\n if( (data == null) || (data.size() < 1) ) {\r\n min = 0.0;\r\n max = 0.0;\r\n return;\r\n }\r\n\r\n min = data.get( 0 );\r\n max = data.get( 0 );\r\n\r\n for( int i = 1; i < data.size(); i++ ) {\r\n if( min > data.get( i ) )\r\n min = data.get( i );\r\n if( max < data.get( i ) )\r\n max = data.get( i );\r\n }\r\n\r\n }",
"public double[] updateAllowedMinMaxValuesFromDataRange() {\n min=getBaselineValue();\n max=getBaselineValue();\n for (int i=0;i<numericdata.length;i++) {\n if (numericdata[i]>max) max=numericdata[i];\n if (numericdata[i]<min) min=numericdata[i];\n } \n return new double[]{min,max}; \n }",
"public void testMinMax() {\n\n\t\tStats stats;\n\t\tstats = getStats();\n\n\t\t// start off with small values:\n\t\taddWeightedStats(stats, smallWeightedValues);\n\t\tdouble max_simple = getWeightedMax(smallWeightedValues);\n\t\tdouble min_simple = getWeightedMin(smallWeightedValues);\n\t\tassertEquals(\"Incorrect min!\", min_simple, stats.min);\n\t\tassertEquals(\"Incorrect max!\", max_simple, stats.max);\n\n\t\t// change min/max\n\t\tassertTrue(\"Assumption violated in testcase!\",\n\t\t\t\tmax_simple < getWeightedMax(weightedValues1));\n\t\tassertTrue(\"Assumption violated in testcase!\",\n\t\t\t\tmin_simple > getWeightedMin(weightedValues1));\n\t\taddWeightedStats(stats, weightedValues1);\n\t\tmax_simple = Math.max(max_simple, getWeightedMax(weightedValues1));\n\t\tmin_simple = Math.min(min_simple, getWeightedMin(weightedValues1));\n\t\tassertEquals(\"Incorrect min!\", min_simple, stats.min);\n\t\tassertEquals(\"Incorrect max!\", max_simple, stats.max);\n\n\t\t// check that min/max don't change if existing values have been added\n\t\taddWeightedStats(stats, weightedValues1);\n\t\tassertEquals(\"Incorrect min!\", min_simple, stats.min);\n\t\tassertEquals(\"Incorrect max!\", max_simple, stats.max);\n\n\t\t// add different values, but don't change min/max\n\t\taddWeightedStats(stats, weightedValues2);\n\t\t// keep track of min/max of values_added \\ values_subtracted\n\t\tdouble max_real = max_simple;\n\t\tdouble min_real = min_simple;\n\t\tmax_simple = Math.max(max_simple, getWeightedMax(weightedValues2));\n\t\tmin_simple = Math.min(min_simple, getWeightedMin(weightedValues2));\n\t\tassertEquals(\"Incorrect min!\", min_simple, stats.min);\n\t\tassertEquals(\"Incorrect max!\", max_simple, stats.max);\n\n\t\t// subtract existing values\n\t\tsubtractWeightedStats(stats, weightedValues2);\n\t\tassertEquals(\"Assumption violated in testcase!\", max_simple, max_real);\n\t\tassertEquals(\"Assumption violated in testcase!\", min_simple, min_real);\n\t\tassertTrue(\"Incorrect min!\", min_real >= stats.min && stats.min >= min_simple);\n\t\tassertTrue(\"Incorrect max!\", max_real <= stats.max && stats.max <= max_simple);\n\n\t\t// add values after subtracting\n\t\taddWeightedStats(stats, weightedValues3);\n\t\tmax_simple = Math.max(max_simple, getWeightedMax(weightedValues3));\n\t\tmin_simple = Math.min(min_simple, getWeightedMin(weightedValues3));\n\t\tmax_real = Math.max(max_real, getWeightedMax(weightedValues3));\n\t\tmin_real = Math.min(min_real, getWeightedMin(weightedValues3));\n\t\tassertTrue(\"Incorrect min!\", min_real >= stats.min && stats.min >= min_simple);\n\t\tassertTrue(\"Incorrect max!\", max_real <= stats.max && stats.max <= max_simple);\n\n\t\t// add bigger values\n\t\taddWeightedStats(stats, bigWeightedValues);\n\t\tmax_simple = Math.max(max_simple, getWeightedMax(bigWeightedValues));\n\t\tmin_simple = Math.min(min_simple, getWeightedMin(bigWeightedValues));\n\t\tassertEquals(\"Incorrect min!\", min_simple, stats.min);\n\t\tassertEquals(\"Incorrect max!\", max_simple, stats.max);\n\n\t\t// subtract bigger values\n\t\tsubtractWeightedStats(stats, weightedValues2);\n\t\tassertTrue(\"Assumption violated in testcase!\", max_simple > max_real);\n\t\tassertTrue(\"Assumption violated in testcase!\", min_simple < min_real);\n\t\tassertTrue(\"Incorrect min!\", min_real >= stats.min && stats.min >= min_simple);\n\t\tassertTrue(\"Incorrect max!\", max_real <= stats.max && stats.max <= max_simple);\n\t}",
"@Override\r\n public void setMinMax(Double min, Double max) {\r\n this.minIn = min;\r\n this.maxIn = max;\r\n }",
"public void updateMinMax(int value){\n //update min\n while(true){\n //if value is greater than whatever is in min just break right away\n int minVal = min.get();\n if(value >= minVal){\n break;\n }\n //try to update value only if minVal is in min\n boolean isSetSuccesful = min.compareAndSet(minVal, value);\n //if set was successful break from while loop else keep looping\n if(isSetSuccesful){\n break;\n }\n }\n \n //update max\n while(true){\n int maxVal = max.get();\n if(value <= maxVal){\n break;\n }\n boolean isSetSuccesful = max.compareAndSet(maxVal, value);\n if(isSetSuccesful){\n break;\n }\n }\n }",
"@Override\n public void setHighLowAmount(Float open, Float min, Float max) {\n iGraphView.setMinMaxValue(open, min, max);\n }",
"protected void checkMinMax(StreamParams streamParam, StreamParams streamFromList, int counter) {\n\t\tcounter++;\n\t\tlong temp = streamParam.getRxRate();\n\t\t// summs all streams for printing\n\t\tstreamParam.setRxRate((temp + streamFromList.getRxRate()));\n\t\t// Min&Max\n\t\tif (streamParam.getRxMinRate() > streamFromList.getRxRate()) {\n\t\t\tstreamParam.setRxMinRate(streamFromList.getRxRate());\n\t\t}\n\t\tif (streamParam.getRxMaxRate() < streamFromList.getRxRate()) {\n\t\t\tstreamParam.setRxMaxRate(streamFromList.getRxRate());\n\t\t}\n\t}",
"protected void mapValueToWithinBounds() {\n if (getAllele() != null) {\n \tFloat d_value = ( (Float) getAllele());\n if (d_value.isInfinite()) {\n // Here we have to break to avoid a stack overflow.\n // ------------------------------------------------\n return;\n }\n // If the value exceeds either the upper or lower bounds, then\n // map the value to within the legal range. To do this, we basically\n // calculate the distance between the value and the float min,\n // then multiply it with a random number and then care that the lower\n // boundary is added.\n // ------------------------------------------------------------------\n if (d_value.floatValue() > m_upperBound ||\n d_value.floatValue() < m_lowerBound) {\n RandomGenerator rn;\n if (getConfiguration() != null) {\n rn = getConfiguration().getRandomGenerator();\n }\n else {\n rn = new StockRandomGenerator();\n }\n setAllele(new Float((rn.nextFloat()\n * ((m_upperBound - m_lowerBound))) + m_lowerBound));\n }\n }\n }",
"private void updateMaxAndMinGraph(){\n //Les valeurs entrées précédement sont supprimées si elles existaient déjà\n graph.removeSeries(maxSeries);\n graph.removeSeries(minSeries);\n\n long maxTimeStamp = values.getValues()[values.getValues().length - 1].getTimeStamp();\n DataPoint[] maxTemperatureData = new DataPoint[2];\n DataPoint[] minTemperatureData = new DataPoint[2];\n\n //Ajout des valeurs\n maxTemperatureData[0] = new DataPoint(0, controller.getHighLimit());\n maxTemperatureData[1] = new DataPoint(maxTimeStamp, controller.getHighLimit());\n minTemperatureData[0] = new DataPoint(0, controller.getLowLimit());\n minTemperatureData[1] = new DataPoint(maxTimeStamp, controller.getLowLimit());\n\n //Ajout des données dans le graphique\n maxSeries = new LineGraphSeries<>(maxTemperatureData);\n maxSeries.setTitle(getResources().getString(R.string.maxTemperature));\n maxSeries.setColor(Color.BLUE);\n\n minSeries = new LineGraphSeries<>(minTemperatureData);\n minSeries.setTitle(getResources().getString(R.string.minTemperature));\n minSeries.setColor(Color.RED);\n\n graph.addSeries(maxSeries);\n graph.addSeries(minSeries);\n }",
"private void computeMaxAndMin() {\n if (mWeathers == null || mWeathers.size() <= 0) {\n return;\n }\n\n mMinTem = mWeathers.get(0).getTemperature();\n mMaxTem = mWeathers.get(0).getTemperature();\n for (int i = 1; i < mWeathers.size(); i++) {\n if (mMinTem > mWeathers.get(i).getTemperature()) {\n mMinTem = mWeathers.get(i).getTemperature();\n }\n\n if (mMaxTem < mWeathers.get(i).getTemperature()) {\n mMaxTem = mWeathers.get(i).getTemperature();\n }\n }\n }",
"private void calculateMinMaxPositions() {\n boundingVolume = null;\n if ( minMax == null ) {\n minMax = new double[6];\n\n double minX = Double.MAX_VALUE;\n double minY = Double.MAX_VALUE;\n double minZ = Double.MAX_VALUE;\n double maxX = -Double.MAX_VALUE;\n double maxY = -Double.MAX_VALUE;\n double maxZ = -Double.MAX_VALUE;\n int i;\n\n for ( i = 0; i < getNumVertices(); i++ ) {\n double x = vertexPositions[3*i+0];\n double y = vertexPositions[3*i+1];\n double z = vertexPositions[3*i+2];\n\n if ( x < minX ) minX = x;\n if ( y < minY ) minY = y;\n if ( z < minZ ) minZ = z;\n if ( x > maxX ) maxX = x;\n if ( y > maxY ) maxY = y;\n if ( z > maxZ ) maxZ = z;\n }\n minMax[0] = minX;\n minMax[1] = minY;\n minMax[2] = minZ;\n minMax[3] = maxX;\n minMax[4] = maxY;\n minMax[5] = maxZ;\n }\n }",
"public void resetMinMeasuredValue()\n {\n this.minMeasuredValue = getMaxValue();\n }",
"@Override\n public double[] getMinMax() {\n if ( minMax == null ) {\n calculateMinMaxPositions();\n }\n return minMax;\n }",
"public void initialiseExtremeValues() {\n for (int i = 0; i < numberOfObj; i++) {\n minimumValues[i] = Double.MAX_VALUE;\n maximumValues[i] = -Double.MAX_VALUE;\n }\n }",
"private double correctToRange(double value, double min, double max) {\r\n\t\t// If the value is below the range, set it equal to the minimum.\r\n\t\tif (value < min) {\r\n\t\t\treturn min;\r\n\t\t\t// If it is above the range, set it equal to the maximum.\r\n\t\t} else if (value > max) {\r\n\t\t\treturn max;\r\n\t\t}\r\n\t\t// Otherwise, it is in-range and no adjustments are needed.\r\n\t\treturn value;\r\n\t}",
"public void resetRange() {\r\n\r\n minimum = getDataMin();\r\n\r\n maximum = getDataMax();\r\n\r\n\r\n\r\n double madd = 0;\r\n\r\n double midd = 0;\r\n\r\n if (correctForCloseValues) {\r\n\r\n\r\n\r\n madd = ((maximum - minimum) * 2) / 100;\r\n\r\n midd = ((maximum - minimum) * 2) / 100;\r\n\r\n }\r\n\r\n //System.out.print(\"\\nexpanding bounds!\");\r\n\r\n\r\n\r\n maximum += madd;\r\n\r\n minimum -= midd;\r\n\r\n\r\n\r\n if (minimum == 0.0 && maximum == 0.0) {\r\n minimum = 0;\r\n maximum = 10;\r\n }\r\n\r\n\r\n\r\n\r\n\r\n }",
"public static void checkMinMax() {\r\n\t\tSystem.out.println(\"Beginning min/max test (should be -6 and 17)\");\r\n\t\tSortedIntList list = new SortedIntList();\r\n\t\tlist.add(5);\r\n\t\tlist.add(-6);\r\n\t\tlist.add(17);\r\n\t\tlist.add(2);\r\n\t\tSystem.out.println(\" min = \" + list.min());\r\n\t\tSystem.out.println(\" max = \" + list.max());\r\n\t\tSystem.out.println();\r\n\t}",
"private void newMax() {\n\t\tif (point.getID() != -1) {\n\n\t\t\t// calculating all 3 cases\n\t\t\tint case1 = left.maxval;\n\t\t\tint case2 = left.val + getP();\n\t\t\tint case3 = case2 + right.maxval;\n\t\t\tmaxval = Math.max(Math.max(case1, case2), case3);\n\n\t\t\tif (maxval == case1) {\n\t\t\t\temax = left.getEmax();\n\t\t\t} else if (maxval == case2) {\n\t\t\t\temax = point;\n\t\t\t} else if (maxval == case3) {\n\t\t\t\temax = right.getEmax();\n\t\t\t}\n\t\t}\n\t}",
"public SettingInteger setValidRange(int min, int max) { _minValue = min; _maxValue = max; return this; }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Sets the String group ID tag for this recommendation. Recommendations in the same group are ranked by the Home Screen together, and the sort order within a group is respected. This can be useful if the application has different sources for recommendations, like "trending", "subscriptions", and "new music" categories for YouTube, where the user can be more interested in recommendations from one group than another.
|
public void setGroup(@Nullable String groupTag) {
mGroup = groupTag;
}
|
[
"public void setGroup(String groupID) {\n _groupID = nullIfEmpty(groupID);;\n }",
"public void setGroupID(int groupID) {\n this.groupID = groupID;\n }",
"public void setGROUP_ID(String GROUP_ID) {\r\n this.GROUP_ID = GROUP_ID == null ? null : GROUP_ID.trim();\r\n }",
"public void setGroup_id(Integer group_id) {\n this.group_id = group_id;\n }",
"public Builder setGrpId(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n grpId_ = value;\n onChanged();\n return this;\n }",
"public void setChosenGroup(String group) {\n\t\tthis.chosenGroup = group;\n\t\tparentGroupInputText.setText(this.chosenGroup);\n\t}",
"public void setGroup(int group) {\r\n\t\tthis.group = group;\r\n\t}",
"public void setGroupID(int value) {\n this.groupID = value;\n }",
"public void setGroup_id(Long group_id) {\n this.group_id = group_id;\n }",
"public void setGroup(Group group) {\r\n this.group = group;\r\n }",
"public void setGroupId(String newValue);",
"public void setGroup(Group group) {\n this.group = group;\n }",
"public Builder setDispGrpId(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000010;\n dispGrpId_ = value;\n onChanged();\n return this;\n }",
"void setGroupId(int groupId);",
"public void setIdDomainGroup( Long idDomainGroup ) {\n this.idDomainGroup = idDomainGroup;\n }",
"public void setProduct_group(String product_group);",
"public void setBookGroup(java.lang.String value);",
"public abstract void setGroupIdentificationRegistration(TagContent grp)\r\n\t\t\tthrows TagFormatException;",
"@Override\n\tpublic void setGroupId(long groupId) {\n\t\t_dictData.setGroupId(groupId);\n\t}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Unsets the "encounter" element
|
public void unsetEncounter()
{
synchronized (monitor())
{
check_orphaned();
get_store().remove_element(ENCOUNTER$24, 0);
}
}
|
[
"void unsetEncounter();",
"public org.mhealth.open.data.avro.SObservation.Builder clearEncounter() {\n encounter = null;\n fieldSetFlags()[3] = false;\n return this;\n }",
"public void unsetEmbl()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(EMBL$10, 0);\r\n }\r\n }",
"public void unsetItalic()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(ITALIC$6, 0);\n }\n }",
"public void unsetExperiment()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(EXPERIMENT$0, 0);\r\n }\r\n }",
"public void unsetGenbank()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(GENBANK$8, 0);\r\n }\r\n }",
"void unsetValueSet();",
"public void unsetIncidentId()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(INCIDENTID$4, 0);\n }\n }",
"public void unsetPatient()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(PATIENT$2, 0);\n }\n }",
"public void unsetOrdinalID()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(ORDINALID$6, 0);\n }\n }",
"void unsetPatient();",
"public void unsetOccurrences()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(OCCURRENCES$14, 0);\n }\n }",
"public void unsetBank()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(BANK$0, 0);\n }\n }",
"void unsetXdescelement1();",
"public void unset(){\n\t\tcurrentInst = -1;\n\t}",
"public void resetAreaCurricular()\r\n {\r\n this.areaCurricular = null;\r\n }",
"void unsetIncidentId();",
"void unsetInventoryInd();",
"public void unsetCoverage()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_attribute(COVERAGE$4);\n }\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
AUXILIARY METHODS identify all bids that have expired from the retrieved bid requests data and close down each of the expired bid
|
private ArrayList<BidRequest> closeDownExpiredBids(ArrayList<BidRequest> retrievedBidRequests) {
ArrayList<BidRequest> expiredBidRequests = new ArrayList<>();
// need to check for those bids that have already expired, but are still stored as ALIVE in ur system
// this situation is normal because we did not update the bid status when app is offline
for (BidRequest bidRequest : retrievedBidRequests) {
if (!bidRequest.isStillAlive() && bidRequest.getStatus() == BidRequestStatus.ALIVE) {
expiredBidRequests.add(bidRequest);
}
}
// remove from retrievedBidRequests separately to prevent ConcurrentModificationException
retrievedBidRequests.removeIf(bid -> (expiredBidRequests.contains(bid)));
// for each expired bid requests, system will automatically close down them depending on the type and its bid offer
for (BidRequest expiredBid : expiredBidRequests) {
systemAutoCloseDownBidRequest(expiredBid);
}
// return the remaining alive bids
return retrievedBidRequests;
}
|
[
"public synchronized void closeAuction(){\n \tstatus = \"closed\";\n\n \ttry{\n \t\tif(last_bidder == null){\n \t\t\towner.getMessage(\"\\n Your Auction Item: \"+ ID +\", \"+ item_name +\" has closed with no bids \\n\");\n \t\t}\n \t\telse{\n \t\t\towner.getMessage(\"\\n Your Auction Item: \"+ ID +\", \"+ item_name +\" has a winner --> \"+ last_bidderName + \" Bid Price: \"+ start_price + \" Email: \"+ last_bidder.getEmail() +\"\\n\");\n \t\t\tfor(Entry<String, ClientInterface> entry : bids.entrySet()){\n \t\t\t\tClientInterface bidder = entry.getValue();\n \t\t\t\tif(bidder == last_bidder){\n \t\t\t\t\tlast_bidder.getMessage(\"\\n Congrats!!! You have won the bid for --> \"+ item_name+ \" at the price \" +start_price );\n \t\t\t\t}else{\n \t\t\t\t\tbidder.getMessage(\"\\n An Auction item --> \"+ item_name + \" you bid on was outbidded and won by\" + last_bidderName +\" for \"+ start_price +\"\\n\");\n \t\t\t\t}\n \t\t\t} \n \t\t}\n \t}catch(Exception e){\n \t\te.printStackTrace();\n \t}\n }",
"private void checkSecondPriceAuctions() {\n\n // Get all auctions of according type.\n TypedQuery<Auction> auctionByTypeQuery = getAuctionByTypeQuery(AuctionType.SECOND_PRICE);\n List<Auction> secondPriceResultList = auctionByTypeQuery.getResultList();\n\n // Get current timestamp for comparison.\n DateTime now = new DateTime(DateTimeZone.forID(\"Europe/Berlin\"));\n Date nowDate = now.toDate();\n\n // Filter all auctions that have timed out.\n List<Auction> timeoutSecondPriceAuctions = secondPriceResultList\n .stream()\n .filter(auction -> nowDate.compareTo(auction.getEndTime()) == 1 && auction.isRunning()).collect(Collectors.toList());\n\n // Check if there are any auction that have timed out.\n if (timeoutSecondPriceAuctions.size() > 0) {\n\n for (Auction auction : timeoutSecondPriceAuctions) {\n\n // Stop auction and get its bidders.\n auction.setRunning(false);\n List<Bid> auctionBids = new ArrayList<>();\n List<Bidder> bidder = auction.getBidder();\n\n // Continue only if there are any bidders.\n if (bidder.size() > 0) {\n\n for (Bidder bidderElem : bidder) {\n auctionBids.addAll(bidderElem.getBids());\n }\n\n // Find winner only if registered bidders have bidden.\n if (auctionBids.size() > 0) {\n\n // Sort bids ascending according to their value.\n auctionBids.sort(new BidComperator());\n Bid winningBid = auctionBids.get(0);\n\n // If there is only one bid the bidder has to pay the price\n // originally entered by the article owner, which is basically the second highest\n // amount possible.\n BigDecimal priceToPay = null;\n if (auctionBids.size() == 1) {\n priceToPay = auction.getPrice();\n } else {\n // If there is more than one bid, the winner is still the bidder with\n // the highest bid, but the price he has to pay is the second highest bid.\n priceToPay = auctionBids.get(1).getAmount();\n }\n\n // Get user from Liferay to have access to user related data such as name and mail address.\n long winningUserId = winningBid.getBidder().getUserId();\n try {\n\n User userById = UserLocalServiceUtil.getUserById(winningUserId);\n AuctionResult auctionResult = new AuctionResult();\n auctionResult.setDescription(auction.getArticle().getShortDesc());\n auctionResult.setPrice(priceToPay);\n auctionResult.setFirstName(userById.getFirstName());\n auctionResult.setSurname(userById.getLastName());\n auctionResult.setMail(userById.getEmailAddress());\n auctionResult.setAuctionType(auction.getAuctionType());\n entityManager.persist(auctionResult);\n } catch (Exception e) {\n\n entityManager.getTransaction().rollback();\n }\n }\n }\n }\n }\n }",
"@RequestMapping(value = \"/expiredPostingBidders\", method=RequestMethod.POST)\n\tpublic List<PostingBidder> getExpiredPostingBidders() {\n\t\tTimestamp now = new Timestamp(System.currentTimeMillis()+(60*60*1000));\t// 1 hour from now\n\t\treturn postingAuctionService.getExpiredPostingBidders(now.toString());\n\t}",
"public void removeExpiredAuctions(){\r\n ArrayList <String> expiredAuction = new ArrayList <String>(super.size());\r\n for(String expiredKey: keySet()){\r\n if(getAuction(expiredKey).getTimeRemaining() == 0){\r\n expiredAuction.add(expiredKey);\r\n }\r\n } \r\n for(String expiredKey: expiredAuction){\r\n super.remove(expiredKey);\r\n }\r\n }",
"@Override\n public List<Auction> getClosedAuctions() throws AuctionException {\n log.info(AUCTION_SERVICES + GET_CLOSED_AUCTIONS + \"find all the closed auctions\");\n\n List<Auction> openAuctions = auctionRepository.getOpenAuctions();\n if (isNull(openAuctions)) {\n log.error(AUCTION_SERVICES + GET_CLOSED_AUCTIONS + \" Null list with auctions\");\n throw new AuctionException(\"There are no closed auctions at the moment\");\n }\n log.info(AUCTION_SERVICES + GET_CLOSED_AUCTIONS + \"auctions found successfully \");\n return openAuctions;\n }",
"public void bidSuccessfulCheck() {\n for (int i = 0; i < itemList.size(); i++) {\n long secondsRemaining = TimeUnit.MILLISECONDS.toSeconds(itemList.get(i).getBidTimeRemaining() - System.currentTimeMillis());\n if (secondsRemaining == 0 && itemList.get(i).getAuctionActive()) {\n try {\n Item tempItem = itemList.get(i);\n tempItem.setAuctionActive(false);\n if (clients.get(tempItem.getSecretBidderKey()) != null) {\n clients.get(tempItem.getSecretBidderKey()).clientOutput.writeObject(new Object[]{Command.WinMessage, tempItem}); //send msg to agent that won\n }\n removeItemFromAuction(tempItem);\n Iterator it = clients.entrySet().iterator();\n while (it.hasNext()) {\n Map.Entry pair = (Map.Entry) it.next();\n clients.get(pair.getKey()).clientOutput.writeObject(new Object[]{Command.RefreshTimes});\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n }",
"private void placeBid() {\n // get active auctions\n List<Auction> activeAuctions = auctions.stream().filter(o -> o.getStatus().equals(Status.ACTIVE)).collect(Collectors.toList());\n\n if (activeAuctions.isEmpty()) {\n System.out.println(\"Sorry there ar currently no active auctions to bid on\");\n return;\n }\n\n int choice = 0;\n boolean isValid = false;\n // loop until they have chosen an active auction\n while (!isValid) {\n System.out.println(\"Please choose from the list of active auctions:\");\n browseAuction(auctions);\n\n choice = scanner.nextInt();\n\n if (choice > auctions.size() || choice == 0) {\n System.out.println(\"Sorry that auction doesn't exist,\");\n } else {\n isValid = true;\n }\n }\n\n // get the chosen auction\n Auction auction = activeAuctions.get((choice - 1));\n\n double minimum = 0.0;\n\n // get the current bids from the auction\n if (auction.getBids() != null) {\n List<Bid> bids = auction.getBids();\n\n // get the maximum bid out of the list of bids and set it as the minimum\n if (bids.size() > 0) {\n // get the maxmimum bid on the auction and set it as the minimum bid amount\n minimum = bids.stream().collect(Collectors.maxBy(Comparator.comparingDouble(Bid::getAmount))).get().getAmount();\n }\n }\n\n // set the bidding increments\n double maximum = minimum * 1.2;\n minimum *= 1.1;\n boolean validBid = false;\n\n if (maximum == 0) {\n maximum = auction.getReservePrice();\n }\n\n // loop until the bid is valid\n while (!validBid) {\n System.out.println(\"Please enter the amount you would like to bid between £\" + df.format(minimum) + \" and £\" + df.format(maximum));\n // get the bid\n double bid = scanner.nextDouble();\n\n if (bid <= maximum && bid >= minimum) {\n // valid bid\n validBid = true;\n // create the bid\n Bid userBid = new Bid(bid, (Buyer) loggedInUser, LocalDateTime.now());\n\n // place the bid onto the auction\n auction.placeBid(userBid);\n System.out.println(\"Your bid of £\" + df.format(bid) + \" has successfully been placed on the auction\");\n\n } else {\n // invalid bid\n System.out.println(\"Sorry that bid was invalid, lets try this again\");\n }\n }\n }",
"com.google.openrtb.OpenRtb.BidResponse getBidresponse();",
"public void removeExpiredAuctions() {\r\n\t\t\r\n\t\tSet<String> s = keySet();\r\n\t\t\r\n\t\tIterator<String> itr = s.iterator();\r\n\t\twhile (itr.hasNext()) {\r\n\t\t\tString auc = itr.next();\r\n\t\t\tAuction auction = get(auc);\r\n\t\t\tif (auction.getTimeRemaining() == 0)\r\n\t\t\t\titr.remove();\r\n\t\t}\r\n\t}",
"public void bid()\n {\n \tfor(APlayer p: aPlayers) // check that each player has 10 cards in hand\n \t{\n \t\tif(p.getHand().size() != CARDSINHAND)\n \t\t{\n \t\t\tthrow new GameException(\"Players must be dealt exactly 10 cards not \" + Integer.toString(p.getHand().size()) + \" before the player bids.\");\n \t\t}\n \t}\n aAllPasses = true;\n Bid[]lBids = new Bid[4];\n aContract = new Bid(); // default is pass\n Bid lBid = new Bid(); // last bid\n \n for(Team t : getTeams()) // make sure no team has a contract\n {\n \t\tt.setContract(new Bid());\n }\n \n aBids = new Bid[0]; // construct previousBids array to pass on to APlayer.selectBid\n \n for(int i = 0; i < aPlayers.length; i++)\n\t {\n \taCurrentPlayer = aPlayers[i];\n \tlBid = aPlayers[i].selectBid(aBids);\n\t\n \t// validate bid\n \tif(aBids.length > 0 && !lBid.isPass() && lBid.compareTo(Bid.max(aBids)) <= 0)\n \t{\n \t\t\tthrow new GameException(\"Player must make a higher bid or pass.\" + lBid +\" <= \" + Bid.max(aBids));\n \t}\n \t\n lBids[i] = lBid;\n aBids = Arrays.copyOf(lBids, i+1);\n\n // update contract if bid is not pass\n if (lBid.compareTo(aContract) > 0)\n {\n aContractor = aPlayers[i];\n aContract = lBid;\n aAllPasses = false;\n }\n notifyObservers(new Notification(\"game.engine\", this, getNotificationSequenceNumber(), State.newBid.toString()));\n\n\t } \n \n if(!allPasses())\n {\n\t // update contractor team\n\t Team lContractorTeam = getTeamFromPlayer(aContractor);\n\t lContractorTeam.setContract(aContract);\n\t // update dealer\n\t aDealer = aPlayers[0];\n\t notifyObservers(new Notification(\"game.engine\", this, getNotificationSequenceNumber(), State.newContract.toString()));\n }\n else\n {\n \tfor(APlayer p : aPlayers)\n \t{\n \t\tp.resetHand();\n \t}\n\t notifyObservers(new Notification(\"game.engine\", this, getNotificationSequenceNumber(), State.allPasses.toString()));\n }\n }",
"@Test\n\tpublic void getRejectedBids() {\n\t\tList<Bid> b = bidRepo.listOfRejectedBids(\"Rejected\");\n\t\tfor (Bid bid : b) {\n\t\t\tSystem.out.println(bid.getBidder().getBidderId() + \" \" + bid.getBidStatus());\n\t\t}\n\t}",
"private static BigInteger[] getBids() throws Exception {\n\t\tInputStream stream;\r\n\t\tBigInteger bids[] = new BigInteger[3];\r\n\t\tbyte[][] signatures = new byte[3][];\r\n\t\tbyte[] signature;\r\n\t\tboolean[] bidAccepted = new boolean[3];\r\n\t\t//for each bidder\r\n\t\tfor (int i=0; i < bidders.size(); i++) {\r\n\t\t\tstream=(bidders.get(i)).getInputStream();\r\n\t\t\t//get their bid\r\n\t\t\tbids[i] = cryptoMessaging.recvBigInteger(stream);\r\n\t\t\t//get their signature\r\n\t\t\tsignature = cryptoMessaging.recvByteArr(stream);\r\n\t\t\t\r\n\t\t\tbidAccepted[i] = false;\r\n\t\t\t// if bid is from the person\r\n\t\t\tif (verify(bids[i], biddersigs[i], signature)) {\r\n\t\t\t\t// and the bid is higher than the asking price...\r\n\t\t\t\tif (bids[i].compareTo(askingPrice) >= 0) {\r\n\t\t\t\t\tbidAccepted[i] = true;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tSystem.out.println(\"Bid below the asking price\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tSystem.out.println(\"Bid signature did not match source\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// evaluateBids(bids, bidAccepted); //possible better framework for bid eval than what we got, I was on autopilot and made it\r\n\t\t\r\n\t\treturn bids;\t\r\n\t}",
"public List<Request> getExpiredRequests();",
"public synchronized Object[] sendBid(int agentSecretKey, String itemID, double bidAmount) throws IOException {\n for (int i = 0; i < itemList.size(); i++) {\n if (itemID.equals(itemList.get(i).getItemID())) {\n Item item = itemList.get(i);\n //Checking the Funds\n bankClient.writeClientOutput(new Object[]{Command.CheckAgentFunds,\n agentSecretKey, bidAmount});\n synchronized (this) {\n try {\n wait();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n if (hasFunds && item.getSecretBidderKey() != agentSecretKey) {\n //Lock Balance if legitimate bid has been made\n bankClient.writeClientOutput(new Object[]{Command\n .BlockFunds,agentSecretKey, bidAmount});\n synchronized (this) {\n try {\n wait();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n //If the item has not started yet\n if (item.getBidTimeRemaining() == 0 && bidAmount >= item.getCurrentBidAmount()) {\n item.startBidTime();\n item.setSecretBidderKey(agentSecretKey);\n item.setBidAmount(bidAmount);\n Iterator it = clients.entrySet().iterator();\n while (it.hasNext()) {\n Map.Entry pair = (Map.Entry) it.next();\n clients.get(pair.getKey()).clientOutput.writeObject(new Object[]{Command.RefreshTimes});\n }\n return new Object[]{Command.AcceptResponse, item};\n }\n //If the item time is still going\n else if (item.getBidTimeRemaining() > 0 && bidAmount > item.getCurrentBidAmount()) {\n bankClient.writeClientOutput(new Object[]{Command.UnlockFunds, item\n .getSecretBidderKey(), item.getCurrentBidAmount()});\n synchronized (this) {\n try {\n wait();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n item.startBidTime();\n Iterator it = clients.entrySet().iterator();\n while (it.hasNext()) {\n Map.Entry pair = (Map.Entry) it.next();\n clients.get(pair.getKey()).clientOutput.writeObject(new Object[]{Command.RefreshTimes});\n }\n if (clients.get(item.getSecretBidderKey()) != null) {\n clients.get(item.getSecretBidderKey()).clientOutput.writeObject(new Object[]{Command.BidOvertaken, item});\n }\n item.setSecretBidderKey(agentSecretKey);\n item.setBidAmount(bidAmount);\n return new Object[]{Command.AcceptResponse, item};\n }\n }\n //In the case that the bid is rejected\n if (!hasFunds) {\n return new Object[]{Command.RejectResponse, null};\n }\n }\n }\n return new Object[]{Command.RejectResponse, null};\n }",
"com.google.openrtb.OpenRtb.BidRequest getBidrequest();",
"@Test(expected = BidAmountException.class)\n public void bidIsLessThanHighestBidIsRejected() {\n knownUsers.login(seller.userName(), seller.password());\n knownUsers.annointSeller(seller.userName());\n\n knownUsers.login(bidder.userName(), bidder.password());\n\n Auction testAuction = new Auction(seller, item, startingPrice, startTime, endTime);\n testAuction.onStart();\n\n Bid firstBid = new Bid(bidder, startingPrice, startTime.plusMinutes(2));\n\n testAuction.submitBid(firstBid);\n\n testAuction.submitBid(firstBid);\n\n\n }",
"@Test\n public void testHistorizeBids_0args() throws Bid4WinException\n {\n AuctionAbstractStub auction = this.getGenerator().createAuctionAbstract();\n assertFalse(\"Should not be historized\", auction.isBidHistorized());\n try\n {\n auction.historizeBids();\n fail(\"Should fail with wrong status\");\n }\n catch(UserException ex)\n {\n System.out.println(ex.getMessage());\n assertFalse(\"Should not be historized\", auction.isBidHistorized());\n }\n\n auction.validate(new CancelPolicyAbstractStub(), this.getGenerator().createExchangeRates());\n try\n {\n auction.historizeBids();\n fail(\"Should fail with wrong status\");\n assertFalse(\"Should not be historized\", auction.isBidHistorized());\n }\n catch(UserException ex)\n {\n System.out.println(ex.getMessage());\n }\n\n auction.start();\n try\n {\n auction.historizeBids();\n fail(\"Should fail with wrong status\");\n }\n catch(UserException ex)\n {\n System.out.println(ex.getMessage());\n assertFalse(\"Should not be historized\", auction.isBidHistorized());\n }\n auction.addBid(this.getGenerator().createAccount(), new Bid4WinDate());\n auction.close();\n auction.historizeBids();\n assertTrue(\"Should be historized\", auction.isBidHistorized());\n try\n {\n auction.historizeBids();\n fail(\"Should fail with historized auction\");\n }\n catch(UserException ex)\n {\n System.out.println(ex.getMessage());\n }\n\n auction = this.getGenerator().createAuctionAbstract().validate(\n new CancelPolicyAbstractStub(), this.getGenerator().createExchangeRates()).start().cancel();\n assertFalse(\"Should not be historized\", auction.isBidHistorized());\n auction.historizeBids();\n assertTrue(\"Should be historized\", auction.isBidHistorized());\n }",
"public void newBid(String bidderName, double bidAmt)\n throws ClosedAuctionException {\n if(timeRemaining == 0) throw new ClosedAuctionException();\n if(bidAmt > currentBid) {\n currentBid = bidAmt;\n buyerName = bidderName;\n }\n }",
"private void processBids() {\n PublicKey winner = null;\n int maxBid = 0;\n for (PublicKey publicKey : userBidsMap.keySet()) {\n Integer bid = userBidsMap.get(publicKey);\n\n if (bid > maxBid) {\n maxBid = bid;\n winner = publicKey;\n }\n }\n\n sendAuctionResult(winner);\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Is this status code to be considered as an error?
|
boolean isError(int statusCode);
|
[
"public static boolean isStatusError(int code) {\n return code < STATUS_OK || code >= FIRST_ERROR_STATUS;\n }",
"protected abstract boolean isExpectedResponseCode(int httpStatus);",
"public boolean isApiError() {\n return this.getCode() != null && this.getCode() > 0;\n }",
"public boolean isServerError() {\n return mResponseCode / 100 == 5;\n }",
"boolean isErrorResponse();",
"public boolean isSuccessful() {\n return code >= 200 && code < 300;\n }",
"public static boolean isClientError(int code){\n return (code >= 400) && (code <= 499);\n }",
"public static boolean isStatusError(int status) {\n return (status >= 400 && status < 600);\n }",
"public static boolean isStatusClientError(int status) {\n return (status >= 400 && status < 500);\n }",
"public boolean isError() {\r\n return errorStatus == ERROR;\r\n }",
"public boolean isClientError(){\n return isClientError (getCode ());\n }",
"int getStatusCode();",
"protected static boolean inErrorStatus() {\n synchronized (lock) {\n return errorStatus;\n }\n }",
"public boolean isFailure() {\n return StatusCodeType.FAILURE.equals(response.getStatus());\n }",
"public boolean hasError();",
"public boolean isHttpOK(){\n return getStatusCode() == HttpURLConnection.HTTP_OK;\n }",
"public boolean isSuccessful() {\n return responseCode >= 200 && responseCode < 300;\n }",
"private int verifyHttpCode(int code) {\n\t\ttry {\n\t\t\tif (!HttpStatus.valueOf(code).is4xxClientError() && !HttpStatus.valueOf(code).is5xxServerError())\n\t\t\t\treturn HttpStatus.OK.value();\n\t\t} catch (Exception e) {\n\t\t\treturn HttpStatus.OK.value();\n\t\t}\n\t\treturn code;\n\t}",
"private boolean isRESTFault(Message message) {\n Object opName = message.getExchange().get(\"org.apache.cxf.resource.operation.name\");\n Integer responseCode = (Integer)message.get(Message.RESPONSE_CODE);\n if (opName == null && responseCode == null) {\n return true;\n }\n return (responseCode != null) && (responseCode >= 400);\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
This method was generated by MyBatis Generator. This method sets the value of the database column student.stu_age
|
public void setStuAge(Integer stuAge) {
this.stuAge = stuAge;
}
|
[
"public void testSetAge() {\n System.out.println(\"setAge\");\n int age = 0;\n Student instance = null;\n instance.setAge(age);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"public void setStudent(Student s) {\r\n student = s;\r\n }",
"public static void setAge(String age){\n setUserProperty(Constants.ZeTarget_keyForUserPropertyAge, age);\n }",
"public void setStudent(Student student) {\r\n\t\tthis.student = student;\r\n\t}",
"public void setStudent(Student student) {\n\t\tthis.student = student;\n\t}",
"@Test\n\tpublic void testUpdate(){\n\t\tString hql = \"UPDATE Student s SET s.age = ? WHERE id = ?\";\n\t\tsession.createQuery(hql).setInteger(0,9).setParameter(1,2).executeUpdate();\n\t}",
"public void setAge(int value) {\n this.age = value;\n }",
"public void setAge( int age )\r\n {\r\n myAge = age;\r\n }",
"public void setAge(String un, int age){\n MongoCollection<Document> collRU = db.getCollection(\"registeredUser\");\n // updating user database\n collRU.findOneAndUpdate(\n eq(\"username\", un),\n Updates.set(\"age\", age)\n );\n }",
"private void setStudentNum(long num)\n {\n this.Studentnum = num;\n }",
"public void setStudentnumber(String studentnumber);",
"public void setStudents(StudentDataBase students) {\n this.students = students;\n }",
"protected void setAge(int age) {\r\n\t\tthis.age = age;\r\n\t}",
"public Integer getStuAge() {\n return stuAge;\n }",
"protected void setAge(Age age) {\n this.age = age;\n }",
"@Override\n\tpublic void updateStudent(Student student) {\n\t\tString sql = \"UPDATE STUDENT SET SEMAIL=(select t.semail from (select ? as semail) as t), SPASS=(select t.spass from (select ? as spass) as t), SDEG=(select t.sdeg from (select ? as sdeg) as t) WHERE SNAME=(select t.sname from (select ? as sname from pg_sleep(RANDOM()*((0.5-0.2)+0.2))) as t)\";\n\t\tjdbcTemplate.update(sql, student.getSemail(), student.getSpass(), student.getSdeg(), student.getSname());\n\t}",
"public void setAge(int age){\r\n\t\tif(age >= 0){\r\n\t\t\tthis.age = age;\r\n\t\t}\r\n\t\tif(age > this.age){\r\n\t\t\ttotalAge = totalAge + (age - this.age);\r\n\t\t}\r\n\t\telse if(this.age > age){\r\n\t\t\ttotalAge = totalAge - (this.age - age);\t\r\n\t\t\t}\r\n\t\t}",
"int getStudentAge();",
"public void setStudentId(int value) {\n this.studentId = value;\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Returns a new object of class 'Let Exp'.
|
<C, PM> LetExp<C, PM> createLetExp();
|
[
"LetExp createLetExp();",
"LetExpression createLetExpression();",
"LetExpressionVariableDeclaration createLetExpressionVariableDeclaration();",
"LExp createLExp();",
"LetExpressionVariableDeclarationPart createLetExpressionVariableDeclarationPart();",
"public Let getLet(){\n return let;\n }",
"public Exp asExp() {\n\t\treturn this;\n\t}",
"public Element compileLet() {\n\t\tElement ele = null;\n\t\tString token, tokenType;\n\t\tString varName;\n\t\tboolean array = false;\n\t\tElement letParent = document.createElement(\"letStatement\");\n\n\t\t// let\n\t\ttokenType = jTokenizer.tokenType();\n\t\tele = createXMLnode(tokenType);\n\t\tletParent.appendChild(ele);\n\n\t\t// identifier\n\t\tjTokenizer.advance();\n\t\ttokenType = jTokenizer.tokenType();\n\t\tvarName = jTokenizer.returnTokenVal();\n\t\tele = createXMLnode(tokenType);\n\t\tletParent.appendChild(ele);\n\n\t\t// Checks if the variable is an array element\n\t\tjTokenizer.advance();\n\t\ttokenType = jTokenizer.tokenType();\n\t\ttoken = jTokenizer.returnTokenVal();\n\t\tif (token.equals(\"[\")) {\n\t\t\tarray = true;\n\t\t\t//Pushing base address\n\t\t\twriter.writePush(symTable.lookup(varName).kind, symTable.lookup(varName).index);\n\t\t\t// [\n\t\t\tele = createXMLnode(tokenType);\n\t\t\tletParent.appendChild(ele);\n\n\t\t\t// Pushing the offset, the expression that comes after [\n\t\t\tjTokenizer.advance();\n\t\t\tletParent.appendChild(compileExpression());\n\t\t\t\n\t\t\t// ]\n\t\t\tjTokenizer.advance();\n\t\t\ttokenType = jTokenizer.tokenType();\n\t\t\tele = createXMLnode(tokenType);\n\t\t\tletParent.appendChild(ele);\n\t\t\tjTokenizer.advance();\n\t\t\t\n\t\t\t//Adding the two to find the address of the element\n\t\t\twriter.writeArithmetic(\"add\");\n\t\t}\n\n\t\t// =\n\t\ttokenType = jTokenizer.tokenType();\n\t\tele = createXMLnode(tokenType);\n\t\tletParent.appendChild(ele);\n\n\t\t// compiling the expression on the right side of the equals\n\t\tjTokenizer.advance();\n\t\tletParent.appendChild(compileExpression());\n\n\t\t// ;\n\t\tjTokenizer.advance();\n\t\tele = createXMLnode(jTokenizer.tokenType());\n\t\tletParent.appendChild(ele);\n\t\t\n\t\t//If it was an array, we have to push the result of the expression to the address\n\t\t//of the specific element\n\t\tif (array) {\n\t\t\t// *(base+offset)=expression\n\t\t\twriter.writePop(\"temp\", 0);\n\n\t\t\t// base +index->that\n\t\t\twriter.writePop(\"pointer\", 1);\n\n\t\t\t// Expression -> *(base+index)\n\t\t\twriter.writePush(\"temp\", 0);\n\t\t\twriter.writePop(\"that\", 0);\n\t\t} \n\t\t//If not array, just pop it to the variable directly\n\t\telse {\n\t\t\twriter.writePop(symTable.lookup(varName).kind, symTable.lookup(varName).index);\n\t\t}\n\n\t\treturn letParent;\n\t}",
"public final EObject entryRuleLetExp() throws RecognitionException {\n EObject current = null;\n\n EObject iv_ruleLetExp = null;\n\n\n try {\n // InternalDOcl.g:1044:47: (iv_ruleLetExp= ruleLetExp EOF )\n // InternalDOcl.g:1045:2: iv_ruleLetExp= ruleLetExp EOF\n {\n newCompositeNode(grammarAccess.getLetExpRule()); \n pushFollow(FOLLOW_1);\n iv_ruleLetExp=ruleLetExp();\n\n state._fsp--;\n\n current =iv_ruleLetExp; \n match(input,EOF,FOLLOW_2); \n\n }\n\n }\n\n catch (RecognitionException re) {\n recover(input,re);\n appendSkippedTokens();\n }\n finally {\n }\n return current;\n }",
"public Exp visit(LetTuple e) {\n return new LetTuple(e.ids, e.ts, e.e1.accept(this), e.e2.accept(this));\n }",
"PowerExpression createPowerExpression();",
"VariableExp createVariableExp();",
"public final EObject ruleLetExp() throws RecognitionException {\n EObject current = null;\n\n Token lv_name_0_0=null;\n Token otherlv_2=null;\n EObject lv_variable_1_0 = null;\n\n EObject lv_in_3_0 = null;\n\n\n\n \tenterRule();\n\n try {\n // InternalDOcl.g:1057:2: ( ( ( (lv_name_0_0= 'let' ) ) ( (lv_variable_1_0= ruleLocalVariable ) ) otherlv_2= 'in' ( (lv_in_3_0= ruleOclExpression ) ) ) )\n // InternalDOcl.g:1058:2: ( ( (lv_name_0_0= 'let' ) ) ( (lv_variable_1_0= ruleLocalVariable ) ) otherlv_2= 'in' ( (lv_in_3_0= ruleOclExpression ) ) )\n {\n // InternalDOcl.g:1058:2: ( ( (lv_name_0_0= 'let' ) ) ( (lv_variable_1_0= ruleLocalVariable ) ) otherlv_2= 'in' ( (lv_in_3_0= ruleOclExpression ) ) )\n // InternalDOcl.g:1059:3: ( (lv_name_0_0= 'let' ) ) ( (lv_variable_1_0= ruleLocalVariable ) ) otherlv_2= 'in' ( (lv_in_3_0= ruleOclExpression ) )\n {\n // InternalDOcl.g:1059:3: ( (lv_name_0_0= 'let' ) )\n // InternalDOcl.g:1060:4: (lv_name_0_0= 'let' )\n {\n // InternalDOcl.g:1060:4: (lv_name_0_0= 'let' )\n // InternalDOcl.g:1061:5: lv_name_0_0= 'let'\n {\n lv_name_0_0=(Token)match(input,62,FOLLOW_3); \n\n \t\t\t\t\tnewLeafNode(lv_name_0_0, grammarAccess.getLetExpAccess().getNameLetKeyword_0_0());\n \t\t\t\t\n\n \t\t\t\t\tif (current==null) {\n \t\t\t\t\t\tcurrent = createModelElement(grammarAccess.getLetExpRule());\n \t\t\t\t\t}\n \t\t\t\t\tsetWithLastConsumed(current, \"name\", lv_name_0_0, \"let\");\n \t\t\t\t\n\n }\n\n\n }\n\n // InternalDOcl.g:1073:3: ( (lv_variable_1_0= ruleLocalVariable ) )\n // InternalDOcl.g:1074:4: (lv_variable_1_0= ruleLocalVariable )\n {\n // InternalDOcl.g:1074:4: (lv_variable_1_0= ruleLocalVariable )\n // InternalDOcl.g:1075:5: lv_variable_1_0= ruleLocalVariable\n {\n\n \t\t\t\t\tnewCompositeNode(grammarAccess.getLetExpAccess().getVariableLocalVariableParserRuleCall_1_0());\n \t\t\t\t\n pushFollow(FOLLOW_18);\n lv_variable_1_0=ruleLocalVariable();\n\n state._fsp--;\n\n\n \t\t\t\t\tif (current==null) {\n \t\t\t\t\t\tcurrent = createModelElementForParent(grammarAccess.getLetExpRule());\n \t\t\t\t\t}\n \t\t\t\t\tset(\n \t\t\t\t\t\tcurrent,\n \t\t\t\t\t\t\"variable\",\n \t\t\t\t\t\tlv_variable_1_0,\n \t\t\t\t\t\t\"fr.inria.diverse.docl.DOcl.LocalVariable\");\n \t\t\t\t\tafterParserOrEnumRuleCall();\n \t\t\t\t\n\n }\n\n\n }\n\n otherlv_2=(Token)match(input,63,FOLLOW_16); \n\n \t\t\tnewLeafNode(otherlv_2, grammarAccess.getLetExpAccess().getInKeyword_2());\n \t\t\n // InternalDOcl.g:1096:3: ( (lv_in_3_0= ruleOclExpression ) )\n // InternalDOcl.g:1097:4: (lv_in_3_0= ruleOclExpression )\n {\n // InternalDOcl.g:1097:4: (lv_in_3_0= ruleOclExpression )\n // InternalDOcl.g:1098:5: lv_in_3_0= ruleOclExpression\n {\n\n \t\t\t\t\tnewCompositeNode(grammarAccess.getLetExpAccess().getInOclExpressionParserRuleCall_3_0());\n \t\t\t\t\n pushFollow(FOLLOW_2);\n lv_in_3_0=ruleOclExpression();\n\n state._fsp--;\n\n\n \t\t\t\t\tif (current==null) {\n \t\t\t\t\t\tcurrent = createModelElementForParent(grammarAccess.getLetExpRule());\n \t\t\t\t\t}\n \t\t\t\t\tset(\n \t\t\t\t\t\tcurrent,\n \t\t\t\t\t\t\"in\",\n \t\t\t\t\t\tlv_in_3_0,\n \t\t\t\t\t\t\"fr.inria.diverse.docl.DOcl.OclExpression\");\n \t\t\t\t\tafterParserOrEnumRuleCall();\n \t\t\t\t\n\n }\n\n\n }\n\n\n }\n\n\n }\n\n\n \tleaveRule();\n\n }\n\n catch (RecognitionException re) {\n recover(input,re);\n appendSkippedTokens();\n }\n finally {\n }\n return current;\n }",
"<C, PM> VariableExp<C, PM> createVariableExp();",
"Lexpr createLexpr();",
"public Factor (String literal, int exp) {\r\n\t\tthis.literal = literal;\r\n\t\tthis.exp = exp;\r\n\t}",
"public T elementExp() {\n T c = createLike();\n ops.elementExp(mat, c.mat);\n return c;\n }",
"public static NewExpression new_(Class type) { throw Extensions.todo(); }",
"public final EObject entryRuleLetExpCS() throws RecognitionException {\n EObject current = null;\n\n EObject iv_ruleLetExpCS = null;\n\n\n try {\n // InternalMyDsl.g:9028:49: (iv_ruleLetExpCS= ruleLetExpCS EOF )\n // InternalMyDsl.g:9029:2: iv_ruleLetExpCS= ruleLetExpCS EOF\n {\n if ( state.backtracking==0 ) {\n newCompositeNode(grammarAccess.getLetExpCSRule()); \n }\n pushFollow(FOLLOW_1);\n iv_ruleLetExpCS=ruleLetExpCS();\n\n state._fsp--;\n if (state.failed) return current;\n if ( state.backtracking==0 ) {\n current =iv_ruleLetExpCS; \n }\n match(input,EOF,FOLLOW_2); if (state.failed) return current;\n\n }\n\n }\n\n catch (RecognitionException re) {\n recover(input,re);\n appendSkippedTokens();\n }\n finally {\n }\n return current;\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Returns local backup Zip file name
|
@NonNull
public static String getBackupZipFileName() {
return ZipFileUtils.getZipFileName(LOCAL_BACKUP_DB_FILE_NAME);
}
|
[
"java.lang.String getBackupName();",
"public static String getZipFile() {\n File file = new File(getZipBaseDir(), System.currentTimeMillis() + \".zip\");\n try {\n boolean ignore = file.createNewFile();\n } catch (IOException ignore) {\n\n }\n return file.getAbsolutePath();\n }",
"public String getZipName()\n {\n if (!this.bagFile.exists())\n {\n throw new RuntimeException(\"You must writeFile before you can ask questions about the zip\");\n }\n return this.bagFile.getName();\n }",
"public String getZipFileName() {\n String zipFileName = FileUtils.cleanForFileSystem(this.name);\n if (zipFileName.length() > MAX_LEN_ZIP_FILE_NAME) {\n return zipFileName.substring(0, MAX_LEN_ZIP_FILE_NAME) + \".zip\";\n }\n return zipFileName + \".zip\";\n }",
"String getZipFilePath() {\n return packageRootPrefix.isEmpty() ? zipFilePath\n : zipFilePath + \"!/\" + packageRootPrefix.substring(0, packageRootPrefix.length() - 1);\n }",
"public String getBackupFilename(){\n\t return backupFilename;\n }",
"public String getDestinationZip()\r\n {\r\n return destinationZip;\r\n }",
"private void zipBackup(File source) throws IOException {\n File dir = BACKUP_TAGGED_DIRECTORY;\n \n if (tag == null) {\n dir = BACKUP_AUTO_DIRECTORY;\n tag = String.format(NAME_FORMAT, new Date());\n }\n \n File backup = new File(dir, tag + \".zip\");\n IO.zip(source, backup);\n \n println(\"Backup saved: \" + backup.getPath());\n }",
"public String getSrcZip() {\r\n return (String) getAttributeInternal(SRCZIP);\r\n }",
"@Override\n public String toString() {\n return \"ZipFile '\" + getName() + \"'\";\n }",
"public String getZip() { return this.zip; }",
"public File getZipLocation ()\n\t{\n\t\treturn zipFileLocation;\n\t}",
"public String getWalletFileBaseName() {\r\n return walletFileBaseName;\r\n }",
"public String getHomeZip() {\n return homeZip;\n }",
"private String generateZipEntry(String file){\n\t\tString sourceFolder = SDCARD + TMP_STORAGE;\n\t\treturn file.substring(sourceFolder.length(), file.length());\n\t}",
"public static String getZipFileName(String tempDir, File tomlFile) {\n return Paths.get(tempDir, \"assets\", \"zip\", tomlFile.getParentFile().getName()) + \".zip\";\n }",
"@Override\n public String getScriptsArchiveName() {\n return String.format(\"%s_scripts.zip\", getName());\n }",
"public String getZipPath()\n {\n if (!this.bagFile.exists())\n {\n throw new RuntimeException(\"You must writeFile before you can ask questions about the zip\");\n }\n return this.bagFile.getAbsolutePath();\n }",
"public java.lang.String getBillerZip() {\r\n return billerZip;\r\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
A callback which returns a value of type T. TODO: remove this when we're on Java 8, in favor of java.util.function.Supplier.
|
public interface Supplier<T> {
T get();
}
|
[
"Supplier<Number> getSupplier();",
"private static <E> Value<E> of(Supplier<E> valueSupplier) {\n return new Value<>(valueSupplier.get());\n }",
"@JSFunctor\n @FunctionalInterface\n public interface FullfilledValueCallback<T extends Any, R extends Any> extends JSObject {\n\t\t/**\n\t\t * Fullfilled r.\n\t\t *\n\t\t * @param value the value\n\t\t *\n\t\t * @return the r\n\t\t */\n\t\t@Nullable\n R fullfilled(T value);\n }",
"public V getAndUpdate(final Supplier<V> supplier) {\n\t\tsynchronized (this.monitor) {\n\t\t\tfinal V prev = this.value;\n\t\t\tthis.value = supplier.get();\n\t\t\treturn prev;\n\t\t}\n\t}",
"public static <E> NullableArgFunction<Selection<Element>, E> getValue() {\n return NullableArgFunction.of(selection -> selection.result().getValue());\n }",
"public <R> Maybe<R> when(MaybeCallback<T, R> callback) {\r\n if (present) {\r\n return callback.call(value);\r\n }\r\n return Maybe.<R>empty();\r\n }",
"@FunctionalInterface\n public interface ThrowingSupplier<T> {\n T get() throws Exception;\n }",
"@FunctionalInterface\npublic interface StubValueSupplier<T> {\n\n /**\n * Returns a stub value for the given context and sequence number.\n *\n * @param context the {@link StubbingContext}\n * @param sequenceNumber the sequence number\n * @return a stub value\n */\n T get(StubbingContext context, int sequenceNumber);\n\n}",
"public V updateAndGet(final Supplier<V> supplier) {\n\t\tsynchronized (this.monitor) {\n\t\t\tthis.value = supplier.get();\n\t\t\treturn this.value;\n\t\t}\n\t}",
"public static <T, R> ObservableValue<R> observe(\n Function<T, R> f, ObservableValue<T> value) {\n Objects.requireNonNull(f, \"f is null\");\n Objects.requireNonNull(value, \"value is null\");\n\n return new SingleObservableValue<>(f, value);\n }",
"@JSFunctor\n @FunctionalInterface\n public interface FullfilledValueIntCallback<T extends Any> extends JSObject {\n\t\t/**\n\t\t * Fullfilled int.\n\t\t *\n\t\t * @param value the value\n\t\t *\n\t\t * @return the int\n\t\t */\n\t\tint fullfilled(T value);\n }",
"@Override\n public void apply(T t) {\n // Mapping value to promise\n //\n Promise<R> mapped = fun.apply(t);\n\n //\n // Handling results\n //\n mapped.then(new Consumer<R>() {\n @Override\n public void apply(R r) {\n resolver.result(r);\n }\n }).failure(new Consumer<Exception>() {\n @Override\n public void apply(Exception e) {\n resolver.error(e);\n }\n }).done(resolver.getDispatcher());\n }",
"@JSFunctor\n @FunctionalInterface\n public interface FullfilledValueDoubleCallback<T extends Any> extends JSObject {\n\t\t/**\n\t\t * Fullfilled double.\n\t\t *\n\t\t * @param value the value\n\t\t *\n\t\t * @return the double\n\t\t */\n\t\tdouble fullfilled(T value);\n }",
"T getNewValue();",
"<T> T execute(ProducerCallback<K, V, T> callback);",
"@FunctionalInterface\npublic interface ThrowableSupplier<T> {\n T get() throws Throwable;\n}",
"<T> T await(Supplier<T> supplier);",
"public T getValue(T defaultValue);",
"static <S, F> ConsumableFunction<Result<S, F>> onSuccessDo(Consumer<S> consumer) {\n return r -> r.then(onSuccess(peek(consumer)));\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Enables the GPS provider if it is not enabled yet.
|
private void enableGPS() {
if (mGPSEnabled)
return;
LocationManager locationManager = (LocationManager)this.getSystemService(Context.LOCATION_SERVICE);
if (locationManager != null) {
try {
if (locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this);
mGPSEnabled = true;
}
} catch (SecurityException e) {
e.printStackTrace();
Log.e(LOG_TAG, getResources().getString(R.string.location_permissions));
}
}
}
|
[
"public void turnGPSOn() {\n try {\n String provider = Settings.Secure.getString(getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED);\n\n if (!provider.contains(\"gps\")) { //if gps is disabled\n final Intent poke = new Intent();\n poke.setClassName(\"com.android.settings\", \"com.android.settings.widget.SettingsAppWidgetProvider\");\n poke.addCategory(Intent.CATEGORY_ALTERNATIVE);\n poke.setData(Uri.parse(\"3\"));\n sendBroadcast(poke);\n }\n } catch (Exception e) {\n\n }\n }",
"public void turnGPSOn() {\n try {\n String provider = Settings.Secure.getString(getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED);\n if (!provider.contains(\"gps\")) { //if gps is disabled\n final Intent poke = new Intent();\n poke.setClassName(\"com.android.settings\", \"com.android.settings.widget.SettingsAppWidgetProvider\");\n poke.addCategory(Intent.CATEGORY_ALTERNATIVE);\n poke.setData(Uri.parse(\"3\"));\n sendBroadcast(poke);\n }\n } catch (Exception e) {\n }\n }",
"public void turnGPSOn() {\n LocationManager service = (LocationManager) getSystemService(LOCATION_SERVICE);\n boolean enabled = service.isProviderEnabled(LocationManager.GPS_PROVIDER);\n if (!enabled) {\n AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);\n alertDialogBuilder.setMessage(\"GPS is disabled in your device. Enable it?\")\n .setPositiveButton(R.string.enable_gps, (dialog, id) -> {\n /** Here it's leading to GPS setting options*/\n Intent callGPSSettingIntent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);\n startActivity(callGPSSettingIntent);\n }).setNegativeButton(R.string.cancel, (dialog, id) -> dialog.cancel());\n AlertDialog alert = alertDialogBuilder.create();\n alert.show();\n if (enabled)\n {\n Intent intent = new Intent(DonorMapsActivity.this, dashboard.class);\n startActivity(intent);\n }\n }\n else\n {\n Intent intent = new Intent(DonorMapsActivity.this, dashboard.class);\n startActivity(intent);\n }\n }",
"private void checkGpsEnable() {\n boolean isGpsEnabled = MyLocation.defaultHandler().isLocationAvailable(this);\n if (!isGpsEnabled) {\n\n showEnablePermissionDailog(1, getString(R.string.please_enable_location));\n } else {\n MyLocation.defaultHandler().getLocation(this, locationResult);\n getCurrentLocation();\n }\n }",
"private void enableGPS(){\n AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(requireContext());\n\n alertDialogBuilder.setMessage(\"GPS is disabled in your device. Enable GPS to continue.\")\n .setCancelable(false)\n .setPositiveButton(\"Enable GPS\",\n (dialog, id) -> {\n Intent callGPSSettingIntent = new Intent(\n android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);\n startActivity(callGPSSettingIntent);\n });\n alert = alertDialogBuilder.create();\n alert.show();\n }",
"private boolean GPSEnabled(){\n LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);\n return (locationManager != null && locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER));\n }",
"public boolean isProviderEnabled(String provider){\n\t\tif(provider.equals(GPS_PROVIDER))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}",
"private void checkLocationEnabled () {\n LocationManager location_manager = (LocationManager)\n getSystemService(Context.LOCATION_SERVICE ) ;\n boolean gps_enabled = false;\n boolean network_enabled = false;\n try {\n gps_enabled = location_manager.isProviderEnabled(LocationManager. GPS_PROVIDER ) ;\n } catch (Exception e) {\n e.printStackTrace() ;\n }\n try {\n network_enabled = location_manager.isProviderEnabled(LocationManager. NETWORK_PROVIDER ) ;\n } catch (Exception e) {\n e.printStackTrace() ;\n }\n if (!gps_enabled && !network_enabled) {\n new AlertDialog.Builder(GameActivity. this )\n .setMessage( \"Please enable localization\" )\n .setPositiveButton( \"Settings\" , new\n DialogInterface.OnClickListener() {\n @Override\n public void onClick (DialogInterface paramDialogInterface , int paramInt) {\n startActivity( new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS )) ;\n }\n })\n .setNegativeButton( \"Cancel\" , null )\n .show() ;\n }\n }",
"public boolean isGpsProviderEnabled() {\n if (!isAllowed()) {\n return false;\n }\n String provider = LocationManager.GPS_PROVIDER;\n try {\n\n if (locationManager.getProvider(provider) == null) {\n return false;\n }\n return locationManager.isProviderEnabled(provider);\n } catch (SecurityException secex) {\n return false;\n }\n }",
"private void checkGPS () {\n Button enableButton = (Button) findViewById(R.id.enable_button);\n enableButton.setOnTouchListener(mDelayHideTouchListener);\n\n LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);\n boolean isGPS = locationManager.isProviderEnabled (LocationManager.GPS_PROVIDER);\n if (isGPS) {\n enableButton.setText(LOGON_STRING);\n } else {\n enableButton.setText(ENABLE_GPS_STRING);\n Toast.makeText(this, \"Please Enable GPS Settings First\", Toast.LENGTH_LONG).show();\n }\n }",
"private void turnOnGPS(){\r\n\r\n final AlertDialog.Builder builder = new AlertDialog.Builder(this);\r\n\r\n builder.setMessage(\"Enable GPS\").setCancelable(false).setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {\r\n @Override\r\n public void onClick(DialogInterface dialogInterface, int i) {\r\n startActivity(new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS));\r\n }\r\n }).setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\r\n @Override\r\n public void onClick(DialogInterface dialogInterface, int i) {\r\n dialogInterface.cancel();\r\n }\r\n });\r\n\r\n // create the dialog to show to the user\r\n final AlertDialog alertDialog = builder.create();\r\n\r\n alertDialog.show();\r\n }",
"public void configureGPS(View view) {\n LocationManager locationManager = (LocationManager)getApplicationContext().getSystemService(Context.LOCATION_SERVICE);\n if(locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {\n Toast.makeText(this, getText(R.string.gps_enabled), Toast.LENGTH_LONG).show();\n } else {\n textGPS.setError(null);\n imGPS.setColorFilter(Color.YELLOW);\n Intent gpsOptionsIntent = new Intent(\n android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);\n startActivity(gpsOptionsIntent);\n\n //Solicitamos los permisos al usuario\n if (!checkPermissions()) {\n startLocationPermissionRequest();\n }\n\n //Comprobamos si se ha activado el GPS\n try {\n Thread.sleep(5000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n if(locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)){\n Toast.makeText(this, getText(R.string.gps_enabled_success), Toast.LENGTH_LONG).show();\n imGPS.setColorFilter(Color.GREEN);\n gpsBol = true;\n\n } else {\n Toast.makeText(this, getText(R.string.gps_enable_fail), Toast.LENGTH_LONG).show();\n imGPS.setColorFilter(Color.RED);\n }\n }\n\n\n }",
"public boolean checkGPS(){\n LocationManager manager= (LocationManager) getSystemService(Context.LOCATION_SERVICE);\n return manager.isProviderEnabled(LocationManager.GPS_PROVIDER);\n }",
"public boolean checkToSeeIfGPSIsOn(){\n\t\t\n\t\tLocationManager service = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);\n\t\tboolean enabled = service.isProviderEnabled(LocationManager.GPS_PROVIDER);\n\n\t\tif (!enabled){\n\t\t\t\n\t\t\tAlertDialog ad = new AlertDialog.Builder(context).create();\n\t\t\t\n\t\t\tad.setTitle(\"GPS Inactive!\");\n\t\t\tad.setMessage(\"Do you want to activate the GPS?\");\n\t\t\t\n\t\t\t// Setting Icon to Dialog\n\t ad.setIcon(android.R.drawable.stat_sys_warning);\n\t\t\t\n\t\t\t// negative button shows up first\n\t\t\t// set no button\n\t\t\tad.setButton(DialogInterface.BUTTON_NEGATIVE, \"Don't Activate GPS\", \n\t\t\t\t\t\n\t\t\t\tnew DialogInterface.OnClickListener() {\n\t\t\t\t\t\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tToast.makeText(context, \"GPS will not be used.\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\tdialog.cancel();\n\t\t\t\t\t}}\n\t\t\t\t);\n\t\t\t\n\t\t\t// set yes button\n\t\t\tad.setButton(DialogInterface.BUTTON_POSITIVE, \"Activate GPS\", \n\t\t\t\t\t\n\t\t\t\tnew DialogInterface.OnClickListener() {\n\t\t\t\n\t\t\t\t\t@Override\n\t\t public void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tIntent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);\n\t\t\t\t\t\tcontext.startActivity(intent);\n\t\t\t\t\t\t\n\t\t }}\n\t\t\t\t);\n\t\t\t\n\t\t\tad.show();\n\t\t\t\n\t\t}\n\t\t\n\t\treturn enabled;\n\t}",
"public void onProviderEnabled()\n {\n if(isLocationEnabled(mapsActivity))\n {\n checkPermissionAndService();\n }\n else\n Toast.makeText(mapsActivity.getApplicationContext(),\n R.string.notify_location_service,\n Toast.LENGTH_LONG)\n .show();\n }",
"public boolean checkIsGPSEnabled() {\n LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);\n return lm.isProviderEnabled(LocationManager.GPS_PROVIDER);\n }",
"public boolean CheckGPS(){\n\n boolean status;\n LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);\n status = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);\n return status;\n }",
"private boolean isLocationProviderEnabledRequired() {\n if (isAndroidWear) {\n return false;\n }\n return !isNearbyPermissionNeverForLoc;\n }",
"private void enableLocation(){\n if (PermissionsManager.areLocationPermissionsGranted(this)) {\n // Create an instance of LOST location engine\n initializeLocationEngine();\n } else {\n checkPermissions();\n }\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
This method gets the Shape object in the model with the given name.
|
Shape getShape(String name);
|
[
"Shape getShape();",
"public Shape getShape() {\n if (model == null) {\n return null;\n }\n\n // check to see if we already made this one.\n Object retval = shapeCache.get(model);\n\n // if not, make it and store a copy in the cache..\n if (retval == null) {\n retval = makeBarb();\n if (retval instanceof GeneralPath) {\n shapeCache.put(model.clone(), ((GeneralPath) retval).clone());\n } else {\n shapeCache.put(model.clone(), ((Area) retval).clone());\n }\n }\n\n return (Shape) retval;\n }",
"String getShapeName();",
"public Shape get(final String id) {\n\n\t\tfinal TypedQuery<Shape> query = this.em.createQuery(\"Select s from Shape s where s.id = :parId\", Shape.class);\n\t\tquery.setParameter(\"parId\", id);\n\n\t\ttry {\n\t\t\tfinal Shape shape = query.getSingleResult();\n\t\t\tif (null == shape) {\n\t\t\t\tthrow new NoResultException();\n\t\t\t}\n\t\t\treturn shape;\n\t\t} catch (NoResultException e) {\n\t\t\tthrow new ShapeNotFoundException(id);\n\t\t}\n\n\t}",
"public Shape(String name) {\n this.setName(name);\n }",
"private Shape find(String name, ArrayList<Shape> listShapes, ArrayList<Command> commands) {\r\n for (Shape shape : listShapes) {\r\n if (shape.getName().equals(name)) {\r\n return shape;\r\n }\r\n }\r\n throw new IllegalArgumentException(\"Cannot find shape.\");\r\n }",
"public Shape getShape (String shape_id) {\n Shape shape = new Shape(this, shape_id);\n return shape.shape_dist_traveled.length > 0 ? shape : null;\n }",
"Shape get(int index);",
"@Override\n public String getName() {\n return this.shape.getName();\n }",
"public JShape getJShape( int which )\n {\n return (JShape) getComponent( which ); // this is all we need\n }",
"ShapeType getShapeType();",
"public static Shape getShape(int i) {\r\n \t\tif (shapeSet.size() == 0) {\n \t\t\tloadShapes();\n \t\t}\n \t\t\n \t\tif (i >= shapeSet.size()){\n \t\t\tthrow new IllegalArgumentException(\"Requested shape \" + i + \" out of range [ 0 .. \"+ shapeSet.size() + \"]\");\n \t\t}\n \t\t\n \t\treturn shapeSet.get(i);\n \t}",
"public IShape getShape() {\n return this.shape.copy();\n }",
"String getLayerShapeName();",
"static public NbShape getShape(Node n)\n\t{\n\t\treturn n.getLookup().lookup(NbShape.class);\n\t}",
"public ShapeDetails getShape(boolean first) {\n ShapeDetails result;\n if (first) {\n result = this.shape;\n }\n else {\n result = this.endShape;\n }\n\n return result;\n }",
"abstract ShapeType getShapeType();",
"public Shape() \n {\n this.setName(\"Shape\");\n }",
"public Shape getShape() {\n\t\treturn _shape!=null? _shape: new CircleShape(new Vec2f(0,0), 0);\n\t}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
manager.isAlive() is not called from synchronized context so we must check again to prevent the case where the manager has remmoved the element after the thread has verified manager.isAlive()
|
private boolean isStillAlive(WorldView world, Element element) {
return world.getManager().isAlive(element);
}
|
[
"private synchronized void performHouseKeeping() {\r\n\t\tSet<Map.Entry<Integer,QueueManager>> eS = queueManagers.entrySet();\r\n\t\tfor( Iterator<Map.Entry<Integer,QueueManager>> i = eS.iterator(); i.hasNext(); ) {\r\n\t\t\tMap.Entry<Integer,QueueManager> qMME = i.next();\r\n\t\t\tQueueManager qM = qMME.getValue();\r\n\t\t\tif( qM.houseKeepingAndTestForDelete() ) {\r\n\t\t\t\ti.remove();\r\n\t\t\t\tLOGGER.debug(\"Removed QueueManager with magic number \"+qM.getMagicNumber()+\" due to inactivity\");\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void updateStatus()\n\t{\n\t\tisAlive = false;\n\t}",
"public void checkMan(){\r\n Actor check = getOneObjectAtOffset(0,0,Man.class);\r\n if (check!=null){\r\n if (frameCounter ==0){\r\n Actor checkMan = getOneObjectAtOffset(0,0,Man.class);\r\n if (checkMan!=null){\r\n getWorld().removeObject(check);\r\n getWorld().addObject(new Man(),getX(),getY());\r\n }\r\n frameCounter = 0;\r\n }\r\n }\r\n }",
"protected abstract boolean removalDoneCondition();",
"public boolean isAlive() {\n synchronized (this) {\n return mIsAlive;\n }\n }",
"@Test\n public void testStartInactive() throws Exception {\n // make an inactive manager by deserializing it\n RealManager mgr2 = Serializer.roundTrip(new RealManager(services, params, REQ_ID, workMem));\n mgr = mgr2;\n\n // cannot re-start\n assertThatCode(() -> mgr.start()).isInstanceOf(IllegalStateException.class)\n .hasMessage(\"manager is no longer active\");\n }",
"public boolean IsAlive() {\n\treturn process != null;\n }",
"final public boolean isAlive(){\n\t\treturn this.thread.isAlive();\n\t}",
"public void checkInside() {\n checkInsideDone = false;\n }",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\tsynchronized (OnlineObjectsContainer.this.onlineObjects) {\n\t\t\t\t\tfinal Iterator<OnlineObject> iterator = OnlineObjectsContainer.this.onlineObjects.iterator();\n\t\t\t\t\twhile (iterator.hasNext()) {\n\t\t\t\t\t\tfinal OnlineObject anObject = iterator.next();\n\t\t\t\t\t\tif (anObject.getSeenAt().getTime() + OnlineObjectsContainer.EXPIRATION_TIME < System.currentTimeMillis()) {\n\t\t\t\t\t\t\tOnlineObjectsContainer.this.recentlyRemovedObjects.add(anObject);\n\t\t\t\t\t\t\tOnlineObjectsContainer.this.recentlyAddedObjects.remove(anObject);\n\t\t\t\t\t\t\titerator.remove();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"private void assertSchedulerStillAlive()\n throws InvalidCardChannelException\n {\n boolean alive = false;\n try {\n alive = cs_scheduler.isAlive();\n } catch (CardTerminalException ctx) {\n throw new InvalidCardChannelException(ctx.toString());\n }\n if (!alive)\n {\n card_channel = null;\n cs_scheduler = null;\n throw new InvalidCardChannelException(\"card removed?\");\n }\n }",
"public boolean isAlive()\r\n\t{\r\n\t\treturn internalThread.isAlive();\r\n\t}",
"public void checkIfAlive()\n {\n if(this.health<=0)\n {\n targetable=false;\n monstersWalkDistanceX=0;\n monstersWalkDistanceY=0;\n this.health=0;\n new TextureChanger(this,0);\n isSelected=false;\n if(monsterType==1)\n {\n visible=false;\n }\n if(gaveResource==false) {\n int gameResource = Board.gameResources.getGameResources();\n Board.gameResources.setGameResources(gameResource + resourceReward);\n gaveResource=true;\n }\n }\n }",
"public boolean isInsideWaiting(Token token) {\n for (Token.Waiting item : token.getWaitingList()) {\n if (item.getId() == Node.getInstance().getId()) {\n return true;\n }\n }\n return false;\n }",
"private void maintain() {\n SoftObject obj;\n int count = 0;\n\n while ((obj = (SoftObject)queue.poll()) != null) {\n count++;\n collection.remove(obj);\n }\n\n if (count != 0) {\n // some temporary debugging fluff\n System.err.println(\"vm reclaimed \" + count + \" objects\");\n }\n }",
"boolean isLeaseHeldByCurrentThread() {\n return thread == Thread.currentThread();\n }",
"protected void manageRemovalOfElement(DNStateManager ownerSM, Object element)\n {\n ExecutionContext ec = ownerSM.getExecutionContext();\n if (relationType == RelationType.ONE_TO_MANY_BI)\n {\n // TODO Move this into RelationshipManager\n // Managed Relations : 1-N bidirectional so null the owner on the elements\n if (!ec.getApiAdapter().isDeleted(element))\n {\n DNStateManager elementSM = ec.findStateManager(element);\n if (elementSM != null)\n {\n // Null the owner of the element\n if (NucleusLogger.PERSISTENCE.isDebugEnabled())\n {\n NucleusLogger.PERSISTENCE.debug(Localiser.msg(\"055010\", ownerSM.getObjectAsPrintable(), ownerMemberMetaData.getFullFieldName(), StringUtils.toJVMIDString(element)));\n }\n\n DNStateManager ownerHolderSM = elementSM;\n int ownerFieldNumberInHolder = -1;\n if (ownerMemberMetaData.getMappedBy() != null && ownerMemberMetaData.getMappedBy().indexOf('.') > 0)\n {\n AbstractMemberMetaData otherMmd = null;\n AbstractClassMetaData otherCmd = elementCmd;\n String remainingMappedBy = ownerMemberMetaData.getMappedBy();\n while (remainingMappedBy.indexOf('.') > 0)\n {\n // JPA mappedBy dot notation\n int dotPosition = remainingMappedBy.indexOf('.');\n String thisMappedBy = remainingMappedBy.substring(0, dotPosition);\n otherMmd = otherCmd.getMetaDataForMember(thisMappedBy);\n\n Object holderValueAtField = ownerHolderSM.provideField(otherMmd.getAbsoluteFieldNumber());\n ownerHolderSM = ec.findStateManagerForEmbedded(holderValueAtField, ownerHolderSM, otherMmd, PersistableObjectType.EMBEDDED_COLLECTION_ELEMENT_PC);\n\n remainingMappedBy = remainingMappedBy.substring(dotPosition+1);\n otherCmd = storeMgr.getMetaDataManager().getMetaDataForClass(otherMmd.getTypeName(), clr);\n if (remainingMappedBy.indexOf('.') < 0)\n {\n otherMmd = otherCmd.getMetaDataForMember(remainingMappedBy);\n ownerFieldNumberInHolder = otherMmd.getAbsoluteFieldNumber();\n }\n }\n }\n else\n {\n ownerFieldNumberInHolder = getFieldNumberInElementForBidirectional(elementSM);\n }\n\n Object currentValue = ownerHolderSM.provideField(ownerFieldNumberInHolder);\n if (currentValue != null)\n {\n ownerHolderSM.replaceFieldMakeDirty(ownerFieldNumberInHolder, null);\n if (ec.isFlushing())\n {\n // Make sure this change gets flushed\n ownerHolderSM.flush();\n }\n }\n }\n }\n }\n }",
"public void toggleAlive() {\n\t\tthis.isAlive = !isAlive;\n\t}",
"boolean isUnlocked( ModelObject mo );"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Returns an iterator over the points in this table. The points are returned in ascending order. This is a sparse iterator, that is, it iterates over all cells that the table contains whether or not there is a value in that cell or not.
|
public Iterator pointIterator() {
return new Iterator() {
private int min_x = getMinX();
private int min_y = getMinY();
private int max_x = getMaxX();
private int max_y = getMaxY();
private int x = min_x;
private int y = min_y;
public boolean hasNext() {
return x <= max_x && y <= max_y;
}
public Object next() {
if ( hasNext() ) {
Point p = new Point( x, y );
// prep for next call
++x;
if ( x > max_x ) {
x = min_x;
++y;
}
// return the next point
return p;
}
else
throw new NoSuchElementException();
}
public void remove() {
throw new UnsupportedOperationException();
}
};
}
|
[
"public Iterator valueIterator() {\n return new Iterator() {\n private int min_x = getMinX();\n private int min_y = getMinY();\n private int max_x = getMaxX();\n private int max_y = getMaxY();\n private int x = min_x;\n private int y = min_y;\n public boolean hasNext() {\n return x <= max_x && y <= max_y;\n }\n public Object next() {\n if ( hasNext() ) {\n // get the point\n Object o = get( x, y );\n\n // prep for next call\n x += 1;\n if ( x > max_x ) {\n x = min_x;\n y += 1;\n }\n return o;\n }\n throw new NoSuchElementException();\n }\n public void remove() {\n throw new UnsupportedOperationException();\n }\n };\n }",
"public Iterator<GPoint> iterator() {\n\t\treturn points.iterator();\n\t}",
"public Iterator<Coordinate> iterator() {\n\t\treturn getAllPoints().iterator();\n\t}",
"@Override\n public Iterator<Space> iterator() {\n return row.iterator();\n }",
"public Iterator<DataPoint> getDataPointIterator() {\n Iterator<DataPoint> iteData = new Iterator<DataPoint>() {\n int cur = 0;\n int to = size();\n\n @Override\n public boolean hasNext() {\n return cur < to;\n }\n\n @Override\n public DataPoint next() {\n return getDataPoint(cur++);\n }\n\n @Override\n public void remove() {\n throw new UnsupportedOperationException(\"This operation is not supported for DataSet\");\n }\n };\n\n return iteData;\n }",
"public Iterator iterator() {return coordinates.iterator();}",
"public Iterable<Point2D> points() {\n\n return bst.keys();\n }",
"public Iterable<Point2D> points() {\n return bst.keys();\n }",
"public Iterable<Point2D> points() {\n return ST.keys();\n }",
"Iterator<Column> columnIterator();",
"@Override\r\n\tpublic boolean hasNext() {\r\n\t\t\r\n\t\tif (super.hasNext()) {\r\n\t\t\t\r\n\t\t\t/*\r\n\t\t\t * We want to avoid any array out of index exceptions, this will make sure that we \r\n\t\t\t * are only considering rows with +ve indices, which are real.\r\n\t\t\t * */\r\n\t\t\tif (previousRow > -1) {\r\n\t\t\t\t\r\n\t\t\t\tTuple row = this.table.getTuple(this.previousRow);\r\n\t\t\t\tString timeStep = row.get(this.timeStepTableColumnName).toString();\r\n\t\t\t\t\r\n\t\t\t\tif (Integer.parseInt(timeStep) > this.timestepBounds.getUpperbound()) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t} \r\n\t\t\t\t\r\n\t\t\t\tif (Integer.parseInt(timeStep) < this.timestepBounds.getLowerbound()) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public Queue<Point> getPoints() {\n\tQueue<Point> iter = new Queue<Point>();\n\tfor (Shape s : this.shapes) {\n\t for (Point p : s.getPoints())\n\t\titer.enqueue(p);\n\t}\n\n\treturn iter;\n }",
"public ArrayList<Point> nullPoint() {\n\t\tArrayList<Point> points = new ArrayList<Point>();\n\t\tfor (int r=0; r<rows(); r=r+1) {\n\t\t\tfor (int c=0; c<cols(); c=c+1) {\n\t\t\t\tPoint p = new Point(r,c);\n\t\t\t\tif(get(p)==null) {\n\t\t\t\t\tpoints.add(p);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn points;\n\t}",
"Iterator<Row> rowIterator();",
"public boolean hasNext() {\n while (idxRow < nums.length && idxCol == nums[idxRow].length ) {\n idxRow++;\n idxCol = 0;\n }\n\n return idxRow < nums.length;\n }",
"public java.util.Iterator<java.lang.Integer> iterator() {\n return new Iterator<Integer>() {\n /*the current node pointer*/\n private BinaryTreeNode currentNode = smallestNode;\n\n /**\n * checks if our iterator has a next value.\n * @return - the next true if it has, false otherwise.\n */\n @Override\n public boolean hasNext() {\n return (currentNode != null);\n }\n\n /**\n * returns the next value (integer) in the iteration.\n * @return - the next value.\n * @throws NoSuchElementException if iterator has no next value.\n */\n @Override\n public Integer next() {\n if (hasNext()) {\n Integer valueToReturn = currentNode.getValue();\n currentNode = findSuccessor(currentNode);\n return valueToReturn;\n } else {\n throw new NoSuchElementException();\n }\n }\n\n };\n }",
"public List<Point> getPoints() {\n return pointRepository.findAll()//\n .stream() //\n .sorted((p1, p2) -> Integer.compare(p1.getPosition(), p2.getPosition()))//\n .collect(Collectors.toList());\n }",
"protected PrimitiveIterator.OfInt sourceRowNumberIterator() {\n if (this.isSorted()) {\n return Arrays.stream(sortOrder).iterator();\n } else if (this.hasSelection()) {\n return selection.iterator();\n }\n return Selection.withRange(0, table.rowCount()).iterator();\n }",
"@Override\n public Iterator<Row> iterator() {\n\n return new Iterator<Row>() {\n\n private final Row row = new Row(TableSlice.this);\n\n @Override\n public Row next() {\n return row.next();\n }\n\n @Override\n public boolean hasNext() {\n return row.hasNext();\n }\n };\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Gets the num of connections.
|
public int getNumOfConnections() {
return numOfConnections;
}
|
[
"int getConnectionsCount();",
"public int nConnections() {\n\t\treturn _connections.size();\n\t}",
"public int getCountOpenConnections() { return connectionCount.get(); }",
"public int getTotalConnections();",
"public int getNumConnects() {\n\t\treturn numConnects;\n\t}",
"public static int getConnectionCount()\r\n {\r\n return count_; \r\n }",
"public int getTotalConnections()\n {\n // return _connections.size();\n return 0;\n }",
"public int getCountUsedConnections() { return connectionCount.get() - connLeaser.availablePermits(); }",
"int getTotalCreatedConnections();",
"public int getNumClientsConnected() {\n return clientsConnected.size();\n }",
"public Long getTotalConnections() {\n return totalConnections;\n }",
"public int getMaxConnections();",
"int getMaxConnections() {\n return maxConnections;\n }",
"public int getActiveConnectionCount() {\n return activeConnectionCount;\n }",
"public int getMaxConnections()\n throws SQLException\n {\n return 0;\n }",
"int getConnPoolsize();",
"public int getMaxConnections() {\n return maxConnections;\n }",
"public int getConnectedPeers() {\n return connectionPool.getConnected();\n }",
"int getServerSocketCount();"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Returns the result of interpreting the object as an instance of 'Guarantee Statement'. This implementation returns null; returning a nonnull result will terminate the switch.
|
public T caseGuaranteeStatement(GuaranteeStatement object) {
return null;
}
|
[
"AGCLGuarantee getGuarantee();",
"public T caseMedicationStatement(MedicationStatement object) {\n\t\treturn null;\n\t}",
"public T casePrecondition(Precondition object)\n {\n return null;\n }",
"public T caseLemmaStatement(LemmaStatement object) {\n\t\treturn null;\n\t}",
"public T caseAgreement(Agreement object) {\n\t\treturn null;\n\t}",
"public T caseStatement(Statement object)\n {\n return null;\n }",
"public T caseMNSynchStatement(MNSynchStatement object) {\n\t\treturn null;\n\t}",
"public T caseAssertStatement(AssertStatement object) {\n\t\treturn null;\n\t}",
"public T caseAsynchStatement(AsynchStatement object) {\n\t\treturn null;\n\t}",
"public T caseReturnStatement(ReturnStatement object) {\n\t\treturn null;\n\t}",
"public T casePragmaValue(PragmaValue object) {\n\t\treturn null;\n\t}",
"public T caseScriptStatement(ScriptStatement object) {\n return null;\n }",
"public T caseThrowStatement(ThrowStatement object) {\n\t\treturn null;\n\t}",
"public T caseAlwaysStatement(AlwaysStatement object) {\n\t\treturn null;\n\t}",
"public T casePragma(Pragma object) {\n\t\treturn null;\n\t}",
"public T caseDynamics(Dynamics object) {\r\n\t\treturn null;\r\n\t}",
"public T caseTgtStatement(TgtStatement object)\n {\n return null;\n }",
"public T caseDoStatement(DoStatement object) {\n\t\treturn null;\n\t}",
"public T caseConformanceStatementKind(ConformanceStatementKind object) {\n\t\treturn null;\n\t}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Parse virtual path which is in format /groupId/projectId/datasetId/directory into the 4 component values
|
FilePathInfo parseVirtualPath(String path);
|
[
"String createVirtualPath(Long groupId, Long projectId, Long datasetId, String directory);",
"private void parseUrlsPaths(String localPath) {\n String[] pathArray = localPath.split(\"/\");\n // Geometry_305_v6_fb_coupe_frontlightbulb1_a001.b3d.dflr\n this.fileName = pathArray[pathArray.length - 1];\n // /cars/mustang2015/geometry/\n this.subDirectory = localPath.replace(\"/\" + this.fileName, \"\");\n }",
"String createVirtualPath(Long groupId, Long projectId, Long datasetId);",
"private static Vector<String> Path(String pathname)\n {\n \n \n Vector<String> hier = new Vector<String>();\n String[] Split = pathname.split(\"/\");\n for (String directory :Split)\n {\n if (directory != null && directory.length() > 0)\n {\n hier.add(directory);\n }\n }\n return hier;\n \n }",
"private Path parseRemotePath(String raw_path) {\n // The current path object. This is set initially to either the root\n // directory or the path obtained from parsing the value of DFSCWD, and\n // modified as components are parsed.\n Path current_path;\n // Index into remote_path from which the next component is to be read.\n int cursor_position;\n // Index to the end of the component that is to be read.\n int end_of_component;\n\n // Check if the path begins with the separator. If so, it is an absolute\n // path. Otherwise, it is relative.\n if (raw_path.indexOf(separator) == 0) {\n // If the path is absolute, begin assembling the Path object from\n // the root directory, and set the cursor position to ignore the\n // first separator.\n current_path = new Path();\n cursor_position = 1;\n } else {\n // If the path is absolute, first retrieve the working directory\n // string from the DFSCWD environment variable.\n String working_directory;\n\n try {\n working_directory = System.getenv(directory_variable);\n } catch (Throwable t) {\n throw new IllegalArgumentException(\"cannot retrieve value of \" + directory_variable);\n }\n\n // If DFSCWD is not set, use / as a default value.\n if (working_directory == null)\n working_directory = separator;\n\n // Attempt to create a base path from the value of DFSCWD.\n try {\n current_path = new Path(working_directory);\n } catch (IllegalArgumentException e) {\n throw new IllegalArgumentException(\"cannot parse contents of \" + directory_variable + \": \" + e.getMessage());\n }\n\n // Set the cursor position so that the first component of the\n // relative path begins with the first character.\n cursor_position = 0;\n }\n\n // As long as the cursor position is not moved past the end of the path,\n // search for the end of each component, and adjust the current path\n // according to the component found.\n while (cursor_position < raw_path.length()) {\n end_of_component = raw_path.indexOf(separator, cursor_position);\n if (end_of_component == -1)\n end_of_component = raw_path.length();\n\n String component = raw_path.substring(cursor_position, end_of_component);\n\n // Advance the cursor position past the separator found. If no\n // separator was found, this will move the cursor position past the\n // end of the given path string, terminating the loop after this\n // iteration. This will also terminate the loop if the path happens\n // to end with a separator.\n cursor_position = end_of_component + 1;\n\n // If the component is empty, it refers to the current directory -\n // do not modify the path.\n if (component.length() == 0)\n continue;\n\n // If the component is the current directory, do not modify the\n // path.\n if (component.equals(current_directory))\n continue;\n\n // If the component is the parent directory, check that the current\n // path is not the root directory. If not, get the parent path and\n // make it the new current path.\n if (component.equals(parent_directory)) {\n if (current_path.isRoot()) {\n throw new IllegalArgumentException(\"path component \" + \"refers to parent of \" + \"root directory\");\n }\n\n current_path = current_path.parent();\n continue;\n }\n\n // If the component is a regular component, append it to the path\n // and continue to the next iteration (if there will be one).\n current_path = new Path(current_path, component);\n }\n\n return current_path;\n }",
"private void parsePath() throws AmbariException {\n Collection<String> subDirs = Arrays.asList(directory.list());\n if (subDirs.contains(RCO_FILE_NAME)) {\n // rcoFile is expected to be absolute\n rcoFilePath = getAbsolutePath() + File.separator + RCO_FILE_NAME;\n }\n\n if (subDirs.contains(LIB_FOLDER_NAME)) {\n libraryDir = getAbsolutePath() + File.separator + LIB_FOLDER_NAME;\n }\n\n if (subDirs.contains(KERBEROS_DESCRIPTOR_PRECONFIGURE_FILE_NAME)) {\n // kerberosDescriptorPreconfigureFilePath is expected to be absolute\n kerberosDescriptorPreconfigureFilePath = getAbsolutePath() + File.separator + KERBEROS_DESCRIPTOR_PRECONFIGURE_FILE_NAME;\n }\n\n parseUpgradePacks(subDirs);\n parseServiceDirectories(subDirs);\n parseRepoFile(subDirs);\n parseMetaInfoFile();\n parseRoleCommandOrder();\n parseLibraryClassLoader();\n\n }",
"VariablePath getVariablePath();",
"String getTestKVExtractionFolderName();",
"protected abstract void calculateUiRootPath(StringBuilder... sbUrls);",
"private String[] locationParser(String bundleLocation) {\n String[] parsedPath = bundleLocation.split(\"/\");\n parsedPath[0] = parsedPath[0].substring(parsedPath[0].indexOf(':') + 1, parsedPath[0].length());\n parsedPath[0] = parsedPath[0].replace('.', '/');\n\n return parsedPath;\n }",
"private void parseRawCommand() {\n String[] tokens = rawCommand.split(\":\");\n this.initialFloor = Integer.valueOf(tokens[0]);\n this.paths = Arrays.asList(tokens[1].split(\",\"))\n .stream()\n .map(item -> new Path(Integer.valueOf(item.split(\"-\")[0]), Integer.valueOf(item.split(\"-\")[1])))\n .collect(Collectors.toList());\n }",
"public PathVariables getPathVariables();",
"private void parseRebasePaths(String rebaseDefinitions) {\r\n \t\tStringTokenizer tokenizer = new StringTokenizer(rebaseDefinitions, \",\");\r\n \t\twhile (tokenizer.hasMoreTokens()) {\r\n \t\t\tString rebasePair = tokenizer.nextToken();\r\n \t\t\tint equals = rebasePair.indexOf('=');\r\n \t\t\tString fromPrefix = rebasePair.substring(0, equals);\r\n \t\t\tString toPrefix = rebasePair.substring(equals + 1);\r\n \t\t\tif (GlobalConfiguration.isRuntimeLogging && log.isLoggable(Level.INFO)) {\r\n \t\t\t\tlog.info(\"processPropertiesConfiguration: adding rebase rule from '\" + fromPrefix + \"' to '\" + toPrefix + \"'\");\r\n \t\t\t}\r\n \t\t\trebasePaths.put(fromPrefix, toPrefix);\r\n \t\t}\r\n \t}",
"String getDatasetPath(int datasetId, int versionId) {\n\n PrivilegedCarbonContext carbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext();\n int tenantId = carbonContext.getTenantId();\n String userName = carbonContext.getUsername();\n String targetPath=null;\n String version = null;\n long versionSetId=0;\n\n //to get the version\n try {\n List<MLDatasetVersion> versionSets = datasetProcessor.getAllDatasetVersions(tenantId, userName, datasetId);\n\n Iterator<MLDatasetVersion> versionsetIterator = versionSets.iterator();\n\n while (versionsetIterator.hasNext()) {\n MLDatasetVersion mlDatasetVersion= versionsetIterator.next();\n\n if (mlDatasetVersion.getId()== versionId) {\n version = mlDatasetVersion.getVersion();\n }\n else{\n version = null;\n }\n }\n\n } catch (MLDataProcessingException e) {\n String msg = MLUtils\n .getErrorMsg(\n String.format(\n \"Error occurred while retrieving all versions of a dataset with the [id] %s of tenant [id] %s and [user] %s .\",\n datasetId, tenantId, userName), e);\n log.error(msg, e);\n version = null;\n }\n\n //get target path of the Version\n try {\n versionSetId = datasetProcessor.getVersionSetWithVersion(tenantId, userName, datasetId, version).getId();\n targetPath = datasetProcessor.getVersionset(tenantId, userName,versionSetId).getTargetPath();\n return targetPath;\n\n } catch (MLDataProcessingException e) {\n String msg = MLUtils\n .getErrorMsg(\n String.format(\n \"Error occurred while retrieving the version set with [version] %s of a dataset with the [id] %s of tenant [id] %s and [user] %s .\",\n version, datasetId, tenantId, userName), e);\n log.error(msg, e);\n targetPath = null;\n }\n\n return targetPath;\n }",
"String relativeToVirtualPath(Path filePath, String uploadPath);",
"String getPageBasePath();",
"public static Vector<String> getPathElements(String localPath){\r\n\t\tVector<String> pathElements = new Vector<String>();\r\n\t\tif (localPath != null) {\r\n\t\t\tString[] elements = localPath.split(\"[/\\\\\\\\]\");\r\n\t\t\tfor (int i = 0; i < elements.length; i++) {\r\n\t\t\t\tif(elements[i] == null) continue;\r\n\t\t\t\tString element = elements[i].trim().toLowerCase();\r\n\t\t\t\tif (element.length() == 0 || element.equals(\".\")) continue;\r\n\t\t\t\tif(element.equals(\"..\")){\r\n\t\t\t\t\tif(pathElements.size() > 0){\r\n\t\t\t\t\t\tpathElements.setSize(pathElements.size()-1);\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// attempt to go above the path root. Throw an exception\r\n\t\t\t\t\t\tthrow new ModelException(ExceptionReason.INVALID_PARAMETER,\"Path \"+localPath+\"resolves above /\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tpathElements.add(element);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn pathElements;\r\n\t}",
"private List<String> getPathElements(String path) {\n return Lists.newArrayList(Splitter.on(\".\").omitEmptyStrings().split(path));\n }",
"String createVirtualPath(Long groupId, Long projectId);"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
An optional interface for plugins. If a plugin implements this interface then it can receive the reminaing attributes and directives given in its clause as well as the reporter to use.
|
public interface Plugin {
/**
* Give the plugin the remaining properties.
*
* When a plugin is declared, the clause can contain extra properties.
* All the properties and directives are given to the plugin to use.
*
* @param map attributes and directives for this plugin's clause
*/
void setProperties(Map<String,String> map);
/**
* Set the current reporter. This is called at init time. This plugin
* should report all errors and warnings to this reporter.
*
* @param processor
*/
void setReporter(Reporter processor);
}
|
[
"public interface AnalysisPluginInterface {\n\n\t/**\n\t * The framework will call this method to get the title of this analysis\n\t * plugin.\n\t * \n\t * @return The title.\n\t */\n\tString getTitle();\n\n\t/**\n\t * The framework will call this method to get the description of this\n\t * analysis plugin.\n\t * \n\t * @return The description.\n\t */\n\tString getDescription();\n\n\t/**\n\t * The framework will use the method to pass by a complete set of user's\n\t * data.\n\t * \n\t * @param data\n\t * A list of all person objects.\n\t */\n\tvoid setData(List<Person> data);\n\n\t/**\n\t * The framework will call this method to get the result. The result\n\t * should be presented in a JPanel.\n\t * \n\t * @return A JPanel the presents the result.\n\t */\n\tJPanel getPanel();\n\n}",
"public interface Plugin {\n /**\n * A list of commands that this plugins want to handle. Each\n * command has to be plain text without any prefixes.\n * @return a list of commands handled by this plugin\n */\n public String[] getCommands();\n /**\n * A list of restricted commands that this plugins want to handle. Each\n * command has to be plain text without any prefixes. The access will\n * only be allowed if the user has access to the admin functions.\n *\n * @return a list of restricted commands handled by this plugin\n */\n public String[] getRestrictedCommands();\n /**\n * This method will be called whenever an event this plugin can handle\n * occurs. The {@link IrcCommandEvent} will hold the information\n * necessary to find out which command was called.\n *\n * @param ice the Event that occured\n */\n public void handleEvent(IrcCommandEvent ice);\n /**\n * Returns help for the specified command. Each line in the array will\n * be sent to the user requesting help.<br>\n * The IrcCommandEvent will contain \"help\" as command and the command\n * that the user requested help for as message. The command will either\n * be a command that this plugin registered or the classes simple name\n * in lowercase.\n *\n * @param ice event causing this request\n * @return an array containing help for the specified command\n */\n public String[] getHelp(IrcCommandEvent ice);\n}",
"public interface QueryEnginePluginDescriptor extends PluginDescriptor {\n}",
"public interface Plugin\n{\n\tpublic String getPluginName();\n}",
"public interface Plugin {\n\n\t/**\n\t * Returns a description of the plugin, to be shown as a tooltip and/or in the\n\t * help menu.\n\t * \n\t * @return\n\t */\n\tString getDescription();\n\n\t/**\n\t * A label for buttons and menu entries\n\t * \n\t * @return\n\t */\n\tString getName();\n\n\tIkon getIkon();\n\n}",
"public interface JsHintReporter {\r\n\r\n\tpublic String createReport();\r\n}",
"private interface ReportCallback\n {\n void handleReport(DashboardReport report) throws MojoExecutionException;\n }",
"public interface JsHintReporter {\n /**\n * Write an error report to a stream\n * @param errors errors\n * @param output output stream\n * @throws MojoExecutionException if the report cannot be generated/written\n */\n public void report(Multimap<String, JsHintError> errors, OutputStream output) throws MojoExecutionException;\n}",
"public interface GeneratorPlugin extends MOGLiPlugin {\r\n\r\n\tString getGeneratorReport();\r\n\r\n\tint getNumberOfGenerations();\r\n\r\n\tint getNumberOfGeneratedArtefacts();\r\n}",
"@ProviderType\npublic interface ReportSerializerPlugin {\n\n\t/**\n\t * Get the set of file extension names corresponding to the format that this\n\t * plugin can serialize to.\n\t * \n\t * @return one or multiple extensions name, never {@code null}\n\t */\n\tpublic String[] getHandledExtensions();\n\n\t/**\n\t * Serialize the DTO report into the output stream.\n\t * \n\t * @param reportDTO the DTO report to serialize, must not be {@code null}\n\t * @param output the output stream to write the serialization result, must\n\t * not be {@code null}\n\t * @throws Exception if any errors occur during the serialization process\n\t */\n\tpublic void serialize(Map<String, Object> reportDTO, OutputStream output) throws Exception;\n}",
"public interface ConfigurableIncludedPluginBuild extends IncludedBuild {\n\n /**\n * Sets the name of the included plugin build.\n *\n * @param name the name of the build\n * @since 7.0\n */\n void setName(String name);\n}",
"public interface ICompatPlugin {\n\n // Mod ID the plugin handles\n public abstract String getModId();\n\n // Called during PreInit\n public abstract void preInit();\n\n // Called during Init\n public abstract void init();\n\n // Called during PostInit\n public abstract void postInit();\n\n}",
"public interface Plugin {\n\n\tpublic static class PluginException extends Exception {\n\t\tpublic PluginException() {\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic PluginException(String message, Throwable cause) {\n\t\t\tsuper(message, cause);\n\t\t}\n\n\t\tpublic PluginException(String message) {\n\t\t\tsuper(message);\n\t\t}\n\n\t\tpublic PluginException(Throwable cause) {\n\t\t\tsuper(cause);\n\t\t}\n\t}\n\n\t/**\n\t * Return a globally unique id for this plugin class.\n\t * This ID must be constant across runs and versions.\n\t *\n\t * @return the global identifier for this plugin\n\t */\n\tpublic String getId();\n\n\t/**\n\t * Return a user-friendly name for this plugin that can be used in messages, etc.\n\t *\n\t * @return a user-friendly name for this plugin\n\t */\n\tpublic String getDisplayName();\n\n\n\tpublic String getDescription();\n\n\t/**\n\t * Initializes the plugin, called once after the initial loading of the class.\n\t *\n\t * @param config the config settings for this plugin\n\t * @throws PluginException\n\t */\n\tpublic void init(Optional<ObjectNode> config) throws PluginException;\n}",
"public interface IDiagramPluginService {\n\n /**\n * @param request the context in which the plugins are requested.\n * @return a unmodifiable collection of the registered plugins.\n */\n public Collection<IDiagramPlugin> getRegisteredPlugins(HttpServletRequest request);\n \n /**\n * @param request the context in which the plugin is requested\n * @param name the name of the plugin to find\n * @return the plugin object or null\n */\n public IDiagramPlugin findPlugin(HttpServletRequest request, String name);\n}",
"public interface PluginAnalyse extends PluginBase {\n\t\n\tpublic JDialog analyseCurrentFolder(String currentFolder);\n}",
"public interface Plugin\n{\n /**\n * Initialize the plug-in. Plug-ins need to know the text area in order to provide only those feature that are\n * supported.\n * \n * @param textArea the text area of the editor\n * @param config the configuration object\n */\n void init(RichTextArea textArea, Config config);\n\n /**\n * @return all the user interface extensions that are provided by this plug-in\n */\n UIExtension[] getUIExtensions();\n\n /**\n * Notifies the plug-in to release its resources before being unloaded from the WYSIWYG editor.\n */\n void destroy();\n}",
"public interface Plugin {\n\n /**\n * Invoked when plugin is loaded\n */\n void Initialize();\n\n /**\n * Get plugin name\n * @return plugin name\n */\n String getName();\n\n /**\n * Show the issue management window\n * @param pmsIssue Notification for which the window should be displayed\n * @see PMSIssue\n * @param pmsUser User data\n * @see PMSUser\n *\n * @return window instance\n * @see Stage\n */\n Stage getIssueWindow(PMSIssue pmsIssue, PMSUser pmsUser);\n\n /**\n * Get a PMSManage object to control the project management system\n * @return PMSManage object\n */\n PMSManage getPMSManage();\n\n\n /**\n * When program is shutting down\n */\n void Free();\n}",
"public interface ReportCriteria\n{\n /**\n * Verifica que la seleccion correspondiente sea valida\n * @return\n */\n public boolean validateSelection();\n\n /**\n * Vuelve al estado inicial de valores del componente\n *\n */\n public void clear();\n\n /**\n * El valor que puede ser usado para el titulo de la pestaņa\n *\n * @return\n */\n public String getTabTitle();\n\n /**\n * Mensaje que se mostrara si la validacion falla.\n *\n * @return\n */\n public String getErrorMessage();\n}",
"public interface Renderer extends RenderableFacet {\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Processes the input stream against a rule set using the given input encoding.
|
public void processFile(InputStream fileContents, String encoding, RuleSets ruleSets, RuleContext ctx)
throws PMDException {
try {
processFile(new InputStreamReader(fileContents, encoding), ruleSets, ctx);
} catch (UnsupportedEncodingException uee) {
throw new PMDException("Unsupported encoding exception: " + uee.getMessage());
}
}
|
[
"public void parse(InputStream in, String charset) throws IOException,SAXException,UnsupportedEncodingException {\n\t\tWritableLineReader reader = new WritableLineReader(in, charset);\n\t\tthis.parse(reader);\n\t}",
"public void processFile(InputStream fileContents, String encoding, RuleSet ruleSet, RuleContext ctx)\n \t throws PMDException {\n \ttry {\n \t processFile(new InputStreamReader(fileContents, encoding), ruleSet, ctx);\n \t} catch (UnsupportedEncodingException uee) {\n \t throw new PMDException(\"Unsupported encoding exception: \" + uee.getMessage());\n \t}\n }",
"public final T parse(InputStream stream, String encoding) throws IOException, RecognitionException {\n return parse(new BacktrackingReader(new InputStreamReader(stream, encoding)));\n }",
"public void setInputEncoding(String inputEncoding) {\r\n this.inputEncoding = inputEncoding;\r\n }",
"protected final void setEncoding( String encoding )\n throws SAXException\n {\n if ( _inputSource.getByteStream() != null ) {\n if ( ! encoding.equalsIgnoreCase( _inputSource.getEncoding() ) ) {\n _inputSource.setEncoding( encoding );\n try {\n _reader = new InputStreamReader( new BufferedInputStream( _inputSource.getByteStream() ), encoding );\n } catch ( UnsupportedEncodingException except ) {\n error( WELL_FORMED, format( \"Parser014\", encoding ) );\n }\n }\n }\n else\n if ( isWarning() && _inputSource.getEncoding() != null &&\n ! encoding.equalsIgnoreCase( _inputSource.getEncoding() ) )\n warning( format( \"Parser015\", _inputSource.getEncoding(), encoding ) ); \n }",
"@Override\n public void setInputEncoding(String encoding) {\n inputEncoding = encoding;\n }",
"public void parse(InputStream in) throws IOException,SAXException,UnsupportedEncodingException {\n\t\tthis.parse(in, \"ISO-8859-1\");\n\t}",
"Coding getRuleset();",
"public void setInputEncoding(String encoding)\n {\n configuration.setInCharEncodingName(encoding);\n }",
"public void processFile(InputStream fileContents, RuleSet ruleSet, RuleContext ctx) throws PMDException {\n \tprocessFile(fileContents, System.getProperty(\"file.encoding\"), ruleSet, ctx);\n }",
"@Test\n public void testParseInput() {\n LOGGER.info(\"parseInput\");\n rdfEntityManager = new RDFEntityManager();\n LOGGER.info(\"oneTimeSetup\");\n CacheInitializer.initializeCaches();\n DistributedRepositoryManager.addRepositoryPath(\n \"InferenceRules\",\n System.getenv(\"REPOSITORIES_TMPFS\") + \"/InferenceRules\");\n DistributedRepositoryManager.clearNamedRepository(\"InferenceRules\");\n try {\n final File unitTestRulesPath = new File(\"data/test-rules-1.rule\");\n bufferedInputStream = new BufferedInputStream(new FileInputStream(unitTestRulesPath));\n LOGGER.info(\"processing input: \" + unitTestRulesPath);\n } catch (final FileNotFoundException ex) {\n throw new TexaiException(ex);\n }\n ruleParser = new RuleParser(bufferedInputStream);\n ruleParser.initialize(rdfEntityManager);\n final URI variableURI = new URIImpl(Constants.TEXAI_NAMESPACE + \"?test\");\n assertEquals(\"http://texai.org/texai/?test\", variableURI.toString());\n assertEquals(\"?test\", RDFUtility.formatURIAsTurtle(variableURI));\n List<Rule> rules;\n try {\n rules = ruleParser.Rules();\n for (final Rule rule : rules) {\n LOGGER.info(\"rule: \" + rule.toString());\n rule.cascadePersist(rdfEntityManager, null);\n }\n } catch (ParseException ex) {\n LOGGER.info(StringUtils.getStackTraceAsString(ex));\n fail(ex.getMessage());\n }\n Iterator<Rule> rules_iter = rdfEntityManager.rdfEntityIterator(\n Rule.class,\n null); // overrideContext\n while (rules_iter.hasNext()) {\n final Rule loadedRule = rules_iter.next();\n assertNotNull(loadedRule);\n\n // (\n // description \"if there is a room then it is likely that a table is in the room\"\n // context: texai:InferenceRuleTestContext\n // if:\n // ?situation-localized rdf:type cyc:Situation-Localized .\n // ?room rdf:type cyc:RoomInAConstruction .\n // ?situation-localized cyc:situationConstituents ?room .\n // then:\n // _:in-completely-situation-localized rdf:type texai:InCompletelySituationLocalized .\n // ?situation-localized texai:likelySubSituations _:in-completely-situation-localized .\n // _:table rdf:type cyc:Table_PieceOfFurniture .\n // _:table texai:in-ContCompletely ?room .\n // )\n\n assertEquals(\"(\\ndescription \\\"if there is a room then it is likely that a table is in the room\\\"\\ncontext: texai:InferenceRuleTestContext\\nif:\\n ?situation-localized rdf:type cyc:Situation-Localized .\\n ?room rdf:type cyc:RoomInAConstruction .\\n ?situation-localized cyc:situationConstituents ?room .\\nthen:\\n _:in-completely-situation-localized rdf:type texai:InCompletelySituationLocalized .\\n ?situation-localized texai:likelySubSituations _:in-completely-situation-localized .\\n _:table rdf:type cyc:Table_PieceOfFurniture .\\n _:table texai:in-ContCompletely ?room .\\n)\", loadedRule.toString());\n LOGGER.info(\"loadedRule:\\n\" + loadedRule);\n }\n CacheManager.getInstance().shutdown();\n try {\n if (bufferedInputStream != null) {\n bufferedInputStream.close();\n }\n } catch (final Exception ex) {\n LOGGER.info(StringUtils.getStackTraceAsString(ex));\n }\n rdfEntityManager.close();\n DistributedRepositoryManager.shutDown();\n }",
"SAPL parse(InputStream saplInputStream);",
"public final void readForSpecifiedEncoding (InputStream inputStream,\n String location)\n throws IOException\n {\n if (!inputStream.markSupported()) {\n inputStream = new BufferedInputStream(inputStream);\n }\n inputStream.mark(2048);\n encoding = IOUtil.readLine(inputStream);\n\n // Handle the case where there are trailing commas\n int commaIndex = encoding.indexOf(Comma);\n if (commaIndex != -1) {\n encoding = encoding.substring(0, commaIndex);\n }\n\n try {\n this.encodingIsExplicitlySet = true;\n read(new InputStreamReader(inputStream, encoding), location);\n }\n catch (UnsupportedEncodingException uee) {\n inputStream.reset();\n read(new InputStreamReader(inputStream), location);\n }\n }",
"public void readEncodingTable( DataInputStream in ) throws IOException\n {\n for( int i = 0; i < BitUtils.DIFF_BYTES; i++ )\n theCounts.setCount( i, 0 );\n \n int ch;\n int num;\n \n for( ; ; )\n {\n ch = in.readByte( );\n num = in.readInt( );\n if( num == 0 )\n break;\n theCounts.setCount( ch, num );\n }\n \n createTree( );\n }",
"public abstract boolean canDecodeInput(Object source) throws IOException;",
"private void decode() {\n\t\tencoding = findEncoding();\n\t\tlog.debug(\"\\tChosen encoding is {}\", encoding);\n\t\tapplyEncoding(encoding);\n\t}",
"public void testEncoding() {\n /*\n * only execute if a reference implementation is available\n */\n try {\n XMLInputFactory.newInstance();\n } catch (javax.xml.stream.FactoryConfigurationError e) {\n // no implementation found, stop the test.\n return;\n }\n\n try {\n File file = getFile(\"/xml/russArticle.xml\");\n STAXEventReader xmlReader = new STAXEventReader();\n Document doc = xmlReader.readDocument(new FileReader(file));\n\n assertEquals(\"russArticle.xml encoding wasn't correct\", \"koi8-r\",\n doc.getXMLEncoding());\n\n StringWriter writer = new StringWriter();\n STAXEventWriter xmlWriter = new STAXEventWriter(writer);\n xmlWriter.writeDocument(doc);\n\n String output = writer.toString();\n String xmlDecl = output.substring(0, output.indexOf(\"?>\") + 2);\n String expected = \"<?xml version=\\'1.0\\' encoding=\\'koi8-r\\'?>\";\n assertEquals(\"Unexpected xml declaration\", expected, xmlDecl);\n System.out.println(output);\n } catch (Exception e) {\n e.printStackTrace();\n fail(e.getMessage());\n }\n }",
"public static InputStream toInputStream(final CharSequence input, final String encoding) throws IOException {\n return toInputStream(input, Charset.forName(encoding));\n }",
"@Test\r\n public void testValidEncodings() {\r\n assertThatInputIsValid(\"\");\r\n assertThatInputIsValid(\"UTF8\");\r\n assertThatInputIsValid(\"UTF-8\");\r\n assertThatInputIsValid(\"CP1252\");\r\n assertThatInputIsValid(\"ISO-8859-1\");\r\n assertThatInputIsValid(\"ISO-8859-5\");\r\n assertThatInputIsValid(\"ISO-8859-9\");\r\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Create a shader program from more shaders
|
private static int createProgram(int[] shaderIds){
int shaderProgramId = glCreateProgram();
for(int shader: shaderIds){
if(shader != -1){
glAttachShader(shaderProgramId, shader);
}
}
glLinkProgram(shaderProgramId);
int[] linkResult = {0};
glGetProgramiv(shaderProgramId, GL_LINK_STATUS, linkResult);
if(linkResult[0] == GL_FALSE){
System.err.println("Failed to link shader program.");
String log = glGetProgramInfoLog(shaderProgramId);
System.err.println("Log: ");
System.err.println(log);
}
glValidateProgram(shaderProgramId);
int[] validationResult = {0};
glGetProgramiv(shaderProgramId, GL_VALIDATE_STATUS, validationResult);
if(validationResult[0] == GL_FALSE){
System.err.println("Failed to validate shader program.");
String log = glGetProgramInfoLog(shaderProgramId);
System.err.println("Log: ");
System.err.println(log);
}
return shaderProgramId;
}
|
[
"void create(Shader shader);",
"ShaderProgram(String vertPath, String fragPath){\n programID = glCreateProgram();\n String vertSource = \"attribute vec3 vertexPosition;\\n\" +\n \"void main(){\\n\" +\n \" gl_Position = gl_ModelViewProjectionMatrix * vec4(vertexPosition.x, vertexPosition.y, vertexPosition.z, 1.0);\\n\" +\n \"}\\n\";\n String fragSource = \"uniform vec4 color;\\n\" +\n \"void main() {\\n\" +\n \"gl_FragColor = color;\\n\" +\n \"}\";\n try {\n //vertSource = Files.lines(Paths.get(vertPath)).toString();\n //fragSource = Files.lines(Paths.get(fragPath)).toString();\n }\n catch(Exception e){\n System.out.println(e);\n }\n vertID = glCreateShader(GL_VERTEX_SHADER);\n fragID = glCreateShader(GL_FRAGMENT_SHADER);\n\n\n glShaderSource(vertID, vertSource);\n glShaderSource(fragID, fragSource);\n\n glCompileShader(vertID);\n glCompileShader(fragID);\n System.out.println(vertSource);\n\n glAttachShader(programID, vertID);\n glAttachShader(programID, fragID);\n\n glLinkProgram(programID);\n }",
"public static void createProgram() {\n sProgramHandle = Util.createProgram(VERTEX_SHADER_CODE,\n FRAGMENT_SHADER_CODE);\n Log.d(TAG, \"Created program \" + sProgramHandle);\n\n // get handle to vertex shader's a_position member\n sPositionHandle = GLES20.glGetAttribLocation(sProgramHandle, \"a_position\");\n Util.checkGlError(\"glGetAttribLocation\");\n\n // get handle to fragment shader's u_color member\n sColorHandle = GLES20.glGetUniformLocation(sProgramHandle, \"u_color\");\n Util.checkGlError(\"glGetUniformLocation\");\n\n // get handle to transformation matrix\n sMVPMatrixHandle = GLES20.glGetUniformLocation(sProgramHandle, \"u_mvpMatrix\");\n Util.checkGlError(\"glGetUniformLocation\");\n }",
"public ShaderProgram loadShader(String vsProcess, String fsProcess);",
"public void addFragmentShader(String fileName);",
"private void compileShaders (String vertexShader, String fragmentShader) {\r\n\t\tvertexShaderHandle = loadShader(GL20.GL_VERTEX_SHADER, vertexShader);\r\n\t\tfragmentShaderHandle = loadShader(GL20.GL_FRAGMENT_SHADER, fragmentShader);\r\n\r\n\t\tif (vertexShaderHandle == -1 || fragmentShaderHandle == -1) {\r\n\t\t\tisCompiled = false;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tprogram = linkProgram();\r\n\t\tif (program == -1) {\r\n\t\t\tisCompiled = false;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tisCompiled = true;\r\n fetchAttributes();\r\n fetchUniforms();\r\n\t}",
"public static int initShader(String vs, String fs){\n\n int programID = GLES20.glCreateProgram();\n if(programID != 0 ){\n GLES20.glAttachShader(programID, loadShader(GLES20.GL_VERTEX_SHADER, vs));\n GLES20.glAttachShader(programID, loadShader(GLES20.GL_FRAGMENT_SHADER, fs));\n GLES20.glLinkProgram(programID);\n int[] linkStatus = new int[1];\n GLES20.glGetProgramiv(programID, GLES20.GL_LINK_STATUS, linkStatus, 0);\n if (linkStatus[0] != GLES20.GL_TRUE) {\n// Log.e(\"shiyang\", \"shiyang GreenGLColorTopNode Could not link program: \");\n// Log.e(\"shiyang\", GLES20.glGetProgramInfoLog(mShaderProgramID));\n GLES20.glDeleteProgram(programID);\n programID = 0;\n }\n }\n return programID;\n }",
"public void compile(){\n own.setText(\"\");\n\n if(shadersFile == null || shadersFile.isEmpty()){\n throw new IllegalStateException(\"ERROR: Tried to compile shader \" + own.getFilename() + \" without.shaders file!\");\n\n }\n\n own.setText(workFolder + \"\\n\" + shadersFile + \"\\n\");\n\n\n //Get text from .shaders file\n Document shaders = new Document(workFolder + shadersFile);\n StringBuilder shadersText = new StringBuilder(shaders.getText());\n\n\n //Loop through all the shaders\n for(String s : documents.keySet()){\n\n\n\n\n //Parse the shader\n String parsedText = getStageParsed(s);\n\n\n\n //If the shaders file is empty, add the delimiter\n if(shadersText.length() == 0){\n shadersText.append(\"\\n\");\n shadersText.append(SHADERS_DELIMITER);\n shadersText.append(\"\\n\");\n }\n\n int markIndex = shadersText.indexOf(Character.toString(SHADERS_DELIMITER));\n\n\n\n //Filename of the current shader relative to .glsl file\n String relativeFilename = documents.get(s).getFilename().substring(workFolder.length());\n\n String shaderTable = shadersText.substring(0, markIndex);\n\n //If this shader is already stored in this .shaders file\n if(shaderTable.contains(relativeFilename)){\n //(not space or \\n) (1 or more digits) (one or more digits)\\n\n Pattern p = Pattern.compile(\"([^ \\n]+) (\\\\d+) (\\\\d+)\\n\");\n Matcher m = p.matcher(shaderTable);\n //Updated shader table\n StringBuffer b = new StringBuffer();\n\n //Change of lenght after updating shader source\n int change = 0;\n\n\n while(m.find()){\n String fileName = m.group(1);\n int start = Integer.parseInt(m.group(2));\n int end = Integer.parseInt(m.group(3));\n\n if(fileName.equals(relativeFilename)){\n\n //Replace shader source, calculate change of lenght, update values in shader table\n shadersText.replace(start + markIndex, end + markIndex, parsedText);\n change = parsedText.length() - (end - start);\n m.appendReplacement(b, fileName + \" \" + start + \" \" + (end + change) + \"\\n\");\n continue;\n }\n\n m.appendReplacement(b, fileName + \" \" + (start + change) + \" \" + (end + change) + \"\\n\");\n\n\n }\n\n\n shadersText.replace(0, markIndex, b.toString());\n\n }else{\n //Add new row to shader table and add the source\n shadersText.insert(markIndex, relativeFilename + \" \" + (shadersText.length() - markIndex) + \" \" + (shadersText.length() - markIndex + parsedText.length()) + \"\\n\");\n\n shadersText.append(parsedText);\n\n }\n\n\n shaders.setText(shadersText.toString());\n shaders.save();\n\n //Add this shader to .glsl file (with the prefix)\n own.setText(own.getText() + s + relativeFilename + \"\\n\");\n\n\n\n\n documents.get(s).save();\n }\n\n own.save();\n saved.setValue(true);\n\n }",
"public void initShader(Context context) {\n //Load the script content of the vertex shader\n mVertexShader = com.picovr.cloudxrclientdemo.test.ShaderUtil.loadFromAssetsFile(\"vertex.sh\", context.getResources());\n //Load the script content of the fragment shader\n mFragmentShader = com.picovr.cloudxrclientdemo.test.ShaderUtil.loadFromAssetsFile(\"frag.sh\", context.getResources());\n //Create program based on vertex shader and fragment shader\n mProgram = createProgram(mVertexShader, mFragmentShader);\n //Get the vertex position attribute reference in the program\n maPositionHandle = GLES30.glGetAttribLocation(mProgram, \"aPosition\");\n //Get the reference of the vertex texture coordinate attribute in the program\n maTexCoorHandle = GLES30.glGetAttribLocation(mProgram, \"aTexCoor\");\n //Get the reference of the total transformation matrix in the program\n muMVPMatrixHandle = GLES30.glGetUniformLocation(mProgram, \"uMVPMatrix\");\n }",
"public void setFragmentShader(int shader);",
"public static void main( String[] args ) throws LWJGLException, IOException\n {\n TestingHelper.createDisplay();\n TestingHelper.setupGL();\n\n Shader vertexShader = new Shader( GL_VERTEX_SHADER_ARB );\n Shader fragmentShader = new Shader( GL_FRAGMENT_SHADER_ARB );\n\n vertexShader.setSource( new File( \"shaders/ambient/Vertex.glsl\" ) );\n fragmentShader.setSource( new File( \"shaders/ambient/Fragment.glsl\" ) );\n\n System.out.printf( \"Vertex: %b%n\", vertexShader.getCompileStatus() );\n System.out.printf( \"> %s%n\", vertexShader.getErrorLog() );\n\n System.out.printf( \"Fragment: %b%n\", fragmentShader.getCompileStatus() );\n System.out.printf( \"> %s%n\", fragmentShader.getErrorLog() );\n\n ShaderProgram program = new ShaderProgram();\n program.attachShader( vertexShader );\n program.attachShader( fragmentShader );\n program.link();\n program.validate();\n\n System.out.printf( \"Link %b%n\", program.isLinked() );\n System.out.printf( \"Validated %b%n\", program.isValidated() );\n\n while ( !Display.isCloseRequested() )\n {\n program.enable();\n render();\n ShaderProgram.disable();\n\n TestingHelper.updateDisplay( \"ShaderTest\", 60 );\n }\n\n program.delete();\n fragmentShader.delete();\n vertexShader.delete();\n\n }",
"private static int loadShader(int type, String shaderCode){\n int shader = GLES20.glCreateShader(type);\n\n // add the source code to the shader and compile it\n GLES20.glShaderSource(shader, shaderCode);\n GLES20.glCompileShader(shader);\n\n return shader;\n }",
"public static int loadShader(int type, String shaderCode){\n int shader = GLES20.glCreateShader(type);\n \n // add the source code to the shader and compile it\n GLES20.glShaderSource(shader, shaderCode);\n GLES20.glCompileShader(shader);\n \n return shader;\n }",
"public static Program createProgram(Context context, int vertexShaderResourceId, int fragmentShaderResourceId,\n List<String> _attrs, List<String> _uniforms) {\n int program = createProgram(loadGLShader(context, GLES20.GL_VERTEX_SHADER, vertexShaderResourceId),\n loadGLShader(context, GLES20.GL_FRAGMENT_SHADER, fragmentShaderResourceId));\n ShaderAttributesLocations shaderAttributeLocations = getShaderAttributeLocations(program, _attrs, _uniforms);\n checkGLError(\"GLHelper createProgram\");\n return new Program(program, shaderAttributeLocations);\n }",
"private static void loadShaders() {\n\t\tShader.StandardShader = new Shader(\n\t\t\t\tN3D.class.getClassLoader().getResourceAsStream(\"shaders/standard.vert\"),\n\t\t\t\tN3D.class.getClassLoader().getResourceAsStream(\"shaders/standard.frag\"));\n\n\t}",
"public void startShader() {\n if (state == State.INITIALIZED) {\n gl.glUseProgram(glslContext);\n state = State.IN_USE;\n }\n loadedUniforms.clear();\n loadedAttributes.clear();\n }",
"public void init(BaseFactory factory) {\n\n GLCreated = isGLContextCreated();\n\n baseTexture = factory.gen.textureResources(R.drawable.uvmap2);\n baseShader = factory.gen.shaderResource(BaseShader.TEXTURE, R.raw.texture_vert, R.raw.texture_frag, \"u_MVPMatrix\", \"a_Position\", \"a_TexCoordinate\");\n factory.gen.shaderResource(BaseShader.COLOR, R.raw.one_color_vert, R.raw.color_frag, \"u_MVPMatrix\", \"a_Position\", \"u_Color\");\n factory.gen.shaderResource(BaseShader.TEXTURE_COLOR, R.raw.texture_fade_vert, R.raw.texture_fade_frag, \"u_MVPMatrix\", \"a_Position\", \"a_TexCoordinate\", \"u_Color\");\n factory.gen.shaderResource(BaseShader.INSTANCING, R.raw.particle_vert, R.raw.particle_frag, \"u_VPMatrix\", \"a_Position\", \"a_Texture\", \"a_Color\", \"u_ScaleRatio\", \"u_SpriteSize\");\n\n/*\n new BaseShader(SHADERS[1], \"u_MVPMatrix\", \"a_Position\", \"a_Color\")\n .loadShadersFromResources(R.raw.color_vert, R.raw.color_frag);\n\n new BaseShader(SHADERS[2], \"u_MVPMatrix\", \"a_Position\", \"a_TexCoordinate\", \"u_Light\", \"u_Texture\", \"u_Normals\")\n .loadShadersFromResources(R.raw.bump_vert, R.raw.bump_frag);\n\n new BaseShader(SHADERS[5], \"u_MVPMatrix\", \"a_Position\", \"a_TexCoordinate\", \"u_Center\")\n .loadShadersFromResources(R.raw.blur_vert, R.raw.blur_frag);\n*/\n }",
"private void SetupUniforms(NvGLSLProgram program){\n }",
"public static void useProgram(BaseShader shader) {\n\n // if (shader.glid != currentProgram) {\n GLES20.glUseProgram(shader.glid);\n currentProgram = shader.glid;\n // }\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Unsets the "state" element
|
public void unsetState()
{
synchronized (monitor())
{
check_orphaned();
get_store().remove_element(STATE$16, 0);
}
}
|
[
"void unsetState();",
"public void clearState();",
"public void unsetState()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_attribute(STATE$14);\r\n }\r\n }",
"public void unsetState()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_attribute(STATE$38);\r\n }\r\n }",
"public void resetState();",
"public void reset() {\r\n state = 0;\r\n }",
"void invalidateState();",
"void removeState(int state){\n this.closeStateSettingsRectangle();\n this.closeTransitionSettingsRectangle();\n\n StateGroup stateGroup = stateGroups.remove(state);\n graphGroup.getChildren().remove(stateGroup);\n\n for(int i = state; i < stateGroups.size(); i++)\n stateGroups.get(i).state -= 1;\n }",
"protected void resetState()\n {\n // Nothing to do by default.\n }",
"private void clearStateInfo(){\r\n cmbState.removeAllItems();\r\n }",
"public void\n\t invalidateState()\n\t //\n\t ////////////////////////////////////////////////////////////////////////\n\t {\n\t if (state != null) {\n\t\t\t\tstate.destructor();\n\t\t\t\tstate = null;\n\t }\n\t }",
"public void clearButtonState() {\n downButton.clear();\n upButton.clear();\n setChanged();\n notifyObservers();\n }",
"public void unsetStateOrProvince()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(STATEORPROVINCE$6, 0);\r\n }\r\n }",
"public my.mudah.beam.test.action_states_pkey.Builder clearStateId() {\n state_id = null;\n fieldSetFlags()[2] = false;\n return this;\n }",
"void clearObjectFlowStates();",
"@Override\n public void rnnClearPreviousState() {\n stateMap.clear();\n tBpttStateMap.clear();\n }",
"public void unsetStateOrProvince()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(STATEORPROVINCE$2, 0);\r\n }\r\n }",
"public void resetToMaxState();",
"public void setOff(){\n state = false;\n //System.out.println(\"El requerimiento esta siendo atendido!\");\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Performs maintenance on a virtual machine in a VM scale set.
|
@ServiceMethod(returns = ReturnType.SINGLE)
SyncPoller<PollResult<Void>, Void> beginPerformMaintenance(
String resourceGroupName, String vmScaleSetName, String instanceId, Context context);
|
[
"@ServiceMethod(returns = ReturnType.SINGLE)\n void performMaintenance(String resourceGroupName, String vmScaleSetName, String instanceId);",
"@ServiceMethod(returns = ReturnType.SINGLE)\n void performMaintenance(String resourceGroupName, String vmScaleSetName, String instanceId, Context context);",
"public void scaleCPU(int scaleToVal)\r\n\t{\r\n\t\t\r\n\t\tString vmname = config.getvm_name();\r\n\t\tint currentCPUCap, scaleToCPUCap;\r\n\t\tProcessBuilder p = new ProcessBuilder(\"/bin/bash\",\"-c\",\"xm sched-credit\");\r\n\t\tProcess proc;\r\n\t\ttry {\r\n\t\t\tproc = p.start();\r\n\t\t\t\r\n\t\t\tBufferedReader output = new BufferedReader(new InputStreamReader(proc.getInputStream()));\r\n\t\t\tBufferedReader error = new BufferedReader(new InputStreamReader(proc.getErrorStream()));\r\n\t\t\t\r\n\t\t\tString line = \"\";\r\n\t\t\t\r\n\t\t\twhile ((line = output.readLine()) != null) {\r\n\t\t\t\tString parts[] = line.split(\"\\\\s+\");\r\n\t\t\t\tif (vmname.equals(parts[0]))\r\n\t\t\t\t{\r\n\t\t\t\t\tcurrentCPUCap=Integer.parseInt(parts[2]);\r\n\t\t\t\t\tif(scaleToVal > 0 && scaleToVal <= 10)\r\n\t\t\t\t\t\tscaleToCPUCap = currentCPUCap - 64;\r\n\t\t\t\t\telse if(scaleToVal > 85)\r\n\t\t\t\t\t\tscaleToCPUCap = currentCPUCap + 256;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tscaleToCPUCap = currentCPUCap + 64;\r\n\t\t\t\t\t\r\n\t\t\t\t\tlogger.info(\"Elastically Scaling CPU value : \" + scaleToCPUCap);\r\n\t\t\t\t\t\r\n\t\t\t\t\tp = new ProcessBuilder(\"/bin/bash\",\"-c\",\"xm sched-credit -d \"+vmname+\" -w \"+scaleToCPUCap);\r\n\t\t\t\t\tproc = p.start();\r\n\t\t\t\t\tBufferedReader innerOutput = new BufferedReader(new InputStreamReader(proc.getInputStream()));\r\n\t\t\t\t\tBufferedReader innerError = new BufferedReader(new InputStreamReader(proc.getErrorStream()));\r\n\t\t\t\t\twhile ((line = innerError.readLine()) != null) {\r\n\t\t\t\t\t\tparts = line.split(\":\");\r\n\t\t\t\t\t\tif (\"Error\".equals(parts[0]))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tlogger.error(\"Command didn't execute successfully: xm sched-credit -d \"+vmname+\" -w \"+scaleToCPUCap);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\t\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(e.getMessage());\r\n\t\t}\r\n\t}",
"public void scaleMemory(int scaleToVal)\r\n\t{\r\n\t\tlogger.info(\"Elastically Scaling Memory Value : \" + scaleToVal);\r\n\t\tString vmname = config.getvm_name();\r\n\t\tProcessBuilder p = new ProcessBuilder(\"/bin/bash\",\"-c\",\"xm mem-set \"+vmname+ \" \"+scaleToVal);\r\n\t\tProcess proc;\r\n\t\ttry {\r\n\t\t\tproc = p.start();\r\n\t\t\t\r\n\t\t\tBufferedReader output = new BufferedReader(new InputStreamReader(proc.getInputStream()));\r\n\t\t\tBufferedReader error = new BufferedReader(new InputStreamReader(proc.getErrorStream()));\r\n\t\t\t\r\n\t\t\tString line = \"\";\r\n\t\t\twhile ((line = error.readLine()) != null) {\r\n\t\t\t\tString parts[] = line.split(\":\");\r\n\t\t\t\tif (\"Error\".equals(parts[0]))\r\n\t\t\t\t{\r\n\t\t\t\t\tlogger.error(\"Command didn't execute successfully: xm mem-set \"+vmname+\" \"+scaleToVal);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(e.getMessage());\r\n\t\t}\r\n\t}",
"@ServiceMethod(returns = ReturnType.SINGLE)\n SyncPoller<PollResult<Void>, Void> beginPerformMaintenance(\n String resourceGroupName, String vmScaleSetName, String instanceId);",
"public boolean scaleOut(String scaleLevel){\r\n\t\tSystem.out.println(\"[DomainManager:30] Somebody is asking for resources\");\r\n\t\tlong init = System.currentTimeMillis();\r\n\t\tif(!scaleLevel.equals(\"vm\")){\r\n\t\t\ttry {\r\n\t\t\t\tVirtualMachine vm = new VirtualMachine(4,oneClient);\r\n\t\t\t\tString xml = vm.info().getMessage();\r\n\t\t\t\tString ip = xml.substring(xml.indexOf(\"<ETH0_IP>\") + 18, xml.indexOf(\"</ETH0_IP>\") - 3);\r\n\r\n\t\t\t\tInetAddress inet = InetAddress.getByName(ip);\r\n\t\t\t\tOneResponse rc = vm.resume();\r\n\t\t\t if( rc.isError() ){\r\n\t\t\t System.out.println( \"failed!\");\r\n\t\t\t throw new Exception( rc.getErrorMessage() );\r\n\t\t\t }\r\n\t\t\t\twhile(!inet.isReachable(180000));\r\n\t\t\t\tif(inet.isReachable(10)){\r\n\t\t\t\t\tSystem.out.println(\"time spent to be reachable \" + (System.currentTimeMillis() - init)/1000 + \" ms\");\r\n\t\t\t\t\tFrontEnd.getInstance().updateServices();\r\n\t\t\t\t\tfor(EndPoint ep : FrontEnd.getInstance().getService(\"delay\").getEndPoints()){\r\n\t\t\t\t\t\tSystem.out.println(\"[DomainManager:52] Endpoint \" + ep.getEndpoint());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} catch (ClientConfigurationException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t} else\r\n\t\t\tSystem.out.println(\"Selecting a new VM and starting the remote object\");\r\n\t\treturn true;\r\n\t}",
"public void powerOnVM(OccpVM vm) throws OccpException;",
"VmInstance upgradeDowngradeVM(VmInstance vminstance) throws Exception;",
"public void rescaleByG(){\r\n\t\tSystem.out.println(\" rescaling all the cloudlets by group\");\r\n\t\tboolean contG = true;\r\n\t\tList<Double>computeCostTemp = new ArrayList<Double>();\r\n\t\tfor(int i = 0;i <= cloudletList.size() - 1;i++){\r\n\t\t\tcomputeCostTemp.add(computeCostA.get(i));\r\n\t\t}\r\n\t\twhile(contG){\r\n\t\t\tint selectVmId = -1;\r\n\t\t\tdouble maxSavedED = Double.NEGATIVE_INFINITY;\r\n\t\t\t//\tReset the temporary cloudlet compute cost for all the cloudlets after scaling in some virtual machine\r\n\t\t\tfor(Cloudlet cl:cloudletList){\r\n\t\t\t\tcomputeCostTemp.set(cl.getCloudletId(),computeCostA.get(cl.getCloudletId()));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor(Vm vm:vmList){\r\n\t\t\t\tdouble cloudletESum = 0;\r\n\t\t\t\tdouble cloudletEDSum = 0;\r\n\t\t\t\tdouble savedEDTemp = 0;\r\n\t\t\t\tdouble makespanTemp = 0;\r\n\t\t\t\t//\tReset the state\r\n\t\t\t\tfor(Cloudlet cl:cloudletList){\r\n\t\t\t\t\tDouble[] temp = {(Double)0.0,(Double)0.0};\r\n\t\t\t\t\tsetExeTimeTemp(cl.getCloudletId(),temp);\r\n\t\t\t\t}\r\n\t\t\t\tfor(Vm vm_reset:vmList){\r\n\t\t\t\t\tvm_reset.setAvailTime(0);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//\tReset the temporary cloudlet compute cost for all the cloudlets after scaling in some virtual machine\r\n\t\t\t\tfor(Cloudlet cl:cloudletList){\r\n\t\t\t\t\tcomputeCostTemp.set(cl.getCloudletId(),computeCostA.get(cl.getCloudletId()));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(vm.getCloudletInVm().isEmpty()){\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//\tTentatively increase the level for all the cloudlets in the vm, and calculate the makespan and energy saving value after that\r\n\t\t\t\tfor(int cloudletId:vm.getCloudletInVm()){\r\n\t\t\t\t\tCloudlet cl = getCloudletById(cloudletId);\r\n\t\t\t\t\tif(cl.getLevel() == vm.getMaxVfLevel()){\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tDouble temp = computeCostA.get(cloudletId) * ( vm.getVfListByLevel(cl.getLevel())[1]/vm.getVfListByLevel(cl.getLevel() + 1)[1] );\r\n\t\t\t\t\tcomputeCostTemp.set(cloudletId, temp);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t//\tIf the energy saving value is heavier, and satisfied the deadline, slect the vm\r\n\t\t\t\t//\tReassign the cloudlets in the select virtual machine\r\n\t\t\t\treAssignCloudlet(cloudletList,computeCostTemp);\r\n\t\t\t\t\r\n\t\t\t\t//\tCompute the energy consumption of all the cloudlets\r\n\t\t\t\tfor(Cloudlet cl:cloudletList){\r\n\t\t\t\t\tint level = cl.getLevel();\r\n\t\t\t\t\tif(vm.getCloudletInVm().contains(cl.getCloudletId()) && (cl.getLevel() != vm.getMaxVfLevel()) ){\r\n\t\t\t\t\t\tlevel += 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdouble exeTime = getExeTimeTemp(cl.getCloudletId())[1] - getExeTimeTemp(cl.getCloudletId())[0];\r\n\t\t\t\t\tcloudletEDSum += computeCloudletE(cl,level,exeTime);\r\n\t\t\t\t}\r\n\t\t\t\tsavedEDTemp = curED - cloudletEDSum;\r\n\t\t\t\tmakespanTemp = getExeTimeTemp(cloudletList.size() - 1)[1];\r\n\t\t\t\tdouble vmETemp = 0;\r\n\t\t\t\tfor(Vm vmIdle:vmList){\r\n\t\t\t\t\tdouble workTime = 0;\r\n\t\t\t\t\tfor(int cloudletIdInVm:vmIdle.getCloudletInVm()){\r\n\t\t\t\t\t\tworkTime += computeCostTemp.get(cloudletIdInVm);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvmETemp += computeIdleE(vmIdle,makespanTemp - workTime);\r\n\t\t\t\t}\r\n\t\t\t\tcloudletESum = cloudletEDSum + vmETemp;\r\n\t\t\t\t\r\n\t\t\t\tif( (makespanTemp <= deadline)&&( cloudletESum <= C*baseE )&&( savedEDTemp > maxSavedED ) ){\r\n\t\t\t\t\tselectVmId = vm.getVmId();\r\n\t\t\t\t\tmaxSavedED = savedEDTemp;\r\n//\t\t\t\t\tSystem.out.println(\"......\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\tif(selectVmId == -1){\r\n\t\t\t\t//\tQuite the loop\r\n\t\t\t\tcontG = false;\r\n\t\t\t}else{\r\n\t\t\t\t//\tApply the scaling in the virtual machine whose id is selectVmId\r\n\t\t\t\t//\tReset the state\r\n\t\t\t\tfor(Cloudlet cl:cloudletList){\r\n\t\t\t\t\tDouble[] temp = {(Double)0.0,(Double)0.0};\r\n\t\t\t\t\tsetExeTimeTemp(cl.getCloudletId(),temp);\r\n\t\t\t\t}\r\n\t\t\t\tfor(Vm vm_reset:vmList){\r\n\t\t\t\t\tvm_reset.setAvailTime(0);\r\n\t\t\t\t}\r\n\t\t\t\t//\tReset the temporary cloudlet compute cost for all the cloudlets after scaling in some virtual machine\r\n\t\t\t\tfor(Cloudlet cl:cloudletList){\r\n\t\t\t\t\tcomputeCostTemp.set(cl.getCloudletId(),computeCostA.get(cl.getCloudletId()));\r\n\t\t\t\t}\r\n\t\t\t\t//\tIncrease the level for all the cloudlets in the vm, and calculate the makespan and energy saving value after that\r\n\t\t\t\tVm vm = vmList.get(selectVmId);\r\n\t\t\t\tfor(int cloudletId:vm.getCloudletInVm()){\r\n\t\t\t\t\tCloudlet cl = getCloudletById(cloudletId);\r\n\t\t\t\t\tif(cl.getLevel() == vm.getMaxVfLevel()){\r\n\t\t\t\t\t\tcontG = false;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tDouble temp = computeCostA.get(cloudletId) * ( vm.getVfListByLevel(cl.getLevel())[1]/vm.getVfListByLevel(cl.getLevel() + 1)[1] );\r\n\t\t\t\t\tcomputeCostTemp.set(cloudletId, temp);\r\n\t\t\t\t\tcl.setLevel(cl.getLevel() + 1);\r\n\t\t\t\t}\r\n\t\t\t\treAssignCloudlet(cloudletList,computeCostTemp);\r\n\t\t\t\tfor(Cloudlet cl:cloudletList){\r\n\t\t\t\t\tcomputeCostA.set(cl.getCloudletId(), computeCostTemp.get(cl.getCloudletId()));\r\n\t\t\t\t}\r\n\t\t\t\tfor(Cloudlet cl:cloudletList){\r\n\t\t\t\t\tcl.setAst(getExeTimeTemp(cl.getCloudletId())[0]);\r\n\t\t\t\t\tcl.setAft(getExeTimeTemp(cl.getCloudletId())[1]);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//\tCompute the energy consumption of all the cloudlets\r\n\t\t\t\tdouble cloudletESum = 0;\r\n\t\t\t\tdouble cloudletEDSum = 0;\r\n\t\t\t\tdouble makespanTemp = 0;\r\n\t\t\t\tfor(Cloudlet cl:cloudletList){\r\n\t\t\t\t\tint level = cl.getLevel();\r\n//\t\t\t\t\tSystem.out.println(level);\r\n\t\t\t\t\tdouble exeTime = getExeTimeTemp(cl.getCloudletId())[1] - getExeTimeTemp(cl.getCloudletId())[0];\r\n\t\t\t\t\tcloudletEDSum += computeCloudletE(cl,level,exeTime);\r\n\t\t\t\t}\r\n\t\t\t\tmakespanTemp = getExeTimeTemp(cloudletList.size() - 1)[1];\r\n\t\t\t\tdouble vmETemp = 0;\r\n\t\t\t\tfor(Vm vmIdle:vmList){\r\n\t\t\t\t\tdouble workTime = 0;\r\n\t\t\t\t\tfor(int cloudletIdInVm:vmIdle.getCloudletInVm()){\r\n\t\t\t\t\t\tworkTime += computeCostTemp.get(cloudletIdInVm);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvmETemp += computeIdleE(vmIdle,makespanTemp - workTime);\r\n\t\t\t\t}\r\n\t\t\t\tcurE = cloudletEDSum + vmETemp;\r\n\t\t\t\tcurED = cloudletEDSum;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}",
"public void powerOff() \n {\n try \n {\n // your code here\n \tSystem.out.println(\"Powering off virtual machine '\"+vm.getName() +\"'. Please wait...\"); \n \tTask t=vm.powerOffVM_Task();\n \tif(t.waitForTask()== Task.SUCCESS)\n \t{\n\t \tSystem.out.println(\"Virtual machine powered off.\");\n\t \tSystem.out.println(\"====================================\");\n \t}\n \telse\n \t\tSystem.out.println(\"Power off failed / VM already powered on...\");\n \t\n } catch ( Exception e ) \n { \n \tSystem.out.println( e.toString() ) ; \n }\n }",
"public static void runWithMemoryRestriction() {\n Model m = basicEmptyModel();\n for (int i = 0; i < 30; i++) {\n UUID vmId = UUID.randomUUID();\n m.getMapping().addWaitingVM(vmId);\n m.getResource(\"mem\").set(vmId, 2); //Each VM asks for 2GB RAM\n }\n\n //All the VMs that are waiting must be running now\n m.attach(new Running(m.getMapping().getWaitingVMs()));\n m.attach(new Oversubscription(m.getMapping().getOnlineNodes(), \"mem\", 1));\n m.attach(new Oversubscription(m.getMapping().getOnlineNodes(), \"cpu\", 2));\n ReconfigurationAlgorithm solver = new DefaultChocoReconfigurationAlgorithm();\n ReconfigurationPlan p = solver.solve(m);\n }",
"public void maintenanceMachineCapability(String capability) {\n if (self.getServiceManager().checkMaintenanceAllowed(capability)) {\n self.getServiceManager().setMaintenance(true);\n syncUpdateWithCheck(false);\n int mainTime = self.getServiceManager().getCapability(capability).getMaintenanceTime();\n if (!self.getServiceManager().getCapability(capability).getStatus()) {\n mainTime = self.getServiceManager().getCapability(capability).getRepairTime();\n }\n for (int i = 0; i < mainTime * env.getStepTimeScaler(); i++) {\n waitStepWithCheck();\n }\n self.getServiceManager().repairCapability(capability);\n self.getServiceManager().setMaintenance(false);\n syncUpdateWithCheck(false);\n }\n }",
"@Override\n public boolean run() {\n Model model = makeModel();\n \n Set<SatConstraint> constraints = new HashSet<>();\n //We allow memory over-commitment with a overbooking ratio of 50%\n //i.e. 1MB physical RAM for 1.5MB virtual RAM\n constraints.add(new Overbook(model.getMapping().getAllNodes(), \"mem\", 1.5));\n \n /**\n * On 10 nodes, 4 of the 6 hosted VMs ask now for a 4GB bandwidth\n */\n for (int i = 0; i < 5; i++) {\n Node n = nodes.get(i);\n Set<VM> vmsOnN = model.getMapping().getRunningVMs(n);\n Iterator<VM> ite = vmsOnN.iterator();\n for (int j = 0; ite.hasNext() && j < 4; j++) {\n VM v = ite.next();\n constraints.add(new Preserve(Collections.singleton(v), \"bandwidth\", 4));\n }\n }\n \n ChocoReconfigurationAlgorithm cra = new DefaultChocoReconfigurationAlgorithm();\n \n //Customize the estimated duration of actions\n cra.getDurationEvaluators().register(MigrateVM.class, new LinearToAResourceActionDuration<VM>(\"mem\", 1, 3));\n \n //We want the best possible solution, computed in up to 5 sec.\n cra.doOptimize(true);\n cra.setTimeLimit(5);\n \n //We solve without the repair mode\n cra.doRepair(false);\n solve(cra, model, constraints);\n \n //Re-solve using the repair mode to check for the improvement\n cra.doRepair(true);\n solve(cra, model, constraints);\n return true;\n }",
"public static void migrateToAnotherHost(String vmname1, String newHostName1) {\r\n \t \r\n \t\t\tif (vmname1.equals(null) || newHostName1.equals(null)) {\r\n \t \r\n \t\t\t\t\tSystem.out.println(\"Usage: java MigrateVM <url> \"\r\n \t \r\n \t\t\t\t\t\t\t+ \"<username> <password> <vmname> <newhost>\");\r\n \t \r\n \t\t\t\t\tSystem.exit(0);\r\n\r\n \t\t\t\t }\r\n \t \r\n \t\t\tServiceInstance si = getServiceInstance(URL_STR,\r\n\r\n \t \t\t\t\t\tUSERNAME_1, PASSWORD_1, true);\r\n \t \r\n \t\t\tString vmname= vmname1;\r\n\r\n \t\t\t String newHostName=newHostName1;\r\n \t \r\n \t\t\tFolder rootFolder = si.getRootFolder();\r\n\r\n \t\t\t try {\r\n \t \r\n \t\t\t\t\tVirtualMachine vm = (VirtualMachine) new InventoryNavigator(\r\n\r\n \t \t\t\t\t rootFolder).searchManagedEntity(\r\n\r\n \t\t\t\t\t \"VirtualMachine\", vmname);\r\n \t \r\n \t\t\t\t\tHostSystem newHost = (HostSystem) new InventoryNavigator(\r\n\r\n \t \t\t\t\t rootFolder).searchManagedEntity(\r\n\r\n \t\t\t\t\t \"HostSystem\", newHostName);\r\n \t \r\n \t\t\t\t\t ComputeResource cr = (ComputeResource) newHost.getParent();\r\n\r\n \t \t\t\t\t String[] checks = new String[] {\"cpu\", \"software\"};\r\n \t \r\n \t\t\t\t\t HostVMotionCompatibility[] vmcs =\r\n\r\n \t\t\t\t\t si.queryVMotionCompatibility(vm, new HostSystem[] \r\n \t \r\n \t\t\t\t\t {newHost},checks );\r\n\r\n \t\t\t\t\t \r\n \t \r\n \t\t\t\t\t String[] comps = vmcs[0].getCompatibility();\r\n\r\n \t\t\t\t\t if(checks.length != comps.length)\r\n \t \r\n \t\t\t\t\t {\r\n\r\n \t\t\t\t\t System.out.println(\"CPU/software NOT compatible. Exit.\");\r\n \t \r\n \t\t\t\t\t si.getServerConnection().logout();\r\n\r\n \t\t\t\t\t return;\r\n \t \r\n \t\t\t\t\t }\r\n\r\n \t\t\t\t\t Task task;\r\n \t \r\n \t\t\t\t\t task = vm.migrateVM_Task(cr.getResourcePool(), newHost,\r\n\r\n \t \t\t\t\t VirtualMachineMovePriority.highPriority, \r\n\r\n \t\t\t\t\t VirtualMachinePowerState.poweredOff);\r\n \t \r\n \t\t\t\t\t \r\n\r\n \t\t\t\t\t if(task.waitForTask()==Task.SUCCESS)\r\n \t \r\n \t\t\t\t\t {\r\n\r\n \t\t\t\t\t System.out.println(\"COLD MIGRATION!!!--VM Migrated Successfully!\");\r\n \t \r\n \t\t\t\t\t vm.powerOnVM_Task(null);\r\n\r\n \t \t\t\t\t }\r\n\r\n \t\t\t\t\t else if(task.waitForTask()!=Task.SUCCESS)\r\n \t \r\n \t\t\t\t\t {\r\n \t\t\t\t\t \t \r\n\r\n \t\t\t\t\t \t task = vm.migrateVM_Task(cr.getResourcePool(), newHost,\r\n \t \r\n \t\t\t\t\t\t\t VirtualMachineMovePriority.highPriority, \r\n\r\n \t \t\t\t\t\t\t VirtualMachinePowerState.poweredOn);\r\n \t\t\t\t\t \tSystem.out.println(\"LIVE MIGRATION!!!--VM Migration Successful!!\");\r\n\r\n \t\t\t\t\t }\r\n \t \r\n \t\t\t\t\t else\r\n\r\n \t\t\t\t\t {\r\n \t \r\n \t\t\t\t\t \t System.out.println(\"VM Migration failed!\");\r\n \t \r\n \t\t\t\t\t TaskInfo info = task.getTaskInfo();\r\n\r\n \t\t\t\t\t System.out.println(info.getError().getFault());\r\n \t \r\n \t\t\t\t\t \r\n\r\n \t\t\t\t\t }\r\n \t \r\n \t\t\t\t\t si.getServerConnection().logout();\r\n\r\n \t\t\t\t } catch (Exception e) {\t\t\t\t\r\n \t \r\n \t\t\t\t\te.printStackTrace();\r\n\r\n \t\t\t\t }\t \r\n \t \r\n\r\n\r\n \t\t}",
"public void powerOffVM(OccpVM vm) throws OccpException;",
"public abstract void execute(VirtualMachine virtualMachine);",
"private void updateVM(InetAddress address) {\n try {\n VMManager.getInstance().updateMachinePerformance(address.getHostAddress(), entry);\n } catch (ImageResizerException ex) {\n System.err.println(ex.getMessage());\n }\n }",
"public void powerOn() \n {\n try \n {\n // your code here\n \tSystem.out.println(\"Powering on virtual machine '\"+vm.getName() +\"'. Please wait...\"); \n \tTask t=vm.powerOnVM_Task(null);\n \tif(t.waitForTask()== Task.SUCCESS)\n \t{\n\t \tSystem.out.println(\"Virtual machine powered on.\");\n\t \tSystem.out.println(\"====================================\");\n \t}\n \telse\n \t\tSystem.out.println(\"Power on failed / VM already powered on...\");\n } \n catch ( Exception e ) \n { \n \tSystem.out.println( e.toString() ) ;\n }\n }",
"public void rescaleByI(){\r\n\t\tSystem.out.println(\" rescaling all the cloudlets by individual\");\r\n\t\tboolean contI = true;\r\n//\t\tSystem.out.println(computeCostA);\r\n\t\tList<Double>computeCostTemp = new ArrayList<Double>();\r\n\t\tfor(int i = 0;i <= cloudletList.size() - 1;i++){\r\n\t\t\tcomputeCostTemp.add(computeCostA.get(i));\r\n\t\t}\r\n\t\twhile(contI){\r\n\t\t\tint selectCloudletId = -1;\r\n\t\t\tdouble maxSavedE = Double.NEGATIVE_INFINITY;\r\n\t\t\t//\tReset the temporary cloudlet compute cost for all the cloudlets after scaling in some virtual machine\r\n\t\t\tfor(Cloudlet cl:cloudletList){\r\n\t\t\t\tcomputeCostTemp.set(cl.getCloudletId(),computeCostA.get(cl.getCloudletId()));\r\n\t\t\t}\r\n\t\t\tfor(Cloudlet cl:cloudletList){\r\n\t\t\t\tint cloudletId = cl.getCloudletId();\r\n\t\t\t\tVm vm = vmList.get(cl.getVmId());\r\n\t\t\t\tdouble cloudletESum = 0;\r\n\t\t\t\tdouble cloudletEDSum = 0;\r\n\t\t\t\tdouble savedETemp = 0;\r\n\t\t\t\tdouble makespanTemp = 0;\r\n\t\t\t\tfor(int i = 0;i <= cloudletList.size() - 1;i++){\r\n\t\t\t\t\tDouble[] temp = {(Double)0.0,(Double)0.0};\r\n\t\t\t\t\tsetExeTimeTemp(i, temp);\r\n\t\t\t\t}\r\n\t\t\t\tfor(int i = 0;i <= vmList.size() - 1;i++){\r\n\t\t\t\t\tvmList.get(i).setAvailTime(0);\r\n\t\t\t\t}\r\n\t\t\t\t//\tReset the temporary cloudlet compute cost for all the cloudlets after scaling in some virtual machine\r\n\t\t\t\tfor(int i = 0;i <= cloudletList.size() - 1;i++){\r\n\t\t\t\t\tcomputeCostTemp.set(i, computeCostA.get(i));\r\n\t\t\t\t}\r\n\t\t\t\tif(cl.getLevel() == vm.getMaxVfLevel()){\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tDouble temp = computeCostA.get(cloudletId) * ( vm.getVfListByLevel(cl.getLevel())[1]/vm.getVfListByLevel(cl.getLevel() + 1)[1] );\r\n\t\t\t\t\tcomputeCostTemp.set(cloudletId, temp);\r\n\t\t\t\t}\r\n\t\t\t\t//\tReassign the cloudlet cl\r\n\t\t\t\treAssignCloudlet(cloudletList,computeCostTemp);\r\n\t\t\t\t//\tCompute the energy consumption of all the cloudlets\r\n\t\t\t\tfor(int i = 0;i <= cloudletList.size() - 1;i++){\r\n\t\t\t\t\tCloudlet curCl = getCloudletById(i);\r\n\t\t\t\t\tVm curVm = vmList.get(curCl.getVmId());\r\n\t\t\t\t\tint level = curCl.getLevel();\r\n\t\t\t\t\tif( (cloudletId == i)&&( level != curVm.getMaxVfLevel() )){\r\n\t\t\t\t\t\tlevel += 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdouble exeTime = getExeTimeTemp(i)[1] - getExeTimeTemp(i)[0];\r\n\t\t\t\t\tcloudletEDSum += computeCloudletE(curCl,level,exeTime);\r\n\t\t\t\t}\r\n\t\t\t\tmakespanTemp = getExeTimeTemp(cloudletList.size() - 1)[1];\r\n\t\t\t\tdouble vmETemp = 0;\r\n\t\t\t\tfor(Vm vmIdle:vmList){\r\n\t\t\t\t\tdouble workTime = 0;\r\n\t\t\t\t\tfor(int cloudletIdInVm:vmIdle.getCloudletInVm()){\r\n\t\t\t\t\t\tworkTime += computeCostTemp.get(cloudletIdInVm);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvmETemp += computeIdleE(vmIdle,makespanTemp - workTime);\r\n\t\t\t\t}\r\n\t\t\t\tcloudletESum = cloudletEDSum + vmETemp;\r\n\t\t\t\tsavedETemp = curE - cloudletESum;\r\n\t\t\t\t\r\n\t\t\t\tif( (makespanTemp <= deadline)&&(savedETemp >= 0)&&( savedETemp >= maxSavedE ) ){\r\n\t\t\t\t\tselectCloudletId = cloudletId;\r\n\t\t\t\t\tmaxSavedE = savedETemp;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif( selectCloudletId == -1 ){\r\n\t\t\t\tcontI = false;\r\n\t\t\t}else{\r\n\t\t\t\t//\tApply the scaling in the selected cloudlet\r\n\t\t\t\t//\tReset the state\r\n\t\t\t\tfor(Cloudlet cl:cloudletList){\r\n\t\t\t\t\tDouble[] temp = {(Double)0.0,(Double)0.0};\r\n\t\t\t\t\tsetExeTimeTemp(cl.getCloudletId(),temp);\r\n\t\t\t\t}\r\n\t\t\t\tfor(Vm vm_reset:vmList){\r\n\t\t\t\t\tvm_reset.setAvailTime(0);\r\n\t\t\t\t}\r\n\t\t\t\t//\tReset the temporary cloudlet compute cost for all the cloudlets after scaling in some virtual machine\r\n\t\t\t\tfor(Cloudlet cl:cloudletList){\r\n\t\t\t\t\tcomputeCostTemp.set(cl.getCloudletId(),computeCostA.get(cl.getCloudletId()));\r\n\t\t\t\t}\r\n\t\t\t\t//\tIncrease the level for the selected cloudlet, and calculate the makespan and energy saving value after that\r\n\t\t\t\tCloudlet selectCl = getCloudletById(selectCloudletId);\r\n\t\t\t\t\r\n\t\t\t\tDouble temp = computeCostA.get(selectCloudletId) * ( vmList.get(selectCl.getVmId()).getVfListByLevel(selectCl.getLevel())[1]/vmList.get(selectCl.getVmId()).getVfListByLevel(selectCl.getLevel() + 1)[1] );\r\n\t\t\t\tcomputeCostTemp.set(selectCloudletId, temp);\r\n\t\t\t\tif(selectCl.getLevel()!=vmList.get(selectCl.getVmId()).getMaxVfLevel()){\r\n\t\t\t\t\tselectCl.setLevel(selectCl.getLevel() + 1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcontI = false;\r\n\t\t\t\t}\r\n\t\t\t\treAssignCloudlet(cloudletList,computeCostTemp);\r\n\t\t\t\tfor(Cloudlet cl:cloudletList){\r\n\t\t\t\t\tcomputeCostA.set(cl.getCloudletId(), computeCostTemp.get(cl.getCloudletId()));\r\n\t\t\t\t}\r\n\t\t\t\tfor(Cloudlet cl:cloudletList){\r\n\t\t\t\t\tcl.setAst(getExeTimeTemp(cl.getCloudletId())[0]);\r\n\t\t\t\t\tcl.setAft(getExeTimeTemp(cl.getCloudletId())[1]);\r\n\t\t\t\t}\r\n\t\t\t\t//\tCompute the energy consumption of all the cloudlets\r\n\t\t\t\tdouble cloudletESum = 0;\r\n\t\t\t\tdouble cloudletEDSum = 0;\r\n\t\t\t\tdouble makespanTemp = 0;\r\n\t\t\t\tfor(Cloudlet cl:cloudletList){\r\n\t\t\t\t\tint level = cl.getLevel();\r\n\t\t\t\t\tdouble exeTime = getExeTimeTemp(cl.getCloudletId())[1] - getExeTimeTemp(cl.getCloudletId())[0];\r\n\t\t\t\t\tcloudletEDSum += computeCloudletE(cl,level,exeTime);\r\n\t\t\t\t}\r\n\t\t\t\tmakespanTemp = getExeTimeTemp(cloudletList.size() - 1)[1];\r\n\t\t\t\tdouble vmETemp = 0;\r\n\t\t\t\tfor(Vm vmIdle:vmList){\r\n\t\t\t\t\tdouble workTime = 0;\r\n\t\t\t\t\tfor(int cloudletIdInVm:vmIdle.getCloudletInVm()){\r\n\t\t\t\t\t\tworkTime += computeCostTemp.get(cloudletIdInVm);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvmETemp += computeIdleE(vmIdle,makespanTemp - workTime);\r\n\t\t\t\t}\r\n\t\t\t\tcurE = cloudletEDSum + vmETemp;\r\n\t\t\t}\r\n\t\t}\r\n\t}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
optional .alluxio.proto.journal.CompletePartitionEntry complete_partition = 21;
|
public alluxio.proto.journal.KeyValue.CompletePartitionEntryOrBuilder getCompletePartitionOrBuilder() {
return completePartition_;
}
|
[
"alluxio.proto.journal.KeyValue.CompletePartitionEntryOrBuilder getCompletePartitionOrBuilder();",
"alluxio.proto.journal.KeyValue.CompletePartitionEntry getCompletePartition();",
"public alluxio.proto.journal.KeyValue.CompletePartitionEntryOrBuilder getCompletePartitionOrBuilder() {\n if (completePartitionBuilder_ != null) {\n return completePartitionBuilder_.getMessageOrBuilder();\n } else {\n return completePartition_;\n }\n }",
"public boolean hasCompletePartition() {\n return ((bitField0_ & 0x00000040) == 0x00000040);\n }",
"public Builder mergeCompletePartition(alluxio.proto.journal.KeyValue.CompletePartitionEntry value) {\n if (completePartitionBuilder_ == null) {\n if (((bitField0_ & 0x00000040) == 0x00000040) &&\n completePartition_ != alluxio.proto.journal.KeyValue.CompletePartitionEntry.getDefaultInstance()) {\n completePartition_ =\n alluxio.proto.journal.KeyValue.CompletePartitionEntry.newBuilder(completePartition_).mergeFrom(value).buildPartial();\n } else {\n completePartition_ = value;\n }\n onChanged();\n } else {\n completePartitionBuilder_.mergeFrom(value);\n }\n bitField0_ |= 0x00000040;\n return this;\n }",
"public Builder clearCompletePartition() {\n if (completePartitionBuilder_ == null) {\n completePartition_ = alluxio.proto.journal.KeyValue.CompletePartitionEntry.getDefaultInstance();\n onChanged();\n } else {\n completePartitionBuilder_.clear();\n }\n bitField0_ = (bitField0_ & ~0x00000040);\n return this;\n }",
"alluxio.proto.journal.File.CompleteFileEntryOrBuilder getCompleteFileOrBuilder();",
"alluxio.proto.journal.File.CompleteFileEntry getCompleteFile();",
"private void endFixedPartitionAttributes() {}",
"public void setPartitionNumber(int part) {\n\tpartitionNumber = part;\n }",
"public boolean hasPartition() {\n return fieldSetFlags()[5];\n }",
"public alluxio.proto.journal.File.CompleteFileEntryOrBuilder getCompleteFileOrBuilder() {\n return completeFile_;\n }",
"public PartitionUpdateParam getPartParam() {\n return partParam;\n }",
"public String getPartition();",
"public byte[] getPartitionKeyEnd() {\n return partitionKeyEnd;\n }",
"public void setPartParam(PartitionUpdateParam partParam) {\n this.partParam = partParam;\n }",
"public BlockLocateProgress(double percentComplete, boolean complete) {\n _init(percentComplete, complete, BlockLocateError.NONE, null);\n }",
"public synchronized void setComplete() {\n status = Status.COMPLETE;\n }",
"public no.ruter.avro.entity.actual.block.key.ActualBlockKeyV1.Builder setPartition(java.lang.CharSequence value) {\n validate(fields()[5], value);\n this.Partition = value;\n fieldSetFlags()[5] = true;\n return this;\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Sets the primary key of this configuracion perfilador.
|
public void setPrimaryKey(long primaryKey) {
_configuracionPerfilador.setPrimaryKey(primaryKey);
}
|
[
"@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_workFlowConfig.setPrimaryKey(primaryKey);\n\t}",
"public void setPrimaryKey(long primaryKey) {\n\t\t_settings.setPrimaryKey(primaryKey);\n\t}",
"@Override\n\tpublic void setPrimaryKey(java.lang.String primaryKey) {\n\t\t_bancheAppoggio.setPrimaryKey(primaryKey);\n\t}",
"public void setPrimaryKey(Proposal_HordingPK primaryKey);",
"@Override\n public void setPrimaryKey(long primaryKey) {\n _partido.setPrimaryKey(primaryKey);\n }",
"@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_lineaGastoCategoria.setPrimaryKey(primaryKey);\n\t}",
"public void setPrimaryKey(long primaryKey) {\n\t\t_provincia.setPrimaryKey(primaryKey);\n\t}",
"public void setPrimaryKey(long pk);",
"public void setPrimaryKey(long primaryKey) {\n\t\t_telefonoSolicitudProducto.setPrimaryKey(primaryKey);\n\t}",
"public void setIdkey(String pIdkey){\n this.idkey = pIdkey;\n }",
"@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_cholaContest.setPrimaryKey(primaryKey);\n\t}",
"@Override\n\tpublic void setPrimaryKey(int primaryKey) {\n\t\t_keHoachKiemDemNuoc.setPrimaryKey(primaryKey);\n\t}",
"@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_phieugiahan.setPrimaryKey(primaryKey);\n\t}",
"@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_candidato.setPrimaryKey(primaryKey);\n\t}",
"@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_autorizzazioneDir.setPrimaryKey(primaryKey);\n\t}",
"@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_scienceAppManager.setPrimaryKey(primaryKey);\n\t}",
"@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_scienceApp.setPrimaryKey(primaryKey);\n\t}",
"@Override\r\n\tpublic void setPrimaryKey(long primaryKey) {\r\n\t\t_tthcBieuMauHoSo.setPrimaryKey(primaryKey);\r\n\t}",
"@Override\n\tpublic void setPrimaryKey(java.lang.String primaryKey) {\n\t\t_paymentGatewayMaster.setPrimaryKey(primaryKey);\n\t}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Returns the resource locator that will be used to fetch messages for this validator's diagnostics.
|
@Override
public ResourceLocator getResourceLocator() {
// TODO
// Specialize this to return a resource locator for messages specific to this validator.
// Ensure that you remove @generated or mark it @generated NOT
return super.getResourceLocator();
}
|
[
"@Override\n\tpublic ResourceLocator getResourceLocator() {\n\t\t// TODO\n\t\t// Specialize this to return a resource locator for messages specific to this validator.\n\t\t// Ensure that you remove @generated or mark it @generated NOT\n\t\treturn super.getResourceLocator();\n\t}",
"public ResourceLocator getResourceLocator() {\n return DiscoveryEditPlugin.INSTANCE;\n }",
"public ResourceLocator getResourceLocator() {\r\n\t\treturn MqEditPlugin.INSTANCE;\r\n\t}",
"public ResourceLocator getResourceLocator() {\r\n\t\treturn SimapaEditPlugin.INSTANCE;\r\n\t}",
"protected UReferenceSeeker getReferenceLocator() {\r\n\t\treturn (UReferenceSeeker) this.getServletContext().getAttribute(ServerLauncherServlet.COM_ONTIMIZE_GUI_LOCATOR_ATTRIBUTE_CONTEXT);\r\n\t}",
"public String resourceLocation() {\n return this.innerProperties() == null ? null : this.innerProperties().resourceLocation();\n }",
"protected abstract String getFailedMessagesUri();",
"public ResourceLocator getResourceLocator() {\r\n\t\treturn OsEditPlugin.INSTANCE;\r\n\t}",
"public String getLocationMessage(Invalidity err) {\n String locMessage = \"\";\n String systemId = null;\n NodeInfo node = err.getInvalidNode();\n AbsolutePath path;\n String nodeMessage = null;\n int lineNumber = err.getLineNumber();\n if (err instanceof DOMLocator) {\n nodeMessage = \"at \" + ((DOMLocator) err).getOriginatingNode().getNodeName() + ' ';\n } else if (lineNumber == -1 && (path = err.getPath()) != null) {\n nodeMessage = \"at \" + path + ' ';\n } else if (node != null) {\n nodeMessage = \"at \" + Navigator.getPath(node) + ' ';\n }\n boolean containsLineNumber = lineNumber != -1;\n if (nodeMessage != null) {\n locMessage += nodeMessage;\n }\n if (containsLineNumber) {\n locMessage += \"on line \" + lineNumber + ' ';\n if (err.getColumnNumber() != -1) {\n locMessage += \"column \" + err.getColumnNumber() + ' ';\n }\n }\n\n systemId = err.getSystemId();\n \n if (systemId != null && systemId.length() != 0) {\n locMessage += (containsLineNumber ? \"of \" : \"in \") + abbreviateLocationURI(systemId) + ':';\n }\n return locMessage;\n }",
"public MessagesLoader getMessagesLoader(){\n\t\treturn this.messagesLoader;\n\t}",
"public Locator getLocator() {\r\n\tif (locator == null) {\r\n\t\ttry {\r\n\t\t\tthis.locator = LocatorFactory.getInstance().createLocator(\r\n\t\t\t\tLocatorImpl.TransportStreamProtocol + description);\r\n\t\t} catch (Exception e) {\r\n\t\t\t;\r\n\t\t}\r\n\t}\r\n\treturn this.locator;\r\n }",
"public Locale getFoundLocale() {\n return stringResources.getLocale();\n }",
"public static MyLogger getLocator(){\n \treturn locator;\n }",
"protected abstract String getMessagesRouterUri();",
"public static String getMessageRelativeUrl( )\n {\n return JSP_ADMIN_MESSAGE;\n }",
"public IResourceLocation getSpecificationLocation();",
"public String absoluteMonitorResourcePath() {\n\t\tString fileName = MonitorResourceFileName;\n\t\tString filePath = getAbsolutePathAsString (fileName);\n\t\treturn filePath;\n\t}",
"MessageResources getMessageResources();",
"public String getLocatorURI()\n {\n return uri;\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Access method for legacyResident.
|
public String getLegacyResident() {
return legacyResident;
}
|
[
"public void setLegacyResident(String aLegacyResident) {\n legacyResident = aLegacyResident;\n }",
"public String getLegacyId() {\n return this.legacy_id;\n }",
"public String getLegacyResident1995() {\n return legacyResident1995;\n }",
"public String getResident() {\n return resident;\n }",
"@Deprecated\ninterface PseudoSchedule extends Resource {\n}",
"java.lang.String getLegacyId();",
"public String getLegacyEmissionPoints() {\n return legacyEmissionPoints;\n }",
"public String getLegacy_name() {\n return legacy_name;\n }",
"protected raVersionInfo() {\n }",
"private SCSelfInOthersGrabPlantCollectRet() {}",
"public String getLegacyId() {\n return (String)getAttributeInternal(LEGACYID);\n }",
"public String getResidentName() {\n return residentName;\n }",
"Boolean getRequireNonResident();",
"protected byte[] getOffTimerReservationSetting() {return null;}",
"public String getLegacyEmissionControls() {\n return legacyEmissionControls;\n }",
"public abstract Object getNative();",
"public String getOldResourceUsername () \n throws DataObjectException;",
"protected byte[] getOnTimerReservationSetting() {return null;}",
"public void setResident(String aResident) {\n resident = aResident;\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Method deletes ebay item from specific search
|
public void deleteItemFromSearch(EbayItem item, Search search) {
searchRepository.deleteItemFromSearch(item.getId(), search.getId());
}
|
[
"public void deleteItemFromSearchAll(EbayItem item) {\r\n\t\tUser user = userService.getLoggedUser();\r\n\t\tsearchRepository.deleteItemFromSearchAll(item.getId(), user.getId());\r\n\t}",
"public void deleteItemFromSearchBySeller(EbaySeller seller, Search search) {\r\n\t\t//todo test\r\n\t\tsearchRepository.deleteItemFromSearchBySeller(seller.getName(), search.getId());\r\n\t}",
"public void deleteBlacklistItem(EbayItem item, Search search) {\r\n \tSearchItemBlacklist sib = itemBanRepository.findBySearchAndItem(search, item);\r\n \tsearch.getBlacklistItems().remove(sib);\r\n\t\tsearchRepository.save(search);\r\n\t\titemBanRepository.delete(sib);\r\n\t}",
"public void deleteItemFromSearchBySellerAll(EbaySeller seller) {\r\n\t\t//todo test\r\n\t\tUser user = userService.getLoggedUser();\r\n\t\tsearchRepository.deleteItemFromSearchBySellerAll(seller.getName(), user.getId());\r\n\t}",
"@Test \n\tpublic void testDeleteBasketItem() throws Exception {\n\t\tBBBBasket basket = AccountHelper.getInstance().getBasket();\n\t\t\n\t\tif(basket == null || basket.items == null || basket.items.length < 1) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tString id = basket.items[0].id;\n\t\t\n\t\tBBBRequest request = BBBRequestFactory.getInstance().createDeleteBasketItemRequest(id);\n\t\tString expectedUrl = AccountHelper.constructUrl(BBBRequestFactory.getInstance().getHostBasket(), String.format(PATH_MY_BASKETS_ITEMS_, id) );\n\t\tassertEquals(expectedUrl, request.getUrl());\n\t\t\n\t\tBBBResponse response = BBBRequestManager.getInstance().executeRequestSynchronously(request);\n\t\t\n\t\tif(response.getResponseCode() != HttpURLConnection.HTTP_OK) {\n\t\t\tfail(\"Error: \"+response.toString());\n\t\t}\n\t}",
"public void deleteItem(int pageIndex, int itemIndex);",
"public static void RemoveItemOnClick(String itemname)\n {\n order.RemoveItem(itemname);\n\n //order.RemoveItem\n }",
"private void deleteItem() {\n // Only perform the delete if this is an existing pet.\n if (mCurrentItemUri != null) {\n // Call the ContentResolver to delete the pet at the given content URI.\n // Pass in null for the selection and selection args because the mCurrentPetUri\n // content URI already identifies the pet that we want.\n int rowsDeleted = getContentResolver().delete(mCurrentItemUri, null, null);\n\n // Show a toast message depending on whether or not the delete was successful.\n if (rowsDeleted == 0) {\n // If no rows were deleted, then there was an error with the delete.\n Toast.makeText(this, getString(R.string.editor_delete_item_failed),\n Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the delete was successful and we can display a toast.\n Toast.makeText(this, getString(R.string.editor_delete_item_successful),\n Toast.LENGTH_SHORT).show();\n }\n }\n\n // Close the activity\n finish();\n }",
"public void deleteShoppingCartItem() {\n String value = FacesContext.getCurrentInstance().\n getExternalContext().getRequestParameterMap().get(\"menu_id\");\n int menu_id = Integer.parseInt(value);\n for (int i = 0; i < menulists.size(); i++) {\n if (menulists.get(i).menu_id == menu_id) {\n menulists.remove(i);\n break;\n }\n }\n }",
"public void delete(CbmCItemFininceItem entity);",
"void deleteItem(IDAOSession session, int id);",
"private void deleteItem() {\n // Only perform the delete if this is an existing inventory item\n if (mCurrentInventoryUri != null) {\n // Call the ContentResolver to delete the inventory item at the given content URI.\n // Pass in null for the selection and selection args because the mCurrentInventoryUri\n // content URI already identifies the inventory item that we want.\n int rowsDeleted = getContentResolver().delete(mCurrentInventoryUri, null, null);\n\n // Show a toast message depending on whether or not the delete was successful.\n if (rowsDeleted == 0) {\n // If no rows were deleted, then there was an error with the delete.\n Toast.makeText(this, getString(R.string.editor_delete_inventory_failed),\n Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the delete was successful and we can display a toast.\n Toast.makeText(this, getString(R.string.editor_delete_inventory_successful),\n Toast.LENGTH_SHORT).show();\n }\n }\n\n // Close the activity\n finish();\n }",
"public DeleteItemOutcome deleteItem(DeleteItemSpec spec);",
"public static void removeItemFromSale(){\r\n\t\ttry{\r\n\t\t\t// remove sale item from sale\r\n\t\t\tlong saleItemAlbumID = Long.parseLong(Main.getSaleTableSaleItems().getSelection()[0].getText());\r\n\t\t\tStaticProgramTables.sale.getSaleItems().remove(saleItemAlbumID);\r\n\t\t} catch (NumberFormatException nfe){\r\n\t\t\tSystem.out.println(\"*** BUG: SaleFuncs.removeItemFromSale bug\");\r\n\t\t}\r\n\t\t\r\n\t\t// update view\r\n\t\tupdateSaleTableView();\r\n\t}",
"public void removeByExpenseItemId(long expenseItemId);",
"void deletePurchase(int itemCode) {\n\t\t\n\t}",
"private void deleteFoodItem() {\n\t\tfor (Food_Day d : mFoodDayList) {\n\t\t\tfor (ServingSizes s : mServingList) {\n\t\t\t\tLog.d(\"Azure\", \"Checking to delete\");\n\t\t\t\tif (d.getServingSizeId().equals(s.getId())) {\n\t\t\t\t\tLog.d(\"Azure\", \"Delete\");\n\t\t\t\t\tmResponse.onFoodDeleted(s, d);\n\t\t\t\t\tMainActivity.deleteDBData(Food_Day.class, d);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public boolean deleteItem(String inventoryID);",
"public static String deleteSoldItemQuery(SoldItem item){\n String query=\"Delete from SoldItem where Serial_No='\"+item.getSerial_No()+\"'\";\n return query;\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Calculates the ratio for a given sequence within the supplied cluster. In case the sequence is not found in the cluster 0 is returned.
|
private float getSequenceRatio(String sequence, ICluster cluster) {
for (SequenceCount sequenceCount : cluster.getSequenceCounts()) {
if (sequenceCount.getSequence().equals(sequence)) {
return (float) sequenceCount.getCount() / (float) cluster.getSpecCount();
}
}
return 0;
}
|
[
"private int calculatePsmAssessment(float ratio, int clusterSize) {\n if (ratio < minSequenceRatio)\n return 1;\n\n if (clusterSize < minClusterSize)\n return 2;\n\n return 3;\n }",
"public double calculateRatio() {\n \tdouble ratioCalc = new Double(0);\n \tif(this.count_human_dna > 0) {\n \t\tratioCalc = (double) this.count_mutant_dna / this.count_human_dna;\n \t}\n \tthis.setRatio(ratioCalc);\n \treturn ratioCalc;\n }",
"private static double getInterClusterScore(List<String> cluster) {\n\n\t\tPair<String, String> pair = null;\n\n\t\tdouble score = 1;\n\t\tdouble tempScore = 0;\n\n\t\t// System.out.println(\"CL size \" + cluster.size());\n\t\tif (cluster.size() <= 1)\n\t\t\treturn 0;\n\n\t\tfor (int outer = 0; outer < cluster.size(); outer++) {\n\t\t\tfor (int inner = outer + 1; inner < cluster.size(); inner++) {\n\t\t\t\t// create a pair\n\t\t\t\tpair = new ImmutablePair<String, String>(cluster.get(outer)\n\t\t\t\t\t\t.trim(), cluster.get(inner).trim());\n\n\t\t\t\ttry {\n\t\t\t\t\t// retrieve the key from the collection\n\t\t\t\t\ttempScore = SCORE_MAP.get(pair);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tpair = new ImmutablePair<String, String>(cluster.get(\n\t\t\t\t\t\t\t\tinner).trim(), cluster.get(outer).trim());\n\t\t\t\t\t\ttempScore = SCORE_MAP.get(pair);\n\n\t\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\t\ttempScore = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// for sum of all pairwise scores\n\t\t\t\t// score = score + tempScore;\n\n\t\t\t\t// for the minimum inter cluster score\n\t\t\t\tscore = (score >= tempScore) ? tempScore : score;\n\t\t\t}\n\t\t}\n\t\treturn score;\n\t}",
"public abstract double getMatchQC(Cluster cluster, ReconstructedParticle particle);",
"public String calculateScores(IAtomContainer molecule){\n\n String result_Score = \"\";\n List<String> atomSignatures = curateAndGetSignatures(molecule);\n if (atomSignatures.isEmpty()) {\n return result_Score;\n }\n String uuid = getUUID(atomSignatures.get(0));\n double score = 0d;\n int molecule_size = atomSignatures.size();\n for (String uuidSignature : atomSignatures) {\n double fragment_Weight = sigTable.getFragmentWeight(getFragment(uuidSignature));\n score += fragment_Weight;\n }\n /*\n * Normalization is done by dividing the summed up score by atom count of molecule to\n * prevent molecule having more atoms from gaining high score\n */\n if (molecule_size != 0) {\n double normalized_score = score / molecule_size;\n result_Score = uuid + \"|\" + df.format(normalized_score);\n }\n return result_Score;\n }",
"public int getVirusScore(String sequence) {\n\t\tMap<String, Integer> virusesFound = genomeVirusFinder.findViruses(\n\t\t\t\tsequence, virusSequences);\n\t\treturn genomeVirusScorer.getTotalScore(virusesFound);\n\t}",
"protected double calculateScore() {\n int numCorrect = 0;\n\n for (int i = 0; i < notes.size(); i++) {\n Note detectedNote = detectedNotes.get(i);\n Note referenceNote = notes.get(i);\n\n double centDist = Note.centDistance(detectedNote, referenceNote);\n Log.d(LOG_TAG, String.format(\"Reference Pitch: %f Hz; Detected Pitch: %f Hz; Distance in Cents: %f\",\n referenceNote.getFrequency(),\n detectedNote.getFrequency(),\n centDist));\n\n if (detectedNote.getNameWithoutOctave().equals(referenceNote.getNameWithoutOctave())) {\n numCorrect++;\n }\n }\n\n return 100.0 * numCorrect / notes.size();\n }",
"public int calculateRatio()\n {\n return (int) (dailyRecoveredNumber / dailyDeathNumber);\n }",
"private double findPercent() {\n this.progressPercent = round((double)this.counterNumber / this.totalRows * 100);\n return this.progressPercent;\n }",
"private static int centerOfMassRating(Coordinate[] pawns, Coordinate centerOfMass)\n {\n int score = 0;\n\n // Calculate the distance of each pawn from the center of mass\n for (int i = 0; i < pawns.length; i++)\n {\n int distanceX = Math.abs(pawns[i].X - centerOfMass.X);\n int distanceY = Math.abs(pawns[i].Y - centerOfMass.Y);\n int distanceD = (int)Math.floor(Math.sqrt(Math.pow(distanceX, 2) + Math.pow(distanceY, 2)));\n\n int distance = Math.max(Math.max(distanceX, distanceY), distanceD);\n score += (int)Math.pow(distance, 4); // The distance is cubed to force the AI to move the farthest pawns\n }\n\n score *= -1; //System.out.println(\"COM = \" + score/pawns.length);\n return score / pawns.length; // The score is divided by the amount of pawn so the pawn count doesn't affect the evaluation result.\n }",
"public int[] findNumberOfClassPerCluster() {\n\t\tint[] nbClassEachCluster = new int[DataCenter.NBCLUSTER];\n\n\t\t// if there is only one cluster\n\t\tif (nbClassEachCluster.length == 1) {\n\t\t\tnbClassEachCluster[0] = DA.nbClass;\n\t\t\treturn nbClassEachCluster;\n\t\t}\n\n\t\t// find min\n\t\tint min = DA.nbRoomPerCluster[0];\n\t\tint minIdx = 0;\n\t\tfor (int i = 1; i < DA.nbRoomPerCluster.length; i++) {\n\t\t\tif (DA.nbRoomPerCluster[i] < min) {\n\t\t\t\tmin = DA.nbRoomPerCluster[i];\n\t\t\t\tminIdx = i;\n\t\t\t}\n\t\t}\n\t\t// calculate rate between other nbRoomPerCluster[i]s and min\n\t\t// nbRoomPerCluster\n\t\tint[] rate = new int[DataCenter.NBCLUSTER];\n\t\trate[minIdx] = 1;\n\t\tfor (int i = 0; i < rate.length; i++) {\n\t\t\tif (i != minIdx) {\n\t\t\t\trate[i] = (int) ((double) DA.nbRoomPerCluster[i] / min);\n\t\t\t}\n\t\t}\n\n\t\t// calculate number of class per cluster\n\t\tint sumRate = 0;\n\t\tfor (int i = 0; i < rate.length; i++) {\n\t\t\tsumRate += rate[i];\n\t\t}\n\n\t\tint minNBClassPerCluster = (int) Math.ceil((double) DA.nbClass / sumRate);\n\t\tint cummulative = 0;\n\t\tfor (int i = 0; i < nbClassEachCluster.length - 1; i++) {\n\t\t\tnbClassEachCluster[i] = rate[i] * minNBClassPerCluster;\n\t\t\tcummulative += nbClassEachCluster[i];\n\t\t}\n\t\tif (cummulative > DA.nbClass) {\n\t\t\tSystem.out.println(\"BUG in finding number of class per cluster.\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tnbClassEachCluster[nbClassEachCluster.length - 1] = DA.nbClass - cummulative;\n\n\t\treturn nbClassEachCluster;\n\t}",
"private static long ratio(long n1, long n2) {\n return Math.round((double) n1 / (double) n2 * 100);\n }",
"public static double purityFromClusters(ArrayList<HashSet<Integer>> clusters,\n ArrayList<ImageSegmentNode> nodes) {\n int[] majorities = new int[clusters.size()];\n\n for (int i = 0; i < clusters.size(); i++) {\n HashSet<Integer> cluster = clusters.get(i);\n\n ArrayList<Integer> frequencies =\n new ArrayList<>(Collections.nCopies(ImageSegmentNode.SegmentClass.values().length, 0));\n\n for (Integer nodeIndex : cluster) {\n ImageSegmentNode node = nodes.get(nodeIndex);\n frequencies.set(node.getSegmentClass().ordinal(),\n frequencies.get(node.getSegmentClass().ordinal()) + 1);\n }\n majorities[i] = Collections.max(frequencies);\n }\n\n return (double) IntStream.of(majorities).sum() / nodes.size();\n }",
"private double actualJaccardCoefficient(String doc1, String doc2) {\n\t\tArrayList<Integer> uniqueShingles = new ArrayList<Integer>();\n\t\tint matchingShingles = 0;\n\t\tint i;\n\n\t\tfor (i = 0; i < documentShingles.get(doc1).size(); i++)\n\t\t\tuniqueShingles.add(documentShingles.get(doc1).get(i));\n\n\t\tfor (i = 0; i < documentShingles.get(doc2).size(); i++)\n\t\t\tif (!uniqueShingles.contains(documentShingles.get(doc2).get(i)))\n\t\t\t\tuniqueShingles.add(documentShingles.get(doc2).get(i));\n\t\t\telse\n\t\t\t\tmatchingShingles++;\n\n\t\treturn ((double)matchingShingles/(double)uniqueShingles.size());\n\t}",
"public void generateTimeSeries_AllocationSuccessRate(String Cluster){}",
"protected double wordSubClusterProbability(Cluster cluster, String word) {\n return clusterProbability(makeWordSubCluster(cluster, word));\n }",
"float getPercentCorrect() {\n return (float) correctCount / (float) iterations * (float) 100.0;\n }",
"static public double mostFrequentBaseFraction(byte[] sequence) {\n int[] baseCounts = new int[4];\n\n for (byte base : sequence) {\n int baseIndex = simpleBaseToBaseIndex(base);\n\n if (baseIndex >= 0) {\n baseCounts[baseIndex]++;\n }\n }\n\n int mostFrequentBaseIndex = mostFrequentBaseIndex(baseCounts);\n\n return ((double) baseCounts[mostFrequentBaseIndex]) / ((double) sequence.length);\n }",
"int getRemainderPercent();"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Update views with new task
|
private void updateViews() {
List<Task> list = null;
DBHelper db = new DBHelper();
try {
list = db.getTaskList(this, Task.COLUMN_ID, taskID);
} catch (SQLException e) {
// TODO Auto-generated catch block
Log.e("Could not get Single Task", "Bam", e);
}
task = list.get(0);
int prioPos = 0;
for (int i = 0; i < prioList.size(); i++) {
if (prioList.get(i).getId() == task.getPriority().getId()) {
prioPos = i;
break;
}
}
prioSpinner.setSelection(prioPos);
int catPos = 0;
for (int i = 0; i < categoryList.size(); i++) {
if (categoryList.get(i).getId() == task.getCategory().getId()) {
catPos = i;
break;
}
}
categorySpinner.setSelection(catPos);
title.setText(task.getTitle());
description.setText(task.getDescription());
datePicker.updateDate(task.getAblaufJahr(), task.getAblaufMonat(),
task.getAblaufTag());
}
|
[
"public void updateTask(Task task);",
"void showTodoViewToEdit(Task task);",
"public void updateTask(View view) {\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);\n String path;\n String updatedRoom = roomSpinner.getSelectedItem().toString();\n\n // if room changed, remove the old task from its room\n if(!updatedRoom.equals(currTask.room)){\n path = createPath(currTask.caregiveeId, currTask.room, currTask.taskId);\n removeTaskInFirebase(path);\n }\n\n // post updated task details\n String updatedTaskName = String.valueOf(taskNameField.getText());\n if(updatedTaskName.isEmpty()){\n displayMessage(\"Please enter a task name.\",\n ContextCompat.getColor(getApplicationContext(), R.color.red));\n return;\n }\n String updatedNotes = String.valueOf(taskNotesField.getText());\n // formulate path\n path = createPath(currTask.caregiveeId, updatedRoom, currTask.taskId);\n // create updated task HashMap\n Map<String, Object> updatedTask = new HashMap<>();\n updatedTask.put(\"assignedStatus\", currTask.assignedStatus); // prev value\n updatedTask.put(\"caregiverID\", preferences.getString(\"userId\", null)); // curr user's info\n updatedTask.put(\"completionStatus\", currTask.completionStatus); // prev value\n updatedTask.put(\"name\", updatedTaskName); // updated value\n updatedTask.put(\"notes\", updatedNotes); // updated value\n\n // post updated task to path in Firebase\n updateTaskInFirebase(path, updatedTask);\n uploadFile(currTask.taskId.toString());\n }",
"public void updateView(TaskList taskList){\n recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));\n adapter=new TaskRecyclerAdapter(taskList,getActivity());\n recyclerView.setAdapter(adapter);\n adapter.notifyDataSetChanged();\n }",
"void refreshTaskInformation();",
"public void editTask(Task task){\n\n }",
"public void updateTask(Task task) throws ToDoListException;",
"void updateViewFromModel();",
"private void updateEditFragmentContent() {\n //update the editFragment if it is visible\n if(editFragment != null){\n createTask();\n }\n }",
"public void updateView(int view) throws Exception;",
"public void updateViews() {\n updateViews(null);\n }",
"void runUpdateTask();",
"public void editTask(String newTask) {\n task = newTask;\n }",
"void loadInTaskView() {\n tbv_timetracker.getItems().clear();\n List<Task> allTasks;\n if (usModel.getloggedInUser().getIsAdmin()) {\n allTasks = tsModel.getAllTasks();\n } else {\n allTasks = tsModel.refreshUserTasks();\n }\n ObservableList<Task> tasks = FXCollections.observableArrayList();\n tasks.addAll(allTasks);\n tbv_timetracker.setItems(tasks);\n }",
"public void updateTaskList(TaskList tasks) {\n\t\ttaskListViewManager.updateView(tasks);\n\t}",
"private void taskEditRequest(Task task) {\n Log.d(TAG, \"taskEditRequest: starts\");\n\n if (mTwoPane) {\n Log.d(TAG, \"taskEditRequest: in two-pane mode (tablet\");\n\n AddEditActivityFragment fragment = new AddEditActivityFragment();\n\n\n /*\n We pass our task object to the fragment by using a bundle. Instead of using the putExtra\n method, we just create a new bundle and put the task in there.\n The fragment has a setArguments method that we use to add the bundle to it\n */\n Bundle arguments = new Bundle();\n arguments.putSerializable(Task.class.getSimpleName(), task);\n fragment.setArguments(arguments); //added task to bundle and added bundle to fragments arguments\n\n\n //v4 import so older API's can use\n// FragmentManager fragmentManager = getSupportFragmentManager();\n// FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();\n// fragmentTransaction.replace(R.id.task_details_container, fragment);\n// fragmentTransaction.commit();\n // same code as above (chaining methods together)\n getSupportFragmentManager().beginTransaction().replace(R.id.task_details_container, fragment).commit();\n\n } else {\n Log.d(TAG, \"taskEditRequest: in single-pane mode (phone\");\n\n //in single pane mode, start the detaul activity for the selected item Id\n Intent detailIntent = new Intent(this, AddEditActivity.class);\n if (task != null) { //editing a task\n detailIntent.putExtra(Task.class.getSimpleName(), task);\n startActivity(detailIntent);\n } else { //adding a new task\n startActivity(detailIntent);\n }\n }\n\n\n }",
"public void updateTask(Task task){//needs to depend on row num\n SQLiteDatabase db = this.getWritableDatabase();\n ContentValues values = new ContentValues();\n values.put(KEY_ID,task.getId());\n values.put(KEY_LABEL,task.getLabel());\n values.put(KEY_TIME, task.getTime());\n db.update(TABLE_NAME, values, KEY_ID+\" = ?\",\n new String[] { String.valueOf(task.getId()) });\n }",
"@Override\n public void onEditClick(Tasks tasks) {\n if(tasks!=null){\n taskEditRequest(tasks);\n }\n }",
"public void edit(Task task) {\n em.merge(task);\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Created by Elf on 30.04.2016. Interface for items refresh
|
public interface Refreshable {
void refreshItem(int position);
}
|
[
"public abstract void refreshItem();",
"abstract protected T refreshItem(String itemPath);",
"private void refreshItem() {\n\t\tboundSwagForm.getField(\"isFetchOnly\").setValue(true);\r\n\t\tboundSwagForm.saveData(new DSCallback() {\r\n\t\t\t//reselect selected tile (call to saveData de-selects it)\r\n\t\t\tpublic void execute(DSResponse response,\r\n\t\t\t\t\tObject rawData, DSRequest request) {\r\n\t\t\t\t//get updated record\r\n\t\t\t\tfinal TileRecord rec = new TileRecord(request.getData());\r\n\t\t\t\t//Note: selectRecord seems to only work on the tile index\r\n\t\t\t\titemsTileGrid.selectRecord(itemsTileGrid.getRecordIndex(rec));\r\n\t\t\t\t//saveData adds tileRecord to the end.\r\n\t\t\t\t//make sure sort order is preserved\r\n\t\t\t\tdoSort();\r\n\t\t\t}});\r\n\t}",
"@Override\n public void refreshItem(T item) {\n int index = getItems().indexOf(item);\n getItems().remove(item);\n getItems().add(index, item);\n }",
"private void refreshButtonClicked(ActionEvent event) {\n //--\n //-- WRITE YOUR CODE HERE!\n //--\n\n itemView.getItem().setPreviousPrice(itemView.getItem().getItemPrice());\n //itemView.getItem().setItemPrice(randPrice.getRandomPrice());\n itemView.getItem().setItemPrice(randPrice.getRandomPrice(itemView.getItem()));\n itemView.getItem().setItemChange();\n super.repaint();\n showMessage(\"Refresh clicked!\");\n }",
"@Override\n public void refreshAllItems() {\n ObservableList<T> myList = getItems();\n T[] items = (T[]) getItems().toArray();\n myList.clear();\n myList.addAll(items);\n }",
"protected void forceRefresh() {\n items.clear();\n refresh(true);\n }",
"@Override\n public void completeRefresh() {\n }",
"protected void refreshWithProgress() {\n items.clear();\n setListShown(false);\n refresh();\n }",
"@Override\n public void completeRefresh() {\n\n }",
"private void updateItems()\n\t{\t\n\t\tupdatePizzaTypes(items);\n\t\tupdateSidesTypes(items);\n\t\tupdateDrinksTypes(items);\n\t}",
"@Override\n public void onRefresh() {\n reloadList();\n swipeContainer.setRefreshing(true);\n\n }",
"protected void forceUpdate()\n\t{\n\t\tsetItems(m_instance.readAll());\t\t\n\t}",
"abstract protected void doRefresh();",
"void onItemUpdated(MfRecord item);",
"protected final void refreshItem(Widget widget, Object element) {\n SafeRunnable.run(new UpdateItemSafeRunnable(widget, element, true));\n }",
"public abstract void refreshData();",
"public void refreshList() {\n mCursor.requery();\n mCount = mCursor.getCount() + mExtraOffset;\n notifyDataSetChanged();\n }",
"@Override\n public void refreshIndex(int index) {\n T item = getItems().get(index);\n getItems().remove(index);\n getItems().add(index, item);\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
This method returns all the unique elements (of a given field) in an array of records
|
public static String[] uniqueElements(int field, Record[] r){
Stack<String> unique = new Stack<String>(); //stack which will hold the elements
Record[] copy = r; //input array is copied
Record.heapSort(r, field); //array is then sorted according to field argument
for(int i = 0; i < copy.length; i++){
if(i == 0){unique.push(copy[i].getData()[field]);} //first element is always unique --> push into stack
else if(copy[i].getData()[field].equals(copy[i-1].getData()[field])); //ignore if duplicate element is found
else{unique.push(copy[i].getData()[field]); //if not duplicate --> push into stack
}
}
String[] output = new String[unique.size()]; //initialization of output string array
for(int i = output.length-1; i>= 0; i--){ //stack is loaded into array in reverse order
output[i] = unique.pop();
}
return output; //unique elements are returned
}
|
[
"List getUniqueFieldValues(String recordField)\r\n throws Exception;",
"private List<String> rmDupInfo(List<String> fields) {\n Set<String> seen = new HashSet<>();\n List<String> uniqueNonEmptyFields = new ArrayList<>();\n for (String i : fields) {\n if (i.isEmpty() || i.equals(\".\")) {\n continue;\n } else {\n String fieldName = i.split(\"=\")[0];\n if (!seen.contains(fieldName)) {\n uniqueNonEmptyFields.add(i);\n seen.add(fieldName);\n }\n }\n }\n return uniqueNonEmptyFields;\n }",
"protected boolean getDistinctMemberArray(String field) {\r\n return false;\r\n }",
"public abstract ParallelLongArray allUniqueElements();",
"public static ArrayList<String> findAll(String field) {\n\n // load data, if not already loaded\n loadData();\n\n ArrayList<String> values = new ArrayList<>(); // will hold a temp list of unique volues for the column\n\n // for each job in the jobs list, get each value for the column...\n for (HashMap<String, String> row : allJobs) {\n String aValue = row.get(field);\n //...if the current value for the column isn't already in the list,\n // then add it to the temporary list of unique values for the column\n if (!values.contains(aValue)) {\n values.add(aValue);\n }\n }\n\n // Bonus mission: sort the results\n // the Collections.sort method sorts the Strings in the ArrayList in ascending order\n Collections.sort(values);\n\n return values; // return the temp list of unique values for the column\n }",
"List<T> getAllDistinct();",
"public static int[] uniqueElements(int[] arr) {\n boolean[] duplicateMap = new boolean[arr.length];\n int duplicate = 0;\n int index=0;\n int[]result;\n\n for (int x = 0; x < arr.length; x++) {\n for (int j = 0; j < arr.length; j++) {\n if (x == j) {\n break;\n }\n if (arr[x] == arr[j]) {\n duplicateMap[x] = true;\n duplicateMap[j]=false;\n duplicate++;\n }\n }\n }\n result=new int[arr.length-duplicate];\n for(int k=0; k< arr.length;k++){\n if(!duplicateMap[k]){\n result[index]=arr[k];\n index++;\n }\n }\n\n return result;\n }",
"public List<TradeGood> uniqueList(TradeGood[] cargoArr) {\n List<TradeGood> uniqueGoods = new ArrayList<>();\n\n for (int i = 0; i < cargoArr.length; i++) {\n boolean inUniqueList = false;\n if(cargoArr[i] != null) {\n for (int j = 0; j < uniqueGoods.size(); j++) {\n if(cargoArr[i].equals(uniqueGoods.get(j))) {\n inUniqueList = true;\n }\n }\n if(!inUniqueList) {\n uniqueGoods.add(cargoArr[i]);\n }\n }\n }\n return uniqueGoods;\n }",
"DataSet<V> distinct();",
"private static int[] uniqueElements(int[] input)\n {\n Set<Integer> set = new HashSet<Integer>();\n for(int i = 0 ; i< input.length;i++)\n {\n set.add(input[i]);\n }\n int[] output = new int[set.size()];\n Iterator<Integer> itr = set.iterator();\n int offset = 0;\n while(itr.hasNext())\n {\n output[offset++] = itr.next();\n }\n return output;\n\n }",
"public List<Object> getDistinctValues(String column);",
"com.vitessedata.llql.llql_proto.LLQLQuery.Distinct getDistinct();",
"public Set<FieldSet> getUniqueFields() {\n return this.uniqueFields;\n }",
"public Set<V> unique();",
"@NotNull\n EntityIterable distinct();",
"public FromSelect distinct(ColumnRefercence cols);",
"private User[] getUniqueUsers(User[] users) {\n User[] uniqueList = null;\n\n if (users.length > 0) {\n // Collect users in a hashtable to remove duplicate usernames\n Hashtable<String, User> userHash = new Hashtable<String, User>();\n\n // Examine each user in the list\n String username = null;\n for (int idx = 0; idx < users.length; idx++) {\n username = users[idx].getUsername();\n if (!userHash.containsKey(username)) {\n userHash.put(username, users[idx]);\n }\n }\n\n // Return an array of unique users\n int idx = 0;\n uniqueList = new User[userHash.size()];\n Collection<User> values = userHash.values();\n Iterator<User> userIterator = values.iterator();\n while (userIterator.hasNext()) {\n uniqueList[idx] = (User) userIterator.next();\n idx++;\n }\n }\n\n return uniqueList;\n }",
"public List<String> removeIrrelevantFields(Collection<String> fields) {\n final List<String> result = new ArrayList<String>();\n for ( String field : fields ) {\n //clone, empty, iterator, listIterator, size, toArray\n if ( !(field.equals( \"class\" ) || field.equals( \"hashCode\" ) || field.equals( \"toString\" )) ) {\n result.add( field );\n }\n }\n return result;\n }",
"public <T> T[] removeDuplicates(T[] values) {\r\n\t return (T[]) new HashSet<T>(Arrays.asList(values)).toArray();\r\n\t}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Returns an array containing the elements in the given set.
|
public int [] getElements(int setNum);
|
[
"private int[] getArray(Set<Integer> set) {\n int n = set.size();\n int[] array = new int[n];\n\n Iterator<Integer> iterator = set.iterator();\n int i = 0;\n while (iterator.hasNext()) {\n array[i] = iterator.next();\n i++;\n }\n return array;\n }",
"public static long[] toArray(UIDSet[] uidset) {\n\t//return toArray(uidset, -1);\n\tif (uidset == null)\n\t return null;\n\tlong[] uids = new long[(int)UIDSet.size(uidset)];\n\tint i = 0;\n\tfor (UIDSet u : uidset) {\n\t for (long n = u.start; n <= u.end; n++)\n\t\tuids[i++] = n;\n\t}\n\treturn uids;\n }",
"public List transformSetToList(Set set) {\n List array = new ArrayList(set);\n return array;\n }",
"@Override\n public Object[] toArray() {\n return getInternalSet().toArray();\n }",
"public Set<E> elements();",
"@SuppressWarnings(\"unchecked\")\n\tpublic Classifier<A, C>[] toArray(Set<Classifier<A, C>> data){\n\t\tClassifier<A, C>[] target = new Classifier[data.size()];\n\t\ttarget = data.toArray(target);\n\t\treturn target;\n\t}",
"public int[] getSetsArray()\n\t{\n\t\treturn getSets().getSetsArray();\n\t}",
"public static String[] convert(final Set<String> setOfString) {\n final String[] arrayOfString = new String[setOfString.size()];\r\n\r\n // Copy elements from set to string array\r\n // using advanced for loop\r\n int index = 0;\r\n for (final String str : setOfString)\r\n arrayOfString[index++] = str;\r\n\r\n // return the formed String[]\r\n return arrayOfString;\r\n }",
"public com.dc.util.mysolr.config.bean.query.Set[] getSet() {\r\n com.dc.util.mysolr.config.bean.query.Set[] array = new com.dc.util.mysolr.config.bean.query.Set[0];\r\n return this.setList.toArray(array);\r\n }",
"public static long[] toArray(UIDSet[] uidset, long uidmax) {\n\tif (uidset == null)\n\t return null;\n\tlong[] uids = new long[(int)UIDSet.size(uidset, uidmax)];\n\tint i = 0;\n\tfor (UIDSet u : uidset) {\n\t for (long n = u.start; n <= u.end; n++) {\n\t\tif (uidmax >= 0 && n > uidmax)\n\t\t break;\n\t\tuids[i++] = n;\n\t }\n\t}\n\treturn uids;\n }",
"Node[] getNodeSet();",
"public static String[] convertSetToArrayString(Set<String> setOfString) {\n String[] arrayOfString = new String[setOfString.size()];\n\n // Copy elements from set to string array\n // using advanced for loop\n int index = 0;\n for (String str : setOfString)\n arrayOfString[index++] = str;\n\n // return the formed String[]\n return arrayOfString;\n }",
"Variable getSets();",
"public static JsonElement getAsArray(Set<String> value) {\n return getAsArray(value, false);\n }",
"@Invisible\n public java.util.Set<T> toMappedSet() {\n java.util.Set<T> result;\n if (null != array) {\n result = new HashSet<T>(array.length);\n for (int i = 0; i < array.length; i++) {\n result.add(array[i]);\n }\n } else {\n result = null;\n }\n return result;\n }",
"public List<Integer> getTopSet(double set[]){\n\t\t\n\t\tList<Integer> indexList = new ArrayList<Integer>();\n\t\t\n\t\tfor(int i=0; i < set.length; i++){\n\t\t\t\n\t\t\tif(set[i] > 0){\n\t\t\t\tindexList.add(i);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn indexList;\n\t\t\n\t}",
"public List<Element> getElements(OrderedSet<Long> ids) {\n return databaseService\n .getNamedParameterJdbcTemplate()\n .query(\n \"SELECT \" +\n \"ids.column_0 AS id, \" +\n \"j.a AS a, \" +\n \"j.b AS b \" +\n \"FROM \" +\n \"(VALUES \" +\n ids\n .stream()\n .map(i -> \"ROW(\" + i + \")\")\n .collect(Collectors.joining(\",\")) +\n \") ids LEFT JOIN JGraphElement j \" +\n \"ON ids.column_0 = j.id \",\n ImmutableMap.of(\"ids\", ids),\n ELEMENT_LIST_EXTRACTOR\n );\n }",
"@Override\r\n\tpublic MySet<E> intersectSets(MySet<E>[] t) {\r\n\t\t\r\n\t\t//create union of all items in t\r\n\t\tArrayList<E> allElements = new ArrayList<>();\r\n\t\t\r\n\t\tfor(MySet<E> i : t) {\r\n\t\t\tE[] e = (E[]) i.toArray(new Object[i.size()]);\r\n\t\t\tfor (int j = 0; j < e.length; j++) {\r\n\t\t\t\tallElements.add(e[j]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//P4 as specified\r\n\t\tHashMap<E, Integer> map = new HashMap<>();\r\n\t\t\r\n\t\tfor(E e : allElements) {\r\n\t\t\tInteger c = map.getOrDefault(e, 0);\r\n\t\t\tmap.put(e, c+1);\r\n\t\t}\r\n\t\t\r\n\t\tMySet<E> result = new Set2<>();\r\n\t\t\r\n\t\tfor(Map.Entry<E, Integer> entry : map.entrySet()) {\r\n\t\t\tif(entry.getValue() == t.length)\r\n\t\t\t\tresult.add(entry.getKey());\r\n\t\t}\r\n\t\t\r\n\t\treturn result;\r\n\t}",
"public static ArrayList<ArrayList<Furniture>> getSubsets(ArrayList<Furniture> set) {\n ArrayList<ArrayList<Furniture>> allsubsets = new ArrayList<ArrayList<Furniture>>();\n // amount of subsets is 2^(set size)\n int max = 1 << set.size();\n\n for (int i = 0; i < max; i++) {\n ArrayList<Furniture> subset = new ArrayList<Furniture>();\n for (int j = 0; j < set.size(); j++) {\n if (((i >> j) & 1) == 1) {\n subset.add(set.get(j));\n }\n }\n allsubsets.add(subset);\n }\n return allsubsets;\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
return the dot product between the 10 and 0 vectors
|
public double dot_0_10() {
return x_10 * x_0 + y_10 * y_0;
}
|
[
"public double dot(Vector v);",
"public double dotProduct(Coordinates vectorA, Coordinates vectorB);",
"public double dot(Vec vthat);",
"private static Double dot(Vector<Double> first, Vector<Double> second){\n Double result = 0.0;\n for (int i=0; i< first.size(); i++){\n result += first.get(i) * second.get(i);\n }\n return result;\n }",
"public double dot(VectorA v)\n {\n return (this.mag()*v.mag());\n }",
"@Test\n void dot() {\n Vector2f v2 = new Vector2f(0, 0);\n assertEquals(0, v.dot(v2));\n }",
"default double dotProduct(Vector other) {\n double[] result = new double[1];\n this.lazyMultiply(other).unorderedIterator().forEachRemaining((index, value) -> result[0] += value);\n return result[0];\n }",
"public double dot(LorentzVector vect){\n\t\tdouble dotProduct = this.e()*vect.e() - this.vect().dot(vect.vect());\n\t\treturn dotProduct;\n\t}",
"public double dotProduct(RMatrix m) {\n if (columns != 1 || m.columns != 1) {\n throw new ArithmeticException(\"Matrix is not a vector.\");\n }\n if (getRowCount() != m.getRowCount()) {\n throw new ArithmeticException(\"Matrixes do not have the same size.\");\n }\n double dot = 0.0;\n for (int r = 0; r < rows; r++) {\n dot += coefficients[r][0] * m.coefficients[r][0];\n }\n return dot;\n }",
"public static double dotProduct(Vector a, Vector b){\n return (a.getX() * b.getX()) + (a.getY() * b.getY());\n }",
"public static double dotProduct(List<Double> vector1, List<Double> vector2) {\n double dotProduct = 0;\n for (int i=0; i <vector1.size(); i++) {\n dotProduct += vector1.get(i) * vector2.get(i);\n }\n return dotProduct;\n }",
"@Override\n public float dot(INDArray x, INDArray y) {\n //return NativeBlas.ddot(x.length(), x.data(), 0, 1, y.data(), 0, 1);\n return JavaBlas.rdot(x.length(), x.data(), x.offset(), 1, y.data(), y.offset(), 1);\n }",
"public double dot_10_7() {\n return x_7 * x_10 + y_7 * y_10;\n }",
"@Test\n public void dot() {\n float result = 0.0f;\n float[] a = new float[] {1.001f, 2.002f, 3.0f, 4.0f, 5.0f, 6.0f}; \n float[] b = new float[] {2.0f, 2.0f, 6.0f, 4.0f, 4.0f, 5.0f};\n float expect = 74.0f;\n // 1)\n result = Vec4f.dot(a, 2, b, 1);\n assertTrue(Math.abs(result-expect) < 1E-6f);\n \n //2)\n float[] a2 = new float[] {3.0f, 4.0f, 5.0f, 6.0f}; \n float[] b2 = new float[] {2.0f, 6.0f, 4.0f, 4.0f};\n float result2 = Vec4f.dot(a2, b2);\n assertTrue(Math.abs(result2-expect) < 1E-6f);\n }",
"public double dot_10_6() {\n return x_6 * x_10 + y_6 * y_10;\n }",
"public static double dotProduct(Vector v1, Vector v2) {\r\n return ((v1.getPoint().getX() * v2.getPoint().getX())\r\n + (v1.getPoint().getY() * v2.getPoint().getY())\r\n + (v1.getPoint().getZ() * v2.getPoint().getZ()));\r\n }",
"public int dotProduct(DotProductOfTwoSparseVectors_Array vec) {\n int ret = 0;\n for(int i = 0; i < nums.length; ++i) {\n ret += (nums[i] * vec.nums[i]);\n }\n return ret;\n }",
"public static double dot(double[] v, double[] n){\n \n // check if the length of two vectors match \n if(v.length != n.length){\n throw new RuntimeException(\"length does not match\");\n }\n \n double sum = 0.0;\n \n for(int i = 0; i < v.length; i++){\n sum += v[i]*n[i];\n }\n return sum;\n }",
"public double dot_10_5() {\n return x_5 * x_10 + y_5 * y_10;\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
takes any compressed array and scans the first portion to get the pattern and then creates a new array adding the pattern wherever a 1 is found but then copying the rest.
|
public int[] decompressArray(int[] row){
int i=0;
int sCount=0;
while(row[i]!= -1){
sCount++;
i++;
}
int[] pattern = new int[sCount];
for(int j=0; j<pattern.length; j++){
pattern[j] = row[j];
}
i++;
int pCount=-1;
for(int j=0; j<row.length; j++){
if(row[j] == -1) pCount++;
}
int[] temp = new int[row.length-pCount-1-pattern.length + (pCount * pattern.length)];
for(int j=0; j<temp.length; j++){
if(row[i] == -1){
for(int k=0; k<pattern.length; k++){
temp[j] = pattern[k];
j++;
}
j--;
} else {
temp[j] = row[i];
}
i++;
}
return temp;
}
|
[
"public int[] compressArray(int[] row, int[] pattern, int reduction){\r\n\r\n int[] temp = new int[row.length-reduction];\r\n\r\n for(int i=0; i<pattern.length; i++) {\r\n temp[i] = pattern[i];\r\n }\r\n\r\n temp[pattern.length] = -1;\r\n\r\n int i=0;\r\n int n=pattern.length+1;\r\n\r\n while(i<row.length){\r\n temp[n] = row[i];\r\n if(pattern[0] == row[i] && row.length - i > pattern.length) {\r\n for(int j=1; j<pattern.length; j++){\r\n if(pattern[j] != row[i+j]) break;\r\n if(j == pattern.length-1) {\r\n temp[n] = -1;\r\n i+=pattern.length-1;\r\n }\r\n }\r\n }\r\n i++;\r\n n++;\r\n }\r\n\r\n return temp;\r\n }",
"private static int[] computeTemporaryArray(String pattern)\r\n\t{\r\n\t\t// Temp array is of the same size of the pattern.\r\n\t\t// Every point tells us what is the longest suffix length which is also the prefix in this temp array.\r\n\t\tint [] lps = new int[pattern.length()];\r\n\t\t\r\n\t\t// First point is always 0\r\n\t\tint j =0;\r\n\r\n\t\t// Note that there is no i++ here in this for()\r\n\t\tfor(int i=1; i < pattern.length();)\r\n\t\t{\r\n\t\t\t// Match is found\r\n\t\t\tif(pattern.charAt(i) == pattern.charAt(j))\r\n\t\t\t{\r\n\t\t\t\tlps[i] = j + 1;\r\n\t\t\t\tj++;\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\r\n\t\t\t// Match is not found\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// If j is not at zero, move back and do not increase i\r\n\t\t\t\tif(j != 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tj = lps[j-1];\r\n\t\t\t\t}\r\n\t\t\t\t// If j is at zero, there is no other option but to proceed further and mark that cell as zero\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tlps[i] =0;\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn lps;\r\n\t}",
"public void patternArray()\n\t{\n\t\tpattern[0] = Pattern.compile(PIECEPLACEMENT);\n\t\tpattern[1] = Pattern.compile(CASTLING);\n\t\tpattern[2] = Pattern.compile(PIECEMOVEMENT);\n\t}",
"protected void compress(){\r\n\t\t\r\n \tmodCount++;\r\n\t\tArrayNode<T> current = beginMarker.next;\r\n\t\t\r\n\t\t//find non-full node\r\n\t\twhile (current != endMarker){\r\n\t\t\tif (current.getLength()== current.getArraySize()){\r\n\t\t\t\tcurrent = current.next;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tArrayNode<T> removing = current.next;\r\n\t\t\t\t//compression done\r\n\t\t\t\tif (removing==endMarker){\r\n\t\t\t\t\t//remove empty nodes\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t//empty node\r\n\t\t\t\twhile (removing.getArraySize()==0){\r\n\t\t\t\t\tremoving = removing.next;\r\n\t\t\t\t\tif (removing==endMarker)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t//not sure why this is needed\r\n\t\t\t\tif (removing==endMarker){\r\n\t\t\t\t\t//remove empty nodes\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t//move elements from \"removing\" node to \"current\"\r\n\t\t\t\tT temp = removing.removeFirst();\r\n\t\t\t\tcurrent.insertSorted(temp);\r\n\t\t\t\t\r\n\t\t\t\t//check current length, go to next if full, otherwise redo loop\r\n\t\t\t\tif (current.getLength()==current.getArraySize()){\r\n\t\t\t\t\tcurrent = current.next;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//do another sweep at end to remove empty nodes\r\n\t\tcurrent = beginMarker.next;\r\n\t\twhile (current != endMarker){\r\n\t\t\tif (current.getArraySize()==0){\r\n\t\t\t\tcurrent.prev.next = current.next;\r\n\t\t\t\tcurrent.next.prev = current.prev;\r\n\t\t\t\tcurrent = current.next;\r\n\t\t\t\tsize--;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tcurrent = current.next;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public int firstMatch(char[] array, char[] pattern){\n for(int a = 0; a <= array.length-pattern.length; a++) {\n for (int p = 0; p < pattern.length; p++) {\n if (array[a+p] != pattern[p]) break;\n if (p == pattern.length-1) return a;\n }\n }\n return -1;\n }",
"private int[][] Binarize(int[][] array){\n double BinarizationThreshold = 0x20;\n int[][] BinarizedImage = new int[array.length][array[0].length];\n int[][] BinarizedImageRGB = new int[array.length][array[0].length];\n\n for (int i = 0; i < array.length; i++) {\n for (int j = 0; j < array[0].length; j++) {\n int pixel = array[i][j]&0xFF;\n if (pixel > BinarizationThreshold){\n BinarizedImage[i][j]=1;\n BinarizedImageRGB[i][j]=0xFFFFFF;\n } else {\n BinarizedImage[i][j]=0;\n BinarizedImageRGB[i][j]=0x000000;\n }\n }\n }\n return BinarizedImage;\n }",
"boolean isMinimal(int[] pattern);",
"private static int[][] step8Remove(int[][] array) {\r\n\t int[][] new_array = new int[R][S];\r\n\t \r\n\t //offset represents the number of MIN numbers to skip\r\n\t int offset = R/2;\r\n\t \r\n\t //destination in regular sized array\r\n\t for (int destination = 0; destination < N; destination++) {\r\n\t \r\n\t //source in expanded array\r\n\t int source = destination+offset;\r\n\t \r\n\t //calculated position based on number of rows\r\n\t new_array[destination%R][destination/R] = array[source%R][source/R];\r\n\t }\r\n\t return new_array;\r\n\t}",
"public void fillPattern1()\r\n {\r\n for (int row = 0; row < matrix.length; row++)\r\n {\r\n for (int col = 0; col < matrix[0].length; \r\n col++)\r\n {\r\n if (row < col)\r\n matrix[row][col] = 1;\r\n else if (row == col)\r\n matrix[row][col] = 2;\r\n else\r\n matrix[row][col] = 3;\r\n }\r\n }\r\n }",
"public static int[] buildZ(char[] a) {\n int n = a.length;\n int[] z = new int[n];\n if (n == 0) return z;\n z[0] = n;\n int l = 0, r = 0;\n for (int i = 1; i < n; i++) {\n if (i > r) {\n l = r = i;\n while (r < n && a[r - l] == a[r]) {\n r++;\n }\n z[i] = r - l;\n r--;\n } else {\n int k = i - l;\n if (z[k] < r - i + 1) {\n z[i] = z[k];\n } else {\n l = i;\n while (r < n && a[r - l] == a[r]) {\n r++;\n }\n z[i] = r - l;\n r--;\n }\n }\n }\n return z;\n }",
"public static int[] find(byte[] a)\n {\n int[] v = new int[20];\n\n int idx = 0;\n for(int x = 0; x < a.length; x++)\n {\n if(a[x] == 1)\n {\n //System.out.println(x+\" \"+a[x]+\" \"+v.length);\n\n v[idx++] = x;\n\n if(idx == v.length)\n {\n int[] tmp = new int[2*v.length];\n\n for(int i = 0; i < v.length; i++)\n tmp[i] = v[i];\n\n v = tmp;\n }\n }\n }\n\n // but v might be too big:\n int[] tmp = new int[idx];\n for(int i = 0; i < tmp.length; i++)\n tmp[i] = v[i];\n\n //System.out.println(tmp.length);\n\n return tmp;\n }",
"public static int[] duplicateReplacer(int[] arr) {\n int[] newarr = new int[arr.length];\n for (int x = 0; x < arr.length; x++) {\n int count = 0;\n for (int y:newarr) {\n if (y == arr[x]) {\n count ++;\n }\n }\n if (count >= 1) {\n newarr[x] = -1;\n } else {\n newarr[x] = arr[x];\n }\n }\n // REPLACE THIS WITH YOUR CODE\n return newarr;\n }",
"void segregate0and1(int arr[]){\n\n /* Initialize left and right indexes */\n int left = 0, right = arr.length-1;\n \n while (left < right){\n /* Increment left index while we see 0 at left */\n while (arr[left] == 0 && left < right)\n left++;\n \n /* Decrement right index while we see 1 at right */\n while (arr[right] == 1 && left < right)\n right--;\n \n /* If left is smaller than right then there is a 1 at left and a 0 at right. Exchange arr[left] and arr[right]*/\n if (left < right){\n arr[left] = 0;\n arr[right] = 1;\n left++;\n right--;\n }\n }\n}",
"private Block[] compress(Block[] blocks) {\n Block[] retBlocks = new Block[blocks.length];\n int returnedBlocksCounter = 0;\n String blockStr;\n for (Block b : blocks) {\n if (b == null) {\n continue;\n }\n Block retBlock = new Block(b);\n blockStr = retBlock.getStructure();\n for (int i = 0; i < blockStr.length() - 2; i++) { //check all chars in string\n int j = i;\n char charVal = blockStr.charAt(i);\n if (!Character.isLetter(charVal)) continue;\n while (j < blockStr.length() && blockStr.charAt(j) == charVal) { //count repeating\n j++;\n }\n int letterCount = j - i;\n if (letterCount >= 3) { //for count>3\n String partStr = Character.toString(charVal).repeat(letterCount);\n blockStr = blockStr.replaceFirst(partStr, letterCount + Character.toString(charVal));\n i -= (letterCount - 2);\n continue;\n }\n i = j - 1;\n }\n retBlock.setStructure(blockStr);\n retBlocks[returnedBlocksCounter++] = retBlock;\n }\n return retBlocks;\n }",
"private int[] parseBits(int[] peaks){from the number of peaks array decode into an array of bits (2=bit-1, 1=bit-0, 0=no bit)\n\t\t// \n\t\tint i =0;\n\t\tint lowCounter = 0;\n\t\tint highCounter = 0;\n\t\tint nBits = peaks.length /SLOTS_PER_BIT;\n\t\tint[] bits = new int[nBits];\n\t\t//i = findNextZero(peaks,i); // do not search for silence\n\t\ti = findNextNonZero(peaks,i);\n\t\tint nonZeroIndex = i;\n\t\tif (i+ SLOTS_PER_BIT >= peaks.length) //non-zero not found\n\t\t\treturn bits;\n\t\tdo {\n\t\t\t//int nPeaks = peaks[i]+peaks[i+1]+peaks[i+2]+peaks[i+3];\n\t\t\tint nPeaks = 0;\n\t\t\tfor (int j = 0; j < SLOTS_PER_BIT; j++) {\n\t\t\t\tnPeaks+= peaks[i+j];\n\t\t\t}\n\t\t\tint position = i/SLOTS_PER_BIT;\n\t\t\tbits[position] = BIT_NONE_SYMBOL;\n\t\t\t\n\t\t\tif (nPeaks>= LOW_BIT_N_PEAKS) {\n\t\t\t\t//Log.w(TAG, \"parseBits NPEAK=\" + nPeaks);\n\t\t\t\tbits[position] = BIT_LOW_SYMBOL;\n\t\t\t\tlowCounter++;\n\t\t\t}\n\t\t\tif (nPeaks>=HIGH_BIT_N_PEAKS ) {\n\t\t\t\tbits[position] = BIT_HIGH_SYMBOL;\n\t\t\t\thighCounter++;\n\t\t\t}\n\n\t\t\ti=i+SLOTS_PER_BIT;\n\t\t\t\n\t\t\t\n\t\t} while (SLOTS_PER_BIT+i<peaks.length);\n\t\tlowCounter = lowCounter - highCounter;\n\t\treturn bits;\n\t}",
"@Override\n public int read(byte[] finalMazeAsByteArr) throws IOException { //return super.read(b); todo need?\n /* if(finalMazeAsByteArr == null) {throw new IOException(\"Argument Is Null\");}\n\n //byte[] arrayOfFirst25 = new byte[25]; //this is the tempArray of maze. we copy it later to finalMazeAsByteArr\n\n //////////////\n //open a new byte array,in the size of finalMazeAsByteArr that we read to it a temporary compressed array that we want to decompress\n byte[] tempArray = new byte[finalMazeAsByteArr.length]; //hold the compressed array, and in the empty index we have zeros\n //tempArray = [24 | 4,6,55,3,5,7,255,0,77,53,195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]\n\n in.read(tempArray); //we read the compressed array into the tempReverseArray\n in.close();\n\n //this variable count the number of the zeros from the end of the tempArray until we see another number (another number=our compressed array)\n int zerosCounter = 0;\n //in this way we will know what size we need to open our compressed array\n\n for (int i=tempArray.length-1; i>=0;i--) //we run from the end to the start of the temp array\n { //count the number of the zeros in tempArray\n if (tempArray[i] == 0){\n zerosCounter++;\n }\n else{\n break;\n }\n }\n\n int SizeOfCompressedArr = finalMazeAsByteArr.length - zerosCounter; //now we have the size of our compressed array that we want to decompressed\n byte[] compressedArr = new byte[SizeOfCompressedArr]; //hold the compressed array compressedArr=[24 | 4,6,55,3,5,7,255,0,77,53,195]\n\n //copy the compressed array from tempArray to the compressedArr\n //tempArray = [24 | 4,6,55,3,5,7,255,0,77,53,195,0,0,0,0,0,0] -> compressedArr=[24 | 4,6,55,3,5,7,255,0,77,53,195]\n for (int i=0 ; i<compressedArr.length ; i++)\n {\n compressedArr[i] = tempArray[i];\n }\n\n\n for (int i=0 ; i<24 ; i++) //copy the 24 first details to the finalMazeAsByteArr\n {\n finalMazeAsByteArr[i] = compressedArr[i];\n }\n //////////////\n\n // in.read(arrayOfFirst25); //put the compressed array in temp array\n //byte[] arrLen = new byte[4];\n //for (int i=0; i<arrLen.length; i++){\n //arrLen[i] = 0;\n //if (i==3){\n //arrLen[i] = arrayOfFirst25[24];\n //}\n // }\n //int sizeOfTempArray = convertByteToInt(arrLen);\n// int sizeOfTempArray =arrayOfFirst25[24];\n\n //in.read(compressedArr); //put the compressed array in temp array\n\n\n //put the 24 first index of details\n\n //compressedArr=[24 | 4,6,55,3,5,7,255,0,77,53,195]\n int indexCompArr = 24; //start index of the compressed array\n int indexFinalArr = 24; //start index of finalMazeAsByteArr\n\n //int ifZero=0; //if we decompressed zero we write 0\n int ifOneOrZero=0; //if we decompressed one we write 1 if we decompressed zero we write 0\n //int SizeOfCompressedArr = compressedArr.length-24;\n\n if(compressedArr[24] == 0)\n {\n indexCompArr++;\n SizeOfCompressedArr--;\n ifOneOrZero=1;\n }\n\n while (SizeOfCompressedArr-24>0)\n {\n if(compressedArr[indexCompArr] == 255 && compressedArr[indexCompArr+1] ==0) //if we have 255 times \"one\" or \"zero\" so we check if there is 0 after\n {//compressedArr=[24 | 4,6,55,3,5,7,255,0,77,53,195]\n int temp = compressedArr[indexCompArr] + compressedArr[indexCompArr+2]; //save the total appearance nagid 255+45=300\n for(int i=indexFinalArr ; i<indexFinalArr+temp ; i++) // we put x time each element\n {\n finalMazeAsByteArr[i] = (byte) ifOneOrZero; //write the number of appearance of each->comp=[3] ->final=[1,1,1]\n }\n if(ifOneOrZero == 1){ifOneOrZero=0;} //turn from 1 to 0\n else{ifOneOrZero=1;} //turn 0 to 1\n\n indexFinalArr+=temp; //after we put x number we move on in x index in the final array\n indexCompArr+=3; //go 1 index in compressed arr\n SizeOfCompressedArr-=2; //minimize compressed array\n\n }\n else //if we dont see 255 in the compressed array\n {//compressedArr=[24 | 4,6,55,3,5,7,255,0,77,53,195]\n for(int i=indexFinalArr ; i<indexFinalArr+compressedArr[indexCompArr] ; i++) // we put x time each element\n {\n finalMazeAsByteArr[i] = (byte) ifOneOrZero; //write the number of appearance of each->comp=[3] ->final=[1,1,1]\n }\n if(ifOneOrZero == 1){ifOneOrZero=0;} //turn from 1 to 0\n else{ifOneOrZero=1;} //turn 0 to 1\n\n indexFinalArr+=compressedArr[indexCompArr]; //after we put x number we move on in x index in the final array\n indexCompArr++; //go 1 index in compressed arr\n SizeOfCompressedArr--; //minimize compressed array\n }\n }\n return 0;*/\n if(finalMazeAsByteArr == null) {throw new IOException(\"Argument Is Null\");}\n\n byte[] tempArray = new byte[finalMazeAsByteArr.length]; //hold the compressed array, and in the empty index we have zeros\n in.read(tempArray); //we read the compressed array into the tempReverseArray\n in.close();\n\n //this variable count the number of the zeros from the end of the tempArray until we see another number (another number=our compressed array)\n int zerosCounter = 0;\n //in this way we will know what size we need to open our compressed array\n\n for (int i=tempArray.length-1; i>=0;i--) //we run from the end to the start of the temp array\n { //count the number of the zeros in tempArray\n if (tempArray[i] == 0){\n zerosCounter++;\n }\n else{\n break;\n }\n }\n int SizeOfCompressedArr = finalMazeAsByteArr.length - zerosCounter; //now we have the size of our compressed array that we want to decompressed\n byte[] compressedArr = new byte[SizeOfCompressedArr]; //hold the compressed array compressedArr=[24 | 4,6,55,3,5,7,255,0,77,53,195]\n for (int i=0 ; i<compressedArr.length ; i++)\n {\n compressedArr[i] = tempArray[i];\n }\n\n\n for (int i=0 ; i<24 ; i++) //copy the 24 first details to the finalMazeAsByteArr\n {\n finalMazeAsByteArr[i] = compressedArr[i];\n }\n int indexCompArr = 24; //start index of the compressed array\n int indexFinalArr = 24; //start index of finalMazeAsByteArr\n int ifOneOrZero=0; //if we decompressed one we write 1 if we decompressed zero we write 0\n\n if(compressedArr[24] == 0)\n {\n indexCompArr++;\n ifOneOrZero=1;\n }\n\n while (indexCompArr < compressedArr.length){\n\n int temp = compressedArr[indexCompArr];\n if (compressedArr[indexCompArr] < 0)\n {\n temp = 256 + compressedArr[indexCompArr];\n }\n\n for(int i=indexFinalArr ; (i<indexFinalArr+temp && i<finalMazeAsByteArr.length) ; i++) // we put x time each element\n {\n finalMazeAsByteArr[i] = (byte) ifOneOrZero; //write the number of appearance of each->comp=[3] ->final=[1,1,1]\n }\n if(ifOneOrZero == 1){ifOneOrZero=0;} //turn from 1 to 0\n else{ifOneOrZero=1;} //turn 0 to 1\n\n indexFinalArr+=temp; //after we put x number we move on in x index in the final array\n indexCompArr++; //go 1 index in compressed arr\n\n }\n return 0;\n }",
"public abstract void replaceBuffer(Array<Array<Boolean>> pattern);",
"private static int[] stripLeadingZeroBytes(byte a[]) {\n int byteLength = a.length;\n int keep;\n\n // Find first nonzero byte\n for (keep = 0; keep < byteLength && a[keep] == 0; keep++)\n ;\n\n // Allocate new array and copy relevant part of input array\n int intLength = ((byteLength - keep) + 3) >>> 2;\n int[] result = new int[intLength];\n int b = byteLength - 1;\n for (int i = intLength-1; i >= 0; i--) {\n result[i] = a[b--] & 0xff;\n int bytesRemaining = b - keep + 1;\n int bytesToTransfer = Math.min(3, bytesRemaining);\n for (int j=8; j <= (bytesToTransfer << 3); j += 8)\n result[i] |= ((a[b--] & 0xff) << j);\n }\n return result;\n }",
"public void secondPattern(ASTStatementSequenceNode node) {\n boolean success = false;\n ArrayList<AugmentedStmt> toRemove = new ArrayList<AugmentedStmt>();\n for (AugmentedStmt as : node.getStatements()) {\n success = false;\n Stmt s = as.get_Stmt();\n if (!(s instanceof DefinitionStmt)) {\n continue;\n }\n\n DefinitionStmt ds = (DefinitionStmt) s;\n ValueBox right = ds.getRightOpBox();\n Value rightValue = right.getValue();\n\n if (!(rightValue instanceof NewArrayExpr)) {\n continue;\n }\n\n if (DEBUG) {\n System.out.println(\"Found a new ArrayExpr\" + rightValue);\n System.out.println(\"Type of array is:\" + rightValue.getType());\n }\n\n // get type out\n Type arrayType = rightValue.getType();\n\n // get size....need to know this statically for sure!!!\n Value size = ((NewArrayExpr) rightValue).getSize();\n\n if (!(size instanceof IntConstant)) {\n continue;\n }\n\n if (((IntConstant) size).value == 0) {\n debug(\"Found value to be 0 doing nothing\");\n continue;\n }\n if (DEBUG) {\n System.out.println(\"Size of array is: \" + ((IntConstant) size).value);\n }\n\n Iterator<AugmentedStmt> tempIt = node.getStatements().iterator();\n // get to the array creation stmt\n while (tempIt.hasNext()) {\n AugmentedStmt tempAs = (AugmentedStmt) tempIt.next();\n Stmt tempS = tempAs.get_Stmt();\n if (tempS.equals(s)) {\n break;\n }\n }\n // have the size have the type, tempIt is poised at the current def\n // stmt\n ValueBox[] array = new ValueBox[((IntConstant) size).value];\n success = true;\n for (int i = 0; i < ((IntConstant) size).value; i++) {\n // check for each iteration there is one DAssignStmt followed by\n // a DefinitionStmt\n if (!tempIt.hasNext()) {\n // since its end of the stmt seq node just return\n if (DEBUG) {\n System.out.println(\"returning\");\n }\n return;\n }\n\n AugmentedStmt augOne = tempIt.next();\n Stmt augSOne = augOne.get_Stmt();\n\n if (!tempIt.hasNext()) {\n // since its end of the stmt seq node just return\n if (DEBUG) {\n System.out.println(\"returning\");\n }\n return;\n }\n\n AugmentedStmt augTwo = tempIt.next();\n Stmt augSTwo = augTwo.get_Stmt();\n\n if (!isInSequenceAssignmentPatternTwo(augSOne, augSTwo, ds.getLeftOp(), i)) {\n // cant create shortcut since we dont have all necessary\n // initializations\n if (DEBUG) {\n System.out.println(\"Out of order assignment aborting attempt\");\n }\n success = false;\n break;\n } else {\n if (DEBUG) {\n System.out.println(\"Assignment stmt in order adding to array\");\n }\n // the RHS of augSOne is the next assignment in the sequence\n // add to ValueBox array\n array[i] = ((DShortcutAssignStmt) augSOne).getRightOpBox();\n toRemove.add(augOne);\n toRemove.add(augTwo);\n }\n } // end checking for 1D pattern\n\n if (success) {\n DArrayInitExpr tempExpr = new DArrayInitExpr(array, arrayType);\n DArrayInitValueBox tempValueBox = new DArrayInitValueBox(tempExpr);\n DAssignStmt newStmt = new DAssignStmt(ds.getLeftOpBox(), tempValueBox);\n // cant do array initialization without declaration being part\n // of the stmt!!!!!\n // have to prove that this array is never utilized before i.e.\n // from start of method to this point there is no use\n // or def of this array then only can we create this decl/init\n // stmt\n if (DEBUG) {\n System.out.println(\"Created new DAssignStmt and replacing it\");\n }\n\n InitializationDeclarationShortcut shortcutChecker = new InitializationDeclarationShortcut(as);\n methodNode.apply(shortcutChecker);\n boolean possible = shortcutChecker.isShortcutPossible();\n\n if (possible) {\n if (DEBUG) {\n System.out.println(\"Shortcut is possible\");\n }\n\n // create shortcut stmt\n DShortcutAssignStmt newShortcutStmt = new DShortcutAssignStmt(newStmt, arrayType);\n as.set_Stmt(newShortcutStmt);\n // make sure to mark the local in the DVariableDeclarations\n // so that its not printed\n markLocal(ds.getLeftOp());\n }\n\n break;\n }\n } // end going through stmt seq node\n if (success) {\n // means we did a transformation remove the stmts\n List<AugmentedStmt> newStmtList = new ArrayList<AugmentedStmt>();\n for (AugmentedStmt as : node.getStatements()) {\n if (toRemove.contains(as)) {\n toRemove.remove(as);\n } else {\n newStmtList.add(as);\n }\n }\n node.setStatements(newStmtList);\n\n // make sure any other possible simplifications are done\n inASTStatementSequenceNode(node);\n G.v().ASTTransformations_modified = true;\n }\n\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
optional .WordRequestType type = 1;
|
public Builder setType(com.satoshilabs.trezor.lib.protobuf.TrezorType.WordRequestType value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
type_ = value.getNumber();
onChanged();
return this;
}
|
[
"com.satoshilabs.trezor.lib.protobuf.TrezorType.WordRequestType getType();",
"public com.satoshilabs.trezor.lib.protobuf.TrezorType.WordRequestType getType() {\n\t\t\tcom.satoshilabs.trezor.lib.protobuf.TrezorType.WordRequestType result = com.satoshilabs.trezor.lib.protobuf.TrezorType.WordRequestType.valueOf(type_);\n\t\t\treturn result == null ? com.satoshilabs.trezor.lib.protobuf.TrezorType.WordRequestType.WordRequestType_Plain : result;\n\t\t}",
"public com.satoshilabs.trezor.lib.protobuf.TrezorType.WordRequestType getType() {\n\t\t\t\tcom.satoshilabs.trezor.lib.protobuf.TrezorType.WordRequestType result = com.satoshilabs.trezor.lib.protobuf.TrezorType.WordRequestType.valueOf(type_);\n\t\t\t\treturn result == null ? com.satoshilabs.trezor.lib.protobuf.TrezorType.WordRequestType.WordRequestType_Plain : result;\n\t\t\t}",
"teledon.network.protobuffprotocol.TeledonProtobufs.TeledonRequest.Type getType();",
"proto.Chat.ClientRequest.RequestType getType();",
"int getRequestType();",
"speech.multilang.Params.ForwardingControllerParams.Type getType();",
"RequestType createRequestType();",
"HTTPType createHTTPType();",
"com.github.aeonlucid.pogoprotos.networking.Requests.RequestType getRequestType();",
"private WordRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n\t\t\tsuper(builder);\n\t\t}",
"public void setType(RequestType type) {\n this.type = type;\n }",
"private static void addWord(String word, Bayespam.MessageType type)\n {\n Multiple_Counter counter = new Multiple_Counter();\n\n /// if word exists already in the vocabulary..\n if ( vocab.containsKey(word) )\n /// get the counter from the hashtable\n counter = vocab.get(word);\n\n /// increase the counter appropriately\n counter.incrementCounter(type);\n\n /// put the word with its counter into the hashtable\n vocab.put(word, counter);\n }",
"public static String getRequestType(){\n return requestType;\n }",
"public LWord(Type type, String value) {\n\t\tthis.type = type;\n\t\tthis.value = value;\n\t}",
"proto.Chat.ServerRequest.ResponseType getType();",
"public ServletProtocolEmbed(String type)\n {\n setType(type);\n }",
"public void greetMeOneWay(String requestType) {\n }",
"EchoedRequestType createEchoedRequestType();"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
PeukerDouglas Creates an indicator grid (1,0) of upward curved grid cells according to the Peuker and Douglas algorithm.
|
public static ExecResult PeukerDouglas(@NotBlank String Input_Elevation_Grid, Double Center_Smoothing_Weight,
Double Side_Smoothing_Weight, Double Diagonal_Smoothing_Weight,
String Output_Stream_Source_Grid, String inputDir, String outputDir)
{
Map files = new LinkedHashMap();
Map outFiles = new LinkedHashMap();
Map params = new LinkedHashMap();
// A grid of elevation values.
files.put("-fel", Input_Elevation_Grid);
// The center weight parameter used by a kernel to smooth the DEM before the tool identifies upwardly curved grid cells.
// The side weight parameter used by a kernel to smooth the DEM before the tool identifies upwardly curved grid cells.
// The diagonal weight parameter used by a kernel to smooth the DEM before the tool identifies upwardly curved grid cells.
if (Center_Smoothing_Weight == null) {
Center_Smoothing_Weight = 0.4;
}
if (Side_Smoothing_Weight == null) {
Side_Smoothing_Weight = 0.1;
}
if (Diagonal_Smoothing_Weight == null) {
Diagonal_Smoothing_Weight = 0.05;
}
params.put("-par", Center_Smoothing_Weight + " " + Side_Smoothing_Weight + " " + Diagonal_Smoothing_Weight);
// An indicator grid (1,0) of upward curved grid cells according to the Peuker and Douglas algorithm, and if viewed, resembles a channel network.
if (StringUtils.isBlank(Output_Stream_Source_Grid)) {
Output_Stream_Source_Grid = outputNaming(Input_Elevation_Grid, Output_Stream_Source_Grid,
"Output_Stream_Source_Grid", "Raster Dataset");
}
outFiles.put("-ss", Output_Stream_Source_Grid);
return ourInstance.runCommand(TauDEMCommands.PEUKER_DOUGLAS, files, outFiles, params, inputDir, outputDir);
}
|
[
"private static int pluses(String [] grid)\n {\n //New grid without numbers.\n String [] newGrid = Arrays.copyOfRange(grid, 2, grid.length);\n \n int height = Integer.parseInt(grid[0]);\n int width = Integer.parseInt(grid[1]);\n\n\n char [] [] newCharGrid = new char [height] [width]; \n\n for (int i = 0; i < height; i++)\n {\n for (int j = 0; j < width; j++)\n {\n newCharGrid[i][j] = newGrid[i].charAt(j);\n System.out.print(newGrid[i].charAt(j));\n } \n System.out.println(); \n }\n System.out.println();\n\n /* int plusSpan = 0;\n int plusArea = 0;\n int largestPlus = 1;\n int secondLargestPlus = 0;\n int x = 0;\n int y = 0;\n\n\n for (int i = 0 + plusSpan; i < height - plusSpan; i++)\n {\n for (int j = 0 + plusSpan; j < width - plusSpan; j++)\n {\n if (newCharGrid[i][j] == 'G')\n {\n if (newCharGrid[i-plusSpan][j] == 'G' && newCharGrid[i+plusSpan][j] == 'G' && newCharGrid[i][j-plusSpan] == 'G' && newCharGrid[i][j+plusSpan] == 'G')\n {\n plusArea = ((plusSpan) * 4 + 1);\n System.out.println(\"We found a 'good' plus of area: \" + plusArea + \" at y: \" + i + \" x: \" + j);\n\n \n boolean succeed = true;\n\n while (succeed)\n {\n int forceSpan = 0;\n\n if (newCharGrid[i-forceSpan][j] == 'G' && newCharGrid[i+forceSpan][j] == 'G' && newCharGrid[i][j-forceSpan] == 'G' && newCharGrid[i][j+forceSpan] == 'G')\n {\n plusArea = ((plusSpan) * 4 + 1);\n System.out.println(\"We found a 'good' plus of area: \" + plusArea + \" at y: \" + i + \" x: \" + j);\n forceSpan += 1;\n }\n else\n {\n succeed = false;\n }\n }\n \n \n if (plusArea > largestPlus)\n {\n largestPlus = plusArea;\n x = j;\n y = i;\n }\n }\n }\n }\n }\n\n\n*/\n\n\n\n\nint plusSpan = 0;\nint plusArea = 0;\nint largestPlus = 1;\nint secondLargestPlus = 0;\nint x = 0;\nint y = 0;\n\n\n \n for (int i = 0 + plusSpan; i < height - plusSpan; i++)\n {\n for (int j = 0 + plusSpan; j < width - plusSpan; j++)\n {\n if (newCharGrid[i][j] == 'G')\n {\n\n \n\n while (plusSpan != 15)\n {\n \n if (newCharGrid[i-plusSpan][j] == 'G' && newCharGrid[i+plusSpan][j] == 'G' && newCharGrid[i][j-plusSpan] == 'G' && newCharGrid[i][j+plusSpan] == 'G')\n {\n plusArea = ((plusSpan) * 4 + 1);\n System.out.println(\"We found a 'good' plus of area: \" + plusArea + \" at y: \" + i + \" x: \" + j);\n \n }\n\n plusSpan += 1;\n \n \n } \n \n\n if (plusArea > largestPlus)\n {\n largestPlus = plusArea;\n x = j;\n y = i;\n }\n }\n }\n }\n\n System.out.println();\n \n return 0;\n }",
"private void _generateGrid() {\n for (int r = 1; r <= this.rows; r++) {\n for (int c = 1; c <= this.columns; c++) {\n gridMap.add(new Point(this, r, c));\n }\n }\n }",
"void findConnectedGroupGrids()\n\t\t{\n\t\t\tArrayList<GroupGrid> groupGrids = new ArrayList<>(); // set of grids for this group\n\t\t\tArrayList<GroupGrid> neighborGrids = new ArrayList<>(); // potential neighbor grids which might belong to grid\n\t\t\tArrayList<GroupGrid> rejectedGrids = new ArrayList<>(); // grids which don't qualify for group (overlap too much, etc)\n\n\t\t\t// selected grid belongs to group, so add\n\t\t\tneighborGrids.add(new GroupGrid(selectedGrid));\n\t\t\t// array of booleans for all points added to group by grids indicating point has been filled; used to check for overlaps\n\t\t\t//boolean[][] gridHasPoint = new boolean[nRows][nCols];\n\t\t\tGroupPoint[][] groupPoints = new GroupPoint[nRows][nCols];\n\t\t\t// loop over neighbor grids; add grid if it qualifies; regardless add it's new neighbors to end of neighborGrids array\n\t\t\t// so neighborGrids will keep growing until all qualified grids are added and list is exhausted\n\t\t\tfor(int n = 0; n < neighborGrids.size(); n ++)\n\t\t\t{\n\t\t\t\tGroupGrid neighborGrid = neighborGrids.get(n);\n\t\t\t\tStsPatchGrid patchGrid = neighborGrid.grid;\n\t\t\t\tif(!groupGrids.contains(neighborGrid) && !rejectedGrids.contains(neighborGrid))\n\t\t\t\t{\n\t\t\t\t\tint nUnderlaps = 0; // number of points which are below other points in the grid group\n\t\t\t\t\tPatchPoint[][] patchPoints = patchGrid.patchPoints;\n\t\t\t\t\tArrayList<GroupGrid> newNeighborGrids = new ArrayList<>(); // newNeighborGrids is array of grids connected to this neighborGrid\n\t\t\t\t\tArrayList<GroupPoint> newGroupPoints = new ArrayList<>(); // possible new points; will not be added if grid not added\n\t\t\t\t\tfor(int r = 0, row = patchGrid.rowMin; r < patchGrid.nRows; r++, row++)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (int c = 0, col = patchGrid.colMin; c < patchGrid.nCols; c++, col++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tPatchPoint patchPoint = patchPoints[r][c];\n\t\t\t\t\t\t\tif (patchPoint == null) continue;\n\t\t\t\t\t\t\tGroupPoint currentPoint = groupPoints[row][col];\n\t\t\t\t\t\t\tif (currentPoint != null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// REMOVE_GROUP_GRIDS == true:\n\t\t\t\t\t\t\t\t// If this patchPoint is under an existing patchPoint at this location in the group,\n\t\t\t\t\t\t\t\t// then it underlaps the grid above so increment the number of underlapping points.\n\t\t\t\t\t\t\t\t// Otherwise it either overlaps the current point here or there is no point here\n\t\t\t\t\t\t\t\t// so assign point to group point at this location.\n\t\t\t\t\t\t\t\t// ELSE:\n\t\t\t\t\t\t\t\t// If we already have a point here, then the new point overlaps or underlaps it.\n\t\t\t\t\t\t\t\t// So increment the underLap counter. If the number of under/over laps exceeds criteria,\n\t\t\t\t\t\t\t\t// this grid won't be included.\n\t\t\t\t\t\t\t\tif(REMOVE_GROUP_GRIDS)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (patchPoint.z >= currentPoint.point.z)\n\t\t\t\t\t\t\t\t\t\tnUnderlaps++;\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\tnewGroupPoints.add(new GroupPoint(row, col, patchPoint));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tnUnderlaps++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tnewGroupPoints.add(new GroupPoint(row, col, patchPoint));\n\n\t\t\t\t\t\t\tcheckAddNewNeighborGrids(patchGrid, patchPoint, newNeighborGrids);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// criteria for new neighborGrid to be added to group: add regardless if few than 16 points\n\t\t\t\t\t// or if number of non-underlapped points is more than twice the number of underlapped points\n\t\t\t\t\t// don't add if none of this new neighborGrids connected grids (newNeighborGrids) connect back to a group grid.\n\t\t\t\t\t// this prevents a grid from being added to the group which is not connected to the group;\n\t\t\t\t\t// this might occur if the potentially connected grids didn't qualify for the group\n\t\t\t\t\tneighborGrid.nUnderlaps = nUnderlaps;\n\t\t\t\t\tneighborGrid.neighborGrids = newNeighborGrids;\n\t\t\t\t\tif ( (neighborGrid.underlapsOK()) && isNeighborGridConnected(newNeighborGrids, groupGrids))\n\t\t\t\t\t{\n\t\t\t\t\t\taddNewGroupPoints(groupPoints, newGroupPoints, groupGrids);\n\t\t\t\t\t\tgroupGrids.add(neighborGrid);\n\t\t\t\t\t\tneighborGrid.isConnected = true;\n\t\t\t\t\t\t// for each of the new neighbor grids to this grid, add them to the neighborGrids array if not already in the array or rejected\n\t\t\t\t\t\tfor(GroupGrid newNeighborGrid : newNeighborGrids)\n\t\t\t\t\t\t\tif(!alreadyDrawingGrid(newNeighborGrid.grid) && !neighborGrids.contains(newNeighborGrid) && !rejectedGrids.contains(newNeighborGrid))\n\t\t\t\t\t\t\t\tneighborGrids.add(newNeighborGrid);\n\t\t\t\t\t}\n\t\t\t\t\telse // if the grid doesn't qualify, put it on the rejected grids list; a subsequent neighbor grid might be connected\n\t\t\t\t\t // so we check the rejectedGrids to make sure it won't be processed again\n\t\t\t\t\t\trejectedGrids.add(neighborGrid);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(REMOVE_GROUP_GRIDS)\n\t\t\t{\n\t\t\t\tIterator<GroupGrid> groupGridsIterator = groupGrids.iterator();\n\t\t\t\twhile (groupGridsIterator.hasNext())\n\t\t\t\t{\n\t\t\t\t\tGroupGrid groupGrid = groupGridsIterator.next();\n\t\t\t\t\tif (!groupGrid.underlapsOK() && groupGrid.checkRemove())\n\t\t\t\t\t\tgroupGridsIterator.remove();\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.groupPatchGrids = getGroupPatchGrids(groupGrids);\n\t\t}",
"private void buildGraph(){\n\t\tpathfinder = new Silnik();\n\t\tcells = new Komorka[rows][columns];\n\t\tfor(int i = 0; i < rows; i++){\n\t\t\tfor(int j = 0; j < columns; j++){\n\t\t\t\tcells[i][j] = new Komorka(new Point(i * columnWidth,j * rowHeight),columnWidth,rowHeight);\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i < rows; i++){\n\t\t\tfor(int j = 0; j < columns; j++){\n\t\t\t\tif(i + 1 < rows)\n\t\t\t\t\tcells[i][j].addKrawedz(new Krawedz(columnWidth, cells[i + 1][j]));\n\t\t\t\tif(j + 1 < columns)\n\t\t\t\t\tcells[i][j].addKrawedz(new Krawedz(rowHeight, cells[i][j + 1]));\n\t\t\t\tif(i - 1 >= 0)\n\t\t\t\t\tcells[i][j].addKrawedz(new Krawedz(columnWidth, cells[i - 1][j]));\n\t\t\t\tif(j - 1 >= 0)\n\t\t\t\t\tcells[i][j].addKrawedz(new Krawedz(rowHeight, cells[i][j - 1]));\n\t\t\t\tif(i + 1 < rows && j + 1 < columns)\n\t\t\t\t\tcells[i][j].addKrawedz(new Krawedz((int)(rowHeight * 1.4), cells[i + 1][j + 1]));\n\t\t\t\tif(i - 1 >= 0 && j - 1 >= 0)\n\t\t\t\t\tcells[i][j].addKrawedz(new Krawedz((int)(rowHeight * 1.4), cells[i - 1][j - 1]));\n\t\t\t\tif(i + 1 < rows && j - 1 >= 0)\n\t\t\t\t\tcells[i][j].addKrawedz(new Krawedz((int)(rowHeight * 1.4), cells[i + 1][j - 1]));\n\t\t\t\tif(i - 1 >= 0 && j + 1 < columns)\n\t\t\t\t\tcells[i][j].addKrawedz(new Krawedz((int)(rowHeight * 1.4), cells[i - 1][j + 1]));\n\n\t\t\t}\n\t\t}\n\n\t\tstartCell = cells[0][30];\n\t\tstartCell.setKolor(Color.MAGENTA);\n\t\tgoalCell = cells[rows -1][columns - 1];\n\t\tgoalCell.setKolor(Color.RED);\n\t\tupdate();\n\n\t}",
"@Test\n public void testNumCellsColonisedFromOutsideGrid() {\n CompletelySpatiallyRandomParams params1 = new CompletelySpatiallyRandomParams(0.1, 0);\n coloniser = new CompletelySpatiallyRandomColoniser(landCoverType, juvenilePine, juvenileOak,\n juvenileDeciduous, params1);\n assertEquals(1, coloniser.getNumCellsColonisedFromOutsideGrid());\n\n // if baseRate = 0.5 then 9 * 0.5 = 4.5 ~ 5 cells colonised from outside grid\n CompletelySpatiallyRandomParams params2 = new CompletelySpatiallyRandomParams(0.5, 0);\n coloniser = new CompletelySpatiallyRandomColoniser(landCoverType, juvenilePine, juvenileOak,\n juvenileDeciduous, params2);\n assertEquals(5, coloniser.getNumCellsColonisedFromOutsideGrid());\n }",
"private void calculateNextStepPressureCell(int i, int j, int k) {\n // Retrieve the velocity components and pressure of the neighboring cells\n double uEast = u[i + 1][j][k];\n double uWest = u[i - 1][j][k];\n double vNorth = v[i][j + 1][k];\n double vSouth = v[i][j - 1][k];\n double wUp = w[i][j][k + 1];\n double wDown = w[i][j][k - 1];\n // double pCenter = p[i][j][k]; // not used\n double pEast = p[i + 1][j][k];\n double pWest = p[i - 1][j][k];\n double pNorth = p[i][j + 1][k];\n double pSouth = p[i][j - 1][k];\n double pUp = p[i][j][k + 1];\n double pDown = p[i][j][k - 1];\n\n double currentDepth = depth[k];\n double deltaZPlus = (depth[k + 1] - currentDepth) / 2.0;\n double deltaZMinus = (currentDepth - depth[k - 1]) / 2.0;\n double deltaZ = deltaZPlus + deltaZMinus;\n\n // Compute the next-step pressure using the Poisson equation\n double next_p = ((pEast + pWest) / Math.pow(deltaX, 2) + (pNorth + pSouth) / Math.pow(deltaY, 2)\n + (pUp + pDown) / Math.pow(deltaZ, 2)\n - ((uEast - uWest) / deltaX + (vNorth - vSouth) / deltaY + (wUp - wDown) / deltaZ) / timeStep)\n / (2 / (Math.pow(deltaX, 2)) + 2 / (Math.pow(deltaY, 2)) + 2 / (Math.pow(deltaZ, 2)));\n\n // Update the pressure of the cell\n pNext[i][j][k] = next_p;\n }",
"public void initializeGrid() {\n\n for (int j = 1; j < height - 1; j++) {\n double dy = j / (height - 1.0);\n\n for (int i = 1; i < length - 1; i++) {\n double dx = i / (length - 1.0);\n x_old[j][i] = (1.0 - dy)\n * x_old[0][i]\n + dy\n * x_old[height - 1][i]\n + (1.0 - dx)\n * x_old[j][0]\n + dx\n * x_old[j][length - 1]\n - (dx * dy * x_old[height - 1][length - 1] + (1.0 - dx)\n * dy * x_old[height - 1][0] + dx * (1.0 - dy)\n * x_old[0][length - 1] + (1.0 - dx)\n * (1.0 - dy) * x_old[0][0]);\n\n y_old[j][i] = (1.0 - dy)\n * y_old[0][i]\n + dy\n * y_old[height - 1][i]\n + (1.0 - dx)\n * y_old[j][0]\n + dx\n * y_old[j][length - 1]\n - (dx * dy * y_old[height - 1][length - 1] + (1.0 - dx)\n * dy * y_old[height - 1][0] + dx * (1.0 - dy)\n * y_old[0][length - 1] + (1.0 - dx)\n * (1.0 - dy) * y_old[0][0]);\n }\n }\n\n }",
"public void createGrid() {\n\t\tint[][] neighbours = getIo().getNeighbours();\n\t\tsetGrid(new GridAlg(neighbours, animals));\n\t\tgetGrid().setStep(getStep());\n\t}",
"public void drawGrid()\n {\n noStroke();\n for(int i = 0; i < xCells; i++)\n {\n for(int j = 0; j < yCells; j++)\n {\n if(pattern[i][j])\n fill(0);\n else\n fill(255);\n rect(firstCellPosition[0]+i*cellSize,firstCellPosition[1]+j*cellSize,cellSize-1,cellSize-1);\n }\n }\n }",
"private static void fillGrid()\n\t{\n\t\tfor ( int i=0; i < numRows; i++ ){\n\t\t\tfor ( int j = 0; j < numCols; j++ ){\n\t\t\t\tgrid[i][j] = FULL;\n\t\t\t}\n\t\t}\n\t\tgrid[numRows - 1][0] = POISON;\n \n\t}",
"public GrassGrid() {\n grass = new double[100][100];\n ground = new GroundGrid();\n\n for(int x = 0; x < 100; x++) {\n for(int y = 0; y < 100; y++) {\n double percent = ground.getCo2(x, y);\n\n if(ground.getMoisture(x, y) > 50) {\n percent = percent + (100 - ground.getMoisture(x, y))*2;\n }\n else {\n percent = percent + ground.getMoisture(x, y)*2;\n }\n\n if(ground.getSunlight(x, y) > 50) {\n percent = percent + (100 - ground.getSunlight(x, y))*2;\n }\n else {\n percent = percent + ground.getSunlight(x, y)*2;\n }\n\n grass[x][y] = percent/3;\n }\n }\n }",
"static void updateGrid(int[][] G, int[][][] P){\n \n \n for(int i=1; i<G.length; i++){\n for (int j=1; j<G[i].length; j++){\n if (P[i][j][0]==1){ //if there's only one candidate left in P[i][j][0]\n if (G[i][j]==0){ //double check it's not filled already\n for (int k=1; k<G[i].length; k++){ //enter loop to check the THIRD DIMENSION\n if (P[i][j][k]==1){ //grab the index number of the last candidate\n G[i][j] = k; //SMACK\n }\n }\n }\n }\n \n }\n \n }\n \n \n }",
"public void drawGridBubbles() {\n\t\tint rowAdder = 6;\n\n\t\tfor (int i = 0; i < model.startRows + rowAdder; i++) {\n\n\t\t\tfor (int j = 0; j < model.gridColumns; j++) {\n\t\t\t\tJPanel panel = new JPanel();\n\n\t\t\t\tif (i < 6 && model.grid[i][j] != null) {\n\t\t\t\t\tmodel.grid[i][j].xCoord = i * bubbleWH;\n\t\t\t\t\tmodel.grid[i][j].yCoord = j * bubbleWH;\n\t\t\t\t\t// System.out.print(\" [nil] \");\n\t\t\t\t\tpanel.add(model.grid[i][j], BorderLayout.NORTH);\n\n\t\t\t\t}\n\n\t\t\t\tif (i == 0) {\n\t\t\t\t\tdouble x = (j * bubbleWH + 30) * SCALE_FACTOR;\n\t\t\t\t\tdouble y = (i * bubbleWH + 12) * SCALE_FACTOR;\n\t\t\t\t\tdouble bubSize = bubbleWH * SCALE_FACTOR;\n\t\t\t\t\tpanel.setBounds((int) x, (int) y, (int) bubSize, (int) bubSize + 6);\n\n\t\t\t\t} else {\n\t\t\t\t\tif (i % 2 == 0) { // staggering if statement\n\t\t\t\t\t\tdouble x = (j * bubbleWH + 30) * SCALE_FACTOR;\n\t\t\t\t\t\tdouble y = ((i * (bubbleWH - 10)) + 12) * SCALE_FACTOR;\n\t\t\t\t\t\tdouble bubSize = bubbleWH * SCALE_FACTOR;\n\t\t\t\t\t\tpanel.setBounds((int) x, (int) y, (int) bubSize, (int) bubSize + 6);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdouble x = (j * bubbleWH + 65) * SCALE_FACTOR;\n\t\t\t\t\t\tdouble y = ((i * (bubbleWH - 10)) + 12) * SCALE_FACTOR;\n\t\t\t\t\t\tdouble bubSize = bubbleWH * SCALE_FACTOR;\n\n\t\t\t\t\t\tpanel.setBounds((int) x, (int) y, (int) bubSize, (int) bubSize + 6);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tpanel.setOpaque(false);\n\t\t\t\tadd(panel);\n\n\t\t\t\t// System.out.print(\" i: \" + i + \" j: \" + j);\n\t\t\t\tgridBubbleArr[i][j] = panel;\n\t\t\t\t// gridBubbleArr[i][j].setBorder(BorderFactory.createLineBorder(Color.BLUE));\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}",
"public LifeGrid(Pane gamePane) {\n this.numberOfCellsWide = (int) gamePane.getPrefWidth() / Cell.SCALE;\n this.numberOfCellsHigh = (int) gamePane.getPrefHeight() / Cell.SCALE;\n cells = new ArrayList<>();\n\n //initialize the two dimensional ArrayList\n for (int i = 0; i < numberOfCellsHigh; i++) {\n cells.add(new ArrayList<>());\n }\n\n //create cells\n for (int i = 0; i < numberOfCellsHigh; i++) { // yPosition\n for (int j = 0; j < numberOfCellsWide; j++) { // xPosition\n cells.get(i).add(new Cell(j, i));\n }\n }\n\n //set neighbors for all cells\n for (int i = 0; i < numberOfCellsHigh; i++) { // yPosition\n for (int j = 0; j < numberOfCellsWide; j++) { // xPosition\n if (i > 0) {\n if (j > 0) {\n cells.get(i).get(j).setNeighborAboveLeft(cells.get(i - 1).get(j - 1));\n }\n cells.get(i).get(j).setNeighborAboveCenter(cells.get(i - 1).get(j));\n if (j < numberOfCellsWide - 1) {\n cells.get(i).get(j).setNeighborAboveRight(cells.get(i - 1).get(j + 1));\n }\n }\n if (j > 0) {\n cells.get(i).get(j).setNeighborMiddleLeft(cells.get(i).get(j - 1));\n }\n if (j < numberOfCellsWide - 1) {\n cells.get(i).get(j).setNeighborMiddleRight(cells.get(i).get(j + 1));\n }\n if (i < numberOfCellsHigh - 1) { // bottom boarder elements\n if (j > 0) {\n cells.get(i).get(j).setNeighborBelowLeft(cells.get(i + 1).get(j - 1));\n }\n cells.get(i).get(j).setNeighborBelowCenter(cells.get(i + 1).get(j));\n if (j < numberOfCellsWide - 1) {\n cells.get(i).get(j).setNeighborBelowRight(cells.get(i + 1).get(j + 1));\n }\n }\n }\n }\n initialize(gamePane);\n }",
"public void computeCellsNeighbourg (SafeApexEvolutionParameters evolutionParameters) {\r\n\r\n\t\tfor (Iterator c = getCells().iterator(); c.hasNext();) {\r\n\t\t\tSafeApexCell cell = (SafeApexCell) c.next();\r\n\t\t\tint i = cell.getIGrid();\r\n\t\t\tint j = cell.getJGrid();\r\n\r\n\t\t\tSafeApexCell rightNeighbourg = (SafeApexCell) this.getCell(i, j + 1);\r\n\r\n\t\t\t//if toric symetry id off on Xp\r\n\t\t\tif (evolutionParameters.toricXp == 0) {\r\n\t\t\t\tif (rightNeighbourg.getX() < cell.getX()) rightNeighbourg = null;\r\n\t\t\t}\r\n\t\t\tif (rightNeighbourg != null)\tcell.setCellIdRight(rightNeighbourg.getId());\r\n\t\t\t\r\n\r\n\t\t\tSafeApexCell leftNeighbourg = (SafeApexCell) this.getCell(i, j - 1);\r\n\t\t\t//if toric symetry id off on Xn\r\n\t\t\tif (evolutionParameters.toricXn == 0) {\r\n\t\t\t\tif (leftNeighbourg.getX() > cell.getX()) leftNeighbourg = null;\r\n\t\t\t}\r\n\t\t\tif (leftNeighbourg != null) cell.setCellIdLeft(leftNeighbourg.getId());\r\n\t\r\n\r\n\t\t\tSafeApexCell backNeighbourg = (SafeApexCell) this.getCell(i - 1, j);\r\n\t\t\t//if toric symetry id off on Yn\r\n\t\t\tif (evolutionParameters.toricYn == 0) {\r\n\t\t\t\tif (backNeighbourg.getY() < cell.getY()) backNeighbourg = null;\r\n\t\t\t}\t\t\t\r\n\t\t\tif (backNeighbourg != null) cell.setCellIdBack(backNeighbourg.getId());\r\n\t\t\r\n\r\n\t\t\tSafeApexCell frontNeighbourg = (SafeApexCell) this.getCell(i + 1, j);\r\n\t\t\t//if toric symetry id off on Yp\r\n\t\t\tif (evolutionParameters.toricYp == 0) {\r\n\t\t\t\tif (frontNeighbourg.getY() > cell.getY()) frontNeighbourg = null;\r\n\t\t\t}\t\t\t\r\n\t\t\tif (frontNeighbourg != null) cell.setCellIdFront(frontNeighbourg.getId());\r\n\t\t\t\r\n\t\t}\r\n\t}",
"@Override\n public boolean grid(){\n\n game.calibrate=false;\n return true;\n }",
"private void drawGrid(Graphics g) {\n int rMax;\n int cMax;\n if (model.length() * GuiViewFrame.NOTE_W < GuiViewFrame.SCROLL_W) {\n cMax = GuiViewFrame.SCROLL_W / GuiViewFrame.NOTE_W / model.getSig().bpm;\n }\n else {\n cMax = model.length() / model.getSig().bpm;\n }\n if (model.getPitchRange().size() * GuiViewFrame.NOTE_H < GuiViewFrame.SCROLL_H) {\n rMax = GuiViewFrame.SCROLL_H / GuiViewFrame.NOTE_H;\n }\n else {\n rMax = model.getPitchRange().size();\n }\n g.setColor(Color.black);\n for (int r = 0; r <= rMax; r++) {\n g.drawLine(0, r * GuiViewFrame.NOTE_H, (cMax + 1) * GuiViewFrame.MEASURE_W,\n r * GuiViewFrame.NOTE_H);\n }\n for (int c = 0; c <= cMax; c++) {\n g.drawLine(c * GuiViewFrame.MEASURE_W, 0, c * GuiViewFrame.MEASURE_W, (rMax + 1) * GuiViewFrame.NOTE_H);\n }\n for (int i : model.getRepeats().keySet()) {\n g.fillRect((i + 1) * GuiViewFrame.NOTE_W - 5, 0, 5, GuiViewFrame.NVP_H);\n g.fillRect(model.getRepeats().get(i).getGoBack() * GuiViewFrame.NOTE_W, 0, 5, GuiViewFrame.NVP_H);\n }\n if (model.getMultiEnding() != null) {\n g.fillRect(model.getMultiEnding().getBuildUp().getGoBack() * GuiViewFrame.NOTE_W, 0, 5, GuiViewFrame.NVP_H);\n for (Repeat r : model.getMultiEnding().getEndings()) {\n g.fillRect(r.getGoBack() * GuiViewFrame.NOTE_W - 5, 0, 5, GuiViewFrame.NVP_H);\n }\n }\n }",
"private void generateUpsAndDowns() {\n\t\t// rows are simulation at given time, columns paths\n\t\tupsAndDowns = new double[lastTime][numberOfSimulations];\n\t\tdouble threshold = convert();// if the simulated number is less than this, we have up\n\t\t// double for loop, time and simulations\n\t\tfor (int timeIndex = 0; timeIndex < lastTime; timeIndex++) {\n\t\t\tfor (int simulationIndex = 0; simulationIndex < numberOfSimulations; simulationIndex++) {\n\t\t\t\t// the way we convert the probability into a condition on the generated numbers\n\t\t\t\tif (randomGenerator.getNextInteger() < threshold) {\n\t\t\t\t\tupsAndDowns[timeIndex][simulationIndex] = increaseIfUp;\n\t\t\t\t} else {\n\t\t\t\t\tupsAndDowns[timeIndex][simulationIndex] = decreaseIfDown;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private void paintGrid(Graphics g) {\n Dimension size = getSize();\n\n g.setColor(Color.LIGHT_GRAY);\n int startX = x0;\n for (int x = startX; x < size.getWidth(); x += unitsX) {\n g.drawLine(x, 0, x, (int) size.getHeight());\n }\n for (int x = startX; x > 0; x -= unitsX) {\n g.drawLine(x, 0, x, (int) size.getHeight());\n }\n\n int startY = y0;\n for (int y = startY; y < size.getHeight(); y += unitsY) {\n g.drawLine(0, y, (int) size.getWidth(), y);\n }\n for (int y = startY; y > 0; y -= unitsY) {\n g.drawLine(0, y, (int) size.getWidth(), y);\n }\n\n g.setColor(Color.BLACK);\n for (int y = 0; y < (int) size.getHeight(); y++) {\n g.fillRect(x0, y, 1, 1);\n }\n for (int x = 0; x < (int) size.getWidth(); x++) {\n g.fillRect(x, y0, 1, 1);\n }\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Method adds payment into DB and connect user with periodicals and periodicals with payment
|
@Override
public int create(Payment entity) {
try(PreparedStatement ps = connection.prepareStatement(Requests.INSERT_PAYMENT, Statement.RETURN_GENERATED_KEYS);
PreparedStatement psPayPeriodical = connection.prepareStatement(Requests.INSERT_PERIODICAL_PAYMENT);
PreparedStatement psUserPeriodical = connection.prepareStatement(Requests.INSERT_USER_PERIODICAL);
PreparedStatement psUpdateMoney = connection.prepareStatement(Requests.UPDATE_USER_MONEY_BUY)){
ps.setInt(1,entity.getPrice());
ps.setInt(2,entity.getIdUser());
ps.executeUpdate();
ResultSet rs = ps.getGeneratedKeys();
rs.next();
int idPayment = rs.getInt(1);
for (Periodical periodical: entity.getPeriodicals()) {
psPayPeriodical.setInt(1, periodical.getId());
psPayPeriodical.setInt(2, idPayment);
psPayPeriodical.executeUpdate();
psUserPeriodical.setInt(1,entity.getIdUser());
psUserPeriodical.setInt(2,periodical.getId());
psUserPeriodical.executeUpdate();
}
psUpdateMoney.setInt(1,entity.getPrice());
psUpdateMoney.setInt(2,entity.getIdUser());
psUpdateMoney.executeUpdate();
connection.commit();
return idPayment;
} catch (SQLException e) {
e.printStackTrace();
}
return 0;
}
|
[
"public void createNewPayment() {\n// Prepare parameters\n String[] params = {this.isPaid.toString(), this.paymentMethod, Double.toString(this.totalPrice)};\n\n\n// SQL string query\n String query = \"INSERT INTO payment (isPaid, payment_method, total_price) VALUES (?, ?, ?);\";\n\n// Execute query and retrieve new payment id\n int paymentId = Connect.prepUpdatePayment(query, params);\n\n// Update local id\n if(paymentId >= 0) {\n this.paymentId = paymentId;\n }\n }",
"private void createPayment() {\n if (currentUser.getAccount_id()==null) {\n //no account, launch onboarding\n openStripeOnboarding();\n } else {\n //if account exists, launch create payment\n Intent intent = new Intent(this, CreatePaymentActivity.class);\n createPaymentResultLauncher.launch(intent);\n }\n }",
"@Test\n\tpublic void addPaymentTest() {\n\t\tLocalDate expiryDate = LocalDate.parse(\"2025-07-01\");\n\t\tCard card = new Card(3, \"pranathi\", \"1234567891\", expiryDate, \"SBI\");\n\t\tPayment payment1 = new Payment(3, \"debit\", \"success\", card);\n\t\tassertEquals(payment1.toString(), paymentService.addPayment(payment1).toString());\n\t\tlist.add(payment1);\n\n\t}",
"public static void makePayment() {\n // Get the project number the user wishes to work on\n Project proj = getProject();\n int newAmount = getUserInt(\"Add client's next payment: \");\n\n try {\n projMang.updateAmountPaid(proj, newAmount);\n\n } catch (Exception e) {\n System.out.println(e.getMessage());\n }\n }",
"public void calculatePayment() {\n\t \n }",
"public void insertConcursoPeriodoDespacho(ConcursoPeriodoDespacho concursoPeriodoDespacho, Usuario usuario);",
"public void createPaymentLink(Integer invoiceId, Integer paymentId) {\r\n IPaymentSessionBean session = Context.getBean(Context.Name.PAYMENT_SESSION);\r\n session.applyPayment(paymentId, invoiceId);\r\n }",
"public void insertConcursoBonificacionPeriodo(ConcursoBonificacionPeriodo concursoBonificacionPeriodo, Usuario usuario);",
"public void markPaid() throws SQLException{\n this.paymentStatus = \"Paid\";\n \n \n //update customer\n Customer cust = new Customer(this.customerID);\n if(cust.getAcc_type().equals(\"Valued\") || cust.getAcc_type().equals(\"Late\")){\n \n String currentDate = new Date(System.currentTimeMillis()).toString();\n // Splits date from YYYY-MM-DD into array date[0] = YYYY date[1] = MM date[3] = DD\n String date[] = currentDate.split(\"-\");\n \n int nextYear = Integer.parseInt(date[0]);\n int nextMonth = Integer.parseInt(date[1]);\n \n if (nextMonth == 12){\n nextYear ++;\n nextMonth = 1;\n }else nextMonth++;\n \n cust.setNextPayment();\n \n if(cust.getAcc_type().equals(\"Late\")) {\n \n double newOutstandingBalance = cust.getOutstandingBalance() - total;\n cust.setOutstandingBalance(newOutstandingBalance);\n }\n }\n //update table.\n DB.connect();\n \n Connection con = DB.getConn();\n try {\n con.setAutoCommit(false);\n DB.write(\"UPDATE invoice SET payment_status = '\"+ paymentStatus + \"' WHERE invoice_ID = \" + invoiceID);\n con.commit();\n }catch (SQLException ex) {\n if (con != null) {\n try {\n System.err.print(\"Transaction rolling back!\");\n con.rollback();\n } catch (SQLException ex1) {\n Logger.getLogger(DBConnectivity.class.getName()).log(Level.SEVERE, null, ex1);\n }\n }\n }finally {\n con.setAutoCommit(true);\n DB.closeConnection();\n }\n }",
"public void addPayment(Payment payment) {\n payments.add(payment);\n }",
"public void insertConcursoRecomendadaPeriodo(ConcursoRecomendadaPeriodo concursoRecomendadaPeriodo, Usuario usuario);",
"private void automaticPayment(String accountName, String reciever, String billName, final int amount, String date) {\n Log.d(TAG, \"makeTransaction: Has been called\");\n final DocumentReference senderDocRef = db.collection(\"users\").document(user.getEmail())\n .collection(\"accounts\").document(accountName);\n\n final DocumentReference recieverDocRef = db.collection(\"companies\").document(reciever);\n\n final DocumentReference billDocRef = db.collection(\"companies\").document(reciever).collection(\"customer\")\n .document(user.getEmail()).collection(\"bills\").document(billName);\n\n db.runTransaction(new Transaction.Function<Void>() {\n @Override\n public Void apply(Transaction transaction) throws FirebaseFirestoreException {\n DocumentSnapshot sender = transaction.get(senderDocRef);\n DocumentSnapshot reciever = transaction.get(recieverDocRef);\n\n\n int senderBalance = sender.getLong(\"balance\").intValue();\n int recieverBalance = reciever.getLong(\"amount\").intValue();\n int transactionBalance = Math.abs(amount);\n\n if (senderBalance >= transactionBalance) {\n transaction.update(senderDocRef, \"balance\", senderBalance - transactionBalance);\n transaction.update(recieverDocRef, \"amount\", recieverBalance + transactionBalance);\n transaction.update(billDocRef, \"isPaid\", true);\n\n\n SimpleDateFormat dateformat = new SimpleDateFormat(\"dd-MM-yyyy\");\n Date newDate = new Date();\n Calendar cal = Calendar.getInstance();\n cal.setTime(newDate);\n cal.add(Calendar.MONTH, 1);\n newDate = cal.getTime();\n transaction.update(billDocRef, \"recurring\", dateformat.format(newDate));\n } else {\n Log.d(TAG, \"apply: Transaction ikke fuldført\");\n }\n\n // Success\n return null;\n }\n }).addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n Log.d(TAG, \"Transaction success!\");\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.w(TAG, \"Transaction failure.\", e);\n }\n });\n\n }",
"public boolean savePayment(Pagamento payment) {\n\t\tString pattern = \"yyyy-MM-dd HH:mm:ss\";\n\t\tSimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\n\t\tString query = \"INSERT INTO pagamenti (id_veicolo, importo, orario, tipologia) VALUES (\";\n\t\tquery += \"'\" + payment.idVeicolo + \"',\" + Double.toString(payment.importo) + \",\";\n\t\tquery += \"'\" + simpleDateFormat.format(payment.orario) + \"','\" + payment.tipologia + \"')\";\n\t\t\n\t\treturn db.writeData(query);\n\t}",
"public void anualTasks(){\n List<Unit> units = unitService.getUnits();\n for(Unit unit: units){\n double amount = 10000; //@TODO calculate amount based on unit type\n Payment payment = new Payment();\n payment.setPaymentMethod(PaymentMethod.Cash);\n Calendar calendar = Calendar.getInstance();\n calendar.set(Calendar.MONTH, 1);\n calendar.set(Calendar.DATE, 30);\n payment.setDate(LocalDate.now());\n TimeZone tz = calendar.getTimeZone();\n ZoneId zid = tz == null ? ZoneId.systemDefault() : tz.toZoneId();\n payment.setAmount(amount);\n payment.setDueDate(LocalDateTime.ofInstant(calendar.toInstant(), zid).toLocalDate());\n payment.setClient(unit.getOwner());\n payment.setUnit(unit);\n payment.setRecurringInterval(365L);\n payment.setStatus(PaymentStatus.Pending);\n paymentService.savePayment(payment);\n }\n }",
"public void requestAllPayments() {\n\t\t// fetch all data\n\t\tString fetchAllPayments = \"SELECT * FROM Payments\";\n\t\ttry {\n\t\t\trs = statement.executeQuery(fetchAllPayments);\n\t\t} catch (SQLException se) {\n\t\t\tSystem.out.println(\"Error fetching Payments\");\n\n\t\t}\n\n\t\t// store data\n\t\ttry {\n\t\t\twhile (rs.next()) {\n\t\t\t\tint id = rs.getInt(\"Id\");\n\t\t\t\tint recordId = rs.getInt(\"RecordId\");\n\t\t\t\tint consignerId = rs.getInt(\"ConsignerId\");\n\t\t\t\tboolean outstanding = rs.getBoolean(\"Outstanding\");\n\t\t\t\tPayment p = new Payment(recordId, consignerId, outstanding);\n\t\t\t\tp.setId(id);\n\t\t\t\tcontroller.addToAllPayments(p);\n\t\t\t}\n\t\t} catch (SQLException se) {\n\t\t\tSystem.out.println(\"Error reading payment data\");\n\n\t\t}\n\t}",
"public static void addCreditCardPayment(Creditcardpayments credit) {\r\n \r\n try{\r\n\tSession session = sessionFactory.openSession();\r\n \tsession.beginTransaction();\r\n \tsession.save(credit);\r\n session.getTransaction().commit();\r\n session.close();\r\n }\r\n catch(Exception e)\r\n {\r\n JOptionPane.showMessageDialog(null, e);\r\n }\r\n\t\r\n }",
"public PaymentDAO() {\n INSERT_QUERY = \"INSERT INTO PAYMENTS (OrderID, UserID, Amount, Date,\"\n + \" Status, Type) VALUES (?, ?, ?, ?, ?, ?)\";\n UPDATE_QUERY = \"UPDATE payments SET OrderID = ?, UserID = ?, Amount = ?,\"\n + \" Date = ?, Status = ?, Type = ? WHERE PaymentID = ?\";\n DELETE_QUERY = \"DELETE FROM payments WHERE PaymentID = ?\";\n PAYMENT_SELECT = \"SELECT * FROM payments WHERE PaymentID = ?\";\n USER_SELECT = \"SELECT * FROM PAYMENTS WHERE UserID = ?\";\n DATE_SELECT = \"SELECT * FROM payments WHERE Date = ?\";\n USER_DATE_SELECT = \"SELECT * FROM payments WHERE UserID = ? AND Date = ?\";\n \n DBCONN = new DBConnector();\n }",
"public void addPayable(Payable payable) {\n TABLE_NAME = \"Payable\" + LoginActivity.database;\n SQLiteDatabase db = this.getWritableDatabase();\n\n ContentValues values = new ContentValues();\n values.put(KEY_TO, payable.getTo()); // to\n values.put(KEY_TOTAL, payable.getTotal()); // total\n values.put(KEY_DATE, payable.getDate()); // date\n values.put(KEY_ORIGINAL_DATE, payable.getOriginalDate()); // date\n\n // Inserting Row\n db.insert(TABLE_NAME, null, values);\n db.close(); // Closing database connection\n }",
"private void makePayment() {\r\n for (ENTRequest curReq : requestList) {\r\n if (curReq.getId() == requestId) {\r\n double requestAmt = curReq.getRequestAmt();\r\n ENTAccount myAccount = account.getSingleAccount(selectedAccount);\r\n //convert the requestors amount into my currency and debit from my account (catches thrown exception from currency bean)\r\n try {\r\n double debitAmt = 0 - convAmt.ConvertCurrency(requestAmt, curReq.getCurrency(), myAccount.getAcctCurrency());\r\n accountPayment.paymentTransaction(myAccount.getId(), curReq.getRequestorId(), curReq.getAccountId(), debitAmt); \r\n //add request amount in original currency to tp account\r\n accountPayment.paymentTransaction(curReq.getAccountId(), curUser.getUserId(), myAccount.getId(), requestAmt);\r\n } catch (Exception ex) {\r\n errorTxt.setErrorText(\"Error in converting the currency !\");\r\n }\r\n break;\r\n }\r\n }\r\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Sets the value of the 'field947' field
|
public com.maxpoint.cascading.avro.TestExtraLarge.Builder setField947(java.lang.CharSequence value) {
validate(fields()[947], value);
this.field947 = value;
fieldSetFlags()[947] = true;
return this;
}
|
[
"public void setField947(java.lang.CharSequence value) {\n this.field947 = value;\n }",
"public void setField945(java.lang.CharSequence value) {\n this.field945 = value;\n }",
"public void setField946(java.lang.CharSequence value) {\n this.field946 = value;\n }",
"public void setField687(java.lang.CharSequence value) {\n this.field687 = value;\n }",
"public void setField697(java.lang.CharSequence value) {\n this.field697 = value;\n }",
"public void setField941(java.lang.CharSequence value) {\n this.field941 = value;\n }",
"public void setField973(java.lang.CharSequence value) {\n this.field973 = value;\n }",
"public void setField873(java.lang.CharSequence value) {\n this.field873 = value;\n }",
"public void setField916(java.lang.CharSequence value) {\n this.field916 = value;\n }",
"public void setField904(java.lang.CharSequence value) {\n this.field904 = value;\n }",
"public void setField948(java.lang.CharSequence value) {\n this.field948 = value;\n }",
"public void setField692(java.lang.CharSequence value) {\n this.field692 = value;\n }",
"public void setField757(java.lang.CharSequence value) {\n this.field757 = value;\n }",
"public void setField735(java.lang.CharSequence value) {\n this.field735 = value;\n }",
"public void setField869(java.lang.CharSequence value) {\n this.field869 = value;\n }",
"public void setField987(java.lang.CharSequence value) {\n this.field987 = value;\n }",
"public void setField787(java.lang.CharSequence value) {\n this.field787 = value;\n }",
"public void setField73(java.lang.CharSequence value) {\n this.field73 = value;\n }",
"public void setField935(java.lang.CharSequence value) {\n this.field935 = value;\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
.protocol.CdmaStationInfo cdma = 2;
|
public protocol.Message.CdmaStationInfo getCdma() {
if (cdmaBuilder_ == null) {
return cdma_ == null ? protocol.Message.CdmaStationInfo.getDefaultInstance() : cdma_;
} else {
return cdmaBuilder_.getMessage();
}
}
|
[
"protocol.Message.CdmaStationInfo getCdma();",
"protocol.Message.CdmaStationInfoOrBuilder getCdmaOrBuilder();",
"public protocol.Message.CdmaStationInfoOrBuilder getCdmaOrBuilder() {\n return getCdma();\n }",
"public protocol.Message.CdmaStationInfo getCdma() {\n return cdma_ == null ? protocol.Message.CdmaStationInfo.getDefaultInstance() : cdma_;\n }",
"sample.protbuf.Message.Data.Comic getComic();",
"private CdmaStationInfo(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }",
"public void setContactStation(String station) ;",
"public int getAmsNorthPort() {return amsNorthPort;}",
"public interface TcpSynDataCs {\n\n public int getIpId();\n\n public short getTos();\n\n public int getLength();\n\n public String getIpFlags();\n\n public short getTtl();\n\n public long getSequenceNum();\n \n public int getWindowSize();\n\n public String getTcpOptions();\n\n public String getTcpFlags();\n\n public int getTcpLength();\n}",
"protocol.Message.GsmStationInfo getGsm();",
"protocol.Message.DeviceReportSensorDataReqMsg.AdditionalInfo getStatusInfo();",
"public String getContactStation() ;",
"interface DmaRequestMaster extends DmaRequest\n{\n\tpublic void dmaMaster(CPU cpu) throws SIMException;\n}",
"protocol.Message.ChatGroup.Member.Device getDevice();",
"public void setChannel(int station) {\r\n\t\tchannel = station;\r\n\t}",
"public interface Callsign extends Adif {\n \n /**\n * Gets the contact station. A \"\" indicates that this field is not in use.\n * \n * @return the contact station.\n */\n public String getContactStation() ;\n \n /**\n * Sets the contact station. A \"\" indicates that this field is not in use.\n * \n * @param station the contact station.\n */\n public void setContactStation(String station) ;\n\n /**\n * Gets the operating station. A \"\" indicates that this field is not in use.\n * \n * @return the operating station.\n */\n public String getOperatingStation() ;\n \n /**\n * Sets the operating station. A \"\" indicates that this field is not in use.\n * \n * @param station the operating station.\n */\n public void setOperatingStation(String station) ;\n\n}",
"ASIOChannelInfo() {\n\t}",
"interface DmaRequestWrite extends DmaRequest\n{\n\t/**\n\t * Read a byte from the peripheral\n\t */\n\tpublic int getDmaValue();\n}",
"public DriverStationPacket() {\n super(4);\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Added for BUG 17910026 Get unique identifier using Search request. Added this method to fix the Unique ID issue
|
public String getUniqueIdentifier(String logonname) {
String retUid = null;
try {
SearchRequest searchReq = new SearchRequest();
searchReq.setSearchBase(SAPUSER);
// specify the attributes to return
searchReq.addAttribute("id");
// specify the filter
FilterTerm ft = new FilterTerm();
ft.setOperation(FilterTerm.OP_EQUAL);
ft.setName(LOGONNAME);
ft.setValue(logonname);
searchReq.addFilterTerm(ft);
LOG.error("Perf: Search request to get UniqueIdentifier started for user {0} ", logonname);
SpmlResponse spmlResponse = connection.getResponse(searchReq
.toXml());
LOG.error("Perf: Search request to get UniqueIdentifier completed for user {0} ", logonname);
SearchResponse resp = (SearchResponse) spmlResponse;
List results = resp.getResults();
if (results != null) {
SearchResult sr = (SearchResult) results.get(0);
retUid = sr.getIdentifierString();
}
} catch (Exception e) {
LOG.error(e, configuration
.getMessage("SAPUME_ERR_GET_UNIQUEIDENTIFIER")
+ " " + e.getMessage());
throw new ConnectorException(configuration
.getMessage("SAPUME_ERR_GET_UNIQUEIDENTIFIER")
+ " " + e.getMessage(), e);
}
return retUid;
}
|
[
"private final String generateSearchId() {\n return UUID.randomUUID().toString().replace(\"-\", \"\").substring(0,8);\n }",
"public String getIdentifier(){\n return searchId == null ? null : Long.toString(searchId);\n }",
"int getSearchId();",
"public String getUniqueIdentifier(){\n return (streetAddress + aptNumber + zip).toLowerCase().replaceAll(\"\\\\s+\",\"\"); \n }",
"io.dstore.values.StringValue getUniqueId();",
"java.lang.String getResponseId();",
"java.lang.String getQueryId();",
"private UniqueIdentifier(){\n\t\t\n\t}",
"private String generarIdUsr() {\n\t\tStringBuilder id = new StringBuilder();\n\t\tid.append(this.nombre.substring(0, 1).toUpperCase());\n\t\tString[]divApellidos = this.apellidos.split(\"\\\\s+\");\n\t\tid.append(divApellidos[0].substring(0, 1).toUpperCase());\n\t\tid.append(divApellidos[1].substring(0, 1).toUpperCase());\n\t\tid.append(this.nif.getNifTexto().substring(7, 9));\n\t\tthis.idUsr = id.toString();\n\t\treturn id.toString();\n\t}",
"java.lang.String getCustomId();",
"public String getSearchid()\r\n {\r\n return searchid;\r\n }",
"java.lang.String getReqId();",
"private String getUniqueId(JCas jCas) {\n return ConsumerUtils.getExternalId(getDocumentAnnotation(jCas), contentHashAsId);\n }",
"public SearchResultIdentifier getSearchResultIdentifier() throws InvalidFormatException;",
"java.lang.String getRegistId();",
"String getRecepieId();",
"UUID getMatchUniqueId();",
"java.lang.String getExternalId();",
"private String getGUID(RestResponse restResponse) {\n\t\tList<Message> messages = restResponse.getMessages();\n\t\tString GUID = \"\";\n\t\tfor (int i = 0; i < messages.size(); i++) {\n\t\t\tMessage message = messages.get(i);\n\t\t\tString statusCode = message.getStatusCode();\n\t\t\tif (HttpStatusCodes.SC_CREATED == Integer.parseInt(statusCode)) {\n\t\t\t\tString GUIDTemp = message.getDescription();\n\t\t\t\tGUID = GUIDTemp.substring(GUIDTemp.lastIndexOf(\" \")+1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn GUID;\n\t}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
This method calculates the distances between all stations from the input ArrayLists, and returns them as a double matrix. Element at position (i,j) in the output matrix corresponds to the distance between departureStation index i and arrivalStation index j.
|
public double[][] distancesUsedStation(ArrayList<Station> departureStations, ArrayList<Station> arrivalStations) {
double[][] distancesMatrix = new double[departureStations.size()][arrivalStations.size()];
for (int i = 0; i < departureStations.size(); i++) {
for (int j = 0; j < arrivalStations.size(); j++) {
distancesMatrix[i][j] = departureStations.get(i).getLocation().distanceTo(arrivalStations.get(j).getLocation());
}
}
return distancesMatrix;
}
|
[
"public double[] distanceToArrival(ArrayList<Station> arrivalStations) {\n\t\tdouble[] distances = new double[arrivalStations.size()];\n\t\tfor (int i = 0; i < arrivalStations.size(); i++) {\n\t\t\tdistances[i] = this.arrival.distanceTo(arrivalStations.get(i).getLocation()) ;\n\t\t}\n\t\treturn distances;\n\t}",
"public double[] distanceToDeparture(ArrayList<Station> departureStations) {\n\t\tdouble[] distances = new double[departureStations.size()];\n\t\tfor (int i = 0; i < departureStations.size(); i++) {\n\t\t\tdistances[i] = this.departure.distanceTo(departureStations.get(i).getLocation()) ;\n\t\t}\n\t\treturn distances;\n\t}",
"private void generateDistancesMatrix() {\n for (int x = 0; x < this.distancesMatrix[0].length; x++) {\n for (int y = 0; y < this.distancesMatrix[0].length; y++) {\n this.distancesMatrix[x][y] = this.cities.get(x).getDistance(this.cities.get(y));\n }\n }\n }",
"@Pure\n public double[][] getDistMatrix(final ArrayList<double[]> coordList) {\n int size = coordList.size();\n double[][] distMatrix = new double[size][size];\n for (int i = 0; (i < size); i++) {\n {\n double[] distLine = new double[size];\n for (int j = 0; (j < size); j++) {\n {\n double _get = coordList.get(i)[1];\n double _get_1 = coordList.get(j)[1];\n double dist = Math.pow((_get - _get_1), 2);\n double _get_2 = coordList.get(i)[2];\n double _get_3 = coordList.get(j)[2];\n double _pow = Math.pow((_get_2 - _get_3), 2);\n dist = (dist + _pow);\n dist = Math.pow(dist, 0.5);\n distLine[j] = dist;\n }\n }\n distMatrix[i] = distLine;\n }\n }\n return distMatrix;\n }",
"private void calculateDistances() {\n\n\t\tdist = new Double[cameras.size()][objects.size()];\n\t\tfor (int n=0 ; n<cameras.size() ; n++) {\n\t\t\tfor (int m=0 ; m<objects.size() ; m++) {\n\t\t\t\tdist[n][m] = Math.sqrt(Math.pow((cameras.get(n).x-objects.get(m).x), 2) + Math.pow((cameras.get(n).y-objects.get(m).y), 2));\n//\t\t\t\tSystem.out.println(\"dist \"+cameras.get(n).id+\" to object \"+objects.get(m).id+\" is: \"+dist[n][m]);\n\t\t\t}\n\t\t}\n\t}",
"public double calculateDistance(Station[] stations)\n {\n double result = 0.0;\n\n // Start with the second station. If only station exists in the list, then the distance to travel is zero.\n // Fetch the distance between every two stations and add it to the running sum. If the path is invalid, set the\n // sum to Infinity.\n for (int i = 1; i < stations.length; i++)\n {\n String key = stations[i - 1].getId() + \"-\" + stations[i].getId();\n\n if (this.routeDict.containsKey(key))\n {\n // valid path; add the distance\n result += this.routeDict.get(key);\n }\n else\n {\n // invalid path; set the distance to Infinity\n result = Double.POSITIVE_INFINITY;\n return result;\n }\n\n }\n\n return result;\n }",
"public double[][] getDistances() {\n calculateDistances();\n\n int numPoints = getNumPoints();\n double[][] temp = new double[numPoints][numPoints];\n\n for (int i = 0; i < numPoints; i++) {\n for (int j = 0; j < numPoints; j++) {\n temp[i][j] = getDistance(i, j);\n }\n }\n\n return temp;\n }",
"public double[][] getDistanceMatrix() {\n\t\tdouble[][] matrix = new double[distances.getSize()][distances.getSize()];\n\t\tfor (int i = 0; i < matrix.length; i++) {\n\t\t\tfor (int j = i+1; j < matrix.length; j++) {\n\t\t\t\tmatrix[i][j] = matrix[j][i] = distances.getValue(i, j);\n\t\t\t}\n\t\t}\n\t\treturn matrix;\n\t}",
"static public Route[] calculateDistance(){\n\t\t\n\t\tCalculateDistance cd = new CalculateDistance();\n\t\t\n\t\treturn cd.calculateAll();\n\t}",
"private float[][] getDistanceMatrix() {\n\t// get node list and allocate space for\n\t// the distance matrix\n Node[] nodeList = iGraph.getNodeArray();\n\tint nC = iGraph.nodeCount();\n\tfloat[][] dm = new float[nC][nC];\n\n\tSystem.out.println(\"Distance matrix: (\"+nC+\" nodes)\");\n\n\t// initialize 1st order defaults (from iConnected)\n\tfor (int i = 0; i < nC; i++)\n\t for (int j = 0; j < nC; j++)\n\t\tdm[i][j] = (float)(iConnected[i][j] != NOT_CONNECTED ? 1:0);\n\n\tSystem.out.println(\" filling distance matrix...\");\n\n\tboolean matrixChanged = true;\n\n\tfor (int c = 0; (c < nC) && (matrixChanged); c++) {\n\t // mark the matrix unchanged\n\t matrixChanged = false;\n\n\t // iterate over starting nodes\n\t for (int sn = 0; sn < nC; sn++) {\n\t\tint pct = Math.round((((float) sn) / ((float) nC))*100);\n\t\tSystem.out.print(\"\\r pass \"+c+\"/2(?): \"+pct+\"% \");\n\n\t\t// iterate over mid-point nodes\n\t\tfor (int mn = 0; mn < nC; mn++) {\n\n\t\t // iterate over target nodes\n\t\t if (dm[sn][mn] != 0.0) {\n\t\t\tfor (int tn = 0; tn < nC; tn++) {\n\n\t\t\t // take the new distance from source\n\t\t\t // to target, if conditions holding\n\t\t\t if (dm[mn][tn] != 0.0) {\n\t\t\t\tfloat newDist = dm[sn][mn] + dm[mn][tn];\n\n\t\t\t\tif ((dm[sn][tn] == 0) ||\n\t\t\t\t (newDist < dm[sn][tn])) {\n\t\t\t\t dm[sn][tn] = newDist;\n\t\t\t\t dm[tn][sn] = newDist;\n\t\t\t\t matrixChanged = true;\n\t\t\t\t}\n\t\t\t }\n\t\t\t}\n\t\t }\n\t\t}\n\t }\n\n\t System.out.println();\n\t}\n\n\n\t// DEBUG: print out matrix\n\t// for (int i = 0; i < nC; i++) {\n\t// System.out.println(nodeList[i].toString());\n\t// System.out.print(dm[i][0]);\n\t// for (int j = 1; j < nC; j++)\n\t// \tSystem.out.print(\"\\t\"+dm[i][j]);\n\t// System.out.print(\"\\n\");\n\n\t// return distance map\n\treturn dm;\n }",
"private Double[][] makeAdjacencyMatrix()\n {\n Double[][] matrix = new Double[this.numIntxns][this.numIntxns];\n\n for (int i = 0; i < this.numIntxns; i++)\n {\n for (int j = 0; j < this.numIntxns; j++)\n {\n // if the indices are the same the distance is 0.0.\n // otherwise, it's infinite.\n matrix[i][j] = (i != j) ? null : 0.0;\n }\n }\n\n // populate the matrix\n for (int intxn = 0; intxn < this.numIntxns; intxn++)\n {\n for (Road road : this.roads)\n {\n if (intxn == road.start())\n {\n matrix[intxn][road.end()] = road.length();\n matrix[road.end()][intxn] = road.length();\n }\n }\n }\n\n return matrix;\n }",
"public ArrayList<ArrayList<Integer>> updateOutputs(){\n\t\t// prepare list to contain the distance vectors that this node will\n\t\t// send to its neighbors\n\t\tArrayList<ArrayList<Integer>> output = new ArrayList<ArrayList<Integer>>();\n\t\tint t = 0;\n\t\tint max = 0;\n\t\twhile(t < this.distVector.size()){\n\t\t\tif(this.distVector.get(t) > max)\n\t\t\t\tmax = this.distVector.get(t);\n\t\t\tt = t + 2;\n\t\t}\n\t\t\n\t\tt = 0;\n\t\twhile(t <= max){\n\t\t\tArrayList<Integer> dummy1 = new ArrayList<Integer>();\n\t\t\toutput.add(dummy1);\n\t\t\tt++;\n\t\t}\n\t\t\n\t\t\n\t\t// DV algorithm\n\t\t\t\tint allNodes = 0;\n\t\t\t\t\twhile(allNodes < this.distVector.size()){\n\t\t\t\t\t\tint neighborNodes = 0;\n\t\t\t\t\t\tint minimum = INFINITY;\n\t\t\t\t\t\tint hopNode = INFINITY;\n\t\t\t\t\t\t\n\t\t\t\t\t\tint destination = this.distVector.get(allNodes);\n\t\t\t\t\t\t// for each neighbor, calculate C(thisnode, neighbor) + C(neighbor, destination)\n\t\t\t\t\t\tint passing = 0;\n\t\t\t\t\t\twhile(neighborNodes < this.neighbors.size()){\n\t\t\t\t\t\t\tint index = 0;\n\t\t\t\t\t\t\tint distance = INFINITY;\n\t\t\t\t\t\t\tint neighbor = this.neighbors.get(neighborNodes);\n\t\t\t\t\t\n\t\t\t\t\t\t\t// get C(thisnode, neighbor)\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\twhile(index < this.neighbors.size()){\n\t\t\t\t\t\t\t\tif(neighbor == this.neighbors.get(index)){\n\t\t\t\t\t\t\t\t\tdistance = this.neighbors.get(index + 1);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tindex = index + 2;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tint connection = 0;\n\t\t\t\t\t\t\t// now if the destination is not the current neighbor,\n\t\t\t\t\t\t\t// calculate cost from current neighbor to destination\n\t\t\t\t\t\t\t// if this distance is INFINITY, we set the total distance to INFINITY\n\t\t\t\t\t\t if(neighbor != destination && distance != INFINITY){\n\t\t\t\t\t\t\t connection = INFINITY;\n\t\t\t\t\t\t\t index = 0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t while( index < this.allVectors.get(neighbor).size()){\n\t\t\t\t\t\t\t\tif(destination == this.allVectors.get(neighbor).get(index)){\n\t\t\t\t\t\t\t\t\tconnection = this.allVectors.get(neighbor).get(index + 1);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tindex = index + 2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(connection != INFINITY){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tdistance = connection + distance;}\n\t\t\t\t\t\t \n\t\t\t\t\t\t if(connection == INFINITY){\n\t\t\t\t\t\t \tdistance = INFINITY;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t // compare with the minimum and replace if necessary\n\t\t\t\t\t\t // if the neighbor node is not the destination, and the total distance\n\t\t\t\t\t\t // was not infinity, then we have traversed through the neighbor node\n\t\t\t\t\t\t // to the distance and must record this so we can send a distance vector\n\t\t\t\t\t\t // to the neighbor node that says the distance to the destination\n\t\t\t\t\t\t // from this node to the neighbor node is INFINITY to account for poison\n\t\t\t\t\t\t // reverse implementation\n\t\t\t\t\t\t\tif(distance < minimum){\n\t\t\t\t\t\t\t\tminimum = distance;\n\t\t\t\t\t\t\t\thopNode = neighbor;\n\t\t\t\t\t\t\t\tif(hopNode != destination && distance != INFINITY){\n\t\t\t\t\t\t\t\t\tpassing = 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\t\tpassing = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// advance to next neighbor node\n\t\t\t\t\t\t\tneighborNodes = neighborNodes + 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t// found minimum for this destination\n\t\t\t\t\t\t// if there is a change in the distance vector,\n\t\t\t\t\t\t// we set this.hasUpdate to 1\n\t\t\t\t\t\tif(minimum != this.distVector.get(allNodes + 1)){\n\t\t\t\t\t\t\tthis.hasUpdate = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.distVector.set(allNodes + 1, minimum);\t\n\t\t\t\t\t\t// if there was no \"passing\" over a neighbor node\n\t\t\t\t\t\t// we add in the actual values to the distance vectors\n\t\t\t\t\t\t// to be sent to neighbors\n\t\t\t\t\t\tif(passing == 0){\n\t\t\t\t\t\t\tint a = 0;\n;\t\t\t\t\t\t\twhile (a < this.neighbors.size()){\n\t\t\t\t\t\t\t\tint b = this.neighbors.get(a);\n\t\t\t\t\t\t\t\toutput.get(b).add(destination);\n\t\t\t\t\t\t\t\toutput.get(b).add(minimum);\n\t\t\t\t\t\t\t\ta = a + 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// otherwise we must let the neighbor node that we passed\n\t\t\t\t\t\t// over that the distance from this node to the destination\n\t\t\t\t\t\t// is INFINITY\n\t\t\t\t\t\tif(passing == 1){\n\t\t\t\t\t\t\tint a = 0;\n\t\t\t\t\t\t\twhile (a < this.neighbors.size()){\n\t\t\t\t\t\t\t\tint b = this.neighbors.get(a);\n\t\t\t\t\t\t\t\tif(b == hopNode){\n\t\t\t\t\t\t\t\t\toutput.get(b).add(destination);\n\t\t\t\t\t\t\t\t\toutput.get(b).add(INFINITY);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(b != hopNode){\n\t\t\t\t\t\t\t\t\toutput.get(b).add(destination);\n\t\t\t\t\t\t\t\t\toutput.get(b).add(minimum);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ta = a + 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t// advance to next allNodes\n\t\t\t\t\t\tallNodes = allNodes + 2;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t// return the list of distance vectors\n\t\t\treturn output;\n\t\t\t}",
"public static <S extends Solution<?>> double[][] distanceMatrix(List<S> solutionSet) {\n double[][] distance = new double[solutionSet.size()][solutionSet.size()];\n for (int i = 0; i < solutionSet.size(); i++) {\n distance[i][i] = 0.0;\n for (int j = i + 1; j < solutionSet.size(); j++) {\n distance[i][j] =\n SolutionUtils.distanceBetweenObjectives(solutionSet.get(i), solutionSet.get(j));\n distance[j][i] = distance[i][j];\n }\n }\n return distance;\n }",
"public Transition[] computeDistances(){\n\t\tSystem.out.println(\"Computing Transitions...\");\n\t\tTransition[] instanceTransitions = new Transition[nbBd*(nbBd-1)*4];\n\t\t//i sera l'indice de la cellule du tableau\n\t\tint i=0;\n\t\tfor (Strip aStrip : tabStrips){\n\t\t\tfor (Strip anotherStrip : tabStrips)\n\t\t\t\tif (aStrip != anotherStrip){\n\t\t\t\t\tdouble dist = Math.sqrt(Math.pow(anotherStrip.getX0() - aStrip.getX0(), 2) + Math.pow(aStrip.getY0() - anotherStrip.getY0(), 2));\n\t\t\t\t\tdist = 2*(Math.atan(dist/((double)2000*indAltitude)));\n\t\t\t\t\tinstanceTransitions[i] = new Transition(aStrip.getInd(), false, anotherStrip.getInd(), false, (int)((indDMin + (dist / indVr))*1000), i);\n\t\t\t\t\ti++;\n\t\t\t\t\tdist = Math.sqrt(Math.pow(anotherStrip.getX1() - aStrip.getX0(), 2) + Math.pow(aStrip.getY0() - anotherStrip.getY1(), 2));\n\t\t\t\t\tdist = 2*(Math.atan(dist/((double)2000*indAltitude)));\n\t\t\t\t\tinstanceTransitions[i] = new Transition(aStrip.getInd(), false, anotherStrip.getInd(), true, (int)((indDMin + (dist / indVr))*1000), i);\n\t\t\t\t\ti++;\n\t\t\t\t\tdist = Math.sqrt(Math.pow(anotherStrip.getX0() - aStrip.getX1(), 2) + Math.pow(aStrip.getY1() - anotherStrip.getY0(), 2));\n\t\t\t\t\tdist = 2*(Math.atan(dist/((double)2000*indAltitude)));\n\t\t\t\t\tinstanceTransitions[i] = new Transition(aStrip.getInd(), true, anotherStrip.getInd(), false, (int)((indDMin + (dist / indVr))*1000), i);\n\t\t\t\t\ti++;\n\t\t\t\t\tdist = Math.sqrt(Math.pow(anotherStrip.getX1() - aStrip.getX1(), 2) + Math.pow(aStrip.getY1() - anotherStrip.getY1(), 2));\n\t\t\t\t\tdist = 2*(Math.atan(dist/((double)2000*indAltitude)));\n\t\t\t\t\tinstanceTransitions[i] = new Transition(aStrip.getInd(), true, anotherStrip.getInd(), true, (int)((indDMin + (dist / indVr))*1000), i);\n\t\t\t\t\ti++;\n\t\t\t\t}//i != j\n\t\t\t//calcul de indMiddleTMin au fur et a mesure en utilisant des coefficients \n\t\t\t//pour eviter de depasser la taille maximale des int \n\t\t\tint divider = ((2*i) / ((nbBd-1) * 4));\n\t\t\tindMiddleTMin = ((indMiddleTMin * (divider - 2)) + (aStrip.indTMin0 + aStrip.indTMin1)) / divider;\n\t\t}//for\n\t\treturn instanceTransitions;\n\t}",
"public static double getDistance(ArrayList<City> routine){ \n double totalDistance = 0.0;\n for (int i = 0; i < routine.size() - 1; i++) {\n totalDistance += routine.get(i).distance(routine.get(i+1));\n }\n return totalDistance;\n }",
"public static ArrayList<Coord[]> calcDistance(ArrayList<Coord[]> points) {\n \tHashMap<Coord[], Double> map = new HashMap<Coord[], Double>();\n \tfor(Coord[] pair: points) {\n \t\tdouble dis = Math.sqrt(Math.pow((pair[1].x - pair[0].x), 2) + Math.pow((pair[1].y - pair[0].y), 2));\n \t\tmap.put(pair, dis);\n \t}\n \tMap<Coord[], Double> sorted = sortMapByValue(map);\n \tArrayList<Coord[]> result = new ArrayList<Coord[]>();\n \tfor(Coord[] pair: sorted.keySet()) {\n \t\tresult.add(pair);\n \t}\n\t\treturn result; \t\n }",
"public ArrayList<Double> getDistances() {\n return intersections.stream().map(Intersection::getDist)\n .collect(ArrayList::new, ArrayList::add, ArrayList::addAll);\n }",
"public HashMap<String, Double> calculateTotalCost(ArrayList<Station> stations){\n\t\tHashMap<String, Double> totalCosts = new HashMap<>();\n\t\tfor (Station station : this.stations) {\n\t\t\tstation.rideCost(true);\n\t\t\ttotalCosts.put(station.getName(), station.rideCost(true));\n\t\t}\n\t\treturn totalCosts;\n\t}",
"public double distance (ArrayList<DoublePoint> outlier_array);"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Returns all rows from the T_POLICY_BASE table that match the criteria 'MPNAME = :mpname'.
|
@Transactional
public List<TPolicyBase> findWhereMpnameEquals(String mpname) throws TPolicyBaseDaoException
{
try {
return jdbcTemplate.query("SELECT MPID, PTVID, MPNAME, CATEGORY, DESCRIPTION FROM " + getTableName() + " WHERE MPNAME = ? ORDER BY MPNAME", this,mpname);
}
catch (Exception e) {
throw new TPolicyBaseDaoException("Query failed", e);
}
}
|
[
"@Transactional\n\tpublic List<TPolicyBase> findWhereMpidEquals(long mpid) throws TPolicyBaseDaoException\n\t{\n\t\ttry {\n\t\t\treturn jdbcTemplate.query(\"SELECT MPID, PTVID, MPNAME, CATEGORY, DESCRIPTION FROM \" + getTableName() + \" WHERE MPID = ? ORDER BY MPID\", this,mpid);\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new TPolicyBaseDaoException(\"Query failed\", e);\n\t\t}\n\t\t\n\t}",
"@Transactional\n\tpublic TPolicyBase findByPrimaryKey(long mpid) throws TPolicyBaseDaoException\n\t{\n\t\ttry {\n\t\t\tList<TPolicyBase> list = jdbcTemplate.query(\"SELECT MPID, PTVID, MPNAME, CATEGORY, DESCRIPTION FROM \" + getTableName() + \" WHERE MPID = ?\", this,mpid);\n\t\t\treturn list.size() == 0 ? null : list.get(0);\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new TPolicyBaseDaoException(\"Query failed\", e);\n\t\t}\n\t\t\n\t}",
"@Transactional\n\tpublic List<TPolicyBase> findAll() throws TPolicyBaseDaoException\n\t{\n\t\ttry {\n\t\t\treturn jdbcTemplate.query(\"SELECT MPID, PTVID, MPNAME, CATEGORY, DESCRIPTION FROM \" + getTableName() + \" ORDER BY MPID\", this);\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new TPolicyBaseDaoException(\"Query failed\", e);\n\t\t}\n\t\t\n\t}",
"@Transactional\n\tpublic List<TModuleInfoInit> findWhereMnameEquals(String mname) throws TModuleInfoInitDaoException\n\t{\n\t\ttry {\n\t\t\treturn jdbcTemplate.query(\"SELECT MODID, MNAME, MCODE, DESCRIPTION FROM \" + getTableName() + \" WHERE MNAME = ? ORDER BY MNAME\", this,mname);\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new TModuleInfoInitDaoException(\"Query failed\", e);\n\t\t}\n\t\t\n\t}",
"public Witness[] findWhereNamewEquals(String namew) throws WitnessDaoException\n\t{\n\t\treturn findByDynamicSelect( SQL_SELECT + \" WHERE namew = ? ORDER BY namew\", new Object[] { namew } );\n\t}",
"@Transactional\n\tpublic List<TPolicyBase> findWhereDescriptionEquals(String description) throws TPolicyBaseDaoException\n\t{\n\t\ttry {\n\t\t\treturn jdbcTemplate.query(\"SELECT MPID, PTVID, MPNAME, CATEGORY, DESCRIPTION FROM \" + getTableName() + \" WHERE DESCRIPTION = ? ORDER BY DESCRIPTION\", this,description);\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new TPolicyBaseDaoException(\"Query failed\", e);\n\t\t}\n\t\t\n\t}",
"private List<ReplicationPolicyEntry> listReplicationPolicies(Identifier pid,\n Map<String, String> tableMap) throws SQLException {\n\n List<ReplicationPolicyEntry> replicationPolicyEntryList = new ArrayList<ReplicationPolicyEntry>();\n final Map<String, String> finalTableMap = tableMap;\n final String pidStr = pid.getValue();\n\n replicationPolicyEntryList = this.jdbcTemplate.query(new PreparedStatementCreator() {\n\n @Override\n public PreparedStatement createPreparedStatement(Connection conn) throws SQLException {\n String sqlStatement = \"SELECT guid, policy, member_node FROM \"\n + finalTableMap.get(SM_POLICY_TABLE) + \" WHERE guid = ?\";\n\n PreparedStatement statement = conn.prepareStatement(sqlStatement);\n statement.setString(1, pidStr);\n return statement;\n }\n\n }, new ReplicationPolicyEntryMapper());\n // query the smreplicationpolicy table\n return replicationPolicyEntryList;\n }",
"@Transactional\n\tpublic List<TModuleInfoInit> findWhereMcodeEquals(long mcode) throws TModuleInfoInitDaoException\n\t{\n\t\ttry {\n\t\t\treturn jdbcTemplate.query(\"SELECT MODID, MNAME, MCODE, DESCRIPTION FROM \" + getTableName() + \" WHERE MCODE = ? ORDER BY MCODE\", this,mcode);\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new TModuleInfoInitDaoException(\"Query failed\", e);\n\t\t}\n\t\t\n\t}",
"@SuppressWarnings(\"static-access\")\n\tpublic ArrayList<String> getAllPoliciesFromDB () throws Exception {\n\t\tString queryGetAllPoliciesFromCurrentCycle = \n\t\t\t\t\"SELECT DISTINCT PO_CONT\\r\\n\" + \n\t\t\t\t\"FROM [\" + BaseTest.getWebsite() + \"].STAGING.T_STPO_POLICY PO\\r\\n\" + \n\t\t\t\t\"LEFT JOIN [\" + BaseTest.getWebsite() + \"].STAGING.T_STTR_TRANSACTION TR ON PO.PO_POL_NUM = TR.TR_POL_NUM\\r\\n\" + \n\t\t\t\t\"WHERE PO.CURRENT_FLAG = 1\\r\\n\" + \n\t\t\t\t\"AND TR.CURRENT_FLAG = 1\\r\\n\" + \n\t\t\t\t\"AND PO.PO_CYCLE_DATE = '\"+currentCycleDate+\"';\";\n\t\t\n\t\tconn.createSQLServerConn();\n\t\ttry {\n\t\t\tpoliciesList=conn.fetchPoliciesFromDB (queryGetAllPoliciesFromCurrentCycle);\n\t\t\tReports.logAMessage(LogStatus.PASS, \"Successfully retrieved \" + policiesList.size() + \" policies to test\");\n\t\t\tReports.logAMessage(LogStatus.INFO, \"Policies: \\r\\n\" + policiesList);\n\t\t\tSystem.out.println(\"Successfully retrieved \" + policiesList.size() + \" policies to test \\r\\n\"\n\t\t\t\t\t+ \"Policies: \\r\\n\" + policiesList);\n\t\t} catch (NullPointerException e) {\n\t\t\tReports.logAMessage(LogStatus.ERROR, \"Exception: Null pointer\");\n\t\t} catch(Exception e) {\n\t\t\tSystem.err.println(\"Execption: \" + e.getMessage());\n\t\t\tReports.logAMessage(LogStatus.ERROR, \"Exception: \" + e.getMessage());\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tif (policiesList.size() < 1) {\n\t\t\tSystem.out.println(\"FAIL: There are no policies in the database to test against\");\n\t\t\tReports.logAMessage(LogStatus.FAIL, \"There are no policies in the database to test against\");\n\t\t} else {\n\t\t\tif (policiesList.size() > 1) {\n\t\t\t\t// do nothing\n\t\t\t}\n\t\t}\n\t\treturn policiesList;\n\t}",
"List<ProteinCurrent> searchByLikeName(String namePrefix);",
"@Transactional\n\tpublic List<TPolicyBase> findWhereCategoryEquals(long category) throws TPolicyBaseDaoException\n\t{\n\t\ttry {\n\t\t\treturn jdbcTemplate.query(\"SELECT MPID, PTVID, MPNAME, CATEGORY, DESCRIPTION FROM \" + getTableName() + \" WHERE CATEGORY = ? ORDER BY CATEGORY\", this,category);\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new TPolicyBaseDaoException(\"Query failed\", e);\n\t\t}\n\t\t\n\t}",
"@Override\n public List<PolicyHolder> showAllPolicyHolders()\n {\n \tList<PolicyHolder> h_list=holderdao.findAll();\n \treturn h_list;\n }",
"public Items[] findWhereNameEquals(String name) throws ItemsDaoException;",
"public boolean policyInstancesIntegrity(String polname, String subject, String target){\r\n\r\n\t\tboolean decision = true;\r\n\r\n\t\tString[] cols = new String [] {KEY_POLICY_NAME, KEY_SUBJECT, KEY_TARGET, KEY_OUTCOME};\r\n\t\tString where = KEY_POLICY_NAME + \"=? AND \" + KEY_SUBJECT + \"=? AND \" + KEY_TARGET + \"=?\";\r\n\t\tString[] cols1 = {polname, subject, target};\r\n\r\n\t\tCursor c = ourDatabase.query(POLICY_INSTANCES_TABLE, cols, where, cols1, null, null, null);\r\n\t\tLog.d(\"query\", \" \" + c.getCount());\r\n\r\n\t\t//if such a record exists in the database then return true\r\n\t\tif(c.getCount() != 0){\r\n\t\t\tdecision = true;\r\n\t\t}\r\n\r\n\t\t//if it doesn't exist in the database \r\n\t\telse{\r\n\t\t\tdecision = false;\r\n\t\t}\r\n\r\n\t\treturn decision;\r\n\t}",
"public boolean searchCertainItem(String itemname, String tableName, String columnName)\n {\n String selectStr;\n ResultSet rs;\n try{\n\n selectStr=\"SELECT \"+itemname+\" FROM \"+tableName+\" WHERE \"+ columnName+\" = \"+quotate(itemname);\n rs = stmt.executeQuery(selectStr);\n\n while (rs.next())\n {\n return true;\n }\n }catch(Exception e){\n System.out.println(\"Error occurred in searchLogin\");\n }\n\n return false;\n\n }",
"public List<PSMReportItem> getPSMReportByFileName(String fileName){\n\n Set<PSMReportItem> fileNameSet = new HashSet<>();\n\n for (PSMReportItem psm : psmList) {\n if (psm instanceof ReportPSM) {\n if(((ReportPSM) psm).getFileName().equalsIgnoreCase(fileName))\n fileNameSet.add(psm);\n } else if (psm instanceof ReportPSMSet) {\n fileNameSet.addAll(\n ((ReportPSMSet) psm).getPSMs().stream().filter(reportPSM -> reportPSM.getFileName().equalsIgnoreCase(fileName))\n .collect(Collectors.toList()));\n }\n }\n\n return new ArrayList<>(fileNameSet);\n }",
"public TPolicyBase findByPrimaryKey(TPolicyBasePk pk) throws TPolicyBaseDaoException\n\t{\n\t\treturn findByPrimaryKey( pk.getMpid() );\n\t}",
"public static ArrayList<product> laydsSanPham(String msp){\n \n \n ArrayList<product> dmsp = new ArrayList<product>();\n\n Session session = HibernateUtil.getSessionFactory().openSession();\n try {\n String hql =String.format(\" select sp from product sp where sp.categoryp=%s and sp.storep !=0 and status ='Yes' \",msp);\n org.hibernate.Query query = session.createQuery(hql);\n dmsp = (ArrayList<product>) query.list();\n } catch (HibernateException ex) {\n //Log the exception \n System.err.println(ex);\n } finally {\n session.close();\n }\n return dmsp;\n }",
"private ArrayList getStatusPollEnabledObjNames()\n\t{\n\t\tArrayList moNameList=new ArrayList();\n\n\t\tPreparedStatementWrapper psw = relapi.fetchPreparedStatement(PS_FOR_GET_POLL_ENABLED_OBJ_NAMES_ID);\n\t\tPreparedStatement ps = psw.getPreparedStatement();\n\t\tResultSet rs = null;\n\t\ttry\n\t\t{\n\t\t\trs = ps.executeQuery();\n\t\t\twhile(rs.next())\n\t\t\t{\n\t\t\t\tString name=rs.getString(1);\n\t\t\t\tmoNameList.add(name);\n\t\t\t}\n\t\t}catch(SQLException sqle)\n\t\t{\n\t\t\tsqle.printStackTrace();\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif(rs != null)\n\t\t\t\t{\n\t\t\t\t\trs.close();\n\t\t\t\t}\n\t\t\t}catch(SQLException sqle){}\n\t\t\trelapi.returnPreparedStatement(psw);\n\t\t}\n\t\treturn moNameList;\n\t}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
add takes O(1) time, find() takes O(n) time Add the number to an internal data structure.
|
public void add(int number) {
//map.put(number, map.getOrDefault(number, 0) + 1);
if (map.containsKey(number)) {
map.put(number, map.get(number) + 1);
} else {
map.put(number, 1);
}
}
|
[
"public void add(int number) {\n if(map.containsKey(number)) map.put(number, map.get(number) + 1);\n else {\n map.put(number, 1);\n list.add(number);\n }\n }",
"private void addMoney(int hashValue, int num) {\n Integer numberOfMoney = register.get(hashValue);\n numberOfMoney = numberOfMoney + num;\n register.put(hashValue, numberOfMoney);\n\n }",
"public void add(int add){\n if (!elementOf(add)) {\n int[] added = new int[set.length + 1];\n for(int element = 0; element < set.length; element++){\n added[element] = set[element];\n }\n added[set.length] = add; \n setSet(added);\n added = null;\n }\n }",
"public void add(int number) {\n\t\tthis.total += number;\n\t}",
"void add(BigInt number);",
"long add(long element1, long element2);",
"public void addSorted( Integer input )\n {\n //check no duplicates - boolean !contains(Object 0) : no\n //specified element found\n if( !arr_list.contains(input) ){\n //add element - simple add(E e)\n arr_list.add( input );\n \n //sort(Comparator<? super E>c) = the super is the List interface\n //API void sort(List<T> list) - sort specified list in \n //ascending order\n Collections.sort( arr_list );\n }\n }",
"BaseNumber add(BaseNumber operand);",
"public void addTo(int valueToAdd, int index){\n\t\tdata[index] += valueToAdd;\n\t}",
"private static ArrayList addPrimNum(int inputNum) {\n\n for (int j = 0; j < primNumList.size(); j++) {\n if (primNumList.get(j) == inputNum) {\n System.out.println(\"The given input already exists\");\n return primNumList;\n }\n else if (inputNum==0) {\n return primNumList;\n }\n }\n primNumList.add(inputNum); //adds a value to the\n countSum(inputNum); //calls sum method\n\n return primNumList;\n }",
"public void add(NestedInteger ni){}",
"int add(int index, int delta);",
"public void add(int item) {\n \tboolean exists = false;\n \tfor (int i=0;i<set.size();i++) {\n \t\tif(set.get(i)==item) {\n \t\t\texists = true;\n \t\t}\n \t}\n \t\tif(exists==false)\n \t\t\tset.add(item);\n \t}",
"public static <K> void addNumber (Map<? super K, Integer> toAdd, K key, int val) {\n if (toAdd.get(key) == null) {\n toAdd.put(key, val);\n } else {\n toAdd.put(key, toAdd.get(key) + val);\n }\n }",
"long add(long number1, long number2);",
"public void add(Object value, int node) {\n\tif ((_nodes = (BitArray)_index.get(value)) == null) {\n\t _nodes = new BitArray(_arraySize);\n\t _nodes.setMask(node & 0xff000000);\n\t _index.put(value,_nodes);\n\t}\n\t_nodes.setBit(node & 0x00ffffff);\n\n\t/*\n\t * TODO: A bit array can currently only hold nodes from one DOM.\n\t * An index will therefore only return nodes from a single document.\n\t */\n }",
"public void add(int x) {\n\t\t// grow the list if needed\n\t\tif(size == a.length) grow();\n\t\ta[size] = x;\n\t\tindexMap.put(x, size);\n\t\tsize++;\n\t}",
"public void addNumSorted(int a){\n\t\tSystem.out.println(\"Testing... \" + a);\n\t\tif(this.prevNum != null){\n\t\t\tListUtilities temp = new ListUtilities();\n\t\t\tSystem.out.println(\"Reversing \" + a);\n\t\t\ttemp = this.prevNum;\n\t\t\tSystem.out.println(\"Returned to \" + temp.num);\n\t\t\ttemp.addNumSorted(a);\n\t\t\t\n\t\t}\n\t\tif(this.prevNum == null && this.num > a){\n\t\t\t//if at the beginning, and lowest number, insert at beginning\n\t\t\tSystem.out.println(\"Adding to beginning... \" + a);\n\t\t\tListUtilities newNode = new ListUtilities(a);\n\t\t\tnewNode.nextNum = this;\n\t\t\tthis.prevNum = newNode;\n\t\t\tSystem.out.println(this.num + \" is now attached to \" + this.prevNum.num);\n\t\t\treturn;\n\t\t}else if(this.nextNum == null && this.num < a){\n\t\t\t//if at the end and highest number insert at the end\n\t\t\tSystem.out.println(\"Adding to the end... \" + a);\n\t\t\tListUtilities newNode = new ListUtilities(a);\n\t\t\tthis.nextNum = newNode;\n\t\t\tnewNode.prevNum = this;\n\t\t\treturn;\n\t\t}else if (this.num < a && this.nextNum.num > a){\n\t\t\t//insert in between lower and higher numbers\n\t\t\tSystem.out.println(\"Inserting \" + a + \" in between \" + this.num + \" and \" + this.nextNum.num);\n\t\t\tListUtilities newNode = new ListUtilities(a);\n\t\t\tnewNode.nextNum = this.nextNum;\n\t\t\tthis.nextNum.prevNum = newNode;\n\t\t\tthis.nextNum = newNode;\n\t\t\tnewNode.prevNum = this;\n\t\t\treturn;\n\t\t}\n\t}",
"public void add(int value) {\n m_value += value;\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Valid mount IDs must comply with the hostname restrictions. That is, they must only contain az, AZ, 09 and '.' or ''. They must not start with a number, dot or a hyphen and must not end with a dot or hyphen.
|
public static boolean isValidMountID(final String id) {
if (id == null || id.isEmpty()) {
return false;
}
if (id.startsWith("knime.") || !MOUNTID_PATTERN.matcher(id).find()) { //$NON-NLS-1$
return false;
}
try {
// this is the way we build URIs to reference server items - this must not choke.
new URI(ExplorerFileSystem.SCHEME, id, "/test/path", null); //$NON-NLS-1$
return true;
} catch (URISyntaxException e) {
return false;
}
}
|
[
"private boolean hostnameIsValid( String hostname ){\n\t\treturn Pattern.matches(\"[-.0-9a-zA-Z]+\", hostname);\n\t}",
"public void \n validateHostIDs() \n throws IllegalConfigException\n {\n TreeMap<String,BigInteger> hostIDs = getHostIDs();\n if(hostIDs == null) \n throw new IllegalConfigException\n\t(\"No Host IDs where specified!\"); \n\n {\n String host = getMasterHostname();\n if(!hostIDs.containsKey(host))\n\tthrow new IllegalConfigException\n\t (\"No Host ID was provided for the Master Manager host (\" + host + \")!\");\n } \n\n {\n String host = getFileHostname();\n if(!hostIDs.containsKey(host))\n\tthrow new IllegalConfigException\n\t (\"No Host ID was provided for the File Manager host (\" + host + \")!\");\n } \n\n {\n String host = getQueueHostname();\n if(!hostIDs.containsKey(host))\n\tthrow new IllegalConfigException\n\t (\"No Host ID was provided for the Queue Manager host (\" + host + \")!\");\n } \n }",
"@Test\n public void toInstanceIdentifierMissingMountPointNegativeTest() {\n try {\n ParserIdentifier.toInstanceIdentifier(\n \"\" + \"/\" + RestconfConstants.MOUNT, this.schemaContext, Optional.of(this.mountPointService));\n fail(\"Test should fail due to missing mount point\");\n } catch (final RestconfDocumentedException e) {\n assertEquals(\"Not expected error type\",\n RestconfError.ErrorType.PROTOCOL, e.getErrors().get(0).getErrorType());\n assertEquals(\"Not expected error tag\",\n ErrorTag.DATA_MISSING, e.getErrors().get(0).getErrorTag());\n assertEquals(\"Not expected error status code\",\n 404, e.getErrors().get(0).getErrorTag().getStatusCode());\n }\n }",
"public void validateSpaceId(String spaceId) throws InvalidIdException;",
"@Test\n public void testGetSysDiskId() {\n try {\n System.out.println(\"getSysDiskId\");\n GetWindowsDriveCSNum instance = GetWindowsDriveCSNum.INSTANCE;\n GetWindowsDriveCSNum.main(new String[1]);\n \n String result = instance.getSysDiskId();\n Matcher mx = Pattern.compile(\"[a-z0-9]{4,4}-[a-z0-9]{4,4}\",Pattern.CASE_INSENSITIVE).matcher(result);\n assertTrue(mx.matches());\n } catch (IOException ex) {\n fail(\"unexpected exception\");\n }\n \n }",
"protected void validateIdURI()\n {\n if (idURI == null) throw new RuntimeException(\"idURI should not be null\");\n if (!idURI.isAbsolute()) throw new RuntimeException(\"Base URI must be absolute URI\");\n String uri = idURI.toASCIIString().trim();\n\n if (uri.length() != uri.trim().length()) throw new RuntimeException(\"white space not allowed in the beginning or end of URI\");\n if (uri.endsWith(\"/\")) throw new RuntimeException(\"URI should not end with '/'\");\n String path = idURI.getPath();\n String[] parts = path.split(\"/\");\n if (parts.length < 2) throw new RuntimeException(\"URI path portion should have at least 2 segments class name and ID\");\n if (!getClass().getSimpleName().equals(parts[parts.length - 2])) throw new RuntimeException(\"URI path portion should have class name as one before last segment\");\n }",
"public Boolean isValidNameForFileSystem(String name) {\n for (char eachChar : invalidCharacter) {\n if (name.contains(String.valueOf(eachChar))) {\n // contains illegal character\n return false;\n }\n }\n return true;\n }",
"private void checkHostName() {\n if (hostname.isEmpty()) {\n throw new IllegalArgumentException(\n \"Server name value of host_name cannot be empty\");\n }\n\n if (hostname.endsWith(\".\")) {\n throw new IllegalArgumentException(\n \"Server name value of host_name cannot have the trailing dot\");\n }\n }",
"@Test\n public void makeQNameFromIdentifierMountPointInvalidIdentifierNegativeTest() {\n try {\n ParserIdentifier.makeQNameFromIdentifier(\n MOUNT_POINT_IDENT\n + \"/\"\n + TEST_MODULE_REVISION\n + \"/\"\n + TEST_MODULE_NAME);\n\n fail(\"Test should fail due to invalid identifier format\");\n } catch (final RestconfDocumentedException e) {\n assertEquals(\"Not expected error type\",\n RestconfError.ErrorType.PROTOCOL, e.getErrors().get(0).getErrorType());\n assertEquals(\"Not expected error tag\",\n RestconfError.ErrorTag.INVALID_VALUE, e.getErrors().get(0).getErrorTag());\n assertEquals(\"Not expected error status code\",\n 400, e.getErrors().get(0).getErrorTag().getStatusCode());\n }\n }",
"protected boolean isAirlineIDValid(String airlineID) {\n return airlineID.length() <= 5 && airlineID.matches(\"[0-9]+\");\n }",
"@Override\n \tpublic boolean canSummonMounts()\n \t{\n \t\treturn true;\n \t}",
"@Test\n public void makeQNameFromIdentifierMountPointTooShortIdentifierNegativeTest() {\n try {\n ParserIdentifier.makeQNameFromIdentifier(\n MOUNT_POINT_IDENT\n + \"/\"\n + TEST_MODULE_NAME);\n\n fail(\"Test should fail due to too short identifier format\");\n } catch (final RestconfDocumentedException e) {\n assertEquals(\"Not expected error type\",\n RestconfError.ErrorType.PROTOCOL, e.getErrors().get(0).getErrorType());\n assertEquals(\"Not expected error tag\",\n RestconfError.ErrorTag.INVALID_VALUE, e.getErrors().get(0).getErrorTag());\n assertEquals(\"Not expected error status code\",\n 400, e.getErrors().get(0).getErrorTag().getStatusCode());\n }\n }",
"@Test\n public void testCloudFileDirectoryNameValidation()\n {\n NameValidator.validateDirectoryName(\"alpha\");\n NameValidator.validateDirectoryName(\"4lphanum3r1c\");\n NameValidator.validateDirectoryName(\"middle-dash\");\n NameValidator.validateDirectoryName(\"CAPS\");\n NameValidator.validateDirectoryName(\"$root\");\n NameValidator.validateDirectoryName(\"..\");\n NameValidator.validateDirectoryName(\"CLOCK$\");\n NameValidator.validateDirectoryName(\"endslash/\");\n\n invalidDirectoryTestHelper(null, \"No null.\",\n \"Invalid directory name. The name may not be null, empty, or whitespace only.\");\n invalidDirectoryTestHelper(\"middle/slash\", \"Slashes only at the end.\",\n \"Invalid directory name. Check MSDN for more information about valid naming.\");\n invalidDirectoryTestHelper(\"illegal\\\"char\", \"Illegal character.\",\n \"Invalid directory name. Check MSDN for more information about valid naming.\");\n invalidDirectoryTestHelper(\"illegal:char?\", \"Illegal character.\",\n \"Invalid directory name. Check MSDN for more information about valid naming.\");\n invalidDirectoryTestHelper(\"\", \"Between 1 and 255 characters.\",\n \"Invalid directory name. The name may not be null, empty, or whitespace only.\");\n invalidDirectoryTestHelper(new String(new char[256]).replace(\"\\0\", \"n\"), \"Between 1 and 255 characters.\",\n \"Invalid directory name length. The name must be between 1 and 255 characters long.\");\n }",
"static boolean isValidCommandArg(@NotNull String name) {\n if (name.length() == 0) return false;\n if (name.charAt(0) == '-') return false;\n for (char c : name.toCharArray())\n if (!isAlphanumeric(c, false, true)) return false;\n return true;\n }",
"@Override\n public boolean validateNotEmptyPartial (String partial)\n {\n return partial.replaceAll(\"[^/]\", \"\").length() < 3 && partial.replaceAll(\"[^0-9]\", \"\").length() < 9 &&\n partial.replaceAll(\"[0-9/]\", \"\").length() == 0;\n }",
"public void mount(String mountKey);",
"private void validate(String rawCommand) {\n int index = rawCommand.indexOf(\":\");\n if (index == -1) {\n throw new CommandException(\"Initial floor should be delimited by ':' \");\n }\n String[] tokens = rawCommand.split(\":\");\n Arrays.asList(tokens[1].split(\",\"))\n .forEach(token -> {\n String[] paths = token.split(\"-\");\n if (paths.length != 2)\n throw new CommandException(\"Given path command is invalid\");\n\n try {\n Integer startFloor = Integer.valueOf(paths[0]);\n Integer endFloor = Integer.valueOf(paths[1]);\n if (startFloor < 0 || endFloor < 0) {\n throw new CommandException(\"start or end floor is negative\");\n }\n } catch (NumberFormatException ex) {\n throw new CommandException(\"input command is invalid\");\n }\n });\n }",
"protected boolean isStopsValid(String stops) {\n return stops.matches(\"[0-9]\");\n }",
"private boolean CheckID(String id) {\n\t\tif ((!id.matches(\"([0-9])+\") || id.length() != 9) && (!id.matches(\"S([0-9])+\") || id.length() != 10)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Check user already logged in your application using twitter Login flag is fetched from Shared Preferences
|
private boolean isTwitterLoggedInAlready() {
// return twitter login status from Shared Preferences
return mSharedPreferences.getBoolean(PREF_KEY_TWITTER_LOGIN, false);
}
|
[
"@Override\n public boolean isTwitterLoggedInAlready() {\n // return twitter login status from Shared Preferences\n return mSharedPreferences.getBoolean(PREF_KEY_TWITTER_LOGIN, false);\n }",
"private void loginToTwitter() {\n StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();\n\n StrictMode.setThreadPolicy(policy);\n\n // Check if already logged in\n// if (!isTwitterLoggedInAlready()) {\n//\n\n\n try {\n requestToken = twitter\n .getOAuthRequestToken(TWITTER_CALLBACK_URL);\n this.startActivity(new Intent(Intent.ACTION_VIEW, Uri\n .parse(requestToken.getAuthenticationURL())));\n } catch (TwitterException e) {\n e.printStackTrace();\n }\n// } else {\n// // user already logged into twitter\n// Toast.makeText(getActivity(),\n// \"Already Logged into twitter\", Toast.LENGTH_LONG).show();\n// }\n }",
"private boolean userHasAlreadyLogin() {\n SharedPreferences pref = getApplicationContext().getSharedPreferences(\n \"login_pref\", Context.MODE_PRIVATE\n );\n\n return pref.getBoolean(\"already_login\", false);\n }",
"public boolean checkLogin(){\n if(!sharedPreferences.getBoolean(IS_LOGGED_IN, false)){\n sendUserToLoginActivity();\n return false;\n }\n return true;\n }",
"private void loginToTwitter() \n\t{\n\t\t// Check if already logged in\n\t\tif (!isTwitterLoggedInAlready())\n\t\t{\n\t\t\tConfigurationBuilder builder = new ConfigurationBuilder();\n\t\t\tbuilder.setOAuthConsumerKey(TWITTER_CONSUMER_KEY);\n\t\t\tbuilder.setOAuthConsumerSecret(TWITTER_CONSUMER_SECRET);\n\t\t\tConfiguration configuration = builder.build();\n\n\t\t\tTwitterFactory factory = new TwitterFactory(configuration);\n\t\t\ttwitter = factory.getInstance();\n\n\t\t\ttry {\n\t\t\t\trequestToken = twitter.getOAuthRequestToken(TWITTER_CALLBACK_URL);\n\t\t\t\tRuntime.getRuntime().gc();\n\t\t\t\tSystem.gc();\n\t\t\t\tfinish();\n\t\t\t\tIntent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(requestToken.getAuthenticationURL()));\n\t\t\t\tbrowserIntent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);\n\t\t\t\tthis.startActivity(browserIntent);\n\t\t\t} \n\t\t\tcatch (TwitterException e) \n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} \n\t\telse\n\t\t{\n\t\t\t// user already logged into twitter\n//\t\t\tToast.makeText(getApplicationContext(), \"Already Logged into twitter\", Toast.LENGTH_LONG).show();\n\t\t}\n\t}",
"private void checkForUser() {\n tUserId = getIntent().getIntExtra(USER_ID_KEY, -1);\r\n\r\n //in preferences?\r\n if (tUserId != -1) {\r\n return;\r\n }\r\n\r\n if (sPreferences == null) {\r\n getPrefs();\r\n }\r\n tUserId = sPreferences.getInt(USER_ID_KEY, -1);\r\n\r\n //any at all?\r\n if (tUserId != -1) {\r\n return;\r\n }\r\n List<User> users = DAO.getAllUsers();\r\n if (users.size() <= 0) {\r\n User TstUser = new User(\"user\", \"pass\");\r\n DAO.insert(TstUser);\r\n }\r\n\r\n Intent intent = LoginActivity.loginActivityIntent(this);\r\n startActivity(intent);\r\n }",
"public static String CheckAlreadyLoggedIn(Context context) {\n SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext());\n String username = prefs.getString((context.getString(R.string.username)), null);\n if (username != null) {\n return username;\n }\n return null;\n }",
"private void checkUserActivity() {\n if(mPrefs.getBoolean(Constant.LOGGED_IN, false)){\n // only check if the user is logged in and if the request was not already sent\n new UserActivityAsyncTask(this::updateBottomNavigation)\n .execute(mPrefs.getString(Constant.PUSHY_TOKEN, \"\"),\n String.valueOf(mPrefs.getInt(Constant.USER_ID, 0)));\n }\n }",
"private static boolean doCheckLogin(SharedPreferences sharedPreferences) {\n boolean loginRecorded = sharedPreferences.getBoolean(LOGIN_SAVED_KEY, false); // check if a login has been recorded by another session\n\n loggedIn = loginRecorded && FirebaseAuth.getInstance().getCurrentUser() != null; // if current user is null, force a re-login\n return loggedIn;\n }",
"private void checkIfLoggedIn() {\n LocalStorage localStorage = new LocalStorage(getApplicationContext());\n\n if(localStorage.checkIfAuthorityPresent()){\n Intent intent = new Intent(getApplicationContext(),AuthorityPrimaryActivity.class);\n startActivity(intent);\n } else if(localStorage.checkIfUserPresent()){\n Intent intent = new Intent(getApplicationContext(), UserPrimaryActivity.class);\n startActivity(intent);\n }\n }",
"private void handleTwitterSession(TwitterSession session) {\n\n AuthCredential credential = TwitterAuthProvider.getCredential(\n session.getAuthToken().token,\n session.getAuthToken().secret);\n\n mAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, update UI with the signed-in user's information\n // Log.d(TAG, \"signInWithCredential:success\");\n FirebaseUser user = mAuth.getCurrentUser();\n\n\n // Toast.makeText(LoginActivity.this, user.getDisplayName(), Toast.LENGTH_SHORT).show();\n\n UserSharedPreferenceData.setLoggedInUserID(getApplicationContext(),user.getUid());\n UserSharedPreferenceData.setLoggedInUserName(getApplicationContext(),user.getDisplayName());\n UserSharedPreferenceData.setPrefLoggedinUserProf(getApplicationContext(),user.getPhotoUrl().toString());\n UserSharedPreferenceData.setUserLoggedInWith(getApplicationContext(),\"Twitter\");\n UserSharedPreferenceData.setUserLoggedInStatus(getApplicationContext(),true);\n\n postAndCheckSocialData(user.getUid(),user.getDisplayName(),\"`\",user.getPhotoUrl().toString(),\"0\");\n\n\n// UserSharedPreferenceData.setUserPhnStatus(getApplicationContext(),false);\n//\n// // Toast.makeText(getApplicationContext(),user.getUid(),Toast.LENGTH_LONG).show();\n//\n// Intent intent = new Intent(getApplicationContext(),LoginMobActivity.class);\n// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n// intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);\n// startActivity(intent);\n\n } else {\n // If sign in fails, display a message to the user.\n // Log.w(TAG, \"signInWithCredential:failure\", task.getException());\n Toast.makeText(LoginActivity.this, \"Authentication failed.\",\n Toast.LENGTH_SHORT).show();\n // updateUI(null);\n }\n\n // ...\n }\n });\n }",
"public void checkAccountLoggedIn()\r\n\t{\n\t\tSharedPreferences pref = this.getActivity().getSharedPreferences(\r\n\t\t\t\t\"accountdata\", 0);\r\n\t\tif (pref.getBoolean(\"accountLoggedIn\", false))\r\n\t\t{\r\n\r\n\t\t\tusernameEditText.setEnabled(false);\r\n\t\t\tpasswordEditText.setEnabled(false);\r\n\t\t}\r\n\t}",
"boolean hasIfLogin();",
"private void checkUserLoggedIn() {\n\n if (auth.getCurrentUser()==null)\n startLoginActivity();\n else {\n auth.reloadCurrentUser(this);\n }\n }",
"private void getUserDetailsFromTwitter() {\n ParseUser user = ParseUser.getCurrentUser();\n try{\n user.setUsername(ParseTwitterUtils.getTwitter().getScreenName());\n } catch(Exception e){\n Log.e(TAG, \"Error retrieving user data\", e);\n }\n\n user.saveInBackground(e -> {\n Log.d(TAG, \"Successfully added user to App user registry\");\n Toast.makeText(this, \"Login Successful\", Toast.LENGTH_LONG).show();\n directSuccessfulUserLogin();\n });\n }",
"private void loadUserPreferences() {\n SharedPreferences settings = getSharedPreferences(PREFS_NAME,\n Context.MODE_PRIVATE);\n checkIdentifer = settings.getString(PREF_UNAME, DefaultUnameValue);\n identiferGroup = settings.getString(PREF_GROUP, DefaultGroupValue);\n if (!checkIdentifer.equals(DefaultUnameValue) && !identiferGroup.equals(DefaultGroupValue)) {\n logIn = true;\n }\n }",
"boolean getIfLogin();",
"public static boolean hasTwitterId(Context context) {\n\t\t\tSharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);\n\t\t\treturn prefs.getString(TWITTER_ID, null)!=null;\n\t\t}",
"public static boolean checkUserFBLogin() {\n\t\tboolean isFbLogin = Pref.getBoolean(\n\t\t\t\tGeneralClass.temp_iUserFaceBookBLOGIN, false);\n\t\t// Log.e(\"is facebook login\", \"---->\" + isFbLogin);\n\t\t// if (isloginShare && isFbLogin) {\n\t\t// return false;\n\t\t// } else {\n\t\tif (isFbLogin) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\t// }\n\t}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
return offer by student from the offer repository
|
@Transactional
public Offer getOfferByStudentAndIsActive(Student student) {
Offer offer = offerRepository.findOfferByStudentAndIsActiveTrue(student);
if (offer == null) {
throw new NullPointerException(
"Error: Student " + student.getStudentId() + " does not have an active offer!");
}
return offer;
}
|
[
"@Transactional\n\tpublic List<Offer> getOfferByStudent(Student student) {\n\t\tList<Offer> offer = offerRepository.findOfferByStudent(student);\n\t\tif (offer == null) {\n\t\t\tthrow new NullPointerException(\n\t\t\t\t\t\"Error: Student \" + student.getStudentId() + \" does not have an offer!\");\n\t\t}\n\t\treturn offer;\n\t}",
"Student fetchBy(String name);",
"public Student getStudent(Student entity){\r\n return repo.findOne(entity.getID());\r\n }",
"public Student findStudent(int id);",
"Student findById(String id);",
"Student getStudentById(Long id);",
"Student get(long id);",
"public Student getStudent(Integer id);",
"public List<StudentCourseVo> findMycourse(Integer studentId);",
"StudentExam get(long studentId, long examId);",
"Student selectByPrimaryKey(Integer studentId);",
"TStudent selectByPrimaryKey(Integer studentNo);",
"Student findByEmail(String email);",
"List<Student> findByFirstName(String firstName);",
"Student findByLastName(String lastName);",
"public Student findByDeviceId(String deviceId);",
"StudentGuardian selectByPrimaryKey(Integer id);",
"public Integer findStudentId(Integer userId);",
"List<StudentExam> getByExam(long examId);"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Sets the status by user name of this person.
|
@Override
public void setStatusByUserName(java.lang.String statusByUserName) {
_person.setStatusByUserName(statusByUserName);
}
|
[
"@Override\n\tpublic void setStatusByUserName(String statusByUserName);",
"void setStatus(final UserStatus status);",
"@Override\n\tpublic void setStatusByUserName(java.lang.String statusByUserName) {\n\t\t_pathologyData.setStatusByUserName(statusByUserName);\n\t}",
"public void setUserStatus(java.lang.String userStatus) {\n this.userStatus = userStatus;\n }",
"@Override\n\tpublic void setStatusByUserName(java.lang.String statusByUserName) {\n\t\t_announcement.setStatusByUserName(statusByUserName);\n\t}",
"public void setUserStatus (String userStatus) {\n\n // Set the value.\n this.userStatus = userStatus;\n }",
"public void setUserStatus(String userStatus) {\n this.userStatus = userStatus;\n }",
"@Override\n public void setStatusByUserUuid(java.lang.String statusByUserUuid) {\n _person.setStatusByUserUuid(statusByUserUuid);\n }",
"Users setStatus(String status);",
"public void setUserstatus(String userstatus) {\n this.userstatus = userstatus;\n }",
"public void setUserStatus(StatusType userStatus) {\n this.userStatus = userStatus;\n }",
"public void setStatus(UserAccountStatus status) {\n this._status = status;\n }",
"@Override\n public void setStatusByUserId(long statusByUserId) {\n _person.setStatusByUserId(statusByUserId);\n }",
"@Override\n\tpublic void setStatusByUserName(String statusByUserName) {\n\t\t_editionGallery.setStatusByUserName(statusByUserName);\n\t}",
"@Override\n\tpublic void setStatusByUserId(long statusByUserId);",
"public void setStatusName(String statusName);",
"@Override\n\tpublic void setStatusByUserUuid(String statusByUserUuid);",
"void updateUserActivateStatus(User user, int newStatus);",
"private void change_status(String status){\n query.changeUserStatus(status);\n editor.putString(\"status\", status);\n editor.apply();\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
requestInfo GET /index.jsp?query=dfdfdf HTTP/1.1 Accept: image/gif, image/xxbitmap, image/jpeg, image/pjpeg, application/xshockwaveflash, application/QVOD, application/QVOD, AcceptLanguage: zhcn AcceptEncoding: gzip, deflate UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; CIBA; TheWorld) Host: localhost:8080 Connection: KeepAlive
|
public static String handle(Request req) {
ServletRequest request = new ServletRequest();
// String url = req.getUrl();
// String[] strs = url.split("\\?");
// request.setUri(strs[0]);
// if(strs.length > 1){
// request.setQueryString(strs[1]);
// }
StringBuilder sb = new StringBuilder();
sb.append("HTTP/1.1 200 OK\n");//注意每行后面有一个 \n
sb.append("\n");
sb.append("hello world");
return sb.toString();
}
|
[
"HttpGet getRequest(HttpServletRequest request, String address) throws IOException;",
"public void processRequest(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n String url = req.getParameter(Constants.ORIGURL);\n log.info(String.format(\"Processing ShortenUrlServlet request for origurl: %s\", url));\n try {\n validateQueryUrl(url);\n CassandraUrlQueryUtil cassandraQueryClient = CassandraUrlQueryUtil.getInstance();\n UrlMapping urlMapping = cassandraQueryClient.queryByOrigUrl(url);\n\t\t\tif (urlMapping == null) {\n\t\t\t\turlMapping = new UrlMapping();\n\t\t\t\turlMapping.setOrigUrl(url);\n\t\t\t\turlMapping.setUrlHash(generateUrlHash());\n\t\t\t\tcassandraQueryClient.writeQuery(urlMapping);\n\t\t\t}\n resp.getOutputStream().print(XMLUtils.convertToXML(urlMapping));\n\t\t} catch (MinimeException mex) {\n\t\t\tsendErrorResponse(req, resp, mex.getMessage());\n\t\t} catch (Exception ex) {\n \tex.printStackTrace();\n sendErrorResponse(req, resp, ex.getMessage());\n }\n log.info(String.format(\"Done processing ShortenUrlServlet request for origurl: %s\", url));\n }",
"@Test\n public void getRequest2() {\n str = METHOD_GET + \"/wiki/page.html \" + HTTP_VERSION + ENDL +\n HOST_HEADER + \": ru.wikipedia.org\" + ENDL +\n USER_AGENT + \": Mozilla/5.0 (X11; U; Linux i686; ru; rv:1.9b5) Gecko/2008050509 Firefox/3.0b5\" + ENDL +\n ACCEPT + \": text/html\" + ENDL +\n CONNECTION_CLOSE;\n request = new HttpRequest(str, IP_ADDRESS, HOST);\n\n assertEquals(request.getMethod(), HttpMethod.GET);\n assertEquals(request.getUrn(), \"/wiki/page.html\");\n assertEquals(request.getHeader(HOST_HEADER), \"ru.wikipedia.org\");\n assertEquals(request.getHeader(USER_AGENT),\n \"Mozilla/5.0 (X11; U; Linux i686; ru; rv:1.9b5) Gecko/2008050509 Firefox/3.0b5\");\n assertEquals(request.getHeader(ACCEPT), \"text/html\");\n assertEquals(request.getHeader(CONNECTION), CLOSE_STR);\n assertEquals(request.getHeader(NONEXISTENT_VAR), \"\");\n assertEquals(request.getParameter(NONEXISTENT_VAR), \"\");\n }",
"public interface HttpRequest {\n // MIME types\n public static final String JNLP_MIME_TYPE = \"application/x-java-jnlp-file\";\n public static final String ERROR_MIME_TYPE = \"application/x-java-jnlp-error\";\n public static final String JAR_MIME_TYPE = \"application/x-java-archive\";\n public static final String JARDIFF_MIME_TYPE = \"application/x-java-archive-diff\";\n public static final String GIF_MIME_TYPE = \"image/gif\";\n public static final String JPEG_MIME_TYPE = \"image/jpeg\";\n \n // Low-level interface\n HttpResponse doHeadRequest(URL url) throws IOException;\n HttpResponse doGetRequest (URL url) throws IOException;\n \n HttpResponse doHeadRequest(URL url, String[] headerKeys, String[] headerValues) throws IOException;\n HttpResponse doGetRequest (URL url, String[] headerKeys, String[] headerValues) throws IOException;\n}",
"public XINSServletResponse query(String url) throws IOException {\n return query(\"GET\", url, null, new HashMap());\n }",
"protected void processRequest(String method, String path, String query,\n Properties requestHeader, InputStream in, OutputStream out,\n InetAddress clientAddress, int clientPort,\n InetAddress localAddress, int localPort, String HTTPVersion)\n throws IOException {\n System.out.println(\"Got request: method=\" + method + \", path=\" + path\n + \", query=\" + query);\n final String root = \"/\";\n // serveString(out, 200, null,\n // \"<HTML><BODY><H1>Hello</H1></BODY></HTML>\",\"text/html\");\n if (path.startsWith(\"..\") || path.endsWith(\"..\")\n || path.indexOf(\"../\") >= 0 || path.indexOf(\"..\\\\\") >= 0) {\n serveError(out, 403, \"URL \" + path + \" contains '..'\");\n return;\n }\n serveFile(out, new File(root, path));\n }",
"java.lang.String getRequestSource();",
"private static StringBuffer getRequestContent(HttpServletRequest request) {\r\n\t\tStringBuffer content = new StringBuffer();\r\n\t\tString aContentLine = null;\r\n\t\ttry {\r\n\t\t\tBufferedReader reader = request.getReader();\r\n\t\t\twhile ((aContentLine = reader.readLine()) != null)\r\n\t\t\t\tcontent.append(aContentLine);\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(\"data reading error\");\r\n\t\t}\r\n\r\n\t\treturn content;\r\n\t}",
"String parseRequestURI() throws IOException {\n byte[] buf = new byte[1024];\n int i = 0;\n int b;\n while (-1 != (b = reqStream.read())) {\n if (32 == b) {\n byte[] uri = new byte[i];\n System.arraycopy(buf, 0, uri, 0, i);\n return new String(uri);\n }\n\n buf[i++] = (byte) b;\n }\n\n return null;\n }",
"public abstract void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException;",
"static public Map getQueryStringParameters(HttpServletRequest req) throws Exception\n {\n return parseQueryString(req.getQueryString());\n }",
"public HttpFilters filterRequest(HttpRequest originalRequest) {\n boolean wantToFilterRequest = true;\n\n if (!wantToFilterRequest) {\n return null;\n } else {\n return new HttpFiltersAdapter(originalRequest) {\n @Override\n public HttpResponse requestPre(HttpObject httpObject) {\n\n if (httpObject instanceof HttpRequest) {\n // log.info(\"REQUEST\");\n HttpRequest httpRequest = (HttpRequest) httpObject;\n // log.info(\"\\turl: \" + httpRequest.getUri());\n\n URI url = URI.create(httpRequest.getUri()); // url decoding\n String host = url.getHost();\n String path = url.getPath();\n\n // log.info(\"\\thost: \" + host);\n // log.info(\"\\tpath: \" + path);\n\n List<NameValuePair> params = URLEncodedUtils.parse(url, \"utf8\");\n Map<String, String> urlParameters = new HashMap();\n Iterator<NameValuePair> iParams = params.iterator();\n\n while (iParams.hasNext()) {\n NameValuePair param = iParams.next();\n urlParameters.put(param.getName(), param.getValue());\n }\n\n // System.out.println(\"PARAMS : \\n\" + JSON.serialize(urlParameters));\n\n // 4 in a line\n if (StringUtils.equals(host, \"wv.inner-active.mobi\")) {\n if (false && StringUtils.startsWith(path, \"/simpleM2M/clientRequestWVBannerOnly\")) {\n return getAdRequestResponse(\n \"wv.inner-active.mobi.ftl\",\n \"http://lorempixel.com/320/50/\",\n \"#\"\n );\n }\n // BenjBanana\n } else if (StringUtils.equals(host, \"my.mobfox.com\")) {\n if (StringUtils.startsWith(path, \"/request.php\")) {\n\n DBObject rtbResponse = rtbRequest(JSON.serialize(urlParameters));\n Logger.getAnonymousLogger().info(\"RTBRESPONSE --- \" + JSON.serialize(rtbResponse));\n if (Integer.parseInt(rtbResponse.get(\"bid\").toString()) > 0) {\n return getAdRequestResponse(\n \"my.mobfox.com.ftl\",\n rtbResponse.get(\"imgsrc\").toString(), //lorempixel.com/300/50/\",\n rtbResponse.get(\"ahref\").toString()\n );\n }\n\n }\n } else if (StringUtils.equals(host, \"api2.playhaven.com\")) {\n if (StringUtils.startsWith(path, \"/v3/publisher/content/\")) {\n return getAdRequestResponse(\n \"api2.playhaven.com.ftl\",\n \"http://lorempixel.com/640/560/\",\n \"#\"\n );\n }\n } else if (StringUtils.equals(host, \"my.mobfox.com\")) {\n if (StringUtils.startsWith(path, \"/request.php\")) {\n return getAdRequestResponse(\n \"my.mobfox.com.ftl\",\n \"http://lorempixel.com/300/50/\",\n \"#\"\n );\n }\n }\n\n return null;\n }\n // TODO: implement your filtering here\n return null;\n }\n\n @Override\n public HttpResponse requestPost(HttpObject httpObject) {\n // TODO: implement your filtering here\n return null;\n }\n\n @Override\n public void responsePre(HttpObject httpObject) {\n // TODO: implement your filtering here\n }\n\n @Override\n public void responsePost(HttpObject httpObject) {\n // TODO: implement your filtering here\n }\n };\n }\n }",
"private void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n request.setCharacterEncoding(RequestParameterName.UTF8);\n String commandName = request.getParameter(RequestParameterName.COMMAND_NAME);\n\n Command command = CommandHelper.getInstance().getCommand(commandName);\n\n String page;\n try {\n page = command.execute(request, response);\n } catch (CommandException e) {\n page = JspPageName.ERROR_JSP;\n }\n\n RequestDispatcher requestDispatcher = request.getRequestDispatcher(page);\n\n if (requestDispatcher != null) {\n requestDispatcher.forward(request, response);\n }\n }",
"String getRequestCharset();",
"@SuppressWarnings(\"unused\")\n\tprivate String getRequestAsString(HttpServletRequest request)\n\t\t\tthrows java.io.IOException {\n\t\t\n\t\t//TODO: Check if remove this unused method\n\t\t\n\t\tInputStream in = request.getInputStream();\n\t\tBufferedReader requestData = new BufferedReader(new InputStreamReader(\n\t\t\t\tin));\n\t\tStringBuffer stringBuffer = new StringBuffer();\n\t\tString line;\n\n\t\ttry {\n\t\t\twhile ((line = requestData.readLine()) != null) {\n\t\t\t\tstringBuffer.append(line + \"\\n\");\n\t\t\t}\n\t\t} catch (Exception e) {\n\n\t\t}\n\n\t\treturn stringBuffer.toString();\n\n\t}",
"InputStream getRequestInputStream();",
"String getRequestURL();",
"@Override\n\tprotected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse)\n\tthrows ServletException, java.io.IOException\n\t{\n\t\tString sMethod = \"doGet\";\n\t\tString sQueryString = \"\";\n\t\tString sLanguage = null;\n\t\t\n\t\tPrintWriter pwOut = Utils.prepareForHtmlOutput(servletRequest, servletResponse);\n\n\t\tsQueryString = servletRequest.getQueryString();\n\t\tHashMap htServiceRequest = Utils.convertCGIMessage(sQueryString, true); // URL decoded result\n\n\t\ttry {\n\t\t\tsLanguage = (String) htServiceRequest.get(\"language\"); // optional language code\n\t\t\tif (sLanguage == null || sLanguage.trim().length() < 1)\n\t\t\t\tsLanguage = null;\t\t\t\n\t\t\tString sCountry = (String) htServiceRequest.get(\"country\"); // optional country code\n\t\t\tif (sCountry == null || sCountry.trim().length() < 1)\n\t\t\t\tsCountry = null;\n\t\t\t\n\t\t\tString sMyUrl = servletRequest.getRequestURL().toString();\n\t\t\thtServiceRequest.put(\"my_url\", sMyUrl);\n\n\t\t\tString sRid = (String) htServiceRequest.get(\"rid\");\n\t\t\tString sAsUrl = (String) htServiceRequest.get(\"as_url\");\n\t\t\tString sCookiename = (String) htServiceRequest.get(\"cookiename\");\n\t\t\tString sAsId = (String) htServiceRequest.get(\"a-select-server\");\n\t\t\tString sSignature = (String) htServiceRequest.get(\"signature\");\n\n\t\t\tif ((sRid == null) || (sAsUrl == null) || (sCookiename == null) || (sAsId == null) || (sSignature == null)) {\n\t\t\t\t_systemLogger.log(Level.FINE, MODULE, sMethod, \"Invalid request, at least one mandatory parameter is missing.\");\n\t\t\t\tthrow new ASelectException(Errors.ERROR_COOKIE_INVALID_REQUEST);\n\t\t\t}\n\t\t\t_systemLogger.log(Level.INFO, MODULE, sMethod, \"GET {\"+servletRequest+\" --> \"+sMethod+\": \"+sQueryString);\n\n\t\t\t// 20120110, Bauke: no longer needed, done by convertCGIMessage()\n\t\t\t//sAsUrl = URLDecoder.decode(sAsUrl, \"UTF-8\");\n\t\t\t//sUid = URLDecoder.decode(sUid, \"UTF-8\");\n\t\t\t//sSignature = URLDecoder.decode(sSignature, \"UTF-8\");\n\n\t\t\tStringBuffer sbSignature = new StringBuffer(sRid).append(sAsUrl);\n\t\t\tsbSignature.append(sCookiename).append(sAsId);\n\n\t\t\t// optional country and language code\n\t\t\tif (sCountry != null) sbSignature.append(sCountry);\n\t\t\tif (sLanguage != null) sbSignature.append(sLanguage);\n\n\t\t\tif (!_cryptoEngine.verifySignature(sAsId, sbSignature.toString(), sSignature)) {\n\t\t\t\tthrow new ASelectException(Errors.ERROR_COOKIE_INVALID_REQUEST);\n\t\t\t}\n\n\t\t\t// Get cookie value here and verify if we know this cookie\n\t\t\t_systemLogger.log(Level.INFO, MODULE, sMethod, \"Looking for cookie with name:\" + sCookiename);\n\t\t\t\n\t\t\tCookie[] cookies = servletRequest.getCookies();\n\t\t\t_systemLogger.log(Level.FINEST, MODULE, sMethod, \"Number of cookies found= \" + (cookies == null ? 0 : cookies.length));\n\t\t\tString v = null;\n\t\t\tHashtable htPreviousSessionContext = null;\n\t\t\tfor ( Cookie c : cookies) {\n\t\t\t\t_systemLogger.log(Level.FINEST, MODULE, sMethod, \"Found cookie: \" + c.getName() + \", with value: \" + c.getValue());\n\t\t\t\tif (c.getName().equalsIgnoreCase(sCookiename)) {\n\t\t\t\t\tv = c.getValue();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t_sAuthMode = Errors.ERROR_COOKIE_ACCESS_DENIED;\n\t\t\t\n\t\t\tif ( v != null ) { // we found a value for our cookie\n\t\t\t\t_systemLogger.log(Level.INFO, MODULE, sMethod, \"Found cookie value:\" + v);\n\t\t\t\t// We verify if we know this cookie here\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\thtPreviousSessionContext = (Hashtable) _previousSessionManager.getHandle().get(v);\n\t\t\t\t\t\n\t\t\t\t} catch (ASelectStorageException e) {\n\t\t\t\t\t_systemLogger.log(Level.INFO, MODULE, sMethod, \"Cookie value not in storage\");\n\t\t\t\t\thtPreviousSessionContext = null;\n\t\t\t\t}\n\t\t\t\tif (htPreviousSessionContext != null) {\n\t\t\t\t\t_sAuthMode = Errors.ERROR_COOKIE_SUCCESS;\n\t\t\t\t\t_authenticationLogger.log(new Object[] {\n\t\t\t\t\t\t\tMODULE, sCookiename, servletRequest.getRemoteAddr(), sAsId, \"granted\"\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t_systemLogger.log(Level.INFO, MODULE, sMethod, \"No cookie found with name:\" + sCookiename);\n\t\t\t\t\t_sAuthMode = Errors.ERROR_COOKIE_ACCESS_DENIED;\n\t\t\t\t\t_authenticationLogger.log(new Object[] {\n\t\t\t\t\t\t\tMODULE, sCookiename, servletRequest.getRemoteAddr(), sAsId, \"denied\", _sAuthMode\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t_systemLogger.log(Level.INFO, MODULE, sMethod, \"No cookie found with name:\" + sCookiename);\n\t\t\t\t_sAuthMode = Errors.ERROR_COOKIE_ACCESS_DENIED;\n\t\t\t\t_authenticationLogger.log(new Object[] {\n\t\t\t\t\t\tMODULE, sCookiename, servletRequest.getRemoteAddr(), sAsId, \"denied\", _sAuthMode\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\thandleResult(htServiceRequest, servletResponse, pwOut, _sAuthMode, sLanguage, _sFailureHandling, htPreviousSessionContext);\n\t\t}\n\t\tcatch (ASelectException e) {\n\t\t\thandleResult(htServiceRequest, servletResponse, pwOut, e.getMessage(), sLanguage, _sFailureHandling);\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\t_systemLogger.log(Level.SEVERE, MODULE, sMethod, \"Internal error\", e);\n\t\t\thandleResult(htServiceRequest, servletResponse, pwOut, Errors.ERROR_COOKIE_COULD_NOT_AUTHENTICATE_USER, sLanguage, _sFailureHandling);\n\t\t}\n\t\t_systemLogger.log(Level.INFO, MODULE, sMethod, \"} NULL GET\");\n\t}",
"String getQueryString ();"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
method isValidRecord Gets the errorcode for the latitude instance variable
|
public int getLatitudeError() {
return latitudeError;
}
|
[
"public static int validate(double latitude, double longitude) {\n if (Numbers.isReal(latitude) && Numbers.isReal(longitude)) {\n final double latitude_abs = Math.abs(latitude);\n final double longitude_abs = Math.abs(longitude);\n if (latitude_abs < 0.1 && longitude_abs < 0.1) {\n // If lat,lon == 0,0 assume bad data (there's no BASE off the coast of Africa)\n return INVALID_ZERO;\n } else if (latitude_abs > 90.0 || longitude_abs > 180.0) {\n // Lat/lon out of bounds. Likely parsing error.\n return INVALID_RANGE;\n } else if (latitude_abs < 0.1 || latitude_abs == 90.0) {\n // No BASE jumps on the equator?\n return UNLIKELY_LAT;\n } else if (longitude_abs < 0.1 && (latitude < 4 || 55 < latitude)) {\n // There is no landmass south of 4 degrees latitude on the prime meridian\n // There is no landmass north of 55 degrees latitude on the prime meridian\n return UNLIKELY_LON;\n } else {\n return VALID;\n }\n } else {\n return INVALID_NAN;\n }\n }",
"public boolean validateLng() {\r\n\t\treturn true;\r\n\t}",
"public boolean isValidRecord () {\n int sumError = periodCodeError +\n sequenceNumberError +\n notesError;\n return (sumError == 0 ? true : false);\n }",
"private boolean isValidLocationFound() {\n return latitudeValue != null && longitudeValue != null;\n }",
"private static boolean validateLatitude(String latitude) {\n try {\n BigDecimal bd = new BigDecimal(latitude);\n\n if ((bd.compareTo(maxLatitude) <= 0) && (bd.compareTo(minLatitude) >= 0)) {\n return true;\n }\n } catch (Exception ignored) {\n }\n\n return false;\n }",
"public boolean validate(){ if(fields_details.getLatitude().toString().trim().equals(\"\"))\n// return false;\n// else if(fields_details.getMacId().toString().trim().equals(\"\"))\n// return false;\n// else if(fields_details.getTimestamp().toString().trim().equals(\"\"))\n// return false;\n// else\n return true;\n }",
"public void testLatValid() throws Exception {\n assertTrue(SyntaxChecker.latValid(\"-43.516479\"));\n assertFalse(SyntaxChecker.latValid(\"-180000000\"));\n }",
"public boolean isValid() {\n return !Double.isNaN(lat) && !Double.isNaN(lng) && (lat != 0 || lng != 0);\n }",
"public boolean hasRecordErrors();",
"private boolean isValidLocation(float lat, float lon)\n {\n if (Math.abs(lat) > 90) return false;\n if (Math.abs(lon) > 180) return false;\n\n return true;\n }",
"public static boolean isValidLatitude(float latitude) {\n\t if(latitude >= MIN_LATITUDE && latitude <= MAX_LATITUDE) {\n\t return true;\n\t } else {\n\t return false;\n\t }\n\t }",
"private boolean validateObjectForDB() {\n\t\tboolean l_ret = true;\n\t\tif (m_country_name.equals(\"\")) {\n\t\t\tm_error_string = \"Unable to add the country. Country name is required.\";\n\t\t\tl_ret = false;\n\t\t}\n\t\treturn (l_ret);\n\t}",
"public boolean isValidData(){\n\t\tif(lengthOfArray > MINIMUMVALIDTOKENNUMBER){\n\t\t\tSystem.out.println(\"This is a valid GPS data\");\n\t\t\t\n\t\t\treturn true;\n\t\t}else{\n\t\t\tSystem.out.println(\"This is not a valid GPS data\");\n\t\t\t\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}",
"private void checkRecord(Record record, BindingResult bindingResult) {\n\n // Check if the record's times are valid\n if (!recordService.areTimesValid(record)) {\n bindingResult.rejectValue(\"startTime\", \"error.record\", messageSource.getMessage(\"records.error.wrong_starttime_and_wrong_endtime\", null, Locale.getDefault()));\n bindingResult.rejectValue(\"endTime\", \"error.record\", messageSource.getMessage(\"records.error.wrong_starttime_and_wrong_endtime\", null, Locale.getDefault()));\n }\n\n // Get the logged in user.\n User authenticationUser = SecurityContext.getAuthenticationUser();\n\n // Check if the user already has a record that overlaps with this one\n if (!recordService.areTimesAllowed(record, authenticationUser)) {\n bindingResult.rejectValue(\"startTime\", \"error.record\", messageSource.getMessage(\"records.error.entry_already_exists\", null, Locale.getDefault()));\n bindingResult.rejectValue(\"endTime\", \"error.record\", messageSource.getMessage(\"records.error.entry_already_exists\", null, Locale.getDefault()));\n }\n }",
"public boolean validateLocationLookup(String[] line, int rowNum, String fileName) {\r\n\r\n String[] arr = line;\r\n ArrayList<String> errorList = new ArrayList<String>();\r\n // Update location-lookup into DB\r\n // Based on the location id from DB \r\n // Compare to check if location ID exist\r\n String locationID = \"\";\r\n String semanticPlace = \"\";\r\n int arraySize = arr.length;\r\n if (arraySize == 0) {\r\n errorList.add(ErrorUtility.BSBLANK_LOCATIONID);\r\n errorList.add(ErrorUtility.BSBLANK_SEMANTIC_PLACE);\r\n } else if (arraySize == 1) {\r\n if (arr[0].trim().isEmpty()) {\r\n errorList.add(ErrorUtility.BSBLANK_LOCATIONID);\r\n }\r\n errorList.add(ErrorUtility.BSBLANK_SEMANTIC_PLACE);\r\n } else {\r\n locationID = arr[0].trim();\r\n semanticPlace = arr[1].trim();\r\n\r\n if (locationID.equals(\"\")) {\r\n errorList.add(ErrorUtility.BSBLANK_LOCATIONID);\r\n }\r\n\r\n if (semanticPlace.equals(\"\")) {\r\n errorList.add(ErrorUtility.BSBLANK_SEMANTIC_PLACE);\r\n }\r\n\r\n if (errorList.isEmpty()) {\r\n try {\r\n int locationNum = Integer.parseInt(locationID);\r\n if (locationNum <= 0) {\r\n errorList.add(ErrorUtility.BSINVALID_LOCATIONID);\r\n }\r\n } catch (NumberFormatException e) {\r\n errorList.add(ErrorUtility.BSINVALID_LOCATIONID);\r\n }\r\n try {\r\n if (!\"SMUSISL\".equals(semanticPlace.substring(0, 7)) && !\"SMUSISB\".equals(semanticPlace.substring(0, 7))) {\r\n errorList.add(ErrorUtility.BSINVALID_SEMANTIC_PLACE);\r\n \r\n } else if (semanticPlace.length() <= 8) {\r\n errorList.add(ErrorUtility.BSINVALID_SEMANTIC_PLACE);\r\n } else {\r\n try {\r\n int floor = Integer.parseInt(semanticPlace.substring(7,8));\r\n \r\n if(floor <= 0){\r\n errorList.add(ErrorUtility.BSINVALID_SEMANTIC_PLACE);\r\n }\r\n } catch (NumberFormatException e){\r\n errorList.add(ErrorUtility.BSINVALID_SEMANTIC_PLACE);\r\n }\r\n }\r\n\r\n } catch (IndexOutOfBoundsException e) {\r\n errorList.add(ErrorUtility.BSINVALID_SEMANTIC_PLACE);\r\n }\r\n }\r\n }\r\n\r\n if (checkForRepeatLocationID.get(locationID) != null) {\r\n errorList.add(ErrorUtility.BSINVALID_LOCATIONID);\r\n }\r\n\r\n if (!errorList.isEmpty()) {\r\n totalErrors++;\r\n errorRecords.add(new FileRecordError(fileName, rowNum, errorList));\r\n return false;\r\n } else {\r\n checkForRepeatLocationID.put(locationID, locationID);\r\n successfulRows++;\r\n return true;\r\n }\r\n }",
"public boolean checkMissingLonLatTime() {\n\t\ttry {\n _locationsChecked = true;\n\t\t\tDouble[] longitudes = getSampleLongitudes();\n\t\t\tfor (int rowIdx = 0; rowIdx < numSamples; rowIdx++) {\n\t\t\t\tif ( longitudes[rowIdx] == null ) {\n\t\t\t\t\t_locationsOk = false;\n\t\t\t\t\tADCMessage msg = new ADCMessage();\n\t\t\t\t\tmsg.setSeverity(Severity.CRITICAL);\n\t\t\t\t\tmsg.setRowIndex(rowIdx);\n\t\t\t\t\tmsg.setColIndex(longitudeIndex);\n\t\t\t\t\tmsg.setColName(userColNames[longitudeIndex]);\n\t\t\t\t\tString comment = \"missing longitude\";\n\t\t\t\t\tmsg.setGeneralComment(comment);\n\t\t\t\t\tmsg.setDetailedComment(comment);\n\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch ( Exception ex ) {\n\t\t\t_locationsOk = false;\n\t\t\tADCMessage msg = new ADCMessage();\n\t\t\tmsg.setSeverity(Severity.CRITICAL);\n\t\t\tString comment = \"no longitude column\";\n\t\t\tmsg.setGeneralComment(comment);\n\t\t\tmsg.setDetailedComment(comment);\n\t\t\tstdMsgList.add(msg);\n\t\t}\n\n\t\ttry {\n\t\t\tDouble[] latitudes = getSampleLatitudes();\n\t\t\tfor (int rowIdx = 0; rowIdx < numSamples; rowIdx++) {\n\t\t\t\tif ( latitudes[rowIdx] == null ) {\n\t\t\t\t\t_locationsOk = false;\n\t\t\t\t\tADCMessage msg = new ADCMessage();\n\t\t\t\t\tmsg.setSeverity(Severity.CRITICAL);\n\t\t\t\t\tmsg.setRowIndex(rowIdx);\n\t\t\t\t\tmsg.setColIndex(latitudeIndex);\n\t\t\t\t\tmsg.setColName(userColNames[latitudeIndex]);\n\t\t\t\t\tString comment = \"missing latitude\";\n\t\t\t\t\tmsg.setGeneralComment(comment);\n\t\t\t\t\tmsg.setDetailedComment(comment);\n\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch ( Exception ex ) {\n\t\t\t_locationsOk = false;\n\t\t\tADCMessage msg = new ADCMessage();\n\t\t\tmsg.setSeverity(Severity.CRITICAL);\n\t\t\tString comment = \"no latitude column\";\n\t\t\tmsg.setGeneralComment(comment);\n\t\t\tmsg.setDetailedComment(comment);\n\t\t\tstdMsgList.add(msg);\n\t\t}\n\n//\t DashDataType<?> pressureColumn = findDataColumn(\"water_pressure\");\n//\t DashDataType<?> depthColumn = findDataColumn(\"sample_depth\");\n//\t if ( depthColumn != null ) {\n//\t\t\ttry {\n//\t\t\t\tDouble[] depths = getSampleDepths();\n//\t\t\t\tfor (int rowIdx = 0; rowIdx < numSamples; rowIdx++) {\n//\t\t\t\t\tif ( depths[rowIdx] == null ) {\n//\t\t\t\t\t\tisOk = pressureColumn != null;\n//\t\t\t\t\t\tADCMessage msg = new ADCMessage();\n//\t\t\t\t\t\tmsg.setSeverity(pressureColumn == null ? Severity.ERROR : Severity.WARNING);\n//\t\t\t\t\t\tmsg.setRowIndex(rowIdx);\n//\t\t\t\t\t\tmsg.setColIndex(sampleDepthIndex);\n//\t\t\t\t\t\tmsg.setColName(userColNames[sampleDepthIndex]);\n//\t\t\t\t\t\tString comment = \"missing sample depth\";\n//\t\t\t\t\t\tmsg.setGeneralComment(comment);\n//\t\t\t\t\t\tmsg.setDetailedComment(comment);\n//\t\t\t\t\t\tstdMsgList.add(msg);\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t} catch ( Exception ex ) {\n//\t\t\t ex.printStackTrace();\n//\t\t\t}\n//\t\t} else if ( pressureColumn == null ) {\n//\t\t\tisOk = false;\n//\t\t\tADCMessage msg = new ADCMessage();\n//\t\t\tmsg.setSeverity(Severity.CRITICAL);\n//\t\t\tString comment = \"no sample depth column\";\n//\t\t\tmsg.setGeneralComment(comment);\n//\t\t\tmsg.setDetailedComment(comment);\n//\t\t\tstdMsgList.add(msg);\n//\t\t}\n\n\t\tDouble[] times = null;\n\t\ttry {\n _timesChecked = true;\n\t\t\ttimes = getSampleTimes();\n\t\t\tfor (int rowIdx = 0; _timesOk && rowIdx < numSamples; rowIdx++) {\n\t\t\t\tif ( times[rowIdx] == null ) {\n\t\t\t\t\t_timesOk = false;\n // XXX Messages are now added during the data standarization phase\n\t\t\t\t\t// in the StdUserDataArray constructor.\n//\t\t\t\t\tADCMessage msg = new ADCMessage();\n//\t\t\t\t\tmsg.setSeverity(Severity.CRITICAL);\n//\t\t\t\t\tmsg.setRowIndex(rowIdx);\n//\t\t\t\t\tString comment = \"incomplete sample date/time specification\";\n//\t\t\t\t\tmsg.setGeneralComment(\"Bad date/time value\");\n//\t\t\t\t\tmsg.setDetailedComment(comment);\n//\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch ( Exception ex ) {\n\t\t\t_timesOk = false;\n\t\t\tex.printStackTrace();\n\t\t\tADCMessage msg = new ADCMessage();\n\t\t\tmsg.setSeverity(Severity.CRITICAL);\n\t\t\tString comment = \"incomplete columns specifying sample date/time\";\n\t\t\tmsg.setGeneralComment(comment);\n\t\t\tmsg.setDetailedComment(ex.getMessage());\n\t\t\tstdMsgList.add(msg);\n\t\t}\n\n\t\treturn _locationsOk && _timesOk;\n\t}",
"public static boolean isValidLatitude(String latitude) {\n\t\tif (latitude != null && !latitude.equals(\"\")\n\t\t\t\t&& latitude.matches(NUMMATCH)) {\n\t\t\tdouble lat = Double.parseDouble(latitude);\n\t\t\tif (lat < -90 || lat > 90)\n\t\t\t\treturn false;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public ErrorResponse validateCenterField(String center);",
"public ErrorResponse validateZoneField(String zone);"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Checks whether the 'field165' field has been set
|
public boolean hasField165() {
return fieldSetFlags()[165];
}
|
[
"public boolean hasField145() {\n return fieldSetFlags()[145];\n }",
"public boolean hasField158() {\n return fieldSetFlags()[158];\n }",
"public boolean hasField146() {\n return fieldSetFlags()[146];\n }",
"public boolean hasField943() {\n return fieldSetFlags()[943];\n }",
"public boolean hasField141() {\n return fieldSetFlags()[141];\n }",
"public boolean hasField159() {\n return fieldSetFlags()[159];\n }",
"public boolean hasField138() {\n return fieldSetFlags()[138];\n }",
"public boolean hasField130() {\n return fieldSetFlags()[130];\n }",
"public boolean hasField433() {\n return fieldSetFlags()[433];\n }",
"public boolean hasField114() {\n return fieldSetFlags()[114];\n }",
"public boolean hasField139() {\n return fieldSetFlags()[139];\n }",
"public boolean hasField113() {\n return fieldSetFlags()[113];\n }",
"public boolean hasField343() {\n return fieldSetFlags()[343];\n }",
"public boolean hasField431() {\n return fieldSetFlags()[431];\n }",
"public boolean hasField570() {\n return fieldSetFlags()[570];\n }",
"public boolean hasField534() {\n return fieldSetFlags()[534];\n }",
"public boolean hasField529() {\n return fieldSetFlags()[529];\n }",
"public boolean hasField142() {\n return fieldSetFlags()[142];\n }",
"public boolean hasField161() {\n return fieldSetFlags()[161];\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Setter for the "FeatureInstalled5" variable.
|
public void setFeatureInstalled5(String x) throws SnmpStatusException;
|
[
"public void setFeatureInstalled6(String x) throws SnmpStatusException;",
"public void setFeatureInstalled7(String x) throws SnmpStatusException;",
"public void setFeatureInstalled4(String x) throws SnmpStatusException;",
"public void setFeatureInstalled1(String x) throws SnmpStatusException;",
"public void setFeatureInstalled10(String x) throws SnmpStatusException;",
"public void setFeatureInstalled3(String x) throws SnmpStatusException;",
"public void setFeatureInstalled8(String x) throws SnmpStatusException;",
"public String getFeatureInstalled5() throws SnmpStatusException;",
"public void setFeatureInstalled2(String x) throws SnmpStatusException;",
"public void checkFeatureInstalled5(String x) throws SnmpStatusException;",
"public void setExtAttribute6(String value) {\n setAttributeInternal(EXTATTRIBUTE6, value);\n }",
"public void checkFeatureInstalled6(String x) throws SnmpStatusException;",
"public String getFeatureInstalled6() throws SnmpStatusException;",
"public void setExtAttribute5(String value) {\n setAttributeInternal(EXTATTRIBUTE5, value);\n }",
"public void setFlg5(String flg5) {\r\n this.flg5 = flg5;\r\n }",
"public void setOdlKarafFeatureListInstalled(String x) throws SnmpStatusException;",
"public void setAttribute6(String value) {\n setAttributeInternal(ATTRIBUTE6, value);\n }",
"public void setNum5(int value) {\n this.num5 = value;\n }",
"public void setAttribute6(String value)\n {\n setAttributeInternal(ATTRIBUTE6, value);\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Returns an ordered range of all the products where userId = &63; and status = &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 full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from ProductModelImpl.
|
public java.util.List<Product> findByU_S(
long userId, int status, int start, int end,
com.liferay.portal.kernel.util.OrderByComparator<Product>
orderByComparator);
|
[
"public java.util.List<Product> findByG_U_S(\n\t\tlong groupId, long userId, int status, int start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator<Product>\n\t\t\torderByComparator);",
"public java.util.List<Product> filterFindByG_U_S(\n\t\tlong groupId, long userId, int status, int start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator<Product>\n\t\t\torderByComparator);",
"public java.util.List<Product> findByU_S(\n\t\tlong userId, int status, int start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator<Product>\n\t\t\torderByComparator,\n\t\tboolean useFinderCache);",
"public java.util.List<Product> findByG_U_S(\n\t\tlong groupId, long userId, int status, int start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator<Product>\n\t\t\torderByComparator,\n\t\tboolean useFinderCache);",
"public java.util.List<Product> findByUserId(\n\t\tlong userId, int start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator<Product>\n\t\t\torderByComparator);",
"public java.util.List<Product> findByU_S(\n\t\tlong userId, int[] statuses, int start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator<Product>\n\t\t\torderByComparator);",
"public java.util.List<Product> findByC_U_S(\n\t\tlong companyId, long userId, int status, int start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator<Product>\n\t\t\torderByComparator);",
"public java.util.List<Product> findByU_S(\n\t\tlong userId, int status, int start, int end);",
"public java.util.List<Product> findByG_U_S(\n\t\tlong groupId, long userId, int status, int start, int end);",
"public java.util.List<Product> findByG_S(\n\t\tlong groupId, int status, int start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator<Product>\n\t\t\torderByComparator);",
"public java.util.List<Product> findByC_U_S(\n\t\tlong companyId, long userId, int status, int start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator<Product>\n\t\t\torderByComparator,\n\t\tboolean useFinderCache);",
"public java.util.List<Todo> findByU_S(\n\t\tlong userId, int status, int start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator<Todo>\n\t\t\torderByComparator);",
"public java.util.List<Product> findByUserIdGroupId(\n\t\tlong userId, long groupId, int start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator<Product>\n\t\t\torderByComparator);",
"public java.util.List<Product> findByUserId(\n\t\tlong userId, int start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator<Product>\n\t\t\torderByComparator,\n\t\tboolean useFinderCache);",
"public java.util.List<Todo> findByG_U_S(\n\t\tlong groupId, long userId, int status, int start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator<Todo>\n\t\t\torderByComparator);",
"public java.util.List<Product> filterFindByG_S(\n\t\tlong groupId, int status, int start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator<Product>\n\t\t\torderByComparator);",
"public java.util.List<Product> filterFindByUserIdGroupId(\n\t\tlong userId, long groupId, int start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator<Product>\n\t\t\torderByComparator);",
"public java.util.List<Product> findByC_U_S(\n\t\tlong companyId, long userId, int[] statuses, int start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator<Product>\n\t\t\torderByComparator);",
"public java.util.List<Product> filterFindByG_U_S(\n\t\tlong groupId, long userId, int status, int start, int end);"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
SHIP FUNCTIONS get all the ships in the system
|
public List<Ship> getAllShips() {return allShips; }
|
[
"public AbstractShip[] getShips() {\n return ships;\n }",
"public Ship[] getShips() {\n return ships;\n }",
"private List<SpaceShips> getSpaceShips() {\n API api = new API();\n\n List<SpaceShips> totalSpaceShips = new ArrayList<SpaceShips>();\n Gson gson = new Gson();\n GetRequestRepository requestRepository = new GetRequestRepository(api);\n\n JsonObject jsonObject = requestRepository.getAll(\"starships\", null);\n\n\n /**\n * Get next uri\n */\n SpaceShipsOverView spaceShipsOverView = gson.fromJson(jsonObject, SpaceShipsOverView.class);\n\n\n /**\n * Get SpaceShips\n */\n JsonArray resultsSpaceships = jsonObject.getAsJsonArray(\"results\");\n Type collectionType = new TypeToken<Collection<SpaceShips>>(){}.getType();\n Collection<SpaceShips> enums = gson.fromJson(resultsSpaceships, collectionType);\n totalSpaceShips.addAll(enums);\n\n while (spaceShipsOverView.getNext()!=null) {\n String valueUri = spaceShipsOverView.getNext();\n String [] splited = valueUri.split(\"/\");\n\n jsonObject = requestRepository.getAll(\"starships/\"+splited[splited.length-1],null);\n\n /**\n * Get next uri\n */\n spaceShipsOverView = gson.fromJson(jsonObject, SpaceShipsOverView.class);\n\n /**\n * Get SpaceShips\n */\n resultsSpaceships = jsonObject.getAsJsonArray(\"results\");\n collectionType = new TypeToken<Collection<SpaceShips>>(){}.getType();\n enums = gson.fromJson(resultsSpaceships, collectionType);\n totalSpaceShips.addAll(enums);\n }\n return totalSpaceShips;\n }",
"protected ArrayList<Ship> getShips() {\n\t\tArrayList<Ship> copy = new ArrayList<Ship>();\n\t\t\n\t\tfor (Ship s : ships) {\n\t\t\tcopy.add(s);\n\t\t}\t\t\n\t\treturn copy;\n\t}",
"public ArrayList<Ship> getShipsOnBoard(){\n return ships;\n }",
"@RequestMapping(\"/shipping\")\r\n\t@ResponseBody\r\n\tIterable<Shipping> getAllShippings() {\r\n\t\treturn shiRepo.findAll();\r\n\t}",
"private Ship[] consoleGetShips(int player) {\n //Grid grid = new Grid();\n Ship[] ships = new Ship[5];\n System.out.println();\n System.out.println(\"You are player \" + player);\n System.out.println(\"Please place your ships.\");\n ships[0] = consoleGetAShip(ships, \"CARRIER\", 5);\n ships[1] = consoleGetAShip(ships, \"DESTROYER\", 4);\n ships[2] = consoleGetAShip(ships, \"BATTLESHIP\", 3);\n ships[3] = consoleGetAShip(ships, \"SUBMARINE\", 3);\n ships[4] = consoleGetAShip(ships, \"PT\", 2);\n return ships;\n }",
"public Ship[][] getShipArray(){\n return ships;\n }",
"static void placeShips()\n\t{\n\t\tships = new Ship[5];\n\t\tships[0] = new Ship(\"Carrier\");\n\t\tships[1] = new Ship(\"Battleship\");\n\t\twhile (ships[1].overlaps(ships[0]))\n\t\t\tships[1] = new Ship(\"Battleship\");\n\t\tships[2] = new Ship(\"Cruiser\");\n\t\twhile (ships[2].overlaps(ships[0]) || ships[2].overlaps(ships[1]))\n\t\t\tships[2] = new Ship(\"Cruiser\");\n\t\tships[3] = new Ship(\"Submarine\");\n\t\twhile (ships[3].overlaps(ships[0]) || ships[3].overlaps(ships[1]) || ships[3].overlaps(ships[2]))\n\t\t\tships[3] = new Ship(\"Submarine\");\n\t\tships[4] = new Ship(\"Destroyer\");\n\t\twhile (ships[4].overlaps(ships[0]) || ships[4].overlaps(ships[1]) || ships[4].overlaps(ships[2]) || ships[4].overlaps(ships[3]))\n\t\t\tships[4] = new Ship(\"Destroyer\");\n\t}",
"public Ship[] shipsMapToArray(){\r\n\t\tIterator<Ship> shIt = this.ships.iterator();\r\n\t\tShip[] shipsToReturn = new Ship[this.ships.size()];\r\n\t\tint i = 0;\r\n\t\t\r\n\t\twhile(shIt.hasNext()){\r\n\t\t\tshipsToReturn[i] = shIt.next();\r\n\t\t\ti++;\r\n\t\t}\r\n\t\treturn shipsToReturn;\r\n\t}",
"public static List<Ship> generateShips(int countShip) {\n List<Ship> ships = new ArrayList<>();\n for (int i = 0; i < countShip; i++) {\n Ship ship = new Ship();\n ship.setName(RandomStringUtils.random(10, true, false));\n ship.setHumanSeats(parseInt(RandomStringUtils.randomNumeric(5)));\n ship.setPrice(parseInt(RandomStringUtils.randomNumeric(7)));\n ship.setType(RandomStringUtils.random(4, true, false));\n ship.setWeight(parseInt(RandomStringUtils.randomNumeric(4)));\n ship.setWorkDaysOfWeek(WorkDaysOfWeek.FIVE);\n ships.add(ship);\n }\n return ships;\n }",
"final List<Object> shipsOfGamePlayer(GamePlayer currentGamePlayer){\n return currentGamePlayer.getShips().stream().sorted(Comparator.comparing(Ship::getId)).collect(Collectors.toList());\n }",
"public void getUserShips() {\r\n\t\tTile tile1=new Tile();\r\n\t\tTile tile2=new Tile();\r\n\t\tString player=\"Human\";\r\n\t\t\r\n\t\tfor (int i=0;i<5;i++)\r\n\t\t\tgetInputShips(tile1, tile2,player,ships[i]) ;\r\n\t\t\r\n\t\t}",
"protected void populateShips(){\n\n int startingBlueGridY = (int)(numYGridPoints*0.1);\n\n int startingRedGridY =(int)(numYGridPoints*0.9);\n\n for(int i = 0; i < numShipsInGame; i++){\n if(me.getShipColour().equals(\"blue\")){\n me.getFleet().add(newShip(R.drawable.ship_right, getScreenXFromGridX(2+2*i), getScreenYFromGridY(startingBlueGridY), \"blue\"));\n enemy.getFleet().add(newShip(R.drawable.enemy_ship_right, getScreenXFromGridX(2+2*i), getScreenYFromGridY(startingRedGridY), \"red\"));\n } else{\n me.getFleet().add(newShip(R.drawable.enemy_ship_right, getScreenXFromGridX(2+2*i), getScreenYFromGridY(startingRedGridY), \"red\"));\n enemy.getFleet().add(newShip(R.drawable.ship_right,getScreenXFromGridX(2+2*i), getScreenYFromGridY(startingBlueGridY), \"blue\"));\n }\n\n\n }\n }",
"public void setShips(Ship[] ships) {\n this.ships = ships;\n }",
"private void createComputerShips() {\r\n\r\n getShips().addAll(Arrays.asList(\r\n new Ship(\"Battleship\", 4),\r\n new Ship(\"Cruiser1\", 3),\r\n new Ship(\"Cruiser2\", 3),\r\n new Ship(\"Destroyer1\", 2),\r\n new Ship(\"Destroyer2\", 2),\r\n new Ship(\"Destroyer3\", 2)));\r\n }",
"public void makeShips()\n\t{\n\t\t//The below is firstly to create the five ships \n\t\tint[] shipSizes= {2,3,3,4,5};\n\n\t\t//### Creating battleship to be put in the playerBattleShipsList\n\t\tfor (int x = 0; x < shipSizes.length; x ++) \n\t\t{\n\t\t\t//This creates a new battleship of size X from index's of shipSizes\n\t\t\tBattleShip newPlayerBattleShip = new BattleShip(shipSizes[x]);\n\n\t\t\t//This add the new battleship of size x (above) to a part in the array\n\t\t\tplayerBattleShipsList[x] = newPlayerBattleShip;\n\t\t}\n\n\t\t//### Creating battleship to be put in the aiBattleShipsList\n\n\t\tfor (int y = 0; y < shipSizes.length; y ++) \n\t\t{\n\t\t\t//This creates a new battleship of size X from index's of shipSizes\n\t\t\tBattleShip newAIBattleShip = new BattleShip(shipSizes[y]);\n\n\t\t\t//This add the new battleship of size x (above) to a part in the array\n\t\t\taiBattleShipsList[y] = newAIBattleShip;\n\t\t}\n\n\t}",
"@RequestMapping(value = \"/showShips\", method = RequestMethod.GET)\n\tpublic String getShips(Model s) {\n\t\tArrayList<Ship> shipList = shipsService.listAll();\n\n\t\ts.addAttribute(\"shipList\", shipList);\n\n\t\treturn \"showShips\";\n\t}",
"public static void printShips(List<Ship> ships) {\n for (Ship ship : ships) {\n System.out.println(ship);\n }\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Method to set whether to move a node when its export name moves.
|
public static void setMoveNodeWithExport(boolean on) { cacheMoveNodeWithExport.setBoolean(on); }
|
[
"public static boolean isMoveNodeWithExport() { return cacheMoveNodeWithExport.getBoolean(); }",
"public abstract boolean isMove(E node);",
"abstract protected void moveNode (DefaultMutableTreeNode node, DefaultMutableTreeNode destination);",
"public void setMoved(boolean b)\r\n {\r\n moved = b;\r\n }",
"public void setInternalDragAndDropIsMove(boolean b) {\n\t\tmInternalDragAndDropIsMove = b;\n\t\t}",
"public void setRootMove(String aMove);",
"public native void setMoveable(boolean value) /*-{\n\t\tvar jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();\n\t\tjso.moveable = value;\n }-*/;",
"public void setAsJumpMove()\n\t{\n\t\tjumpMove = true;\n\t}",
"public void setMoving(boolean moving) {\n this.moving = moving;\n }",
"public void setMoveable(boolean moveable) {\n\t\t_moveable = moveable;\n\t}",
"public boolean setMove(boolean movable)\n {\n canMove = movable;\n return true;\n }",
"public void moved(){\r\n moved = true;\r\n }",
"void setInitialMovePassed(boolean initialMovePassed);",
"public void setMoveState(boolean moveState) {\r\n this.moveState = moveState;\r\n }",
"public void moved(){\r\n\t\tisMoved = true;\r\n\t}",
"public abstract boolean moveToRightNode();",
"public void move(String targetNodeId, String targetPath);",
"void setMove(Move move) {\n this.move = move;\n }",
"public void move(DefaultMutableTreeNode dest, DefaultMutableTreeNode node) throws Exception {\r\n \t\t/* never move root node or a node unto itself or a node to its parent */\r\n \t\tif (node.isRoot() || node == dest || node.getParent() == dest) return;\r\n \r\n \t\t/* never move a parent down into itself */\r\n \t\tfor (DefaultMutableTreeNode child = dest; child != null; child = (DefaultMutableTreeNode) child.getParent())\r\n \t\t\tif (child == node) throw new Exception(\"Cannot move node under itself!\");\r\n \r\n \t\t/* save the file system path of the old node location */\r\n \t\tFile oldPath = this.getNodePath(node);\r\n \t\t\r\n \t\t/* invalidate the file system name of the node */\r\n \t\tTask oldTask = (Task) node.getUserObject();\r\n \t\t((FileSystemTask)oldTask).setPlainName(null);\r\n \t\t\r\n \t\t/* remove the node and add it under the destination node */\r\n \t\tthis.treeModel.removeNodeFromParent(node);\r\n \t\tthis.treeModel.insertNodeInto(node, dest, dest.getChildCount());\r\n \t\t\r\n \t\t/* update the file system: set the new file system (plain) name and move the task directory */\r\n \t\tthis.setFileSystemName(node);\r\n \t\toldPath.renameTo(this.getNodePath(node));\r\n \t}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
If the logout action for the catalog is "Go to URL", this will return the URL provided. If the logout action for the catalog is "Go to Template", this will return the Id (instanceId) of the template.
|
public String getLogoutDestination() {return entry.getEntryFieldValue(FIELD_LOGOUT_DESTINATION);}
|
[
"public String getDefaultLogoutUrl() {\n // If the default logout url has not been calculated yet\n if (defaultLogoutUrl == null) {\n // If the catalog has a URL default logout destination\n if (\"Go to URL\".equals(getLogoutAction())) {\n // Redirect to the default logout action\n defaultLogoutUrl = getLogoutDestination();\n }\n // If the catalog has a Template default logout destination\n if (\"Go to Template\".equals(getLogoutAction())) {\n // Retrieve the template (this is done rather than manually\n // building the URL so that the template DisplayName property is\n // observed).\n Template template = Template.findById(context, getLogoutDestination());\n // If the template was not found\n if (template == null) {\n // Throw an error\n throw new RuntimeException(\"The template (\"+\n getLogoutDestination()+\") was not found. \"+\n \"Unable to determine default logout action.\");\n }\n // If the template was found\n else {\n defaultLogoutUrl = template.getAnonymousUrl();\n }\n }\n }\n // Return the result\n return defaultLogoutUrl;\n }",
"public static URL getUrlForLogout()\r\n {\r\n String strUrl = getBaseURL() + \"account_services/api/1.0/account/logout\";\r\n return str2url( strUrl );\r\n }",
"public String getLogoutAction() {return entry.getEntryFieldValue(FIELD_LOGOUT_ACTION);}",
"public String getLogoutUrl() {\n if (springLogoutUrl == null) {\n springLogoutUrl = GWT.getHostPageBaseURL() + DEFAULT_SPRING_LOGOUT_URL;\n }\n return springLogoutUrl;\n }",
"public String getLogoutUrl() {\n return logoutUrl;\n }",
"public String getUrlLogOut() {\r\n return urlLogOut;\r\n }",
"public static String getLogoutURL() {\n\t\t\n\t\tZmailURI uri = new ZmailURI(ZmailURI.getBaseURI());\n\t\turi.addQuery(\"loginOp\", \"logout\");\n\t\treturn (uri.toString());\n\n\t}",
"public java.lang.String getLogoutURL() {\r\n return logoutURL;\r\n }",
"private String navigateAfterLoginAttemp()\r\n {\r\n Identity identity = this.getIdentity();\r\n\r\n if (identity == null) {\r\n return \"/\";\r\n }\r\n if (identity instanceof Pilot) {\r\n return \"/pilot/index.xhtml\";\r\n }\r\n if (identity instanceof General) {\r\n return \"/general/index.xhtml\";\r\n }\r\n if (identity instanceof SystemAdministrator) {\r\n return \"/admin/index.xhtml\";\r\n }\r\n throw new IllegalStateException(\"Identita \" + identity\r\n + \" nie je ziadneho z typov, pre ktory dokazem 'navigovat'!\");\r\n }",
"private String getTopcatSessionId() {\r\n HttpServletRequest request = this.getThreadLocalRequest();\r\n HttpSession session = request.getSession();\r\n String sessionId = null;\r\n if (session.getAttribute(\"SESSION_ID\") == null) { // First time login\r\n try {\r\n sessionId = userManager.login();\r\n session.setAttribute(\"SESSION_ID\", sessionId);\r\n } catch (AuthenticationException e) {\r\n // TODO Auto-generated catch block\r\n e.printStackTrace();\r\n }\r\n } else {\r\n sessionId = (String) session.getAttribute(\"SESSION_ID\");\r\n }\r\n return sessionId;\r\n }",
"public String gettemplateId() {\r\n return (String)ensureVariableManager().getVariableValue(\"templateId\");\r\n }",
"public String getAuthTemplateId() {\n return getProperty(Property.AUTH_TEMPLATE_ID);\n }",
"String getCurrentUrl();",
"public Result logOut() {\n customerService().logout();\n return redirectToReturnUrl();\n }",
"public String getCurrLTIUrl()\n\t{\n\t\tif (meleteResource != null && meleteResource.getResourceId() != null)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tString rUrl = getMeleteCHService().getResourceUrl(meleteResource.getResourceId());\n\t\t\t\treturn rUrl;\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\treturn \"about:blank\";\n\t\t\t}\n\t\t}\n\t\treturn \"about:blank\";\n\t}",
"java.lang.String getTrackingUrlTemplate();",
"public String getUrlTemplate() {\n return this.urlTemplate;\n }",
"public String getEntityIdentifier()\n {\n \treturn url;\n }",
"public String getRedirectUserDefaultJSP () { return getRedirectJSPbyId (JSPIdUserDefault) ;}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Sets image link of the food item Preconditions: None Postconditions: The FoodItemData object will be updated to have the supplied image link
|
@Override
public void setImageLink(String imageLink) {
this.imageLink = imageLink;
}
|
[
"public maestro.payloads.FlyerFeaturedItem.Builder setItemImageUrl(CharSequence value) {\n validate(fields()[8], value);\n this.item_image_url = value;\n fieldSetFlags()[8] = true;\n return this;\n }",
"public void setItemImageUrl(CharSequence value) {\n this.item_image_url = value;\n }",
"public void setImageLink(ImageLink imageLink) {\n\t\tthis.imageLink = imageLink;\n\t}",
"public void setItemImageFileName(String inventoryID, String imageName);",
"public void setUrlImage(String urlImage);",
"private void imageSetter(){\n artistNameTextView.setText(apiObject.displaySongs.get(selectedIndex).getArtist());\n songNameTextView.setText(apiObject.displaySongs.get(selectedIndex).getSongName());\n try {\n String urldisplay = apiObject.displaySongs.get(selectedIndex).getCoverartLink();\n new DownloadImageTask((ImageView) findViewById(R.id.albumImage)).execute(urldisplay);\n\n } catch(Exception ex){\n System.out.println(ex.toString());\n }\n }",
"public void changeImage(){\n if(getImage()==storeItemImg) setImage(selected);\n else setImage(storeItemImg);\n }",
"public void setImage(String loc, Image img, String ItemName) {\n\t\tcurrent_location = world.getLocation(loc);\n\t\tcurrent_location.setItem(img, ItemName);\n\n\t}",
"public void setImgUrl(String url){\n this.img_url_link = url;\n }",
"void setImageLocation(URL imageLocation) throws IOException;",
"abstract void setImage();",
"Imports setImageRef(String imageRef);",
"public void setImage(Image img){\r\n this.elementImage = img;\r\n }",
"Builder addImage(URL value);",
"public CharSequence getItemImageUrl() {\n return item_image_url;\n }",
"public maestro.payloads.FlyerFeaturedItem.Builder clearItemImageUrl() {\n item_image_url = null;\n fieldSetFlags()[8] = false;\n return this;\n }",
"void setImageFromURL(String imageURL);",
"public void setImage(Drawable inImage) {\n\t\tcardImage = inImage;\n\t}",
"public CharSequence getItemImageUrl() {\n return item_image_url;\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Lists the paths of the children of an instance.
|
@GET
@Path( "/all-children" + OPTIONAL_INSTANCE_PATH )
@Produces( MediaType.APPLICATION_JSON )
List<Instance> listAllChildrenInstances( @PathParam("name") String applicationName, @PathParam("instancePath") String instancePath );
|
[
"@GET\n\t@Path( \"/children\" + OPTIONAL_INSTANCE_PATH )\n\t@Produces( MediaType.APPLICATION_JSON )\n\tList<Instance> listChildrenInstances( @PathParam(\"name\") String applicationName, @PathParam(\"instancePath\") String instancePath );",
"public List getChildren() {\n\t\tLinkedList childrenPaths = new LinkedList();\n\t\tList childrenEdges = getGraph().getOutgoingEdges(getEndNode());\n\t\tfor (Iterator it = childrenEdges.iterator(); it.hasNext(); ) {\n\t\t\tEdge e = (Edge) it.next();\n\t\t\t/* Loop check */\n\t\t\tif (!contains(e.getBeginNode()) \n\t\t\t\t\t|| !contains(e.getEndNode())) {\n\t\t\t\tUndirectedPath p = (UndirectedPath) clone();\n\t\t\t\tp.addEdge(e);\n\t\t\t\tchildrenPaths.add(p);\n\t\t\t}\n\t\t}\n\n\t\treturn childrenPaths;\n\t}",
"public ArrayList<String> getAllChildren(){ \n\t\treturn getAllChildrenRecursive(this,1);\n\t}",
"public GraphLocation[] getChildren();",
"public List<DimensionalObject> getChildren();",
"public List<IDirectory> getAllChildDir() {\n return this.children;\n }",
"public List<Path> getAllPaths();",
"public Collection<ChildType> getChildren();",
"public List<PafDimMember> getChildren() {\r\n\t\t\r\n\t\tList<PafDimMember> childList = null;\r\n\t\t\r\n\t\t// If no children are found, return empty array list\r\n\t\tif (children == null) {\r\n\t\t\tchildList = new ArrayList<PafDimMember>();\r\n\t\t} else {\r\n\t\t\t// Else, return pointer to children\r\n\t\t\tchildList = children;\r\n\t\t}\r\n\t\treturn childList;\r\n\t}",
"List<Path> getPaths();",
"public List<String> getChildren(String path) {\n\t\t\ttry{\n\t\t\treturn zkClient.getChildren().forPath(path);\n\t\t\t}catch (Throwable e) {\n\t\t\t\tthrow new KafkaZKException(e);\n\t\t\t} \n\t\t}",
"public List<String> getChildren(final String path, Watcher watcher) throws KeeperException, InterruptedException {\n final String clientPath = path;\n PathUtils.validatePath(clientPath);\n\n // the watch contains the un-chroot path\n WatchRegistration wcb = null;\n if (watcher != null) {\n wcb = new ChildWatchRegistration(watcher, clientPath);\n }\n\n final String serverPath = prependChroot(clientPath);\n\n RequestHeader h = new RequestHeader();\n h.setType(ZooDefs.OpCode.getChildren);\n GetChildrenRequest request = new GetChildrenRequest();\n request.setPath(serverPath);\n request.setWatch(watcher != null);\n GetChildrenResponse response = new GetChildrenResponse();\n ReplyHeader r = cnxn.submitRequest(h, request, response, wcb);\n if (r.getErr() != 0) {\n throw KeeperException.create(KeeperException.Code.get(r.getErr()), clientPath);\n }\n return response.getChildren();\n }",
"Configuration[] getChildren();",
"public List<ModelData> getChildren();",
"public ArrayList<Node> getChildList(){\n return children;\n }",
"public synchronized List<Xen> children() {\n if ( (children == NO_CHILDREN) && notAttrMock())\n children = new ArrayList<Xen>();\n\n return children;\n }",
"public HashSet<String> getChildrenURL() {\n return childrenURL;\n }",
"public List<MagicPattern> getChildren() {\n\t\treturn children;\n\t}",
"private static void listChildren(Path p, List<String> list)\n throws IOException {\n for (Path c : p.getDirectoryEntries()) {\n list.add(c.getPathString());\n if (c.isDirectory()) {\n listChildren(c, list);\n }\n }\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Returns the period in which this course finishes. (For 1 period courses, this will be the same period as the starting period, for 2 period courses it will be starting period + 1 and so on...)
|
public int getFinishingPeriod() {
return this.period + this.getAmountOfPeriods() - 1;
}
|
[
"long getPeriod();",
"public int getGoalendPeriod() {\r\n return goalendPeriod;\r\n }",
"long getStepPeriod();",
"public TsPeriod getEnd() {\r\n return new TsPeriod(m_freq, m_beg + m_c);\r\n }",
"public int getHowManyInPeriod();",
"int getRunPeriod();",
"public long period() throws TimeWindowException {\n return div();\n }",
"public int getPeriod() {\r\n return period;\r\n }",
"Period getEffectivePeriod();",
"public Long getEndPeriodInLong() {\n if (isSecondSemesterByNow()) {\n return SECOND_SEMESTER_END.atStartOfDay().toEpochSecond(ZERO_HOUR_OFFSET);\n } else {\n return FIRST_SEMESTER_END.atStartOfDay().toEpochSecond(ZERO_HOUR_OFFSET);\n }\n }",
"protected long getTerminationPeriod() {\n\t\treturn terminationPeriod;\n\t}",
"public int getEndInt(){\n\t\treturn convertTime(periodEnd);\n\t}",
"public int getGoalstartPeriod() {\r\n return goalstartPeriod;\r\n }",
"protected long getPeriod()\n {\n return 0;\n }",
"public org.drip.analytics.cashflow.CompositePeriod lastPeriod()\n\t{\n\t\tjava.util.List<org.drip.analytics.cashflow.CompositePeriod> lsCouponPeriod = periods();\n\n\t\treturn lsCouponPeriod.get (lsCouponPeriod.size() - 1);\n\t}",
"public double getPeriod() {\n return period;\n }",
"public int getStartingPeriod() {\n\t\treturn this.period;\n\t}",
"public int getPeriods() {\n return periods;\n }",
"public Integer getPeriod() {\n return period;\n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|