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 |
|---|---|---|---|---|---|---|
Converts the coordinates given in the parent's coordinate system to this actor's coordinate system. | public Vector2 parentToLocalCoordinates(Vector2 parentCoords) {
return internalGroup.parentToLocalCoordinates(parentCoords);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Vector2 localToParentCoordinates(Vector2 localCoords) {\n return internalGroup.localToParentCoordinates(localCoords);\n }",
"public static Spatial convertToLocal(Spatial parent, Spatial child) {\n\t\tfloat x = child.getX();\n\t\tfloat y = child.getY();\n\n\t\tfloat angle = child.getAngle();\n\n\... | [
"0.55993205",
"0.55398196",
"0.54619783",
"0.53170615",
"0.52905345",
"0.52264655",
"0.51915383",
"0.51585203",
"0.5158076",
"0.5152906",
"0.5028245",
"0.5020329",
"0.5015014",
"0.4957261",
"0.4922994",
"0.4922387",
"0.48934907",
"0.48777425",
"0.48669147",
"0.48567516",
"0.4... | 0.6742682 | 0 |
Adds the specified size to the current size. | public void sizeBy(float size) {
internalGroup.sizeBy(size);
dataTrait.width = internalGroup.getWidth();
dataTrait.height = internalGroup.getHeight();
resetSprite();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void addSize(double edgeSize)\r\n\t{\r\n\t\tsize= size + edgeSize;\r\n\t}",
"public Size plus(Size other) {\n if (isZero()) {\n return other;\n } else if (other.isZero()) {\n return this;\n } else {\n return new Size(mJavaSize + other.mJavaSize,\n mRegisteredNativeSize + o... | [
"0.73356074",
"0.71455395",
"0.6860071",
"0.68526745",
"0.67649907",
"0.6716097",
"0.6705688",
"0.6413508",
"0.6413066",
"0.64110273",
"0.64054537",
"0.6386654",
"0.6372688",
"0.6312346",
"0.6279689",
"0.623965",
"0.6206313",
"0.6182473",
"0.6176915",
"0.6173217",
"0.6173217"... | 0.5646437 | 70 |
Adds the specified size to the current size. | public void sizeBy(float width, float height) {
internalGroup.sizeBy(width, height);
dataTrait.width = internalGroup.getWidth();
dataTrait.height = internalGroup.getHeight();
resetSprite();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void addSize(double edgeSize)\r\n\t{\r\n\t\tsize= size + edgeSize;\r\n\t}",
"public Size plus(Size other) {\n if (isZero()) {\n return other;\n } else if (other.isZero()) {\n return this;\n } else {\n return new Size(mJavaSize + other.mJavaSize,\n mRegisteredNativeSize + o... | [
"0.73356074",
"0.71455395",
"0.6860071",
"0.68526745",
"0.67649907",
"0.6716097",
"0.6705688",
"0.6413508",
"0.6413066",
"0.64110273",
"0.64054537",
"0.6386654",
"0.6372688",
"0.6312346",
"0.6279689",
"0.623965",
"0.6206313",
"0.6182473",
"0.6176915",
"0.6173217",
"0.6173217"... | 0.0 | -1 |
Changes the zorder for this actor so it is in back of all siblings. | public void toBack() {
internalGroup.toBack();
dataTrait.zIndex = internalGroup.getZIndex();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void flip() {\n ObservableList<Node> tmp = FXCollections.observableArrayList(this.getChildren());\n Collections.reverse(tmp);\n getChildren().setAll(tmp);\n setAlignment(Pos.TOP_LEFT);\n }",
"private void flip() {\n ObservableList<Node> tmp = FXCollections.observable... | [
"0.6757939",
"0.6757939",
"0.6757939",
"0.6308667",
"0.6057591",
"0.5940374",
"0.5824588",
"0.579627",
"0.5717944",
"0.5702851",
"0.5692599",
"0.5565863",
"0.55393916",
"0.5533245",
"0.5520452",
"0.5414782",
"0.54147685",
"0.5413783",
"0.5399313",
"0.53906095",
"0.53651947",
... | 0.6340521 | 3 |
Changes the zorder for this actor so it is in front of all siblings. | public void toFront() {
internalGroup.toFront();
dataTrait.zIndex = internalGroup.getZIndex();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void setZOrder(int order, Object source);",
"public void setZIndex(int newZIndex)\n {\n zIndex = newZIndex;\n \n if (parent != null)\n {\n parent.onZIndexChanged(this);\n }\n }",
"private void flip() {\n ObservableList<Node> tmp = FXCollections.observa... | [
"0.65193003",
"0.63612306",
"0.6092523",
"0.6092523",
"0.6092523",
"0.6007116",
"0.5977047",
"0.58240294",
"0.5697987",
"0.56587285",
"0.56091356",
"0.5560959",
"0.55381054",
"0.54929316",
"0.5485448",
"0.54693174",
"0.538593",
"0.5361896",
"0.52687526",
"0.5262296",
"0.52334... | 0.6431693 | 1 |
Defines the interface for accessing the order processing system. | public interface OrderProcessing extends Serializable {
// Used by
public void newOrder(Basket bought) // Cashier
throws OrderException;
public int uniqueNumber() // Cashier
throws OrderException;
public Basket getOrderToPick() // Picker
throws OrderException;
public boolean informOrderPicked(int orderNum) // Picker
throws OrderException;
public boolean informOrderCollected(int orderNum) // Collection
throws OrderException;
public Map<String, List<Integer>> getOrderState() // Display
throws OrderException;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface IOrderService {\n ServerResponse pay(Long orderNo, Long userId, String path);\n\n ServerResponse aliCallback(Map<String, String> params);\n\n ServerResponse queryOrderPayStatus(Long userId, Long orderNo);\n\n ServerResponse createOrder(Long userId, Integer shippingId);\n\n ServerRes... | [
"0.67590696",
"0.6703227",
"0.6697133",
"0.6580699",
"0.6550196",
"0.6540256",
"0.6528338",
"0.65173984",
"0.6489064",
"0.64779305",
"0.6464972",
"0.643117",
"0.6420988",
"0.6342747",
"0.63315403",
"0.6315969",
"0.63151026",
"0.6300055",
"0.62896526",
"0.6271811",
"0.62710816... | 0.763316 | 0 |
exception generation and handling | private static void fail(String filename, String errMsg, Module_itemContext itemCon)
throws UnsupportedGrammerException {
Interval int1 = itemCon.getSourceInterval(); // get token interval
Token firstToken = tokenStream.get(int1.a);
int lineNum = firstToken.getLine(); // get line of first token
// Determining j, first token in int1 which occurs at a different line
int j;
for (j = int1.a; j < int1.b; j++) {
if (tokenStream.get(j).getLine() != lineNum)
break;
}
// form a string from tokens 1 through j-1
String tokenStr = tokenStream.getText(new Interval(int1.a, j));
System.err.printf("Parser error (%s:%d): %s\n", filename, lineNum, tokenStr);
fail(errMsg);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void mo57276a(Exception exc);",
"String getException();",
"String getException();",
"@Override\r\n\tpublic void doException() {\n\r\n\t}",
"@Override\n\tprotected String generateMessage() {\n\t\treturn \"Script evaluation exception \" + generateSimpleMessage();\n\t}",
"protected final void delegateExcept... | [
"0.66708416",
"0.6616687",
"0.6616687",
"0.6586104",
"0.63672465",
"0.6270926",
"0.62693185",
"0.61711496",
"0.6099027",
"0.60686284",
"0.6025486",
"0.6022317",
"0.59941244",
"0.59737664",
"0.5953321",
"0.5951062",
"0.59199005",
"0.5904802",
"0.5896019",
"0.589374",
"0.588736... | 0.0 | -1 |
pass null as `library` to parse without library | public static ArrayList<Netlist> parseString(String str, GateLibrary library) throws Exception {
return getNetlists("STRING", new ANTLRInputStream(str), library == null ? new GateLibrary() : library);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic String unparseAnnexLibrary(AnnexLibrary library, String indent) {\n\t\treturn serializer.serialize(library);\n\t}",
"public void loadingLibrary(String libraryFilename);",
"public LibraryParser(final LibraryObject root) throws NoChildrenException {\r\n\t\tthis.root = root;\r\n\t\tthis.allPla... | [
"0.55300504",
"0.54706436",
"0.5416343",
"0.5339435",
"0.5314789",
"0.5257001",
"0.5255851",
"0.523613",
"0.5194612",
"0.51557714",
"0.5142058",
"0.51199436",
"0.50945944",
"0.50879484",
"0.5045182",
"0.50061494",
"0.4998454",
"0.49964032",
"0.49899092",
"0.49654377",
"0.4958... | 0.0 | -1 |
note: returns null on failure, parent method must throw parsing error if this method returns null | private static Net parseArrayNet(ParserRuleContext con) throws Exception {
int tokensR = con.getSourceInterval().length();
if (tokensR == 4 || tokensR == 5) {
// indexed identifier, e.g. x[1]
int spaceBuffer = tokensR == 5 ? 1 : 0;
int firstToken = con.start.getTokenIndex();
Token token1 = tokenStream.get(firstToken);
Token token2 = tokenStream.get(firstToken + 1 + spaceBuffer);
Token token3 = tokenStream.get(firstToken + 2 + spaceBuffer);
Token token4 = tokenStream.get(firstToken + 3 + spaceBuffer);
if (token2.getText().equals("[") && token4.getText().equals("]")) {
Net result = new Net(token1.getText());
int bit = Integer.parseInt(token3.getText());
result.start = bit;
result.end = bit;
return result;
}
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void parse() {\n }",
"@Override\n\tpublic String unparse() {\n\t\treturn null;\n\t}",
"@Override\n public String parse(ValidationInfo validationInfo) {\n return null;\n }",
"@Override\n public String parse(AssignmentInfo assignmentInfo) {\n return null;\n }",
"@Override\n\... | [
"0.6755542",
"0.67433584",
"0.67276186",
"0.6645589",
"0.65029466",
"0.61908203",
"0.61908203",
"0.6122212",
"0.6087517",
"0.6085672",
"0.6061088",
"0.6049203",
"0.59971064",
"0.5913961",
"0.5893831",
"0.58568865",
"0.5855423",
"0.58242226",
"0.57865095",
"0.5753644",
"0.5740... | 0.0 | -1 |
verify no ports have UNKNOWN direction | private static void checkPortDirections(Netlist netlist) throws UnsupportedGrammerException {
for (Map.Entry<String, Port> entry : netlist.ports.entrySet()) {
if (entry.getValue().direction == PinDirection.UNKONWN) {
String msg = String.format(ERR_MSG_3, entry.getValue().id);
fail(msg);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean hasPort();",
"boolean hasPort();",
"public boolean hasPort() {\n return !ports.isEmpty();\n }",
"@Test\n public void testConnectToInvalidService()\n throws IOException\n {\n final boolean availability = ConnectionChecker.checkServiceAvailability(\"localhost\", 65534,... | [
"0.66434973",
"0.66434973",
"0.6274854",
"0.6024962",
"0.59486467",
"0.5922357",
"0.5900893",
"0.5855601",
"0.58498836",
"0.584559",
"0.5838042",
"0.5826669",
"0.5721486",
"0.57163537",
"0.570952",
"0.568237",
"0.56669873",
"0.56639475",
"0.5638782",
"0.563028",
"0.55893886",... | 0.7084288 | 0 |
verify that port definitions match any existing net definitions | private static void checkPortsAndNets(Netlist netlist) throws UnsupportedGrammerException {
for (Map.Entry<String, Port> entry : netlist.ports.entrySet()) {
Port port = entry.getValue();
Net net = netlist.nets.get(port.id);
if (net != null) {
if (net.start != port.start || net.end != port.end) {
String emsg = String.format(ERR_MSG_9, port.id, port.start, port.end, net.id, net.start, net.end);
fail(emsg);
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static void checkPortDirections(Netlist netlist) throws UnsupportedGrammerException {\n\n\t\tfor (Map.Entry<String, Port> entry : netlist.ports.entrySet()) {\n\n\t\t\tif (entry.getValue().direction == PinDirection.UNKONWN) {\n\n\t\t\t\tString msg = String.format(ERR_MSG_3, entry.getValue().id);\n\n\t\t\t\t... | [
"0.6470775",
"0.5901975",
"0.5901975",
"0.58537865",
"0.57470816",
"0.5741594",
"0.56630665",
"0.5612841",
"0.55172014",
"0.5506351",
"0.54873306",
"0.54798496",
"0.5465567",
"0.5437468",
"0.54334944",
"0.5327741",
"0.53127146",
"0.5312001",
"0.5302293",
"0.5293535",
"0.52876... | 0.69236946 | 0 |
Inflate the menu; this adds items to the action bar if it is present. | @Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_edit_note, menu);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {... | [
"0.7246102",
"0.7201358",
"0.7194834",
"0.7176498",
"0.71066517",
"0.7039537",
"0.7037961",
"0.70112145",
"0.70094734",
"0.69807225",
"0.6944953",
"0.69389373",
"0.6933199",
"0.6916928",
"0.6916928",
"0.6891486",
"0.68831646",
"0.68754137",
"0.68745375",
"0.68621665",
"0.6862... | 0.0 | -1 |
Complete the maxSubsetSum function below. | static int maxSubsetSum(int[] arr) {
int n = arr.length;
int[] dp = new int[n];
dp[0] = arr[0];
dp[1] = Math.max(arr[0], arr[1]);
for (int i = 2; i < n; ++i) {
dp[i] = Math.max(dp[i - 2], Math.max(dp[i - 2] + arr[i], Math.max(dp[i - 1], arr[i])));
}
return dp[n - 1];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static int MaxSubarraySum(int[] a) {\n\t\t\n\t\tint max_so_for =Integer.MIN_VALUE;\n\t\tint max_ending_here = 0;;\n\t\t\n\t\tfor (int i = 0; i < a.length; i++) {\n\t\t\tmax_ending_here = max_ending_here + a[i];\n\t\t\t\n\t\t\tif(max_so_for < max_ending_here )\n\t\t\t\tmax_so_for = max_ending_here;\n\t\t\ti... | [
"0.70561427",
"0.7048909",
"0.7035349",
"0.70063555",
"0.68916816",
"0.68700415",
"0.6806787",
"0.6803358",
"0.6777564",
"0.6765908",
"0.6752209",
"0.67241985",
"0.66849566",
"0.6654772",
"0.66496634",
"0.6593403",
"0.65729064",
"0.6567019",
"0.6562096",
"0.65568286",
"0.6552... | 0.78714776 | 0 |
TODO: Return the communication channel to the service. | @Override
public IBinder onBind(Intent intent) {
throw new UnsupportedOperationException("Not yet implemented");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Channel channel() {\n return channel;\n }",
"public IChannel getChannel() {\n\t\treturn message.getChannel();\n\t}",
"SocketChannel getChannel();",
"EzyChannel getChannel();",
"public Channel getChannel()\n {\n return channel;\n }",
"java.lang.String getChannel();",
"protected Channel getC... | [
"0.7437254",
"0.73157257",
"0.7183302",
"0.7135984",
"0.7129005",
"0.71285546",
"0.7090409",
"0.7070889",
"0.7067624",
"0.7038997",
"0.6988283",
"0.6917885",
"0.68884337",
"0.67946744",
"0.67914945",
"0.67852235",
"0.677885",
"0.674656",
"0.67354923",
"0.6681876",
"0.66714543... | 0.0 | -1 |
the previous command executed | public CommandManager() {} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getPrevCommandString() {\n if (this.history.size() == 0) {\n return \"\";\n }\n\n if (this.currIndex <= 0) {\n return this.history.get(0);\n }\n\n this.currIndex -= 1;\n return this.history.get(this.currIndex);\n }",
"public static ... | [
"0.71694934",
"0.7014616",
"0.68759745",
"0.6472511",
"0.64112926",
"0.6402279",
"0.63851905",
"0.63094056",
"0.6302164",
"0.626227",
"0.6254112",
"0.6202121",
"0.619334",
"0.6182156",
"0.6164179",
"0.6160396",
"0.611924",
"0.6110499",
"0.60732806",
"0.60351026",
"0.59838",
... | 0.0 | -1 |
empty constructor Executes the given command and stores it as our previous command. | public void executeCommand(Command c) {
c.execute();
lastCommand = c;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Command() {\n this.executed = false;\n }",
"public Shell() {\n commandNumber = 0;\n prevPID = -1;\n command = \"\";\n }",
"public AGameCommand(Command command) {\n this.game = Game.getInstance();\n this.command = command;\n }",
"public Command() {\n ... | [
"0.7317299",
"0.70593864",
"0.698869",
"0.69685256",
"0.6939187",
"0.68846583",
"0.6846916",
"0.67997307",
"0.67426217",
"0.66808635",
"0.6576912",
"0.6571747",
"0.6570214",
"0.656466",
"0.6552408",
"0.6551686",
"0.6538336",
"0.6519086",
"0.65019673",
"0.64111924",
"0.6409166... | 0.0 | -1 |
Checks if there is a previous command to undo. | public boolean isUndoAvailable() {
return lastCommand != null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static boolean canUndo() {\r\n\t\treturn undoCommands.isEmpty();\r\n\t}",
"public boolean canUndo() {\n/* 834 */ return !Utils.isNullOrEmpty(getNextUndoAction());\n/* */ }",
"public boolean isUndoPossible() {\n return (roundsHistory.size() > 1);\n }",
"public boolean undo(){\n\t\... | [
"0.7874784",
"0.7803436",
"0.77768934",
"0.7649166",
"0.7625825",
"0.7468498",
"0.73677254",
"0.73677254",
"0.7278807",
"0.7264471",
"0.7043469",
"0.69472975",
"0.6831273",
"0.673548",
"0.671096",
"0.6698784",
"0.66332465",
"0.6589631",
"0.6587455",
"0.65823615",
"0.65796417"... | 0.7792579 | 2 |
Undoes the previous command, and sets the previous command to null. | public void undo() {
if (lastCommand != null) {
lastCommand.undo();
lastCommand = null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void undo() {\n if (!history.isEmpty()) {\n Command c = history.get(0);\n c.undo();\n history.remove(0);\n future.add(0, c);\n }\n }",
"public void undoLast() {\t\t\n\t\tCommand command = undoStack.pop();\n\t\tcommand.undo();\n\t}",
"public st... | [
"0.7269156",
"0.6797358",
"0.6773177",
"0.66857815",
"0.6584197",
"0.65589213",
"0.65115434",
"0.6476073",
"0.6468877",
"0.6463398",
"0.64573175",
"0.6443969",
"0.6378114",
"0.6340194",
"0.63056827",
"0.6285844",
"0.62858045",
"0.62652946",
"0.6255544",
"0.62135595",
"0.61758... | 0.76367706 | 0 |
The following test case is basically for the method's general functionality Test case : PASSED | @Test
public void newSortingTest() {
newSorting sort = new newSorting();
int[] arr = {3, 2, 6, 5, 1, 7, 4};
int[] expected = {1, 2, 3, 4, 5, 6, 7};
sort.newSorting(arr, 4);
assertArrayEquals(arr, expected);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\t\t\tpublic void test() {\n\t\t\t}",
"@Override\n public void test() {\n \n }",
"@Override\n\tpublic void test() {\n\t\t\n\t}",
"public void testOperation();",
"private void test() {\n\n\t}",
"@Test\n public void testCheckPositive() {\n Helper.checkPositive(1, \"obj\"... | [
"0.7291286",
"0.68660015",
"0.6846467",
"0.68420786",
"0.68291503",
"0.6770235",
"0.6509294",
"0.6496122",
"0.64326614",
"0.6412908",
"0.6397645",
"0.6356335",
"0.6340777",
"0.633926",
"0.63106734",
"0.6287859",
"0.62811744",
"0.6273587",
"0.6258862",
"0.6258862",
"0.62533057... | 0.0 | -1 |
The following test case checks for duplicates Test case : PASSED | @Test
public void newSortingTest2() {
newSorting sort = new newSorting();
int[] arr = {0, 5, 1, 8, 0, 0};
int[] expected = {0, 0, 0, 1, 5, 8};
sort.newSorting(arr, 4);
assertArrayEquals(arr, expected);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\r\n\tpublic void test1() {\r\n\t\tint[] nums = {1,2,3,1,4};\r\n\t\tAssert.assertEquals(true, containsDuplicate(nums));\r\n\t}",
"public void testFindDuplicates() {\r\n System.out.println(\"findDuplicates\");\r\n \r\n List<String> elements = new ArrayList<>();\r\n elements.add(\"foo\");\r\n e... | [
"0.8029213",
"0.7517954",
"0.7303155",
"0.7204346",
"0.70551854",
"0.6950422",
"0.69426626",
"0.6929646",
"0.6778536",
"0.6725065",
"0.6708395",
"0.66903496",
"0.66760576",
"0.66581833",
"0.6657843",
"0.6647117",
"0.65750134",
"0.6572898",
"0.6547079",
"0.65246606",
"0.651145... | 0.0 | -1 |
The following test case checks if the array can be sorted reversely Test case : PASSED | @Test
public void newSortingTest3() {
newSorting sort = new newSorting();
int[] arr = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1};
int[] expected = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
sort.newSorting(arr, 5);
assertArrayEquals(arr, expected);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void reverseArray () {\n\n int[] input = {-2,5,-1,7,-3};\n int[] output = {-3,7,-1,5,-2};\n assertArrayEquals(output, Computation.reversal(input));\n\n }",
"@Test\r\n public void testReverseArr() {\r\n System.out.println(\"ReverseArr\");\r\n int length =... | [
"0.7924808",
"0.7835651",
"0.78318965",
"0.76262397",
"0.7382609",
"0.68772745",
"0.68648535",
"0.677624",
"0.6719571",
"0.6702716",
"0.66463184",
"0.6645347",
"0.6549357",
"0.65435684",
"0.6451039",
"0.6443457",
"0.6443123",
"0.64294",
"0.6427885",
"0.6418502",
"0.64040196",... | 0.5923499 | 93 |
The following test case checks if the array can be sorted with negative numbers and duplicates numbers. Test case : PASSED | @Test
public void newSortingTest4() {
newSorting sort = new newSorting();
int[] arr = {-1, 0, 1, 0, 1, 0, -1};
int[] expected = {-1, -1, 0, 0, 0, 1, 1};
sort.newSorting(arr, 3);
assertArrayEquals(arr, expected);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\r\n public void repeatedValuesTest() {\r\n int[] unsorted = new int[]{1,33,1,0,33,-23,1,-23,1,0,-23};\r\n int[] expResult = new int[]{-23,-23,-23,0,0,1,1,1,1,33,33};\r\n int[] result = arraySorter.sort(unsorted);\r\n assertArrayEquals(expResult, result);\r\n }",
"@Test\n\t... | [
"0.76580304",
"0.75958526",
"0.7513042",
"0.73905426",
"0.7062372",
"0.6978802",
"0.6967995",
"0.6960922",
"0.6952724",
"0.69204104",
"0.6889121",
"0.6873409",
"0.68126696",
"0.67752606",
"0.67484003",
"0.6728885",
"0.6715664",
"0.6710301",
"0.66789633",
"0.66504353",
"0.6584... | 0.66961145 | 18 |
The following test case checks if the half size is smaller than expected Test case : PASSED | @Test
public void newSortingTest5() {
newSorting sort = new newSorting();
int[] arr = {10, 100, 20, 90, 30, 80, 40, 70, 50, 60};
int[] expected = {10, 20, 30, 40, 50, 60, 70, 80, 90, 100};
sort.newSorting(arr, 2);
assertArrayEquals(arr, expected);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void assertSizeEquals(int expected);",
"public void testSize() {\n assertEquals(this.stack.size(), 10, 0.01);\n assertEquals(this.empty.size(), 0, 0.01);\n }",
"private void assertEqual(long count, long size) {\n\t\t\n\t}",
"private void testSize() {\n System.out.println(\"------ TEST... | [
"0.74117166",
"0.6775492",
"0.66929007",
"0.66769755",
"0.66504663",
"0.6585696",
"0.65576756",
"0.6549643",
"0.6504975",
"0.64809316",
"0.6392281",
"0.63728464",
"0.63554436",
"0.62352103",
"0.62093467",
"0.6200719",
"0.61847204",
"0.6168296",
"0.6154943",
"0.6136343",
"0.61... | 0.0 | -1 |
InitReve initReve = new InitReve(); | @Override
public void init(ServletConfig config) throws ServletException {
//初始化定时任务
// initSysTask();
super.init(config);
try {
ServiceBeanContext.getInstance().loadContext(Constants.Env.BASE_HOME+"applicationContext.xml");
//启动代理服务器
//ProxyServer.startProxy();
//initReve.init();
} catch (Exception e) {
log.error("启动初始化applicationContext.xml失败", e);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void init() {\n\n }",
"public InitService() {\n super(\"InitService\");\n }",
"private void init() {\n\n\t}",
"public void init(){}",
"private void initService() {\r\n\t}",
"public void init() {}",
"public void init() {}",
"public static void init() {\n\t\t\n\t}",
"public... | [
"0.6398554",
"0.63586557",
"0.63476956",
"0.6334189",
"0.6326165",
"0.6324014",
"0.6324014",
"0.6316039",
"0.63159305",
"0.63159305",
"0.63159305",
"0.63159305",
"0.6307025",
"0.63008267",
"0.6298878",
"0.6273249",
"0.6273249",
"0.6272786",
"0.6272786",
"0.6267456",
"0.625785... | 0.0 | -1 |
Handle action bar item clicks here. The action bar will automatically handle clicks on the Home/Up button, so long as you specify a parent activity in AndroidManifest.xml. | @Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == android.R.id.home) {
onBackPressed();
return true;
}
return super.onOptionsItemSelected(item);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean onOptionsItemSelected(MenuItem item) { Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n\n //\n // HANDLE BACK BUTTON\n ... | [
"0.79044175",
"0.7806529",
"0.77667165",
"0.772694",
"0.76315796",
"0.76219255",
"0.75851756",
"0.75312436",
"0.7488551",
"0.7458599",
"0.7458599",
"0.74389243",
"0.74213",
"0.7403157",
"0.7392013",
"0.73872125",
"0.73794484",
"0.73704696",
"0.73621285",
"0.7356082",
"0.73457... | 0.71176934 | 68 |
private ScriptEngine scriptEngine ;// scriptEngineManager.getEngineByName("nashorn"); | @Override
public void run() {
// logger.warn("正在执行mqtttask "+":"+message);
// jedis = JedisUtil.getInstance().getJedis();
AnaUtil.handlemqttMessage(message);
// logger.warn("执行mqtttask结束 "+":"+message);
// JedisUtil.getInstance().returnJedis(jedis);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void createScript(final Script script, final String scriptName)\n\t{\n\t\ttry\n\t\t{\n\t\t\tfinal ScriptEngine scriptEngine = new ScriptEngineManager().getEngineByName(\"nashorn\");\t\t\t\t\t\t\t\t\t\t\n\t\t\t\n\t\t\tif (scriptEngine != null)\n\t\t\t{\n\t\t\t\tscript.setName(scriptName);\t\t\t\n\t\t\t\tscri... | [
"0.63576996",
"0.63224816",
"0.6233849",
"0.6144982",
"0.60728616",
"0.5998469",
"0.59284717",
"0.5916345",
"0.58753425",
"0.58666086",
"0.5821066",
"0.5784084",
"0.57310736",
"0.5654522",
"0.5635896",
"0.5634954",
"0.5634954",
"0.5623739",
"0.5553651",
"0.5511906",
"0.550942... | 0.0 | -1 |
Load your keystore file | private void Initiat_Service(Object serviceAdm,Utilisateur user_en_cours) {
log.debug("user_en_cours.trustedApplication:"+user_en_cours.trustedApplication);
String filename =propIdentification.getProperty(Long.toString(user_en_cours.trustedApplication));
log.debug("filename:"+filename);
//System.out.println("my file "+filename);
FileInputStream is=null;
try {
is = new FileInputStream(filename);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
KeyStore myKeyStore=null;
try {
myKeyStore = KeyStore.getInstance(KeyStore.getDefaultType());
} catch (KeyStoreException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
String password =propIdentification.getProperty(Long.toString(user_en_cours.trustedApplication)+".password");
try {
myKeyStore.load(is, password.toCharArray());
} catch (NoSuchAlgorithmException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
} catch (CertificateException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
} catch (IOException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
String filenameTrust =prop.getProperty("clienttrustore");
FileInputStream myKeys = null;
try {
myKeys = new FileInputStream(filenameTrust);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// Load your TrustedStore
KeyStore myTrustedStore=null;
try {
myTrustedStore = KeyStore.getInstance(KeyStore.getDefaultType());
} catch (KeyStoreException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
try {
myTrustedStore.load(myKeys, prop.getProperty("clienttrustore.password").toCharArray());
} catch (NoSuchAlgorithmException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (CertificateException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
WSConnection.setupTLS(serviceAdm, myKeyStore, password, myTrustedStore);
} catch (GeneralSecurityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void loadStore() throws Exception {\n\t\tkeyStore = KeyStore.getInstance(keyStoreType.toUpperCase());\n\t\tFileInputStream fis = null;\n\t\ttry {\n\t\t\tfis = new FileInputStream(keyStorePath);\n\t\t\tkeyStore.load(fis, keyStorePass.toCharArray());\n\t\t} catch (CertificateException | IOException e) {\n\t\... | [
"0.7171067",
"0.70470214",
"0.6850139",
"0.6686363",
"0.6677564",
"0.6575663",
"0.649491",
"0.64475167",
"0.642696",
"0.6390061",
"0.6383167",
"0.6374125",
"0.61789805",
"0.6083503",
"0.60381305",
"0.5959781",
"0.5926625",
"0.5890648",
"0.5866977",
"0.5854282",
"0.58270794",
... | 0.54351753 | 34 |
generate custom SQL querry SELECT ENO,ENAME,EADD,SALFROM EMPLOYE WHERE ENAME="?" AND EADD="?" | public List<Employe> findByEnameAndEadd(String name,String add); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private String constructSQL() {\n\t\tString sql = \"\";\n\t\tif (!minAgeSet) {\n\t\t\tsql = \"SELECT E.EMP_ID, E.EMP_FULLNAME\" + \" FROM \" + empTable\n\t\t\t+ \" E\";\n\t\t} else {\n\t\t\tsql = \"SELECT E.EMP_ID, E.EMP_FULLNAME\" + \" FROM \" + empTable\n\t\t\t+ \" E WHERE E.EMP_BIRTH_DATE <= ? \";\n\t\t}\n\n\t\... | [
"0.6315347",
"0.5877575",
"0.5808197",
"0.5642161",
"0.5600146",
"0.5599386",
"0.5560383",
"0.548501",
"0.5474146",
"0.5464948",
"0.53933537",
"0.53675747",
"0.53298366",
"0.532935",
"0.5299481",
"0.5290981",
"0.52894413",
"0.5272645",
"0.5267781",
"0.526551",
"0.5234872",
... | 0.50433815 | 38 |
SELECT ENO,ENAME,EADD,SALFROM EMPLOYE WHERE ESAL BETWEEN ? AND ? | public List<Employe> findByEsalBetween(float startSal,float endSal); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List<Employe> findByEnoGreaterThanEqualAndEnameEndingWithOrEsalBetween(int Eno,String name,float startSalary,float endSalary);",
"@WebMethod\n public List<Employee> getEmployeesBySalary(@WebParam(name = \"arg0\") int emp_sal) {\n Connection conn = null;\n List<Employee> emplyeeList = new A... | [
"0.6554963",
"0.60805786",
"0.5917012",
"0.5652853",
"0.5312912",
"0.5309388",
"0.5190418",
"0.51551396",
"0.5152166",
"0.51481473",
"0.5144514",
"0.51241845",
"0.5077688",
"0.5066793",
"0.5050013",
"0.5044726",
"0.5043904",
"0.5036741",
"0.50347996",
"0.50242156",
"0.5004509... | 0.68670774 | 0 |
SELECT ENO,ENAME,EADD,ESALARY FROM EMPLOYE WHERE ENAME LIKE '?' AND EADD LIKE '?' | public List<Employe> findByEnameStartingWithAndEaddStartingWith(String name,String addrs); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static String employeeExists(String eid, String pass){\n return \"select e_fname from employee where e_id = '\"+eid+\"' and e_pass = '\"+pass+\"'\";\n }",
"public List<Employe> findByEnameAndEadd(String name,String add);",
"@Query(\"FROM Employee WHERE name = :name OR location = :location \")\... | [
"0.6079868",
"0.59240484",
"0.5854366",
"0.581917",
"0.5694334",
"0.5621369",
"0.5589583",
"0.5544927",
"0.5528401",
"0.5528242",
"0.5528026",
"0.54856056",
"0.5479068",
"0.54723644",
"0.54702723",
"0.54583704",
"0.54102683",
"0.5401254",
"0.5386683",
"0.5350629",
"0.53068733... | 0.5893291 | 2 |
SELECT ENO,ENAME,EADD,ESALARY FROM EMPLOYEE WHERE (ENO>="?" AND ENAME LIKE '?') OR (ESALARY BETWEEN "?" AND "?") | public List<Employe> findByEnoGreaterThanEqualAndEnameEndingWithOrEsalBetween(int Eno,String name,float startSalary,float endSalary); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Query(\"FROM Employee WHERE name = :name OR location = :location \")\n List<Employee> getEmployeeByNameOrLocation(String name, String location);",
"String WHERE() { return yyline+\"/\"+yycolumn+\"(\"+yychar+\")\" ;}",
"public List<Employe> findByEsalBetween(float startSal,float endSal);",
"@Query(\"SELEC... | [
"0.59867346",
"0.5598439",
"0.54153115",
"0.53701377",
"0.51690036",
"0.5164253",
"0.5147801",
"0.5146642",
"0.5128214",
"0.5088191",
"0.5027388",
"0.5017236",
"0.4940612",
"0.49151468",
"0.48681694",
"0.48391697",
"0.4807544",
"0.4783708",
"0.47751284",
"0.4765706",
"0.47575... | 0.6472101 | 0 |
SELECT ENO,ENAME,EADD,ESALARY FROM EMPLOYEE WHERE ENAME IN('raja','rani','suresh') OR EADD IN('hyd','mumbai','delhi') | public List<Employe> findByEnameInOrEaddIn(List<String> names,List<String> addresses); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List<Employe> findByEnoGreaterThanEqualAndEnameEndingWithOrEsalBetween(int Eno,String name,float startSalary,float endSalary);",
"public List<Employe> findByEnameAndEadd(String name,String add);",
"public List<Employee> findEmployee(String name) {\n\t\tCriteriaQuery<Employee> createQuery = emp.getCri... | [
"0.59375286",
"0.5772314",
"0.5742375",
"0.5605904",
"0.55729234",
"0.54984945",
"0.53060055",
"0.5299884",
"0.52075714",
"0.5137231",
"0.5130566",
"0.5101593",
"0.50985",
"0.50956434",
"0.50923926",
"0.5086444",
"0.50680524",
"0.504369",
"0.50345194",
"0.49842378",
"0.498284... | 0.6564394 | 0 |
if node is at i, then its left child is at 2i+1 and right child at 2i+2 | private Node constructFromLevelOrder(Node root, int[] arr, int curr) {
if (root == null)
return null;
int left = 2 * curr + 1; //index of the left child
int right = 2 * curr + 2; //index of the right child
Node lnode = null;
Node rnode = null;
//left child creation
if (left < arr.length && arr[left]!=NULL_NODE)
lnode = new Node(arr[left]);
//right child cretion
if (right < arr.length && arr[right]!=NULL_NODE)
rnode = new Node(arr[right]);
//Connection childs to their parent
root.left = lnode;
root.right = rnode;
constructFromLevelOrder(root.left, arr, left);
constructFromLevelOrder(root.right, arr, right);
return root;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private int leftchild(int i) {\n return (2 * i) + 1;\n }",
"private int leftChild(int i){return 2*i+1;}",
"private static int leftChild(int i) {\n\t\treturn 2 * i + 1;\n\t}",
"private static int leftChild(int i) {\n\t\treturn 2*i + 1;\n\t}",
"private int rightChild(int i){return 2*i+2;}",
"pr... | [
"0.78406286",
"0.78204983",
"0.7769191",
"0.77406466",
"0.76377064",
"0.7605767",
"0.75440574",
"0.75359315",
"0.74787486",
"0.7427906",
"0.73611736",
"0.7301248",
"0.72930914",
"0.724749",
"0.71251655",
"0.69508004",
"0.68926233",
"0.6869619",
"0.68135214",
"0.68027085",
"0.... | 0.0 | -1 |
isSubsequence method Bruteforce method Time complexity: O(n) Space complexity: O(1) | public static boolean isSubsequence(String s, String t) {
int pos = -1;
for(int i=0; i<s.length(); i++){
pos = t.indexOf(s.charAt(i), pos+1);
if(pos == -1){
return false;
}
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void subSequencesTest3() {\n String text = \"wnylazlzeqntfpwtsmabjqinaweaocfewgpsrmyluadlybfgaltgljrlzaaxvjehhygggdsrygvnjmpyklvyilykdrphepbfgdspjtaap\"\n + \"sxrpayholutqfxstptffbcrkxvvjhorawfwaejxlgafilmzrywpfxjgaltdhjvjgtyguretajegpyirpxfpagodmzrhstrxjrpirlbfgkhhce\"\n ... | [
"0.6753521",
"0.6487365",
"0.6295196",
"0.62054193",
"0.6205011",
"0.6142827",
"0.60979116",
"0.59954315",
"0.5968445",
"0.5966364",
"0.59569585",
"0.5949307",
"0.5929026",
"0.58746934",
"0.5856206",
"0.5844241",
"0.57875574",
"0.5773664",
"0.57725704",
"0.571213",
"0.5702863... | 0.5780581 | 17 |
This is the main method which drives the program. | public static void main(String[] args) {
String s = "abc";
String t = "ahbgdc";
boolean res = isSubsequence(s,t);
System.out.println(res);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main() {\n \n }",
"public static void main()\n\t{\n\t}",
"public static void main() {\n }",
"public static void main(){\n\t}",
"public static void main (String []args){\n }",
"public static void main(String[] args) {\n \n\n }",
"public static void main(String []... | [
"0.83747923",
"0.8301215",
"0.81466335",
"0.8077481",
"0.78347987",
"0.772925",
"0.7702447",
"0.76924074",
"0.76908964",
"0.7680108",
"0.7677582",
"0.7677582",
"0.7645699",
"0.76346767",
"0.76346767",
"0.7622221",
"0.7617592",
"0.7617592",
"0.7617592",
"0.7617592",
"0.7617592... | 0.0 | -1 |
Gets if two players are on the same team | public boolean areOnSameTeam(Player p1, Player p2) {
return areOnSameTeam(p1.getUniqueId(), p2.getUniqueId());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean areOnSameTeam(UUID s1, UUID s2) {\n\t\tTeam team = plugin.getTeamManager().getPlayerTeam(s1);\n\t\tTeam warpeeTeam = plugin.getTeamManager().getPlayerTeam(s2);\n\n\t\tif (team == null || warpeeTeam == null) {\n\t\t\treturn false;\n\t\t}\n\t\tif (team != warpeeTeam)\n\t\t\treturn false;\n\n\t\tif (te... | [
"0.7272877",
"0.6665779",
"0.65363246",
"0.6449471",
"0.63878196",
"0.6292455",
"0.62776214",
"0.62712353",
"0.6259556",
"0.6250007",
"0.6225547",
"0.62209815",
"0.613574",
"0.6097381",
"0.6091866",
"0.6066729",
"0.6060349",
"0.60588676",
"0.60261464",
"0.5957731",
"0.5933836... | 0.763584 | 0 |
Gets whether two names are on the same team | public boolean areOnSameTeam(UUID s1, UUID s2) {
Team team = plugin.getTeamManager().getPlayerTeam(s1);
Team warpeeTeam = plugin.getTeamManager().getPlayerTeam(s2);
if (team == null || warpeeTeam == null) {
return false;
}
if (team != warpeeTeam)
return false;
if (team == warpeeTeam)
return true;
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean areOnSameTeam(Player p1, Player p2) {\n\t\treturn areOnSameTeam(p1.getUniqueId(), p2.getUniqueId());\n\n\t}",
"boolean hasSameAs();",
"boolean hasTeam();",
"private boolean teamExist(String teamName) {\n boolean doesExist = false;\n for (Team team : scoreboard.getTeams()) if (tea... | [
"0.6920566",
"0.6430983",
"0.6381688",
"0.6330937",
"0.6286805",
"0.6199843",
"0.6179467",
"0.61596143",
"0.6144398",
"0.6024231",
"0.5984302",
"0.5977782",
"0.5962007",
"0.5949137",
"0.58938354",
"0.5879742",
"0.5878825",
"0.5791538",
"0.5775689",
"0.57518876",
"0.57420874",... | 0.72719383 | 0 |
Gets if the player should be deathbanned or not in the End. | public boolean shouldDeathban(Player player) {
PlayerInventory pi = player.getInventory();
try {
for (Method m : ARMOR_METHODS) {
ItemStack item = (ItemStack) m.invoke(pi);
if (item == null) {
return true;
}
String name = item.getType().name();
if (!(name.contains("IRON_") || name.contains("DIAMOND_"))) {
return true;
}
}
}
catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
e.printStackTrace();
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isDeath() {\n return death;\n }",
"public boolean checkDeath() {\r\n\t\tif (death) {\r\n\t\t\tdeath = false;\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public static boolean isDead(Entity e) {\r\n return e.getAttribute(\"state:death\", false)... | [
"0.7066744",
"0.6665105",
"0.6560607",
"0.64268064",
"0.64246213",
"0.6320889",
"0.63127553",
"0.62595",
"0.6168054",
"0.607793",
"0.6045047",
"0.6023985",
"0.6015699",
"0.59540707",
"0.5953213",
"0.59510905",
"0.5921621",
"0.59068364",
"0.5906575",
"0.5896529",
"0.5867628",
... | 0.0 | -1 |
Gets if the location's region is outer spawn | public boolean isOuterSpawn(Location loc) {
return RegionManager.get().hasTag(loc, "outer-spawn");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean inRegion(Location loc)\n {\n if (!loc.getWorld().getName().equals(world.getName()) || !setup)\n return false;\n \n int x = loc.getBlockX();\n int y = loc.getBlockY();\n int z = loc.getBlockZ();\n \n // Check the lobby first.\n ... | [
"0.6801204",
"0.6786711",
"0.67398334",
"0.6665115",
"0.6641679",
"0.6616575",
"0.65743726",
"0.6553889",
"0.64463276",
"0.6414243",
"0.6413001",
"0.6343317",
"0.62933403",
"0.62562084",
"0.6234022",
"0.6233812",
"0.6223363",
"0.62072766",
"0.61875194",
"0.61775625",
"0.61750... | 0.8007499 | 0 |
Gets if the location's region is spawn | public boolean isSpawn(Location loc) {
return RegionManager.get().hasTag(loc, "spawn");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isSpawn()\n\t{\n\t\treturn block == Block.FRUIT_SPAWN || block == Block.GHOST_SPAWN || block == Block.PAC_SPAWN;\n\t}",
"public boolean isOuterSpawn(Location loc) {\n\t\treturn RegionManager.get().hasTag(loc, \"outer-spawn\");\n\n\t}",
"public boolean isSpawnable(Location loc) {\n Block b... | [
"0.7408096",
"0.72347",
"0.7034431",
"0.69925076",
"0.69912094",
"0.69151825",
"0.6895418",
"0.68504786",
"0.68436444",
"0.6759964",
"0.6759964",
"0.6431158",
"0.6409287",
"0.638271",
"0.63823324",
"0.6380092",
"0.6271374",
"0.62176144",
"0.6165845",
"0.612439",
"0.6114365",
... | 0.7763035 | 0 |
Gets if blow flow should be prevented on the block | public boolean shouldPreventFlow(Block b) {
return !b.hasMetadata("flow");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean isBlocked() {\n return block_state <= 1;\n }",
"private boolean isStepBlocked(Step step){\n return step.getOverlays().stream().anyMatch( o -> o instanceof Blockable );\n }",
"public boolean isProhibited() {\n return getFlow().isProhibited();\n }",
"@Override\n pub... | [
"0.7546168",
"0.6706888",
"0.6626218",
"0.66257393",
"0.6581235",
"0.65037376",
"0.64814407",
"0.6479315",
"0.6463073",
"0.64305747",
"0.6426178",
"0.6380904",
"0.63522637",
"0.6340361",
"0.6337985",
"0.62910646",
"0.6246703",
"0.6184771",
"0.6182502",
"0.61380994",
"0.607673... | 0.78375053 | 0 |
Gets the team chat map used for handling team chat | public HashMap<String, String> getTeamChatMap() {
return teamChat;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Map<ContactId, GroupChatEvent.Status> getGroupChatEvents(String chatId);",
"public void setTeamChatMap(HashMap<String, String> tchat) {\n\t\tthis.teamChat = tchat;\n\t}",
"public Map<ParticipantId, ParticipantConfig> getParticipantMap() {\n return _participantMap;\n }",
"public Map<String, Player> getPla... | [
"0.62282604",
"0.6143595",
"0.6094221",
"0.60485244",
"0.5980351",
"0.59593683",
"0.5888286",
"0.5850095",
"0.56712747",
"0.5661745",
"0.5621478",
"0.55687517",
"0.55550057",
"0.5547262",
"0.5512967",
"0.5506578",
"0.54915833",
"0.5414136",
"0.5406093",
"0.5365248",
"0.533279... | 0.81211597 | 0 |
Sets the team chat map used for handling team chat | public void setTeamChatMap(HashMap<String, String> tchat) {
this.teamChat = tchat;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public HashMap<String, String> getTeamChatMap() {\n\t\treturn teamChat;\n\t}",
"public void setMap()\n {\n gameManager.setMap( savedFilesFrame.getCurrent_index() );\n }",
"public static void setWebSocketMap(ConcurrentMap<String, WebSocketServer> webSocketMap) {\n\t\tWebSocketServer.webSocketMap = ... | [
"0.6761248",
"0.6123317",
"0.5899629",
"0.5851614",
"0.5749282",
"0.5658721",
"0.56138456",
"0.56075436",
"0.55986583",
"0.559494",
"0.5577707",
"0.5531445",
"0.5525581",
"0.55248535",
"0.5516952",
"0.5511133",
"0.54165494",
"0.54061854",
"0.538067",
"0.53584695",
"0.53434515... | 0.77649224 | 0 |
Disables a player from attacking for 10 seconds | public void disablePlayerAttacking(final Player p) {
p.sendMessage(ChatColor.GRAY + "You cannot attack for 10 seconds.");
final Listener l = new Listener() {
@EventHandler
public void onPlayerDamage(EntityDamageByEntityEvent e) {
if (e.getDamager() instanceof Player && e.getEntity() instanceof Player) {
if (((Player) e.getDamager()).getName().equals(p.getName())) {
e.setCancelled(true);
}
}
}
};
Bukkit.getPluginManager().registerEvents(l, RavenPlugin.get());
Bukkit.getScheduler().runTaskLater(RavenPlugin.get(), new Runnable() {
public void run() {
HandlerList.unregisterAll(l);
}
}, 10 * 20);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n public int actionDelayTime(Entity attacker) {\n return 4000;\r\n }",
"public void attack() {\n energy = 2;\n redBull = 0;\n gun = 0;\n target = 1;\n // if Player is in range take off a life.\n if (CharacterTask.ghostLocation == GameWindow.playe... | [
"0.66239154",
"0.65669364",
"0.6564921",
"0.6430869",
"0.63903785",
"0.6326094",
"0.63121384",
"0.6291603",
"0.6271139",
"0.6265877",
"0.6146839",
"0.6140379",
"0.61096215",
"0.59720606",
"0.5934687",
"0.59135747",
"0.59065",
"0.5903845",
"0.5901674",
"0.58849835",
"0.5881961... | 0.7666191 | 0 |
TODO Autogenerated method stub | public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String input = br.readLine();
StringBuilder sb = new StringBuilder();
while (!input.equals("#")) {
int[] arr = new int[2];
char[] inputs = input.toCharArray();
for (int i = 0; i < inputs.length - 1; i++) {
arr[inputs[i] - '0']++;
}
sb.append(input.substring(0, input.length() - 1));
if (inputs[inputs.length - 1] == 'e') {
if (arr[1] % 2 == 1) {
sb.append(1);
} else {
sb.append(0);
}
} else {
if (arr[1] % 2 == 1) {
sb.append(0);
} else {
sb.append(1);
}
}
sb.append(System.lineSeparator());
input = br.readLine();
}
System.out.print(sb.toString());
} | {
"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 |
/when a month pass is called on the animal, health is decreased, if there is available food, it eats an item of food and its age is incremented by a month | public boolean aMonthPasses()
{
decreaseHealth();
age++;
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void haveFun() {\n\t\tint action = inputPrompt.funActivities(money);\r\n\t\tthis.money -= action;\r\n\t\t//has better effect depending on how much money you have spent\r\n\t\tthis.mentalHealth += FUNHEALTH + action;\r\n\t\tdailyTime--;\r\n\t\tinputPrompt.mainInfo(energy, physHealth, mentalHealth, money);\r... | [
"0.59914714",
"0.5934932",
"0.5904686",
"0.58772063",
"0.5833293",
"0.58005667",
"0.5773157",
"0.5767158",
"0.5730343",
"0.5721659",
"0.57152885",
"0.570809",
"0.567844",
"0.56701404",
"0.5660904",
"0.564447",
"0.5639773",
"0.56237894",
"0.5614611",
"0.56125426",
"0.56104165"... | 0.6019022 | 0 |
The stroked() method is called to treat the lion | public void treat()
{
stroked();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void onRed() {\n\t\taddSequential(new DriveStraightByDistance(PEG_STRAIGHT - ROBOT_LENGTH / 2), 3.5);\n\t\t//TODO: might need to change to a little less\n\t\taddSequential(new TurnDegrees(90), 2.5);\n\t\taddSequential(new DriveStraightByDistance(EXTRA_DIS), 4);\n\t\taddSequential(new OpenPlacer... | [
"0.5700307",
"0.558016",
"0.53025013",
"0.5286173",
"0.5258117",
"0.52326226",
"0.51827806",
"0.5180721",
"0.5176557",
"0.51668113",
"0.5156271",
"0.5115152",
"0.5109373",
"0.509929",
"0.5098784",
"0.5093665",
"0.50764126",
"0.5057045",
"0.5056743",
"0.5050921",
"0.5045536",
... | 0.7346657 | 0 |
TODO: inflate a fragment view | @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = super.onCreateView(inflater, container, savedInstanceState);
unbinder = ButterKnife.bind(this, rootView);
return rootView;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.show_program_fragment, parent, false);\n }",
"@Override\n public View onCreateView(@NonNull LayoutInfla... | [
"0.75212604",
"0.7492544",
"0.7487358",
"0.7479385",
"0.74779814",
"0.7466526",
"0.7466328",
"0.74526715",
"0.7452614",
"0.7443973",
"0.7438898",
"0.7434542",
"0.74284536",
"0.741808",
"0.74093133",
"0.7400632",
"0.7394933",
"0.73865515",
"0.7384236",
"0.73830897",
"0.738306"... | 0.0 | -1 |
TODO Autogenerated method stub | public static void main(String[] args) {
int[] candidates = { 2, 3, 6, 7 };
int target = 7;
List<List<Integer>> h = combinationSum(candidates, target);
Iterator<List<Integer>> it = h.iterator();
while (it.hasNext()) {
System.out.println(it.next());
}
} | {
"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 |
how we can store a list of integers or related items a set of uniform data elements that can accessed via index | public static void main(String[] args) {
int[] numbers = new int[5];// must tell Java how many elements it has-- it cannot shrink or grow
numbers[2]= 5; //number 5 is stores in array
System.out.println(numbers [2]);// print out stored array
// numbers is the entirre array-- to work with data in the array you must use the index
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private List<Integer> createData() {\r\n\t\tList<Integer> data = new ArrayList<Integer>();\r\n\t\tfor (int i = 0; i < N; i++) {\r\n\t\t\tdata.add(i);\r\n\t\t}\r\n\t\treturn data;\r\n\t}",
"int getRequestedValues(int index);",
"E getData(int index);",
"default V item( int i ) { return getDataAt( indexOfIndex(... | [
"0.60392976",
"0.5871173",
"0.58443063",
"0.5793808",
"0.56843793",
"0.564175",
"0.5610325",
"0.55253357",
"0.5494183",
"0.54906744",
"0.54745233",
"0.54675156",
"0.5448907",
"0.5436183",
"0.5411003",
"0.54027855",
"0.53703034",
"0.5367264",
"0.5349488",
"0.532604",
"0.532381... | 0.0 | -1 |
Created by Ao on 20171015. | public interface User {
public enum UserType{
STUDENT, TA, PROFESSOR
}
UserType getUserType();
String getToken();
String getName();
String getUsername();
String getEmail();
//int getNumberOfGroups();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void perish() {\n \n }",
"public final void mo51373a() {\n }",
"private static void cajas() {\n\t\t\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"private stendhal() {\n\t}",
"@Override\n\... | [
"0.5866869",
"0.5778552",
"0.57777137",
"0.57569593",
"0.570931",
"0.5706855",
"0.57066363",
"0.5689637",
"0.5687756",
"0.5665537",
"0.5617138",
"0.56082386",
"0.56040895",
"0.56040895",
"0.55950606",
"0.55847734",
"0.55804896",
"0.5568785",
"0.55575037",
"0.5534293",
"0.5512... | 0.0 | -1 |
A view model that handles the interaction between the agenda view (fragment) and the model. | public interface AgendaViewModel {
/**
* Factory for creating an agenda view model.
*/
interface Factory {
/**
* Create an instance of an agenda view model with the given saved
* instance state.
*
* @param savedInstanceState previously saved state of the view model
* @return the created agenda view model
*/
AgendaViewModel create(Bundle savedInstanceState);
}
/**
* Retrieve tasks for the user within a date range in ascending order by
* date.
*
* @param startDate starting date of the agenda (inclusive)
* @param endDate ending date of the agenda (exclusive)
* @return observable list of tasks for the user sorted by date
*/
LiveData<List<Task>> getSortedTasks(LocalDate startDate,
LocalDate endDate);
/**
* Add a task for the user.
*
* @param newTask the task to add
* @return true if the operation was successful; false otherwise
*/
boolean addTask(Task newTask);
/**
* Update a task for the user.
*
* @param updatedTask the modified task to save
* @return true if the operation was successful; false otherwise
*/
boolean updateTask(Task updatedTask);
/**
* Delete a task for the user.
*
* @param task the task to delete
* @return true if the operation was successful; false otherwise
*/
boolean deleteTask(Task task);
/**
* Retrieve the active task for the user.
*
* @return current active task for the user
*/
@VisibleForTesting(otherwise = VisibleForTesting.NONE)
LiveData<Task> getActiveTask();
/**
* Update the active task for the user.
*
* @param task the task to be active
* @return true if the operation was successful; false otherwise
*/
boolean updateActiveTask(Task task);
/**
* Perform clean-up for this instance.
*/
void onDestroy();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface OwnEventsView extends BaseView {\n\n void adaptEventsList(List<EventModel> eventModelsList);\n\n void viewEvent(EventModel eventModel);\n\n void showViewRefreshing();\n\n void hideViewRefreshing();\n\n void hideViewEmpty();\n\n void showViewEmpty();\n\n}",
"public interface Mod... | [
"0.6494252",
"0.6471826",
"0.64518523",
"0.60635465",
"0.60401434",
"0.59630835",
"0.59250885",
"0.59250885",
"0.59250885",
"0.5831209",
"0.5804344",
"0.5793159",
"0.57288736",
"0.56795675",
"0.56453425",
"0.5635985",
"0.56144357",
"0.5605472",
"0.5602557",
"0.5597779",
"0.55... | 0.70069265 | 0 |
Factory for creating an agenda view model. | interface Factory {
/**
* Create an instance of an agenda view model with the given saved
* instance state.
*
* @param savedInstanceState previously saved state of the view model
* @return the created agenda view model
*/
AgendaViewModel create(Bundle savedInstanceState);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"AgendaViewModel create(Bundle savedInstanceState);",
"public interface AgendaViewModel {\r\n /**\r\n * Factory for creating an agenda view model.\r\n */\r\n interface Factory {\r\n /**\r\n * Create an instance of an agenda view model with the given saved\r\n * instance state.... | [
"0.7486945",
"0.6715961",
"0.63583606",
"0.6090953",
"0.5984556",
"0.58966297",
"0.5869535",
"0.586546",
"0.5802957",
"0.57335407",
"0.57123524",
"0.5673301",
"0.5648365",
"0.56136644",
"0.56045437",
"0.56008226",
"0.5588065",
"0.5577016",
"0.5560976",
"0.55480254",
"0.548256... | 0.754259 | 0 |
Create an instance of an agenda view model with the given saved instance state. | AgendaViewModel create(Bundle savedInstanceState); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"interface Factory {\r\n /**\r\n * Create an instance of an agenda view model with the given saved\r\n * instance state.\r\n *\r\n * @param savedInstanceState previously saved state of the view model\r\n * @return the created agenda view model\r\n */\r\n ... | [
"0.68016565",
"0.58077425",
"0.5762859",
"0.5523021",
"0.5397831",
"0.5374135",
"0.5367585",
"0.52794105",
"0.52663535",
"0.52283704",
"0.5189382",
"0.5172813",
"0.5172813",
"0.5172813",
"0.5172813",
"0.5172813",
"0.5172813",
"0.5172813",
"0.51399165",
"0.5138376",
"0.5114372... | 0.75597847 | 0 |
Retrieve tasks for the user within a date range in ascending order by date. | LiveData<List<Task>> getSortedTasks(LocalDate startDate,
LocalDate endDate); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List<Task> getAllTasksForUser(long userId);",
"public List<TaskMaster> retrieveAllTaskOfCurrentUserById(Date startDate, Date endDate, Long userId, List<Long> projectIds);",
"@GetMapping(\"/get\")\n public List<Task> getTasksBetweenDateAndTime(@RequestParam(\"dstart\") @DateTimeFormat(iso = DateTimeFo... | [
"0.70637053",
"0.6594306",
"0.6514703",
"0.64885885",
"0.64542705",
"0.64428633",
"0.64018434",
"0.6396453",
"0.62992465",
"0.6282992",
"0.6261055",
"0.6198341",
"0.61296105",
"0.6112541",
"0.61016434",
"0.609762",
"0.6053379",
"0.6044664",
"0.60233295",
"0.60155964",
"0.6002... | 0.71927965 | 0 |
Add a task for the user. | boolean addTask(Task newTask); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void addTask(Task task);",
"public void addTask(Task task) {\n\t\tSystem.out.println(\"Inside createTask()\");\n\t\t\n\t\ttoDoList.add(task);\n\t\tdisplay();\n\t}",
"public void add(Task task)\n {\n this.tasks.add(task);\n }",
"void add(final Task task);",
"public void add(Task task){ this.tasks.... | [
"0.7559337",
"0.7349781",
"0.7315991",
"0.72923434",
"0.72894424",
"0.7270748",
"0.7269865",
"0.72222376",
"0.72222376",
"0.72222376",
"0.7209485",
"0.7190178",
"0.7139542",
"0.7130383",
"0.70972836",
"0.7008308",
"0.69241375",
"0.69127876",
"0.68999153",
"0.68763494",
"0.684... | 0.66107225 | 31 |
Update a task for the user. | boolean updateTask(Task updatedTask); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void updateTask(UserDto user);",
"TaskResponse updateTask(TaskRequest taskRequest, Long taskId);",
"@Override\n public UpdateFuotaTaskResult updateFuotaTask(UpdateFuotaTaskRequest request) {\n request = beforeClientExecution(request);\n return executeUpdateFuotaTask(request);\n }",
"publi... | [
"0.7824837",
"0.7614304",
"0.72031593",
"0.7016346",
"0.700975",
"0.6766624",
"0.6749875",
"0.66795",
"0.6612796",
"0.6520695",
"0.64460844",
"0.64187795",
"0.63728994",
"0.6336083",
"0.6313445",
"0.62361395",
"0.62125266",
"0.6181676",
"0.6125251",
"0.6119675",
"0.6106351",
... | 0.73062205 | 2 |
Delete a task for the user. | boolean deleteTask(Task task); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean deleteTask(long userId, String taskId);",
"public void deleteTask(Task task) {\n database.delete(SQLiteHelper.TABLE_TASKS,\n SQLiteHelper.COLUMN_ID + \" = \" + task.get_id(), null);\n }",
"@Override\n public DeleteFuotaTaskResult deleteFuotaTask(DeleteFuotaTaskRequest... | [
"0.7903824",
"0.7442513",
"0.7217369",
"0.72128075",
"0.7133448",
"0.71169466",
"0.7078131",
"0.70499945",
"0.7036107",
"0.70330113",
"0.688372",
"0.68253905",
"0.6815354",
"0.67753613",
"0.67486846",
"0.6719363",
"0.6685547",
"0.66656524",
"0.66336644",
"0.66329813",
"0.6597... | 0.7395513 | 2 |
Retrieve the active task for the user. | @VisibleForTesting(otherwise = VisibleForTesting.NONE)
LiveData<Task> getActiveTask(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public ITask getTask() {\n \t\treturn task;\n \t}",
"public Task getTask() {\n return task;\n }",
"public Task getTask() {\n Long __key = this.TaskId;\n if (task__resolvedKey == null || !task__resolvedKey.equals(__key)) {\n if (daoSession == null) {\n throw new... | [
"0.65479124",
"0.64630437",
"0.63725096",
"0.63679975",
"0.63679975",
"0.6284689",
"0.62527615",
"0.61946416",
"0.6159881",
"0.6139986",
"0.6105664",
"0.6091256",
"0.6051691",
"0.60484344",
"0.6039934",
"0.6039533",
"0.6028488",
"0.60246766",
"0.59711385",
"0.59560674",
"0.59... | 0.744851 | 0 |
Update the active task for the user. | boolean updateActiveTask(Task task); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void updateTask() {\r\n int selected = list.getSelectedIndex();\r\n if (selected >= 0) {\r\n Task task = myTodo.getTaskByIndex(selected + 1);\r\n todoTaskGui(\"Update\", task);\r\n }\r\n }",
"void updateTask(UserDto user);",
"public void updateTask() {}",
... | [
"0.66543984",
"0.6642256",
"0.65703017",
"0.6453264",
"0.6355405",
"0.62362635",
"0.6167439",
"0.6159313",
"0.60901636",
"0.6085098",
"0.6060658",
"0.60360575",
"0.5983064",
"0.59760976",
"0.58707094",
"0.579244",
"0.5788639",
"0.57385075",
"0.57124174",
"0.5679936",
"0.56757... | 0.79227203 | 0 |
Perform cleanup for this instance. | void onDestroy(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void cleanup() {\r\n }",
"public void cleanup() {\n }",
"public void cleanup();",
"@Override\n public void cleanup() {\n \n }",
"@Override\n public void cleanup() {\n \n }",
"public void cleanup() {\n\t}",
"@Override\r\n\tpublic void cleanup(... | [
"0.824533",
"0.8171136",
"0.81621045",
"0.8136613",
"0.8136613",
"0.8072509",
"0.7971351",
"0.791371",
"0.7872966",
"0.78704363",
"0.782507",
"0.7726498",
"0.7726498",
"0.77184165",
"0.7701825",
"0.7701825",
"0.7701825",
"0.76770884",
"0.76770884",
"0.76354355",
"0.76231796",... | 0.0 | -1 |
A native ad loaded successfully, check if the ad loader has finished loading and if so, insert the ads into the list. | @Override
public void onUnifiedNativeAdLoaded(UnifiedNativeAd unifiedNativeAd) {
mNativeAds.add(unifiedNativeAd);
if (!adLoader.isLoading()) {
insertAdsInMenuItems();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void onAdLoaded() {\n }",
"@Override\n public void onAdLoaded() {\n }",
"@Override\n public void onAdLoaded() {\n }",
"@Override\n public void onAdLoaded() {\n }",
"@Override\n public void onAdLoad... | [
"0.687776",
"0.68411815",
"0.68411815",
"0.68411815",
"0.68411815",
"0.68411815",
"0.68411815",
"0.68411815",
"0.68411815",
"0.6812601",
"0.6600043",
"0.65520954",
"0.65236604",
"0.651985",
"0.6449565",
"0.64147395",
"0.64147395",
"0.6399776",
"0.63694054",
"0.6326331",
"0.62... | 0.68247813 | 9 |
A native ad failed to load, check if the ad loader has finished loading and if so, insert the ads into the list. | @Override
public void onAdFailedToLoad(int errorCode) {
Log.e("MainActivity", "The previous native ad failed to load. Attempting to"
+ " load another.");
if (!adLoader.isLoading()) {
insertAdsInMenuItems();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void onAdFailedToLoad(LoadAdError loadAdError) {\n String error =\n String.format(\n \"domain: %s, code: %d, message: %s\",\n loadAdError.getDomain(), loadAdError.getCode(), loadAdError.getMessage());\n Log.e(\n ... | [
"0.6773519",
"0.6654509",
"0.6586618",
"0.6552209",
"0.6552209",
"0.6514985",
"0.6514985",
"0.6514985",
"0.6514985",
"0.6514985",
"0.6514985",
"0.6514985",
"0.6514985",
"0.6514985",
"0.6514985",
"0.6514985",
"0.6510663",
"0.65062165",
"0.6483152",
"0.6472204",
"0.6466612",
... | 0.68046755 | 0 |
TODO Autogenerated method stub | public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int A = scan.nextInt();
int B = scan.nextInt();
long x = scan.nextInt();
long y = scan.nextInt();
long z = scan.nextInt();
long requiredA = x * 2 + y;
long requiredB = y + z * 3;
long neededA = Math.max(0, requiredA - A);
long neededB = Math.max(0, requiredB - B);
System.out.print(neededA + neededB);
} | {
"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 |
implementations for extended InterpreterValue >> numberoperations This function gets executed when the operator '+' is used on the double | @Override
public InterpreterValue add(InterpreterValue v) {
// If the given value is a IntegerValue create a new DoubleValue from
// the addition-result
if(v instanceof IntegerValue) return new DoubleValue(getValue() + ((IntegerValue) v).getValue());
// If the given value is a DoubleValue create a new DoubleValue from
// the addition-result
if(v instanceof DoubleValue) return new DoubleValue(getValue() + ((DoubleValue) v).getValue());
// In other case just throw an error
throw new Error("Operator '+' is not defined for type double and " + v.getName());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void add()\r\n {\r\n resultDoubles = Operations.addition(leftOperand, rightOperand);\r\n resultResetHelper();\r\n }",
"protected abstract double operation(double val);",
"BaseNumber add(BaseNumber operand);",
"public void enfoncerPlus() {\n\t\ttry {\n\t\t\tthis.op = new Plus();\n\t\t\tif (!raz... | [
"0.6926353",
"0.675019",
"0.6450218",
"0.6387068",
"0.6319312",
"0.6288133",
"0.6273867",
"0.62700236",
"0.6259034",
"0.6247541",
"0.6205975",
"0.619259",
"0.6181131",
"0.61777943",
"0.6175855",
"0.6166907",
"0.6150326",
"0.6147178",
"0.61457014",
"0.61131024",
"0.6108964",
... | 0.73276514 | 0 |
This function gets executed when the operator '' is used on the double | @Override
public InterpreterValue sub(InterpreterValue v) {
// If the given value is a IntegerValue create a new DoubleValue from
// the subtraction-result
if(v instanceof IntegerValue) return new DoubleValue(getValue() - ((IntegerValue) v).getValue());
// If the given value is a DoubleValue create a new DoubleValue from
// the subtraction-result
if(v instanceof DoubleValue) return new DoubleValue(getValue() - ((DoubleValue) v).getValue());
// In other case just throw an error
throw new Error("Operator '-' is not defined for type double and " + v.getName());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void print(double someDouble) {\r\n print(someDouble + \"\");\r\n }",
"@Override\n public String visit(DoubleLiteralExpr n, Object arg) {\n return null;\n }",
"@Override\n\tpublic void visit(DoubleLiteral n) {\n\t\t\n\t}",
"public Snippet visit(CoercionToDoubleExpression n, Snip... | [
"0.70123696",
"0.6660561",
"0.65625787",
"0.6301871",
"0.62956583",
"0.6237324",
"0.6236484",
"0.62202495",
"0.621516",
"0.61662555",
"0.61385983",
"0.6119884",
"0.61124307",
"0.6072498",
"0.60679805",
"0.6036646",
"0.60345083",
"0.6017957",
"0.5984319",
"0.597892",
"0.596338... | 0.0 | -1 |
This function gets executed when the operator '' is used on the double | @Override
public InterpreterValue mul(InterpreterValue v) {
// If the given value is a IntegerValue create a new DoubleValue from
// the multiplication-result
if(v instanceof IntegerValue) return new DoubleValue(getValue() * ((IntegerValue) v).getValue());
// If the given value is a DoubleValue create a new DoubleValue from
// the multiplication-result
if(v instanceof DoubleValue) return new DoubleValue(getValue() * ((DoubleValue) v).getValue());
// In other case just throw an error
throw new Error("Operator '*' is not defined for type double and " + v.getName());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void print(double someDouble) {\r\n print(someDouble + \"\");\r\n }",
"@Override\n public String visit(DoubleLiteralExpr n, Object arg) {\n return null;\n }",
"@Override\n\tpublic void visit(DoubleLiteral n) {\n\t\t\n\t}",
"public Snippet visit(CoercionToDoubleExpression n, Snip... | [
"0.70123696",
"0.6660561",
"0.65625787",
"0.6301871",
"0.62956583",
"0.6237324",
"0.6236484",
"0.62202495",
"0.621516",
"0.61662555",
"0.61385983",
"0.6119884",
"0.61124307",
"0.6072498",
"0.60679805",
"0.6036646",
"0.60345083",
"0.6017957",
"0.5984319",
"0.597892",
"0.596338... | 0.0 | -1 |
This function gets executed when the operator '/' is used on the double | @Override
public InterpreterValue div(InterpreterValue v) {
// If the given value is a IntegerValue create a new DoubleValue from
// the division-result
if(v instanceof IntegerValue) return new DoubleValue(getValue() / ((IntegerValue) v).getValue());
// If the given value is a DoubleValue create a new DoubleValue from
// the division-result
if(v instanceof DoubleValue) return new DoubleValue(getValue() / ((DoubleValue) v).getValue());
// In other case just throw an error
throw new Error("Operator '/' is not defined for type double and " + v.getName());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract double operation(double val);",
"@Override\n public double calculate(double input)\n {\n return input/getValue();\n }",
"private Double check_mathOperator(Double result) {\n \r\n switch(mathOperator){\r\n case '/':\r\n result =totalFirs... | [
"0.66926754",
"0.66677874",
"0.6621252",
"0.6486757",
"0.6466879",
"0.6437575",
"0.6417483",
"0.6408106",
"0.63556516",
"0.6314545",
"0.62754935",
"0.6269384",
"0.62228876",
"0.621803",
"0.62040085",
"0.6192243",
"0.6156995",
"0.6156864",
"0.6145621",
"0.6122247",
"0.61087966... | 0.6883047 | 0 |
This function gets executed when the operator '%' is used on the double | @Override
public InterpreterValue mod(InterpreterValue v) {
// If the given value is a IntegerValue create a new DoubleValue from
// the modulo-result
if(v instanceof IntegerValue) return new DoubleValue(getValue() % ((IntegerValue) v).getValue());
// If the given value is a DoubleValue create a new DoubleValue from
// the modulo-result
if(v instanceof DoubleValue) return new DoubleValue(getValue() % ((DoubleValue) v).getValue());
// In other case just throw an error
throw new Error("Operator '%' is not defined for type double and " + v.getName());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public double calculate(double input)\n {\n return input/getValue();\n }",
"private void percent()\n\t{\n\t\tDouble percent;\t\t//holds the right value percentage of the left value\n\t\tString newText = \"\";//Holds the updated text \n\t\tif(calc.getLeftValue ( ) != 0.0 && Fun != null... | [
"0.6640394",
"0.6595065",
"0.6308639",
"0.6305766",
"0.6265934",
"0.61904967",
"0.61260283",
"0.60960484",
"0.60844225",
"0.60741013",
"0.6038899",
"0.6034199",
"0.60230106",
"0.59514344",
"0.5926849",
"0.591532",
"0.59064806",
"0.5868366",
"0.5863049",
"0.58388585",
"0.58241... | 0.70983416 | 0 |
This function gets executed when the operator '' is used on the double | @Override
public InterpreterValue pow(InterpreterValue v) {
// If the given value is a IntegerValue create a new DoubleValue from
// the power-result
if(v instanceof IntegerValue) return new DoubleValue(Math.pow(getValue(), ((IntegerValue) v).getValue()));
// If the given value is a DoubleValue create a new DoubleValue from
// the power-result
if(v instanceof DoubleValue) return new DoubleValue(Math.pow(getValue(), ((DoubleValue) v).getValue()));
// In other case just throw an error
throw new Error("Operator '**' is not defined for type double and " + v.getName());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void print(double someDouble) {\r\n print(someDouble + \"\");\r\n }",
"@Override\n public String visit(DoubleLiteralExpr n, Object arg) {\n return null;\n }",
"@Override\n\tpublic void visit(DoubleLiteral n) {\n\t\t\n\t}",
"public Snippet visit(CoercionToDoubleExpression n, Snip... | [
"0.70123696",
"0.6660561",
"0.65625787",
"0.6301871",
"0.62956583",
"0.6237324",
"0.6236484",
"0.62202495",
"0.621516",
"0.61662555",
"0.61385983",
"0.6119884",
"0.61124307",
"0.6072498",
"0.60679805",
"0.6036646",
"0.60345083",
"0.6017957",
"0.5984319",
"0.597892",
"0.596338... | 0.0 | -1 |
implementations for extended InterpreterValue >> comparison This function gets executed when the operator '==' is used on the double | @Override
public BooleanValue equals(InterpreterValue v) {
// If the given value is a IntegerValue then check if the value is equal
// to the own value and return a BooleanValue
if(v instanceof IntegerValue) return BooleanValue.from(getValue() == ((IntegerValue) v).getValue());
// If the given value is a DoubleValue then check if the value is equal
// to the own value and return a BooleanValue
if(v instanceof DoubleValue) return BooleanValue.from(getValue() == ((DoubleValue) v).getValue());
// In other case just throw an error
throw new Error("Operator '==' is not defined for type integer and " + v.getName());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isDouble();",
"public void equal() {\n if (operatorAssigned != Operator.NON || operatorType != Operator.NON) {\n double subResult;\n if (numberStored[1] != 0) {\n subResult = basicCalculation(numberStored[1], Double.parseDouble(mainLabel.getText()), oper... | [
"0.6107149",
"0.6080991",
"0.59573245",
"0.5929458",
"0.589117",
"0.5878663",
"0.5878199",
"0.5876318",
"0.5831031",
"0.58028406",
"0.5799955",
"0.5792691",
"0.5765156",
"0.57638055",
"0.5743091",
"0.57345045",
"0.5725216",
"0.5722977",
"0.5693088",
"0.56672186",
"0.5655081",... | 0.5440546 | 43 |
This function gets executed when the operator '$gt;=' is used on the double | @Override
public InterpreterValue bigger_equals(InterpreterValue v) {
// If the given value is a IntegerValue then check if the value is bigger than
// or equal to the own value and return a BooleanValue
if(v instanceof IntegerValue) return BooleanValue.from(getValue() >= ((IntegerValue) v).getValue());
// If the given value is a DoubleValue then check if the value is bigger than
// or equal to the own value and return a BooleanValue
if(v instanceof DoubleValue) return BooleanValue.from(getValue() >= ((DoubleValue) v).getValue());
// In other case just throw an error
throw new Error("Operator '>=' is not defined for type integer and " + v.getName());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean hasGt();",
"String getGreater();",
"public void testGreaterThanElement() {\n\t // fail(\"testGreaterThanElement\");\n \tCircuit circuit = new Circuit();\n \tDouble x1 = 0.5;\n \tAnd and = (And) circuit.getFactory().getGate(Gate.AND);\n\t\tNot not = (Not) circuit.getFactory().getGate(Gate.NOT)... | [
"0.60524714",
"0.5886445",
"0.57953435",
"0.576977",
"0.57684356",
"0.56663793",
"0.55815727",
"0.5527303",
"0.5517828",
"0.5479127",
"0.54672253",
"0.5458556",
"0.5458451",
"0.543927",
"0.54363155",
"0.5406549",
"0.5394386",
"0.5381566",
"0.5373033",
"0.53428125",
"0.5309517... | 0.0 | -1 |
This function gets executed when the operator '<=' is used on the doubles | @Override
public InterpreterValue smaller_equals(InterpreterValue v) {
// If the given value is a IntegerValue then check if the value is smaller than
// or equal to the own value and return a BooleanValue
if(v instanceof IntegerValue) return BooleanValue.from(getValue() <= ((IntegerValue) v).getValue());
// If the given value is a DoubleValue then check if the value is smaller than
// or equal to the own value and return a BooleanValue
if(v instanceof DoubleValue) return BooleanValue.from(getValue() <= ((DoubleValue) v).getValue());
// In other case just throw an error
throw new Error("Operator '<=' is not defined for type integer and " + v.getName());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\t\tpublic int compare(Double o1, Double o2) {\n\t\t\treturn o2.compareTo(o1);\r\n\t\t}",
"@Override\r\n\tpublic int compareTo(Double another) {\n\t\treturn 0;\r\n\t}",
"@Override\r\n\t\tpublic int compare(Double arg0, Double arg1) {\n\t\t\treturn arg0.compareTo(arg1);\r\n\t\t}",
"@Override\n\t\... | [
"0.6541076",
"0.65241444",
"0.644219",
"0.62942356",
"0.6262817",
"0.6258138",
"0.6218553",
"0.619541",
"0.6195262",
"0.61829334",
"0.6173139",
"0.6019844",
"0.6013288",
"0.5930819",
"0.5929726",
"0.5884291",
"0.58782023",
"0.58569497",
"0.58566445",
"0.58342075",
"0.58036834... | 0.53740126 | 68 |
This function gets executed when the operator '>' is used on the double | @Override
public InterpreterValue bigger(InterpreterValue v) {
// If the given value is a IntegerValue then check if the value is bigger than
// the own value and return a BooleanValue
if(v instanceof IntegerValue) return BooleanValue.from(getValue() > ((IntegerValue) v).getValue());
// If the given value is a DoubleValue then check if the value is bigger than
// the own value and return a BooleanValue
if(v instanceof DoubleValue) return BooleanValue.from(getValue() > ((DoubleValue) v).getValue());
// In other case just throw an error
throw new Error("Operator '>' is not defined for type integer and " + v.getName());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\t\tpublic int compare(Double o1, Double o2) {\n\t\t\treturn o2.compareTo(o1);\r\n\t\t}",
"public boolean greaterThan(NumberP other)\n {\n \treturn OperationsCompareTo.CompareDouble(this, other) == 1;\n }",
"@Override\r\n\t\tpublic int compare(Double arg0, Double arg1) {\n\t\t\treturn arg... | [
"0.6790741",
"0.6781772",
"0.67744094",
"0.67177486",
"0.6526389",
"0.647047",
"0.6344082",
"0.63393766",
"0.6335748",
"0.63289255",
"0.62778544",
"0.62740386",
"0.6273517",
"0.62591445",
"0.62129426",
"0.6179179",
"0.61558384",
"0.61328006",
"0.6080622",
"0.6050456",
"0.6011... | 0.5627306 | 51 |
This function gets executed when the operator '<' is used on the double | @Override
public InterpreterValue smaller(InterpreterValue v) {
// If the given value is a IntegerValue then check if the value is smaller than
// the own value and return a BooleanValue
if(v instanceof IntegerValue) return BooleanValue.from(getValue() < ((IntegerValue) v).getValue());
// If the given value is a DoubleValue then check if the value is smaller than
// the own value and return a BooleanValue
if(v instanceof DoubleValue) return BooleanValue.from(getValue() < ((DoubleValue) v).getValue());
// In other case just throw an error
throw new Error("Operator '<' is not defined for type integer and " + v.getName());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\t\tpublic int compare(Double arg0, Double arg1) {\n\t\t\treturn arg0.compareTo(arg1);\r\n\t\t}",
"@Override\r\n\t\tpublic int compare(Double o1, Double o2) {\n\t\t\treturn o2.compareTo(o1);\r\n\t\t}",
"public boolean lessThan(NumberP other)\n {\n \treturn OperationsCompareTo.CompareDouble(t... | [
"0.7144077",
"0.70901036",
"0.6924496",
"0.68414897",
"0.68396944",
"0.6578901",
"0.65637684",
"0.6539548",
"0.65369135",
"0.64996374",
"0.64292777",
"0.63904154",
"0.634121",
"0.6326068",
"0.63021505",
"0.62450325",
"0.620966",
"0.6201258",
"0.6200977",
"0.6180123",
"0.61672... | 0.5780772 | 50 |
Initialize a new XorShiftRandom using the current system time as a seed. | public XorShiftRandom() {
this(System.nanoTime());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public XorShiftRandom(final long seed) {\n\t\tthis.seed = seed;\n\t}",
"public XorShiftRandom(final XorShiftRandom random) {\n\t\tthis(random.getSeed());\n\t}",
"public XorShiftRandom(final Random random) {\n\t\t\n\t\ttry {\n\t\t\tif(getSeed != null)\n\t\t\t\tsetSeed(((AtomicLong)XorShiftRandom.getSeed.get(ran... | [
"0.7634386",
"0.7442761",
"0.727509",
"0.63463163",
"0.632356",
"0.6145694",
"0.6137781",
"0.6027675",
"0.59746283",
"0.59706944",
"0.5958992",
"0.595787",
"0.59505576",
"0.59222966",
"0.5900436",
"0.588342",
"0.58626896",
"0.5839081",
"0.58371425",
"0.5788854",
"0.578302",
... | 0.83812904 | 0 |
Initialize a new XorShiftRandom using the current seed value of the provided Random. | public XorShiftRandom(final Random random) {
try {
if(getSeed != null)
setSeed(((AtomicLong)XorShiftRandom.getSeed.get(random)).get());
} catch(Throwable t) {
;
} finally {
if(getSeed() == 0)
setSeed(System.nanoTime());
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public XorShiftRandom(final XorShiftRandom random) {\n\t\tthis(random.getSeed());\n\t}",
"public XorShiftRandom(final long seed) {\n\t\tthis.seed = seed;\n\t}",
"public XorShiftRandom() {\n\t\tthis(System.nanoTime());\n\t}",
"public Random(long seed) {\n real = new UniversalGenerator(seed);\n t... | [
"0.84538794",
"0.79681647",
"0.7835214",
"0.6438134",
"0.6234666",
"0.62294024",
"0.61918086",
"0.61054164",
"0.60281324",
"0.59849167",
"0.59420836",
"0.5908757",
"0.5870187",
"0.58430636",
"0.5821386",
"0.5782251",
"0.56596375",
"0.56523675",
"0.5611155",
"0.56090355",
"0.5... | 0.83611864 | 1 |
Initialize a new XorShiftRandom using the seed value of the provided XorShiftRandom instance. | public XorShiftRandom(final XorShiftRandom random) {
this(random.getSeed());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public XorShiftRandom(final long seed) {\n\t\tthis.seed = seed;\n\t}",
"public XorShiftRandom() {\n\t\tthis(System.nanoTime());\n\t}",
"public XorShiftRandom(final Random random) {\n\t\t\n\t\ttry {\n\t\t\tif(getSeed != null)\n\t\t\t\tsetSeed(((AtomicLong)XorShiftRandom.getSeed.get(random)).get());\n\t\t} catch... | [
"0.7859829",
"0.7728567",
"0.7333325",
"0.61296934",
"0.58948743",
"0.5638653",
"0.5551258",
"0.5551115",
"0.55147237",
"0.54921144",
"0.53986496",
"0.53976935",
"0.53879565",
"0.5384094",
"0.527776",
"0.52769166",
"0.52765775",
"0.5271865",
"0.52537936",
"0.5231391",
"0.5220... | 0.78410375 | 1 |
Initialize a new XorShiftRandom using the specified seed. | public XorShiftRandom(final long seed) {
this.seed = seed;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public XorShiftRandom(final XorShiftRandom random) {\n\t\tthis(random.getSeed());\n\t}",
"public XorShiftRandom() {\n\t\tthis(System.nanoTime());\n\t}",
"public XorShiftRandom(final Random random) {\n\t\t\n\t\ttry {\n\t\t\tif(getSeed != null)\n\t\t\t\tsetSeed(((AtomicLong)XorShiftRandom.getSeed.get(random)).ge... | [
"0.73796856",
"0.7347991",
"0.7077441",
"0.67196226",
"0.66560626",
"0.65683645",
"0.6517424",
"0.6404331",
"0.63789535",
"0.63390875",
"0.62855947",
"0.62750787",
"0.6230842",
"0.61615014",
"0.6047007",
"0.60252815",
"0.6014131",
"0.59666",
"0.5957604",
"0.59503925",
"0.5930... | 0.8639817 | 0 |
Gets the current seed value. | public long getSeed() {
return seed;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static long getSeed() {\r\n return seed;\r\n }",
"public long getSeed(){\n\t\treturn this.seed;\n\t}",
"public int getSeed() {\r\n return seed;\r\n }",
"public long getSeed() {\n return seed;\n }",
"public int getSeed() {\n return seed;\n }",
"public int getSeed()... | [
"0.8119474",
"0.8059007",
"0.80319947",
"0.80073917",
"0.7966063",
"0.7966063",
"0.7852292",
"0.7820206",
"0.7814707",
"0.7663458",
"0.763818",
"0.74653196",
"0.7405393",
"0.71944803",
"0.6983639",
"0.6854664",
"0.67085916",
"0.6675985",
"0.6649837",
"0.6555143",
"0.64486235"... | 0.80196375 | 3 |
Creates request for daily goals and sends as a json object. | private static String fetchElevHistory(){
RequestData req = new RequestData("activities/elevation/date/today/max"); //make request
req.sendRequest(); //send request
JSONObject json1 = new JSONObject(req.getBody()); //make json from response
JSONArray json = json1.getJSONArray("activities-elevation");
return json.toString(); //return goals as json
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void getWeekCalorieData(String accessToken, boolean getGoal) {\r\n ArrayList<String> taskParamsList = new ArrayList<>();\r\n taskParamsList.add(accessToken);\r\n\r\n Calendar startDate = getFirstMondayInWeek(endDate);\r\n\r\n SimpleDateFormat dateFormat = new SimpleDateFormat(ge... | [
"0.581421",
"0.5311068",
"0.5293046",
"0.52745426",
"0.51544774",
"0.5151782",
"0.514538",
"0.5046631",
"0.50244635",
"0.49809986",
"0.49770015",
"0.49507907",
"0.49412864",
"0.49093866",
"0.48898318",
"0.48855022",
"0.48539442",
"0.4849933",
"0.4830823",
"0.48269215",
"0.481... | 0.45329034 | 41 |
Returns calorie data from a specific date. | public double getElevationData(String date){
JSONArray array = new JSONArray(elevHistory);
for(int i = 0; i<array.length();i++){
JSONObject json = array.getJSONObject(i);
if(json.get("dateTime").equals(date))
return Double.parseDouble(json.get("value").toString());
}
return -1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Date getForDate();",
"public Calendar calendario(Date date) {\r\n Calendar calendar = Calendar.getInstance();\r\n calendar.setTime(date);\r\n return calendar;\r\n }",
"Date getDataIns();",
"public List<Serie> getCaloriesByDate(){\r\n\t\t\r\n\t\treturn daoEjercicio.getCaloriesByDate();... | [
"0.6762252",
"0.6728341",
"0.6576603",
"0.651115",
"0.63389987",
"0.6321007",
"0.6279307",
"0.62514347",
"0.6212287",
"0.6201274",
"0.61575073",
"0.6155857",
"0.6143856",
"0.6124674",
"0.6104081",
"0.6089662",
"0.6048322",
"0.6009964",
"0.5990576",
"0.5967053",
"0.59588397",
... | 0.0 | -1 |
Creates new form stock_view | public transact() {
initComponents();
//String type=jComboBox1.getSelectedItem().toString();
//JOptionPane.showMessageDialog(null,type);
try{
javaconnect connect=new javaconnect();
Connection conn=javaconnect.getConnection();
//Connection conn=null;
ResultSet rs=null;
Statement stmt=null;
PreparedStatement pst=null;
String sql6="select `id` as 'id',name as 'Name',detail as 'Description',quantity as 'Quantity',supplier as 'Supplier',price as 'Cost (Ksh)' from product";
pst=conn.prepareStatement(sql6);
rs=pst.executeQuery();
//JOptionPane.showMessageDialog(null,rs.getString("Quantity"));
jTable1.setModel(DbUtils.resultSetToTableModel(rs));
String sql2="select * from cart";
pst=conn.prepareStatement(sql2);
rs=pst.executeQuery();
cart.setModel(DbUtils.resultSetToTableModel(rs));
TableColumnModel tcm=jTable1.getColumnModel();
tcm.removeColumn(tcm.getColumn(0));
TableColumnModel tcm1=cart.getColumnModel();
tcm1.removeColumn(tcm1.getColumn(0));
ResultSet rs2=null;
PreparedStatement pst2=null;
String sql4="select SUM(total_cost) from cart";
pst2=conn.prepareStatement(sql4);
rs2=pst2.executeQuery();
while (rs2.next())
{
int std = rs2.getInt(1);
total_l.setText(String.valueOf(std));
}
DateFormat dtf=new SimpleDateFormat("yyyy-MM-dd");
// Date date=new Date();
Date date=new Date();
dtf.format(date);
sell_date.setDate(date);
String sql_ps="select id,name,detail,quantity,total_cost,profit,date_sold,sold_by from sells where date_sold like '%"+dtf.format(date)+"%' order by date_sold desc";
pst=conn.prepareStatement(sql_ps);
rs=pst.executeQuery();
t_sold.setModel(DbUtils.resultSetToTableModel(rs));
TableColumnModel tcm2=t_sold.getColumnModel();
tcm2.removeColumn(tcm2.getColumn(0));
}
catch(Exception e){
JOptionPane.showMessageDialog(null,e);
}
//DateFormat dtf=new SimpleDateFormat("yyyy/MM/dd");
//Date date=new Date();
//dtf.format(date);
// JOptionPane.showMessageDialog(null,dtf.format(date));
// sell_date.setDate(dtf.format(date));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public IndividualStockDetailsPage() {\n this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));\n this.add(new JLabel(\"ENTER TICKER SYMBOL\"));\n this.add(ticker);\n this.add(new JLabel(\"ENTER AMOUNT\"));\n this.add(amount);\n this.add(new JLabel(\"ENTER YEAR\"));\n this.add(year);\n this.... | [
"0.6413859",
"0.64030796",
"0.62953955",
"0.62758297",
"0.62673265",
"0.6190462",
"0.6155262",
"0.61434054",
"0.6141473",
"0.6118643",
"0.6013981",
"0.59111625",
"0.58705723",
"0.58658004",
"0.57693714",
"0.57555354",
"0.5727082",
"0.57255703",
"0.5719637",
"0.57077825",
"0.5... | 0.0 | -1 |
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor. | @SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
search = new javax.swing.JTextField();
jLabel7 = new javax.swing.JLabel();
jPanel5 = new javax.swing.JPanel();
detail = new javax.swing.JTextField();
jLabel11 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
name = new javax.swing.JTextField();
price = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
quantity = new javax.swing.JTextField();
jPanel6 = new javax.swing.JPanel();
jLabel6 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
jCheckBox1 = new javax.swing.JCheckBox();
jPanel7 = new javax.swing.JPanel();
jLabel31 = new javax.swing.JLabel();
total = new javax.swing.JLabel();
add_cart = new javax.swing.JPanel();
jLabel33 = new javax.swing.JLabel();
jComboBox1 = new javax.swing.JComboBox<>();
jTabbedPane1 = new javax.swing.JTabbedPane();
jScrollPane1 = new javax.swing.JScrollPane();
jTable1 = new javax.swing.JTable();
jPanel4 = new javax.swing.JPanel();
jScrollPane3 = new javax.swing.JScrollPane();
t_sold = new javax.swing.JTable();
jButton6 = new javax.swing.JButton();
sell_date = new com.toedter.calendar.JDateChooser();
jLabel28 = new javax.swing.JLabel();
paid = new javax.swing.JTextField();
jLabel29 = new javax.swing.JLabel();
jLabel30 = new javax.swing.JLabel();
jPanel3 = new javax.swing.JPanel();
jLabel27 = new javax.swing.JLabel();
jSeparator1 = new javax.swing.JSeparator();
jTabbedPane2 = new javax.swing.JTabbedPane();
jPanel8 = new javax.swing.JPanel();
jScrollPane2 = new javax.swing.JScrollPane();
cart = new javax.swing.JTable();
jPanel10 = new javax.swing.JPanel();
jButton1 = new javax.swing.JButton();
jLabel34 = new javax.swing.JLabel();
total_l = new javax.swing.JLabel();
jPanel11 = new javax.swing.JPanel();
jLabel35 = new javax.swing.JLabel();
balance = new javax.swing.JLabel();
total_b = new javax.swing.JTextField();
jLabel42 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
jPanel1.setBackground(new java.awt.Color(0, 102, 204));
search.setBackground(new java.awt.Color(153, 204, 255));
search.setFont(new java.awt.Font("Century Gothic", 1, 16)); // NOI18N
search.setForeground(new java.awt.Color(255, 255, 255));
search.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 153, 255), 3));
search.setSelectedTextColor(new java.awt.Color(0, 51, 51));
search.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
searchActionPerformed(evt);
}
});
search.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
searchKeyReleased(evt);
}
});
jLabel7.setFont(new java.awt.Font("Century Gothic", 1, 18)); // NOI18N
jLabel7.setForeground(new java.awt.Color(255, 255, 255));
jLabel7.setText("Search");
jPanel5.setBackground(new java.awt.Color(0, 102, 204));
detail.setBackground(new java.awt.Color(153, 204, 255));
detail.setFont(new java.awt.Font("Century Gothic", 1, 16)); // NOI18N
detail.setForeground(new java.awt.Color(255, 255, 255));
detail.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 153, 255), 3));
detail.setEnabled(false);
jLabel11.setFont(new java.awt.Font("Century Gothic", 1, 14)); // NOI18N
jLabel11.setForeground(new java.awt.Color(255, 255, 255));
jLabel11.setText("NAME");
jLabel2.setFont(new java.awt.Font("Century Gothic", 1, 14)); // NOI18N
jLabel2.setForeground(new java.awt.Color(255, 255, 255));
jLabel2.setText("DESCRIPTION");
name.setBackground(new java.awt.Color(153, 204, 255));
name.setFont(new java.awt.Font("Century Gothic", 1, 16)); // NOI18N
name.setForeground(new java.awt.Color(255, 255, 255));
name.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 153, 255), 3));
name.setEnabled(false);
name.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
nameActionPerformed(evt);
}
});
price.setBackground(new java.awt.Color(153, 204, 255));
price.setFont(new java.awt.Font("Century Gothic", 1, 16)); // NOI18N
price.setForeground(new java.awt.Color(255, 255, 255));
price.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 153, 255), 3));
price.setEnabled(false);
price.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
priceActionPerformed(evt);
}
});
price.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
priceKeyReleased(evt);
}
});
jLabel3.setFont(new java.awt.Font("Century Gothic", 1, 14)); // NOI18N
jLabel3.setForeground(new java.awt.Color(255, 255, 255));
jLabel3.setText("COST");
jLabel4.setFont(new java.awt.Font("Century Gothic", 1, 14)); // NOI18N
jLabel4.setForeground(new java.awt.Color(255, 255, 255));
jLabel4.setText("QUANTITY");
jLabel5.setFont(new java.awt.Font("Century Gothic", 1, 18)); // NOI18N
jLabel5.setForeground(new java.awt.Color(255, 255, 255));
jLabel5.setText("TOTAL");
quantity.setBackground(new java.awt.Color(163, 204, 255));
quantity.setFont(new java.awt.Font("Century Gothic", 1, 16)); // NOI18N
quantity.setForeground(new java.awt.Color(255, 255, 255));
quantity.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 153, 255), 3));
quantity.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
quantityActionPerformed(evt);
}
});
quantity.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
quantityKeyReleased(evt);
}
});
jPanel6.setBackground(new java.awt.Color(0, 153, 51));
jPanel6.setEnabled(false);
jPanel6.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jPanel6MouseClicked(evt);
}
});
jLabel6.setFont(new java.awt.Font("Century Gothic", 1, 16)); // NOI18N
jLabel6.setForeground(new java.awt.Color(255, 255, 255));
jLabel6.setText("Sell");
javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
jPanel6.setLayout(jPanel6Layout);
jPanel6Layout.setHorizontalGroup(
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 111, Short.MAX_VALUE)
.addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel6Layout.createSequentialGroup()
.addGap(0, 42, Short.MAX_VALUE)
.addComponent(jLabel6)
.addGap(0, 43, Short.MAX_VALUE)))
);
jPanel6Layout.setVerticalGroup(
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 40, Short.MAX_VALUE)
.addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel6Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(jLabel6)
.addGap(0, 0, Short.MAX_VALUE)))
);
jLabel1.setFont(new java.awt.Font("Century Gothic", 0, 36)); // NOI18N
jLabel1.setForeground(new java.awt.Color(255, 255, 255));
jLabel1.setText("Customer Transaction");
jCheckBox1.setBackground(new java.awt.Color(0, 102, 204));
jCheckBox1.setForeground(new java.awt.Color(255, 255, 255));
jCheckBox1.setText("Negotiable");
jCheckBox1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jCheckBox1ActionPerformed(evt);
}
});
jPanel7.setBackground(new java.awt.Color(0, 153, 51));
jPanel7.setEnabled(false);
jPanel7.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jPanel7MouseClicked(evt);
}
});
jLabel31.setFont(new java.awt.Font("Century Gothic", 1, 16)); // NOI18N
jLabel31.setForeground(new java.awt.Color(255, 255, 255));
jLabel31.setText("Sell");
javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
jPanel7.setLayout(jPanel7Layout);
jPanel7Layout.setHorizontalGroup(
jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 100, Short.MAX_VALUE)
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel7Layout.createSequentialGroup()
.addGap(0, 37, Short.MAX_VALUE)
.addComponent(jLabel31)
.addGap(0, 37, Short.MAX_VALUE)))
);
jPanel7Layout.setVerticalGroup(
jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 40, Short.MAX_VALUE)
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel7Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(jLabel31)
.addGap(0, 0, Short.MAX_VALUE)))
);
total.setFont(new java.awt.Font("Century Gothic", 1, 36)); // NOI18N
total.setForeground(new java.awt.Color(255, 255, 255));
total.setText("0");
total.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
total.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
public void propertyChange(java.beans.PropertyChangeEvent evt) {
totalPropertyChange(evt);
}
});
add_cart.setBackground(new java.awt.Color(0, 153, 255));
add_cart.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
add_cartMouseClicked(evt);
}
});
jLabel33.setFont(new java.awt.Font("Century Gothic", 1, 20)); // NOI18N
jLabel33.setForeground(new java.awt.Color(255, 255, 255));
jLabel33.setText(">>");
javax.swing.GroupLayout add_cartLayout = new javax.swing.GroupLayout(add_cart);
add_cart.setLayout(add_cartLayout);
add_cartLayout.setHorizontalGroup(
add_cartLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, add_cartLayout.createSequentialGroup()
.addContainerGap(25, Short.MAX_VALUE)
.addComponent(jLabel33)
.addGap(23, 23, 23))
);
add_cartLayout.setVerticalGroup(
add_cartLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel33, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
jPanel5.setLayout(jPanel5Layout);
jPanel5Layout.setHorizontalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addGap(34, 34, 34)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addComponent(jLabel5)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(jPanel5Layout.createSequentialGroup()
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(120, 120, 120)
.addComponent(price, javax.swing.GroupLayout.PREFERRED_SIZE, 178, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 21, Short.MAX_VALUE)
.addComponent(jCheckBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(139, 139, 139))))
.addGroup(jPanel5Layout.createSequentialGroup()
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addGap(12, 12, 12)
.addComponent(jLabel1))
.addGroup(jPanel5Layout.createSequentialGroup()
.addGap(34, 34, 34)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
.addComponent(jLabel11)
.addGap(120, 120, 120)
.addComponent(name, javax.swing.GroupLayout.PREFERRED_SIZE, 367, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
.addComponent(jLabel2)
.addGap(73, 73, 73)
.addComponent(detail, javax.swing.GroupLayout.PREFERRED_SIZE, 367, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGroup(jPanel5Layout.createSequentialGroup()
.addGap(34, 34, 34)
.addComponent(jLabel4)
.addGap(95, 95, 95)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(total, javax.swing.GroupLayout.PREFERRED_SIZE, 217, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(quantity, javax.swing.GroupLayout.PREFERRED_SIZE, 178, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
.addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(50, 50, 50))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
.addComponent(add_cart, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(45, 45, 45)
.addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())))
);
jPanel5Layout.setVerticalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addGap(38, 38, 38)
.addComponent(jLabel1)
.addGap(70, 70, 70)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addGap(9, 9, 9)
.addComponent(jLabel11))
.addComponent(name, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(47, 47, 47)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addGap(9, 9, 9)
.addComponent(jLabel2))
.addComponent(detail, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(47, 47, 47)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addGap(9, 9, 9)
.addComponent(jLabel3))
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(price, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jCheckBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addGap(52, 52, 52)
.addComponent(jLabel4))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
.addGap(43, 43, 43)
.addComponent(quantity, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(57, 57, 57)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(total, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(31, 31, 31)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(add_cart, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 1233, Short.MAX_VALUE)
.addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(54, 54, 54))
);
jComboBox1.setBackground(new java.awt.Color(153, 204, 255));
jComboBox1.setFont(new java.awt.Font("Century Gothic", 1, 12)); // NOI18N
jComboBox1.setForeground(new java.awt.Color(255, 255, 255));
jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Name", "Detail", "Supplier" }));
jComboBox1.setToolTipText("Search Field (Column)");
jComboBox1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jComboBox1MouseClicked(evt);
}
});
jComboBox1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jComboBox1ActionPerformed(evt);
}
});
jTable1.setBackground(new java.awt.Color(51, 153, 255));
jTable1.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
jTable1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseReleased(java.awt.event.MouseEvent evt) {
jTable1MouseReleased(evt);
}
});
jTable1.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
jTable1KeyReleased(evt);
}
});
jScrollPane1.setViewportView(jTable1);
jTabbedPane1.addTab("PRODUCTS ON STOCK", jScrollPane1);
t_sold.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
jScrollPane3.setViewportView(t_sold);
jButton6.setText("Filter");
jButton6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton6ActionPerformed(evt);
}
});
sell_date.setDateFormatString("yyyy-MM-dd");
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 637, Short.MAX_VALUE)
.addGroup(jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addComponent(sell_date, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jButton6)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton6)
.addComponent(sell_date, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 147, Short.MAX_VALUE))
);
jTabbedPane1.addTab("PRODUCTS SOLD", jPanel4);
jLabel28.setFont(new java.awt.Font("Century Gothic", 1, 18)); // NOI18N
jLabel28.setForeground(new java.awt.Color(255, 255, 255));
jLabel28.setText("Balance Calculation");
paid.setBackground(new java.awt.Color(163, 204, 255));
paid.setFont(new java.awt.Font("Century Gothic", 1, 18)); // NOI18N
paid.setForeground(new java.awt.Color(255, 255, 255));
paid.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 153, 255), 3));
paid.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
paidActionPerformed(evt);
}
});
jLabel29.setFont(new java.awt.Font("Century Gothic", 1, 16)); // NOI18N
jLabel29.setForeground(new java.awt.Color(255, 255, 255));
jLabel29.setText("Balance");
jLabel30.setFont(new java.awt.Font("Century Gothic", 1, 16)); // NOI18N
jLabel30.setForeground(new java.awt.Color(255, 255, 255));
jLabel30.setText("Paid");
jPanel3.setBackground(new java.awt.Color(221, 217, 222));
jPanel3.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jPanel3MouseClicked(evt);
}
});
jPanel3.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
jPanel3KeyReleased(evt);
}
});
jLabel27.setFont(new java.awt.Font("Dialog", 1, 16)); // NOI18N
jLabel27.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel27.setText("Calculate");
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel27, javax.swing.GroupLayout.DEFAULT_SIZE, 87, Short.MAX_VALUE)
.addContainerGap())
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel27, javax.swing.GroupLayout.DEFAULT_SIZE, 30, Short.MAX_VALUE)
);
cart.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
jScrollPane2.setViewportView(cart);
jPanel10.setBackground(new java.awt.Color(0, 204, 204));
jButton1.setText("Delete");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jLabel34.setFont(new java.awt.Font("Century Gothic", 1, 16)); // NOI18N
jLabel34.setForeground(new java.awt.Color(255, 255, 255));
jLabel34.setText("Total");
total_l.setFont(new java.awt.Font("Century Gothic", 1, 22)); // NOI18N
total_l.setForeground(new java.awt.Color(255, 255, 255));
total_l.setText("0");
total_l.addInputMethodListener(new java.awt.event.InputMethodListener() {
public void caretPositionChanged(java.awt.event.InputMethodEvent evt) {
total_lCaretPositionChanged(evt);
}
public void inputMethodTextChanged(java.awt.event.InputMethodEvent evt) {
}
});
jPanel11.setBackground(new java.awt.Color(0, 153, 51));
jPanel11.setEnabled(false);
jPanel11.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jPanel11MouseClicked(evt);
}
});
jLabel35.setFont(new java.awt.Font("Century Gothic", 1, 14)); // NOI18N
jLabel35.setForeground(new java.awt.Color(255, 255, 255));
jLabel35.setText("Sell");
javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
jPanel11.setLayout(jPanel11Layout);
jPanel11Layout.setHorizontalGroup(
jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 63, Short.MAX_VALUE)
.addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel11Layout.createSequentialGroup()
.addGap(0, 20, Short.MAX_VALUE)
.addComponent(jLabel35)
.addGap(0, 19, Short.MAX_VALUE)))
);
jPanel11Layout.setVerticalGroup(
jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 0, Short.MAX_VALUE)
.addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel11Layout.createSequentialGroup()
.addGap(0, 3, Short.MAX_VALUE)
.addComponent(jLabel35)
.addGap(0, 4, Short.MAX_VALUE)))
);
javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
jPanel10.setLayout(jPanel10Layout);
jPanel10Layout.setHorizontalGroup(
jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel10Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jButton1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 31, Short.MAX_VALUE)
.addComponent(jLabel34, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(total_l, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE))
);
jPanel10Layout.setVerticalGroup(
jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel10Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel34)
.addComponent(total_l))
.addComponent(jButton1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel11, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
jPanel8.setLayout(jPanel8Layout);
jPanel8Layout.setHorizontalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
);
jPanel8Layout.setVerticalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel8Layout.createSequentialGroup()
.addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 193, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
);
jTabbedPane2.addTab(" PRODUCT LIST", jPanel8);
balance.setFont(new java.awt.Font("Century Gothic", 1, 22)); // NOI18N
balance.setForeground(new java.awt.Color(255, 255, 255));
balance.setText("0");
total_b.setBackground(new java.awt.Color(163, 204, 255));
total_b.setFont(new java.awt.Font("Century Gothic", 1, 18)); // NOI18N
total_b.setForeground(new java.awt.Color(255, 255, 255));
total_b.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 153, 255), 3));
total_b.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
total_bActionPerformed(evt);
}
});
jLabel42.setFont(new java.awt.Font("Century Gothic", 1, 16)); // NOI18N
jLabel42.setForeground(new java.awt.Color(255, 255, 255));
jLabel42.setText("Total");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel28)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel29)
.addComponent(jLabel30)
.addComponent(jLabel42))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(22, 22, 22)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(balance, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jPanel1Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(total_b, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(paid, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))))))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jTabbedPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 347, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(20, 20, 20))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addGap(0, 5, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addComponent(search, javax.swing.GroupLayout.PREFERRED_SIZE, 280, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel7)
.addGap(177, 177, 177)
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 568, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(48, 48, 48))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 642, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())))))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(75, 75, 75)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel7)
.addComponent(search, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 219, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel28)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(paid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel30))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(total_b, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel42))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel29)
.addComponent(balance))
.addGap(18, 18, 18)
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(92, 92, 92))
.addComponent(jTabbedPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 282, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(1291, 1291, 1291))
.addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
setSize(new java.awt.Dimension(1325, 713));
setLocationRelativeTo(null);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Form() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n }",
"public frmRectangulo() {\n initComponents();\n }",
"public form() {\n ... | [
"0.73191476",
"0.72906625",
"0.72906625",
"0.72906625",
"0.72860986",
"0.7248112",
"0.7213479",
"0.72078276",
"0.7195841",
"0.71899796",
"0.71840525",
"0.7158498",
"0.71477973",
"0.7092748",
"0.70800966",
"0.70558053",
"0.69871384",
"0.69773406",
"0.69548076",
"0.69533914",
"... | 0.0 | -1 |
GENFIRST:event_jCheckBox1ActionPerformed TODO add your handling code here: | private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {
if(price.isEnabled()){
price.setEnabled(false);
}else{
price.setEnabled(true);
}
;
// if(price.enabled(true))
// {}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent evt) {\n\t\t\t\tcheckboxsActionPerformed(evt);\n\t\t\t}",
"private void jCheckBoxCffActionPerformed(ActionEvent e) {\n\t\tsetFileNameExtension();\n\t}",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Co... | [
"0.74542314",
"0.7190808",
"0.708534",
"0.6955852",
"0.695125",
"0.6950609",
"0.68940383",
"0.68919843",
"0.6872682",
"0.6851578",
"0.6846802",
"0.68180394",
"0.6788043",
"0.6787499",
"0.67831874",
"0.67156",
"0.66722494",
"0.66722494",
"0.66722494",
"0.66657245",
"0.66619104... | 0.6475082 | 36 |
public static int a=0; | private void add_cartMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_add_cartMouseClicked
Statement stmt=null;
String name_d=name.getText();
String detail_d=detail.getText();
String price_d=price.getText();
String quantity_d=quantity.getText();
String supplier_d=total.getText();
try{
javaconnect connect=new javaconnect();
Connection conn=javaconnect.getConnection();
ResultSet rs=null;
// Statement stmt=null;
PreparedStatement pst=null;
int index=jTable1.getSelectedRow();
TableModel model=jTable1.getModel();
String id_e = model.getValueAt(index, 0).toString();
String name_e = model.getValueAt(index, 1).toString();
String detail_e = model.getValueAt(index, 2).toString();
String price_e = model.getValueAt(index, 5).toString();
String quantity_e = model.getValueAt(index, 3).toString();
String supplier_e = model.getValueAt(index, 4).toString();
//Statement stmt=null;
int tb_quantity=Integer.parseInt(quantity_e);
int tx_quantity=Integer.parseInt(quantity.getText());
if(tb_quantity>tx_quantity){
PreparedStatement pst_p=null;
ResultSet rs_p=null;
String sql_p="SELECT buying_price FROM product WHERE id='"+id_e+"'";
pst=conn.prepareStatement(sql_p);
rs_p=pst.executeQuery();
String usr_p=null;
while (rs_p.next())
{
String std_p= (rs_p.getString(1));
float pt=Float.valueOf(total.getText())-(Float.valueOf(quantity.getText())*Float.valueOf(std_p));
usr_p=String.valueOf(pt);
//JOptionPane.showMessageDialog(null,usr_p);
//System.out.println(usr_p);
//int a=Integer.parseInt(usr_p);
}
String find="select * from cart where id='"+id_e+"'";
pst=conn.prepareStatement(find);
rs=pst.executeQuery();
if(!rs.next()){
String sql="insert into cart(id,name,detail,quantity,total_cost,profit) values('"+id_e+"','"+name_d+"','"+detail_d+"','"+quantity_d+"','"+total.getText()+"','"+usr_p+"')";
stmt=conn.createStatement();
stmt.executeUpdate(sql);
String sql2="select * from cart";
pst=conn.prepareStatement(sql2);
rs=pst.executeQuery();
cart.setModel(DbUtils.resultSetToTableModel(rs));
TableColumnModel tcm1=cart.getColumnModel();
tcm1.removeColumn(tcm1.getColumn(0));
/*String sql6="select `id` as 'id',name as 'Name',detail as 'Description',quantity as 'Quantity',supplier as 'Supplier',price as 'Cost (Ksh)' from product";
pst=conn.prepareStatement(sql6);
rs=pst.executeQuery();
JOptionPane.showMessageDialog(null,rs.getString("Quantity"));
String quantity_r=rs.getString("Quantity");*/
try{
int rem=Integer.parseInt(quantity_e)-Integer.parseInt(quantity.getText());
/* rem=rem-1;
rem=rem-a;
a=a+1;*/
String red="update product set quantity='"+rem+"' where id='"+id_e+"'";
stmt=conn.createStatement();
stmt.executeUpdate(red);
String sql3="select `id` as 'id',name as 'Name',detail as 'Description',quantity as 'Quantity',supplier as 'Supplier',price as 'Cost (Ksh)' from product";
pst=conn.prepareStatement(sql3);
rs=pst.executeQuery();
jTable1.setModel(DbUtils.resultSetToTableModel(rs));
TableColumnModel tcm=jTable1.getColumnModel();
tcm.removeColumn(tcm.getColumn(0));
//JOptionPane.showMessageDialog(null,Integer.parseInt(quantity.getText()));
try{
ResultSet rs2=null;
PreparedStatement pst2=null;
String sql4="select SUM(total_cost) from cart";
pst2=conn.prepareStatement(sql4);
rs2=pst2.executeQuery();
while (rs2.next())
{
int std = rs2.getInt(1);
total_l.setText(String.valueOf(std));
}
}
catch(SQLException e){
JOptionPane.showMessageDialog(null,e);
}
}
catch(NumberFormatException | SQLException e){
JOptionPane.showMessageDialog(null,e+"yap");
}
// JOptionPane.showMessageDialog(null,"Product Succefully updated");
}else{
JOptionPane.showMessageDialog(null,"Item already dded");
}
name.setText("");
detail.setText("");
quantity.setText("");
price.setText("");
total.setText("0");
paid.setText(null);
balance.setText(null);
total_b.setText("0");}else
if(tb_quantity==0){
JOptionPane.showMessageDialog(null,"Product out of Stock");
}else
{
JOptionPane.showMessageDialog(null,"Please enter valid quantity");
}
}catch(Exception e){
JOptionPane.showMessageDialog(null,e);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static void m1(int a){\n\t\ta=Static11.a;\nSystem.out.println(a);\n\t}",
"StaticVariable(){\n count++;//incrementing the value of static variable\n System.out.println(count);\n }",
"public static void a() {\n\n }",
"public static aa a() {\n }",
"public int a() {\n return 6;\n ... | [
"0.7404771",
"0.6822549",
"0.64874536",
"0.6380893",
"0.63447833",
"0.6227142",
"0.6221692",
"0.6221692",
"0.62077147",
"0.61194915",
"0.6110416",
"0.6110416",
"0.61064833",
"0.60686433",
"0.6059204",
"0.6008953",
"0.5956189",
"0.5955277",
"0.59442925",
"0.59271145",
"0.58855... | 0.0 | -1 |
the constructor for a "SendWalletThread" | public SendWalletThread(String[] address,Wallet wallet) {
this.WALLET = wallet;
ADDRESS= address;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public dc_wallet() {}",
"public TicketBoothClient()\n {\n Thread myThread = new Thread(this);\n myThread.start();\n }",
"NetThread(){}",
"public WifiProtocol(){\r\n// messages = new String[100];\r\n// index = 0;\r\n }",
"@Override\n public void run() {\n ... | [
"0.65062237",
"0.63674986",
"0.6147715",
"0.60023284",
"0.600153",
"0.59582657",
"0.59056413",
"0.5825903",
"0.5815804",
"0.5808663",
"0.58068264",
"0.5779158",
"0.57512647",
"0.5736613",
"0.5732024",
"0.57184744",
"0.5707597",
"0.5705288",
"0.56743795",
"0.56710434",
"0.5640... | 0.7652482 | 0 |
this handles both normal file resources and url resources that were added as "existing resources" | public boolean isNameCustom(String itemName)
{
boolean custom = itemName != null && !itemName.equalsIgnoreCase(getResourceProperties().getProperty(ResourceProperties.PROP_DISPLAY_NAME));
// if custom by logic above, check for url resources that were added as new resources by Lessons
// the item name for urls added this way will have a protocol prefix (ie. https://)
// if the protocol prefix does not appear, consider this to be custom
if (custom && URL_RESOURCE_TYPE.equals(getResourceType()))
{
custom = itemName != null && !itemName.matches(URL_HAS_PROTOCOL_REGEX);
}
return custom;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void testResourceFile() {\n\t\tArrayList l = new ArrayList();\n\t\tl.add(\"http://www.google.it\");\n\t\tl.add(\"http://www.microsoft.com\");\n\t\t/*\n\t\tDownloader d = new Downloader(1);\n\t\tlogger\n\t\t\t\t.log(\n\t\t\t\t\t\tLevel.INFO,\n\t\t\t\t\t\"TEST ResourceFile implementation. Url downloade... | [
"0.62108034",
"0.6135801",
"0.61254966",
"0.608055",
"0.6032109",
"0.59366053",
"0.5913654",
"0.5899331",
"0.5881052",
"0.58748317",
"0.58507586",
"0.5844875",
"0.58188015",
"0.58100134",
"0.5788955",
"0.57738185",
"0.5773283",
"0.57541865",
"0.5736653",
"0.57067317",
"0.5704... | 0.0 | -1 |
/return "" + Integer.toHexString(getRed()) +Integer.toHexString(getGreen()) +Integer.toHexString(getBlue()); | public String getHexa() {
return String.format("#%02x%02x%02x", getRed(), getGreen(), getBlue());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String toString(){\n\t\treturn (red + \" \" + green + \" \" + blue + \"\\n\");\n\t}",
"public String toString() {\n return \"#ffff00\";\n }",
"@Override\n public String toString() {\n if(a != -1) {\n return String.format(\"#%08X\", toARGB());\n } else {\n ... | [
"0.7639786",
"0.75290304",
"0.7241294",
"0.7197489",
"0.709152",
"0.69463307",
"0.6926897",
"0.6882251",
"0.6741949",
"0.6723922",
"0.6717134",
"0.6704613",
"0.6692321",
"0.6682251",
"0.66759557",
"0.6656652",
"0.6641935",
"0.6610729",
"0.65875125",
"0.6551091",
"0.6533476",
... | 0.740147 | 2 |
/ Compares two moves excluding their flags. | public boolean isSameAs(Move comp){
return this.xFrom==comp.xFrom &&
this.xTo==comp.xTo &&
this.yFrom==comp.yFrom &&
this.yTo==comp.yTo;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean isUnblockedMove(Square from, Square to) {\r\n int dir = from.direction(to);\r\n SqList rook = ROOK_SQUARES[from.index()][dir];\r\n int indexTo = rook.indexOf(to);\r\n for (int i = indexTo; i >= 0; i--) {\r\n if (map.get(rook.get(i)) != EMPTY) {\r\n retu... | [
"0.6087523",
"0.5974479",
"0.59341687",
"0.5863401",
"0.5787927",
"0.57813853",
"0.56098706",
"0.56071466",
"0.54857564",
"0.5483651",
"0.5466652",
"0.5437717",
"0.5427178",
"0.5424617",
"0.5408486",
"0.5400288",
"0.53847504",
"0.5374186",
"0.5374043",
"0.535239",
"0.5346885"... | 0.5448531 | 11 |
System.out.println("in update controller "+user); | @RequestMapping(value = "/editUserData" , method = RequestMethod.POST)
public String saveEditUser(@ModelAttribute("updateDetails") LoginUser user, Model model)
{
LoginUser updatedDetails=loginService.updateData(user);
// System.out.println("return in controller "+l);
model.addAttribute("updatedDetails", updatedDetails);
return "login";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void updateUser() {\n\t\tSystem.out.println(\"com.zzu.yhl.a_jdk updateUser\");\r\n\t}",
"public void editUser(User user) {\n\t\t\n\t}",
"public void update(User u) {\n\r\n\t}",
"@Override\n // Update user\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n ... | [
"0.72089475",
"0.7086436",
"0.70185065",
"0.7005314",
"0.6995714",
"0.69630015",
"0.69630015",
"0.69196",
"0.6826647",
"0.6800715",
"0.679537",
"0.6747495",
"0.66330105",
"0.6629408",
"0.66287774",
"0.6622626",
"0.66068876",
"0.6601611",
"0.65864736",
"0.6545299",
"0.65447307... | 0.6903319 | 8 |
Primitive Data Types 1. integer data type 32 bit | public static void main(String[] args) {
int x; //declaring
int y=123456789; //initializing/assigning the value of y to be 10 --> 10 does not equal to y but y=10
Integer c=3;
Integer a=new Integer(3);
//2. double is numbers with decimal number
double d= 2.1;
//3. boolean two type true or false
boolean bool= true; //true=1
boolean bool1=false;//false=0
//4. byte 8-bit data type
byte b=123;
//5. short 16-bit data type
short srt=12345;
//6. long 64-bit data type
long lng= 4;
//7. float data typr 32 bit
float f=3;
float f1='s';
//8. Char variable type
char ch= 'C';
/**********complex objects or reference not *************/
//1. Strings variable type
//string pool
String s="hu"; //declaring
String r= new String("hello");
r="hhh";
s="hi";
String str= " my name is rasmi"; //assigning the value of str to be h--> h does not equal to str
//
int num='x';
int sum=num+2;
System.out.println("num:"+ num +" "+"sum:"+sum);
/******* enums******/
Color c1=Color.RED;
System.out.println( "Enum Color: " +c1);
int num1=0,num2=0;
String chair,table="metal";
//chair=chair+table; // chair not initialized
//System.out.println("chair: "+chair);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic long as32Bit() throws AssembleError {\n\t\treturn 0;\n\t}",
"public abstract Number getPrimitiveType();",
"PrimitiveType createPrimitiveType();",
"public boolean hasInteger32() {\n return result.hasInteger32();\n }",
"public PrimitiveType getPrimitiveType();",
"public Llvm... | [
"0.6975011",
"0.6815955",
"0.66700584",
"0.63773143",
"0.6373265",
"0.63350284",
"0.63326395",
"0.6210364",
"0.61883676",
"0.6146998",
"0.61278147",
"0.6111898",
"0.6106834",
"0.6097822",
"0.6070073",
"0.6069903",
"0.6056452",
"0.5998018",
"0.5994188",
"0.59776187",
"0.597331... | 0.0 | -1 |
prints the current high scores to the highscores menu | private void settings() {
mainTitle = makeLabel("Settings", true);
add(mainTitle);
add(content);
add(diffSlider);
add(colourChooser);
add(mainB);//button to main menu
diffSlider.requestFocus();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void showScores() {\n levelNumber.setText(String.format(\"%s%d\", getResources().getString(R.string.level), level));\n Level l = Level.getLevel(level);\n for (int i = 0; i < Level.MAX_SCORES; i++) {\n Level.Player p = l.getPlayer(i);\n if (p != null) new ScoreText... | [
"0.68725866",
"0.6814455",
"0.67859405",
"0.6766853",
"0.6754001",
"0.67511994",
"0.67451966",
"0.6736652",
"0.6708402",
"0.6693114",
"0.66735107",
"0.65892935",
"0.65201056",
"0.6508623",
"0.6505515",
"0.6491966",
"0.6489947",
"0.6475344",
"0.64325",
"0.6398136",
"0.6395976"... | 0.0 | -1 |
when button is pressed | @Override
public void actionPerformed(ActionEvent e) {
removeAll();
switch (in) {
case 1:
initial();
button.setToolTipText("To main menu");
break;
case 2:
settings();
button.setToolTipText("To settings");
break;
default:
highScores();
button.setToolTipText("To high scores");
break;
}
revalidate();
repaint();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void buttonClicked();",
"@Override\n\tprotected void on_button_pressed(String button_name) {\n\n\t}",
"public void buttonClicked() {\n mSanitizorGame.buttonClicked();\n }",
"public void onButtonAPressed();",
"void buttonGo_actionPerformed(ActionEvent e) {\n\n\n }",
"void mainButtonPress... | [
"0.79603904",
"0.7830349",
"0.76130056",
"0.7553383",
"0.7523605",
"0.73870367",
"0.7284341",
"0.72568685",
"0.71961856",
"0.7178323",
"0.7150953",
"0.7143568",
"0.7134279",
"0.713406",
"0.71244586",
"0.7069205",
"0.70638996",
"0.70488137",
"0.7047523",
"0.7047523",
"0.704752... | 0.0 | -1 |
method made to simplify the appearence and actins of buttons | private JLabel makeLabel(String title, boolean h1) {
JLabel label = new JLabel(title);
if (h1 == true) {//if the label is to be a title
label.setForeground(themeColor);
label.setFont(new Font("Terminal Bold", Font.PLAIN, 48));
} else {
label.setFont(new Font("Terminal Bold", Font.PLAIN, 25));
label.setForeground(Color.white);
}
return label;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[0])){\n\t\t\tperformButton(0);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[1])){\n\t\t\tperformButton(1);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[2])){\n\t\t\tper... | [
"0.70904726",
"0.7080795",
"0.6978373",
"0.68992054",
"0.68555295",
"0.6823196",
"0.68107164",
"0.6791138",
"0.6787979",
"0.6785243",
"0.67780274",
"0.6762248",
"0.6745191",
"0.6717238",
"0.67104465",
"0.6695773",
"0.66946495",
"0.66844606",
"0.66708237",
"0.66587657",
"0.665... | 0.0 | -1 |
method made to simplify making changes to appearence of text | public void packUp() {
news.themeColour = (String) colourChooser.getSelectedItem(); //gets the currently selected colour
news.write(); //writes high scores and selected colour to file
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void textilize () {\n\n textIndex = 0;\n int textEnd = line.length() - 1;\n listChars = new StringBuffer();\n linkAlias = false;\n while (textIndex < line.length()\n && (Character.isWhitespace(textChar()))) {\n textIndex++;\n }\n while (textEnd >= 0\n && textEnd >= t... | [
"0.6934362",
"0.68846",
"0.64447993",
"0.62179506",
"0.61957705",
"0.6034004",
"0.60154736",
"0.59981835",
"0.5977695",
"0.5964106",
"0.59496635",
"0.59480846",
"0.5885767",
"0.58716494",
"0.58553237",
"0.58540326",
"0.5844904",
"0.58252335",
"0.58227026",
"0.5822053",
"0.581... | 0.0 | -1 |
Method generates a test case with given parameters. For example: if the parameters are "N=100" and "Group=RND" the method should generate a "random" test case of size 100. This method is project dependant and is used a) as a helper method for the getTestCase() method and b) as a method called by the ALGator's evaluate process to generate test cases for algorithm inspection and evaluation. | public AbstractTestCase generateTestCase(String type, Variables generatingParameters) {
switch (type) {
case ETestCase.defaultGeneratorType: return testCaseGenerator (generatingParameters);
case "TYPE1" : return testCaseGenerator1(generatingParameters);
case "TYPE2" : return testCaseGenerator2(generatingParameters);
case "TYPE3" : return testCaseGenerator3(generatingParameters);
case "TYPE4" : return testCaseGenerator4(generatingParameters);
case "TYPE5" : return testCaseGenerator5(generatingParameters);
case "TYPE6" : return testCaseGenerator6(generatingParameters);
case "TYPE7" : return testCaseGenerator7(generatingParameters);
case "TYPE8" : return testCaseGenerator8(generatingParameters);
case "TYPE9" : return testCaseGenerator9(generatingParameters);
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void generate_test_case(int Index, StringBuffer Code, DataType[] ParamTypes, DataType ReturnType, TestCase Case)\n {\n int I;\n String[] Inputs = Case.getInput();\n String Output = Case.getOutput();\n String Desc = ReturnType.getDescription();\n\n /*\n * Ge... | [
"0.6556636",
"0.6311531",
"0.57846797",
"0.57447827",
"0.56755775",
"0.55799454",
"0.55659884",
"0.5551398",
"0.54961705",
"0.54458016",
"0.5269407",
"0.5215487",
"0.5207223",
"0.5198118",
"0.5181935",
"0.5155295",
"0.5150446",
"0.51314884",
"0.50869423",
"0.50846475",
"0.505... | 0.5762419 | 3 |
constructor generate random values for sources, destinations and cost Matrix with the property: Total supply=Total demand | public GenerateRandomInstances(int n) {
this.sources = new Source[n];
this.sources[0] = new Factory("S" + 0, (int) (Math.random() * 50) + 10);
for (int i = 1; i < n; i++) { // generate random values for supply
this.sources[i] = new Warehouse("S" + i, (int) (Math.random() * 50) + 10);
//sum += this.sources[i].getSupply();
}
this.destinations = new Destination[n];
for (int i = 0; i < n; i++) { // generate random values for supply
this.destinations[i] = new Destination("D" + i, (int) (Math.random() * 50) + 10);
}
this.costMatrix = new int[n][n];
for (int k = 0; k < n; k++) { // generate random values for cost matrix
for (int j = 0; j < n; j++) {
this.costMatrix[k][j] = (int) (Math.random() * 9) + 1;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public CostMatrix(int agents, int tasks, Random rnd)\n {\n _agents = new int[agents];\n _costArray = new int[agents][agents];\n _n = agents;\n\n for (int i = 0; i < agents; ++i)\n {\n for (int j = 0; j < tasks; ++j)\n {\n SetCost(i, j, rnd.... | [
"0.64797384",
"0.59080786",
"0.5882152",
"0.58312047",
"0.5639942",
"0.5597387",
"0.55837446",
"0.55790776",
"0.5472465",
"0.54699016",
"0.54666686",
"0.5356859",
"0.5345325",
"0.5342259",
"0.533185",
"0.5304985",
"0.5286578",
"0.5275484",
"0.52584624",
"0.52534324",
"0.52416... | 0.6494987 | 0 |
create the problem with sources, destinations and costMatrix display the problem on the screen create a solution using the Vogel's approximation method display on the screen the total cost | public void displaySolution() {
Problem pb = new Problem(sources, destinations, costMatrix);
pb.printProblem();
Solution sol = new Solution(pb);
sol.computeCost();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) {\n Source s1 = new Source(SourceType.FACTORY, \"Source1\");\n s1.setCapacity(10);\n Source s2 = new Source(35, SourceType.WAREHOUSE, \"Source2\");\n Source s3 = new Source(25, SourceType.WAREHOUSE, \"Source3\");\n System.out.println(s1.toSt... | [
"0.7103598",
"0.6949163",
"0.6776092",
"0.59926",
"0.5966199",
"0.58689094",
"0.58575433",
"0.5840483",
"0.58188397",
"0.5809826",
"0.5762031",
"0.5747708",
"0.5729642",
"0.57146055",
"0.57135314",
"0.5709698",
"0.5706267",
"0.56991947",
"0.5673222",
"0.5671134",
"0.56220317"... | 0.72903246 | 0 |
holds the current contact | @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_contact_detail);
Contacts.loadData(this);
// Get the selected contact ID from intent arguments
int contactPosition = getIntent().getIntExtra(ARG_ITEM_ID, 0);
mContact = Contacts.LIST.get(contactPosition);
// Set up collapsing toolbar
Toolbar toolbar = (Toolbar) findViewById(R.id.detail_toolbar);
setSupportActionBar(toolbar);
// Show the Up button in the action bar.
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
}
// Set contact name and image in toolbar
CollapsingToolbarLayout appBarLayout = (CollapsingToolbarLayout) findViewById(R.id.toolbar_layout);
final ImageView appBarImage = (ImageView) findViewById(R.id.detail_toolbar_image);
if (appBarLayout != null) {
appBarLayout.setTitle(mContact.getName());
Picasso.with(this)
.load(mContact.getPictureUrl())
.placeholder(R.drawable.default_contact)
.error(R.drawable.default_contact)
.into(appBarImage);
}
// Get contact detail views
TextView email = ((TextView) findViewById(R.id.contact_detail_email));
TextView number = ((TextView) findViewById(R.id.contact_detail_number));
TextView title = ((TextView) findViewById(R.id.contact_detail_title));
TextView linkedIn = ((TextView) findViewById(R.id.contact_detail_linkedin));
// Set contact details inside appropriate views
email.setText(mContact.getEmail());
number.setText(mContact.getNumber());
title.setText(mContact.getTitle());
linkedIn.setText("LinkedIn");
// Set onClick listeners to make the app more useful
email.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse("mailto:" + mContact.getEmail()));
startActivity(intent);
}
});
number.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + mContact.getNumber()));
startActivity(intent);
}
});
linkedIn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(mContact.getLinkedInUrl()));
startActivity(intent);
}
});
// Set up floating action button, add to contacts when clicked
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(ContactsContract.Intents.Insert.ACTION);
intent.setType(ContactsContract.RawContacts.CONTENT_TYPE);
intent.putExtra(ContactsContract.Intents.Insert.EMAIL, mContact.getEmail());
intent.putExtra(ContactsContract.Intents.Insert.EMAIL_TYPE, ContactsContract.CommonDataKinds.Email.TYPE_WORK);
intent.putExtra(ContactsContract.Intents.Insert.PHONE, mContact.getNumber());
intent.putExtra(ContactsContract.Intents.Insert.NAME, mContact.getName());
intent.putExtra(ContactsContract.Intents.Insert.COMPANY, "AppCentrica");
intent.putExtra(ContactsContract.Intents.Insert.JOB_TITLE, mContact.getTitle());
// Contact picture is a bit different since we have to pass the bitmap as a byte array
ByteArrayOutputStream stream = new ByteArrayOutputStream();
Bitmap contactPicture = ((BitmapDrawable) appBarImage.getDrawable()).getBitmap();
contactPicture.compress(Bitmap.CompressFormat.PNG, 100, stream);
ArrayList<ContentValues> data = new ArrayList<>();
ContentValues row = new ContentValues();
row.put(ContactsContract.Contacts.Data.MIMETYPE, ContactsContract.CommonDataKinds.Photo.CONTENT_ITEM_TYPE);
row.put(ContactsContract.CommonDataKinds.Photo.PHOTO, stream.toByteArray());
data.add(row);
intent.putParcelableArrayListExtra(ContactsContract.Intents.Insert.DATA, data);
startActivity(intent);
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getContact() {\r\n return this.contact;\r\n }",
"public String getContact() {\n\t\treturn contact;\n\t}",
"public String getContact() {\n return contact;\n }",
"public String getContact() {\n return contact;\n }",
"public String getContact() {\n return contact;\... | [
"0.74764735",
"0.73853654",
"0.7381844",
"0.7381844",
"0.7381844",
"0.7381844",
"0.7381844",
"0.73317266",
"0.73317266",
"0.7188652",
"0.7015748",
"0.698976",
"0.69360673",
"0.68299884",
"0.67990327",
"0.67985636",
"0.66659534",
"0.6646986",
"0.6618697",
"0.6604151",
"0.66011... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.