query stringlengths 7 33.1k | document stringlengths 7 335k | metadata dict | negatives listlengths 3 101 | negative_scores listlengths 3 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
Writes a typeinstance association. JTM provides no shortcut like "instanceOf" at the topic level to indicate that a topic is an instance of another topic, all typeinstance relationships must be encoded as associations. | private void _writeTypeInstance(final Topic type, final Topic instance) throws IOException {
_out.startObject();
_writeKeyValue("type", _TMDM_TYPE_INSTANCE);
_out.key("roles");
_out.startArray();
_out.startObject();
_writeKeyValue("type", _TMDM_TYPE);
_writeKeyValue("player", _topicRef(type));
_out.endObject();
_out.startObject();
_writeKeyValue("type", _TMDM_INSTANCE);
_writeKeyValue("player", _topicRef(instance));
_out.endObject();
_out.endArray();
_out.endObject();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setInstanceType(String instanceType) {\n this.instanceType = instanceType;\n }",
"public void associate(Object obj, Class type);",
"TypeAssociation getAssocieCommeSujetInstanceObjet();",
"public static void publishInstance(bjDealerDataWriter typedWriter, bjDealer pubInstance)\n\t{\n\t\t... | [
"0.5060203",
"0.4993496",
"0.48938432",
"0.48326826",
"0.47450843",
"0.4720847",
"0.4672573",
"0.46637663",
"0.46070543",
"0.4601724",
"0.4540818",
"0.45090213",
"0.44459832",
"0.4425804",
"0.44065344",
"0.43807516",
"0.43719298",
"0.4347132",
"0.43418688",
"0.4283663",
"0.42... | 0.74922097 | 0 |
Serializes the reifier iff the reifier is not null. | private void _writeReifier(Reifiable reifiable) throws IOException {
Topic reifier = reifiable.getReifier();
if (reifier == null) {
return;
}
_writeKeyValue("reifier", _topicRef(reifier));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic String serialize() {\n\t\treturn null;\n\t}",
"@Override\r\n\t\t\tpublic void serializar() {\n\r\n\t\t\t}",
"@Override\r\n\tpublic String serialize(Annotation annotation) {\n\t\treturn null;\r\n\t}",
"@Override\r\n\tpublic void serializar() {\n\r\n\t}",
"public abstract String serialise... | [
"0.63773763",
"0.5821228",
"0.5737477",
"0.5685735",
"0.5669803",
"0.56626844",
"0.5662091",
"0.5605998",
"0.53956604",
"0.53538465",
"0.5344624",
"0.5264918",
"0.52602184",
"0.5218539",
"0.52129394",
"0.52105707",
"0.51983577",
"0.5196029",
"0.5196029",
"0.51879156",
"0.5187... | 0.5971752 | 1 |
Writes a key/value pair. | private void _writeKeyValue(String key, String value) throws IOException {
_out.key(key);
_out.value(value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void write(K key, V value);",
"public void emit(String key, String value) throws IOException {\r\n writer.writeKV(key, value);\r\n }",
"@Override\r\n public void write(final K key, final V value) throws IOException {\r\n m_Text.append(key.toString()+ \"\\t\" + value.toString());\r\n }",
"voi... | [
"0.80352813",
"0.7141569",
"0.6949223",
"0.68496746",
"0.67862576",
"0.66410494",
"0.6564504",
"0.63627934",
"0.6326303",
"0.6146525",
"0.60858893",
"0.6075557",
"0.60395634",
"0.60395634",
"0.59656185",
"0.59186023",
"0.58790654",
"0.5858207",
"0.58556217",
"0.58499026",
"0.... | 0.79608357 | 1 |
Returns an IRI which is usable to as reference to the specified topic. | private String _topicRef(Topic topic) {
Set<Locator> locs = topic.getSubjectIdentifiers();
if (!locs.isEmpty()) {
return "si:" + locs.iterator().next().toExternalForm();
}
locs = topic.getSubjectLocators();
if (!locs.isEmpty()) {
return "sl:" + locs.iterator().next().toExternalForm();
}
locs = topic.getItemIdentifiers();
if (!locs.isEmpty()) {
return "ii:" + locs.iterator().next().toExternalForm();
}
return "ii:" + _baseIRI + "#" + topic.getId();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String getTopic();",
"String getTopic();",
"public String getID()\n {\n return \"topic=\" + id;\n }",
"Topic getTopic();",
"long getTopic();",
"public Topic readTopic(int topicId);",
"@Override\n public String getTopic() {\n Object ref = topic_;\n if (ref instanceof String) {\n ... | [
"0.62834793",
"0.62834793",
"0.6280863",
"0.60954016",
"0.5957849",
"0.5955355",
"0.5898314",
"0.57047474",
"0.56981856",
"0.5644421",
"0.56178147",
"0.5596301",
"0.559058",
"0.5588452",
"0.5574919",
"0.55378735",
"0.550792",
"0.54836756",
"0.5438086",
"0.5425816",
"0.5413976... | 0.8112269 | 0 |
/ Building a search query | @Override
public Flowable<Row> streamMarcRecordIds(ParseLeaderResult parseLeaderResult, ParseFieldsResult parseFieldsResult, RecordSearchParameters searchParameters, String tenantId) {
SelectJoinStep searchQuery = DSL.selectDistinct(RECORDS_LB.EXTERNAL_ID).from(RECORDS_LB);
appendJoin(searchQuery, parseLeaderResult, parseFieldsResult);
appendWhere(searchQuery, parseLeaderResult, parseFieldsResult, searchParameters);
if (searchParameters.getOffset() != null) {
searchQuery.offset(searchParameters.getOffset());
}
if (searchParameters.getLimit() != null) {
searchQuery.limit(searchParameters.getLimit());
}
/* Building a count query */
SelectJoinStep countQuery = DSL.select(countDistinct(RECORDS_LB.EXTERNAL_ID)).from(RECORDS_LB);
appendJoin(countQuery, parseLeaderResult, parseFieldsResult);
appendWhere(countQuery, parseLeaderResult, parseFieldsResult, searchParameters);
/* Join both in one query */
String sql = DSL.select().from(searchQuery).rightJoin(countQuery).on(DSL.trueCondition()).getSQL(ParamType.INLINED);
return getCachedPool(tenantId)
.rxGetConnection()
.flatMapPublisher(conn -> conn.rxBegin()
.flatMapPublisher(tx -> conn.rxPrepare(sql)
.flatMapPublisher(pq -> pq.createStream(10000)
.toFlowable()
.filter(row -> !enableFallbackQuery || row.getInteger(COUNT) != 0)
.switchIfEmpty(streamMarcRecordIdsWithoutIndexersVersionUsage(conn, parseLeaderResult, parseFieldsResult, searchParameters))
.map(this::toRow))
.doAfterTerminate(tx::commit)));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"CampusSearchQuery generateQuery();",
"public String buildSearchQuery() throws Exception\r\n { \r\n String query;\r\n \r\n searchContext.setText(getSearchString());\r\n \r\n if(!locations.isEmpty())\r\n {\r\n searchContext.setLocations(locations);\r\n }\r\n\r\n if (ext != null) {\... | [
"0.7985988",
"0.703659",
"0.6983679",
"0.67783934",
"0.6764428",
"0.6755167",
"0.6747615",
"0.6706109",
"0.66114944",
"0.66092443",
"0.6601369",
"0.6552577",
"0.647412",
"0.641837",
"0.641837",
"0.6411479",
"0.64027166",
"0.63708794",
"0.6364236",
"0.63494027",
"0.63492393",
... | 0.0 | -1 |
Deletes old versions of Marc Indexers based on tenant ID. | @Override
public Future<Boolean> deleteMarcIndexersOldVersions(String tenantId) {
return executeInTransaction(txQE -> acquireLock(txQE, INDEXERS_DELETION_LOCK_NAMESPACE_ID, tenantId.hashCode())
.compose(isLockAcquired -> {
if (Boolean.FALSE.equals(isLockAcquired)) {
LOG.info("deleteMarcIndexersOldVersions:: Previous marc_indexers old version deletion still ongoing, tenantId: '{}'", tenantId);
return Future.succeededFuture(false);
}
return deleteMarcIndexersOldVersions(txQE, tenantId);
}), tenantId);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n @Secured(SecurityRoles.ADMINISTRATOR)\n public void reindex() {\n revisionDao.deleteAll();\n // OK, launches a new indexation\n indexFromLatest();\n }",
"public void deleteVersions(SQLTenant tenant, String uniqueIdentifier) {\n oma.select(VersionedFile.class)\n ... | [
"0.590462",
"0.56968486",
"0.5686371",
"0.5571511",
"0.5376356",
"0.5365956",
"0.52771944",
"0.52632505",
"0.5250094",
"0.52455205",
"0.52326614",
"0.52211845",
"0.5147375",
"0.5089081",
"0.5075607",
"0.5058985",
"0.50077546",
"0.49911076",
"0.4981155",
"0.49719584",
"0.49431... | 0.7051438 | 0 |
/ Code to avoid the occurrence of records when limit equals to zero | private RecordCollection toRecordCollectionWithLimitCheck(QueryResult result, int limit) {
// Validation to ignore records insertion to the returned recordCollection when limit equals zero
if (limit == 0) {
return new RecordCollection().withTotalRecords(asRow(result.unwrap()).getInteger(COUNT));
}
else {
return toRecordCollection(result);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void clearLimit() { limit_ = null;\n \n }",
"public long limit();",
"public void setLimit(int limit) {\n this.limit=limit;\n }",
"private void limitRows()\n {\n paginate(currentPage, getResultsPerPage());\n }",
"public void setLimit(int limit) {\n this.limit = lim... | [
"0.62034506",
"0.61172515",
"0.61082184",
"0.60792714",
"0.60734814",
"0.60448587",
"0.6044458",
"0.60302484",
"0.5997513",
"0.59642535",
"0.59220415",
"0.59100413",
"0.5904492",
"0.58617705",
"0.58189726",
"0.5751369",
"0.57324487",
"0.56969935",
"0.569168",
"0.56664765",
"0... | 0.7040243 | 0 |
TODO Autogenerated method stub | @Override
public <E> void add(Attr<E> newAttr) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public <E> Attr<E> find(String attrName) {
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public <E> Attr<E> remove(String attrName) {
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public <E> Iterator<Attr<E>> attrs() {
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
Creates a new PaxosExecution within the given PaxosInstance for the given initiator. A PaxosRound with round number 0 is also created and its timeout is started | public PaxosExecution(PaxosInstance a_instance, String a_initiator, Vector a_roundLeaders)
{
this.m_initiator = a_initiator;
this.m_paxosInstance = a_instance;
m_roundLeaders = a_roundLeaders;
createRound();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract T create(final double idealStartTime);",
"SAProcessInstanceBuilder createNewInstance(SProcessInstance processInstance);",
"public com.google.common.util.concurrent.ListenableFuture<\n com.google.cloud.aiplatform.v1.Execution>\n createExecution(com.google.cloud.aiplatform.v1... | [
"0.5197669",
"0.49235788",
"0.47986653",
"0.47764188",
"0.4741409",
"0.46622583",
"0.46083125",
"0.45742851",
"0.4534282",
"0.45121518",
"0.44739705",
"0.44661066",
"0.4459304",
"0.44272378",
"0.44027993",
"0.43731666",
"0.43231604",
"0.4307302",
"0.42050955",
"0.41891724",
"... | 0.72003776 | 0 |
Returns the round with the given round number or null if there is no such round exists | public PaxosRound getRound(int a_round)
{
PaxosRound result = (PaxosRound) m_rounds.get(new Integer(a_round));
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private ChesspairingRound getRound(int roundNumber) {\n\t\tList<ChesspairingRound> rounds = mTournament.getRounds();\n\t\tfor (ChesspairingRound round : rounds) {\n\t\t\tif (round.getRoundNumber() == roundNumber) {\n\t\t\t\treturn round;\n\t\t\t}\n\t\t}\n\t\tthrow new IllegalStateException(\n\t\t\t\t\"Tournament i... | [
"0.706985",
"0.6473156",
"0.63552904",
"0.63256705",
"0.62587506",
"0.61881304",
"0.6158528",
"0.6154913",
"0.61379415",
"0.61305416",
"0.6094091",
"0.59730935",
"0.5972442",
"0.59553933",
"0.5839919",
"0.5769147",
"0.5675565",
"0.5571954",
"0.5564044",
"0.55400056",
"0.55162... | 0.7516556 | 0 |
Creates and returns a new PaxosRound with the given round number | public PaxosRound createRound(int a_round)
{
PaxosRound result = new PaxosRound(this, a_round, getNextRoundLeader(a_round));
m_rounds.put(new Integer(a_round), result);
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public PaxosRound createRound()\n {\n return createRound(0);\n }",
"public PaxosRound getRound(int a_round)\n {\n PaxosRound result = (PaxosRound) m_rounds.get(new Integer(a_round));\n return result;\n }",
"public void setRound(int round) {\r\n this.round = round;\r\n ... | [
"0.8102282",
"0.6454583",
"0.6216657",
"0.61616856",
"0.61128545",
"0.60877264",
"0.59969807",
"0.5908528",
"0.5649885",
"0.56239265",
"0.56161267",
"0.5575764",
"0.5535451",
"0.54109615",
"0.5403501",
"0.5367833",
"0.53473866",
"0.53226936",
"0.53217",
"0.53184825",
"0.52810... | 0.7716057 | 1 |
Creates a PaxosRound with round number 0 | public PaxosRound createRound()
{
return createRound(0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Round() {\n\t\tthis.niceMoves = null;\n\t\tthis.roundNo = 1;\n\t}",
"public PaxosRound createRound(int a_round)\n {\n PaxosRound result = new PaxosRound(this, a_round, getNextRoundLeader(a_round));\n m_rounds.put(new Integer(a_round), result);\n return result;\n }",
"public st... | [
"0.58268195",
"0.57222813",
"0.55645764",
"0.5454309",
"0.53932065",
"0.5389639",
"0.5321591",
"0.5258297",
"0.5234384",
"0.52051085",
"0.51751614",
"0.5174799",
"0.5150408",
"0.51365066",
"0.5121832",
"0.51148266",
"0.50872344",
"0.50679636",
"0.50441587",
"0.5027279",
"0.49... | 0.8062155 | 0 |
Returns this executions initiators id | public String getInitiator()
{
return m_initiator;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private long getInitId() {\n if (self.getQuorumVerifier().getVotingMembers().containsKey(self.getMyId())) {\n return self.getMyId();\n } else {\n return Long.MIN_VALUE;\n }\n }",
"public UUID executionId();",
"String getExecId();",
"public int getExecutionInstanc... | [
"0.700159",
"0.6442379",
"0.6437566",
"0.6070867",
"0.59549826",
"0.5944417",
"0.59369326",
"0.59069633",
"0.59069633",
"0.5854743",
"0.58417386",
"0.5800329",
"0.5782637",
"0.577817",
"0.5768916",
"0.5732986",
"0.5709925",
"0.56599694",
"0.5652656",
"0.56429636",
"0.56390095... | 0.0 | -1 |
Returns the PaxosInstance this execution belongs to | public PaxosInstance getPaxosInstance()
{
return m_paxosInstance;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getExecutionInstance() {\n return executionInstance;\n }",
"Execution getProcessInstance();",
"public static final PikaxProcessor getInstance() {\n\t\tif (instance == null) {\n\t\t\treturn newInstance();\n\t\t}\n\t\treturn instance;\n\t}",
"public PaxosExecution getExecution(PaxosMessage ... | [
"0.70904785",
"0.65914637",
"0.6510925",
"0.61428505",
"0.6004738",
"0.5851339",
"0.58500415",
"0.58262986",
"0.5734824",
"0.5713195",
"0.5699949",
"0.56986535",
"0.56878704",
"0.5678086",
"0.5655324",
"0.56115335",
"0.5595351",
"0.5588178",
"0.55842304",
"0.5574621",
"0.5539... | 0.73362964 | 0 |
Aborts all active rounds | public void cancel()
{
Enumeration en = m_rounds.keys();
while (en.hasMoreElements())
{
PaxosRound tmp = (PaxosRound) m_rounds.get(en.nextElement());
tmp.abort();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void abort() {\n isAborted = true;\n cancelCommands();\n cancel(true);\n }",
"public synchronized void abort() {\r\n\t\tif (done) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tdone = true;\r\n\r\n\t\tabortScheduledTasks();\r\n\t}",
"public void stopGame()\r\n\t{\r\n\t\tthis.inProgress = fal... | [
"0.6712838",
"0.65581936",
"0.65374124",
"0.64106065",
"0.6363701",
"0.634371",
"0.62770146",
"0.62466353",
"0.6244759",
"0.6199459",
"0.61689806",
"0.6164067",
"0.614501",
"0.61320794",
"0.6101712",
"0.60876024",
"0.60652167",
"0.6054831",
"0.6054831",
"0.6054831",
"0.605483... | 0.7865504 | 0 |
Decides the given proposal for this execution | public void decide(String a_proposal)
{
this.m_paxosInstance.addDecision(this.getInitiator(), a_proposal);
m_decided = true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getProposal() {\n return proposal;\n }",
"private ClaimOrConcession(int proposal) {\n this.proposal = proposal;\n }",
"public void setProposalNo(java.lang.String proposalNo) {\n this.proposalNo = proposalNo;\n }",
"public java.lang.String getProposa... | [
"0.6880457",
"0.6475646",
"0.5898633",
"0.5808563",
"0.5795159",
"0.5774769",
"0.5753348",
"0.5719346",
"0.56790066",
"0.56706375",
"0.56293535",
"0.557212",
"0.5566831",
"0.5546895",
"0.53835523",
"0.5315035",
"0.52979594",
"0.5294491",
"0.5286439",
"0.5278842",
"0.52438694"... | 0.68395764 | 1 |
Indicates if this execution has been decided | public boolean isDecided()
{
return m_decided;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isExecuted()\n {\n return executed;\n }",
"boolean hasExecution();",
"public boolean hasBeenExecuted() {\n\t\treturn executed;\n\t}",
"public boolean isExecuting(){\n return !pausing;\n }",
"public boolean isOperationExecuted() {\n return currentItemState == Ite... | [
"0.73285824",
"0.72607416",
"0.7022175",
"0.6993957",
"0.69652474",
"0.67889035",
"0.6631992",
"0.65738785",
"0.6475675",
"0.64149743",
"0.6387202",
"0.6374593",
"0.6339978",
"0.63194555",
"0.6268232",
"0.6259023",
"0.6230352",
"0.6205601",
"0.6205123",
"0.6198623",
"0.619281... | 0.0 | -1 |
Returns the ID of the next rounds leader. This will only be needed if the previous round gets frozen | public String getNextRoundLeader(int a_round)
{
int i = 0;
for (; i < m_roundLeaders.size(); i++)
{
if (getInitiator().equals(m_roundLeaders.get(i)))
break;
}
int index = (i + a_round) % m_roundLeaders.size();
String g = (String) m_roundLeaders.get(index);
return g;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private int getNextPlayer() {\n int nextPlayerID = ((currentTurn + turnOrder) % numPlayers);\n nextPlayerID = (((nextPlayerID + numPlayers) % numPlayers)); // handles negative numbers\n return nextPlayerID;\n }",
"public int nextId() throws IllegalIdRequestException {\r\n\t\tif (currentId... | [
"0.7202087",
"0.672702",
"0.6427792",
"0.6386612",
"0.63300556",
"0.62676495",
"0.62404853",
"0.6224939",
"0.62011135",
"0.6199851",
"0.6171109",
"0.61692196",
"0.61678386",
"0.6164794",
"0.6136341",
"0.61197776",
"0.6091701",
"0.6086698",
"0.6065404",
"0.6054795",
"0.6044399... | 0.7298858 | 0 |
Returns a "good" (see Paxos at War) proposal for this execution A proposal is p good if a) There is no pending decission, i.e. the set Poss is empty in all rounds and p = "NULL" b) p is in acc in some round i and in poss in all rounds i \<= k \< a_nextRound | public String getGoodProposal(int a_nextRound)
{
String goodValue = null;
for (int i = 0; i < a_nextRound; i++)
{
PaxosRound round = (PaxosRound) m_rounds.get(new Integer(i));
if (round == null)
{
error("(acc) Uuuups, there is no round " + i);
continue;
}
Vector acc = round.getAcc();
if (acc.isEmpty())
continue;
Enumeration en = acc.elements();
while (en.hasMoreElements())
{
String prop = (String) en.nextElement();
boolean good = true;
for (int j = i; j < a_nextRound; j++)
{
PaxosRound r = (PaxosRound) m_rounds.get(new Integer(j));
if (r == null)
{
error("(poss) Uuuups, there is no round " + j);
continue;
}
Vector poss = r.getPoss();
if (!poss.isEmpty() && !poss.contains(prop))
{
good = false;
break;
}
}
if (good)
{
goodValue = prop;
break;
}
}
if (goodValue != null)
break;
}
if (goodValue == null)
goodValue = "NULL";
return goodValue;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static boolean canPrune() {\n\t\tboolean result = false;\n\t\tint projectedTotal = 0;\n\t\t\n\t\tint i = 0;\n\t\twhile(i<jobsChosen){\n\t\t\tprojectedTotal += board[i][currentCombo[i]];\n\t\t\ti++;\n\t\t}\n\t\twhile(i<numPeople){\n\t\t\tprojectedTotal += bestPossibleCombination[i];\n\t\t\ti++;\n\t\t}\n\t\ti... | [
"0.5879613",
"0.58230746",
"0.55910146",
"0.55186355",
"0.5471682",
"0.5467091",
"0.5446042",
"0.5428008",
"0.54139674",
"0.5404922",
"0.5360964",
"0.5355068",
"0.5301301",
"0.52520907",
"0.524421",
"0.5239846",
"0.52294195",
"0.51623374",
"0.5159011",
"0.51522946",
"0.513659... | 0.7183224 | 0 |
float[][] m = new float[2][3]; | public static void main(String[] args) {
float[][] m = {
{1,2,3},{4,5,6},{7,8,2}
};
new Solver(m);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Matrix3f(float v[]) {\n\t\n \tthis.set(v);\n }",
"public native float[][] __float2dArrayMethod( long __swiftObject, float[][] arg );",
"public abstract float[] toFloatArray();",
"float[] getModelMatrix();",
"float[] getMVPMatrix();",
"public float[] array() {\r\n\t\treturn new float[] { x, y... | [
"0.6720004",
"0.6605453",
"0.65138596",
"0.64575225",
"0.64068615",
"0.63705707",
"0.608522",
"0.59014046",
"0.5900914",
"0.58896536",
"0.5868722",
"0.58524215",
"0.58500147",
"0.5848433",
"0.5805075",
"0.58021045",
"0.5794342",
"0.57645124",
"0.5756896",
"0.5741091",
"0.5716... | 0.0 | -1 |
O(N^3) better style, from prashant404 | public int sumOddLengthSubarrays1(int[] arr) {
int total = 0;
for (int window = 1; window <= arr.length; window += 2)
for (int i = 0; i + window <= arr.length; i++)
for (int j = i; j < i + window; j++)
total += arr[j];
return total;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static int f2(int N) { \n int x = 0; //O(1)\n for(int i = 0; i < N; i++) // O(n)\n // O(n)`\n for(int j = 0; j < i; j++) \n x++;\n return x;\n }",
"public static int f1(int N) {\n int x = 0; //O(1)\n for(int i = 0; i < N; i++... | [
"0.66949636",
"0.64112025",
"0.6108174",
"0.5998883",
"0.57879746",
"0.5703236",
"0.5679745",
"0.5627099",
"0.5589933",
"0.5556628",
"0.5546348",
"0.55048853",
"0.54460853",
"0.5296719",
"0.52807444",
"0.5272134",
"0.5250643",
"0.5216037",
"0.5213045",
"0.5197479",
"0.5161772... | 0.0 | -1 |
Created by traitorwtf on 22.08.2017. | public interface Overdrive {
void useOverdrive();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void perish() {\n \n }",
"private stendhal() {\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n... | [
"0.5970683",
"0.58904094",
"0.5699271",
"0.56022227",
"0.5600665",
"0.5600665",
"0.5587645",
"0.55768424",
"0.5574353",
"0.55534667",
"0.55281246",
"0.5513497",
"0.5476697",
"0.54720694",
"0.54675156",
"0.54648745",
"0.5449651",
"0.5449651",
"0.5449651",
"0.5449651",
"0.54496... | 0.0 | -1 |
Constructor for objects of class CheckB | public CheckB(BHTPane bHTP, Check check, Color color) {
super();
cb = new CheckButton(bHTP, check);
this.check = check;
initialize(color);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public NotChecker(Checker chk1)\n {\n checker1 = chk1;\n }",
"public /* synthetic */ Checks(Name name2, Check[] checkArr, Function1 function1, int i, DefaultConstructorMarker defaultConstructorMarker) {\n this(name2, checkArr, (Function1<? super FunctionDescriptor, String>) (i & 4) != 0 ... | [
"0.64773077",
"0.62477386",
"0.6203218",
"0.6198963",
"0.61780196",
"0.61238176",
"0.6116034",
"0.59543616",
"0.5925663",
"0.58765066",
"0.58532274",
"0.58381236",
"0.5833372",
"0.5824922",
"0.58103",
"0.5747988",
"0.5704349",
"0.5697434",
"0.56881845",
"0.5673009",
"0.563886... | 0.6156803 | 5 |
TODO Autogenerated method stub | @Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,
ModelAndView modelAndView) throws Exception {
super.postHandle(request, response, handler, modelAndView);
if (modelAndView != null) {
response.setContentType("text/html; charset=UTF-8");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
We don't want to time the toString, so ensure we're calling a trivial one... | @Test
public void timeAppendObject() {
Object o =
new Object() {
@Override
public String toString() {
return "constant";
}
};
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
while (state.keepRunning()) {
StringBuilder sb = new StringBuilder();
for (int j = 0; j < mLength; ++j) {
sb.append(o);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String toString()\n/* */ {\n/* 1460 */ return toString(true);\n/* */ }",
"public String toString()\r\n/* 736: */ {\r\n/* 737:804 */ return toStringBuilder().toString();\r\n/* 738: */ }",
"String toString();",
"String toString();",
"String toString();",
"String toStr... | [
"0.71403104",
"0.70385545",
"0.6955364",
"0.6955364",
"0.6955364",
"0.6955364",
"0.6955364",
"0.6955364",
"0.6955364",
"0.6955364",
"0.6955364",
"0.6955364",
"0.6955364",
"0.6955364",
"0.6955364",
"0.6955364",
"0.6955364",
"0.6955364",
"0.6955364",
"0.6955364",
"0.6955364",
... | 0.6584945 | 85 |
Construct a new instance | protected Downloader(float maxArea) {
this.maxArea = maxArea;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Reproducible newInstance();",
"private Instantiation(){}",
"Instance createInstance();",
"protected abstract void construct();",
"public CMObject newInstance();",
"public Instance() {\n }",
"public T newInstance();",
"public void create(){}",
"@Override\r\n\tpublic CMObject newInstance()\r\n\t{\... | [
"0.75945556",
"0.7518607",
"0.7423393",
"0.73149437",
"0.6998678",
"0.68987113",
"0.6848237",
"0.666116",
"0.66099733",
"0.65910536",
"0.6573748",
"0.6524093",
"0.650649",
"0.650649",
"0.6499274",
"0.64542055",
"0.64240247",
"0.6400431",
"0.6379562",
"0.63608354",
"0.63608354... | 0.0 | -1 |
Set the view to download | public void setBox(@NonNull ViewBox box) {
this.box = new ViewBox(box);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void download() {\n\t\t\r\n\t}",
"@RequestMapping(value = \"/download\", method = RequestMethod.GET)\n public PdfView download(final Model model) {\n final PdfView view = new PdfView();\n return view;\n }",
"public void download() {\n }",
"public void downloadButt... | [
"0.636577",
"0.6248749",
"0.622603",
"0.6179269",
"0.6145029",
"0.614107",
"0.60433453",
"0.58976835",
"0.5772199",
"0.5764903",
"0.57395005",
"0.5677634",
"0.56615555",
"0.56603956",
"0.5658427",
"0.5646443",
"0.5621208",
"0.5619775",
"0.55992776",
"0.5595867",
"0.55948514",... | 0.0 | -1 |
TODO Autogenerated method stub Embed stego = new Embed(); stego.embedMsg(); stego.decode(); | public static void main(String[] args) throws IOException {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Builder setEmbed(MessageEmbed embed) {\n message.setEmbeds(embed);\n return this;\n }",
"EMBED createEMBED();",
"IMessage decode(byte[] data) throws InvalidMessageException;",
"private static EmbedBuilder JoinDM (){\n Color color = new Color(238,119,0);\n ret... | [
"0.63171667",
"0.60632",
"0.5191684",
"0.5145183",
"0.51306015",
"0.5031315",
"0.5017535",
"0.5017316",
"0.4930079",
"0.4865731",
"0.47815353",
"0.4773506",
"0.47592348",
"0.4703183",
"0.4703183",
"0.46972594",
"0.4641128",
"0.46396032",
"0.46099135",
"0.45916235",
"0.4571046... | 0.0 | -1 |
Panels that use the EntityOpsPanel of buttons must provide a controller that implements this interface. | public interface EntityOpsController
{
/** @return a string representing the type of entity for use in messages. */
public String getEntityName();
/** Called when user presses the 'Commit' button. */
public void commitEntity();
/** Called when user presses the 'Close' button. */
public void closeEntity();
/** Called when user presses the 'Help' button. */
public void help();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface IController {\n\n /**\n * add action command to the Button.\n */\n void configureButtonListener();\n\n /**\n * add mouse command to the editView.\n */\n void configureMouseListener();\n\n}",
"private void createButtonsPanel() {\r\n Composite buttonsPanel = new Composite(this, ... | [
"0.67556804",
"0.5798073",
"0.57003194",
"0.5692417",
"0.56845444",
"0.5633804",
"0.5627381",
"0.5627381",
"0.56028146",
"0.55556476",
"0.55368626",
"0.54753447",
"0.54706335",
"0.54631674",
"0.5450573",
"0.544886",
"0.54378587",
"0.54347384",
"0.54196596",
"0.54011846",
"0.5... | 0.735907 | 0 |
Called when user presses the 'Commit' button. | public void commitEntity(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void commit() {\n }",
"protected void post_commit_hook() { }",
"public void commit() {\n doCommit();\n }",
"public void commit() {\n }",
"@Override\n\tpublic void commit() {\n\n\t}",
"void commit();",
"void commit();",
"@Override\n public void commit() {\n }",
"public void commit(){... | [
"0.7330888",
"0.6996511",
"0.692656",
"0.6847231",
"0.6704446",
"0.66606903",
"0.66606903",
"0.6579023",
"0.6562302",
"0.6551676",
"0.65098107",
"0.65010065",
"0.6498667",
"0.6486426",
"0.64249015",
"0.64200974",
"0.6393521",
"0.63230354",
"0.6305904",
"0.6305438",
"0.6295692... | 0.0 | -1 |
Called when user presses the 'Close' button. | public void closeEntity(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void close() {\n getCloseButton().click();\n }",
"@Override\n\tpublic void windowClose(CloseEvent e) {\n\t\t\n\t}",
"void close_actionPerformed(ActionEvent e){\n\t System.exit(0);\n\t }",
"public abstract void windowClose(CloseEvent e);",
"private void closeBtnMouseClicked(java.awt.e... | [
"0.8212316",
"0.79125917",
"0.78827167",
"0.78337413",
"0.78242177",
"0.7792636",
"0.7746054",
"0.77184236",
"0.7705525",
"0.76914436",
"0.7688938",
"0.7688938",
"0.7688938",
"0.7686598",
"0.76620054",
"0.7652321",
"0.7641972",
"0.7639501",
"0.76229656",
"0.76194006",
"0.7614... | 0.0 | -1 |
Called when user presses the 'Help' button. | public void help(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tprotected void handleHelp(ClickEvent event) {\n\t\t\n\t}",
"protected void handleHelp(ActionEvent event) {\n\t}",
"@Override\n \t\t\t\tpublic void doHelp() {\n \n \t\t\t\t}",
"public void showHelp();",
"public void helpRequested(HelpEvent event) {\r\n }",
"public void handleHelp()... | [
"0.86302084",
"0.860233",
"0.83413124",
"0.8336883",
"0.82124895",
"0.82111424",
"0.82060504",
"0.81802917",
"0.80177027",
"0.79524463",
"0.79291636",
"0.7851695",
"0.7828261",
"0.7806413",
"0.77896035",
"0.77224374",
"0.77175355",
"0.7702225",
"0.76834214",
"0.7679565",
"0.7... | 0.80229205 | 8 |
Method: Checking(String name) Inputs: name and balance Returns: Description: The method construct a new account with name and balance. | public Checking(String name, float balance) {
super(name, balance);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Account(String name, double balance)\r\n\t{\r\n\t\t\r\n\t\tthis.name = name; //assign name to the instance variable name \r\n\t\t\r\n\t\t// validate that the balance is greater that 0.0; if it is not,\r\n\t\t// instance variable balance keeps its default value 0.0\r\n\t\tif(balance > 0.0) // if balance is valid\r\... | [
"0.7566508",
"0.7297061",
"0.71608824",
"0.70085615",
"0.68528664",
"0.6829573",
"0.6780334",
"0.6764915",
"0.6712807",
"0.6640572",
"0.66216546",
"0.6594538",
"0.651532",
"0.6495882",
"0.645846",
"0.6457769",
"0.64532155",
"0.6429549",
"0.63743794",
"0.6326132",
"0.63003725"... | 0.79096496 | 0 |
Method: getType() Inputs: Returns: String "checking" Description: The method return a string "Checking". | public String getType() { return "Checking"; } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isTypeChecking() {\n return _typeChecking;\n }",
"public String giveType(){\n if(isFull==false){\n return \"notfilled\";\n }\n else if(type==TYPE.BLACK){\n return \"BLACK\";\n }else{\n return \"WHITE\";\n }\n }",
... | [
"0.6584807",
"0.6562745",
"0.6385408",
"0.6270798",
"0.62290496",
"0.62086606",
"0.62086606",
"0.62086606",
"0.62086606",
"0.62086606",
"0.62086606",
"0.62086606",
"0.62086606",
"0.62086606",
"0.62086606",
"0.62086606",
"0.62086606",
"0.62086606",
"0.62086606",
"0.62086606",
... | 0.89614165 | 0 |
Method: createChecking(String name) Inputs: name Returns: The method return a new checking account with name. Description: The method create a new checking account with name. | public static Checking createChecking(String name) {
return new Checking(name);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private Checking(String name) {\r\n\t\tsuper(name);\r\n\t}",
"public void createAccount() {\n System.out.println(\"Would you like to create a savings or checking account?\");\n String AccountRequest = input.next().toLowerCase().trim();\n createAccount(AccountRequest);\n\n }",
"public Ch... | [
"0.68053883",
"0.59979504",
"0.5978651",
"0.5781694",
"0.5704448",
"0.56754285",
"0.5603489",
"0.54910815",
"0.5434576",
"0.5425367",
"0.5367224",
"0.5357025",
"0.53512204",
"0.5340686",
"0.53291255",
"0.5318343",
"0.53071284",
"0.5271788",
"0.5228858",
"0.52260137",
"0.52047... | 0.7938037 | 0 |
Method: deposit(float amount) Inputs: amount Returns: boolean Description: The method deposit money into account by specific amount. A deposit may be made unless the Checking account is closed | public boolean deposit(float amount) {
if (getState() != State.CLOSED && amount > 0.0f) {
balance = balance + amount;
if (balance >= 0.0f) {
setState(State.OPEN);
}
return true;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract boolean deposit(float amount);",
"public boolean deposit(double amount) {\n if (amount>0) {\n setBalance(this.balance + amount);\n return true;\n }\n return false;\n }",
"@Override\n public boolean deposit(Account account, BigDecimal amount) {\n ... | [
"0.85451657",
"0.8311003",
"0.82970375",
"0.82833064",
"0.82395375",
"0.8128079",
"0.80268216",
"0.8018354",
"0.80098575",
"0.8009414",
"0.799965",
"0.7981996",
"0.79480535",
"0.7923277",
"0.7919492",
"0.79077744",
"0.78965235",
"0.7872327",
"0.78703564",
"0.78627205",
"0.784... | 0.81686556 | 5 |
Method: withdraw(float amount) Inputs: amount Returns: boolean Description: The method withdraw money from account by specific amount. After 10 withdrawals a fee of $2 is charged per transaction You may continue to withdraw an overdrawn account until the balance is below $100 | public boolean withdraw(float amount) {
if (amount > 0.0f) {
// KG: incorrect, last balance check should be >=
if (getState() == State.OPEN || (getState() == State.OVERDRAWN && balance > -100.0f)) {
balance = balance - amount;
_numWithdraws++;
if (_numWithdraws > 10)
balance = balance - 2.0f;
if (balance < 0.0f) {
setState(State.OVERDRAWN);
}
return true;
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean withdraw(double amount)\t{\n\t\tbalance = balance - amount;\n\t\tnumWithdraws++;\n\t\treturn true;\n\t}",
"void withdraw(double amount) {\n\t\tif (isSuspended()) {\n\t\t\tSystem.out.println(\"Account is suspended.\");\n\t\t\treturn;\n\t\t}\n\t\tif (amount <= 0) {\n\t\t\tSystem.out.println(\"Amount... | [
"0.8309425",
"0.82836944",
"0.82417655",
"0.81369406",
"0.8128343",
"0.8128343",
"0.8088404",
"0.80733466",
"0.80656266",
"0.8053424",
"0.80278367",
"0.80262196",
"0.80138135",
"0.80083585",
"0.80082846",
"0.7977118",
"0.79728484",
"0.79608",
"0.7910024",
"0.78748274",
"0.786... | 0.8001335 | 15 |
Method: toString() Inputs: Returns: String "checking" + name + balance Description: The method print the checking account infos. | public String toString() {
return "Checking: " + getName() + ": " + getBalance();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String toString() {\n return \"Account \" + name + \" has $\" + balance + \"and is \" + getState()\n + \"\\n\";\n }",
"public String toString(){\n\t\t return id+\" \"+name+\" \"+balance;\r\n\t}",
"@Override\n public String toString() {\n return \"accountNumber=\" + ac... | [
"0.736177",
"0.70406413",
"0.7015661",
"0.7007959",
"0.682725",
"0.682619",
"0.6757683",
"0.6605258",
"0.6588076",
"0.6553249",
"0.65204376",
"0.6509272",
"0.6481781",
"0.64502925",
"0.6444232",
"0.64140344",
"0.639537",
"0.6385209",
"0.6381522",
"0.6376466",
"0.63236225",
... | 0.8481232 | 0 |
Method: Checking(String name) Inputs: name Returns: Description: The method construct a new account with name. | private Checking(String name) {
super(name);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static Checking createChecking(String name) {\r\n return new Checking(name);\r\n }",
"public CheckingAccount() {\n\t\tsuper();\n\t}",
"public void createAccount() {\n System.out.println(\"Would you like to create a savings or checking account?\");\n String AccountRequest = input.next... | [
"0.71529853",
"0.6584641",
"0.6581029",
"0.65278465",
"0.6364974",
"0.63528603",
"0.6168796",
"0.6160827",
"0.61483985",
"0.61388403",
"0.60020727",
"0.5927323",
"0.5882661",
"0.5878589",
"0.58687204",
"0.58668005",
"0.5859831",
"0.583519",
"0.5834494",
"0.58342636",
"0.58339... | 0.6891508 | 1 |
ACTION_OPEN_DOCUMENT is the intent to choose a file via the system's file browser. | public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
// Filter to only show results that can be "opened", such as a
// file (as opposed to a list of contacts or timezones)
intent.addCategory(Intent.CATEGORY_OPENABLE);
// Filter to show only images, using the image MIME data type.
// it would be "*/*".
intent.setType("*/*");
startActivityForResult(intent, RESULT_PICK_IMAGEFILE);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void onClick(View view) {\n Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);\n intent.addCategory(Intent.CATEGORY_OPENABLE);\n //intent.setType(\"*/*\");\n intent.setType(\"text/plain\");\n startActivit... | [
"0.74914217",
"0.7461456",
"0.72752565",
"0.6934628",
"0.68600863",
"0.6830689",
"0.67444104",
"0.6692973",
"0.6648989",
"0.6529365",
"0.6528057",
"0.6489468",
"0.645808",
"0.6421533",
"0.6420513",
"0.6407779",
"0.63093805",
"0.62798136",
"0.6275589",
"0.6275327",
"0.6243832"... | 0.6634933 | 9 |
Creates a new button with the specified text. | public Button(final String textLabel) {
label = new Label(textLabel);
label.setHorizontalAlignment(HorizontalAlignment.CENTRE);
label.setVerticalAlignment(VerticalAlignment.MIDDLE);
label.setBackgroundColour(Color.GRAY);
label.setOpaque(true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static JButton createButton(String text) {\n return new JButton(text);\n }",
"Button createButton();",
"public static JButton createLabelButton(String text) {\n JButton but = createButton(text);\n but.setBorderPainted(false);\n but.setHorizontalAlignment(SwingConstants.LEF... | [
"0.8523499",
"0.7417037",
"0.7413243",
"0.7258334",
"0.72308975",
"0.7219959",
"0.7108022",
"0.70965254",
"0.70745504",
"0.7015822",
"0.6901245",
"0.6873059",
"0.6850135",
"0.68055147",
"0.67953014",
"0.6755523",
"0.6746289",
"0.66521776",
"0.65828085",
"0.6575389",
"0.655521... | 0.6590557 | 18 |
Gets the button's bounds. | public final Rectangle getBounds() {
return label.getBounds();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Rectangle getBounds();",
"public Rectangle getBounds() {\n\t\t\treturn new Rectangle(x_pos, y_pos, getIconWidth(), getIconHeight());\n\t\t}",
"public Rectangle getBounds() {\n return new Rectangle(x, y, 32, 32);\n }",
"Rectangle getBounds() {\n return new Rectangle(getLocation(), getSize());... | [
"0.709175",
"0.7066095",
"0.69944704",
"0.6987175",
"0.69751394",
"0.6948416",
"0.6897127",
"0.68583006",
"0.6854329",
"0.6854329",
"0.68488073",
"0.6837972",
"0.6833667",
"0.6816157",
"0.68152434",
"0.6803569",
"0.6784883",
"0.677238",
"0.67626077",
"0.67413414",
"0.67368567... | 0.70195895 | 2 |
Gets the label that acts as the backing for this button. | public final Label getLabel() {
return label;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String label() {\n return this.label;\n }",
"public String getLabel() {\r\n return label;\r\n }",
"public String getLabel() {\r\n return label;\r\n }",
"public String getLabel() {\r\n return label;\r\n }",
"public String getLabel()\n {\n return label;\n... | [
"0.78729427",
"0.78215414",
"0.78215414",
"0.78215414",
"0.7812738",
"0.78003514",
"0.78003514",
"0.77982616",
"0.77982616",
"0.77982616",
"0.77982616",
"0.77976763",
"0.77976763",
"0.77976763",
"0.7791025",
"0.7772603",
"0.7770061",
"0.77677864",
"0.77643394",
"0.7760464",
"... | 0.74899364 | 49 |
Renders the button to the specified graphics context. | public final void render(final Graphics2D g) {
label.render(g);
g.setStroke(new BasicStroke(BORDER_WIDTH));
g.setColor(Color.LIGHT_GRAY);
g.draw(getBounds());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\t\tpublic void renderButton(int mouseX, int mouseY){\n\t\t}",
"@Override\n\tpublic void paint() {\n\t\tSystem.out.println(\"Painting an OSX Button!\");\n\t}",
"public JButton drawButton ()\n {\n\n if (isAlive())\n {\n button.setBackground(ALIVE_COLOUR);\n }\n ... | [
"0.67164004",
"0.62338465",
"0.6063642",
"0.604121",
"0.59094733",
"0.5906833",
"0.5897239",
"0.58962554",
"0.58868736",
"0.5863795",
"0.586362",
"0.5828158",
"0.5806709",
"0.5784035",
"0.57762355",
"0.5763939",
"0.57625",
"0.5752352",
"0.57188636",
"0.5705843",
"0.5705122",
... | 0.0 | -1 |
Creates an instance from the raw database value | SaldoLinks(String rawValue) {
if (StringUtils.isEmpty(rawValue)) {
links = Collections.emptyList();
return;
}
String[] rawLinks = rawValue.split(Utils.ASTERISK_SEPARATOR);
links = new ArrayList<>();
for (String rawLink : rawLinks) {
if (StringUtils.hasLength(rawLink)) {
SaldoLink saldoLink = new SaldoLink(rawLink);
if (saldoLink.hasValidLinks()) {
links.add(saldoLink);
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract DataType<T> newInstance(String format);",
"FromValues createFromValues();",
"public DBRecord(String encodedForm)\n\t{\n\t\tselected = false;\n\t\tbindings = new ChunkList<DBBinding>();\n\t\tloadFromEncodedForm(encodedForm);\n\t}",
"private DatabaseType(Integer value, String displayValue, Stri... | [
"0.570774",
"0.5635735",
"0.5613004",
"0.5487784",
"0.5455933",
"0.5406324",
"0.53546077",
"0.5249198",
"0.52491367",
"0.52056086",
"0.52032167",
"0.50951123",
"0.5084066",
"0.5056864",
"0.50568503",
"0.50565743",
"0.50478107",
"0.5029601",
"0.5009988",
"0.5006931",
"0.499498... | 0.0 | -1 |
Gets the saldo links | @NonNull List<SaldoLink> getLinks() {
return links;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"List<ProductLink> links();",
"protected java.util.Vector _getLinks() {\n\t\tjava.util.Vector links = new java.util.Vector();\n\t\tlinks.add(getLeaseTaskStartsLink());\n\t\tlinks.add(getLeaseRulesLink());\n\t\treturn links;\n\t}",
"public List<String> linkTexts()\n\t{\n\t\t\n\t\tList<String> links=new ArrayList... | [
"0.5915045",
"0.57713085",
"0.57363516",
"0.57127076",
"0.565244",
"0.5550021",
"0.55380577",
"0.54876024",
"0.5483742",
"0.54689723",
"0.542238",
"0.5400844",
"0.5399179",
"0.537868",
"0.5342584",
"0.5341203",
"0.5318908",
"0.53136474",
"0.52750343",
"0.5261221",
"0.5258214"... | 0.6599121 | 0 |
public PageBean getUserList(int page); | public void addUser(UserModel user); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List<Object> retrievePagingList(PageBean pageBean) ;",
"public PageList<User> getUserPageList(User user, int pageSize, int pageNum) throws DataAccessException;",
"Set<String> getUsers(String page);",
"@Override\n\tpublic List<User> listByPage(int page) throws Exception {\n\t\treturn null;\n\t}",
"pu... | [
"0.8309894",
"0.8044249",
"0.7605636",
"0.7530972",
"0.73640233",
"0.7359319",
"0.7166331",
"0.7157256",
"0.7152412",
"0.71431714",
"0.7128543",
"0.70795155",
"0.7054667",
"0.7017053",
"0.6968034",
"0.69652337",
"0.69488186",
"0.69351906",
"0.69064534",
"0.6874906",
"0.683545... | 0.0 | -1 |
Tests the constructor of the professor class with two parameters passed in order, those parameters will be be first name and last name | @Test
public void testProfessorConstructor2params(){
String firstname = "Steven";
String lastName = "Beaty";
Professor testProfessor = new Professor(firstname, lastName);
Assert.assertEquals("Steven", testProfessor.getFirstName());
Assert.assertEquals("Beaty", testProfessor.getLastName());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n\tpublic void testProfessorConstructor3Params(){\n\t\tString firstname = \"Dennis\";\n\t\tString lastName = \"Ritchie\";\n\t\tlong id = 0451;\n\t\tProfessor testProfessor = new Professor(firstname, lastName, id);\n\t\tAssert.assertEquals(\"Dennis\", testProfessor.getFirstName());\n\t\tAssert.assertEquals(\"... | [
"0.78216773",
"0.74112713",
"0.7244772",
"0.6867716",
"0.67882067",
"0.6758318",
"0.6723482",
"0.66895455",
"0.6626587",
"0.6609892",
"0.6479147",
"0.6463736",
"0.641069",
"0.63588744",
"0.633615",
"0.629953",
"0.625933",
"0.6245996",
"0.6231266",
"0.6211854",
"0.61801535",
... | 0.84673333 | 0 |
Tests the constructor of the profeessor class with three parameteres passed in order, those parameters will be first name, last name, and the professor's unique ID number | @Test
public void testProfessorConstructor3Params(){
String firstname = "Dennis";
String lastName = "Ritchie";
long id = 0451;
Professor testProfessor = new Professor(firstname, lastName, id);
Assert.assertEquals("Dennis", testProfessor.getFirstName());
Assert.assertEquals("Ritchie", testProfessor.getLastName());
Assert.assertEquals(Long.valueOf(0451), testProfessor.getId());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n\tpublic void testProfessorConstructor2params(){\n\t\tString firstname = \"Steven\";\n\t\tString lastName = \"Beaty\";\n\t\tProfessor testProfessor = new Professor(firstname, lastName);\n\t\tAssert.assertEquals(\"Steven\", testProfessor.getFirstName());\n\t\tAssert.assertEquals(\"Beaty\", testProfessor.getL... | [
"0.7896998",
"0.7213504",
"0.71340317",
"0.7102414",
"0.7039782",
"0.68926734",
"0.6579491",
"0.6307294",
"0.6305898",
"0.6167641",
"0.6141542",
"0.6099564",
"0.6096472",
"0.60818607",
"0.60700786",
"0.60663533",
"0.60593265",
"0.6056173",
"0.59822786",
"0.59813577",
"0.59764... | 0.86684316 | 0 |
Tests the setter and getter for the first name field of the professor class | @Test
public void testProfeessorFirstName(){
String firstName = "Linus";
testProfessor.setFirstName(firstName);
Assert.assertEquals("Linus", testProfessor.getFirstName());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n\tpublic void testProfeessorLastName(){\n\t\tString lastName = \"Torvalds\";\n\t\ttestProfessor.setLastName(lastName);\n\t\tAssert.assertEquals(\"Torvalds\", testProfessor.getLastName());\n\t}",
"@Test\r\n\tpublic void testSetGetFirstNameValid() {\r\n\t\tDoctor doctor = new Doctor();\r\n\t\tdoctor.setFirs... | [
"0.7829428",
"0.7569413",
"0.74313366",
"0.74073195",
"0.7375787",
"0.73534995",
"0.7351261",
"0.73009634",
"0.7284204",
"0.72835916",
"0.72835916",
"0.72775954",
"0.7264305",
"0.7213766",
"0.718488",
"0.71747845",
"0.71598905",
"0.71572363",
"0.71552247",
"0.71278477",
"0.71... | 0.8456519 | 0 |
Tests the setter and getter for the last name of the porfessor class | @Test
public void testProfeessorLastName(){
String lastName = "Torvalds";
testProfessor.setLastName(lastName);
Assert.assertEquals("Torvalds", testProfessor.getLastName());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setLastName() {\n\t}",
"public void setLastname(String lastname);",
"public void setLastName(String lastName);",
"@Test\n\tpublic void testProfeessorFirstName(){\n\t\tString firstName = \"Linus\";\n\t\ttestProfessor.setFirstName(firstName);\n\t\tAssert.assertEquals(\"Linus\", testProfessor.getFir... | [
"0.7260423",
"0.7222163",
"0.7204488",
"0.7180536",
"0.71419233",
"0.71301895",
"0.7128409",
"0.7105196",
"0.70208293",
"0.70094866",
"0.69997734",
"0.6991264",
"0.69620305",
"0.6961057",
"0.6956177",
"0.6879562",
"0.68557495",
"0.6839731",
"0.6810423",
"0.6810254",
"0.678374... | 0.8050881 | 0 |
Tests the settere and getter for the unique ID number of the professor class | @Test
public void testProfessorId(){
long id = 42;
testProfessor.setId(id);
Assert.assertEquals(Long.valueOf(42), testProfessor.getId());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\r\n public void testSetID() {\r\n user = userFactory.getUser(\"C\");\r\n user.setID(233);\r\n assertEquals(233, user.getID());\r\n }",
"public Professor(String name, int id)\r\n {\r\n this.name = name;\r\n this.id = id;\r\n }",
"public int getID(){\n return... | [
"0.64526963",
"0.6355594",
"0.63031965",
"0.62350595",
"0.6206025",
"0.6184765",
"0.61646104",
"0.61609405",
"0.61580503",
"0.61505884",
"0.6136683",
"0.61275953",
"0.6119782",
"0.6115594",
"0.61027014",
"0.6098808",
"0.6097336",
"0.6091838",
"0.60364145",
"0.603583",
"0.6025... | 0.75828016 | 0 |
Affiche une liste pour selectionner un client | public void menu() {
super.menu();
for(JCheckBox cb : arrayCompo){
cb.setPreferredSize(new Dimension(largeur-30, hauteur));
gbc.gridy++;
pan.add(cb, gbc);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic List<Client> selectclient() {\n\t\tList<Client> list=this.getSqlSessionTemplate().selectList(changToNameSpace(\"selectclient\"));\r\n\t\treturn list;\r\n\t}",
"private void listaClient() {\n\t\t\r\n\t\tthis.listaClient.add(cliente);\r\n\t}",
"@Override\n\t\tpublic List<Client> listeClient... | [
"0.7761886",
"0.7649047",
"0.7633005",
"0.7539799",
"0.74965215",
"0.74473405",
"0.74270976",
"0.7372741",
"0.7327954",
"0.7319815",
"0.72974324",
"0.7111787",
"0.7080098",
"0.7057707",
"0.7011923",
"0.69533443",
"0.6930349",
"0.69140506",
"0.68914014",
"0.68747884",
"0.68056... | 0.0 | -1 |
Use a unique transition name so this item can be used as a shared element when transitioning to the album details screen. | public void bind(Album album) {
ViewCompat.setTransitionName(container, album.title);
container.setOnClickListener(v -> listener.onAlbumClicked(container, album));
albumImage.setImageResource(album.cover);
albumTitle.setText(album.title);
albumArtist.setText(album.artist);
if (albumDuration != null) {
albumDuration.setText(album.duration);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void onClick(View view) {\n\n Pair<View, String> pair = Pair.create((View) holder.thumbnail, \"name_transition\");\n\n ActivityOptionsCompat options;\n Activity act = (AppCompatActivity) mContext;\n options = ActivityOptionsC... | [
"0.58788735",
"0.5595587",
"0.5432241",
"0.5429745",
"0.542295",
"0.5356016",
"0.5356016",
"0.5342627",
"0.5212654",
"0.5190495",
"0.51616216",
"0.5160907",
"0.5147563",
"0.51424533",
"0.511979",
"0.5113545",
"0.50978214",
"0.5096039",
"0.50901526",
"0.50887245",
"0.5075287",... | 0.0 | -1 |
onCreat > ergebnisse_layout / layout wird gestartet, EditText, Buttons und co. werden zugeordnet. | @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.minilotto_layout);
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
// Button zur Abgabe des Tipps
ausfuehren = (Button) findViewById(R.id.btnAusfuehren);
// Button zum Aktualisieren der Daten
refresh = (Button) findViewById(R.id.refresh);
// 3 festzulegende Lottozahlen (User)
z1 = (EditText) findViewById(R.id.editZahl1);
z2 = (EditText) findViewById(R.id.editZahl2);
z3 = (EditText) findViewById(R.id.editZahl3);
information = (TextView) findViewById(R.id.textView2);
ziehung = (TextView) findViewById(R.id.ziehung);
ergebnis = (TextView) findViewById(R.id.txtErgebnis_zeigen);
information2 = (TextView) findViewById(R.id.textView22);
auspackenLoginSpielInformationen("");
// ------------------------------------------------------------------------ onClick -> ausfuehren
/*
* Bei Klick auf Ausführen wird geschaut ob 1) alle EdiText Felder ausgefüllt sind -> Sonst Fehlermeldung
* 2) Ob der Spieler bereits auf Ausführen gedrückt hat -> Sonst Fehlermeldung
* 3) Ob die Tippabgabe durch Ausführen durch den letzten Spieler der Spielsitzung stattfand
* da erst dann die Gewinnerermittlung durchgeführt wird
*
*/
ausfuehren.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (pruefenObAlleEditTextAusgefuelltWurden()==true)
{
if (einmalAusfuehrenDruecken==false){
randomToFindTheRightNumber();
if(letzterSpieler()==true)
{
HashMap GewinnerID = new HashMap();
GewinnerID= gewinnerSuchen(); //###############################################
if (GewinnerID.get("GewinnerMenge").equals(0)){information.setText("Es gibt keinen Gewinner!");}
else
{
for (int i=1; i <= (Integer.valueOf(GewinnerID.get("GewinnerMenge").toString()));i++)
{
gewinnerNotiz(Integer.valueOf(GewinnerID.get("Gewinner"+i).toString()));
}
}
}
else {information.setText("Informationen der Mitspieler");}
}
else {fehlermeldung("Es darf nur einmal getippt werden!");}
}
else {fehlermeldung("Bitte alle Felder ausfüllen!");}
}
});
// ------------------------------------------------------------------------ onClick -> refresh
/*
* Durch Drücken der refresh-Taste aktualisieren sich die Informationen.
*/
refresh.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
refresh.refreshDrawableState();
Intent callerIntent = getIntent();
Bundle packageFromSpiel = callerIntent.getBundleExtra("SpielInformationen");
if (ActuellSpieler_Gleich_MaxSpieler(packageFromSpiel.getInt("ID_Spiel"))==true)//########################################################
{
String emailLesen=Email_Lesen(String.valueOf(packageFromSpiel.getInt("ID_Spiel")));
auspackenLoginSpielInformationen(emailLesen);
ziehung.setText(getErgebnisDerSpielID());
}
else{
auspackenLoginSpielInformationen("");
ergebnis.setText(vorratErgebnisString);
}
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){\n View layout = inflater.inflate(R.layout.setup_chatroom_dialog, container, false);\n Button setupButton = (Button)layout.findViewById(R.id.setup_chatRoom_dialog_setup_button);\n B... | [
"0.72285056",
"0.72015",
"0.71961343",
"0.692603",
"0.68704116",
"0.68521684",
"0.68508977",
"0.68301797",
"0.6810782",
"0.67902374",
"0.67529094",
"0.67120576",
"0.66931206",
"0.6670156",
"0.6669707",
"0.6648241",
"0.6632536",
"0.6625245",
"0.6618192",
"0.66178495",
"0.66125... | 0.0 | -1 |
gewinnerNotiz(int LoginID) / Wenn der Gewinner ermittelt wurde, wird ihm eine Nachricht hinterlassen + der Gewinn auf sein Konto | public void gewinnerNotiz(int LoginID)
{
this.gewinnerGefunden = true;
String Logname="",Pass= "",Email="";
double Bank_Double= 0;
Intent callerIntent = getIntent();
Bundle packageFromSpiel = callerIntent.getBundleExtra("SpielInformationen");
try
{
final String METHOD_NAME="getListLogin";
final String SOAP_ACTION=NAMESPACE+METHOD_NAME;
SoapObject request=new SoapObject(NAMESPACE, METHOD_NAME);
SoapSerializationEnvelope envelope= new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet=true;
envelope.setOutputSoapObject(request);
MarshalFloat marshal=new MarshalFloat();
marshal.register(envelope);
HttpTransportSE androidHttpTransport= new HttpTransportSE(URL);
androidHttpTransport.call(SOAP_ACTION, envelope);
SoapObject soapArray1=(SoapObject) envelope.getResponse();
for(int i=0; i<soapArray1.getPropertyCount(); i++)
{
SoapObject soapItem =(SoapObject) soapArray1.getProperty(i);
if (LoginID == Integer.valueOf(soapItem.getProperty("LoginID").toString()))
{
Logname=soapItem.getProperty("Username").toString().trim();
Pass=soapItem.getProperty("Passwords").toString().trim();
Email=soapItem.getProperty("Email").toString().trim();
if (Email.contains("#"))
{
Email = Email.replace((Email.substring(Email.indexOf("#")))," ").trim();
}
else{}
Email=(Email+"#"+packageFromSpiel.getInt("ID_Spiel")+"#"+" Mit "+
(packageFromSpiel.getDouble("EinSatzGeld_DoubleWert")*
packageFromSpiel.getInt("MaxSpieler"))).trim();
String B =soapItem.getProperty("Bank").toString().trim();
Bank_Double = Double.valueOf(B) + (packageFromSpiel.getDouble("EinSatzGeld_DoubleWert")*packageFromSpiel.getInt("MaxSpieler"));
}
}
updateLogin(LoginID,Logname,Pass,Email,Bank_Double);
}
catch (Exception ex)
{
fehlermeldung("Fehler bei der Internetverbindung");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public \tStringBuilder vergleichVorratErgebnisErgebnis() // result is a String of LoginID, these win this Game\r\n\t{\r\n\t\tIntent callerIntent = getIntent(); \r\n\t\tBundle packageFromSpiel = callerIntent.getBundleExtra(\"SpielInformationen\");\r\n\t\t\r\n\t\t// implement Array VorrErg and LogID \r\n\t\tString [... | [
"0.5685169",
"0.5644331",
"0.5587667",
"0.5535067",
"0.5515837",
"0.5480575",
"0.5468759",
"0.54355496",
"0.54316634",
"0.53858036",
"0.53393763",
"0.53392345",
"0.5315858",
"0.5285093",
"0.52812034",
"0.52691126",
"0.5262336",
"0.5242058",
"0.5238036",
"0.522923",
"0.5197955... | 0.642126 | 0 |
auspackenLoginSpielInformationen() / AUSPACKEN der LoginSpielInformationen | public void auspackenLoginSpielInformationen(String Str)
{
Intent callerIntent = getIntent();
Bundle packageFromLogin = callerIntent.getBundleExtra("LogInformationen");
Bundle packageFromSpiel = callerIntent.getBundleExtra("SpielInformationen");
information2.setText("\n Deine User ID:\n "+packageFromLogin.getInt("ID_Login")
+" -- "+packageFromLogin.getString("Username_Login")
// + "\t Spiel_ID: "+packageFromSpiel.getInt("ID_Spiel")
+"\n\n Aktuelle Spieler = "+packageFromSpiel.getInt("ActuellSpieler")
+"\n\n Max. Spieler= "+packageFromSpiel.getInt("MaxSpieler")
+"\n\n Geldeinsatz= "+packageFromSpiel.getDouble("EinSatzGeld_DoubleWert")
+"\n\n Pot= "+(packageFromSpiel.getDouble("EinSatzGeld_DoubleWert")*packageFromSpiel.getInt("MaxSpieler"))
+""+Str);
information.setText(" "+String.valueOf(ruckgabeVonUsernameVorratErgebnis())+"\n"+Str);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public tela_GerencLogin() {\n initComponents();\n lb_NomeLogin.setText(Sessao.getLogin());\n lb_Id.setText(Integer.toString(Sessao.getId()));\n \n }",
"Conseiller obtenirConseillerParLogin(String login);",
"private void loadLogin(){\n }",
"String getLoginapiavgrtt();",
"pu... | [
"0.6475373",
"0.62436867",
"0.6226275",
"0.6214796",
"0.6195319",
"0.61560667",
"0.6153273",
"0.6137455",
"0.6124847",
"0.60880935",
"0.6087765",
"0.6043154",
"0.6025931",
"0.6012058",
"0.60034233",
"0.5998941",
"0.599206",
"0.5986688",
"0.59501445",
"0.59227806",
"0.5913299"... | 0.6557404 | 0 |
fehlermeldung( String fMeldung) / Generierung der Fehlermeldung | public void fehlermeldung(String fMeldung)
{
AlertDialog.Builder b = new AlertDialog.Builder(SpielLottoActivity.this);
b.setMessage(fMeldung);
b.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
b.create().show();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void sendeFehlerHelo();",
"public DataDiFineTirocinioNonValidaException(String messaggio) {\r\n super(messaggio);\r\n }",
"public void estiloError() {\r\n /**Bea y Jose**/\r\n\t}",
"public void InvalidFormat();",
"public void falschesSpiel(SpielException e);",
"String errorMessage();",
"... | [
"0.7095468",
"0.6282489",
"0.6068008",
"0.6043774",
"0.60182464",
"0.5960773",
"0.589706",
"0.58638614",
"0.58613884",
"0.58470565",
"0.58470565",
"0.583377",
"0.58103",
"0.57909954",
"0.5755275",
"0.5751663",
"0.57233363",
"0.5706235",
"0.5684067",
"0.5679111",
"0.5652508",
... | 0.67663693 | 1 |
vergleichVorratErgebnisErgebnis() / Vergleich der abgegebenen 3 Zahlen mit den (random/zufall) generierten 3 Lotto Zahlen | public StringBuilder vergleichVorratErgebnisErgebnis() // result is a String of LoginID, these win this Game
{
Intent callerIntent = getIntent();
Bundle packageFromSpiel = callerIntent.getBundleExtra("SpielInformationen");
// implement Array VorrErg and LogID
String [] VorErg = new String [packageFromSpiel.getInt("MaxSpieler")+5];
int [] LogID = new int [packageFromSpiel.getInt("MaxSpieler")+5];
String Ergebnis_to_Compare = getErgebnisDerSpielID();
Object [] array_VorErg = getListHatVorratErgebnisGleicheSpielID().toArray();
for (int i=0; i<array_VorErg.length;i++)
{
// split elements in array_VorrErg to 2 new Array
String [] arr = array_VorErg[i].toString().trim().split(" ");
LogID[i]= Integer.parseInt(arr [0]); //##################################################
VorErg[i] = arr[1];
}
StringBuilder List_IDGewinner = new StringBuilder();
for (int j=0; j<packageFromSpiel.getInt("MaxSpieler"); j++)
{
if((Ergebnis_to_Compare.trim()).equals(VorErg[j].trim()))
{
List_IDGewinner.append(LogID[j]+" ");
}
else {continue;}
}
return List_IDGewinner ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void maakNieuweDoolhof()\n {\n /*hzs: hoek zonder schat\n hms: hoek met schat\n r: recht stuk\n t: T-kruispunt met schat*/\n //vaste aantallen vakjes\n int hzs = 10, hms = 6, r = 11, t = 6;\n List<String> schatten = sch.getSchatten();\n List<String>... | [
"0.65212077",
"0.62500596",
"0.6136971",
"0.60467845",
"0.60422534",
"0.60000044",
"0.595319",
"0.59356624",
"0.57566226",
"0.5738803",
"0.5729505",
"0.5698981",
"0.5687125",
"0.56853676",
"0.56844854",
"0.5670407",
"0.56552285",
"0.56239676",
"0.56153935",
"0.5596881",
"0.55... | 0.0 | -1 |
insertSpiel() / Spieldaten in Database einpflegen | public void insertSpiel ()
{
Intent callerIntent = getIntent();
Bundle packageFromSpiel = callerIntent.getBundleExtra("SpielInformationen");
double y = (packageFromSpiel.getInt("MaxSpieler")*packageFromSpiel.getDouble("EinSatzGeld_DoubleWert"));
try
{
//Toast.makeText(this, "Insert_Spiel", Toast.LENGTH_LONG).show();
final String METHOD_NAME = "insertSpiel";
final String SOAP_ACTION = NAMESPACE + METHOD_NAME;
SoapObject request=new SoapObject(NAMESPACE, METHOD_NAME);
SoapObject newSpieler=new SoapObject(NAMESPACE, "inputspiel");
newSpieler.addProperty("Schwerrate",packageFromSpiel.getInt("SchwerRate"));
newSpieler.addProperty("MaxSpieler",packageFromSpiel.getInt("MaxSpieler"));
newSpieler.addProperty("ActuellSpieler",packageFromSpiel.getInt("ActuellSpieler"));
newSpieler.addProperty("GeldPol",BigDecimal.valueOf(packageFromSpiel.getDouble("EinSatzGeld_DoubleWert")));
newSpieler.addProperty("GeldSum",BigDecimal.valueOf(y));
request.addSoapObject(newSpieler);
SoapSerializationEnvelope envelope=new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet=true;
envelope.setOutputSoapObject(request);
MarshalFloat marshal=new MarshalFloat();
marshal.register(envelope);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.call(SOAP_ACTION, envelope);
SoapPrimitive soapPrimitive= (SoapPrimitive)envelope.getResponse();
/*
int ret=Integer.parseInt(soapPrimitive.toString());
if(ret<=0)
{Toast.makeText(this, "Insert Spiel fail", Toast.LENGTH_LONG).show();}
else{Toast.makeText(this, "Insert Spiel Successful", Toast.LENGTH_LONG).show();}
*/
}
catch (Exception ex)
{
Toast.makeText(this, "Insert Spiel Fehler Exception", Toast.LENGTH_LONG).show();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void insert() throws SQLException;",
"public void insere(Pessoa pessoa){\n\t\tdb.save(pessoa);\n\t}",
"public void processInsertar() {\n }",
"public void insert() {\n\t\tSession session = DBManager.getSession();\n\t\tsession.beginTransaction();\n\t\tsession.save(this);\n\t\tsession.getTransaction()... | [
"0.7068765",
"0.6964535",
"0.68319017",
"0.6828228",
"0.6753672",
"0.6740214",
"0.6734321",
"0.67267114",
"0.6715156",
"0.67085385",
"0.66968435",
"0.6691689",
"0.66777366",
"0.66776496",
"0.6677116",
"0.66396",
"0.6613564",
"0.6611968",
"0.6580825",
"0.6562201",
"0.6560848",... | 0.0 | -1 |
insertErgebnis() / Random/Lotto Ergebnis in Database einpflegen | public void insertErgebnis()
{
Intent callerIntent = getIntent();
Bundle packageFromSpiel = callerIntent.getBundleExtra("SpielInformationen");
try {
//Toast.makeText(this, "Insert_Ergebnis",Toast.LENGTH_LONG).show();
final String METHOD_NAME = "insertErgebnis";
final String SOAP_ACTION = NAMESPACE + METHOD_NAME;
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
SoapObject newErgebnis = new SoapObject(NAMESPACE, "inputErgebnis");
newErgebnis.addProperty("Ergebnis",this.ergebnisString);
newErgebnis.addProperty("SpielID", (packageFromSpiel.getInt("MaxSpielID")+1));
request.addSoapObject(newErgebnis);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
MarshalFloat marshal = new MarshalFloat();
marshal.register(envelope);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.call(SOAP_ACTION, envelope);
SoapPrimitive soapPrimitive = (SoapPrimitive) envelope.getResponse();
/*
int ret = Integer.parseInt(soapPrimitive.toString());
if (ret <= 0) {
Toast.makeText(this, "Insert Ergebnis fail", Toast.LENGTH_LONG).show();
} else {
Toast.makeText(this, "Insert Ergebnis Successful",Toast.LENGTH_LONG).show();
}
*/
} catch (Exception ex) {
Toast.makeText(this, "Insert Ergebnis Fehler Exception",
Toast.LENGTH_LONG).show();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void addCertainRow(String username, String num, String ISBN)\n {\n String insertStr;\n int tempt= (int) (Math.random()*500);\n String random=Integer.toString(tempt);\n try{\n\n insertStr=\"INSERT IGNORE INTO borrowlist (username... | [
"0.6886203",
"0.6816657",
"0.68139523",
"0.6704576",
"0.66659826",
"0.66318125",
"0.66154593",
"0.65952265",
"0.6540003",
"0.6539991",
"0.6534718",
"0.6527967",
"0.6523382",
"0.6489587",
"0.6477579",
"0.6476779",
"0.6473668",
"0.6461057",
"0.64571226",
"0.6436011",
"0.6410801... | 0.0 | -1 |
insertVorratErgebnis() / Abgebener Tipp wird in Database eingepflegt | public void insertVorratErgebnis()
{
Intent callerIntent = getIntent();
Bundle packageFromLogin = callerIntent.getBundleExtra("LogInformationen");
Bundle packageFromSpiel = callerIntent.getBundleExtra("SpielInformationen");
try {
//Toast.makeText(this, "Insert_VorratErgebnis",Toast.LENGTH_LONG).show();
final String METHOD_NAME = "insertVorrateEgebnis";
final String SOAP_ACTION = NAMESPACE + METHOD_NAME;
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
SoapObject newErgebnis = new SoapObject(NAMESPACE, "inputvorratergebnis");
newErgebnis.addProperty("LoginID",packageFromLogin.getInt("ID_Login"));
if (pruefenObSpielerSpielHerstellerIst()==true){
newErgebnis.addProperty("SpielID", (packageFromSpiel.getInt("MaxSpielID")+1));}
else {newErgebnis.addProperty("SpielID", packageFromSpiel.getInt("ID_Spiel"));}
newErgebnis.addProperty("VorratErgebnis",this.vorratErgebnisString);
request.addSoapObject(newErgebnis);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
MarshalFloat marshal = new MarshalFloat();
marshal.register(envelope);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.call(SOAP_ACTION, envelope);
SoapPrimitive soapPrimitive = (SoapPrimitive) envelope.getResponse();
/*
int ret = Integer.parseInt(soapPrimitive.toString());
if (ret <= 0) {
Toast.makeText(this, "Insert_VorratErgebnis fail", Toast.LENGTH_LONG).show();
} else {
Toast.makeText(this, "Insert_VorratErgebnis Successful",Toast.LENGTH_LONG).show();
}
*/
} catch (Exception ex) {
Toast.makeText(this, "Insert_VorratErgebnis Fehler Exception",
Toast.LENGTH_LONG).show();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void insert(Object objekt) throws SQLException {\r\n\t\t \r\n\t\tPomagaloVO ul = (PomagaloVO) objekt;\r\n\r\n\t\tif (ul == null)\r\n\t\t\tthrow new SQLException(\"Insert \" + tablica\r\n\t\t\t\t\t+ \", ulazna vrijednost je null!\");\r\n\t\t \r\n\t\tConnection conn = null;\r\n\t\tPreparedStatement ps = null;... | [
"0.72767514",
"0.6926748",
"0.68923396",
"0.6886399",
"0.6865576",
"0.68541497",
"0.68478084",
"0.6817843",
"0.67962664",
"0.67863184",
"0.6745195",
"0.67298573",
"0.6713582",
"0.6693816",
"0.66855097",
"0.6683048",
"0.66566014",
"0.66452944",
"0.6643773",
"0.66407406",
"0.66... | 0.6233937 | 79 |
updateLogin() / Login Informationen werden aktualisiert | public void updateLogin()
{
Intent callerIntent = getIntent();
Bundle packageFromLogin = callerIntent.getBundleExtra("LogInformationen");
Bundle packageFromSpiel = callerIntent.getBundleExtra("SpielInformationen");
try
{
final String METHOD_NAME="UpdateSpieler";
final String SOAP_ACTION=NAMESPACE+METHOD_NAME;
SoapObject request=new SoapObject(NAMESPACE, METHOD_NAME);
SoapObject newSpieler=new SoapObject(NAMESPACE, "_login");
newSpieler.addProperty("LoginID",packageFromLogin.getInt("ID_Login"));
newSpieler.addProperty("Username",packageFromLogin.getString("Username_Login"));
newSpieler.addProperty("Passwords",packageFromLogin.getString("Passwords_Login"));
newSpieler.addProperty("Email",packageFromLogin.getString("Email_Login"));
newSpieler.addProperty("Bank",(packageFromLogin.getDouble("Bank_Login")-packageFromSpiel.getDouble("EinSatzGeld_DoubleWert")));
request.addSoapObject(newSpieler);
SoapSerializationEnvelope envelope= new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet=true;
envelope.setOutputSoapObject(request);
MarshalFloat marshal=new MarshalFloat();
marshal.register(envelope);
//tạo đối tượng HttpTransportSE
HttpTransportSE androidHttpTransport= new HttpTransportSE(URL);
androidHttpTransport.call(SOAP_ACTION, envelope);
SoapPrimitive soapPrimitive= (SoapPrimitive) envelope.getResponse();
//Toast.makeText(this, soapPrimitive.toString(), Toast.LENGTH_LONG).show();
}
catch(Exception e)
{
Toast.makeText(this, "Fehler Login Update", Toast.LENGTH_LONG).show();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void updateLastLogin()\n throws Exception;",
"public void update() {\n user.setNewPassword(newPassword.getText().toString());\n user.setPassword(password.getText().toString());\n reauthenticate();\n }",
"Login(String strLogin)\n {\n \tsetLogin(strLogin);\n }",
"public ... | [
"0.77287865",
"0.7098448",
"0.7057441",
"0.70171297",
"0.6931892",
"0.6913683",
"0.6884264",
"0.685628",
"0.6831704",
"0.6813637",
"0.6791808",
"0.6789933",
"0.677087",
"0.67473793",
"0.67007303",
"0.6690026",
"0.66894114",
"0.6684129",
"0.66734546",
"0.6656583",
"0.6654687",... | 0.659548 | 26 |
updateSpiel() / Spiel Informationen werden aktualisiert | public void updateSpiel()
{
Intent callerIntent = getIntent();
Bundle packageFromSpiel = callerIntent.getBundleExtra("SpielInformationen");
try
{
final String METHOD_NAME="UpdateSpiel";
final String SOAP_ACTION=NAMESPACE+METHOD_NAME;
SoapObject request=new SoapObject(NAMESPACE, METHOD_NAME);
SoapObject newSpiel=new SoapObject(NAMESPACE, "_spiel");
newSpiel.addProperty("SpielID",packageFromSpiel.getInt("ID_Spiel"));
newSpiel.addProperty("Schwerrate",packageFromSpiel.getInt("SchwerRate"));
newSpiel.addProperty("MaxSpieler",packageFromSpiel.getInt("MaxSpieler"));
newSpiel.addProperty("ActuellSpieler",packageFromSpiel.getInt("ActuellSpieler"));
newSpiel.addProperty("GeldPol",packageFromSpiel.getDouble("EinSatzGeld_DoubleWert"));
newSpiel.addProperty("GeldSum",(packageFromSpiel.getDouble("EinSatzGeld_DoubleWert"))*packageFromSpiel.getInt("MaxSpieler"));
request.addSoapObject(newSpiel);
SoapSerializationEnvelope envelope= new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet=true;
envelope.setOutputSoapObject(request);
MarshalFloat marshal=new MarshalFloat();
marshal.register(envelope);
HttpTransportSE androidHttpTransport= new HttpTransportSE(URL);
androidHttpTransport.call(SOAP_ACTION, envelope);
SoapPrimitive soapPrimitive= (SoapPrimitive) envelope.getResponse();
//Toast.makeText(this, soapPrimitive.toString(), Toast.LENGTH_LONG).show();
}
catch(Exception e)
{
Toast.makeText(this, "Fehler Spiel Update", Toast.LENGTH_LONG).show();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void update(){\n addNotificaciones(nombre + \" \" + this.sucursal.descuento());\n mostrarNotificaciones();\n notificaciones.clear();\n }",
"@Override\n\tpublic void updatePais(Pais elemento) {\n\t\tgetSession().update(elemento);\n\t\t\n\t}",
"Software update( Software s );",
"void upda... | [
"0.6451087",
"0.6321237",
"0.6234529",
"0.6218089",
"0.616386",
"0.61597854",
"0.61573935",
"0.6120263",
"0.61121833",
"0.61121833",
"0.6095411",
"0.60915774",
"0.6070571",
"0.60692155",
"0.60587394",
"0.6050888",
"0.6014831",
"0.5955789",
"0.5900262",
"0.58939517",
"0.588898... | 0.7083364 | 0 |
Convert the given object to string with each line indented by 4 spaces (except the first line). | private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private String toIndentedString(Object object) {\n if (object == null) {\n return EndpointCentralConstants.NULL_STRING;\n }\n return object.toString().replace(EndpointCentralConstants.LINE_BREAK,\n EndpointCentralConstants.LINE_BREAK + EndpointCentralConstants.TAB_SPA... | [
"0.78843355",
"0.7548756",
"0.7496465"
] | 0.0 | -1 |
impl.addContainer("dummy.dev", "dummyHR", ContainerType.DEVICE, ContainerFunction.None, 0); | @Test
public void testGetDevContainer() {
HashMap<String, Object> deviceSpec = new HashMap<String, Object>();
deviceSpec.put("smgdevicetype", SIDeviceType.Accelerometer);
impl.addDevContainer(new DeviceContainer(new DeviceId("dev", "dummy"), "foo",deviceSpec));
DeviceContainer container = impl.getDeviceContainer(new DeviceId("dev", "dummy"));
assertEquals(container.getContainerId(), "dummy.dev");
assertEquals(container.getContainerFunction(), ContainerFunction.NONE);
assertEquals(container.isVirtualContainer(), false);
assertEquals(container.getContainerType(), ContainerType.DEVICE);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Container createContainer();",
"private void makeContainer(){\n Container X = (Container) ((SpringGridLayout) headlineContainer.getLayout()).getChild(1, 0);\n if (!(X == null)) headlineContainer.removeChild(X);\n\n Container sub = new Container(new SpringGridLayout(Axis.X,Axis.Y,FillMode.L... | [
"0.5683948",
"0.55629635",
"0.5537007",
"0.55120045",
"0.5487079",
"0.544439",
"0.5385322",
"0.5372391",
"0.5356961",
"0.53323317",
"0.5320148",
"0.5296672",
"0.5279149",
"0.5249552",
"0.524116",
"0.52162594",
"0.5208137",
"0.5200983",
"0.519967",
"0.51912576",
"0.5174126",
... | 0.659571 | 0 |
Scans all classloaders for the current thread for loaded jars, and then scans each jar for the package name in question, listing all classes directly under the package name in question. Assumes directory structure in jar file and class package naming follow java conventions (i.e. com.example.test.MyTest would be in /com/example/test/MyTest.class) | public static Collection<Class> getClassesForPackage(String packageName)
throws Exception {
String packagePath = packageName.replace(".", "/");
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
Set<URL> jarUrls = new HashSet<URL>();
while (classLoader != null) {
if (classLoader instanceof URLClassLoader) {
for (URL url : ((URLClassLoader) classLoader).getURLs()) {
if (url.getFile().endsWith(".jar")) // may want better way to detect jar files
{
jarUrls.add(url);
} // if
} // for
} // if
classLoader = classLoader.getParent();
} // while
Set<Class> classes = new HashSet<Class>();
for (URL url : jarUrls) {
JarInputStream stream = new JarInputStream(url.openStream()); // may want better way to open url connections
JarEntry entry = stream.getNextJarEntry();
while (entry != null) {
String name = entry.getName();
if (name.endsWith(".class") && name.substring(0,
packagePath.length()).equals(packagePath)) {
classes.add(Class.forName(name.substring(0,
name.length() - 6).replace("/", ".")));
} // if
entry = stream.getNextJarEntry();
} // while
stream.close();
} // for
return classes;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private List<Class<?>> getClasses(String packageName) throws Exception {\n File directory = null;\n try {\n ClassLoader cld = getClassLoader();\n URL resource = getResource(packageName, cld);\n directory = new File(resource.getFile());\n } catch (NullPointerExc... | [
"0.6670555",
"0.6670494",
"0.6634323",
"0.6533117",
"0.6453535",
"0.63663733",
"0.6323596",
"0.6318052",
"0.6268942",
"0.6265214",
"0.62626594",
"0.61919343",
"0.6144118",
"0.6103414",
"0.60760075",
"0.6062088",
"0.601519",
"0.60074484",
"0.5990965",
"0.59882337",
"0.59854585... | 0.7070831 | 0 |
Instantiates a new road, given the parameters are valid. | @Override
public void execute(RoadMap r) {
Logger log = Logger.getLogger(NewHighwayEvent.class.getName());
log.info("Attempting to execute NewHighwayEvent...");
r.addRoad(createHighway(r));
log.info("Event executed");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public RailRoad() {}",
"public RoadTest()\n {\n }",
"private Road()\n\t{\n\t\t\n\t}",
"public Road(int x, int y, int width, int height)\n {\n screenWidth = width;\n screenHeight = height;\n xTopLeft = x;\n yTopLeft = y;\n }",
"@Test\n public void constructor(){\n ... | [
"0.6993017",
"0.69391114",
"0.6935618",
"0.6786998",
"0.6721721",
"0.6502",
"0.63948846",
"0.63908285",
"0.61795944",
"0.6148094",
"0.59968984",
"0.58973473",
"0.5863069",
"0.5858804",
"0.5787007",
"0.5768228",
"0.5750305",
"0.573471",
"0.5618859",
"0.56014866",
"0.5598056",
... | 0.0 | -1 |
Creates a new Highway with the event parameters, if possible. | public Highway createHighway(RoadMap r) {
Highway newHighway;
try {
newHighway = new Highway(roadID, length, maxVel, verifyJunction(r,
ini), verifyJunction(r, end), lanes);
} catch (IllegalArgumentException | ObjectNotFoundException e) {
throw new IllegalArgumentException(
"Error: Could not create Highway " + roadID + " at time "
+ getTime() + ".\n" + e.getMessage(), e);
}
return newHighway;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\t\tpublic NewHighwayEvent build(IniSection ini) {\n\t\t\tNewHighwayEvent event = null;\n\t\t\tint lanes;\n\n\t\t\tif (TAG.equals(ini.getTag()) && isCorrectType(ini, TYPE)) {\n\t\t\t\ttry {\n\t\t\t\t\tLogger log = Logger.getLogger(NewHighwayEvent.class\n\t\t\t\t\t\t\t.getName());\n\t\t\t\t\tlog.info(\"A... | [
"0.5620142",
"0.54069424",
"0.53946036",
"0.53168833",
"0.5289115",
"0.5284529",
"0.5260383",
"0.5253013",
"0.5253013",
"0.52275777",
"0.5189571",
"0.5157627",
"0.5071005",
"0.5054662",
"0.50031567",
"0.4997943",
"0.4965337",
"0.49394593",
"0.49226588",
"0.49147186",
"0.49040... | 0.65592253 | 0 |
Return a description of the event. | @Override
public void describe(Map<String, String> out) {
super.describe(out);
out.put("Type", "New Highway " + roadID);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getEventDescription() {\n\t\treturn description;\n\t}",
"private String getEventDescription(Event event) {\n String day = getDayDescription(event);\n String typeOfEvent = getEventType(event);\n String description = day + \" \" + typeOfEvent + event.getName();\n if (descr... | [
"0.8500561",
"0.78031105",
"0.7512345",
"0.7500311",
"0.7422424",
"0.7373523",
"0.7188395",
"0.7086694",
"0.69594693",
"0.6952421",
"0.6915571",
"0.69140935",
"0.6912951",
"0.6912951",
"0.6912951",
"0.6912951",
"0.6912951",
"0.6912951",
"0.6912951",
"0.6912951",
"0.6912951",
... | 0.0 | -1 |
Build the event from a given INI section, returns null if the section tag does not match the event tag. | @Override
public NewHighwayEvent build(IniSection ini) {
NewHighwayEvent event = null;
int lanes;
if (TAG.equals(ini.getTag()) && isCorrectType(ini, TYPE)) {
try {
Logger log = Logger.getLogger(NewHighwayEvent.class
.getName());
log.info("Attempting to parse NewHighwayEvent...");
NewRoadEvent ev = super.build(ini);
lanes = parsePositiveInt(ini, "lanes");
event = new NewHighwayEvent(ev, lanes);
log.info("Event parsed");
} catch (Exception e) {
throw new IllegalArgumentException(
EVENT_PARSE_ERROR_MSG + e.getMessage(), e);
}
}
return event;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Section(BufferedReader in) throws IOException, ReloadFault {\n String line = in.readLine();\n // find top of section and process it\n while (line != null) {\n if (line.startsWith(JTR_V2_SECTION)) {\n title = extractSlice(line, 0, \":\", null);\n ... | [
"0.47525185",
"0.47376356",
"0.4712401",
"0.45720986",
"0.45223066",
"0.45171416",
"0.45123422",
"0.44436854",
"0.44373104",
"0.4416376",
"0.4337754",
"0.4286977",
"0.42779896",
"0.42746758",
"0.4268519",
"0.42636752",
"0.42292538",
"0.42163208",
"0.41923434",
"0.41923434",
"... | 0.6864123 | 0 |
private boolean verboseMode = true; Tests the listSensorDataTimestamp method to see if power source exists on this server. | @Before
@Test
public void testListSensorDataTimestampSource() throws Exception {
command = "sensordata SIM_SEA timestamp 2009-11-01T00:00:00.0000";
commandProcessor = new CommandProcessor();
commandList = commandProcessor.parseCommand(command);
cli = new CommandLineInterface();
commandProcessor.processCommand(cli, commandList);
assertTrue(ASSERT_SOURCE_MESSAGE, cli.errorEncountered);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static boolean verboseOn() {\n return (SolrUtil.DEBUG || Debug.verboseOn());\n }",
"public boolean isPowerSource()\r\n {\r\n return true;\r\n }",
"public static boolean verbose() {\n return verbose;\n }",
"public boolean isVerbose() {\n\treturn verbose;\n }",
"pub... | [
"0.67993146",
"0.65900856",
"0.6549087",
"0.6543461",
"0.6525766",
"0.64824474",
"0.64824474",
"0.64210546",
"0.6271815",
"0.621153",
"0.6197037",
"0.61851525",
"0.61295193",
"0.5938443",
"0.5930152",
"0.5779006",
"0.5748711",
"0.57239574",
"0.57028365",
"0.5653906",
"0.56334... | 0.0 | -1 |
Tests the listSensorDataTimestamp method to see if timestamp string is valid. | @Test
public void testListSensorDataTimestampTimestamp() throws Exception {
command = "sensordata SIM_KAHE_1 timestamp 11-01-2009T00:00:00.0000";
if (verboseMode) {
System.out.println("> " + command);
System.out.println("Checking if timestamp is not a valid string...");
}
commandList = commandProcessor.parseCommand(command);
cli = new CommandLineInterface();
commandProcessor.processCommand(cli, commandList);
assertTrue(ASSERT_TIMESTAMP_MESSAGE, cli.errorEncountered);
if (verboseMode) {
System.out.println(result);
System.out.println(OK_MESSAGE + CARRIAGE_RETURN);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static boolean isTimeStampValid(String timestamp) {\n return parseTimeStamp(timestamp) != null;\n }",
"public boolean verifyTimestamp(String timestamp) {\n\t\tlog.debug(\"Verifying string based timestamp\");\n\t\treturn (verifyTimestamp(Long.parseLong(timestamp)));\n\t}",
"@Test\n public void time... | [
"0.74530953",
"0.72904944",
"0.7119268",
"0.6715605",
"0.65825844",
"0.656998",
"0.64924043",
"0.64526594",
"0.64256805",
"0.6410178",
"0.6410178",
"0.6410178",
"0.6410178",
"0.6410178",
"0.6410178",
"0.6410178",
"0.58324164",
"0.5831309",
"0.5831309",
"0.5822054",
"0.5815266... | 0.7547905 | 0 |
Tests the listSensorDataTimestamp method to see if data about a power source exists. | @Test
public void testListSensorDataTimestampCurrentYear() throws Exception {
command = "sensordata SIM_KAHE_1 timestamp 2009-11-01T00:00:00.0000";
if (verboseMode) {
System.out.println("> " + command);
System.out.println("Checking if data about power source exists...");
}
commandList = commandProcessor.parseCommand(command);
cli = new CommandLineInterface();
commandProcessor.processCommand(cli, commandList);
result = (new SensordataTimestamp()).doCommand(cli, commandList);
if (verboseMode) {
System.out.println(result);
}
assertTrue("Checking if data about power source exists", result.contains("Tool")
&& result.contains("Source") && result.contains("Properties"));
if (verboseMode) {
System.out.println(OK_MESSAGE + CARRIAGE_RETURN);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testListSensorDataTimestampPreviousYear() throws Exception {\n command = \"sensordata SIM_KAHE_1 timestamp 2008-11-01T00:00:00.0000\";\n if (verboseMode) {\n System.out.println(\"> \" + command);\n System.out.println(\"Checking if data about power source exists...\");\n }\n ... | [
"0.63129973",
"0.590029",
"0.5825419",
"0.5565811",
"0.55485904",
"0.54969984",
"0.534165",
"0.534165",
"0.534165",
"0.534165",
"0.534165",
"0.534165",
"0.534165",
"0.53285474",
"0.53140825",
"0.5291175",
"0.52708703",
"0.5218254",
"0.5174602",
"0.5164936",
"0.51462066",
"0... | 0.6519747 | 0 |
Tests the listSensorDataTimestamp method to see if data about a power source exists. | @Test
public void testListSensorDataTimestampPreviousYear() throws Exception {
command = "sensordata SIM_KAHE_1 timestamp 2008-11-01T00:00:00.0000";
if (verboseMode) {
System.out.println("> " + command);
System.out.println("Checking if data about power source exists...");
}
commandList = commandProcessor.parseCommand(command);
cli = new CommandLineInterface();
commandProcessor.processCommand(cli, commandList);
result = (new SensordataTimestamp()).doCommand(cli, commandList);
if (verboseMode) {
System.out.println(result);
}
assertEquals("Checking if data about power source exists",
"No data for SIM_KAHE_1 on 2008-11-01T00:00:00.0000.", result);
if (verboseMode) {
System.out.println(OK_MESSAGE + CARRIAGE_RETURN);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testListSensorDataTimestampCurrentYear() throws Exception {\n command = \"sensordata SIM_KAHE_1 timestamp 2009-11-01T00:00:00.0000\";\n if (verboseMode) {\n System.out.println(\"> \" + command);\n System.out.println(\"Checking if data about power source exists...\");\n }\n ... | [
"0.6519747",
"0.590029",
"0.5825419",
"0.5565811",
"0.55485904",
"0.54969984",
"0.534165",
"0.534165",
"0.534165",
"0.534165",
"0.534165",
"0.534165",
"0.534165",
"0.53285474",
"0.53140825",
"0.5291175",
"0.52708703",
"0.5218254",
"0.5174602",
"0.5164936",
"0.51462066",
"0.... | 0.63129973 | 1 |
constructs object and sets database | public ValuesDAO(Database db)
{
this.db = db;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Database()\r\n\t{\r\n\t\tinitializeDatabase();\r\n\t\t\r\n\t}",
"public Database() {\n if (init) {\n\n //creating Transaction data\n Transaction transactionOne\n = new Transaction(1, \"Debit\", \"Spar Grocery\", 54.68,1);\n\n transactionDB.add(tra... | [
"0.75545734",
"0.74972504",
"0.72223043",
"0.7124183",
"0.7112924",
"0.7103709",
"0.7029335",
"0.70203936",
"0.70088726",
"0.69792676",
"0.69753045",
"0.69160676",
"0.687247",
"0.6827533",
"0.6809343",
"0.67993426",
"0.67800474",
"0.67241776",
"0.67049664",
"0.67043567",
"0.6... | 0.6459764 | 40 |
Searches for the specified project then returns its values | public ArrayList<Value> getAll(Project project)
{
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic List<ProjectInfo> findProject(ProjectInfo project) {\n\t\treturn sqlSession.selectList(\"cn.sep.samp2.project.findProject\",project);\n\t}",
"@Override\n\tpublic List<ProjectInfo> findAllProject() {\n\t\treturn sqlSession.selectList(\"cn.sep.samp2.project.findAllProject\");\n\t}",
"@Overrid... | [
"0.7498508",
"0.6955228",
"0.68924046",
"0.63574135",
"0.6317282",
"0.6261402",
"0.622945",
"0.62212723",
"0.6205525",
"0.6196978",
"0.6192202",
"0.616648",
"0.6146912",
"0.61142075",
"0.60872597",
"0.60727817",
"0.6072163",
"0.60690504",
"0.60416025",
"0.60294724",
"0.602553... | 0.62805665 | 5 |
Searches for the specified field then returns its values | public ArrayList<Value> getAllByFieldID(int fieldID) throws DatabaseException
{
PreparedStatement stmt = null;
ResultSet rs = null;
ArrayList<Value> valueList = new ArrayList<Value>();
try
{
String sql = "SELECT * FROM \"values\" WHERE fieldID = " + Integer.toString(fieldID);
stmt = db.getConnection().prepareStatement(sql);
rs = stmt.executeQuery();
while(rs.next())
{
Value value = new Value();
value.setValueID(rs.getInt(1));
value.setRecordID(rs.getInt(2));
value.setFieldID(rs.getInt(3));
value.setBatchID(rs.getInt(4));
value.setProjectID(rs.getInt(5));
value.setData(rs.getString(6));
valueList.add(value);
}
}
catch(SQLException e)
{
throw new DatabaseException();
}
return valueList;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public OpenERPRecord search(String fieldname, Object search) {\r\n\t\t// no finds if nothing is to be found\r\n\t\tif (fieldname == null)\r\n\t\t\treturn null;\r\n\r\n\t\t// do this with all records\r\n\t\tIterator<OpenERPRecord> i = records.iterator();\r\n\t\twhile (i.hasNext()) {\r\n\t\t\tOpenERPRecord r = i.nex... | [
"0.642104",
"0.63787335",
"0.6367998",
"0.621753",
"0.61950487",
"0.6152656",
"0.60321623",
"0.6027195",
"0.6017325",
"0.60106355",
"0.6001216",
"0.59577674",
"0.5915875",
"0.5887678",
"0.58750826",
"0.5871247",
"0.58584267",
"0.5850787",
"0.581633",
"0.58119655",
"0.578869",... | 0.0 | -1 |
Searches for the specified batch then returns its values | public ArrayList<Value> getAll(Batch batch)
{
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private List<MutationBatch> lookupMutationBatches(ImmutableSortedSet<Integer> batchIds) {\n List<MutationBatch> result = new ArrayList<>();\n for (Integer batchId : batchIds) {\n MutationBatch batch = lookupMutationBatch(batchId);\n if (batch != null) {\n result.add(batch);\n }\n }\n... | [
"0.5750046",
"0.52001506",
"0.5119503",
"0.51178616",
"0.50988835",
"0.5031193",
"0.50202245",
"0.50042266",
"0.4986327",
"0.4965662",
"0.4945816",
"0.49442852",
"0.49276394",
"0.48901907",
"0.48643216",
"0.4818649",
"0.48174566",
"0.47864068",
"0.4780132",
"0.47115493",
"0.4... | 0.5902463 | 0 |
Searches for the specified record then returns its values | public ArrayList<Value> getAll(Record record) throws DatabaseException
{
PreparedStatement stmt = null;
ResultSet rs = null;
ArrayList<Value> valueList = new ArrayList<Value>();
try
{
String sql = "SELECT * FROM \"values\" WHERE recordID = " + Integer.toString(record.getRecordID());
stmt = db.getConnection().prepareStatement(sql);
rs = stmt.executeQuery();
while(rs.next())
{
Value value = new Value();
value.setValueID(rs.getInt(1));
value.setRecordID(rs.getInt(2));
value.setFieldID(rs.getInt(3));
value.setBatchID(rs.getInt(4));
value.setProjectID(rs.getInt(5));
value.setData(rs.getString(6));
valueList.add(value);
}
}
catch(SQLException e)
{
throw new DatabaseException();
}
return valueList;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String[] findRecord(String county){\n String[] found = null;\n\n for (String[] record : records ) {\n\n if (record[0].equalsIgnoreCase(county)){\n found = record;\n break;\n }\n }\n\n return found;\n }",
"public Set<RecordP... | [
"0.6591762",
"0.64984214",
"0.64265305",
"0.63836795",
"0.63202846",
"0.6265871",
"0.6099409",
"0.6090999",
"0.5807655",
"0.5719749",
"0.57132417",
"0.5669349",
"0.5663736",
"0.56360143",
"0.56140876",
"0.55970615",
"0.55945635",
"0.55750126",
"0.5570654",
"0.5532846",
"0.551... | 0.556414 | 19 |
returns all values in the database | public ArrayList<Value> getAll() throws DatabaseException
{
PreparedStatement stmt = null;
ResultSet rs = null;
ArrayList<Value> valueList = new ArrayList<Value>();
try
{
String sql = "SELECT * FROM \"values\"";
stmt = db.getConnection().prepareStatement(sql);
rs = stmt.executeQuery();
while(rs.next())
{
Value value = new Value();
value.setValueID(rs.getInt(1));
value.setRecordID(rs.getInt(2));
value.setFieldID(rs.getInt(3));
value.setBatchID(rs.getInt(4));
value.setProjectID(rs.getInt(5));
value.setData(rs.getString(6));
valueList.add(value);
}
}
catch(SQLException e)
{
throw new DatabaseException();
}
return valueList;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List selectAll() {\n\t\tList values = new ArrayList();\n\t\topen();\n\t\tCursor c = queryDB();\n\n\t\tif (c.moveToFirst()) {\n\t\t\tdo {\n\t\t\t//\tvalues.add(hydrateNewObject(c));\n\t\t\t} while (c.moveToNext());\n\t\t}\n\t\t\n\t\tc.close();\n\t\tclose();\n\t\t\n\t\treturn values;\n\t}",
"@Override\r\n\t... | [
"0.7500142",
"0.7053272",
"0.68289346",
"0.67032236",
"0.6654161",
"0.66462994",
"0.663588",
"0.66299886",
"0.65725815",
"0.6565868",
"0.65342927",
"0.651062",
"0.64915085",
"0.64351004",
"0.6406949",
"0.64027786",
"0.6373877",
"0.6364906",
"0.63451415",
"0.6335462",
"0.63244... | 0.72798777 | 1 |
Searches the database for a value that matches the desired ID | public Value get(int valueID) throws DatabaseException
{
PreparedStatement stmt = null;
ResultSet rs = null;
Value value = new Value();
try
{
String sql = "SELECT * FROM \"values\" WHERE valueID = " + Integer.toString(valueID);
stmt = db.getConnection().prepareStatement(sql);
rs = stmt.executeQuery();
while(rs.next())
{
value.setValueID(rs.getInt(1));
value.setRecordID(rs.getInt(2));
value.setFieldID(rs.getInt(3));
value.setBatchID(rs.getInt(4));
value.setProjectID(rs.getInt(5));
value.setData(rs.getString(6));
}
}
catch(SQLException e)
{
throw new DatabaseException();
}
return value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int findItem(int value) {\n return find(value, root);\n }",
"public Item searchID(String ID) {\n Item foundItem = null;\n for (Item item : this) {\n if (item.getItemId().equals(ID)) {\n foundItem = item;\n break;\n }\n }\n ... | [
"0.6199092",
"0.6154839",
"0.60798925",
"0.606481",
"0.6059546",
"0.60491616",
"0.59615856",
"0.59420884",
"0.5909344",
"0.5853228",
"0.5843088",
"0.58179754",
"0.5813879",
"0.58107466",
"0.58051676",
"0.57991815",
"0.57950795",
"0.57873446",
"0.5782633",
"0.5770956",
"0.5765... | 0.0 | -1 |
Adds value to the database | public int add(Value value) throws DatabaseException
{
PreparedStatement stmt = null;
Statement keyStmt = null;
ResultSet keyRS = null;
int valueID;
try
{
String sql = "INSERT INTO \"values\" (recordID, fieldID, batchID, projectID, data) VALUES (?, ?, ?, ?, ?)";
stmt = db.getConnection().prepareStatement(sql);
stmt.setInt(1, value.getRecordID());
stmt.setInt(2, value.getFieldID());
stmt.setInt(3, value.getBatchID());
stmt.setInt(4, value.getProjectID());
stmt.setString(5, value.getData());
if (stmt.executeUpdate() == 1)
{
keyStmt = db.getConnection().createStatement();
keyRS = keyStmt.executeQuery("select last_insert_rowid()");
keyRS.next();
valueID = keyRS.getInt(1);
}
else
{
throw new DatabaseException();
}
}
catch(SQLException e)
{
throw new DatabaseException();
}
finally
{
if(stmt != null)
{
try
{
stmt.close();
keyStmt.close();
keyRS.close();
}
catch(SQLException e)
{
throw new DatabaseException();
}
}
}
return valueID;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void addValue() {\n addValue(1);\n }",
"public void insert() {\n\t\tSession session = DBManager.getSession();\n\t\tsession.beginTransaction();\n\t\tsession.save(this);\n\t\tsession.getTransaction().commit();\n\t}",
"public void add(Object value) {\n\n\t}",
"private void insertValue(String fi... | [
"0.63667953",
"0.61841446",
"0.61201507",
"0.6119938",
"0.6119788",
"0.60980767",
"0.6068531",
"0.6064101",
"0.6037052",
"0.6027706",
"0.6015041",
"0.59528106",
"0.59198046",
"0.5914859",
"0.59136385",
"0.59127086",
"0.5863815",
"0.5863578",
"0.58490765",
"0.58251745",
"0.580... | 0.63534474 | 1 |
finds the value in the database, and replaces it's previous data with the current data | public void update(Value value) throws DatabaseException
{
PreparedStatement stmt = null;
try
{
String sql = "UPDATE \"values\"" +
"set recordID = ?, fieldID = ?, batchID = ?, projectID = ?, data = ? " +
"WHERE valueID = ?";
stmt = db.getConnection().prepareStatement(sql);
stmt.setInt(1, value.getRecordID());
stmt.setInt(2, value.getFieldID());
stmt.setInt(3, value.getBatchID());
stmt.setInt(4, value.getProjectID());
stmt.setString(5, value.getData());
stmt.setInt(6, value.getValueID());
if (stmt.executeUpdate() == 1)
{
//works
}
else
{
throw new DatabaseException();
}
}
catch(SQLException e)
{
throw new DatabaseException();
}
finally
{
if(stmt != null)
{
try
{
stmt.close();
}
catch(SQLException e)
{
throw new DatabaseException();
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n String svalue = dataSnapshot.getValue(String.class);\n\n FirebaseDatabase database = FirebaseDatabase.getInstance();\n DatabaseReference upd = ... | [
"0.55916864",
"0.5587262",
"0.5419201",
"0.52334356",
"0.5152313",
"0.5133671",
"0.51143205",
"0.5093129",
"0.5057701",
"0.5041014",
"0.5038783",
"0.5030371",
"0.50123864",
"0.49986804",
"0.49531627",
"0.49433225",
"0.49424377",
"0.4932676",
"0.49305713",
"0.49230406",
"0.491... | 0.0 | -1 |
removes a value from the database | public void delete(Value value) throws DatabaseException
{
PreparedStatement stmt = null;
try
{
String sql = "DELETE FROM \"values\" WHERE valueID = " + Integer.toString(value.getValueID());
stmt = db.getConnection().prepareStatement(sql);
if (stmt.executeUpdate() == 1)
{
//It worked!
}
else
{
throw new DatabaseException();
}
}
catch(SQLException e)
{
throw new DatabaseException();
}
finally
{
if(stmt != null)
{
try
{
stmt.close();
}
catch(SQLException e)
{
throw new DatabaseException();
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void removeFromDb() {\n }",
"private DeleteByValue() {}",
"private DeleteByValue() {}",
"private void deleteOne(String value){\n\t\tnumCache.put(value, numCache.get(value) - 1);\n\t\tif (numCache.get(value) == 0){\n\t\t\tnumCache.remove(value);\n\t\t}\n\t}",
"boolean delete(int val... | [
"0.6971067",
"0.64858395",
"0.64858395",
"0.63836807",
"0.63267195",
"0.63097525",
"0.63042563",
"0.6276978",
"0.62201196",
"0.6216828",
"0.6216652",
"0.62147385",
"0.6209013",
"0.61996984",
"0.6198557",
"0.6179152",
"0.6162512",
"0.6162512",
"0.61559534",
"0.6140193",
"0.611... | 0.64797866 | 3 |
Verify jwt tokens addressed to IAP protected resources on App Engine. The project number for your Google Cloud project available via 'gcloud projects describe $PROJECT_ID' or in the Project Info card in Cloud Console. projectId is The project ID for your Google Cloud Project. | Jwt verifyJWTTokenForAppEngine(HttpRequest request, long projectNumber, String projectId) throws Exception {
// Check for iap jwt header in incoming request
String jwtToken =
request.getHeaders().getFirstHeaderStringValue("x-goog-iap-jwt-assertion");
if (jwtToken == null) {
return null;
}
return verifyJWTToken(jwtToken, String.format("/projects/%s/apps/%s",
Long.toUnsignedString(projectNumber),
projectId));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Jwt verifyJWTTokenForComputeEngine(HttpRequest request, long projectNumber, long backendServiceId) throws Exception {\n String jwtToken =\n request.getHeaders().getFirstHeaderStringValue(\"x-goog-iap-jwt-assertion\");\n if (jwtToken == null) {\n return null;\n }\n return verifyJWTToken(jwtT... | [
"0.6305842",
"0.6120249",
"0.5892373",
"0.5777072",
"0.57048666",
"0.55686474",
"0.5350217",
"0.5340865",
"0.52894485",
"0.5287112",
"0.523509",
"0.5189906",
"0.51614547",
"0.51289344",
"0.510595",
"0.5083046",
"0.5073648",
"0.5014892",
"0.50093836",
"0.4988297",
"0.4934709",... | 0.77691734 | 0 |
Check for iap jwt header in incoming request | Jwt verifyJWTTokenForComputeEngine(HttpRequest request, long projectNumber, long backendServiceId) throws Exception {
String jwtToken =
request.getHeaders().getFirstHeaderStringValue("x-goog-iap-jwt-assertion");
if (jwtToken == null) {
return null;
}
return verifyJWTToken(jwtToken, String.format("/projects/%s/global/backendServices/%s",
Long.toUnsignedString(projectNumber),
Long.toUnsignedString(backendServiceId)));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getJwtFromRequest(HttpServletRequest request) {\n String authHeader = request.getHeader(jwtConfig.getAuthorizationHeader());\n System.out.println(\"auth header is :\" + authHeader);\n System.out.println(\"jwt token is being prepared\");\n if (authHeader != null && authHead... | [
"0.6939411",
"0.6480974",
"0.64763653",
"0.6356311",
"0.6317664",
"0.61978275",
"0.6175107",
"0.611039",
"0.6107036",
"0.60605025",
"0.60205334",
"0.60117245",
"0.60112536",
"0.5963452",
"0.59574306",
"0.5921702",
"0.5921702",
"0.5921702",
"0.5862524",
"0.5828808",
"0.5819661... | 0.0 | -1 |
Time constraints are automatically checked, use setAllowedClockSkewSeconds to specify a leeway window The token was issued in a past date "iat" TODAY | Jwt verifyJWTToken(String jwtToken, String expectedAudience) throws Exception {
Jwt jwt =
Jwts.parser()
.setSigningKeyResolver(resolver)
.requireAudience(expectedAudience)
.requireIssuer(IAP_ISSUER_URL)
.parse(jwtToken);
DefaultClaims claims = (DefaultClaims) jwt.getBody();
if (claims.getSubject() == null) {
throw new Exception("Subject expected, not found.");
}
if (claims.get("email") == null) {
throw new Exception("Email expected, not found.");
}
return jwt;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Duration getTokenExpiredIn();",
"@Override\n\tpublic void setTokenExpiryTime(long arg0) {\n\t\t\n\t}",
"@Override\n\tpublic long getTokenExpiryTime() {\n\t\treturn 0;\n\t}",
"public long getTokenValidityInSeconds() {\n return tokenValidityInSeconds;\n }",
"public boolean v... | [
"0.6719646",
"0.6209752",
"0.62070507",
"0.61680496",
"0.6015401",
"0.59708256",
"0.5955966",
"0.5893687",
"0.57685596",
"0.571028",
"0.5708504",
"0.5693846",
"0.56735307",
"0.560953",
"0.5602672",
"0.5535518",
"0.5502842",
"0.54957944",
"0.5464962",
"0.54553646",
"0.5435837"... | 0.0 | -1 |
Called when the activity is first created. | @Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView textview=(TextView)findViewById(R.id.name);
// textview.setText(ExampleUsage.makeRequest());
// ExampleUsage.makeRequest();
RequestParams params=new RequestParams();
params.put("city", "苏州");
// AsyncHttpResponseHandler client = new AsyncHttpResponseHandler();
TwitterRestClient.get("getArea", params, new AsyncHttpResponseHandler(){
public void onSuccess(String response) {
Log.e("onSuccess", "onSuccess");
System.out.println(response);
String temp01 = response.substring(76);
String temp02 = temp01.substring(0,temp01.length()-9);
try {
List<AreaImp> list = JSONUtils.fromJson(temp02, new TypeToken<List<AreaImp>>(){});
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public void onStart(){
Log.e("onStart", "onStart");
}
public void onFailure(Throwable e, String response) {
Log.e("onFailure", response);
}
public void onFinish() {
Log.e("onFinish", "onFinish");
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t\tinit();\n\t}",
"@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t}",
"@Override\n\tpublic void onActivit... | [
"0.791686",
"0.77270156",
"0.7693263",
"0.7693263",
"0.7693263",
"0.7693263",
"0.7693263",
"0.7693263",
"0.7637394",
"0.7637394",
"0.7629958",
"0.76189965",
"0.76189965",
"0.7543775",
"0.7540053",
"0.7540053",
"0.7539505",
"0.75269467",
"0.75147736",
"0.7509639",
"0.7500879",... | 0.0 | -1 |
TODO Autogenerated method stub | public static void main(String[] args) {
String string = new String("阿是跨境电商的.txt,asda.java,新建.docx");
System.out.println("字符串:"+string);
String[] s=string.split(",");
findJava(s);
wjm(s);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
Function that implements Dijkstra's single source shortest path algorithm for a graph represented using adjacency matrix representation | public double dijkstra(NodoArista[][] adjacencyMatrix, int startVertex, int nodoBuscado, ListaEnlazada lista) {
int nVertices = adjacencyMatrix[0].length;
// shortestDistances[i] will hold the shortest distance from src to i
double[] shortestDistances = new double[nVertices];
double[] precios = new double[nVertices];
// added[i] will true if vertex i is included / in shortest path tree or shortest distance from src to i is finalized
boolean[] added = new boolean[nVertices];
// Initialize all distances as INFINITE and added[] as false
for (int vertexIndex = 0; vertexIndex < nVertices; vertexIndex++) {
shortestDistances[vertexIndex] = Integer.MAX_VALUE;
precios[vertexIndex] = Integer.MAX_VALUE;
added[vertexIndex] = false;
}
// Distance of source vertex from itself is always 0
shortestDistances[startVertex] = 0;
precios[startVertex] = 0;
// Parent array to store shortest path tree
int[] parents = new int[nVertices];
// The starting vertex does not have a parent
parents[startVertex] = NO_PARENT;
// Find shortest path for all vertices
for (int i = 1; i < nVertices; i++) {
// Pick the minimum distance vertex from the set of vertices not yet processed. nearestVertex is always equal to startNode in first iteration.
int nearestVertex = -1;
double shortestDistance = Integer.MAX_VALUE;
double precio = Integer.MAX_VALUE;
for (int vertexIndex = 0; vertexIndex < nVertices; vertexIndex++) {
if (!added[vertexIndex] && shortestDistances[vertexIndex] < shortestDistance) {
nearestVertex = vertexIndex;
shortestDistance = shortestDistances[vertexIndex];
precio = precios[vertexIndex];
}
}
// Mark the picked vertex as processed
added[nearestVertex] = true;
// Update dist value of the adjacent vertices of the picked vertex.
for (int vertexIndex = 0; vertexIndex < nVertices; vertexIndex++) {
double edgeDistance = adjacencyMatrix[nearestVertex][vertexIndex].getPeso();
double precioActual = adjacencyMatrix[nearestVertex][vertexIndex].getPrecio();
double edgePrice = adjacencyMatrix[nearestVertex][vertexIndex].getPrecio();
if (edgeDistance > 0 && ((shortestDistance + edgeDistance) < shortestDistances[vertexIndex])) {
parents[vertexIndex] = nearestVertex;
shortestDistances[vertexIndex] = shortestDistance + edgeDistance;
precios[vertexIndex] = precio + precioActual;
}
if (edgePrice > 0 && ((shortestDistance + edgeDistance) < shortestDistances[vertexIndex])) {
parents[vertexIndex] = nearestVertex;
shortestDistances[vertexIndex] = shortestDistance + edgeDistance;
precios[vertexIndex] = precio + precioActual;
}
}
}
printSolution(startVertex, shortestDistances, parents);
printSolutionPara(startVertex, shortestDistances, parents, nodoBuscado, lista);
return precios[nodoBuscado];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void dijkstra(int graph[][], int src) {\n int dist[] = new int[V]; // The output array. dist[i] will hold\n // the shortest distance from src to i\n\n // sptSet[i] will true if vertex i is included in shortest\n Boolean sptSet[] = new Boolean[V];\n\n for (int ... | [
"0.7223919",
"0.69724286",
"0.6786906",
"0.67368263",
"0.6715819",
"0.670795",
"0.67066795",
"0.6694121",
"0.6676676",
"0.66564524",
"0.65891284",
"0.65862244",
"0.658494",
"0.6583498",
"0.6578354",
"0.65631354",
"0.65296614",
"0.65106004",
"0.650969",
"0.65042126",
"0.649078... | 0.6823916 | 2 |
A utility function to print the constructed distances array and shortest paths | private void printSolution(int startVertex, double[] distances, int[] parents) {
int nVertices = distances.length;
System.out.print("Vertex\t Distance\tPath");
for (int vertexIndex = 0; vertexIndex < nVertices; vertexIndex++) {
if (vertexIndex != startVertex) {
System.out.print("\n" + startVertex + " -> ");
System.out.print(vertexIndex + " \t\t ");
System.out.print(distances[vertexIndex] + "\t\t");
printPath(vertexIndex, parents);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void print_path(int[]parent,int[]dist,int s)\n {\n System.out.println(); \n \n //path from s to all other vertices\n \n for(int i=0;i<parent.length;i++)\n {\n System.out.println(\"From \"+s+\" to \"+i);\n System.out.print(\"path: \");\n print_node(parent,i)... | [
"0.6754311",
"0.6541191",
"0.64110124",
"0.63461643",
"0.6260942",
"0.6172635",
"0.6171264",
"0.61428165",
"0.6121084",
"0.60880244",
"0.6081924",
"0.60682714",
"0.59764016",
"0.59582055",
"0.5940192",
"0.5921468",
"0.59160405",
"0.5906768",
"0.5855767",
"0.58544403",
"0.5799... | 0.7328411 | 0 |
Function to print shortest path from source to currentVertex using parents array | private void printPath(int currentVertex, int[] parents) {
// Base case : Source node has been processed
if (currentVertex == NO_PARENT) {
return;
}
printPath(parents[currentVertex], parents);
System.out.print(currentVertex + " ");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void printPath(ArrayList<Integer> parent, int index, Graph graph){\n if (parent.get(index)==-1)\r\n return;\r\n\r\n //recurse till we get src\r\n printPath(parent, parent.get(index), graph);\r\n shortestVerticesToPlot.add(graph.vertices.get(index).point);\r\n\r\n ... | [
"0.74038744",
"0.7302658",
"0.6992993",
"0.66858464",
"0.66673267",
"0.66458654",
"0.66422546",
"0.66402453",
"0.66233814",
"0.65663445",
"0.6521198",
"0.64964914",
"0.64928645",
"0.6482712",
"0.6375751",
"0.63555235",
"0.63362354",
"0.63173145",
"0.628402",
"0.62313056",
"0.... | 0.80847293 | 0 |
Base case : Source node has been processed | private void printPathPara(int currentVertex, int[] parents, ListaEnlazada lista) {
if (currentVertex == NO_PARENT) {
return;
}
printPathPara(parents[currentVertex], parents, lista);
NodoTemp temp = new NodoTemp(currentVertex);
lista.add(temp);
System.out.print(currentVertex + " ");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Node getSourceNode();",
"@Override\n\t\tpublic CompilationUnitTree process(CompilationUnitTree source) throws Exception {\n\t\t\treturn null;\n\t\t}",
"public void setSourceNode(String sourceNode) {\n this.sourceNode = sourceNode;\n }",
"public Node source() {\n return source;\n }... | [
"0.6659934",
"0.64673746",
"0.62706673",
"0.6201497",
"0.61939824",
"0.6132681",
"0.60393274",
"0.60393274",
"0.59848946",
"0.59350055",
"0.59316796",
"0.5911759",
"0.5888243",
"0.5838739",
"0.583246",
"0.58233863",
"0.58198416",
"0.58197397",
"0.58060855",
"0.5794045",
"0.57... | 0.0 | -1 |
Inflate the layout for this fragment | @Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.content_welcome_dua, container, false);
Button btnCategory = view.findViewById(R.id.btn_next);
btnCategory.setOnClickListener(this);
ImageView iv1 = view.findViewById(R.id.iv_gbr1);
ImageView iv2 = view.findViewById(R.id.iv_gbr2);
DrawableImageViewTarget imageViewTarget = new DrawableImageViewTarget(iv1);
Glide.with(this).load(R.raw.superman).into(imageViewTarget);
imageViewTarget = new DrawableImageViewTarget(iv2);
Glide.with(this).load(R.raw.angel_and_devil_jadi).into(imageViewTarget);
return view;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_main_allinfo, container, false);\n }",
"@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup... | [
"0.6739604",
"0.67235583",
"0.6721706",
"0.6698254",
"0.6691869",
"0.6687986",
"0.66869223",
"0.6684548",
"0.66766286",
"0.6674615",
"0.66654444",
"0.66654384",
"0.6664403",
"0.66596216",
"0.6653321",
"0.6647136",
"0.66423255",
"0.66388357",
"0.6637491",
"0.6634193",
"0.66251... | 0.0 | -1 |
interface holding methods to be implemented | public interface AppDao {
boolean slotTaken(Timestamp date) throws Exception;
List<Appointment> listAllApps() throws Exception;
Appointment getAppointment(Integer id) throws Exception;
List<Appointment> listAppsByUser(String requester) throws Exception;
Appointment newAppointment(String requester, Room room, Timestamp date) throws Exception;
Appointment modifyApp(Integer id, Room room, Timestamp date) throws Exception;
Appointment removeApp(Integer id) throws Exception;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface Implementor {\n // 实现抽象部分需要的某些具体功能\n void operationImpl();\n}",
"public interface Calculator {\n //add method\n double add(double x, double y);\n\n //subtract method\n double subtract(double x, double y);\n\n //mulpiply method\n double multiply(double x, double y);\n\n //Divide method\n... | [
"0.6839975",
"0.67230886",
"0.6669167",
"0.6618539",
"0.6613824",
"0.6595836",
"0.6595812",
"0.6568812",
"0.65443325",
"0.65314645",
"0.6512077",
"0.6483929",
"0.64785314",
"0.6459135",
"0.6458634",
"0.64542925",
"0.64533085",
"0.64461195",
"0.6443164",
"0.6443164",
"0.643606... | 0.0 | -1 |
Constructor from superclass, indicate to Hibernate. | public LanguageDao() {
super(Language.class);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public AbstractHibernateDAOSupport() {\n super();\n }",
"public RepoSQL() { // constructor implicit\r\n\t\t super();\r\n\t }",
"protected CompanyJPA() {\n\t}",
"@Inject\n\tpublic AbsenceDaoImpl() throws SQLException {\n\t\tsuper(Absence.class);\n\t}",
"public AbstractEntity() {\r\n\t}",
"public... | [
"0.7176589",
"0.7088926",
"0.68161565",
"0.6693701",
"0.65135276",
"0.6489287",
"0.6469013",
"0.63985896",
"0.63975537",
"0.638022",
"0.63521963",
"0.63263404",
"0.6320854",
"0.6311995",
"0.629558",
"0.62889165",
"0.6287598",
"0.62827563",
"0.62608063",
"0.62376666",
"0.62325... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.