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
Get the top element.
public int top() { return q1.peek(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int top() {\n return topElem;\n }", "public E top() {\n return !isEmpty() ? head.item : null;\n }", "public int topElement() {\n\t\tif(isEmpty()){\n\t\t\tthrow new AssertionError();\n\t\t}\n\t\telse {\n\t\t\treturn heap.get(0).element;\n\t\t\n\t\t}\n\t}", "public T getTop( ...
[ "0.8335419", "0.79350287", "0.77536744", "0.7748599", "0.76948357", "0.76440716", "0.76287603", "0.76287603", "0.76210487", "0.761078", "0.75897783", "0.757352", "0.75697553", "0.75569373", "0.75336695", "0.74941546", "0.7478168", "0.7464024", "0.7455516", "0.744731", "0.7420...
0.7072783
43
Return whether the stack is empty.
public boolean empty() { return q1.isEmpty(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean emptyStack() {\n return (expStack.size() == 0);\n }", "public boolean isEmpty()\n {\n return stack.size() == 0;\n }", "public boolean isEmpty() {\n \treturn stack.size() == 0;\n }", "public boolean isEmpty()\n {\n return stack.isEmpty();\n }", "publi...
[ "0.9066117", "0.90027034", "0.89577776", "0.89295036", "0.88910544", "0.88681304", "0.8840347", "0.88153386", "0.88096553", "0.88096553", "0.8760622", "0.8759322", "0.87508786", "0.87422633", "0.8738757", "0.8725327", "0.87200683", "0.8688953", "0.8647964", "0.86373746", "0.8...
0.0
-1
Use this factory method to create a new instance of this fragment using the provided parameters.
public static Network newInstance(String param1, String param2) { Network fragment = new Network(); Bundle args = new Bundle(); args.putString(ARG_PARAM1, param1); args.putString(ARG_PARAM2, param2); fragment.setArguments(args); return fragment; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static FragmentTousWanted newInstance() {\n FragmentTousWanted fragment = new FragmentTousWanted();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }", "protected abstract Fragment createFragment();", "public void createFragment() {\n\n ...
[ "0.7258239", "0.7232153", "0.7113334", "0.6991505", "0.69893247", "0.68336403", "0.6829459", "0.68129236", "0.6800367", "0.6799862", "0.6764318", "0.6738285", "0.6738285", "0.67269975", "0.67161703", "0.6706323", "0.66909164", "0.66905874", "0.668715", "0.66615874", "0.664535...
0.0
-1
Inflate the layout for this fragment
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { rootView = inflater.inflate(R.layout.fragment_network, container, false); btnInsertar = (Button) rootView.findViewById(R.id.btnRegistrar); btnConsultar = (Button) rootView.findViewById(R.id.btnConsultar); edtName = (EditText) rootView.findViewById(R.id.edName); btnInsertar.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { String name=edtName.getText().toString().trim(); insertDatabase(name); } }); btnConsultar.setOnClickListener(this); return rootView; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_main_allinfo, container, false);\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup...
[ "0.6739604", "0.67235583", "0.6721706", "0.6698254", "0.6691869", "0.6687986", "0.66869223", "0.6684548", "0.66766286", "0.6674615", "0.66654444", "0.66654384", "0.6664403", "0.66596216", "0.6653321", "0.6647136", "0.66423255", "0.66388357", "0.6637491", "0.6634193", "0.66251...
0.0
-1
TODO: Rename method, update argument and hook method into UI event
public void onButtonPressed(Uri uri) { if (mListener != null) { mListener.onFragmentInteraction(uri); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\t}", "@Override\n\t\t\t\tpublic void handle(ActionEvent event) {\n\n\t\t\t\t}", "@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\t\n\t\t\t}", "@...
[ "0.6619185", "0.65246344", "0.6473144", "0.6473144", "0.64351684", "0.6325494", "0.62368196", "0.6189416", "0.6158721", "0.61455715", "0.6123594", "0.6107332", "0.6101038", "0.6092755", "0.6049496", "0.6049496", "0.60442764", "0.604003", "0.604003", "0.6007846", "0.59999037",...
0.0
-1
This interface must be implemented by activities that contain this fragment to allow an interaction in this fragment to be communicated to the activity and potentially other fragments contained in that activity. See the Android Training lesson Communicating with Other Fragments for more information.
public interface OnFragmentInteractionListener { // TODO: Update argument type and name void onFragmentInteraction(Uri uri); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface OnFragmentInteractionListener {\n void onFragmentMessage(String TAG, Object data);\n}", "public interface FragmentInteraction {\n void switchToBoardView();\n void switchToPinsView();\n void switchToPins(PDKBoard pdkBoard);\n void switchToDescription(PDKPin pin);\n}", "public int...
[ "0.7323792", "0.72082794", "0.7134954", "0.7123491", "0.7122167", "0.701424", "0.6976951", "0.6976951", "0.6976951", "0.6973974", "0.69670236", "0.69652706", "0.6960549", "0.69533235", "0.69430083", "0.69339865", "0.69292945", "0.692731", "0.69223285", "0.6910736", "0.6902757...
0.0
-1
TODO: Update argument type and name
void onFragmentInteraction(Uri uri);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public String getFirstArg() {\n return name;\r\n }", "@Override\n public int getNumberArguments() {\n return 1;\n }", "java.lang.String getArg();", "@Override\n public int getArgLength() {\n return 4;\n }", "Argument createArgument();", "@Override\r\n\tpublic ...
[ "0.7164074", "0.6946075", "0.6714363", "0.65115863", "0.63969076", "0.6375468", "0.63481104", "0.63162106", "0.6260299", "0.6208487", "0.6208487", "0.62070644", "0.6197276", "0.61806154", "0.6177103", "0.61530507", "0.61472267", "0.61243707", "0.60771817", "0.6054482", "0.599...
0.0
-1
When the code is send and the enter phone no. is in the phone in which app is runing this meathod is going to run
@Override public void onVerificationCompleted(PhoneAuthCredential phoneAuthCredential) { Toast.makeText(otpsignin.this,"Code send to your phone",Toast.LENGTH_SHORT).show(); signInWithPhoneAuthCredential(phoneAuthCredential); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void onClick(View v) {\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tString phoneno=phonenoET.getText().toString();\n\t\t\t\t\t\t\tif(phoneno.equals(\"\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tToast.makeText(getApplicationContext(),\"Enter Phone No.\",Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\...
[ "0.68455094", "0.6787106", "0.67383325", "0.6593128", "0.65856326", "0.65321624", "0.6490468", "0.64816356", "0.6385167", "0.6298051", "0.62909627", "0.6290456", "0.627747", "0.626254", "0.6256027", "0.6227408", "0.6226471", "0.6175812", "0.6163803", "0.6139444", "0.61309767"...
0.587545
54
If sms didn't receive this gonna call
@Override public void onVerificationFailed(FirebaseException e) { Toast.makeText(otpsignin.this,"Something went wrong",Toast.LENGTH_SHORT).show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasSms();", "void dispatchMessage(SmsMessage sms) {\n boolean handled = false;\n\n // Special case the message waiting indicator messages\n if (sms.isMWISetMessage()) {\n mPhone.updateMessageWaitingIndicator(true);\n\n if (sms.isMwiDontStore()) {\n ...
[ "0.72295946", "0.69692373", "0.68644506", "0.68614674", "0.6660919", "0.6447569", "0.63830376", "0.63743776", "0.6264092", "0.6246398", "0.62093335", "0.61760914", "0.61666304", "0.6152844", "0.6130534", "0.6119129", "0.61184746", "0.6115963", "0.6099253", "0.6093963", "0.606...
0.0
-1
This meathod is call when ever the enter phone no. is in the other mobile other than the installed app phone no. The SMS verification code has been sent to the provided phone number, we now need to ask the user to enter the code and then construct a credential by combining the code with a verification ID.
@Override public void onCodeSent(String verificationId, PhoneAuthProvider.ForceResendingToken token) { Toast.makeText(otpsignin.this, verificationId, Toast.LENGTH_SHORT).show(); Log.d(TAG, "onCodeSent:" + verificationId); Toast.makeText(otpsignin.this,"On code sent meathod",Toast.LENGTH_SHORT).show(); // Save verification ID and resending token so we can use them later btntype=1; mVerificationId = verificationId; mResendToken = token; btnOTP.setText("Verify code"); // ... }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onVerificationCompleted(PhoneAuthCredential credential) {\n Toast.makeText(activity, \"credentials : \"+credential, Toast.LENGTH_SHORT).show();\n Toast.makeText(activity, \"Sms : \"+smsCode, Toast.LENGTH_SHORT).show();\n ...
[ "0.7924769", "0.7614646", "0.7555514", "0.7540428", "0.7522904", "0.74668133", "0.74318045", "0.73658395", "0.73213834", "0.73155445", "0.7276304", "0.7256325", "0.7236523", "0.7157604", "0.7141619", "0.71270853", "0.7115127", "0.69759697", "0.68940073", "0.68940073", "0.6894...
0.69676286
18
Calculates the symmetric difference between sets A and B. It is defined as: \( A\,\triangle\,B = (A \smallsetminus B) \cup (B \smallsetminus A),\, \)
public static Set symmetricDifference(Set a, Set b){ Set aMinusB = a.difference(b); Set bMinusA = b.difference(b); return aMinusB.union(bMinusA); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static Set symmetricSetDifference (Set<Integer> set1, Set<Integer> set2)\n {\n Set<Integer> skæringspunktet = new HashSet<Integer>(set1);\n\n // Holder på set2 også\n skæringspunktet.retainAll(set2);\n\n // Set1 fjerner alt fra Settet\n set1.removeAll(skæringspunktet);...
[ "0.760575", "0.6607559", "0.65207475", "0.64679295", "0.6188567", "0.6137943", "0.6118243", "0.6067955", "0.60674405", "0.60586995", "0.60301113", "0.6028024", "0.5863655", "0.5699561", "0.5605333", "0.5594007", "0.55487055", "0.54994375", "0.54757905", "0.53796995", "0.53646...
0.76424384
0
ToolBarHelper.setSutColor(mWebMessageActivity, Color.argb(0, 255, 255, 255));
@Override public void initView() { mWebMessageActivity.setContentView(R.layout.activity_webdetial); // mWebMessageActivity.mToolBarHelper.hidToolbar(mWebMessageActivity, (RelativeLayout) mWebMessageActivity.findViewById(R.id.buttomaciton)); // mWebMessageActivity.measureStatubar(mWebMessageActivity, (RelativeLayout) mWebMessageActivity.findViewById(R.id.stutebar)); mWebMessageActivity.mToolBarHelper.hidToolbar2(mWebMessageActivity); ToolBarHelper.setBgColor(mWebMessageActivity, mWebMessageActivity.mActionBar, Color.rgb(255, 255, 255)); mWebMessageActivity.btnBach = mWebMessageActivity.findViewById(R.id.back); mWebMessageActivity.title = mWebMessageActivity.findViewById(R.id.title); mWebMessageActivity.shareBtn = mWebMessageActivity.findViewById(R.id.share); if(mWebMessageActivity.getIntent().getBooleanExtra("showshare",false) == false) { mWebMessageActivity.shareBtn.setVisibility(View.INVISIBLE); } else { ShareItem shareItem = new ShareItem(); shareItem.picurl = mWebMessageActivity.getIntent().getStringExtra("img"); if(shareItem.picurl == null) { shareItem.picurl = ""; } shareItem.title = mWebMessageActivity.getIntent().getStringExtra("des"); if(shareItem.title == null) { shareItem.title = ""; } shareItem.des = " "; shareItem.weburl = ConversationPrase.prseShareUrl(ConversationAsks.praseShareType(mWebMessageActivity.getIntent().getStringExtra("type")) ,mWebMessageActivity.getIntent().getStringExtra("detialid")); mWebMessageActivity.shareBtn.setOnClickListener(new BigwinerApplication.DoshareListener(mWebMessageActivity,shareItem)); } mWebMessageActivity.btnBach.setOnClickListener(mWebMessageActivity.backListener); mWebMessageActivity.mWebView = (WebView) mWebMessageActivity.findViewById(R.id.webview); BigwinerApplication.mApp.hisupdata = true; initWebViewSettings(); String url = mWebMessageActivity.getIntent().getStringExtra("url"); mWebMessageActivity.mWebView.loadUrl(mWebMessageActivity.getIntent().getStringExtra("url")); mWebMessageActivity.mRelativeLayout = (RelativeLayout) mWebMessageActivity.findViewById(R.id.shade); if(mWebMessageActivity.getIntent().hasExtra("detialid")) { Intent intent = new Intent(MainActivity.ACTION_SET_READ_CONVERSATION); intent.putExtra("id",mWebMessageActivity.getIntent().getStringExtra("detialid")); intent.setPackage(BigwinerApplication.mApp.getPackageName()); mWebMessageActivity.sendBroadcast(intent); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onGenerated(Palette palette) {\n int defaultValue = 0x000000;\n chosenColor = palette.getDarkMutedColor(defaultValue);\n collapsingToolbar.setContentScrimColor(chosenColor);\n\n //changing the status bar color\n\n ...
[ "0.6360896", "0.63002187", "0.5960905", "0.59173054", "0.59134364", "0.5896451", "0.5889332", "0.5880198", "0.58533937", "0.57810956", "0.57660043", "0.5758337", "0.57162637", "0.5707589", "0.5657836", "0.5652237", "0.56313854", "0.5617769", "0.56093425", "0.5606888", "0.5590...
0.0
-1
TODO Autogenerated method stub
@Override public void Start() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override public void Resume() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override public void Pause() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override public void Destroy() { mWebMessageActivity.mWebView.destroy(); }
{ "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
/ pd: Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water. assm: grid only contains 0 or 1 and no nulls, no. of cell in grid < 10000, best time solution appr: start with first of matrix if it 1 then run dfs from this cell and visit all 4 neighbours. Idea here is to start from a 1 and make all connecting cell with 1 value to 0. test cases:
public int numIslands(char[][] grid) { int noOfRows = grid.length; int noOfCols = grid[0].length; int islands = 0; for (int row = 0; row < noOfRows; row++) { for (int col = 0; col < noOfCols; col++) { if (grid[row][col] == '1') { islands++; dfs(grid,row,col); } } } return islands; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int numIslands_dfs(char[][] grid) {\n int m = grid.length;\n int n = grid[0].length;\n \n // 很多解法是将grid[i][j] 设置成0,这样也可以,只是会改变输入,可以讨论。\n boolean[] visited = new boolean[m * n]; // 这里就不用map了,一个一维数组就可以。\n \n int numOfIslands = 0;\n for (int i = 0; i < m...
[ "0.81536776", "0.8075438", "0.7968682", "0.78511024", "0.7822265", "0.7760982", "0.7733059", "0.7679175", "0.7590826", "0.757111", "0.7483238", "0.74019754", "0.73889995", "0.72612613", "0.7252699", "0.7089178", "0.7010988", "0.6861819", "0.6700473", "0.6655936", "0.6582165",...
0.7874049
3
Created by Administrator on 2018/4/18.
public interface ChangePhoneIF { void changePhoneSuccess(int code, String result); void changePhoneFailed(int code, String result); void getchangePhoneSmsSuccess(int code, String result); void getchangePhoneSmsfailed(int code, String result); void checkchangePhoneSmsSuccess(int code, String result); void checkchangePhoneSmsFailed(int code, String result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private stendhal() {\n\t}", "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "pro...
[ "0.62136674", "0.6090949", "0.5769723", "0.5736592", "0.5733917", "0.5729521", "0.5672822", "0.56677485", "0.5667281", "0.56564254", "0.5636243", "0.56159574", "0.5613901", "0.56043166", "0.5604009", "0.55797285", "0.5576577", "0.55761015", "0.55689985", "0.55689985", "0.5560...
0.0
-1
Calling method to generate notification
@Override public void onMessageReceived(RemoteMessage remoteMessage) { sendNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); bodyMessage = remoteMessage.getNotification().getBody(); Log.d(TAG, "onMessageReceived: " + bodyMessage); Log.d(TAG, "onMessageReceived: " + remoteMessage.getNotification().getTitle() + " vvvvvvvv " + remoteMessage.getNotification().getBody()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void sendNotification() {\n }", "private void showNotification() {\n\n }", "private void showNotification() {\n }", "@Override\r\n\tpublic void sendGeneralNotification() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void sendNotifications() {\n\r\n\t}", "int displayNotification(Message message...
[ "0.7969488", "0.749805", "0.7416516", "0.7356231", "0.718862", "0.70694935", "0.70145726", "0.68769944", "0.6756389", "0.6756315", "0.6737685", "0.6723822", "0.6716159", "0.66355217", "0.6618255", "0.66024315", "0.6599156", "0.65743935", "0.65708953", "0.6554333", "0.65458184...
0.0
-1
This method is only generating push notification
private void sendNotification(String title, String messageBody) { Intent intent = new Intent(this, MainActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_ONE_SHOT); Log.d(TAG, "sendNotification: " + messageBody + title); Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this) .setSmallIcon(android.R.mipmap.sym_def_app_icon) .setContentTitle(title) .setContentText(messageBody) .setAutoCancel(true) .setSound(defaultSoundUri) .setContentIntent(pendingIntent).addAction(new NotificationCompat.Action( android.R.drawable.sym_call_missed, "Cancel", PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT))) .addAction(new NotificationCompat.Action( android.R.drawable.sym_call_outgoing, "OK", PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT))); ; NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.notify(0, notificationBuilder.build()); Log.d(TAG, "sendNotification: " + messageBody + title); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void sendNotification() {\n }", "private void sendNotificationSample() {\n Intent notificationIntent = new Intent(GCMIntentService.this, AlertActivity.class);\n\n // Get a PendingIntent containing the entire back stack.\n int i = new Random().nextInt(100);\n PendingIntent n...
[ "0.75550216", "0.7347505", "0.6876047", "0.68558556", "0.6811568", "0.67492336", "0.6743241", "0.6710908", "0.65744865", "0.6569351", "0.65689635", "0.65581983", "0.6556253", "0.6551013", "0.6542169", "0.65168494", "0.64840436", "0.6461161", "0.64239115", "0.64148474", "0.636...
0.0
-1
this is an extremely simple solution to an otherwise seemingly complicated problem. the below is a very elegant approach and isn't very intuitive, but with a lot of practice on DP problems becomes easier to invent start from the last row and move up to the first row while calculating min cost per color choice instead of recursion this works as an iterative solution as min cost can be calculated via below equation imagine two houses 1 & 2 1. cost color1 choice = cost color 1 of house 1 + min (color choice of house 2 colors 2 & 3). 2. cost color2 choice = cost color 2 of house 1 + min (color choice of house 2 colors 1 & 3). 3. cost color3 choice = cost color 3 of house 1 + min (color choice of house 2 colors 1 & 2). min cost is min (1, 2, 3) above.
public int minCostDP(int[][] costs) { if (costs.length == 0) return 0; int[] workRow = new int[numColors]; //an array for some background work int[] prevRow = new int[numColors]; //an array that tracks min costs so far per the color choices int currentRow = costs.length - 1; //copy the last costs to prev array and thereafter start from second last row System.arraycopy(costs[currentRow], 0, prevRow, 0, costs[currentRow].length); while (currentRow > 0) { currentRow--; //for each color calculate the min cost thus far workRow[0] = costs[currentRow][0] + Math.min(prevRow[1], prevRow[2]); workRow[1] = costs[currentRow][1] + Math.min(prevRow[0], prevRow[2]); workRow[2] = costs[currentRow][2] + Math.min(prevRow[0], prevRow[1]); //copy working array to previous array System.arraycopy(workRow, 0, prevRow, 0, workRow.length); } //the total cost so far per color choice is available in the prevRow //pick the min cost in the array return Math.min(Math.min(prevRow[0], prevRow[1]), prevRow[2]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int processCosts(int houseNo, int color) {\n String key = getKey(houseNo, color);\n Integer cost = costMap.get(key);\n if (cost != null) {\n return cost;\n }\n if (houseNo == numHouses - 1) {\n //base case when this is the last house\n //cost is e...
[ "0.70461047", "0.694471", "0.63857514", "0.63625306", "0.6241309", "0.62345713", "0.62281716", "0.6226436", "0.61982197", "0.61478764", "0.6098529", "0.59362227", "0.59131277", "0.59009624", "0.5802649", "0.57459575", "0.57278764", "0.56905454", "0.56820023", "0.5665047", "0....
0.748569
0
calculates the cost via calling into processCosts method. and returns the min cost of the three colors in question.
public int minCost(int[][] costs) { if (costs.length == 0) return 0; this.costs = costs; numHouses = costs.length; int cA = processCosts(0, 0); int cB = processCosts(0, 1); int cC = processCosts(0, 2); return Math.min(Math.min(cA, cB), cC); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int minCostDP(int[][] costs) {\n if (costs.length == 0) return 0;\n int[] workRow = new int[numColors]; //an array for some background work\n int[] prevRow = new int[numColors]; //an array that tracks min costs so far per the color choices\n int currentRow = costs.length - 1;\n ...
[ "0.74645585", "0.7080529", "0.67652726", "0.65312886", "0.6521299", "0.5816561", "0.570253", "0.5649178", "0.5642067", "0.5625044", "0.56065404", "0.5604406", "0.559459", "0.55801594", "0.55625975", "0.55566657", "0.5554448", "0.55316293", "0.55178654", "0.54838437", "0.54796...
0.6165316
5
this method recurses down from first to last house while calculating the min cost so far to paint the house per each color choice. so as to not repeat the calculations, the costs per house/color are saved in a map for fast retrieval if already calculated previously
int processCosts(int houseNo, int color) { String key = getKey(houseNo, color); Integer cost = costMap.get(key); if (cost != null) { return cost; } if (houseNo == numHouses - 1) { //base case when this is the last house //cost is exactly that of the given house's color, it has no more depencies //as its the last house cost = costs[houseNo][color]; costMap.put(key, cost); return cost; } int colorACSoFar = 0; int colorBCSoFar = 0; if (color == 0) { colorACSoFar = processCosts(houseNo + 1, 1); colorBCSoFar = processCosts(houseNo + 1, 2); } else if (color == 1) { colorACSoFar = processCosts(houseNo + 1, 0); colorBCSoFar = processCosts(houseNo + 1, 2); } else if (color == 2) { colorACSoFar = processCosts(houseNo + 1, 0); colorBCSoFar = processCosts(houseNo + 1, 1); } //get the min cost of other two colors for the rest of houses int costsSoFar = Math.min(colorACSoFar, colorBCSoFar); //add cost for the current color for current house costsSoFar += costs[houseNo][color]; //update cost for house/color in map so next time it doesnt have to be recalculated costMap.put(key, costsSoFar); return costsSoFar; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int minCostDP(int[][] costs) {\n if (costs.length == 0) return 0;\n int[] workRow = new int[numColors]; //an array for some background work\n int[] prevRow = new int[numColors]; //an array that tracks min costs so far per the color choices\n int currentRow = costs.length - 1;\n ...
[ "0.64498156", "0.6296055", "0.56387806", "0.5587631", "0.55822074", "0.54794425", "0.5421246", "0.5311821", "0.53069216", "0.5272367", "0.5239786", "0.5220524", "0.51811665", "0.5160779", "0.51432693", "0.5079579", "0.50729257", "0.5061854", "0.50578934", "0.5057527", "0.5043...
0.7519913
0
its a good design to have a separate method that can return the key represented by the given house no and color no
private String getKey(int houseNo, int colorNo) { return houseNo + "_" + colorNo; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getKey();", "int getKey();", "Object getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey...
[ "0.6169499", "0.6169499", "0.5937631", "0.5872573", "0.5872573", "0.5872573", "0.5872573", "0.5872573", "0.5872573", "0.5872573", "0.5872573", "0.5872573", "0.5872573", "0.5872573", "0.5872573", "0.5872573", "0.5871541", "0.5794543", "0.5788295", "0.5748815", "0.57408464", ...
0.8426831
0
TODO Autogenerated method stub
public void doUpdateStatus() throws GameException { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
public void setMinimumPlayers(int nPlayers) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
public void addAgent(String name) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override public void doModifyWagerPool(double factor, String msg) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override public <T extends Serializable> T getResource(Class<T> class1) { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override public <T extends Serializable> void setResource(Class<T> c, T markovChain) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override public void doUpdateConfig(GameConfig game) { }
{ "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
Sets minimum and maximum values for split selection
public void onDialogCreated(View view) { hourPicker = (NumberPicker) view.findViewById(R.id.np_time_hours); hourPicker.setMinValue(0); hourPicker.setMaxValue(99); NumberPicker.Formatter formatter = new NumberPicker.Formatter() { @Override public String format(int value) { return String.format("%02d", value); } }; minutePicker = (NumberPicker) view.findViewById(R.id.np_time_minutes); minutePicker.setMinValue(0); minutePicker.setMaxValue(59); minutePicker.setFormatter(formatter); secondsPicker = (NumberPicker) view.findViewById(R.id.np_time_seconds); secondsPicker.setMinValue(0); secondsPicker.setMaxValue(59); secondsPicker.setFormatter(formatter); decimalPicker = (NumberPicker) view.findViewById(R.id.np_time_decimal); decimalPicker.setMinValue(0); decimalPicker.setMaxValue(9); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public void setMinMax(Double min, Double max) {\r\n this.minIn = min;\r\n this.maxIn = max;\r\n }", "@Override public void setMinMax(float minValue, float maxValue) {\n this.valueTrack.min = minValue; this.valueTrack.max = maxValue;\n }", "public void initMaxMin(){\n\t\tmax = dja....
[ "0.7003965", "0.697183", "0.67788804", "0.65887743", "0.6443899", "0.64095825", "0.6344559", "0.631024", "0.6274885", "0.62339145", "0.62319255", "0.6181577", "0.61797667", "0.61618155", "0.6148618", "0.61317116", "0.6128214", "0.60883987", "0.60555094", "0.6042966", "0.60370...
0.0
-1
Sets the numberpickers to the specified values
public boolean setValue(String timeString){ String[] timeSplit = timeString.split(":"); // Splits (timeSplit[0]) minutes from seconds (timeSplit[1]) String[] secondsDecimal = timeSplit[2].split("\\."); //Splits 00.0 into 2 separate numbers if(timeSplit.length > 3 ) return false; try { hourPicker.setValue(Integer.parseInt(timeSplit[0].trim())); minutePicker.setValue(Integer.parseInt(timeSplit[1])); secondsPicker.setValue(Integer.parseInt(secondsDecimal[0])); decimalPicker.setValue(Integer.parseInt(secondsDecimal[1].trim())); }catch(NumberFormatException e){ e.printStackTrace(); return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initialiseNumberPickers() {\n\n ViewGroup pickerElements = (ViewGroup) findViewById(R.id.pickerLayout);\n for (int j = 0; j < pickerElements.getChildCount(); j++) {\n View grandchild = pickerElements.getChildAt(j);\n if (grandchild instanceof NumberPicker) {\n\n ...
[ "0.7854894", "0.66172695", "0.64692426", "0.6353467", "0.6348952", "0.61966616", "0.6154415", "0.5974656", "0.59594536", "0.59290785", "0.59019125", "0.58983546", "0.5885106", "0.5815245", "0.57946324", "0.57598895", "0.57595825", "0.57091117", "0.5678574", "0.5663019", "0.56...
0.0
-1
Gets the time value from the number pickers and returns it as a string
public String getTimeString(){ StringBuilder sBuilder = new StringBuilder(); sBuilder.append(hourPicker.getValue()) .append(':') .append(minutePicker.getValue()) .append(':') .append(secondsPicker.getValue()) .append('.') .append(decimalPicker.getValue()); return sBuilder.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String getTime() {\n String time = \"\";\n NumberPicker np = (NumberPicker) findViewById(R.id.tenMinutePicker);\n time = time.concat(String.valueOf(np.getValue()));\n np = (NumberPicker) findViewById(R.id.oneMinutePicker);\n time = time.concat(String.valueOf(np.getValue()...
[ "0.8207345", "0.66521525", "0.6547068", "0.6520024", "0.65095687", "0.64662147", "0.64518446", "0.6419963", "0.6380503", "0.6348453", "0.63239795", "0.6306046", "0.62893873", "0.627185", "0.6245465", "0.6231803", "0.6205614", "0.61844236", "0.6176877", "0.61477005", "0.614269...
0.7436271
1
Topdown approach DP: Memoization
public static int countCombinationsR(int s, int[] comb) { if (comb[s] > 0) return comb[s]; if (s == 0) return 1; int total = 0; if(s >= 7) total += countCombinationsR(s - 7, comb); if(s >= 3) total += countCombinationsR(s - 3, comb); if(s >= 2) total += countCombinationsR(s - 2, comb); comb[s] = total; return total; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int optimize() {\n\t\t// items: Items sorted by value-to-weight ratio for linear relaxation\n\t\t// t: the decision vector being tested at each node\n\t\t// ws, vs, is, bs: stacks of weight, value, item id, whether bring item\n\t\t// p: stack pointer; i, b, weight, value: loop caches; best: max search\n\t\...
[ "0.6392804", "0.61541706", "0.5885394", "0.58496696", "0.577994", "0.5729", "0.5708635", "0.57032603", "0.5689723", "0.5675359", "0.56004876", "0.5598173", "0.55848384", "0.55025166", "0.5432726", "0.5414349", "0.5359323", "0.5355278", "0.53519046", "0.5349706", "0.5342653", ...
0.0
-1
Bottomup approach DP: Iterative
public static int countCombinationsDP(int score) { /* * Return Type of DP array is same as return type of the recursive function * Dimensions of DP array is the number of non constant parameters to the recursive function */ /* * Fn(s) = Fn(s-7) [if(s>=7)] + Fn(s-3) [if(s>=3)] + Fn(s-2) [if(s>=2)] * Fn(0) = 1 * * F(11) = F(4) + F(8) + F(9) */ int comb[] = new int[score + 1]; comb[0] = 1; // Halting Condition /* * Loop goes in the direction opposite to that of the recursion */ for (int s = 1; s <= score; ++s) { // s is the score of the recursion int total = 0; if (s >= 7) total = total + comb[s - 7]; if (s >= 3) total = total + comb[s - 3]; if (s >= 2) total = total + comb[s - 2]; comb[s] = total; } return comb[score]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt(), M = scanner.nextInt();\n int[][] graph = new int[N + 1][N + 1];\n\n for (int i = 0; i < M; i++) {\n int from = scanner.nextInt(), to = scanner.nextInt();\n ...
[ "0.61451256", "0.60385245", "0.60207194", "0.5976915", "0.5946454", "0.5860899", "0.5753018", "0.57290524", "0.5701623", "0.56822306", "0.5611507", "0.5590598", "0.55724066", "0.54973733", "0.545851", "0.5450037", "0.5442744", "0.54302526", "0.541756", "0.53928787", "0.538848...
0.0
-1
Bottomup approach DP: Iterative Order not important
public static int countUniqueCombinationsDP(int score) { /* * Return Type of DP array is same as return type of the recursive function * Dimensions of DP array is the number of non constant parameters to the recursive function */ /* * Fn(s) = Fn(s-7) [if(s>=7)] + Fn(s-3) [if(s>=3)] + Fn(s-2) [if(s>=2)] * Fn(0) = 1 * * F(11) = F(4) + F(8) + F(9) */ int[][] comb = new int[score + 1][3]; // int[] points = {2,3,7}; // Halting Conditions comb[0][0] = 1; comb[0][1] = 1; comb[0][2] = 1; /* * Loop goes in the direction opposite to that of the recursion */ for (int s = 1; s <= score; ++s) { // s is the score of the recursion for (int p = 0; p < 3; ++p) { int total = 0; if (s >= 2 && p == 0) total = total + comb[s - 2][0]; if (s >= 3 && p <= 1) total = total + comb[s - 3][1]; if (s >= 7) // No need of condition p<=2; as it will always be true total = total + comb[s - 7][2]; comb[s][p] = total; } } return comb[score][0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt(), M = scanner.nextInt();\n int[][] graph = new int[N + 1][N + 1];\n\n for (int i = 0; i < M; i++) {\n int from = scanner.nextInt(), to = scanner.nextInt();\n ...
[ "0.62660426", "0.6208841", "0.61772233", "0.6168264", "0.61534226", "0.61319613", "0.5952256", "0.58996296", "0.58610255", "0.5844424", "0.5800338", "0.5702196", "0.5668126", "0.5658033", "0.55748993", "0.5531518", "0.55114156", "0.55113226", "0.5453203", "0.5450364", "0.5450...
0.0
-1
/for (int i = 0; i < 20; ++i) System.out.println(i + " Memo : " + countCombinations(i) + ", DP : " + countCombinationsDP(i) + ", Recursion : " + recursion(i) + ", Order Not Imp : " + countCombinationsDPOrderNotImportant(i));
public static void main(String[] args) { for (int i = 0; i < 20; ++i) System.out.println(i + " - Unique Ways DP : " + countUniqueCombinationsDP(i) + ", Unique Ways Recursive : " + countUniqueCombinationsR(i)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addTotalNumberOfCombinations(int nr);", "public static int combinationCounter(int n) {\r\n int hasil = n * (n - 1) / 2;\r\n return hasil;\r\n }", "public static void printGivenAndGeneratedCombinations() {\n\t\tSystem.out.println(GENERATE_START);\n\t\t\n\t\tfor(int row = 0; row < SA...
[ "0.6565312", "0.6377293", "0.63453776", "0.6327277", "0.62447804", "0.6132755", "0.6094919", "0.6060573", "0.5985241", "0.59421784", "0.5846108", "0.5802741", "0.58015954", "0.57999337", "0.57980144", "0.5717356", "0.56919014", "0.56776905", "0.5672888", "0.5657298", "0.56070...
0.7493215
0
check weather a tree is BST or not Ques 55
public boolean check(BSTNode root) { if(root==null) return true; if((root.getLeft()!=null)&&(root.getLeft().getData()>root.getData())) return false; else if((root.getRight()!=null)&&(root.getRight().getData()<root.getData())) return false; else return (check(root.getLeft())&&(check(root.getRight()))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean isBST() {\r\n return isBST(root, null, null);\r\n }", "private boolean isBST() {\n return isBST(root, null, null);\n }", "public abstract boolean isBinarySearchTree();", "void isABST(Node root, BSTNode correcttree){\n \n //the boolean value is a globa...
[ "0.7409045", "0.722657", "0.7223396", "0.7194137", "0.7173272", "0.7173034", "0.7113905", "0.7049166", "0.7038698", "0.69823873", "0.69747365", "0.6950078", "0.6849649", "0.6799484", "0.6749485", "0.6739134", "0.6720303", "0.6710134", "0.67041284", "0.6665484", "0.6656076", ...
0.6216082
57
helper function of finding max in tree used in ques 56
public int max(BSTNode root) { BSTNode curr; int max=Integer.MIN_VALUE; Queue<BSTNode> q = new LinkedList<BSTNode>(); q.add(root); while(!q.isEmpty()) { curr=q.poll(); if(curr.getData()>max) max=curr.getData(); if(curr.getLeft()!=null) q.add(curr.getLeft()); if(curr.getRight()!=null) q.add(curr.getRight()); } return max; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Node findMax(){\n if(root!=null){ // มี node ใน tree\n return findMax(root); // Call the recursive version\n }\n else{\n return null;\n }\n }", "public int findMax(){\n\t\tif(root==nil){\n\t\t\treturn 0;\n\t\t}\n\t\tNode temp = root;\n\t\twhile(temp.right != nil){\n\...
[ "0.7334634", "0.7265926", "0.72152346", "0.7208261", "0.7183698", "0.7173161", "0.71454966", "0.7137606", "0.7135473", "0.7133413", "0.7056404", "0.7017445", "0.7003473", "0.7002468", "0.6992874", "0.69826585", "0.6964051", "0.6963018", "0.6883735", "0.68464524", "0.68427444"...
0.64031726
51
helper function of finding min in tree used in ques 56
public int min(BSTNode root) { BSTNode curr; int min=Integer.MAX_VALUE; Queue<BSTNode> q = new LinkedList<BSTNode>(); q.add(root); while(!q.isEmpty()) { curr=q.poll(); if(curr.getData()<min) min=curr.getData(); if(curr.getLeft()!=null) q.add(curr.getLeft()); if(curr.getRight()!=null) q.add(curr.getRight()); } return min; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void testFindMin() {\r\n assertNull(tree.findMin());\r\n tree.insert(\"apple\");\r\n tree.insert(\"act\");\r\n assertEquals(\"act\", tree.findMin());\r\n tree.remove(\"act\");\r\n assertEquals(\"apple\", tree.findMin());\r\n }", "private BinaryNode<AnyType> fin...
[ "0.7375884", "0.72905505", "0.71750903", "0.71142477", "0.7076213", "0.7074904", "0.702338", "0.70230246", "0.70191216", "0.7011984", "0.6971202", "0.6938649", "0.6929498", "0.6920222", "0.6893773", "0.6868385", "0.68091816", "0.6775769", "0.67717195", "0.67710465", "0.675362...
0.6532678
52
check if BST Ques 56
public boolean better_check(BSTNode root) { if(root==null) return true; if(root.getLeft()!=null&&max(root.getLeft())>root.getData()) return false; if(root.getRight()!=null&&min(root.getRight())<root.getData()) return false; return (check(root.getLeft())&&(check(root.getRight()))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void isABST(Node root, BSTNode correcttree){\n \n //the boolean value is a global variable and is set to false if there are any descrepencies. \n if(root.data != correcttree.data){\n isThisABST = false;\n } else {\n //If one node is null and the other is not, set t...
[ "0.6678557", "0.66352797", "0.6574781", "0.65558326", "0.6503741", "0.6492972", "0.649193", "0.64612055", "0.64527637", "0.64405745", "0.6431826", "0.6423629", "0.6402101", "0.640138", "0.6364078", "0.6325607", "0.63177806", "0.6316903", "0.6288727", "0.6280016", "0.6263593",...
0.56521165
91
check if BST Ques 57
public boolean best_check(BSTNode root,int min, int max) { if (root==null) return true; boolean check1=(root.getData()>min&&root.getData()<max); boolean check2=best_check(root.getLeft(),min,root.getData()); boolean check3=best_check(root.getRight(),root.getData(),max); return (check1&&check2&&check3); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Boolean isBST(BinaryNode node) {\n\n if (node == null) return true;\n\n if (node.right == null && node.left == null) {\n return true;\n } else if (node.right == null) {\n if ((Integer)node.left.element < (Integer)node.element) return isBST(node.left);\n ...
[ "0.65377164", "0.6527041", "0.6512285", "0.6509812", "0.6485382", "0.64712113", "0.64588934", "0.64119035", "0.6365351", "0.6353195", "0.63311523", "0.6320041", "0.6314242", "0.6302107", "0.62954223", "0.62632346", "0.62484986", "0.6236363", "0.6201594", "0.6200482", "0.61961...
0.0
-1
check if BST Ques 58
public boolean bestOfbest_check(BSTNode root) { BSTNode curr=root; int prev=Integer.MIN_VALUE; Stack<BSTNode> s = new Stack<BSTNode>(); while(true) { if(curr!=null) { s.push(curr); curr=curr.getLeft(); } else { if(s.isEmpty()) return true; curr=s.pop(); int data=curr.getData(); if(prev>data) return false; prev=data; curr=curr.getRight(); if(curr!=null) s.push(curr); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isValidBSTII(TreeNode node) {\n if (node == null) {\n return true;\n }\n Stack<TreeNode> stack = new Stack<>();\n \n while(node != null) {\n stack.push(node);\n node = node.left;\n }\n TreeNode prev = null;\n wh...
[ "0.64836144", "0.64633423", "0.64504313", "0.6375672", "0.6364777", "0.63599426", "0.6323835", "0.6316978", "0.630726", "0.62457734", "0.61885184", "0.6181056", "0.6175736", "0.61698246", "0.6154583", "0.6131516", "0.6127321", "0.61243904", "0.612062", "0.6093448", "0.6088991...
0.5996391
27
Returns the value of the 'Operand2' reference. If the meaning of the 'Operand2' reference isn't clear, there really should be more of a description here...
SEIntegerVariable getOperand2();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "SEIntegerVariable getOperand1();", "public int getOperandB();", "public double getOperand2()\r\n\t{\r\n\t\tSystem.out.println(\"enter the operand 2:\");\r\n\t\tdouble op2=sc.nextDouble();\r\n\t\treturn op2;\r\n\t}", "public String getOperand(int operandNumber);", "private StringBuilder getOperand() {\r\n\t...
[ "0.7421807", "0.7047609", "0.7044668", "0.7005962", "0.6916636", "0.6875871", "0.6790329", "0.67899185", "0.6736012", "0.641698", "0.6276852", "0.6266402", "0.6220003", "0.61318624", "0.6051091", "0.6047879", "0.6000265", "0.5995796", "0.5915495", "0.5906881", "0.5899563", ...
0.8037975
0
Returns the value of the 'Operand1' reference. If the meaning of the 'Operand1' reference isn't clear, there really should be more of a description here...
SEIntegerVariable getOperand1();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "SEIntegerVariable getOperand2();", "public String getOperand(int operandNumber);", "public int getOperandA();", "public int getOperandB();", "public double getOperand1()\r\n\t{\r\n\t\tSystem.out.println(\"enter the operand 1:\");\r\n\t\tdouble op1=sc.nextDouble();\r\n\t\treturn op1;\r\n\t}", "private Str...
[ "0.7566045", "0.7181927", "0.6944429", "0.689851", "0.6883574", "0.682507", "0.66548604", "0.6495639", "0.64684075", "0.6271861", "0.62627524", "0.6248509", "0.62021667", "0.6199122", "0.60717237", "0.59835374", "0.597602", "0.5882284", "0.5877338", "0.5861992", "0.5781816", ...
0.80763865
0
========== getters and setters ==========
public List<ProjectRecoveryNoticeLetterInfo> getNoticeLetters() { return this.noticeLetters; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void get() {}", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "protected abstract Set method_1559();", "@Override\r\n\tpublic void get() {\n\t\t\r\n\t}", "@Override\n String get();", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "@Override\n\n // <editor-fold d...
[ "0.6307323", "0.62325925", "0.61545724", "0.61451674", "0.605579", "0.6054439", "0.5984799", "0.5957485", "0.5862102", "0.585546", "0.5850574", "0.584108", "0.58297634", "0.58186245", "0.58160836", "0.5805797", "0.580545", "0.57983077", "0.5796036", "0.5788912", "0.5787956", ...
0.0
-1
The Default Logger private static final Logger LOG = LoggerFactory.getLogger(StatReader.class); LDAP private LdapRepository ldapRepository; DB private JdbcRepository jdbcRepository;
@Override public List<UserDTO> read() throws Exception, UnexpectedInputException, ParseException, NonTransientResourceException { // TODO Auto-generated method stub return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public AccountDataAccess() {\r\n\t\tlogger = Logger.getLogger(getClass());\r\n\t}", "private LoginRepository(LoginDataSource dataSource) {\n this.dataSource = dataSource;\n //Mobyra instance\n mobyraInstance = MobyraInstance.getInstance();\n }", "private DatabaseRepository() {\n ...
[ "0.61503357", "0.60186815", "0.583292", "0.5796348", "0.5733672", "0.5722274", "0.56990904", "0.566883", "0.56481653", "0.55713594", "0.5536035", "0.55219233", "0.54700786", "0.5456933", "0.54535455", "0.5441199", "0.54337394", "0.5419613", "0.5395041", "0.53661263", "0.53242...
0.0
-1
List courses = new ArrayList(Arrays.asList( new course("Java","Core Java Starter","Basics of Core Java"), new course("Spring","Spring Starter","Spring Framework basics"), new course("JavaScript","JavaScript Starter", "JavaScript basics") ));
public List<Course> getAllCourses(String topicId){ //return courses; ArrayList<Course> course = new ArrayList<>(); courseRepository.findByTopicId(topicId).forEach(course::add); return course; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static List<Course> createCourseList() {\n List<Course> courses = new ArrayList<Course>();\n courses.add(createCourse(\"12345\"));\n courses.add(createCourse(\"67890\"));\n return courses;\n }", "private void getCourseList(){\r\n\r\n CourseDAO courseDAO = new CourseDA...
[ "0.77597445", "0.7322531", "0.7084119", "0.7055236", "0.70143205", "0.6547834", "0.6528116", "0.65139914", "0.646966", "0.64585626", "0.640971", "0.63782555", "0.63617784", "0.6355388", "0.63546795", "0.6347453", "0.63063085", "0.62739164", "0.626441", "0.6202286", "0.6161952...
0.0
-1
return courses.stream().filter(t > t.getId().equals(id)).findFirst().get();
public Optional<Course> getCourse(String id) { return courseRepository.findById(id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Book getBookById(int id){\n Book book = null;\n //list.stream->to take the stream\n\n book = list.stream().filter(e->e.getId()==id).findFirst().get();\n return book;\n }", "public Optional<Course> getCourse(String id) {\n//\t\treturn topics.stream().filter(t -> t.getId().equ...
[ "0.6319548", "0.6233512", "0.6110075", "0.58244663", "0.5797044", "0.56808424", "0.56308216", "0.5629954", "0.5519969", "0.5508738", "0.550725", "0.550697", "0.54409575", "0.5423597", "0.54188246", "0.5410413", "0.5388876", "0.5373439", "0.537189", "0.53563887", "0.5342688", ...
0.5001701
66
tim resetPassword bang cach nhap vao token
public ResetPasswordToken findByToken(String token);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void getResetPassword() {\n\t\t// TODO Auto-generated method stub\n\t\tdialog = new ZProgressHUD(ChangePasswordActivity.this);\n\t\tdialog.setMessage(\"Pls wait ...\");\n\t\tdialog.show();\n\t\t\n\t\tNetworkEngine.setIP(\"starticketmyanmar.com\");\n\t\tNetworkEngine.getInstance().GetResetPassword(email, co...
[ "0.7463428", "0.720153", "0.71223974", "0.70906365", "0.70656544", "0.7061021", "0.7006734", "0.694768", "0.68153733", "0.6754829", "0.67364025", "0.66740716", "0.6661337", "0.66583323", "0.6620826", "0.66058105", "0.65519774", "0.652335", "0.65076345", "0.64991415", "0.64962...
0.0
-1
check xem token da ton tai chua
public boolean existsByToken(String token);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void checkToken(String token) throws InvalidTokenException;", "boolean hasToken();", "boolean hasToken();", "boolean hasToken();", "boolean hasToken();", "boolean hasToken();", "boolean hasToken();", "public void validarToken() {\r\n\t\ttry {\r\n\t\t\tif (getToken() == null || getToken().trim().isEmp...
[ "0.6815072", "0.6406859", "0.6406859", "0.6406859", "0.6406859", "0.6406859", "0.6406859", "0.6328021", "0.62610364", "0.6243089", "0.6204388", "0.61386037", "0.6130383", "0.59963316", "0.598916", "0.58346593", "0.583368", "0.582131", "0.58090544", "0.5778282", "0.5771237", ...
0.0
-1
register that the Spinner was opened so we have a status indicator for the activity (which may lose focus for some other reasons)
@Override public boolean performClick() { throwEvents = true; return super.performClick(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void setStatusSpinner() {\r\n\t\tSpinner spinner = (Spinner) mActionBar.getCustomView().findViewById(\r\n\t\t\t\tR.id.spinner_status);\r\n\t\tif (!mShowStatusFilter\r\n\t\t\t\t|| mArchiveFragmentStatePagerAdapter.getCount() == 0) {\r\n\t\t\tspinner.setVisibility(View.GONE);\r\n\t\t\treturn;\r\n\t\t}\r\n\...
[ "0.63253444", "0.62142324", "0.62128484", "0.61739564", "0.6125897", "0.6016609", "0.59416276", "0.59332436", "0.5932163", "0.5909901", "0.58334285", "0.58281356", "0.58073485", "0.5706889", "0.56736064", "0.56248885", "0.56194204", "0.5591948", "0.5535181", "0.5503732", "0.5...
0.0
-1
Constructor that uses the information of the starter class
public Game2(Starter starter){ chromaticManager = starter.chromaticManager; this.starter=starter; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Main() {\r\n\t\tsuper();\r\n\t\tinitialize();\r\n\r\n\t}", "public DemonstrationApp()\n {\n // Create Customers of all 3 types\n s = new Senior(\"alice\", \"123 road\", 65, \"555-5555\", 1);\n a = new Adult(\"stacy\", \"123 lane\", 65, \"555-1111\", 2);\n u = new Student(\"b...
[ "0.6705024", "0.66402256", "0.65979326", "0.65397507", "0.6537112", "0.64591587", "0.6433762", "0.64118874", "0.6409561", "0.6392914", "0.6390556", "0.6371166", "0.63526505", "0.6351597", "0.6342007", "0.63414454", "0.6338614", "0.6328229", "0.6313293", "0.6305442", "0.629876...
0.0
-1
initializes all labels and buttons
private void builder(){ //Objects //Left canvasStackPane.setAlignment(Pos.TOP_LEFT); left1HintButton = new Button("Hint"); left2Button = new Button("New Graph"); left3Button = new Button("New GameMode"); left4Button = new Button("New GraphMode"); left5Button = new Button("Finished"); leftRestLabel = new Label(); //Up upperLeftButton = new Label("Menu"); upperLeftButton.setAlignment(Pos.CENTER); upper1Label = new Label(); upper2Label = new Label(); upper3Label = new Label(); upperRestLabel = new Label(); //calculateVectors backPane.setPickOnBounds(false); textFieldVertices.setPromptText("Vertices"); textFieldEdges.setPromptText("Edges"); gameEnd.setSpacing(30); gameEnd.setAlignment(Pos.CENTER); gameWinStackPane.setAlignment(Pos.CENTER); hBoxWin.setAlignment(Pos.CENTER); hBoxWin.setSpacing(30); canvasStackPane.setPickOnBounds(true); canvas.setPickOnBounds(true); canvas.getGraphicsContext2D().setLineWidth(2.5); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initializeControls() {\n\t\tlabel = new Label(status.toString());\n\t}", "private void _initLabels() \n {\n _lblName = _createNewLabel( \"Mother Teres@ Practice Management System\");\n _lblVersion = _createNewLabel(\"Version 1.0.1 (Beta)\");\n _lblAuthor = _createNewLabel( \"...
[ "0.7857805", "0.76166296", "0.75502545", "0.7506383", "0.7474506", "0.74694633", "0.7421017", "0.7348029", "0.72103804", "0.7135895", "0.7113589", "0.7096045", "0.7081796", "0.7074739", "0.7073721", "0.7072619", "0.70660114", "0.70660114", "0.7060932", "0.70572424", "0.705703...
0.0
-1
styles all labels and buttons with the Style.css class
private void styling(){ canvasStackPane.getStyleClass().add("canvasStackPane"); upper1Label.getStyleClass().add("myLabelTest2"); upper2Label.getStyleClass().add("myLabelTest2"); upper3Label.getStyleClass().add("myLabelTest2"); upperRestLabel.getStyleClass().add("myLabelTest2"); upperHBox.getStyleClass().add("upperHBox"); leftVBox.getStyleClass().add("leftVBox"); upperLeftButton.getStyleClass().add("upperLeftButton"); left1HintButton.getStyleClass().add("leftButton"); left2Button.getStyleClass().add("leftButton"); left3Button.getStyleClass().add("leftButton"); left4Button.getStyleClass().add("leftButton"); left5Button.getStyleClass().add("leftButton"); //new GameMode newGamemodeHBox.getStyleClass().add("newGameModeHBox"); newGamemodebutton1.getStyleClass().add("chooseButtons"); newGamemodebutton2.getStyleClass().add("chooseButtons"); newGamemodebutton3.getStyleClass().add("chooseButtons"); //back Button backPane.getStyleClass().add("backPane"); backButton.getStyleClass().add("backButton"); //new Graphmode newGraphModeHBox.getStyleClass().add("newGraphModeHBox"); newGraphModebutton1.getStyleClass().add("chooseButtons"); newGraphModebutton2.getStyleClass().add("chooseButtons"); newGraphModebutton3.getStyleClass().add("chooseButtons"); sMBHBox.getStyleClass().add("newGraphModeHBox"); smallButton.getStyleClass().add("chooseButtons"); middleButton.getStyleClass().add("chooseButtons"); bigButton.getStyleClass().add("chooseButtons"); textFieldHBox.getStyleClass().add("newGraphModeHBox"); buttonTextfield.getStyleClass().add("chooseButtons"); //new Graph newGraphHBox.getStyleClass().add("newGraphHBox"); newGraphButtonYes.getStyleClass().add("chooseButtons"); newGraphButtonNo.getStyleClass().add("chooseButtons"); submit2.getStyleClass().add("chooseButtons"); listViewVBox.getStyleClass().add("newGraphHBox"); textFieldVertices.getStyleClass().add("textfield"); textFieldEdges.getStyleClass().add("textfield"); gameEndTop.getStyleClass().add("gameEndTop"); gameEndStackPane.getStyleClass().add("gameEndStackPane"); //hintmenu and hintbuttons: hintMenuStack.getStyleClass().add("newGraphModeHBox"); hintButton1.getStyleClass().add("chooseButtons"); hintButton2.getStyleClass().add("chooseButtons"); hintButton3.getStyleClass().add("chooseButtons"); hintButton4.getStyleClass().add("chooseButtons"); hintButton5.getStyleClass().add("chooseButtons"); hintButton6.getStyleClass().add("chooseButtons"); hintButton7.getStyleClass().add("chooseButtons"); hintButton8.getStyleClass().add("chooseButtons"); hintButton9.getStyleClass().add("chooseButtons"); gameWinButton1.getStyleClass().add("chooseButtons"); gameWinButton2.getStyleClass().add("chooseButtons"); gameWinStackPane.getStyleClass().add("newGraphModeHBox2"); gameWinHBox.setAlignment(Pos.CENTER); gameWinHBox.setSpacing(30); vBoxWin.setAlignment(Pos.BASELINE_CENTER); vBoxHint.setAlignment(Pos.CENTER); vBoxHint2.setAlignment(Pos.CENTER); vBoxHint3.setAlignment(Pos.CENTER); hintMenu.setAlignment(Pos.CENTER); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void style() {\n\n\t\tfinal ArrayList<String> cssClasses = new ArrayList<>();\n\t\tif (!this.styles.isEmpty()) {\n\t\t\tthis.styles.forEach(s -> {\n\t\t\t\tcssClasses.add(s.getCss());\n\t\t\t});\n\t\t}\n\n\t\t// replace the cell styles with the new set\n\t\tthis.add(AttributeModifier.replace(\"class\", Stri...
[ "0.65216047", "0.65191793", "0.6395411", "0.6361598", "0.62543684", "0.6237857", "0.6150463", "0.6133311", "0.6098977", "0.59650713", "0.59558344", "0.59454834", "0.59288037", "0.5927208", "0.59037185", "0.58983487", "0.58546966", "0.5841888", "0.5811875", "0.57833654", "0.57...
0.5801522
19
sets the size of all objects
public void setSize(double width, double height){ double topLaneHeight=height/100*myInformation.upperToDownPercent; double bottomLaneHeight=height-topLaneHeight; double leftSideWidth=width/100*myInformation.leftToRightPercent; double rightSideWidth=width-leftSideWidth-1; double buttonLeftHeight=(height-topLaneHeight)/100*myInformation.leftButtonsPercent; int countLeftButtons=0; double labelTopWidth=rightSideWidth/100*myInformation.upperButtonsPercent; int countTopLabels=0; //Regions leftVBox.setMinSize(leftSideWidth,height); leftVBox.setMaxSize(leftSideWidth,height); upperHBox.setMinSize(width,topLaneHeight); upperHBox.setMaxSize(width,topLaneHeight); canvas.setWidth(width); canvas.setHeight(bottomLaneHeight); pane.setMinSize(width,bottomLaneHeight); pane.setMaxSize(width,bottomLaneHeight); stackPane.setMinSize(width, height); stackPane.setMaxSize(width, height); mainVBox.setMinSize(width, height); mainVBox.setMaxSize(width, height); canvasStackPane.setMinSize(width,bottomLaneHeight); canvasStackPane.setMaxSize(width,bottomLaneHeight); listViewVBox.setMinSize(width, height); listViewVBox.setMaxSize(width, height); //Objects upperLeftButton.setMinSize(leftSideWidth,topLaneHeight); upperLeftButton.setMaxSize(leftSideWidth,topLaneHeight); //Left Side left1HintButton.setMinSize(leftSideWidth,buttonLeftHeight); left1HintButton.setMaxSize(leftSideWidth,buttonLeftHeight); countLeftButtons++; left2Button.setMinSize(leftSideWidth,buttonLeftHeight); left2Button.setMaxSize(leftSideWidth,buttonLeftHeight); countLeftButtons++; left3Button.setMinSize(leftSideWidth,buttonLeftHeight); left3Button.setMaxSize(leftSideWidth,buttonLeftHeight); countLeftButtons++; left4Button.setMinSize(leftSideWidth,buttonLeftHeight); left4Button.setMaxSize(leftSideWidth,buttonLeftHeight); countLeftButtons++; left5Button.setMinSize(leftSideWidth,buttonLeftHeight); left5Button.setMaxSize(leftSideWidth,buttonLeftHeight); countLeftButtons++; double restHeight=height-(buttonLeftHeight*countLeftButtons+topLaneHeight); leftRestLabel.setMinSize(leftSideWidth,restHeight); leftRestLabel.setMaxSize(leftSideWidth,restHeight); //Top upper1Label.setMinSize(labelTopWidth,topLaneHeight); upper1Label.setMaxSize(labelTopWidth,topLaneHeight); countTopLabels++; upper2Label.setMinSize(labelTopWidth,topLaneHeight); upper2Label.setMaxSize(labelTopWidth,topLaneHeight); countTopLabels++; upper3Label.setMinSize(labelTopWidth,topLaneHeight); upper3Label.setMaxSize(labelTopWidth,topLaneHeight); countTopLabels++; double restwidth=width-upperLeftButton.getWidth()-(labelTopWidth*countTopLabels); upperRestLabel.setMinSize(restwidth,topLaneHeight); upperRestLabel.setMaxSize(restwidth,topLaneHeight); //New Gamemode stuff newGamemodeHBox.setMinSize(width,height); newGamemodeHBox.setMaxSize(width,height); double nBWidth=width/100*myInformation.newGamemodeButtonsPercent.width; double nBHeight=height/100*myInformation.newGamemodeButtonsPercent.height; newGamemodebutton1.setMinSize(nBWidth,nBHeight); newGamemodebutton1.setMaxSize(nBWidth,nBHeight); newGamemodebutton2.setMinSize(nBWidth,nBHeight); newGamemodebutton2.setMaxSize(nBWidth,nBHeight); newGamemodebutton3.setMinSize(nBWidth,nBHeight); newGamemodebutton3.setMaxSize(nBWidth,nBHeight); //BackButton backPane.setMinSize(width, height); backPane.setMaxSize(width, height); double backWidth=width/100*myInformation.backButtonPercent.width; double backHeight=height/100*myInformation.backButtonPercent.height; backButton.setMinSize(backWidth,backHeight); backButton.setMaxSize(backWidth,backHeight); //New Graphmode newGraphModeHBox.setMinSize(width,height); newGraphModeHBox.setMaxSize(width,height); newGraphModebutton1.setMinSize(nBWidth,nBHeight); newGraphModebutton1.setMaxSize(nBWidth,nBHeight); newGraphModebutton2.setMinSize(nBWidth,nBHeight); newGraphModebutton2.setMaxSize(nBWidth,nBHeight); newGraphModebutton3.setMinSize(nBWidth,nBHeight); newGraphModebutton3.setMaxSize(nBWidth,nBHeight); sMBHBox.setMinSize(width,height); sMBHBox.setMaxSize(width,height); smallButton.setMinSize(nBWidth,nBHeight); smallButton.setMaxSize(nBWidth,nBHeight); middleButton.setMinSize(nBWidth,nBHeight); middleButton.setMaxSize(nBWidth,nBHeight); bigButton.setMinSize(nBWidth,nBHeight); bigButton.setMaxSize(nBWidth,nBHeight); gameEndButton.setMinSize(nBWidth,nBHeight); gameEndButton.setMaxSize(nBWidth,nBHeight); gameEndTop.setMinSize(width/2,height/5); gameEndTop.setMaxSize(width/2,height/5); listView.setMinSize(width/8,height/2); listView.setMaxSize(width/8,height/2); submit2.setMinSize(width/8,height/10); submit2.setMaxSize(width/8,height/10); textFieldHBox.setMinSize(width,height); textFieldHBox.setMaxSize(width,height); textFieldVertices.setMinSize(nBWidth,nBHeight); textFieldVertices.setMaxSize(nBWidth,nBHeight); textFieldEdges.setMinSize(nBWidth,nBHeight); textFieldEdges.setMaxSize(nBWidth,nBHeight); buttonTextfield.setMinSize(nBWidth/2,nBHeight); buttonTextfield.setMaxSize(nBWidth/2,nBHeight); //New Graph newGraphHBox.setMinSize(width,height); newGraphHBox.setMaxSize(width,height); newGraphButtonYes.setMinSize(nBWidth,nBHeight); newGraphButtonYes.setMaxSize(nBWidth,nBHeight); newGraphButtonNo.setMinSize(nBWidth,nBHeight); newGraphButtonNo.setMaxSize(nBWidth,nBHeight); hintButton1.setMinSize(nBWidth,nBHeight); hintButton1.setMaxSize(nBWidth,nBHeight); hintButton2.setMinSize(nBWidth,nBHeight); hintButton2.setMaxSize(nBWidth,nBHeight); hintButton3.setMinSize(nBWidth,nBHeight); hintButton3.setMaxSize(nBWidth,nBHeight); hintButton4.setMinSize(nBWidth,nBHeight); hintButton4.setMaxSize(nBWidth,nBHeight); hintButton5.setMinSize(nBWidth,nBHeight); hintButton5.setMaxSize(nBWidth,nBHeight); hintButton6.setMinSize(nBWidth,nBHeight); hintButton6.setMaxSize(nBWidth,nBHeight); hintButton7.setMinSize(nBWidth,nBHeight); hintButton7.setMaxSize(nBWidth,nBHeight); hintButton8.setMinSize(nBWidth,nBHeight); hintButton8.setMaxSize(nBWidth,nBHeight); hintButton9.setMinSize(nBWidth,nBHeight); hintButton9.setMaxSize(nBWidth,nBHeight); gameWinStackPane.setMinSize(width, height); gameWinStackPane.setMaxSize(width, height); gameWinButton1.setMinSize(nBWidth,nBHeight); gameWinButton1.setMaxSize(nBWidth,nBHeight); gameWinButton2.setMinSize(nBWidth,nBHeight); gameWinButton2.setMaxSize(nBWidth,nBHeight); gameWinHBox.setMinSize(width,height/4); gameWinHBox.setMaxSize(width,height/4); hintMenuStack.setMinSize(width, height); hintMenuStack.setMaxSize(width, height); hintMenu.setSpacing(width/30); vBoxHint.setSpacing(height/20); vBoxHint2.setSpacing(height/20); vBoxHint3.setSpacing(height/20); abstand.setMinSize(width,height/3); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setSize(int size) {\n\t members = size;\n\t}", "public void setObjectSize(short size) { this.objectSize=size; }", "public void setSize(int size) {\r\n _size = size;\r\n }", "private void set_size(int size)\r\n\t{\r\n\t\tthis.size = size;\r\n\t}", "public void setSize(int size){\n ...
[ "0.73268676", "0.73081195", "0.7201594", "0.71890014", "0.71755177", "0.7164561", "0.71456003", "0.71140397", "0.7089285", "0.70493144", "0.70394546", "0.70394546", "0.7031706", "0.7031706", "0.7031706", "0.7031706", "0.702756", "0.7019523", "0.7011193", "0.6907784", "0.67652...
0.0
-1
puts the labels buttons into layouts
private void insert(){ leftVBox.getChildren().addAll(left1HintButton,left2Button,left3Button,left4Button,left5Button,leftRestLabel); upperHBox.getChildren().addAll(upperLeftButton,upper1Label,upper2Label,upper3Label,upperRestLabel);//upperBoundLabel should not be visible since no text added to it canvasStackPane.getChildren().addAll(canvas,pane); mainVBox.getChildren().addAll(upperHBox,canvasStackPane); stackPane.getChildren().add(mainVBox); //new GameMode stuff newGamemodeHBox.getChildren().addAll(newGamemodebutton1,newGamemodebutton2,newGamemodebutton3); //Back button backPane.getChildren().add(backButton); //new GraphMode newGraphModeHBox.getChildren().addAll(newGraphModebutton1,newGraphModebutton2,newGraphModebutton3); //new Graph newGraphHBox.getChildren().addAll(newGraphButtonYes,newGraphButtonNo); gameWinHBox.getChildren().addAll(gameWinButton1,gameWinButton2); hBoxWin.getChildren().add(viewer); vBoxWin.getChildren().addAll(abstand,hBoxWin,gameWinHBox); gameWinStackPane.getChildren().add(vBoxWin); //add objects to Hboxes, Vboxes etc sMBHBox.getChildren().addAll(smallButton,middleButton,bigButton); textFieldHBox.getChildren().addAll(textFieldVertices,textFieldEdges,buttonTextfield); listViewVBox.getChildren().addAll(listView,submit2); gameEnd.getChildren().addAll(gameEndTop,gameEndButton); gameEndStackPane.getChildren().add(gameEnd); vBoxHint.getChildren().addAll(hintButton1,hintButton2,hintButton3); vBoxHint2.getChildren().addAll(hintButton4,hintButton5,hintButton6); vBoxHint3.getChildren().addAll(hintButton7,hintButton8,hintButton9); hintMenu.getChildren().addAll(vBoxHint,vBoxHint2,vBoxHint3); hintMenuStack.getChildren().add(hintMenu); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void createButtonsPane(VBox labelsPane){\n\t\tHBox buttonsPane = new HBox();\n\t\tButton easy = new Button(\"EASY\");\n\t\teasy.setFont(new Font(\"Arial Black\", 12));\n\t\teasy.setTextFill(Color.BLUE);\n\t\teasy.setFocusTraversable(false);\n\t\tButton medium = new Button(\"MEDIUM\");\n\t\tmedium.setFont(n...
[ "0.69442743", "0.6847555", "0.67012525", "0.6635701", "0.66051733", "0.65592164", "0.6544661", "0.65345454", "0.648647", "0.6470342", "0.64380014", "0.64272255", "0.63769484", "0.6374574", "0.636862", "0.6361705", "0.6360871", "0.633463", "0.6318422", "0.6313995", "0.628868",...
0.0
-1
actionslisteners of all objects
private void listen(){ //new Size Listeners scene.widthProperty().addListener((observable, oldValue, newValue) -> { setSize(scene.getWidth(),scene.getHeight()); setDisplay(currentGraph); }); scene.heightProperty().addListener((observable, oldValue, newValue) -> { setSize(scene.getWidth(),scene.getHeight()); setDisplay(currentGraph); }); //Button Listeners upperLeftButton.addEventHandler(MouseEvent.MOUSE_ENTERED,event -> { canvasStackPane.getChildren().removeAll(leftVBox); canvasStackPane.getChildren().add(leftVBox); }); leftVBox.addEventHandler(MouseEvent.MOUSE_EXITED,event -> { canvasStackPane.getChildren().removeAll(leftVBox); }); upper1Label.addEventHandler(MouseEvent.MOUSE_ENTERED,event -> { canvasStackPane.getChildren().removeAll(leftVBox); }); left1HintButton.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { System.out.println(currentGraph.getCNumber()); stackPane.getChildren().addAll(hintMenuStack,backPane); }); left2Button.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { canvasStackPane.getChildren().removeAll(leftVBox); stackPane.getChildren().add(newGraphHBox); stackPane.getChildren().add(backPane); }); left3Button.addEventHandler(MouseEvent.MOUSE_CLICKED, event -> { canvasStackPane.getChildren().removeAll(leftVBox); stackPane.getChildren().add(newGamemodeHBox); stackPane.getChildren().add(backPane); }); left4Button.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { canvasStackPane.getChildren().removeAll(leftVBox); stackPane.getChildren().add(newGraphModeHBox); stackPane.getChildren().add(backPane); }); left5Button.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { canvasStackPane.getChildren().removeAll(leftVBox); finished(); }); //Back Button backButton.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { stackPane.getChildren().removeAll(newGraphHBox,newGamemodeHBox,newGraphModeHBox,sMBHBox,backPane,listView,textFieldHBox,listViewVBox,hintMenuStack); }); //Other Buttons newGraphButtonYes.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { stackPane.getChildren().removeAll(newGraphHBox,backPane); setNewGraph(); setDisplay(currentGraph); }); newGraphButtonNo.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { stackPane.getChildren().removeAll(newGraphHBox,backPane); }); newGraphModebutton1.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { stackPane.getChildren().removeAll(newGraphModeHBox,backPane); stackPane.getChildren().addAll(sMBHBox,backPane); }); newGraphModebutton2.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { listView.setItems(FXCollections.observableArrayList(starter.giveGraphs())); stackPane.getChildren().removeAll(newGraphModeHBox,backPane); stackPane.getChildren().addAll(listViewVBox,backPane); }); newGraphModebutton3.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { stackPane.getChildren().removeAll(newGraphModeHBox,backPane); stackPane.getChildren().addAll(textFieldHBox,backPane); }); //New Graphs Buttons smallButton.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { stackPane.getChildren().removeAll(sMBHBox,backPane); graphMode=1; selectedSize=1; setNewGraph(); setDisplay(currentGraph); }); middleButton.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { stackPane.getChildren().removeAll(sMBHBox,backPane); graphMode=1; selectedSize=2; setNewGraph(); setDisplay(currentGraph); }); bigButton.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { stackPane.getChildren().removeAll(sMBHBox,backPane); graphMode=1; selectedSize=3; setNewGraph(); setDisplay(currentGraph); }); listView.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> { if(newValue!=null){ myGraph=newValue.toString(); } }); submit2.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { stackPane.getChildren().removeAll(listViewVBox,backPane); graphMode=2; setNewGraph(); setDisplay(currentGraph); }); buttonTextfield.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { stackPane.getChildren().removeAll(textFieldHBox,backPane); graphMode=3; setNewGraph(); }); //new gamemode buttons: newGamemodebutton1.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { gamemode=1; setNewGraph(); setDisplay(currentGraph); stackPane.getChildren().removeAll(newGamemodeHBox,backPane); }); newGamemodebutton2.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { gamemode=2; stackPane.getChildren().removeAll(newGamemodeHBox,backPane); setNewGraph(); setDisplay(currentGraph); }); newGamemodebutton3.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { gamemode=3; stackPane.getChildren().removeAll(newGamemodeHBox,backPane); setNewGraph(); setDisplay(currentGraph); }); gameEndButton.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { stackPane.getChildren().removeAll(gameEndStackPane,gameWinStackPane); setNewGraph(); setDisplay(currentGraph); }); //action listeners for the hintbuttons and call the giveHint method hintButton1.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { giveHint(1); hintButtonClick(hintButton1); }); hintButton2.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { giveHint(2); hintButtonClick(hintButton2); }); hintButton3.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { giveHint(3); hintButtonClick(hintButton3); }); hintButton4.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { giveHint(4); hintButtonClick(hintButton4); }); hintButton5.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { giveHint(5); hintButtonClick(hintButton5); }); hintButton6.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { giveHint(6); hintButtonClick(hintButton6); }); hintButton7.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { giveHint(7); hintButtonClick(hintButton7); }); hintButton8.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { giveHint(8); hintButtonClick(hintButton8); }); hintButton9.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { giveHint(9); hintButtonClick(hintButton9); }); gameWinButton2.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { System.exit(0); }); gameWinButton1.addEventHandler(MouseEvent.MOUSE_CLICKED,event -> { stackPane.getChildren().removeAll(gameEndStackPane,gameWinStackPane); setNewGraph(); setDisplay(currentGraph); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Iterator actionListeners();", "private void addActionListeners() {\n\t\tif(this.actionListener == null)\n\t\t\t\treturn; \n\t\t\n\t\t\n\t\t/**\n\t\t\tADD ACTION LISTENERS FOR BUTTONS HERE \n\t\t*/\n\t\tclearButton.addActionListener(this.actionListener);\n\t\tsinButton.addActionListener(this.actionListener);\n\t...
[ "0.6821182", "0.66293377", "0.6614442", "0.65549654", "0.6419411", "0.6363357", "0.625966", "0.6212835", "0.6184338", "0.6183752", "0.61293525", "0.6105646", "0.60883373", "0.6044393", "0.60352516", "0.60282016", "0.60209185", "0.6011334", "0.60091823", "0.6008527", "0.599719...
0.0
-1
timer for certain gamemodes
private void setDisplay(Graph graph){ if(currentGraph!=null) { resetHintButtons(); int v=graph.getVertices(); if(v<=10){ Parameters.maxPushOf=30; } if(10<v&&v<=20){ Parameters.maxPushOf=20; } if(20<v&&v<=30){ Parameters.maxPushOf=10; } if(30<v&&v<=40){ Parameters.maxPushOf=9; } if(v>40){ Parameters.maxPushOf=8; } upper1Label.setText(""); upper2Label.setText(""); upper3Label.setText(""); if (timer != null) { timer.stop(); } //for the second gamemode (fixed time): if (gamemode == 2) { double time = currentGraph.getVertices()*10; timing = (int) time; timer = new Timeline(new KeyFrame(Duration.seconds(1), event -> { timing--; upper3Label.setText("Time: "+Double.toString(timing)); })); timer.setCycleCount((int) time); timer.setOnFinished(event -> { timing = 0; timerUp(); }); timer.play(); } clear(); double myWidth = canvas.getWidth(); double myHeight = canvas.getHeight(); System.out.println(myWidth + " " + myHeight); ArrayList<Dot> list = graph.getList(); Random random = new Random(); for (int i = 0; i < list.size(); i++) { int x = random.nextInt((int) Math.round(myWidth / 4)) + (int) Math.round((myWidth / 2) - myWidth / 8); int y = random.nextInt((int) Math.round(myHeight / 4)) + (int) Math.round((myHeight / 2) - myHeight / 8); list.get(i).setPosition(new Position(x, y)); list.get(i).setParent(this); if (gamemode == 3) { list.get(i).gameMode = 3; list.get(i).removeMain(); } //list.get(i).setOnAction(graphHandeler); list.get(i).getStyleClass().add("graphButton"); pane.getChildren().add(list.get(i)); } Timeline timeline = new Timeline(new KeyFrame(Duration.millis(1), ev -> { canvas.getGraphicsContext2D().clearRect(0, 0, canvas.getWidth(), canvas.getHeight()); ArrayList<Position> positionArrayList = new ArrayList(); for (int i = 0; i < list.size(); i++) { Dot d = list.remove(i); positionArrayList.add(d.calculateVectors(list, d.giveList(), canvas.getWidth(), canvas.getHeight())); list.add(i, d); } for (int i = 0; i < list.size(); i++) { list.get(i).setPosition(positionArrayList.get(i)); } for (int i = 0; i < list.size(); i++) { printDot(list.get(i), true); printDot(list.get(i), false); } })); timeline.setCycleCount(Parameters.trys); timeline.play(); if (gamemode == 3) { list.get(0).getChildren().add(list.get(0).hBox); hintButtonClick(hintButton5); hintButtonClick(hintButton7); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void timer() {\r\n date.setTime(System.currentTimeMillis());\r\n calendarG.setTime(date);\r\n hours = calendarG.get(Calendar.HOUR_OF_DAY);\r\n minutes = calendarG.get(Calendar.MINUTE);\r\n seconds = calendarG.get(Calendar.SECOND);\r\n //Gdx.app.debug(\"Clock\", hour...
[ "0.70709", "0.6975243", "0.66872895", "0.6628363", "0.66124743", "0.65816087", "0.65767056", "0.65266097", "0.6519992", "0.651401", "0.64727706", "0.6440637", "0.64123976", "0.64089805", "0.64070725", "0.640186", "0.6383576", "0.63456535", "0.63343096", "0.63290095", "0.62766...
0.0
-1
goes to the array that contains all dots
public Dot findNewDot(){ ArrayList<Dot> myList = currentGraph.getList(); for(int i=0;i<myList.size();i++){ if(!myList.get(i).getWasClicked()){ return myList.get(i); } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public /*@ non_null @*/ StringBuffer toDot(){\n\n StringBuffer r = new StringBuffer();\n\n for(int i = 0; i <= sons.size() - 1; i++)\n\tr.append(getChildAt(i).toDot());\n \n return r;\n }", "public boolean supportsEightDot();", "abstract String toDot();", "private void displayDots(Text...
[ "0.5703925", "0.5649251", "0.5611644", "0.55299455", "0.55151886", "0.54816175", "0.5464931", "0.54028463", "0.53168625", "0.524951", "0.52433175", "0.51375943", "0.51351863", "0.5130917", "0.5115199", "0.5069492", "0.5040766", "0.49928758", "0.49838594", "0.49756008", "0.497...
0.0
-1
sets new graph when asked for
public void setGraph(){ setDisplay(currentGraph); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setNewGraph() {\n\tresetHints();\r\n Random random = new Random();\r\n if (graphMode == 1) {\r\n if (selectedSize == 1) {\r\n currentGraph = chromaticManager.calculate(random.nextInt(myInformation.smallGraph) + 1, -1);\r\n }\r\n if (selected...
[ "0.79482836", "0.72511613", "0.6943112", "0.685297", "0.6786141", "0.6779889", "0.6703361", "0.6678774", "0.6642605", "0.6638569", "0.6573912", "0.65730697", "0.6570334", "0.65248597", "0.6493634", "0.64386874", "0.6420303", "0.6410147", "0.63685393", "0.63602453", "0.6331972...
0.762611
1
clears the old graph
public void clear(){ canvas.getGraphicsContext2D().clearRect(canvas.getWidth(),canvas.getHeight(),1,1); pane.getChildren().clear(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void clearGraph(){\n\t\tthis.tools.clearGraph(graph);\n\t}", "public void resetGraph(){\n removeAllSeries();\n removeSeries(xySeries);\n removeSeries(currentPoint);\n xySeries = new PointsGraphSeries<>();\n currentPoint = new PointsGraphSeries<>();\n initGraph();\...
[ "0.89153737", "0.79540634", "0.7896196", "0.7845421", "0.77911615", "0.7745115", "0.767321", "0.76486593", "0.75866914", "0.7535756", "0.75170964", "0.74712217", "0.74297094", "0.7387224", "0.737819", "0.73648703", "0.7357586", "0.7339117", "0.73074067", "0.7275538", "0.71972...
0.0
-1
gives edges a colour for hint 8, and otherwise colours them pink, so the user knows to which vertices a vertix is connected
public void printDot(Dot dot,boolean colored){ if(gamemode==3){//does not work for gamemode3 return; } else { ArrayList<Dot> myList = dot.giveList(); for(int x=0;x<myList.size();x++){ Position position1 = dot.position; Dot myDot = myList.get(x); Position position2 = myDot.position; if(colored){ if( true &&myDot.coloredAs!=null && CalculateScore.hintEightUsed){ canvas.getGraphicsContext2D().setStroke(myDot.coloredAs); } else{ canvas.getGraphicsContext2D().setStroke(Color.DEEPPINK); } } else{ canvas.getGraphicsContext2D().setStroke(Color.BLACK); } canvas.getGraphicsContext2D().strokeLine(position1.x+15,position1.y+15,position2.x+15,position2.y+15); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int colorVertices();", "public int getColor(Vertex v);", "@Override\n public Color getColor() {\n return super.getEdgeColor();\n }", "Color generateColor(Vertex v) {\n if (v.x == width - 1 && v.y == height - 1) {\n return Color.magenta;\n }\n else if (v.path) {\n return...
[ "0.67667085", "0.64858174", "0.6187623", "0.60073894", "0.59483963", "0.5918566", "0.58021754", "0.58016324", "0.57629746", "0.5704806", "0.5649932", "0.56468683", "0.56197006", "0.5598427", "0.55693424", "0.5528943", "0.5528943", "0.5525498", "0.5513469", "0.5497861", "0.549...
0.0
-1
checks if user completed the game
public boolean coloredRight(Graph graph){ set.clear(); ArrayList<Dot> list = graph.getList(); //Set set = new HashSet(); for(int i=0;i<list.size();i++){ if(list.get(i).coloredAs==null){ return false; } ArrayList<Dot> innerList = list.get(i).giveList(); for(int x=0;x<innerList.size();x++){ if(list.get(i).coloredAs.equals(innerList.get(x).coloredAs)){ return false; } } set.add(list.get(i).coloredAs); } if(gamemode==1){ return graph.getCNumber()==set.size(); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean isGameComplete();", "protected abstract boolean isGameFinished();", "public boolean isGameFinished() {\n if (listaJogadores.size() - listaJogadoresFalidos.size() == 1) {\n return true;\n } else {\n return false;\n }\n\n }", "public boolean gameCompleted()...
[ "0.8297523", "0.75534505", "0.7480342", "0.7320391", "0.7312901", "0.7300506", "0.7246569", "0.7225528", "0.7130212", "0.71258545", "0.7122265", "0.7103765", "0.7081852", "0.70768756", "0.70448256", "0.7036582", "0.7012491", "0.7002946", "0.6998323", "0.6989918", "0.6987698",...
0.0
-1
game ends when out of time
private void timerUp(){ stackPane.getChildren().add(gameEndStackPane); System.out.println("TOP"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void endGame () {\n gameOver = true;\n System.out.println(\"Game over\");\n timer.cancel();\n }", "private void gameTimerOnFinish() {\n if (currentScreenGameState == GameState.PLAYING) {\n stopGame();\n }\n }", "@Override\n\tpublic void endGame() {\n\t\tsuper...
[ "0.823965", "0.80347985", "0.7949281", "0.7818795", "0.7807868", "0.7786513", "0.7755159", "0.76983523", "0.7647268", "0.7637474", "0.76300836", "0.76112986", "0.7603124", "0.75807905", "0.7555863", "0.75533587", "0.7486877", "0.7454506", "0.74424905", "0.7434532", "0.7412118...
0.0
-1
method to call when player wants a new level
public void setNewGraph() { resetHints(); Random random = new Random(); if (graphMode == 1) { if (selectedSize == 1) { currentGraph = chromaticManager.calculate(random.nextInt(myInformation.smallGraph) + 1, -1); } if (selectedSize == 2) { currentGraph = chromaticManager.calculate(random.nextInt(myInformation.middleGraph - myInformation.smallGraph) + myInformation.smallGraph + 1, -1); } if (selectedSize == 3) { currentGraph = chromaticManager.calculate(random.nextInt(myInformation.bigGraph - myInformation.middleGraph) + myInformation.middleGraph + 1, -1); } } if (graphMode == 2) { currentGraph = chromaticManager.calculate(myGraph); } if (graphMode == 3) { try { stackPane.getChildren().removeAll(textFieldHBox, backPane); myVertices = Integer.parseInt(textFieldVertices.getText()); myEdges = Integer.parseInt(textFieldEdges.getText()); currentGraph = chromaticManager.calculate(myVertices, myEdges); setDisplay(currentGraph); } catch (NumberFormatException e) { } } threadPoolExecutor.execute(() -> { NewForce newForce = new NewForce(); currentGraph.setCNumer(newForce.doNewForce(currentGraph,currentGraph.getUpperBound(),currentGraph.getLowerBound())); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void newGame(String level) {\n\t\tmanager.newGame(level);\n\t}", "void createNewLevel(int level);", "public void createLevel() {\n room = 1;\n currentLevelFinish = false;\n createRoom();\n }", "public abstract void levelComplete();", "public void setLevel(Level l...
[ "0.77346087", "0.7156306", "0.7129588", "0.70323896", "0.6933603", "0.6895388", "0.6758371", "0.6700989", "0.66686195", "0.66462517", "0.6607258", "0.65942776", "0.6573842", "0.655146", "0.6539131", "0.65245587", "0.6443925", "0.64380515", "0.6436263", "0.6423686", "0.6414084...
0.0
-1
reset the hintButtons, for when a new game is started
private void resetHintButtons(){ rHintButton(hintButton1); rHintButton(hintButton2); rHintButton(hintButton3); rHintButton(hintButton4); rHintButton(hintButton5); rHintButton(hintButton6); rHintButton(hintButton7); rHintButton(hintButton8); rHintButton(hintButton9); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void resetHints() {//use this whenever there's a new graph, or whenever a new game is started!\r\n CalculateScore.hintOneUsed = false;\r\n CalculateScore.hintTwoUsed = false;\r\n CalculateScore.hintThreeUsed = false;\r\n CalculateScore.hintFourUsed = false;\r\n CalculateSc...
[ "0.7096627", "0.6960244", "0.66729736", "0.6616689", "0.65005285", "0.64736664", "0.64634216", "0.6452023", "0.643507", "0.6415438", "0.6388668", "0.6386984", "0.6373013", "0.63671917", "0.63640636", "0.6345655", "0.6333251", "0.6330852", "0.6301787", "0.62656987", "0.6230795...
0.8463895
0
let the hintbuttons be clickable again
private void rHintButton(Button button){ button.getStyleClass().remove("closedButton"); button.getStyleClass().add("chooseButtons"); button.setMouseTransparent(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void resetHintButtons(){\r\n rHintButton(hintButton1);\r\n rHintButton(hintButton2);\r\n rHintButton(hintButton3);\r\n rHintButton(hintButton4);\r\n rHintButton(hintButton5);\r\n rHintButton(hintButton6);\r\n rHintButton(hintButton7);\r\n rHintButton(...
[ "0.7253545", "0.68658453", "0.68266034", "0.6777662", "0.66089433", "0.64134145", "0.6409922", "0.62815017", "0.6106895", "0.60150623", "0.59935904", "0.5976571", "0.5943093", "0.59272826", "0.59171784", "0.5887033", "0.58848184", "0.58541054", "0.5841084", "0.582815", "0.580...
0.6523829
5
a hintbutton can not be used twice
public void hintButtonClick(Button button){ button.setMouseTransparent(true); button.getStyleClass().removeAll("chooseButtons"); button.getStyleClass().add("closedButton"); stackPane.getChildren().removeAll(hintMenuStack,backPane); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract void showHint();", "public boolean isShowingHintText() {\n/* 1355 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\thintButton.setVisible(false);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbtnBuyHint.setVisible(true);...
[ "0.688848", "0.66219974", "0.66154206", "0.6480287", "0.64648604", "0.6442502", "0.6407876", "0.63996595", "0.63817596", "0.6335334", "0.6324155", "0.6251914", "0.6139756", "0.6123989", "0.6108387", "0.61026233", "0.6070719", "0.6052093", "0.60037255", "0.59631515", "0.594597...
0.6413797
6
resets all hints when a new level starts
public void resetHints() {//use this whenever there's a new graph, or whenever a new game is started! CalculateScore.hintOneUsed = false; CalculateScore.hintTwoUsed = false; CalculateScore.hintThreeUsed = false; CalculateScore.hintFourUsed = false; CalculateScore.hintFiveUsed = false; CalculateScore.hintSixUsed = false; CalculateScore.hintSevenUsed = false; CalculateScore.hintEightUsed = false; CalculateScore.hintNineUsed = false; hint4 = false; hint9 = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void reset() {\n\t\tlevel.getLogic().resetBoard();\n\t\tlevelView.refresh();\n\t\tlevelView.clearSelectedWords();\n\t}", "public void startAgain() {\n setLevel(1);\n setScore(0);\n setPotion(0);\n setBonusKeys(0);\n setCoin(0);\n setHealth(100);\n startGame();\n }", "private void ...
[ "0.6501485", "0.6409072", "0.61676484", "0.61624414", "0.6090071", "0.6082508", "0.60714597", "0.60469", "0.6045061", "0.6011238", "0.6008135", "0.6004512", "0.59957063", "0.5993795", "0.5984557", "0.598429", "0.5956605", "0.5927996", "0.5898535", "0.589204", "0.5872433", "...
0.74803424
0
calculate the score according to the gameMode,
public void scoresForGameModes() { CalculateScore myScore = new CalculateScore(); this.score = myScore.giveScore(); if (gamemode == 1) { return; } if (gamemode ==2 ) { this.score = this.score - (10 * (currentGraph.getCNumber() - set.size())); } if (gamemode ==3) { this.score = this.score - (10 * (currentGraph.getCNumber() -set.size())); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void calculateScore() {\n\n turnScore();\n\n if (turn == 1) {\n p1.setScore(p1.getScore() - turnScore);\n\n } else if (turn == 2) {\n p2.setScore(p2.getScore() - turnScore);\n\n }\n\n\n }", "public int score(){\r\n\t\t//to be implemented: should return ...
[ "0.7238375", "0.71071494", "0.7005189", "0.69778585", "0.69021493", "0.69021493", "0.6827199", "0.6827199", "0.6819747", "0.6819747", "0.6819747", "0.6819747", "0.67951584", "0.67928195", "0.6740139", "0.6722207", "0.6718536", "0.6701753", "0.66886085", "0.6684204", "0.667928...
0.83632445
0
method to check if user completes the level
public void finished(){ if(coloredRight(currentGraph)==true){ scoresForGameModes(); System.out.println(score); hBoxWin.getChildren().clear(); viewer.setImage(new Image(new File("src/GraphColoring/kittencoin.gif").toURI().toString())); ImageView viewer2 = new ImageView(); viewer2.setImage(new Image(new File("src/GraphColoring/kittencoin.gif").toURI().toString())); ImageView viewer3 = new ImageView(); viewer3.setImage(new Image(new File("src/GraphColoring/kittencoin.gif").toURI().toString())); ImageView viewer4 = new ImageView(); viewer4.setImage(new Image(new File("src/GraphColoring/kittencoin.gif").toURI().toString())); ImageView viewer5 = new ImageView(); viewer5.setImage(new Image(new File("src/GraphColoring/kittencoin.gif").toURI().toString())); if(score>=100){ hBoxWin.getChildren().addAll(viewer,viewer2,viewer3,viewer4,viewer5); } else if(score >= 90 && score<100){ hBoxWin.getChildren().addAll(viewer,viewer2,viewer3,viewer4,viewer5); viewer5.setEffect(new ColorAdjust(0,0,-0.9,0)); } else if(score >= 60 && score<90){ hBoxWin.getChildren().addAll(viewer,viewer2,viewer3,viewer4,viewer5); viewer5.setEffect(new ColorAdjust(0,0,-0.9,0)); viewer4.setEffect(new ColorAdjust(0,0,-0.9,0)); } else if(score >= 30 && score<60){ hBoxWin.getChildren().addAll(viewer,viewer2,viewer3,viewer4,viewer5); viewer5.setEffect(new ColorAdjust(0,0,-0.9,0)); viewer4.setEffect(new ColorAdjust(0,0,-0.9,0)); viewer3.setEffect(new ColorAdjust(0,0,-0.9,0)); } else if(score<30){ hBoxWin.getChildren().addAll(viewer,viewer2,viewer3,viewer4,viewer5); viewer5.setEffect(new ColorAdjust(0,0,-0.9,0)); viewer4.setEffect(new ColorAdjust(0,0,-0.9,0)); viewer3.setEffect(new ColorAdjust(0,0,-0.9,0)); viewer2.setEffect(new ColorAdjust(0,0,-0.9,0)); } stackPane.getChildren().add(gameWinStackPane); resetHints(); }else{ if(gamemode==3){ stackPane.getChildren().add(gameEndStackPane); }else{ String string = upper2Label.getText(); upper2Label.setText("Nononono"); Timeline timeline = new Timeline(new KeyFrame(Duration.seconds(3),event -> { })); timeline.play(); timeline.setOnFinished(event -> { upper2Label.setText(string); }); } } //should be displayed in the score window when the game is finished }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isCompleted() {\n \n // set amount of bottles to complete the level\n int bottlesAmount = 3;\n \n // if player collects the set amount, level is completed\n if (player.getBottles() == bottlesAmount)\n {\n return true;\n }\n el...
[ "0.71750134", "0.70523626", "0.6736136", "0.6736136", "0.6736136", "0.6736136", "0.6720822", "0.66995233", "0.65907717", "0.6478759", "0.6318801", "0.6272963", "0.6236675", "0.6217133", "0.6213934", "0.61516434", "0.60672283", "0.6032288", "0.6014152", "0.59637403", "0.594730...
0.0
-1
Construct an RPG with a goal which overrides that contained in the first parameter's GroundProblem.goal field.
public RelaxedPlanningGraph(GroundProblem gp, GroundFact goal) { // super(gp); // setProposition(gp.groundedPropositions); setActionMap(gp.actions); this.setLinks(); createNoOps(); this.setGoal(goal); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ResiduatedGoal (Goal goal)\n {\n setGoal(goal);\n }", "public final void setGoal(final int goal)\n {\n this.goal = goal;\n }", "public void setGoal(Goal goal) {\n this.put(\"goal\", goal);\n }", "public void setGoal(GoalComponent goal) {\n \tthis.goal = goal;\n ...
[ "0.6874721", "0.61363333", "0.60040873", "0.59572995", "0.58521634", "0.5789535", "0.57260543", "0.57198435", "0.5705864", "0.5647149", "0.560725", "0.5604142", "0.55809176", "0.5579771", "0.55474436", "0.55406046", "0.5504151", "0.54397863", "0.54343575", "0.5324679", "0.530...
0.6261821
1
Loads the desired window
@Override public void start(Stage primaryStage) throws Exception{ // Loads the Home view Parent root = FXMLLoader.load(getClass().getResource("fxml/Home.fxml")); primaryStage.setTitle("To-Do Manager"); // Sets the title of the window // Sets the Home view as the first scene Scene scene = new Scene(root, 854, 480); // Sets the window's scene primaryStage.setScene(scene); // Prevents user from resizing window ( because of UI reasons ) primaryStage.setResizable(false); // Displays the window primaryStage.show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void loadwindow(String loc, String title){\n\t \ttry{\n\t \t\tParent parent = FXMLLoader.load(getClass().getClassLoader().getResource(loc));\n\t \t\tStage stage = new Stage(StageStyle.DECORATED);\n\t \t\tstage.setTitle(title);\n\t \t\tstage.setScene(new Scene(parent));\n\t \t\tstage.show();\n\t ...
[ "0.7265962", "0.70349294", "0.6799309", "0.67089593", "0.6695729", "0.6591578", "0.65402913", "0.64924484", "0.6467235", "0.6384751", "0.6347576", "0.6329056", "0.63175744", "0.63164866", "0.63102716", "0.6304431", "0.6302471", "0.6297094", "0.629383", "0.6279384", "0.6278723...
0.0
-1
Loads the tasks that were saved in the txt file when the program launches
@Override public void init() throws IOException { ToDoData.getInstance().loadTasks(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void loadTasks() {\n try {\n List<Task> tasks = Reader.readTasks(new File(TASKS_FILE));\n for (Task t1 : tasks) {\n todoList.addTask(t1);\n }\n } catch (IOException e) {\n System.err.println(\"No file exists\");\n }\n }", ...
[ "0.80574304", "0.7443564", "0.7269915", "0.7254154", "0.7203555", "0.69700986", "0.6922332", "0.6919607", "0.686677", "0.66444445", "0.6562037", "0.65422654", "0.6447056", "0.64270747", "0.6372943", "0.6365948", "0.63441825", "0.63368195", "0.6298351", "0.6275737", "0.6270348...
0.64288014
13
Store the tasks that were inputted by the user into a txt file when the program closes
@Override public void stop() throws IOException { ToDoData.getInstance().storeTasks(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void saveTasks() {\n try {\n Writer writer = new Writer(new File(TASKS_FILE));\n for (Task t1: todoList.getListOfTasks()) {\n writer.write(t1);\n }\n writer.close();\n System.out.println(\"Tasks saved to file \" + TASKS_FILE);\n ...
[ "0.7124938", "0.69849306", "0.67073435", "0.6503493", "0.64676327", "0.6437171", "0.6410594", "0.63900054", "0.6373389", "0.6308426", "0.6209251", "0.61559397", "0.61556876", "0.6118998", "0.6085441", "0.60651606", "0.60454327", "0.60421", "0.6023279", "0.6000188", "0.5982541...
0.5895769
24
Get TE path. Build TePathQueryKey object by parameters,and query the L2vpnTePath by TePathQueryKey. Add description for L2vpnTePath, and add all L2vpnTePath to the list.
@GET @Consumes({"application/json"}) @Produces({"application/json"}) public RestRsp<List<TePathList>> getTePath(@QueryParam("vpnId") final String vpnId, @QueryParam("srcNeId") final String srcNeId, @QueryParam("destNeId") final String destNeId, @QueryParam("srcAcId") final String srcAcId, @QueryParam("destAcId") final String destAcId, final HttpContext httpContext) { final List<TePathList> tePathLists = new ArrayList<TePathList>(); TePathQueryKey posTePathQueryKey = null; try { posTePathQueryKey = new TePathQueryKey(vpnId, srcNeId, destNeId, srcAcId, destAcId); final List<TePathList> posTePathLists = getTePathLists(posTePathQueryKey, "positive"); if(!posTePathLists.isEmpty()) { tePathLists.addAll(posTePathLists); } } catch(final ServiceException e) { } TePathQueryKey negTePathQueryKey = null; try { negTePathQueryKey = new TePathQueryKey(vpnId, destNeId, srcNeId, destAcId, srcAcId); final List<TePathList> negTePathLists = getTePathLists(negTePathQueryKey, "negative"); if(!negTePathLists.isEmpty()) { tePathLists.addAll(negTePathLists); } } catch(final ServiceException e) { } return new RestRsp<List<TePathList>>(ResultConstants.SUCCESS, tePathLists); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public RDFList path(RDFList exp) {\r\n RDFList ll = new RDFList(exp.head(), exp.getList());\r\n Expression re = list();\r\n\r\n for (Expression ee : exp.getList()){\r\n Triple t = createPath(exp.head(), re, ee);\r\n ll.add(t);\r\n }\r\n \r\n return ll;\...
[ "0.45493317", "0.45396304", "0.45055223", "0.44384977", "0.4431791", "0.44304344", "0.44291028", "0.4423157", "0.43802512", "0.43775022", "0.43423182", "0.43238968", "0.42805004", "0.42461523", "0.42375287", "0.42360768", "0.42328623", "0.4226529", "0.4181754", "0.41572395", ...
0.5902417
0
Send Mail to respective users of the dataset
public static void sendMail(String emailRecepients, String emailSubject, String dataSetName, String emailBody) { try { logger.info("Sending Email Notification"); JavaMailSenderImpl mailSender = new JavaMailSenderImpl(); String dataSetPath = ""; mailSender.setHost(PropertyLoaderUtil.MAIL_HOST); MimeMessage message = mailSender.createMimeMessage(); MimeMessageHelper helper = new MimeMessageHelper(message, true); helper.setFrom(PropertyLoaderUtil.MAIL_FROM); helper.setTo(org.springframework.util.StringUtils .commaDelimitedListToStringArray(emailRecepients)); String[] dataSetNameArray = null; if (dataSetName != null && !dataSetName.equals("") && !dataSetName.isEmpty()) { ST emailSubjectTemplate = new ST(emailSubject); ST emailBodyTemplate = new ST(emailBody); dataSetNameArray = dataSetName.split("&"); if (dataSetNameArray.length > 1) { dataSetName = dataSetNameArray[0]; dataSetPath = dataSetNameArray[1]; emailSubjectTemplate.add("dataset_name", dataSetName); helper.setSubject(emailSubjectTemplate.render()); // Replace the tags in the body emailBodyTemplate.add("dataset_name", dataSetName); emailBodyTemplate.add("dataset_file_name", dataSetPath); helper.setText(emailBodyTemplate.render()); } else { emailSubjectTemplate.add("dataset_name", dataSetName); helper.setSubject(emailSubjectTemplate.render()); helper.setTo(org.springframework.util.StringUtils .commaDelimitedListToStringArray(emailRecepients)); emailBodyTemplate.add("dataset_name", dataSetName); helper.setText(emailBodyTemplate.render()); } } else { helper.setSubject(emailSubject); helper.setText(emailBody); } mailSender.send(message); } catch (Exception e) { logger.error("Mail Exception " + e.getMessage()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void sendMailReport() {\n mailService.sendMail(\"users@example.org\", \"ToDo report\",\n String.format(\"There are '%s' todo entries!\", todoListService.getAllEntries().size()));\n }", "public void sendMail(RegistrationData d) {}", "public void sendInvitations(){\r\n for(...
[ "0.7356837", "0.67422456", "0.66222394", "0.6589048", "0.658726", "0.6559619", "0.6558269", "0.6393007", "0.638718", "0.6378244", "0.63637996", "0.6356709", "0.63543034", "0.63145244", "0.6313915", "0.6313196", "0.6305155", "0.6273438", "0.6270037", "0.6251576", "0.62363696",...
0.59014595
70
File: EntranceMachineState Description: Version: 1.0 Date : 2020/8/5 Author: linchaoyue Revision History: linchaoyue 2020/8/5 1.0 create
public interface EntranceMachineState { String insertCoin(EntranceMachine entranceMachine); String pass(EntranceMachine entranceMachine); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public State(Machine machine, String name) {\n this.machine = machine;\n this.name = name;\n }", "ESMFState getState();", "StateMachineFactory getStateMachineFactory();", "IfaceState createState(int nlocal,IfaceSafetyStatus sts);", "void mo15871a(StateT statet);", "public abstract Exp...
[ "0.66880363", "0.65054345", "0.64291847", "0.6155524", "0.61199546", "0.6119562", "0.6016586", "0.6008621", "0.59923", "0.59790844", "0.59746677", "0.5967076", "0.5955353", "0.59152544", "0.5914054", "0.59031993", "0.5886729", "0.5884301", "0.58814627", "0.58814627", "0.58814...
0.64991176
2
TODO Autogenerated method stub
public int getCount() { return MyArrList.size(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
public Object getItem(int position) { return position; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
public long getItemId(int position) { return position; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
public View getView(final int position, View convertView, ViewGroup parent) { LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); if (convertView == null) { convertView = inflater.inflate(R.layout.activity_column, null); } // ColCode TextView txtCode = (TextView) convertView.findViewById(R.id.parents_name); txtCode.setText(MyArrList.get(position).get("parent_name")); // ColCountry TextView txtCountry = (TextView) convertView.findViewById(R.id.parents_phone); txtCountry.setText(MyArrList.get(position).get("parent_phone")); // ColChk CheckBox Chk = (CheckBox) convertView.findViewById(R.id.ColChk); Chk.setTag(MyArrList.get(position).get("parent_phone")); return convertView; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
public void destroy() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
public void init(FilterConfig arg0) throws ServletException { }
{ "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
This method iterates through the char array and removes occurrences of a character
public String removeStringIterator(String oldS, Character ch) { if (oldS == null) { return oldS; } StringBuilder sb = new StringBuilder(); char[] oldArray = oldS.toCharArray(); for(int i = 0; i < oldArray.length; i++){ if(oldArray[i] == ch.charValue()){ } else { sb.append(oldArray[i]); } } return sb.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String replaceAndRemove(char[] s) {\n\n //First we remove 'b' and count a\n int countA = 0;\n int len =0;\n for (int i=0; i <= s.length-1 && s[i] != '\\u0000'; i++) {\n if (s[i] == 'a' || s[i] == 'A')\n countA++;\n\n if (s[i] == 'b' || s[i] ==...
[ "0.67136997", "0.67027265", "0.66501915", "0.6337322", "0.6177266", "0.61737263", "0.6113075", "0.6073808", "0.6058411", "0.6043226", "0.6038396", "0.601002", "0.5975733", "0.5967248", "0.59672385", "0.59136844", "0.59118664", "0.5909799", "0.5898334", "0.5861203", "0.5855381...
0.602333
11
This method removes the occurrences of char using String method replaceAll
public String removeString(String oldS, Character ch) { if (oldS == null) { return oldS; } String removeS = ch.toString(); String newS = oldS.replaceAll(removeS,""); return newS; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String RemoveCharacters(String sentence){\n\t\tString keyCharacters[] = {\"<\",\">\",\"SERVICE\",\"{\",\"}\",\"(\",\")\",\"-\"};\n\t\tString resturnString = sentence;\n\t\tfor(int i=0;i<keyCharacters.length;i++) {\n\t\t\tresturnString = resturnString.replace(keyCharacters[i],\"\");\n\t\t}\n\t\t\n\t\t...
[ "0.650562", "0.64902455", "0.6253556", "0.61905247", "0.61684006", "0.616472", "0.61380404", "0.6128014", "0.61024684", "0.6075252", "0.6049945", "0.6047281", "0.60196054", "0.5987318", "0.5946931", "0.59206855", "0.58953404", "0.5877518", "0.58662516", "0.57922673", "0.57824...
0.56479007
34
Search by ID if numeric, search by name if not.
@FXML void modifyProductSearchOnAction(ActionEvent event) { if (modifyProductSearchField.getText().matches("[0-9]+")) { modProdAddTable.getSelectionModel().select(Inventory.partIndex(Integer.valueOf(modifyProductSearchField.getText()))); } else { modProdAddTable.getSelectionModel().select(Inventory.partName(modifyProductSearchField.getText())); } //modProdAddTable.getSelectionModel().select(Inventory.partIndex(Integer.valueOf(modifyProductSearchField.getText()))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void searchByID() {\n\t\tcount = 0;\n\t\tif (UtilityClinic.patFile == null) {\n\t\t\ttry {\n\t\t\t\tutil.accessExistingPatJson();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tSystem.out.println(\"File not found\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tutil.readFromPatJson(UtilityClinic....
[ "0.6621709", "0.6323498", "0.6017775", "0.59322697", "0.5873047", "0.583565", "0.5832251", "0.5779937", "0.5776806", "0.5732501", "0.5721315", "0.5715841", "0.56589454", "0.56393516", "0.5599055", "0.55768836", "0.5576702", "0.5574611", "0.55716336", "0.5569101", "0.5561305",...
0.0
-1
Initializes the controller class.
@Override public void initialize(URL url, ResourceBundle rb) { modifyProductPartIDDelCol.setCellValueFactory(new PropertyValueFactory<>("partID")); modifyProductPartNameDelCol.setCellValueFactory(new PropertyValueFactory<>("name")); modifyProductInventoryDelCol.setCellValueFactory(new PropertyValueFactory<>("inStock")); modifyProductPriceDelCol.setCellValueFactory(new PropertyValueFactory<>("price")); modifyProductPartIDAddCol.setCellValueFactory(new PropertyValueFactory<>("partID")); modifyProductPartNameAddCol.setCellValueFactory(new PropertyValueFactory<>("name")); modifyProductInventoryAddCol.setCellValueFactory(new PropertyValueFactory<>("inStock")); modifyProductPriceAddCol.setCellValueFactory(new PropertyValueFactory<>("price")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initialize() {\n\t\tcontroller = Controller.getInstance();\n\t}", "public MainController() {\n\t\tcontroller = new Controller(this);\n\t}", "public abstract void initController();", "public Controller() {\n super();\n }", "public Controller() {\n super();\n }", "public Co...
[ "0.8125658", "0.78537387", "0.78320265", "0.776199", "0.776199", "0.76010174", "0.74497247", "0.7437837", "0.7430714", "0.742303", "0.74057597", "0.7341963", "0.7327749", "0.72634363", "0.72230434", "0.7102504", "0.70575505", "0.69873077", "0.69721675", "0.6944077", "0.691256...
0.0
-1
Reads and verifies a driver file.
public static List<File> readDriver(String fileName) { File inputFile = new File(fileName); List<File> driverFiles = null; try { if (!inputFile.isFile() || !inputFile.canRead()) throw new IllegalArgumentException("file to read is not valid"); BufferedReader bf = new BufferedReader(new FileReader(inputFile)); driverFiles = new ArrayList<File>(); String line; while ((line = bf.readLine()) != null && line.trim().length() != 0) { File file = new File(line); assert file.isFile() : "file " + file + " does not exist!"; driverFiles.add(file); } bf.close(); } catch (IOException e) { e.printStackTrace(); } assert driverFiles != null; return driverFiles; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void readFromFile(){\n\t\t\n\t\ttry {\n\t\t\tFile file=new File(\"controller.txt\");\n\t\t\tFileInputStream fin;\n\t\t\tfin = new FileInputStream(file);\n\t\t\tDataInputStream din=new DataInputStream(fin);\n\t\t\tBufferedReader br=new BufferedReader(new InputStreamReader(din));\n\t\t\t\n\t\t\tfor(int i=0; ...
[ "0.59085685", "0.5831674", "0.5586556", "0.54925424", "0.54818857", "0.5422222", "0.53606635", "0.53599167", "0.5316053", "0.5302293", "0.52989316", "0.523139", "0.52231157", "0.52175206", "0.52036315", "0.51698124", "0.5156836", "0.5142263", "0.5141371", "0.51073766", "0.505...
0.54503775
5
TODO Autogenerated method stub
private String IMO_read_file() throws Exception { CSVReader reader = new CSVReader(new FileReader(System.getProperty("user.dir") + "\\src\\main\\resources\\FileUploadData\\test_IMO.csv")); // this will load content into list List<String[]> li=reader.readAll(); System.out.println("Total rows which we have is "+li.size()); // create Iterator reference Iterator<String[]>i1= li.iterator(); // Iterate all values while(i1.hasNext()){ String[] str=i1.next(); for(int i=0;i<str.length;i++) { System.out.print(" IMO "+str[i]); } System.out.println(" "); imo_from_spreadsheet = str[0]; System.out.println("IMO " + imo_from_spreadsheet); } return imo_from_spreadsheet; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
private Object expect(String attribute) { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
Split synchronized multievent firings
public Automaton extractDelaySequence(Automaton automaton, Transition t){ List<DelayElement> DI = ((DelayInformation) t.findExtension(DelayInfoProvider.EXTENSION_ID)).getElements(); NewLinkedList result = new NewLinkedList(); List<DelayElement> Init = getEdgeInput(DI); List<NewLinkedList> dlist = new Vector<NewLinkedList>(); List<NewLinkedList> pureList = new Vector<NewLinkedList>(); for(DelayElement a : Init){ NewLinkedList temp = new NewLinkedList(); NewLinkedList copy = new NewLinkedList(); temp.sequentialInsertion(a); copy.sequentialInsertion(a); dlist.add(temp); pureList.add(copy); List<DelayElement> Pre = new Vector<DelayElement>(); List<DelayElement> Post = new Vector<DelayElement>(); Pre.add(a); Post = getNext(DI,Pre); while(!Post.isEmpty()){ for(DelayElement b : Post){ temp.contains_removes(b); copy.contains_removes(b); } temp.sequentialInsertion(Post.get(0)); copy.sequentialInsertion(Post.get(0)); for(int i=1;i<Post.size();i++){ temp.parallelInsertion(Post.get(i)); copy.parallelInsertion(Post.get(i)); } Pre.clear(); Pre.addAll(Post); Post.clear(); Post = getNext(DI,Pre); } } List<DelayElement> comTemp = new Vector<DelayElement>(); List<DelayElement> com = new Vector<DelayElement>(); NewLinkedList Common = new NewLinkedList(); for(int j=0;j<Init.size();j++){ for(int k=j+1;k<Init.size();k++){ comTemp.addAll(commonDI(dlist.get(j),dlist.get(k),Common)); for(DelayElement a : comTemp){ if(!com.contains(a)) com.add(a); } comTemp.clear(); } } if(Common.isEmpty()){ for(int m=0;m<Init.size();m++){ result = combineParallel(result,dlist.get(m),false); } } else{ result = arrangeDelaySequence(Common,dlist,false); /*List<DelayElement> to = new Vector<DelayElement>(); List<DelayElement> from = new Vector<DelayElement>(); NewNode<DelayElement> position = Common.getHead().next; NewNode<DelayElement> Rposition = position; while(Rposition!=null){ if(!to.contains(Rposition.getData())) to.add(Rposition.getData()); Rposition = Rposition.right; } for(int n=0;n<Init.size();n++){ if(dlist.get(n).contains(to)){ result = combineParallel(result,dlist.get(n).subSeq1(to)); } } result.getCurrent().next.setData(to.get(0)); result.setCurrent(result.getCurrent().next); for(int i=1;i<to.size();i++) result.addDatatoRight(to.get(i)); //Set other dummy-tail nodes NewNode<DelayElement> settingDummy1 = result.getCurrent(); while(settingDummy1!=null){ settingDummy1.dummyTail = true; settingDummy1 = settingDummy1.right; } position = position.next; Rposition = position; from.addAll(to); to.clear(); while(position!=null){ while(Rposition!=null){ if(!to.contains(Rposition.getData())) to.add(Rposition.getData()); Rposition = Rposition.right; } NewLinkedList Construction = new NewLinkedList(); for(int i=0;i<Init.size();i++){ if(dlist.get(i).contains(to) && dlist.get(i).contains(from)){ Construction = combineParallel(Construction,dlist.get(i).subSeq2(from, to)); } } Construction.getCurrent().next.setData(to.get(0)); Construction.setCurrent(Construction.getCurrent().next); for(int k=1;k<to.size();k++) Construction.addDatatoRight(to.get(k)); //Set other dummy-tail nodes NewNode<DelayElement> settingDummy2 = Construction.getCurrent(); while(settingDummy2!=null){ settingDummy2.dummyTail = true; settingDummy2 = settingDummy2.right; } NewNode<DelayElement> Tail = result.getCurrent(); Tail.next = Construction.getHead().next; Construction.getHead().next.prev = Tail; //Set "next" of dummy-tail nodes Tail = Tail.right; while(Tail!=null){ Tail.next = Construction.getHead().next; Tail = Tail.right; } result.setCurrent(Construction.getCurrent()); position = position.next; Rposition = position; from.clear(); from.addAll(to); to.clear(); } NewLinkedList lastPart = new NewLinkedList(); for(int p=0;p<Init.size();p++){ if(dlist.get(p).contains(from)){ lastPart = combineParallel(lastPart, dlist.get(p).subSeq3(from)); } } NewNode<DelayElement> lastTail = new NewNode<DelayElement>(); if(!lastPart.isEmpty()){ lastTail = result.getCurrent(); lastTail.next = lastPart.getHead().next; lastPart.getHead().next.prev = lastTail; }*/ } // Rearrange the delay-sequence // Check here!!! NewLinkedList done = result; for(int i=0;i<pureList.size();i++){ NewLinkedList newComList = new NewLinkedList(); commonDI(pureList.get(i),done, newComList); if(!newComList.isEmpty()){ List<NewLinkedList> list = new Vector<NewLinkedList>(); list.add(pureList.get(i)); list.add(done); done = arrangeDelaySequence(newComList, list, true); } } if(!com.isEmpty()){ for(int j=0;j<pureList.size();j++){ if(!pureList.get(j).contains(com)){ done = combineParallel(done, pureList.get(j),false); } } } SetDummy(done,com); // automaton = Seq2Automaton.addNewParts(automaton,t, done); automaton = newSeq2Automaton.addNewParts(automaton, t, done, false); return automaton; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static OMUpdateEventBatch processEventBatch() throws IOException {\n String omPutKey =\n OM_KEY_PREFIX + VOL +\n OM_KEY_PREFIX + BUCKET_TWO +\n OM_KEY_PREFIX + FILE_FIVE;\n OmKeyInfo omPutKeyInfo = buildOmKeyInfo(VOL, BUCKET_TWO, KEY_FIVE,\n FILE_FIVE, ...
[ "0.56287897", "0.56019485", "0.5364685", "0.5290583", "0.52714974", "0.5253581", "0.522799", "0.5176886", "0.51662725", "0.5163033", "0.5159806", "0.5143621", "0.5115812", "0.50890166", "0.5077042", "0.50670534", "0.5053132", "0.5036758", "0.49694154", "0.49444312", "0.493428...
0.0
-1
POST /companytypes : Create a new companyType.
@PostMapping("/company-types") @Timed public ResponseEntity<CompanyType> createCompanyType(@Valid @RequestBody CompanyType companyType) throws URISyntaxException { log.debug("REST request to save CompanyType : {}", companyType); if (companyType.getId() != null) { return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert("companyType", "idexists", "A new companyType cannot already have an ID")).body(null); } CompanyType result = companyTypeRepository.save(companyType); companyTypeSearchRepository.save(result); return ResponseEntity.created(new URI("/api/company-types/" + result.getId())) .headers(HeaderUtil.createEntityCreationAlert("companyType", result.getId().toString())) .body(result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@PostMapping(\"/buy-types\")\n @Timed\n @Secured({AuthoritiesConstants.ROLE_ADMIN, AuthoritiesConstants.CREATE_BUY_TYPE})\n public ResponseEntity<BuyTypeDTO> createBuyType(@Valid @RequestBody BuyTypeDTO buyTypeDTO, BindingResult validation) throws URISyntaxException {\n if (validation.hasErrors())\...
[ "0.61812866", "0.60603005", "0.58212477", "0.5755833", "0.5728134", "0.5690856", "0.5619557", "0.5600373", "0.5600373", "0.54933083", "0.54155767", "0.53511876", "0.5311198", "0.522713", "0.5223709", "0.52081245", "0.5152284", "0.5148523", "0.51305157", "0.5126014", "0.511364...
0.77885574
0
GET /companytypes : get all the companyTypes.
@GetMapping("/company-types") @Timed public List<CompanyType> getAllCompanyTypes() { log.debug("REST request to get all CompanyTypes"); List<CompanyType> companyTypes = companyTypeRepository.findAll(); return companyTypes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@ModelAttribute(\"companyTypesList\")\n\tpublic List<CompanyType> companyTypesList() {\n\t\treturn companyService.findAllCompanyType();\n\t}", "@GetMapping(\"/_search/company-types\")\n @Timed\n public List<CompanyType> searchCompanyTypes(@RequestParam String query) {\n log.debug(\"REST request to s...
[ "0.7730391", "0.711497", "0.68348396", "0.642407", "0.6417837", "0.6389668", "0.63887334", "0.6337183", "0.6329944", "0.62424433", "0.6221776", "0.61988103", "0.6181042", "0.6160427", "0.6114019", "0.60693836", "0.6005671", "0.6004534", "0.59929127", "0.596144", "0.59351915",...
0.8282668
0
GET /companytypes/:id : get the "id" companyType.
@GetMapping("/company-types/{id}") @Timed public ResponseEntity<CompanyType> getCompanyType(@PathVariable Long id) { log.debug("REST request to get CompanyType : {}", id); CompanyType companyType = companyTypeRepository.findOne(id); return Optional.ofNullable(companyType) .map(result -> new ResponseEntity<>( result, HttpStatus.OK)) .orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@GetMapping(\"/company-types\")\n @Timed\n public List<CompanyType> getAllCompanyTypes() {\n log.debug(\"REST request to get all CompanyTypes\");\n List<CompanyType> companyTypes = companyTypeRepository.findAll();\n return companyTypes;\n }", "Company getCompany(int id);", "public...
[ "0.67159796", "0.65260017", "0.64026326", "0.62174475", "0.62056935", "0.61286974", "0.6083157", "0.60632634", "0.60452616", "0.60386086", "0.6023025", "0.59749687", "0.5917332", "0.58670765", "0.5859902", "0.5789353", "0.5754627", "0.5753", "0.573719", "0.5707831", "0.570441...
0.8093608
0
DELETE /companytypes/:id : delete the "id" companyType.
@DeleteMapping("/company-types/{id}") @Timed public ResponseEntity<Void> deleteCompanyType(@PathVariable Long id) { log.debug("REST request to delete CompanyType : {}", id); companyTypeRepository.delete(id); companyTypeSearchRepository.delete(id); return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert("companyType", id.toString())).build(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@DeleteMapping(\"/buy-types/{id}\")\n @Timed\n @Secured({AuthoritiesConstants.ROLE_ADMIN, AuthoritiesConstants.DELETE_BUY_TYPE})\n public ResponseEntity<Void> deleteBuyType(@PathVariable Long id) {\n log.debug(\"REST request to delete BuyType : {}\", id);\n buyTypeService.delete(id);\n ...
[ "0.6943029", "0.6729826", "0.6685088", "0.65086967", "0.64146864", "0.625061", "0.6230942", "0.62201434", "0.6206265", "0.6175291", "0.61439306", "0.6142619", "0.6126276", "0.61151165", "0.6105263", "0.6082428", "0.6080465", "0.60763115", "0.60720605", "0.60629284", "0.603393...
0.8509025
0
SEARCH /_search/companytypes?query=:query : search for the companyType corresponding to the query.
@GetMapping("/_search/company-types") @Timed public List<CompanyType> searchCompanyTypes(@RequestParam String query) { log.debug("REST request to search CompanyTypes for query {}", query); return StreamSupport .stream(companyTypeSearchRepository.search(queryStringQuery(query)).spliterator(), false) .collect(Collectors.toList()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "SearchResultCompany search(String keywords);", "List<TypeTreatmentPlanStatuses> search(String query);", "Page<TypeBonDTO> search(String query, Pageable pageable);", "List<Corretor> search(String query);", "@Override\r\n\tpublic <T> SearchResult<T> search(String index, String type, String query, Class<T> cl...
[ "0.6904906", "0.65446484", "0.6518776", "0.6267391", "0.62289244", "0.61022496", "0.6099107", "0.60184866", "0.60053295", "0.60025215", "0.5955982", "0.59381115", "0.59091824", "0.58555144", "0.58385026", "0.58256537", "0.5819086", "0.58088386", "0.58062047", "0.57813627", "0...
0.81189364
0
Extracts a zip file specified by the zipFilePath to a directory specified by destDirectory (will be created if does not exists)
public void unzip(String zipFilePath, String destDirectory) throws IOException { File destDir = new File(destDirectory); if (!destDir.exists()) { destDir.mkdir(); } ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(zipFilePath)); ZipEntry ZipEntry = zipInputStream.getNextEntry(); while (ZipEntry != null) { String fileName = ZipEntry.getName(); String filePath = destDirectory + File.separator + fileName; if (!ZipEntry.isDirectory() && fileName.endsWith(".jar")) { extractFile(zipInputStream, filePath); } zipInputStream.closeEntry(); ZipEntry = zipInputStream.getNextEntry(); } zipInputStream.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void unzip(String zipFilePath, String destDirectory) throws IOException {\n File destDir = new File(destDirectory);\n if (!destDir.exists()) {\n destDir.mkdir();\n }\n ZipInputStream zipIn = new ZipInputStream(new FileInputStream(zipFilePath));\n ZipEntry entry ...
[ "0.81104517", "0.8109646", "0.8109646", "0.805794", "0.7729631", "0.75594914", "0.7116376", "0.704148", "0.69576687", "0.69252515", "0.69248027", "0.6882317", "0.677064", "0.6705191", "0.66617525", "0.65922517", "0.6559753", "0.6522725", "0.6472751", "0.6458442", "0.6447898",...
0.7942187
4