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 |
|---|---|---|---|---|---|---|
/ Gets all the service requests for the Admin page | @SuppressWarnings("unchecked")
public List<ServiceBean> getService_Requests()
{
logger.info("========================== Getting ALL service requests for the admin home page... =================================");
List<ServiceBean> beanList = null;
Session session = sessionFactory.getCurrentSession();
Query query = null;
List<String> scalarPropsList = null;
scalarPropsList = SQLUtil.parseSQLScalarProperties(GET_ALL_SERVICE_REQUESTS_ADMIN_SQL_SCALAR);
if (scalarPropsList != null)
{
query = SQLUtil.buildSQLQuery(session, scalarPropsList, GET_ALL_SERVICE_REQUESTS_ADMIN_SQL);
query.setResultTransformer(Transformers.aliasToBean(ServiceBean.class));
beanList = (List<ServiceBean>) query.list();
}
return beanList;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@GetMapping(\"/all\")\n public List<Admin> getAll(){\n return adminService.getAll();\n }",
"@SuppressWarnings(\"unchecked\")\r\n\tpublic List<ServiceBean> getServiceRequestsByStatus(List<String> statusList)\r\n\t{\r\n\t\tlogger.debug(\"Getting service requests for the admin home page...\");\r\n\t\tS... | [
"0.67716855",
"0.62736773",
"0.6166079",
"0.61436486",
"0.60966945",
"0.60410494",
"0.5960456",
"0.59455734",
"0.5897194",
"0.58925736",
"0.5849451",
"0.58475345",
"0.5845137",
"0.5833296",
"0.5809005",
"0.5777962",
"0.57596153",
"0.57520515",
"0.5731106",
"0.5729531",
"0.571... | 0.76659346 | 0 |
Checks duplicate entry (same user requesting same request) | public boolean checkIfExisting(ServiceRequest sr) throws SQLException
{
System.out.println("Entered checkIfExisting service request...");
Session session = sessionFactory.getCurrentSession();
ServiceRequest existingSR = null;
boolean existing = false;
int serviceId = 0;
String preferredDate = null;
Query query = null;
if (sr != null)
{
serviceId = sr.getServiceId();
preferredDate = sr.getPreferredDate();
System.out.println("===================== serviceId: " + serviceId);
System.out.println("===================== preferredDate: " + preferredDate);
try
{
query = session.createQuery(GET_DUPLICATE_SERVICE_REQUEST_HQL);
query.setParameter("serviceId", serviceId);
query.setParameter("preferredDate", preferredDate);
if (query.list() != null && query.list().size() > 0)
{
existingSR = (ServiceRequest) query.list().get(0);
if (existingSR != null)
{
System.out.println("=========== existingSR ID: " + existingSR.getId());
existing = true;
}
}
else
{
System.out.println("=========== NO DUPLICATE! ");
}
}
catch (Exception ex)
{
throw new SQLException("Error in validating the request " + ex.getMessage(), ex);
}
}
return existing;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isDuplicate(IDecodedDeviceRequest<?> request) throws SiteWhereException;",
"boolean duplicatedUsername(String username);",
"private boolean duplicationCheck(String userName) {\n\t\tboolean ret = true;\n\t\tif(obs.isEmpty()) {\n\t\t\tret = true;\n\t\t}\n\t\telse {\n\t\t\tfor(int i=0; i<obs.size()... | [
"0.66294664",
"0.6429993",
"0.63465047",
"0.6326285",
"0.6280496",
"0.6243911",
"0.6203443",
"0.61297476",
"0.6117567",
"0.60834503",
"0.60729235",
"0.6047162",
"0.59850574",
"0.5978292",
"0.5931477",
"0.5920787",
"0.5915222",
"0.5881743",
"0.5862254",
"0.5849957",
"0.5815259... | 0.559625 | 40 |
Get an amenity request by its ID | @Override
public ServiceRequest getServiceRequestById(int id) throws SQLException
{
logger.info("DAO getting a service request with ID: " + id);
System.out.println("DAO getting a service request with ID: " + id);
ServiceRequest sr = null;
Session session = sessionFactory.getCurrentSession();
Query query = session.createQuery(GET_SERVICE_REQUEST_BY_ID_HQL);
query.setParameter("id", id);
if (query.list() != null && query.list().size() > 0)
{
sr = (ServiceRequest) query.list().get(0);
}
return sr;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Acquest getAcquest(int Acquest_id);",
"RequesterVO get(int id);",
"public Optional<IncomingRequests> findSingleRequest(int id){\n\t\tOptional<IncomingRequests> requestList = incomingRequests.findById(id);\n//\t\trequestList.forEach(singleRequest::add);\n\t\treturn requestList;\n\t}",
"@Override\n\tpublic Ach... | [
"0.6941131",
"0.68028396",
"0.6498025",
"0.63360643",
"0.6260235",
"0.62268436",
"0.6214546",
"0.61188066",
"0.5974253",
"0.5941498",
"0.5906661",
"0.57342446",
"0.5681409",
"0.56383294",
"0.5629676",
"0.56286925",
"0.5618141",
"0.56151646",
"0.5565901",
"0.54997444",
"0.5496... | 0.5326685 | 35 |
Updates an Service request | public ServiceRequest updateServiceRequest(ServiceRequest sr)
{
Session session = sessionFactory.getCurrentSession();
session.update(sr);
return sr;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public UpdateRequest() {\n super(ServiceType.UPDATE);\n }",
"public abstract Response update(Request request, Response response);",
"@ApiMethod(name = \"updateRequest\")\n public Request updateRequest(Request request)throws NotFoundException {\n if (findRecord(request.getDeviceId()) == null... | [
"0.7125704",
"0.70330167",
"0.6793514",
"0.66708994",
"0.651022",
"0.64355516",
"0.64192265",
"0.62919605",
"0.62701213",
"0.62290084",
"0.61881757",
"0.6184",
"0.61735606",
"0.61629903",
"0.6162341",
"0.6159509",
"0.61266273",
"0.6084661",
"0.6040485",
"0.6013757",
"0.597322... | 0.7260207 | 0 |
/ == teste == | @Override
public String toString() {
return String.format("Company [code=%s, name=%s]", code, name);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n\tpublic void testEqualityCheck() {\n\t\tadd(\"f(x)=x^3\");\n\t\tadd(\"g(x)=-x^3\");\n\t\tt(\"f==g\", \"false\");\n\t\tt(\"f!=g\", \"true\");\n\t\tt(\"f==-g\", \"true\");\n\t\tt(\"f!=-g\", \"false\");\n\t}",
"private static boolean equalityTest1(String a, String b)\n {\n return a == b;\n }",
... | [
"0.6995958",
"0.69873565",
"0.68754447",
"0.6665366",
"0.6588887",
"0.65503883",
"0.65318704",
"0.65261006",
"0.6419526",
"0.63774717",
"0.6364703",
"0.63548976",
"0.6321407",
"0.62916905",
"0.6279174",
"0.62633055",
"0.62109476",
"0.6188728",
"0.6178783",
"0.6157297",
"0.614... | 0.0 | -1 |
populates UI of Detail Activity except Videos and Reviews | private void populateUI() {
Picasso.get()
.load(Codes.BACKDROP_URL + movie.backdropPath)
.error(R.drawable.error)
.into(mBinding.backdrop);
Picasso.get()
.load(Codes.POSTER_URL + movie.posterPath)
.error(R.drawable.error)
.into(mBinding.movieDetails.poster);
diskIO.execute(new Runnable() {
@Override
public void run() {
MiniMovie miniMovie = mDatabase.movieDao().getMovieById(movie.movieId);
if (miniMovie != null) {
isFavorite = true;
mBinding.favoriteButton.setImageResource(R.drawable.ic_star_white_24px);
} else {
isFavorite = false;
mBinding.favoriteButton.setImageResource(R.drawable.ic_star_border_white_24px);
}
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void showMovieDetails() {\n\n if (movie != null) {\n\n // Display movie title, year, and overview into corresponding labels\n if (movie.getReleaseDate().equals(\"\")) {\n\n lblTitle.setText(movie.getMovieTitle());\n lblOverview.setText(movie.getMov... | [
"0.65086186",
"0.64274335",
"0.6260261",
"0.6224185",
"0.6059388",
"0.60502136",
"0.6040935",
"0.60404813",
"0.6003163",
"0.59970975",
"0.5996006",
"0.59858394",
"0.5948042",
"0.5903201",
"0.5870083",
"0.5803606",
"0.5792522",
"0.57557464",
"0.5752385",
"0.5752059",
"0.575106... | 0.0 | -1 |
fetch videos and populate their views | private void populateVideos(Bundle savedInstanceState) {
LinearLayoutManager layoutManager =
new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
mBinding.movieVideos.videosList.setLayoutManager(layoutManager);
mBinding.movieVideos.videosList.setHasFixedSize(true);
mBinding.movieVideos.videosList.setNestedScrollingEnabled(false);
RecyclerView.ItemDecoration itemDecoration = new HorizontalItemDecoration(this);
mBinding.movieVideos.videosList.addItemDecoration(itemDecoration);
mVideoAdapter = new VideoAdapter(this);
mBinding.movieVideos.videosList.setAdapter(mVideoAdapter);
if (savedInstanceState != null && savedInstanceState.containsKey(BUNDLE_VIDEOS)) {
mVideoAdapter.addVideosList(savedInstanceState.
<Video>getParcelableArrayList(BUNDLE_VIDEOS));
if (mVideoAdapter.getItemCount() == 0) {
mBinding.movieVideos.videosLabel.setVisibility(View.GONE);
}
} else {
Call<ApiResponse<Video>> call = mApiClient.getVideos(movie.movieId);
call.enqueue(new Callback<ApiResponse<Video>>() {
@Override
public void onResponse(Call<ApiResponse<Video>> call,
Response<ApiResponse<Video>> response) {
List<Video> result = response.body().results;
mVideoAdapter.addVideosList(result);
if (result.size() == 0) {
mBinding.movieVideos.videosLabel.setVisibility(View.GONE);
}
}
@Override
public void onFailure(Call<ApiResponse<Video>> call, Throwable t) {
Toast.makeText(DetailActivity.this,
getString(R.string.connection_error), Toast.LENGTH_LONG).show();
}
});
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"VideosClient getVideos();",
"private void getVideos() {\n\n StringRequest videosRequest = new StringRequest(VIDEOS_URL+query, new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n //parse data from webservice to get Contracts as Ja... | [
"0.73309684",
"0.72596043",
"0.7096264",
"0.7028033",
"0.6895013",
"0.6765469",
"0.6672863",
"0.66132015",
"0.6373126",
"0.6368088",
"0.633543",
"0.6276877",
"0.62542886",
"0.62225616",
"0.6218292",
"0.61977535",
"0.6175995",
"0.61635965",
"0.61555254",
"0.61332077",
"0.61318... | 0.7066681 | 3 |
fetch reviews and populate their views | private void populateReviews(Bundle savedInstanceState) {
LinearLayoutManager layoutManager =
new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
mBinding.movieReviews.reviewsList.setLayoutManager(layoutManager);
mBinding.movieReviews.reviewsList.setHasFixedSize(true);
mBinding.movieReviews.reviewsList.setNestedScrollingEnabled(false);
RecyclerView.ItemDecoration itemDecoration = new HorizontalItemDecoration(this);
mBinding.movieReviews.reviewsList.addItemDecoration(itemDecoration);
mReviewAdapter = new ReviewAdapter(this);
mBinding.movieReviews.reviewsList.setAdapter(mReviewAdapter);
if (savedInstanceState != null && savedInstanceState.containsKey(BUNDLE_REVIEWS)) {
mReviewAdapter.addReviewsList(savedInstanceState.
<Review>getParcelableArrayList(BUNDLE_REVIEWS));
if (mReviewAdapter.getItemCount() == 0) {
mBinding.movieReviews.reviewsLabel.setVisibility(View.GONE);
}
} else {
Call<ApiResponse<Review>> call = mApiClient.getReviews(movie.movieId);
call.enqueue(new Callback<ApiResponse<Review>>() {
@Override
public void onResponse(Call<ApiResponse<Review>> call,
Response<ApiResponse<Review>> response) {
List<Review> result = response.body().results;
mReviewAdapter.addReviewsList(result);
if (result.size() == 0) {
mBinding.movieReviews.reviewsLabel.setVisibility(View.GONE);
}
}
@Override
public void onFailure(Call<ApiResponse<Review>> call, Throwable t) {
Toast.makeText(DetailActivity.this,
getString(R.string.connection_error), Toast.LENGTH_LONG).show();
}
});
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void updateReviews(){\r\n FetchReviewsTask reviewsTask = new FetchReviewsTask();\r\n reviewsTask.execute(MovieId);\r\n }",
"public void showReviews(View view) {\n if (reviewNo > 0) {\n //send the List of Review objects to the host activity\n listener.displayR... | [
"0.71582633",
"0.70410323",
"0.6929347",
"0.67431456",
"0.6685898",
"0.66827035",
"0.66381466",
"0.66024035",
"0.6588489",
"0.6558766",
"0.65412015",
"0.64915645",
"0.6358005",
"0.635071",
"0.63484645",
"0.6331309",
"0.6316084",
"0.63034976",
"0.6280411",
"0.6197593",
"0.6165... | 0.7202112 | 0 |
adds the movie to favorite or remove it if it already exists adding favorite means adds it to sql database | public void onClickFavoriteButton() {
String snackBarText;
if (isFavorite) {
diskIO.execute(new Runnable() {
@Override
public void run() {
mDatabase.movieDao().delete(movie);
}
});
isFavorite = false;
mBinding.favoriteButton.setImageResource(R.drawable.ic_star_border_white_24px);
snackBarText = getString(R.string.remove_favorite);
} else {
diskIO.execute(new Runnable() {
@Override
public void run() {
mDatabase.movieDao().insert(movie);
}
});
isFavorite = true;
mBinding.favoriteButton.setImageResource(R.drawable.ic_star_white_24px);
snackBarText = getString(R.string.add_favorite);
}
Snackbar.make(mBinding.coordinatorLayout, snackBarText, Snackbar.LENGTH_SHORT).show();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void addMovieToFavorites(Movie movie) {\n movie.setFavorite(true);\n isFavorite = true;\n //change the star from gray to yellow\n star.setImageResource(R.drawable.ic_grade_yellow_36px);\n //save the poster in local storage\n String imageName = saveMoviePoster();\n\n... | [
"0.7967912",
"0.7928937",
"0.77029145",
"0.76929545",
"0.7492546",
"0.7244194",
"0.7243822",
"0.72092897",
"0.6971154",
"0.6911034",
"0.68410754",
"0.68244594",
"0.6724305",
"0.67120546",
"0.6689503",
"0.66439605",
"0.6596112",
"0.6551984",
"0.65232396",
"0.6423804",
"0.63984... | 0.61908305 | 26 |
0 = false, 1 = true | public OrotParser() {
createPackagesJson();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean booleanOf();",
"boolean getValue();",
"public abstract boolean read_boolean();",
"public boolean isProcessed() \n{\nObject oo = get_Value(\"Processed\");\nif (oo != null) \n{\n if (oo instanceof Boolean) return ((Boolean)oo).booleanValue();\n return \"Y\".equals(oo);\n}\nreturn false;\n}",
"pub... | [
"0.66675025",
"0.6425454",
"0.63142824",
"0.62767935",
"0.62416255",
"0.62361836",
"0.61929035",
"0.61929035",
"0.6180804",
"0.6180804",
"0.6180804",
"0.6180804",
"0.6148348",
"0.6121819",
"0.61194015",
"0.6115446",
"0.6109804",
"0.61068904",
"0.6103862",
"0.61030453",
"0.609... | 0.0 | -1 |
TODO Autogenerated method stub | public static void main(String[] args) {
ArrayList<Integer> numbers = new ArrayList<Integer>();
numbers.add(5);
numbers.add(50);
numbers.add(10);
numbers.add(60);
numbers.add(15);
numbers.add(70);
System.out.println(numbers);
List<Integer> evenNumbers = numbers.stream().filter(I -> I%2==0).collect(Collectors.toList());
System.out.println(evenNumbers);
} | {
"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 checks if the device is connected to internet services.. | public boolean isNetworkAvailable() {
ConnectivityManager connectivityManager
= (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
Log.i("Utilities","isNetworkAvailable()"+(activeNetworkInfo != null
&& activeNetworkInfo.isConnected()));
return activeNetworkInfo != null && activeNetworkInfo.isConnected();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean checkInternetConnection() {\n\n ConnectivityManager connectivityManager = (ConnectivityManager) this.getSystemService(Context.CONNECTIVITY_SERVICE);\n\n NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();\n\n return (networkInfo != null && networkInfo.isConnec... | [
"0.7987454",
"0.7976686",
"0.79602385",
"0.794465",
"0.7936885",
"0.7916883",
"0.7908568",
"0.79010427",
"0.78990567",
"0.7884653",
"0.7884653",
"0.7882594",
"0.7873065",
"0.78454596",
"0.78155077",
"0.7814182",
"0.7795741",
"0.77219576",
"0.77182984",
"0.77122366",
"0.767133... | 0.0 | -1 |
This method will return a string that will suggest the type of network connected it would return Wifi or MobileData | public String getNetworkType(){
String networkType=null;
ConnectivityManager connectivityManager = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo newNetworkInfo = connectivityManager.getActiveNetworkInfo();
if(newNetworkInfo.getType()== ConnectivityManager.TYPE_WIFI){
networkType=mContext.getResources()
.getString(R.string.wifiString);
}
else if(newNetworkInfo.getType()== ConnectivityManager.TYPE_MOBILE){
networkType=mContext.getResources()
.getString(R.string.mobiledataString);
}
return networkType;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected String getConnectivityType(Context context) {\n NetworkInfo info = Connectivity.getNetworkInfo(context);\n int type = info.getType();\n int subType = info.getSubtype();\n\n if(type == ConnectivityManager.TYPE_WIFI)\n return \"WIFI\";\n else\n retur... | [
"0.7947504",
"0.7921868",
"0.7663765",
"0.7571402",
"0.7570006",
"0.75359297",
"0.7528607",
"0.7491876",
"0.7408777",
"0.7340082",
"0.71848035",
"0.7065054",
"0.699592",
"0.6837948",
"0.6661996",
"0.66011524",
"0.64850944",
"0.64689004",
"0.6413185",
"0.64112914",
"0.63900447... | 0.81419027 | 0 |
This method displays a dialog to get user preferences for syncing images in the absence of Network. | public AlertDialog.Builder connectivityAlert(){
mAlertDialogBuilder = new AlertDialog.Builder(mContext);
Log.i(TAG,"in connectivyAlert!!!!!");
mAlertDialogBuilder.setMessage(R.string.connectivityLossMessageString)
.setPositiveButton(R.string.wifiString,new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface dialog, int id){
Log.i(TAG,"+ve Button");
// Toast.makeText(mContext,"positive Button",Toast.LENGTH_SHORT).show();
Toast.makeText(mContext,R.string.uploadRequestOnNoNetwork,Toast.LENGTH_SHORT).show();
writeSyncPreferences(mContext.getString(R.string.wifiString));
//TODO - call a function that enters records to the SQLite database
//Challenge- how to get the values from the UploadCamPicsActivity class?
insertRecords();
mContext.startActivity(new Intent(mContext,MainActivity.class));
((Activity)mContext).finish();
}
})
.setNegativeButton(R.string.mobiledataString,new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface dialog, int id){
// Log.i(TAG," -ve Button");
//Toast.makeText(mContext,"negative Button",Toast.LENGTH_SHORT).show();
Toast.makeText(mContext,R.string.uploadRequestOnNoNetwork,Toast.LENGTH_SHORT).show();
writeSyncPreferences(mContext.getString(R.string.mobiledataString));
//TODO - call a function that enters records to the SQLite database
insertRecords();
mContext.startActivity(new Intent(mContext,MainActivity.class));
((Activity)mContext).finish();
}
});
return mAlertDialogBuilder;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void showUserPreferences() {\r\n MyAccount ma = state.getAccount();\r\n \r\n mOriginName.setValue(ma.getOriginName());\r\n SharedPreferencesUtil.showListPreference(this, MyAccount.Builder.KEY_ORIGIN_NAME, R.array.origin_system_entries, R.array.origin_system_entries, R.string... | [
"0.62064195",
"0.62031764",
"0.60212135",
"0.58892137",
"0.5738159",
"0.56444424",
"0.5612263",
"0.55962425",
"0.5593463",
"0.55839145",
"0.5573756",
"0.5568141",
"0.5547306",
"0.5518311",
"0.55125964",
"0.5504899",
"0.5502627",
"0.54990715",
"0.5482527",
"0.54493284",
"0.543... | 0.0 | -1 |
Log.i(TAG," ve Button"); Toast.makeText(mContext,"negative Button",Toast.LENGTH_SHORT).show(); | @Override
public void onClick(DialogInterface dialog, int id){
Toast.makeText(mContext,R.string.uploadRequestOnNoNetwork,Toast.LENGTH_SHORT).show();
writeSyncPreferences(mContext.getString(R.string.mobiledataString));
//TODO - call a function that enters records to the SQLite database
insertRecords();
mContext.startActivity(new Intent(mContext,MainActivity.class));
((Activity)mContext).finish();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void onClick(View v) {\n Toast.makeText(MainActivity.this, \"Goodbye!\", Toast.LENGTH_SHORT).show();\n }",
"@Override\n public void onClick(View v) {\n Toast.makeText(getContext(), \"Not Ready Yet :(\", Toast.LENGTH_SHORT).show();\... | [
"0.7599518",
"0.75684243",
"0.7560056",
"0.75319415",
"0.7161373",
"0.7130555",
"0.71042395",
"0.70695084",
"0.6967956",
"0.69370407",
"0.6936252",
"0.69254184",
"0.69099414",
"0.6885756",
"0.68829155",
"0.68815696",
"0.68815696",
"0.684469",
"0.6842247",
"0.682747",
"0.68209... | 0.0 | -1 |
This method checks if the user's Syncing properties are set | public boolean checkSharedPreference(String username){
mSharedPreference = mContext.getSharedPreferences(mContext.getString(
R.string.sharedpreferencesFileName),Context.MODE_PRIVATE);
if(mSharedPreference.getString(username,"Sync_Preference").equals("Sync_Preference")){
return false;
}
else
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean hasSyncNail() {\n for (final Nail nail : getNails()) {\n if (nail.getPropertyType().equals(PropertyType.SYNCHRONIZATION)) return true;\n }\n\n return false;\n }",
"public boolean needsSync() {\n return myNeedsSync;\n }",
"public boolean setSynchronize() {\... | [
"0.67024916",
"0.6646394",
"0.66243565",
"0.6428483",
"0.63842684",
"0.6225687",
"0.6225687",
"0.6216846",
"0.615314",
"0.6115072",
"0.60322464",
"0.5913244",
"0.5909951",
"0.5909134",
"0.5900908",
"0.5835054",
"0.58067846",
"0.58057976",
"0.57881397",
"0.5786076",
"0.5776768... | 0.6292884 | 5 |
Method writes to the sharedPreferences file | public void writeSyncPreferences(String string){
mSharedPreference = mContext.getSharedPreferences(mContext.getString(
R.string.sharedpreferencesFileName),Context.MODE_PRIVATE);
SharedPreferences.Editor editor = mSharedPreference.edit();
editor.putString(getCurrentIdentity(),string);
editor.commit();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void savePreference() {\n\t\tString myEmail = ((TextView) findViewById(R.id.myEmail)).getText().toString();\n\t\tString myPassword = ((TextView) findViewById(R.id.myPassword)).getText().toString();\n\t\t\n\t\tEditor editor = sharedPreferences.edit();\n\t\teditor.putString(\"myEmail\", myEmail);\n\t\teditor... | [
"0.7927848",
"0.7671658",
"0.7588317",
"0.73179275",
"0.72862333",
"0.7123592",
"0.7066279",
"0.7044305",
"0.69915885",
"0.6934103",
"0.69291854",
"0.6895137",
"0.6828",
"0.6807378",
"0.6800928",
"0.67661625",
"0.6742058",
"0.6741874",
"0.67251074",
"0.6724109",
"0.6698112",
... | 0.6730181 | 18 |
This method writes to the sharedpreferences file. the latest encounter number that will be used to identify an encounter locally in the absence of network. only maximum of 10 encounter numbers will be inserted in the SQLite table. | public void writeEncounterNumPreferences(long encounterNum){
mSharedPreference = mContext.getSharedPreferences(mContext.getString(
R.string.sharedpreferencesFileName),Context.MODE_PRIVATE);
SharedPreferences.Editor editor=mSharedPreference.edit();
editor.putLong(mContext.getString(R.string.encounter),encounterNum);
editor.commit();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void writeToSharedPreference(int value){\n SharedPreferences sharedPreferences = getActivity().getPreferences(Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putInt(\"NUMBER OF ITEMS\",value);\n editor.commit();\n\n }",
"private ... | [
"0.66516197",
"0.6302599",
"0.6270905",
"0.62642777",
"0.6213827",
"0.6199365",
"0.6181417",
"0.6174613",
"0.61463237",
"0.6069113",
"0.602499",
"0.59805447",
"0.595192",
"0.5933868",
"0.5912857",
"0.5893569",
"0.5889812",
"0.5882432",
"0.58496284",
"0.58302164",
"0.5822056",... | 0.77480334 | 0 |
Gets the details of the user that is currently logged in | public String getCurrentIdentity(){
mSharedPreference = mContext.getSharedPreferences( mContext.getString(R.string.sharedpreferencesFileName),Context.MODE_PRIVATE);
if(mSharedPreference.contains("zzxxyz")) {
return mSharedPreference.getString("zzxxyz", "");
}
else
return "";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private EndUser getCurrentLoggedUserDetails() {\n\n\t\tEndUser endUser = endUserDAOImpl.findByUsername(getCurrentLoggedUserName()).getSingleResult();\n\n\t\treturn endUser;\n\n\t}",
"@Override\r\n\tpublic User getCurrentUser() {\r\n\t\tString currentUserName = this.getCurrentUserName();\r\n\t\tUser userdetails =... | [
"0.80277246",
"0.800521",
"0.7833175",
"0.7734104",
"0.77117485",
"0.76654863",
"0.76623005",
"0.7611351",
"0.7492579",
"0.745035",
"0.7433033",
"0.74194926",
"0.7417902",
"0.7403107",
"0.73753154",
"0.73645234",
"0.7364317",
"0.73525673",
"0.7352252",
"0.7352252",
"0.7352252... | 0.0 | -1 |
Sets the details of the user that is currently logged in | public void setCurrentIdentity(String zzxxyz){
mSharedPreference = mContext.getSharedPreferences( mContext.getString(R.string.sharedpreferencesFileName),Context.MODE_PRIVATE);
SharedPreferences.Editor editor=mSharedPreference.edit();
editor.putString("zzxxyz",zzxxyz);
editor.commit();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void updateCurrentTrempitUser() {\n\n // create the trempituser object\n TrempitUser currentUser = new TrempitUser();\n currentUser.setFullName(Profile.getCurrentProfile().getName());\n currentUser.setId(Long.valueOf(Profile.getCurrentProfile().getId()));\n\n // update the... | [
"0.73294765",
"0.7226554",
"0.720221",
"0.7037926",
"0.6993507",
"0.69691545",
"0.6950193",
"0.69460285",
"0.69460285",
"0.69460285",
"0.6938781",
"0.684511",
"0.684511",
"0.684511",
"0.68395066",
"0.6828291",
"0.68243235",
"0.68224204",
"0.6821779",
"0.681439",
"0.68114746",... | 0.0 | -1 |
Method to insert record in to the SQLite database | public void insertRecords(){
InsertToDB insertRecords= new InsertToDB(mDbhelper,mRecord);
Log.i(TAG, "starting insertion on a new Thread!!");
idlingResource.increment();
new Thread(insertRecords).start();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void insert(BnesBrowsingHis record) throws SQLException;",
"int insert(Assist_table record);",
"int insert(PmKeyDbObj record);",
"int insert(Model record);",
"void insert(OrderPreferential record) throws SQLException;",
"int insert(AccessModelEntity record);",
"public void insert() throws SQLException;... | [
"0.74370563",
"0.73922133",
"0.7205262",
"0.7187866",
"0.71643007",
"0.7159406",
"0.715828",
"0.7141956",
"0.70896244",
"0.70860684",
"0.70860076",
"0.7065169",
"0.7059313",
"0.7056167",
"0.7032872",
"0.7032872",
"0.7029016",
"0.70263296",
"0.7004998",
"0.69993585",
"0.699299... | 0.0 | -1 |
This method starts the Sync Service. | public void startSyncing(){
Log.i(TAG,"in start Syncing");
Intent intent = new Intent(mContext,SyncerService.class);
if(!SyncerService.IsRunning) {
intent.putExtra("SyncStarted", MainActivity.SYNC_STARTED);
intent.putExtra("SyncComplete", MainActivity.SYNC_COMPLETE);
}
if(!SyncerService.IsRunning) {
mContext.startService(intent);
// Toast.makeText(mContext, "Service will be started!!", Toast.LENGTH_SHORT).show();
}
else{
// Toast.makeText(mContext, "Syncing in progress already!!", Toast.LENGTH_SHORT).show();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void startSync() {\n mLogger.d(\"Starting silent sync\");\n startSync(new IMediaSyncListener() {\n @Override\n public void step() {\n\n }\n\n @Override\n public void onFinish(int total, int ok, int ko) {\n mLogger.d(\"Silent... | [
"0.7376831",
"0.7144083",
"0.71255946",
"0.7096317",
"0.65971047",
"0.64904404",
"0.63879204",
"0.6354661",
"0.626047",
"0.625023",
"0.61860216",
"0.6116219",
"0.6108692",
"0.60816985",
"0.60556316",
"0.60452664",
"0.59943426",
"0.5994269",
"0.59860253",
"0.59733737",
"0.5936... | 0.7709895 | 0 |
This method redirects from one activity to the other.. | public void redirect(int imagesUploaded, int imagesRequested,Activity FromClass,Class ToClass){
if(imagesRequested==imagesUploaded){
Toast.makeText(mContext,"All images were uploaded!",Toast.LENGTH_LONG).show();
}
else if(imagesUploaded == 0 && imagesRequested ==0){
Toast.makeText(mContext,"The images will be uploaded on the availability of appropriate network!",Toast.LENGTH_LONG).show();
}
else{
Toast.makeText(mContext,imagesRequested-imagesUploaded+"were uploaded!",Toast.LENGTH_LONG).show();
}
((Activity)FromClass).finish();
mContext.startActivity(new Intent(FromClass,ToClass));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void redirectTO() {\n\n Intent intent = new Intent(this, MainActivity.class);\n startActivity(intent);\n\n finish();\n }",
"private void gotoOtherActivity() {\n finish();\n }",
"private void redirectLoginScreen(Bundle bundle){\n Intent loginIntent = new Intent(Pr... | [
"0.7590754",
"0.7464547",
"0.6841636",
"0.6733703",
"0.66754115",
"0.66705585",
"0.6616019",
"0.66119975",
"0.6585617",
"0.65624374",
"0.6552081",
"0.652888",
"0.6495292",
"0.64937",
"0.6482568",
"0.6482113",
"0.6462087",
"0.64597774",
"0.6452407",
"0.64398855",
"0.6435065",
... | 0.0 | -1 |
Prepares records for insertion to Database | public void prepareBatchForInsertToDB(Boolean isUploaded) {
long encounterNum = getEncounterNumPreferences();
mRecord=new ArrayList<ImageRecordDBRecord>();
for (String filename : mImagePaths) {
ImageRecordDBRecord record = new ImageRecordDBRecord();
record.setFileName(filename);
record.setUsername(getCurrentIdentity());
Date date = new Date();
record.setDate(date);
record.setIsUploaded(isUploaded);
record.setmEncounterNum(encounterNum);
mRecord.add(record);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void prepareInsertObject() {\n // Require modify row to prepare.\n if (getModifyRow() == null) {\n return;\n }\n\n if (hasMultipleStatements()) {\n for (Enumeration statementEnum = getSQLStatements().elements();\n statementEnum.hasMoreEle... | [
"0.65170085",
"0.6450228",
"0.63528335",
"0.62602997",
"0.6245128",
"0.6233077",
"0.6124699",
"0.6050355",
"0.59876823",
"0.5961354",
"0.5950637",
"0.5910971",
"0.5887428",
"0.5874399",
"0.58640605",
"0.5829496",
"0.5818225",
"0.5818217",
"0.5817455",
"0.58139473",
"0.5808502... | 0.61391175 | 6 |
Method that displays a snackbar | public void displaySnackBar(View layout,int message,int bgcolor){
Snackbar snack=null;
View snackView;
if(message == com.ibeis.wildbook.wildbook.R.string.offline)
snack=Snackbar.make(layout,message,Snackbar.LENGTH_INDEFINITE);
else
snack=Snackbar.make(layout,message,Snackbar.LENGTH_SHORT);
snackView = snack.getView();
snackView.setBackgroundColor(bgcolor);
snack.show();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void showErrorSnackbar();",
"private void showSnackBar(String message) {\n }",
"private void showSnackbarMessage(String message){\n if(view != null){\n Snackbar.make(view, message, Snackbar.LENGTH_SHORT).show();\n }\n }",
"private void showSnackBar(String message) {\n if... | [
"0.81631845",
"0.8049236",
"0.7707295",
"0.7318469",
"0.72002316",
"0.7193589",
"0.71365404",
"0.70560676",
"0.70375276",
"0.7003116",
"0.69925004",
"0.6911676",
"0.6900523",
"0.6873789",
"0.6864579",
"0.68261844",
"0.67547876",
"0.67469686",
"0.67469454",
"0.6739422",
"0.672... | 0.6646284 | 25 |
if(degree.getDouble() < 0) return new Degree360(360 degree.getDouble()); else | public static Degree360 valueOf(Degree180 degree){
return new Degree360(degree.getDouble());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Degree createDegree();",
"int getDegree();",
"int getDegree();",
"public Degree() {\n\t\tsuper();\n\t}",
"public int getDegree(){\n return degree;\n }",
"public Degree360 add(Degree360 degree){\n\t\treturn Degree360.valueOf(this.getDouble() + degree.getDouble());\r\n\t}",
"@Override\n\t\tpubl... | [
"0.7006046",
"0.67975336",
"0.67975336",
"0.6769296",
"0.676544",
"0.6664922",
"0.6586692",
"0.6529428",
"0.639381",
"0.63808656",
"0.6378441",
"0.63447535",
"0.6337498",
"0.62192184",
"0.61920416",
"0.6188948",
"0.61570364",
"0.61465657",
"0.6110417",
"0.60627794",
"0.606092... | 0.7702678 | 0 |
return Degree360.valueOf((this.getDouble() + degree.getDouble()) % 360); | public Degree360 add(Degree360 degree){
return Degree360.valueOf(this.getDouble() + degree.getDouble());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static double to_360(double deg) {\n return modulo(deg,360);\n }",
"public static double reduce360Degrees(double degrees){\n return degrees % 360;\n }",
"public double getAngle () {\n return super.getAngle() % 360D;\n }",
"public static Degree360 valueOf(Degree180 degree){\n\t\... | [
"0.71829695",
"0.71532595",
"0.7017412",
"0.70138544",
"0.69284004",
"0.6866275",
"0.67877364",
"0.67743933",
"0.6648926",
"0.6648926",
"0.6646616",
"0.66453",
"0.6618342",
"0.6617692",
"0.65920645",
"0.6534255",
"0.64937687",
"0.64937687",
"0.64663684",
"0.6461472",
"0.64238... | 0.7429665 | 0 |
This methods only purpose is to give the programmer more comfortability in generating a System.out.println(Object), which in addition has the classpath and name prepended. .toString() is called on all objects also. | private void out(Object obj) {
System.out.println(deb + obj.toString());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void println() { System.out.println( toString() ); }",
"public void print(){\r\n System.out.println(toString());\r\n }",
"public void print() {\r\n\t\t System.out.println(toString());\r\n\t }",
"public void println(Object obj) {\n println(obj.toString());\n }",
"public void print... | [
"0.75131625",
"0.7065727",
"0.70617545",
"0.6994059",
"0.6963039",
"0.6784537",
"0.67630094",
"0.67056894",
"0.6702777",
"0.66586024",
"0.66498566",
"0.6595667",
"0.65912026",
"0.6585759",
"0.6558367",
"0.6554494",
"0.6553922",
"0.65100086",
"0.6476204",
"0.6471845",
"0.64617... | 0.6635379 | 11 |
Created by mala on 17/1/17. | public interface RecyclerViewClickListener {
public void onRecyclerViewItemClick(View v, int position);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void perish() {\n \n }",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"private stendhal() {\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n... | [
"0.60117203",
"0.5841281",
"0.5810327",
"0.57574356",
"0.57298005",
"0.57298005",
"0.57116884",
"0.57076466",
"0.57046914",
"0.56711185",
"0.5669878",
"0.5653835",
"0.56460893",
"0.5639015",
"0.5626781",
"0.56201935",
"0.5609706",
"0.56075287",
"0.5601411",
"0.5557262",
"0.55... | 0.0 | -1 |
Inputs an integer and calls displayDigits() by passing the integer entered | public static void main(String[] args) {
int number = 0;
java.util.Scanner keyboard = new java.util.Scanner(System.in);
do
{
System.out.print("Enter an integer between 1 and 99999: ");
number = keyboard.nextInt();
if (number >= 1 && number <= 99999)
displayDigits(number);
else
System.out.print("Try again. ");
}
while (!(number >= 1 && number <= 99999));
keyboard.close();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static int f_number_user(){\n Scanner keyboard=new Scanner(System.in);\r\n int digits;\r\n System.out.println(\"input the entire number \");\r\n digits=keyboard.nextInt();\r\n return digits;\r\n }",
"public static void main(String[] args) {\n f_menu();\r\n ... | [
"0.6547",
"0.61249775",
"0.6047136",
"0.6031754",
"0.6019693",
"0.5957321",
"0.5919888",
"0.58983094",
"0.5676159",
"0.56441337",
"0.56230587",
"0.5594957",
"0.5581367",
"0.5554459",
"0.5524546",
"0.55213207",
"0.550898",
"0.5505814",
"0.5501076",
"0.54982835",
"0.5492878",
... | 0.57665944 | 8 |
main end Calculates the integer part of the quotient when integer a is divided by integer b | public static int calculateIntegerPart(int a)
{
int integerPart = a / 10;
return integerPart;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int division(int a, int b) {\n return a / b;\n }",
"@Override\n\tpublic int calculation(int a, int b) {\n\t\treturn b/a;\n\t}",
"public int div(int a, int b) {\n\t\t\treturn compute(a, b, OPER_DIV);\n\t\t}",
"public static double div() {\n System.out.println(\"Enter dividend\");\n ... | [
"0.82245",
"0.78680307",
"0.7667095",
"0.7510611",
"0.7509976",
"0.7487984",
"0.7434108",
"0.7378785",
"0.7363042",
"0.73484033",
"0.7338673",
"0.7328137",
"0.7286065",
"0.72319967",
"0.7219647",
"0.71396214",
"0.7137207",
"0.71284163",
"0.71248025",
"0.7115824",
"0.7108444",... | 0.0 | -1 |
Calculates the integer remainder when integer a is divided by integer b | public static int calculateRemainderPart(int a)
{
int remainderPart = a % 10;
return remainderPart;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int modulo(int a, int b) {\n return a % b;\n }",
"private static int cprModFunction(int a, int b) {\n\t\tint res = a % b;\n\t\tif (res < 0)\n\t\t\tres += b;\n\t\treturn res;\n\t}",
"public double divide(double a, double b, boolean rem){ return rem? a%b: a/b; }",
"public int division(int a, int ... | [
"0.7886016",
"0.77447885",
"0.74249285",
"0.74088156",
"0.7310927",
"0.72306633",
"0.71583587",
"0.71409637",
"0.70472527",
"0.6984994",
"0.69783455",
"0.6937385",
"0.6924119",
"0.6864746",
"0.684865",
"0.6807433",
"0.67972183",
"0.6779019",
"0.67511296",
"0.6711954",
"0.6695... | 0.6842346 | 15 |
Displays a number as a sequence of digits, separating each pair of digits by two spaces | public static void displayDigits(int numberToSplit)
{
int number = numberToSplit;
String numberAsString = "";
int integerPart;
int remainderPart;
System.out.printf("Number to split: %d%n", numberToSplit);
do
{
integerPart = calculateIntegerPart(number);
remainderPart = calculateRemainderPart(number);
numberAsString = remainderPart + " " + numberAsString;
number = integerPart;
} while (number >= 10);
if (integerPart != 0)
numberAsString = integerPart + " " + numberAsString;
System.out.printf("The number after splitting represented as a String: %s", numberAsString);
System.out.println();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void printNum() {\n\t\tfor(int i = 1; i<= 20; i++) {\n\t\t\tSystem.out.print(\" \" + i);\n\t\t}\n\t\tSystem.out.println(\"\\n\");\n\t\t}",
"private static String repeatSpace(int number) {\n StringBuilder space = new StringBuilder();\n\n // Adding spaces.\n for (int i = 0; i < n... | [
"0.6745821",
"0.6619905",
"0.6501745",
"0.64220905",
"0.6318742",
"0.6268193",
"0.62664926",
"0.6250016",
"0.62085205",
"0.6089241",
"0.6078837",
"0.60788137",
"0.60616505",
"0.6014219",
"0.5998936",
"0.599569",
"0.59703565",
"0.59431285",
"0.59264326",
"0.5913578",
"0.591347... | 0.6321504 | 4 |
TODO Autogenerated method stub | @Override
protected void controlUpdate(float tpf) {
} | {
"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
protected void controlRender(RenderManager rm, ViewPort vp) {
} | {
"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 PrintWriter getLogWriter() throws SQLException {
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 void setLogWriter(PrintWriter out) throws SQLException {
} | {
"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.66708666",
"0.65675074",
"0.65229905",
"0.6481001",
"0.64770633",
"0.64584893",
"0.6413091",
"0.63764185",
"0.6275735",
"0.62541914",
"0.6236919",
"0.6223816",
"0.62017626",
"0.61944294",
"0.61944294",
"0.61920846",
"0.61867654",
"0.6173323",
"0.61328775",
"0.61276996",
"0... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void setLoginTimeout(int seconds) throws SQLException {
} | {
"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 int getLoginTimeout() throws SQLException {
return 0;
} | {
"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 Logger getParentLogger() throws SQLFeatureNotSupportedException {
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> T unwrap(Class<T> iface) throws SQLException {
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.66708666",
"0.65675074",
"0.65229905",
"0.6481001",
"0.64770633",
"0.64584893",
"0.6413091",
"0.63764185",
"0.6275735",
"0.62541914",
"0.6236919",
"0.6223816",
"0.62017626",
"0.61944294",
"0.61944294",
"0.61920846",
"0.61867654",
"0.6173323",
"0.61328775",
"0.61276996",
"0... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public boolean isWrapperFor(Class<?> iface) throws SQLException {
return false;
} | {
"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 Connection getConnection() throws SQLException {
if(listConnection.size() > 0){
final Connection conn = listConnection.removeFirst();
return (Connection) Proxy.newProxyInstance(JdbcPool.class.getClassLoader(),
conn.getClass().getInterfaces(),
new InvocationHandler() {
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
// TODO Auto-generated method stub
if(!method.getName().equals("close")){
return method.invoke(conn, args);
}else{
listConnection.add(conn);
return null;
}
}
});
}else{
throw new RuntimeException("对不起,数据库忙");
}
} | {
"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 Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if(!method.getName().equals("close")){
return method.invoke(conn, args);
}else{
listConnection.add(conn);
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 Connection getConnection(String username, String password) throws SQLException {
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.66708666",
"0.65675074",
"0.65229905",
"0.6481001",
"0.64770633",
"0.64584893",
"0.6413091",
"0.63764185",
"0.6275735",
"0.62541914",
"0.6236919",
"0.6223816",
"0.62017626",
"0.61944294",
"0.61944294",
"0.61920846",
"0.61867654",
"0.6173323",
"0.61328775",
"0.61276996",
"0... | 0.0 | -1 |
Gets the wrapped model. | IModel getWrappedModel(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic T getModel() {\n\t\treturn model;\r\n\t}",
"public BaseSlingModel getGenericModel() {\n return model;\n }",
"public Model getModel () { return _model; }",
"@JsonIgnore\n @Override\n public Model getModel() {\n return this.model;\n }",
"public Model getModel() {\n ... | [
"0.7677734",
"0.74096006",
"0.73432535",
"0.72513777",
"0.72344565",
"0.72344565",
"0.72344565",
"0.72344565",
"0.7146566",
"0.7113838",
"0.7085995",
"0.7085995",
"0.7085995",
"0.70789975",
"0.7045745",
"0.70022845",
"0.6957492",
"0.6931783",
"0.68918484",
"0.68242025",
"0.67... | 0.83124316 | 0 |
private final StatefulRedisConnection connection; | public LettuceCacheManager(CachingProvider cachingProvider, URI uri, ClassLoader classLoader,
Properties properties) {
super(cachingProvider, uri, classLoader, properties);
RedisURI redisURI = RedisURI.create(uri);
RedisClient redisClient = RedisClient.create(redisURI);
this.redisClient = redisClient;
// this.connection = redisClient.connect(new ByteArrayCodec());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public RedisConnector() {\n super();\n\n ensureRedisClient();\n }",
"private RedisClient() {\n\n }",
"public RedisClient() {\n init();\n }",
"public interface RedisService {\n\n boolean existsKey(String key);\n\n void removeKey(String key);\n\n void pushMsg(String key, ... | [
"0.67420554",
"0.6440716",
"0.6347008",
"0.62908864",
"0.62330616",
"0.6129965",
"0.60235924",
"0.59910387",
"0.59741956",
"0.59455836",
"0.5932882",
"0.5932882",
"0.59299153",
"0.59299153",
"0.59299153",
"0.5929175",
"0.5929175",
"0.5925198",
"0.58753496",
"0.5870802",
"0.58... | 0.0 | -1 |
a reference to the simulation object ====================================================================== public AgentCanvas() Constructor for the agent canvas. Needs a reference to the simulation manager. ====================================================================== | public AgentCanvas(SimulationManager theSimulation, ShelterGrid theShelters)
{
simulation = theSimulation;
shelters = theShelters;
legend_visible = true;
addMouseListener(this); // to handle mouse clicks
// Create shelter grid
gridWidth = Parameters.getDefaultGridSize();
gridHeight = gridWidth; // We're square.
//shelterGrid = new Shelter[gridWidth][gridHeight];
updateGrid(shelters);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected ModelAgent (String agentName)\n {\n trc = new Trace (\"ModelAgent\", agentName);\n\n String jsimprop = System.getProperty (\"jsim.use_xml\", \"false\");\n if (jsimprop.toLowerCase ().equals (\"true\")) {\n use_xml = true;\n } // if\n \n jsimprop = Sy... | [
"0.60690194",
"0.6048552",
"0.5798832",
"0.5795577",
"0.57707596",
"0.5747566",
"0.5727464",
"0.56900567",
"0.5629515",
"0.5612331",
"0.55612534",
"0.55434036",
"0.5481929",
"0.54628164",
"0.54417545",
"0.5380222",
"0.5380207",
"0.5351549",
"0.5350873",
"0.5350672",
"0.533454... | 0.65287447 | 0 |
====================================================================== public int getGridWidth() public int getGridHeight() Simple accessor methods. ====================================================================== | public int getGridWidth() { return gridWidth; } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getGridDimensions() {\n return GRID_DIMENSIONS;\n }",
"public GridSize getGridSize()\n {\n return this.gridSize.clone();\n }",
"public short getGridSize() {\n\t\treturn gridSize;\n\t}",
"public int getWidth(){\r\n\t\treturn grid.length;\r\n\t}",
"@Override\r\n\tpublic int getSiz... | [
"0.8420676",
"0.80510837",
"0.7891259",
"0.7877325",
"0.7859647",
"0.7688263",
"0.76152116",
"0.7568876",
"0.7561044",
"0.75288314",
"0.73469895",
"0.72271734",
"0.72183985",
"0.7186104",
"0.7171941",
"0.7157608",
"0.7093977",
"0.7052561",
"0.7046259",
"0.70378613",
"0.703151... | 0.8482644 | 0 |
====================================================================== public void changeBackground() I used to allow the user to select an image background. Dropped it, but if we ever back to it, we should take any existing agents and reposition at random b/c the image is likely a different size. ====================================================================== | public void updateGrid(ShelterGrid shelters)
{
this.shelters = shelters;
gridWidth = Parameters.getDefaultGridSize();
gridHeight = gridWidth;
simulation.reset(); // remove all agents, etc.
// call repaint to redisplay the new background, then agents & grid
repaint();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void changeBackground(Bitmap bg){\n Drawable newbackground = new BitmapDrawable(getResources(), bg);\n this.setBackground(newbackground);\n\n }",
"public void setSelectionBackground( final Image image ) {\n checkWidget();\n selectionBgImage = image;\n }",
"public void setBackg... | [
"0.7006117",
"0.67746556",
"0.67690665",
"0.674372",
"0.6712174",
"0.6704887",
"0.6598509",
"0.6568213",
"0.6504591",
"0.6396064",
"0.637604",
"0.63156074",
"0.6311948",
"0.62225825",
"0.60711217",
"0.60414565",
"0.60403365",
"0.6007439",
"0.5937621",
"0.5937114",
"0.592892",... | 0.0 | -1 |
====================================================================== public void paintComponent(Graphics g) What happens whenever the agent canvas is (re)drawn. ====================================================================== | public void paintComponent(Graphics g)
{
super.paintComponent(g);
// safest to create a copy of the graphics component -- one must
// ensure that no changes are made to the original
Graphics2D graphics = (Graphics2D) g.create();
JViewport viewport = null;
JScrollPane scrollPane = null;
Insets borders = null;
int viewportWidth = 0;
int viewportHeight = 0;
int agentGUISize = Parameters.getAgentGUISize();
int imageWidth = gridWidth * agentGUISize;
int imageHeight = gridHeight * agentGUISize;
// make sure that we're grabbing onto the viewport of the scroll pane
Component ancestor = getParent();
if (ancestor == null || !(ancestor instanceof JViewport))
{
//Exception e = new Exception(
// "AgentCanvas instance must be within JScrollPane instance");
//e.printStackTrace();
//return;
viewportWidth = imageWidth;
viewportHeight = imageHeight;
borders = new Insets(5,5,5,5);
}
else
{
// presumably we have the viewport of scroll pane containing 'this'
viewport = (JViewport) ancestor;
viewportWidth = viewport.getWidth();
viewportHeight = viewport.getHeight();
scrollPane = (JScrollPane) viewport.getParent();
borders = scrollPane.getInsets();
}
// Note that drawImage automatically scales the image to fit that
// rectangle.
int renderWidth = gridWidth * agentGUISize;
int renderHeight = gridHeight * agentGUISize;
// determine the starting (x,y) in the viewport where the image
// will be drawn
viewportX = 10 + Math.max((viewportWidth - renderWidth) / 2, 0);
viewportY = 20 + Math.max((viewportHeight - renderHeight) / 2, 0);
// in case there was a previous image, clear things out
//graphics.clearRect(0, 0, viewportWidth, viewportHeight);
//graphics.clearRect(viewportX, viewportY, viewportWidth, viewportHeight);
graphics.clearRect(viewportX, viewportY, renderWidth, renderHeight);
// now draw the shelters
for (int col = 0; col < gridWidth; col++ )
{
for (int row = 0; row < gridHeight; row++ )
{
Shelter s = shelters.getShelterAt( col, row ); //shelterGrid[col][row];
// make sure not to draw any agent outside the image boundaries;
// remember that graphics x corresponds to column and graphics y
// corresponds to row
if ((row >= 0) && (col >= 0) &&
((row * agentGUISize) + agentGUISize <= renderHeight) &&
((col * agentGUISize) + agentGUISize <= renderWidth))
{
int guiX = GUI_XPAD + viewportX + (col * agentGUISize);
int guiY = GUI_YPAD + viewportY + (row * agentGUISize);
int occupants = s.getCurrentOccupancy();
int capacity = s.getMaxCapacity();
int infested = s.getInfestedCount();
int infected = s.getInfectedCount();
if ( DEBUG ){
if ( infested > occupants || infected > occupants ) {
System.out.println(
"Shelter(" + col + ", " + row + ") " +
" occupants = " + occupants +
" infested = " + infested +
" infected = " + infected );
}
}
double proportionInfested = infested / (double) occupants;
double proportionInfected = infected / (double) occupants;
if ( occupants == 0 ){
proportionInfested = 0.0;
proportionInfected = 0.0;
}
double proportionOccupied = occupants / (double) capacity;
double proportionUnoccupied = 1.0 - proportionOccupied;
// Shelter Occupancy info
graphics.setPaint( Color.white );
int unoccupiedHeight =
(int) Math.round(agentGUISize * proportionUnoccupied);
int occupiedHeight = agentGUISize - unoccupiedHeight;
// Proportion of shelter currently not in use
graphics.fillRect( guiX, guiY,
OCCUPANCY_BAR_WIDTH, unoccupiedHeight );
graphics.setPaint( Color.black );
graphics.fillRect(guiX, guiY + unoccupiedHeight,
OCCUPANCY_BAR_WIDTH, occupiedHeight );
if (occupants > 0){
graphics.setPaint( Color.white );
String str = ""+occupants;
graphics.drawString(str, guiX + 2, guiY + unoccupiedHeight + 15);
graphics.setPaint( Color.black );
}
// Infestation info
// Color of upper half of grid square should get more purple
// as more Hosts are infested
int red = 255 - (int) Math.round( 255 * proportionInfested);
int green = 255 - (int) Math.round( 255 * proportionInfested);
int blue = 255;
Color infestColor = null;
try{
infestColor = new Color( red, green, blue );
} catch (IllegalArgumentException ie ) {
System.out.println("Weird color for infested block: ("
+ red + ", " + green + ", " + blue + ")");
System.out.println("Shelter at (" + row + ", " + col +")");
System.out.println("Usually means infested count is off.");
infestColor = Color.white;
}
graphics.setPaint( infestColor );
graphics.fillRect(guiX + OCCUPANCY_BAR_WIDTH, guiY, STATUS_BAR_WIDTH, agentGUISize / 2);
String data = "" + occupants + "/" + infested;
graphics.setPaint( Color.black );
graphics.drawString(data, guiX + OCCUPANCY_BAR_WIDTH + 5, guiY + agentGUISize/2 - 10 );
// Infection info
// Color of lower half of grid square should get redder
// as more Hosts are infected.
red = 255;
green = 255 - (int) Math.round( 255 * proportionInfected);
blue = 255 - (int) Math.round( 255 * proportionInfected);
Color infectColor = null;
try {
infectColor = new Color( red, green, blue );
} catch (IllegalArgumentException ie) {
System.out.println("Weird color for infected block: ("
+ red + ", " + green + ", " + blue + ")");
System.out.println("Shelter at (" + row + ", " + col +")");
System.out.println("Usually means infected count is off.");
infestColor = Color.white;
}
graphics.setPaint( infectColor );
graphics.fillRect(guiX + OCCUPANCY_BAR_WIDTH,
guiY + agentGUISize/2,
STATUS_BAR_WIDTH,
agentGUISize / 2);
data = "" + occupants + "/" + infected;
graphics.setPaint( Color.black );
graphics.drawString(data, guiX + OCCUPANCY_BAR_WIDTH + 5, guiY + agentGUISize - 10 );
// Color of lower half of grid square should get bluer
// as more Hosts are infected
/*
if (a.isTreated())
{
// if treated with antibiotic, draw a little dot in the
// middle of the rendered agent
int dotSize = 2;
graphics.setPaint(Color.black);
graphics.fillRect(guiX + ((agentGUISize - dotSize) / 2),
guiY + ((agentGUISize - dotSize) / 2),
dotSize, dotSize);
}
*/
drawShelterFrame(graphics,
guiX, guiY, agentGUISize, agentGUISize );
}
}
}
// draw the grid last so that it will overlay the agent squares
//drawGrid(graphics, viewportX, viewportY, renderWidth, renderHeight);
drawGrid(graphics, viewportX + GUI_XPAD, viewportY + GUI_YPAD, renderWidth, renderHeight);
// show the number of infected/uninfected agents
drawAgentInfo(graphics, viewportX, viewportY,
renderWidth, renderHeight, borders);
revalidate();
// get rid of the graphics copy
graphics.dispose();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void paintComponent(Graphics g) \n {\n super.paintComponent(g);\n doDrawing(g);\n }",
"@Override\n\tpublic void paint(Graphics g) {\t\t\n\t\t//tracking total time manually with the time variable\n\t\ttime += control.timerValue;\n\t\t\n\t\t//events\n\t\tsuper.paintCompone... | [
"0.7896479",
"0.77759176",
"0.7670598",
"0.766405",
"0.7635486",
"0.7613727",
"0.7613727",
"0.7595708",
"0.75465804",
"0.75382686",
"0.7499439",
"0.7496412",
"0.7494212",
"0.74770486",
"0.7456833",
"0.7454095",
"0.7438828",
"0.74226165",
"0.740781",
"0.7383641",
"0.73720556",... | 0.6802511 | 73 |
====================================================================== private void drawGrid(Graphics2D graphics) Draw a grid on top of the background and agents. ====================================================================== | private void drawGrid(Graphics2D graphics, int x, int y,
int width, int height)
{
graphics.setPaint(Color.black);
// the columns
graphics.setStroke(new BasicStroke(2));
int agentGUISize = Parameters.getAgentGUISize();
for (int row = 0; row < width / agentGUISize; row++)
graphics.drawLine(x + (row * agentGUISize), y,
x + (row * agentGUISize), y + height - 1);
// the rows
for (int col = 0; col < height / agentGUISize; col++){
graphics.drawLine(x, y + (col * agentGUISize),
x + width - 1, y + (col * agentGUISize));
}
// the border
graphics.drawLine(x, y, x, y + height);
graphics.drawLine(x, y, x + width, y);
graphics.drawLine(x + width, y, x + width, y + height);
graphics.drawLine(x, y + height, x + width, y + height);
graphics.setStroke(new BasicStroke());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract void paintGrid(Graphics2D g);",
"private void drawGrid(){\r\n\r\n\t\tdrawHorizontalLines();\r\n\t\tdrawVerticalLines();\r\n\t}",
"private void drawGrid(Graphics2D g2) {\r\n Stroke stroke = g2.getStroke();\r\n\r\n if (isGridPainted()) {\r\n drawVerticalGrid(g2);\r\n ... | [
"0.8052906",
"0.78850037",
"0.78434396",
"0.7762213",
"0.7730531",
"0.76628274",
"0.7598508",
"0.75933105",
"0.74623036",
"0.7196589",
"0.71163046",
"0.7092033",
"0.7043261",
"0.70410246",
"0.696755",
"0.693947",
"0.69068706",
"0.6836763",
"0.67724293",
"0.6752771",
"0.674910... | 0.8100425 | 0 |
Draw the "caption" for the ShelterGrid | private void drawAgentInfo(Graphics2D graphics, int x, int y,
int width, int height, Insets borders)
{
final int verticalSpaceBeforeText = 20;
// Find the size of string in the font being used by the current
// Graphics2D context.
FontMetrics font = graphics.getFontMetrics();
String agentInfo = null;
int textWidth = 0;
int textHeight = 0;
int totalTextHeight = 0;
int maxTextWidth = 0;
if (GRID_LEGEND_HORIZONTAL) {
agentInfo = "Infected: " + simulation.getNumInfectedHumans() +
" " +
"Uninfected: " + simulation.getNumUninfectedAgents() +
" " +
"Infested: " + simulation.getNumInfestedHosts() +
" " +
"Uninfested: " + simulation.getNumUninfestedHosts() +
" " +
"Treated: " + simulation.getNumTreatedAgents();
Rectangle2D rect = font.getStringBounds(agentInfo, graphics);
textWidth = (int)(rect.getWidth());
textHeight = (int)(rect.getHeight());
totalTextHeight = textHeight;
maxTextWidth = textWidth;
int startStringAt = (width - textWidth) / 2;
// center text horizontally (max sure left side at least draws w/in
// the viewport window -- i.e., x at least 0)
graphics.drawString(agentInfo, Math.max(x + startStringAt, 0),
y + height + verticalSpaceBeforeText);
} else {
agentInfo = "Infected: " + simulation.getNumInfectedHumans();
Rectangle2D rect = font.getStringBounds(agentInfo, graphics);
textWidth = (int)(rect.getWidth());
textHeight = (int)(rect.getHeight());
totalTextHeight = textHeight;
maxTextWidth = textWidth;
int startStringAt = (width - textWidth) / 2;
graphics.drawString(agentInfo, Math.max(x + startStringAt, 0),
y + height + totalTextHeight + verticalSpaceBeforeText);
agentInfo = "Uninfected: " + simulation.getNumUninfectedAgents();
rect = font.getStringBounds(agentInfo, graphics);
textWidth = (int)(rect.getWidth());
textHeight = (int)(rect.getHeight());
totalTextHeight += textHeight;
if (textWidth > maxTextWidth){
maxTextWidth = textWidth;
}
//startStringAt = (width - textWidth) / 2;
graphics.drawString(agentInfo, Math.max(x + startStringAt, 0),
y + height + totalTextHeight + verticalSpaceBeforeText);
agentInfo = "Infested: " + simulation.getNumInfestedHosts();
rect = font.getStringBounds(agentInfo, graphics);
textWidth = (int)(rect.getWidth());
textHeight = (int)(rect.getHeight());
totalTextHeight += textHeight;
if (textWidth > maxTextWidth){
maxTextWidth = textWidth;
}
//startStringAt = (width - textWidth) / 2;
graphics.drawString(agentInfo, Math.max(x + startStringAt, 0),
y + height + totalTextHeight + verticalSpaceBeforeText);
agentInfo = "Uninfested: " + simulation.getNumUninfestedHosts();
rect = font.getStringBounds(agentInfo, graphics);
textWidth = (int)(rect.getWidth());
textHeight = (int)(rect.getHeight());
totalTextHeight += textHeight;
if (textWidth > maxTextWidth){
maxTextWidth = textWidth;
}
//startStringAt = (width - textWidth) / 2;
graphics.drawString(agentInfo, Math.max(x + startStringAt, 0),
y + height + totalTextHeight + verticalSpaceBeforeText);
agentInfo = "Treated: " + simulation.getNumTreatedAgents();
rect = font.getStringBounds(agentInfo, graphics);
textWidth = (int)(rect.getWidth());
textHeight = (int)(rect.getHeight());
totalTextHeight += textHeight;
if (textWidth > maxTextWidth){
maxTextWidth = textWidth;
}
//startStringAt = (width - textWidth) / 2;
graphics.drawString(agentInfo, Math.max(x + startStringAt, 0),
y + height + totalTextHeight + verticalSpaceBeforeText);
}
// Make sure the image plus text (which may be a new one loaded in) is
// visible in the scroll pane. If this isn't somewhere, scrollbars
// won't work in the main screen's encompassing JScrollPane.
setPreferredSize(
new Dimension(
Math.max(width + borders.left + borders.right, maxTextWidth + 10),
height + borders.top + borders.bottom
+ verticalSpaceBeforeText + totalTextHeight + 10));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void drawTitle(Graphics2D g2) {\n //int xloc = leftDisplay + (rightDisplay - leftDisplay)*xCenter/getWidth();\n FontRenderContext frc = g2.getFontRenderContext();\n Font font = new Font(\"Arial\", Font.BOLD, 9);\n String str = dataSet.getGeneRange().getName() + \" Chr\" + dat... | [
"0.6783985",
"0.6643075",
"0.64510036",
"0.6433429",
"0.6429618",
"0.6420342",
"0.63419217",
"0.62891555",
"0.6242553",
"0.62325954",
"0.61531633",
"0.6139452",
"0.6012642",
"0.59761095",
"0.59659475",
"0.5924667",
"0.58697623",
"0.58303183",
"0.5816367",
"0.5809684",
"0.5783... | 0.0 | -1 |
====================================================================== private Point convertToLogical(int x, int y) This takes physical (x,y) and converts it to logical (x,y) in the context of the agent/grid size. ====================================================================== | private Point convertToLogical(int x, int y)
{
// convert to next lowest multiple of agentGUISize using int division
int agentGUISize = Parameters.getAgentGUISize();
int newX = (x - viewportX) / agentGUISize;
int newY = (y - viewportY) / agentGUISize;
return new Point(newX, newY);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private Point2D.Float toGridPoint(int x, int y) {\n return new Point2D.Float((float)((x - centreX)*scale), (float)((centreY - y)*scale));\n }",
"public Point NormalizePoint(int _x, int _y){\n _x = _x - x;\n _y = _y - (y - height);\n\n _y = Math.abs(_y - height);\n\n return n... | [
"0.6018169",
"0.57733667",
"0.57000154",
"0.56828517",
"0.56770146",
"0.5590838",
"0.554546",
"0.5510138",
"0.54110825",
"0.54046685",
"0.5381974",
"0.53755164",
"0.5360269",
"0.53579956",
"0.53448606",
"0.5325862",
"0.53222674",
"0.5312264",
"0.53071856",
"0.52952254",
"0.52... | 0.8615459 | 0 |
====================================================================== private void inspectShelterAt(Point p) ====================================================================== | private void inspectShelterAt(Point p)
{
// Ignore clicks outside the actual grid of shelters
int col = (int) p.getX();
if ( col < 0 ) return;
if ( col >= shelters.getGridWidth() ) return;
int row = (int) p.getY();
if ( row < 0 ) return;
if ( row >= shelters.getGridHeight() ) return;
Shelter s = shelters.getShelterAt( col, row );//shelterGrid[col][row];
if (s != null)
{
// use hash map to see if the window is already created, and if so,
// just focus; otherwise, create a new inspector window
double time = simulation.getTime();
String id = s.getRow() + "," + s.getCol() + " " + time;
ShelterInspector window = ShelterInspector.windowList.get(id);
if (window == null)
{
window = new ShelterInspector(s, time, id);
ShelterInspector.windowList.put(id, window);
}
window.setVisible(true);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void mouseClicked(MouseEvent e)\n {\n Point p = convertToLogical(e.getX(), e.getY());\n inspectShelterAt(p);\n }",
"public ShelterList() {\n shelters = new HashMap<>();\n }",
"public MapLocation senseLocationOf(GameObject o) throws GameActionException;",
"@Override\n\tpub... | [
"0.65686893",
"0.5532881",
"0.5231675",
"0.5190685",
"0.51739025",
"0.513951",
"0.50465924",
"0.500692",
"0.4974387",
"0.49457332",
"0.49313203",
"0.49292377",
"0.49270558",
"0.4917206",
"0.4917196",
"0.49074358",
"0.48910487",
"0.48822662",
"0.48763117",
"0.48652697",
"0.483... | 0.8408973 | 0 |
The following methods are for implementing MouseListener. We're really only interested in mouseClicked(). | public void mouseClicked(MouseEvent e)
{
Point p = convertToLogical(e.getX(), e.getY());
inspectShelterAt(p);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void mouseClicked(int mouseX, int mouseY, int mouse) {}",
"public abstract void mouseClicked(MouseEvent e);",
"public abstract void mouseClicked(MouseClickedEvent event);",
"@Override\n public void mouseClicked(MouseEvent arg0) {\n \n }",
"public void mouseClicked(MouseEvent e) {}",
"... | [
"0.8035695",
"0.80240685",
"0.7998674",
"0.7887444",
"0.7868886",
"0.7868886",
"0.7868886",
"0.7868886",
"0.7816289",
"0.77992946",
"0.7793725",
"0.77844393",
"0.77830124",
"0.7779291",
"0.77646595",
"0.77646595",
"0.77646595",
"0.77646595",
"0.77646595",
"0.77646595",
"0.776... | 0.0 | -1 |
used when run from a junit3 suite | public static junit.framework.Test suite() {
return new JUnit4TestAdapter(TypeEmbedded.class);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void testDumbJUnit() {\n }",
"public void junitClassesStarted() { }",
"public void junitClassesStarted() { }",
"@Test\n\tpublic void testMain() {\n\t}",
"@Override\n public void runTest() {\n }",
"public void junitStarted() { }",
"public void junitStarted() { }",
"protected TeststepRu... | [
"0.6985362",
"0.6891196",
"0.6891196",
"0.68496287",
"0.6810069",
"0.6755462",
"0.6755462",
"0.67438906",
"0.6723217",
"0.671851",
"0.6710353",
"0.6706134",
"0.66740507",
"0.6668179",
"0.6657032",
"0.66350025",
"0.66182417",
"0.6613468",
"0.65998214",
"0.65834624",
"0.6583064... | 0.0 | -1 |
Called just before this Command runs the first time | protected void initialize() {
Robot.pneumatics.pneuOpen();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void preRun() {\n super.preRun();\n }",
"protected void preRun() {\r\n\t\tthis.preparePairs();\r\n\t}",
"@Override\n public void beforeFirstLogic() {\n }",
"public void prePerform() {\n // nothing to do by default\n }",
"protected void onFirstUse() {}",
"@O... | [
"0.7113986",
"0.6542487",
"0.64347786",
"0.6433418",
"0.64082474",
"0.6353506",
"0.6309701",
"0.62537354",
"0.62473047",
"0.62407833",
"0.6167777",
"0.6163407",
"0.6129232",
"0.6129232",
"0.6129232",
"0.6129232",
"0.6129232",
"0.61080366",
"0.608483",
"0.608483",
"0.60805327"... | 0.0 | -1 |
Called repeatedly when this Command is scheduled to run | protected void execute() {
Robot.drive.driveForward(DRIVE_SPEED);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\t\tvoid runCommand() {\n\t\t\ttrigger.execute();\n\t\t}",
"@Override\n public void run() {\n schedule();\n }",
"@Override\n public void autonomousPeriodic() {\n \n Scheduler.getInstance().run();\n \n }",
"public void run() {\n\t\texecuteCommand( client, false );\n\t}",
"... | [
"0.6689458",
"0.6631115",
"0.6566414",
"0.65512514",
"0.6530515",
"0.6488629",
"0.64019585",
"0.6380878",
"0.637645",
"0.6363615",
"0.63557744",
"0.6330997",
"0.6295938",
"0.6275704",
"0.6268897",
"0.62656784",
"0.62656784",
"0.62656784",
"0.62656784",
"0.62656784",
"0.626567... | 0.0 | -1 |
Make this return true when this Command no longer needs to run execute() | protected boolean isFinished() {
return isTimedOut();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean execute() {\n return false;\n }",
"@Override\n public boolean execute() {\n return false;\n }",
"public boolean execute(){\n return false;\n }",
"@Override\n\tpublic boolean Unexecute() \n\t{\n\t\treturn false;\n\t}",
"p... | [
"0.77345294",
"0.77345294",
"0.7678753",
"0.76457655",
"0.75966",
"0.7554271",
"0.6877811",
"0.6748956",
"0.6728847",
"0.66855806",
"0.65891784",
"0.65624696",
"0.64980483",
"0.63857424",
"0.63736373",
"0.6356819",
"0.6356819",
"0.63498974",
"0.63401324",
"0.63290936",
"0.632... | 0.0 | -1 |
Called once after isFinished returns true | protected void end() {
Robot.drive.stop();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n protected boolean isFinished() {\n return true;\n }",
"@Override\n protected boolean isFinished() {\n return true;\n }",
"@Override\n public boolean isFinished() {\n return true;\n }",
"@Override\r\n\tprotected boolean isFinished() {\n\t\treturn true;\r\n\t}",
"@Override\... | [
"0.8585856",
"0.85401976",
"0.8334428",
"0.83323556",
"0.83323556",
"0.8307301",
"0.8305363",
"0.82994324",
"0.82779974",
"0.82779974",
"0.82779974",
"0.82779974",
"0.82779974",
"0.82779974",
"0.82779974",
"0.82779974",
"0.82779974",
"0.82779974",
"0.82779974",
"0.82779974",
... | 0.0 | -1 |
Called when another command which requires one or more of the same subsystems is scheduled to run | protected void interrupted() {
end();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public AutonomousCommand(LiftSubsystem m_lift, ArmSubsystem m_arm, Shooter m_shooter, DriveSubsystem m_drive,\n HopperSubsystem m_hopper, Intake m_intake) {\n // Add your commands in the super() call, e.g.\n // super(new FooCommand(), new BarCommand());\n // alongwith- birlikte çalıştırmak için // wi... | [
"0.57643956",
"0.55974686",
"0.55269176",
"0.54348546",
"0.5383537",
"0.5364402",
"0.53499067",
"0.53434175",
"0.53294504",
"0.53284",
"0.5300598",
"0.5263391",
"0.5255799",
"0.52325845",
"0.5224349",
"0.520375",
"0.5192927",
"0.51795447",
"0.5162683",
"0.5153918",
"0.5143466... | 0.0 | -1 |
Test serialize Date to Timestamp (number of milliseconds since January 1st, 1970, UTC). | @Test
public void shouldSerializeToTimestampWhenSerializingDateWithJackson() throws ParseException, JsonProcessingException {
SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy hh:mm");
df.setTimeZone(TimeZone.getTimeZone("UTC"));
Date date = df.parse("01-01-1970 01:00");
Event event = new Event("party", date);
ObjectMapper objectMapper = new ObjectMapper();
String result = objectMapper.writeValueAsString(event);
assertThat(result, containsString("party"));
assertThat(result, containsString("3600000"));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Timestamp toTimestamp( Date date )\n {\n return date != null ? new Timestamp( date.getTime() ) : null;\n }",
"Date getTimestamp();",
"@Test\n public void testOdtToTs() {\n Instant now = Instant.now();\n OffsetDateTime timestamp = OffsetDateTime.ofInstant(now, ZoneOffset.UTC);\n ... | [
"0.6870104",
"0.6784922",
"0.65747494",
"0.62942004",
"0.62612766",
"0.62579286",
"0.6172504",
"0.6172504",
"0.6172504",
"0.6172504",
"0.6172504",
"0.6172504",
"0.6172504",
"0.6172504",
"0.6172504",
"0.6172504",
"0.6172504",
"0.6172504",
"0.6172504",
"0.6172504",
"0.6172504",... | 0.7090471 | 0 |
Serialize Date to ISO8601 | @Test
public void shouldSerializeToTextWhenSerializingDateToISO8601() throws Exception {
SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy hh:mm");
df.setTimeZone(TimeZone.getTimeZone("UTC"));
String toParse = "01-01-1970 02:30";
Date date = df.parse(toParse);
Event event = new Event("party", date);
ObjectMapper mapper = new ObjectMapper();
mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
mapper.setDateFormat(new ISO8601DateFormat());
String result = mapper.writeValueAsString(event);
assertThat(result, containsString("1970-01-01T02:30:00Z"));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String dateToISO8601(Date date)\n {\n SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SXXX\");\n TimeZone tz = TimeZone.getDefault();\n df.setTimeZone(tz);\n return df.format(date);\n }",
"public static String getISO8601StringForDate(Date date){\n ... | [
"0.75572115",
"0.7103539",
"0.68747944",
"0.62792987",
"0.6205325",
"0.61455274",
"0.60330945",
"0.60316646",
"0.6019272",
"0.5999398",
"0.5923476",
"0.57911754",
"0.56645644",
"0.55888605",
"0.55627644",
"0.5555881",
"0.55093396",
"0.5501967",
"0.54673946",
"0.546576",
"0.53... | 0.70045054 | 2 |
Set our formats for representing dates | @Test
public void shouldCorrectWhenSettingObjectMapperDateFormat() throws Exception {
SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy hh:mm");
String toParse = "20-12-2014 02:30";
Date date = df.parse(toParse );
Event event = new Event("party", date);
ObjectMapper mapper = new ObjectMapper();
mapper.setDateFormat(df);
String result = mapper.writeValueAsString(event);
assertThat(result, containsString(toParse));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setDateFormats(String dateFormats)\n {\n this.dateFormats = dateFormats;\n }",
"@Override\n\tpublic String[] getFormats() {\n\t\treturn new String[] {\"yyyy-MM-dd'T'HH:mm:ss\",\"yyyy-MM-dd HH:mm:ss\",\"yyyy-MM-dd HH:mm\",\"yyyy-MM-dd'T'HH:mm\",\"yyyy-MM-dd HH\", \"yyyy-MM-dd\" };\n\t}",
"publi... | [
"0.7430208",
"0.723146",
"0.7096941",
"0.69550604",
"0.6537015",
"0.6522173",
"0.6408864",
"0.637521",
"0.6298304",
"0.6296831",
"0.6252199",
"0.6224974",
"0.6223266",
"0.6134283",
"0.61331576",
"0.6125832",
"0.6123656",
"0.6112075",
"0.60824585",
"0.60601115",
"0.604809",
... | 0.0 | -1 |
Checks if memory is full | boolean isFull() {return pointer==size;} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isFull()\n {\n return heapSize == heap.length;\n }",
"public boolean isFull() {\n return size == cnt;\n }",
"public boolean isFull() {\n\t\treturn(this.size == this.capacity);\n\t}",
"public boolean isFull(){\n \treturn count==capacity;\n }",
"default boo... | [
"0.762144",
"0.75072604",
"0.74916553",
"0.74864525",
"0.7475717",
"0.746743",
"0.7460521",
"0.7329058",
"0.7284156",
"0.72624636",
"0.7250208",
"0.7237939",
"0.71754086",
"0.71661246",
"0.7153573",
"0.7140905",
"0.7140905",
"0.7140905",
"0.7140905",
"0.7140905",
"0.7140905",... | 0.75447845 | 1 |
Adds new frame to memory | int add(int pgNum, int clock, char act)
{
int old;
//If memory is not full
if(pointer!=size)
{
pm[pointer][0] = pgNum;
pm[pointer][1] = clock;
pm[pointer][2] = act=='W' ? 1 : 0;
pointer++;
return pointer;
}
//If memory is full, replace LRU frame
int lruID = 0;
for(int i = 1; i<size; i++)
if(pm[i][2]<pm[lruID][2])
lruID = i;
old = pm[lruID][0];
pm[lruID][0] = pgNum;
pm[lruID][1] = clock;
pm[lruID][2] = act=='W' ? 1 : 0;
return old;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void addFrame(Point newFrame)\n {\n frames.add(newFrame);\n }",
"public void addFrame(AnimationFrame frame) {\n\t\tthis.frames.add(frame);\n\t}",
"private void addFrame() {\n String name = selectString(\"What is the name of this frame?\");\n ReferenceFrame frame = selectFrame(... | [
"0.7381156",
"0.6868156",
"0.68113863",
"0.679418",
"0.6462767",
"0.6427904",
"0.6222543",
"0.6066099",
"0.59277856",
"0.5918492",
"0.5910148",
"0.58654946",
"0.5854103",
"0.5852167",
"0.57785463",
"0.57062143",
"0.56536025",
"0.5636853",
"0.55996084",
"0.55947113",
"0.557621... | 0.5090294 | 62 |
Checks if memory contains given frame. | int contains(int pgNum, int clock, char act)
{
for(int i = 0; i <size; i++)
if(pm[i][0]==pgNum)
{
pm[i][1] = clock;
pm[i][2] = act=='W' ? 1 : 0;
return i;
}
return -1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean hasFrame();",
"public boolean hasFrame() {\n return frame_ != null;\n }",
"public boolean hasFrame() {\n return frameBuilder_ != null || frame_ != null;\n }",
"public boolean isSetFrame()\n {\n synchronized (monitor())\n {\n check_orphaned();\n ... | [
"0.6816662",
"0.66614693",
"0.64006054",
"0.6304841",
"0.6268729",
"0.6078698",
"0.5994547",
"0.59619",
"0.5951278",
"0.59192824",
"0.5802452",
"0.5790199",
"0.57274824",
"0.5691204",
"0.5669274",
"0.56163126",
"0.5573115",
"0.5565597",
"0.55612427",
"0.5533701",
"0.5532423",... | 0.0 | -1 |
Used to indicate when a packet must be transformed into ship space to work properly (Digging packets for example). Also comes with functionality to store and retrieve a player data backup to prevent the player from getting teleported somewhere else, but this is not necessarily required. | public interface ITransformablePacket {
default boolean isPacketOnMainThread(INetHandlerPlayServer server, boolean callingFromSponge) {
if (!MixinLoadManager.isSpongeEnabled() || callingFromSponge) {
NetHandlerPlayServer serverHandler = (NetHandlerPlayServer) server;
EntityPlayerMP player = serverHandler.player;
return player.getServerWorld().isCallingFromMinecraftThread();
} else {
return false;
}
}
/**
* Puts the player into local coordinates and makes a record of where they used to be.
*/
default void doPreProcessing(INetHandlerPlayServer server, boolean callingFromSponge) {
if (isPacketOnMainThread(server, callingFromSponge)) {
// System.out.println("Pre packet process");
NetHandlerPlayServer serverHandler = (NetHandlerPlayServer) server;
EntityPlayerMP player = serverHandler.player;
PhysicsWrapperEntity wrapper = getPacketParent(serverHandler);
if (wrapper != null
&& wrapper.getPhysicsObject().getShipTransformationManager() != null) {
ISubspaceProvider worldProvider = (ISubspaceProvider) player.getServerWorld();
ISubspace worldSubspace = worldProvider.getSubspace();
worldSubspace.snapshotSubspacedEntity((ISubspacedEntity) player);
wrapper.getPhysicsObject().getShipTransformationManager()
.getCurrentTickTransform().transform(player,
TransformType.GLOBAL_TO_SUBSPACE);
}
}
}
/**
* Restores the player from local coordinates to where they used to be.
*/
default void doPostProcessing(INetHandlerPlayServer server, boolean callingFromSponge) {
if (isPacketOnMainThread(server, callingFromSponge)) {
NetHandlerPlayServer serverHandler = (NetHandlerPlayServer) server;
EntityPlayerMP player = serverHandler.player;
PhysicsWrapperEntity wrapper = getPacketParent(serverHandler);
// I don't care what happened to that ship in the time between, we must restore
// the player to their proper coordinates.
ISubspaceProvider worldProvider = (ISubspaceProvider) player.getServerWorld();
ISubspace worldSubspace = worldProvider.getSubspace();
ISubspacedEntity subspacedEntity = (ISubspacedEntity) player;
ISubspacedEntityRecord record = worldSubspace
.getRecordForSubspacedEntity(subspacedEntity);
// System.out.println(player.getPosition());
if (subspacedEntity.currentSubspaceType() == CoordinateSpaceType.SUBSPACE_COORDINATES) {
subspacedEntity.restoreSubspacedEntityStateToRecord(record);
player.setPosition(player.posX, player.posY, player.posZ);
}
// System.out.println(player.getPosition());
// We need this because Sponge Mixins prevent this from properly working. This
// won't be necessary on client however.
}
}
PhysicsWrapperEntity getPacketParent(NetHandlerPlayServer server);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void processPacket(String packet) {\n try {\n Log.e(\"info\", packet);\n JSONObject obj = new JSONObject(packet);\n JSONObject toSend = new JSONObject();\n String id = obj.getString(\"packet\");\n\n\n\n if (id.equals(\"acknowledge\")) {\n ... | [
"0.5896425",
"0.5476989",
"0.54241264",
"0.5394337",
"0.52773887",
"0.5213934",
"0.5180342",
"0.51515675",
"0.5148726",
"0.51158834",
"0.5111865",
"0.50923645",
"0.5062856",
"0.5017316",
"0.5004213",
"0.49530038",
"0.49465725",
"0.49454027",
"0.49317718",
"0.49275103",
"0.492... | 0.58599323 | 1 |
Puts the player into local coordinates and makes a record of where they used to be. | default void doPreProcessing(INetHandlerPlayServer server, boolean callingFromSponge) {
if (isPacketOnMainThread(server, callingFromSponge)) {
// System.out.println("Pre packet process");
NetHandlerPlayServer serverHandler = (NetHandlerPlayServer) server;
EntityPlayerMP player = serverHandler.player;
PhysicsWrapperEntity wrapper = getPacketParent(serverHandler);
if (wrapper != null
&& wrapper.getPhysicsObject().getShipTransformationManager() != null) {
ISubspaceProvider worldProvider = (ISubspaceProvider) player.getServerWorld();
ISubspace worldSubspace = worldProvider.getSubspace();
worldSubspace.snapshotSubspacedEntity((ISubspacedEntity) player);
wrapper.getPhysicsObject().getShipTransformationManager()
.getCurrentTickTransform().transform(player,
TransformType.GLOBAL_TO_SUBSPACE);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void setupPlayerPosition() {\n\t\tHashMap<Suspect, Coordinates> startPositions = new HashMap<Suspect, Coordinates>();\r\n\t\tstartPositions.put(Suspect.KasandraScarlet, new Coordinates(18, 28));\r\n\t\tstartPositions.put(Suspect.JackMustard, new Coordinates(7, 28));\r\n\t\tstartPositions.put(Suspect.DianeW... | [
"0.6874519",
"0.6820814",
"0.67372143",
"0.65880793",
"0.63353163",
"0.63277966",
"0.63214904",
"0.6319267",
"0.63171154",
"0.62741584",
"0.6232242",
"0.62099904",
"0.6183772",
"0.6167713",
"0.6149511",
"0.6144453",
"0.6134839",
"0.6120705",
"0.608089",
"0.6070484",
"0.606690... | 0.0 | -1 |
Restores the player from local coordinates to where they used to be. | default void doPostProcessing(INetHandlerPlayServer server, boolean callingFromSponge) {
if (isPacketOnMainThread(server, callingFromSponge)) {
NetHandlerPlayServer serverHandler = (NetHandlerPlayServer) server;
EntityPlayerMP player = serverHandler.player;
PhysicsWrapperEntity wrapper = getPacketParent(serverHandler);
// I don't care what happened to that ship in the time between, we must restore
// the player to their proper coordinates.
ISubspaceProvider worldProvider = (ISubspaceProvider) player.getServerWorld();
ISubspace worldSubspace = worldProvider.getSubspace();
ISubspacedEntity subspacedEntity = (ISubspacedEntity) player;
ISubspacedEntityRecord record = worldSubspace
.getRecordForSubspacedEntity(subspacedEntity);
// System.out.println(player.getPosition());
if (subspacedEntity.currentSubspaceType() == CoordinateSpaceType.SUBSPACE_COORDINATES) {
subspacedEntity.restoreSubspacedEntityStateToRecord(record);
player.setPosition(player.posX, player.posY, player.posZ);
}
// System.out.println(player.getPosition());
// We need this because Sponge Mixins prevent this from properly working. This
// won't be necessary on client however.
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void resetPlayerPosition() {\n\t\tthis.tilePositionX = this.STARTING_X;\n\t\tthis.tilePositionY = this.STARTING_Y;\n\t}",
"public void setOriginalLocation() {\r\n for (int i = 0; i < this.enemies.size(); i++) {\r\n Point originalPoint = this.startLocations.get(i);\r\n this.ene... | [
"0.7171928",
"0.64130265",
"0.62364316",
"0.62139714",
"0.61948955",
"0.6174966",
"0.61611915",
"0.6089986",
"0.6071915",
"0.59919304",
"0.5929186",
"0.5896702",
"0.5831877",
"0.58233523",
"0.58013684",
"0.57967514",
"0.5787401",
"0.5784109",
"0.57670385",
"0.5747541",
"0.573... | 0.0 | -1 |
HashTable and MySet change together | @Before
public void test_change(){
HashTable<String,String> table = new HashTable<>(1);
MySet<String> s = (MySet<String>) table.keySet();
table.put("AA","BB");
table.put("AA","CC");
assertTrue(s.contains("AA"));
table.remove("AA");
assertFalse(s.contains("AA"));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void mo30185a(HashSet<zzawj> hashSet);",
"HSet entrySet();",
"protected void rehash( )\r\n\t{\r\n\t\tint newSize = nextPrime(this.tableSize*2);\r\n\t\tMyHashTable<T> newHashTable = new MyHashTable<T>(newSize);\r\n\t\tIterator<T> thisTableIter = this.iterator();\r\n\t\twhile(thisTableIter.hasNext())\r\n\t\t{\r\... | [
"0.7015264",
"0.69206893",
"0.69199204",
"0.6916972",
"0.6882439",
"0.67482173",
"0.67340034",
"0.6719706",
"0.66890895",
"0.6612499",
"0.6597011",
"0.6568509",
"0.6443834",
"0.6404083",
"0.64039797",
"0.64038324",
"0.6402989",
"0.63942593",
"0.6362378",
"0.6316016",
"0.63019... | 0.7251835 | 0 |
Constructor, for both variants absolute height and font varying height. | public SpacerHeight(boolean isFontMultiple, double spacerHeight) {
if (isFontMultiple) {
this.fontMultiple = spacerHeight ;
} else {
this.fontMultiple = null ;
this.spacerSize = spacerHeight ;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void setHeight(VariableAmount height);",
"Builder height(VariableAmount height);",
"@Override\r\n public void setHeight(String height) {\n }",
"public void setFontHeightInPoints(short height)\n {\n font.setFontHeight(( short ) (height * 20));\n }",
"@Override\n\tpublic void setHeight(flo... | [
"0.64414775",
"0.63833785",
"0.63295174",
"0.6237539",
"0.6219516",
"0.61952144",
"0.6094235",
"0.60273635",
"0.60273635",
"0.6020169",
"0.5997243",
"0.5974593",
"0.5963042",
"0.59596705",
"0.5955",
"0.5955",
"0.59513",
"0.59491456",
"0.5920767",
"0.5891014",
"0.58804333",
... | 0.5847976 | 22 |
Returns the spacer height in absolute units, calculating from the template and font if required. Subsequent calls with the same quill use a cached value. | public double getSpacerSize(Quill quill) throws IOException {
if (fontMultiple!=null) {
if (quill==null) throw new IllegalArgumentException("Argument 'quill' should not be null");
if (quill!=this.spacerQuill) {
this.spacerSize = quill.getFontHeight() * fontMultiple ;
this.spacerQuill = quill ;
}
}
return spacerSize ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getCurrentHeight();",
"public SpacerHeight(boolean isFontMultiple, double spacerHeight) { \n\t\tif (isFontMultiple) { \n\t\t\tthis.fontMultiple = spacerHeight ; \n\t\t} else { \n\t\t\tthis.fontMultiple = null ; \n\t\t\tthis.spacerSize = spacerHeight ; \n\t\t}\n\t}",
"private int getQustionHeight(int... | [
"0.6141084",
"0.6112459",
"0.61102074",
"0.6089663",
"0.5909586",
"0.5845559",
"0.58345795",
"0.5720843",
"0.5691115",
"0.5633758",
"0.5625684",
"0.5625684",
"0.5614413",
"0.55970585",
"0.55777246",
"0.5573836",
"0.5536236",
"0.5507657",
"0.5495026",
"0.54947114",
"0.5493482"... | 0.6958414 | 0 |
Created by zyongliu on 23/11/16. | public interface Orders {
Optional<Order> createOrder(User user, HashMap<String, Object> orderInfo);
Optional<Order> findByUidOid(String uid, long oid);
List<Order> findAllByUid(String username);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void perish() {\n \n }",
"private stendhal() {\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\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Over... | [
"0.63929117",
"0.62565947",
"0.6202407",
"0.61735445",
"0.6147911",
"0.6139102",
"0.6139102",
"0.6091609",
"0.60466564",
"0.5995249",
"0.5982245",
"0.5980238",
"0.5979114",
"0.5959059",
"0.5942501",
"0.5936818",
"0.5936284",
"0.5928931",
"0.5920308",
"0.59124476",
"0.5893709"... | 0.0 | -1 |
TODO: Due to the time limitation, I did not refactor this test though my approach would be the same as previous tests i.e define a page object for checkout and read all of the input and desired data via PropertyLoader class. Please have a look at SignInPage.java | @Test
public void checkoutTest() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void SignInTest() throws InterruptedException {\n LoginTC login = new LoginTC(driver);\n login.LoginTest();\n\n SignInPagePO signInPage = new SignInPagePO(driver);\n\n\n //Step 1: Click On Users\n Assert.assertEquals(signInPage.clickUsers(), true,\"Opps!! unable to cl... | [
"0.60776234",
"0.58444333",
"0.58294314",
"0.5826714",
"0.57656264",
"0.576538",
"0.5714908",
"0.57030886",
"0.5685038",
"0.56842357",
"0.5675336",
"0.565132",
"0.56460065",
"0.5635401",
"0.5596446",
"0.5565379",
"0.55625117",
"0.5561723",
"0.5560627",
"0.55572647",
"0.554498... | 0.0 | -1 |
Specifies the number of nested NS instances required for the NS scale level. | public String getNumberOfInstances() {
return numberOfInstances;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int getScaleCount();",
"public void InitializeMaxNumInstances(int num) {\n }",
"public void setScale(double n) {\n\n\t}",
"protected int numChildren() {\r\n return 3;\r\n }",
"void setNoOfBuckets(int noOfBuckets);",
"public void setChildCount (int childCount) {\n this.childCount = childC... | [
"0.596512",
"0.57413673",
"0.57301974",
"0.5702381",
"0.5527052",
"0.5459521",
"0.53799003",
"0.53524417",
"0.5348234",
"0.53386444",
"0.5317126",
"0.5311754",
"0.53058374",
"0.52685314",
"0.52350795",
"0.5223432",
"0.5214815",
"0.52068704",
"0.5192121",
"0.5178058",
"0.51757... | 0.48538867 | 95 |
Identifies the profile to be used for a nested NS involved in the NS level. | public String getNsProfileId() {
return nsProfileId;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public URI getProfile() { \n\t\treturn getProfileElement().getValue();\n\t}",
"@objid (\"d7af9849-7951-4020-8339-9057fcec6b89\")\n Profile getOwnerProfile();",
"public PosSymbol getProfileName() {\n return profileName;\n }",
"@ModelNodeBinding(detypedName = \"profile\")\n\tpublic String profile... | [
"0.5552379",
"0.5462279",
"0.5259834",
"0.51318663",
"0.51271325",
"0.50879204",
"0.50806314",
"0.5012514",
"0.49931517",
"0.49884683",
"0.49824515",
"0.4953108",
"0.49254712",
"0.49082017",
"0.49053434",
"0.4889525",
"0.48809615",
"0.48681346",
"0.484019",
"0.47977108",
"0.4... | 0.52371335 | 3 |
Convert the given object to string with each line indented by 4 spaces (except the first line). | private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private String toIndentedString(Object object) {\n if (object == null) {\n return EndpointCentralConstants.NULL_STRING;\n }\n return object.toString().replace(EndpointCentralConstants.LINE_BREAK,\n EndpointCentralConstants.LINE_BREAK + EndpointCentralConstants.TAB_SPA... | [
"0.78847593",
"0.75493765",
"0.74971926",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0... | 0.0 | -1 |
Line to update the line in the data. | public ReadData(String pathname, String userInput)
{
User = userInput;
filename = pathname; //Records the path filename.
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void line(String line) {\n\t\t}",
"public void addDataLine(String line) {\n this.data.textProperty().set(\n String.format(\n \"%s\\n%s\",\n this.data.textProperty().get(),\n line\n )\n );\n }",
"public void setLine ( Str... | [
"0.69290656",
"0.69076645",
"0.6798374",
"0.67971534",
"0.6643306",
"0.6573523",
"0.6434843",
"0.63702416",
"0.6363032",
"0.63428193",
"0.6325786",
"0.6321458",
"0.6273296",
"0.6271083",
"0.62257487",
"0.6211941",
"0.6183295",
"0.6167805",
"0.61520875",
"0.6132818",
"0.612300... | 0.0 | -1 |
Method will read and set user information to the class. | public void getUserData()
{
int count; //Loop counter
String pathname = filename;
String div = ","; //Used to divide info.
String [] userArray; //To hold divided info.
try {
FileReader reader = new FileReader(pathname);
BufferedReader bufferedReader = new BufferedReader(reader);
String line;
//While getting each line of the data file, BUT stops when USER data found.
//Loop through each line and determine which user data to choose.
while ((line = bufferedReader.readLine()) != null) {
// System.out.println("User Data in file: " + line);
System.out.println("Checking User name in line of data ...");
//This divides the info in the data file into an array.
userArray = line.split(div);
if (User.equals(userArray[0]))
{
System.out.println("User Found: " + User);
user_line = line;
//Assigning data to class variables.
UserPassword = userArray[1].trim(); //Assigning the password.
Device_ID = Integer.parseInt(userArray[2].trim()); //Assigning device ID.
isLost = (Integer.parseInt(userArray[3].trim()) == 0) ? false : true;
//This reads out information.
for (count = 0; count < userArray.length; count++)
{
System.out.println("INFO: " + userArray[count]);
}
break;
}
System.out.println("========================================");
}
reader.close();
} catch (IOException e) {
e.printStackTrace();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void populateUserInfo() {\n User user = Session.getInstance().getUser();\n labelDisplayFirstname.setText(user.getFirstname());\n labelDisplayLastname.setText(user.getLastname());\n lblEmail.setText(user.getEmail());\n lblUsername.setText(user.getUsername());\n }",
"p... | [
"0.7048738",
"0.6975615",
"0.6919609",
"0.6803239",
"0.6784126",
"0.67703784",
"0.67527133",
"0.67121136",
"0.6611589",
"0.65396154",
"0.6511064",
"0.64980483",
"0.6423524",
"0.6372005",
"0.6323363",
"0.6316567",
"0.6276165",
"0.6261602",
"0.6196",
"0.616929",
"0.6155892",
... | 0.5815232 | 73 |
Used to write the user into the file to set device to LOST/FOUND. Needs: password, phone ID, and status. | public void writeDeviceLost(boolean status)
{
String writeStatement = (User + ", " +
UserPassword + ", " +
Device_ID + ", ");
//System.out.println("\nWRITE Statement: " + writeStatement);
writeStatement += (status) ? (1) : (0);
// System.out.println("\nWRITE Statement: " + writeStatement);
//Write Area Below Start
try {
//THIS WORKS DONT TOUCH IT. or at least save copies.
File fileToBeModified = new File(filename);
String oldContent = "";
BufferedReader reader = null;
FileWriter writer = null;
reader = new BufferedReader(new FileReader(fileToBeModified));
String line = reader.readLine();
while (line != null)
{
oldContent = oldContent + line + System.lineSeparator();
line = reader.readLine();
}
//Replacing oldString with newString in the oldContent
String newContent = oldContent.replaceAll(user_line, writeStatement);
//Rewriting the input text file with newContent
writer = new FileWriter(fileToBeModified);
writer.write(newContent);
reader.close();
writer.close();
} catch (IOException e)
{
e.printStackTrace();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void writeFile() {\n try {\n FileWriter writer = new FileWriter(writeFile, true);\n writer.write(user + \" \" + password);\n writer.write(\"\\r\\n\"); // write new line\n writer.close();\n } catch (IOException e) {\n e.printStackTrace();... | [
"0.62130576",
"0.605013",
"0.593306",
"0.5757329",
"0.57303506",
"0.56557775",
"0.56550586",
"0.5604082",
"0.55757487",
"0.5568457",
"0.55550504",
"0.55206203",
"0.5519475",
"0.55114347",
"0.55024856",
"0.5496553",
"0.5486973",
"0.54599196",
"0.5457485",
"0.54424715",
"0.5429... | 0.66647714 | 0 |
Creates a new instance of CreatePartyTypeUseCommand | public CreatePartyTypeUseCommand(UserVisitPK userVisitPK, CreatePartyTypeUseForm form) {
super(userVisitPK, form, null, FORM_FIELD_DEFINITIONS, false);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String createCommand(String commandType, AttributeList properties);",
"Command createCommandWith(CommandCreator creator);",
"ShipmentType createShipmentType();",
"public Command createInstance() {\n\t\t\n\t\tif(name == \"Direction\")\n\t\t\treturn new Direction();\n\t\t\n\t\tif(name == \"Gear\")\n\t\t\tretur... | [
"0.5599695",
"0.5338165",
"0.5283318",
"0.51502573",
"0.5123807",
"0.50823045",
"0.5020095",
"0.49933338",
"0.49570003",
"0.4933011",
"0.4929239",
"0.4929239",
"0.4929239",
"0.48520514",
"0.48394635",
"0.48180008",
"0.47568083",
"0.47406667",
"0.4731618",
"0.47308278",
"0.472... | 0.6709838 | 0 |
InnerTest a; BuilderExampleBuilder b; | public static void main(String[] args) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private OuterTest(com.google.protobuf.GeneratedMessageLite.Builder builder) {\n super(builder);\n\n }",
"public void testBuilderExample() throws IOException {\n doTest();\n }",
"private Builder(org.apache.gora.cascading.test.storage.TestRow.Builder other) {\n super(other);\n }",
"public s... | [
"0.6194706",
"0.61442643",
"0.6140512",
"0.6053447",
"0.5834357",
"0.583184",
"0.5819234",
"0.57389873",
"0.5696309",
"0.56740147",
"0.5632752",
"0.5596036",
"0.55731905",
"0.5508141",
"0.54720837",
"0.54452455",
"0.5432955",
"0.5406086",
"0.5388138",
"0.5382057",
"0.5374793"... | 0.0 | -1 |
/ Opposites are more strict than similar: they are the same class and are not the same object. However they return true for "opposite," and false for anything else. | public boolean opposedTo(Object o); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean hasSameAs();",
"boolean hasIsEquivalent();",
"boolean _is_equivalent(org.omg.CORBA.Object other);",
"public boolean equivalentInteractions(InteractionObject first, InteractionObject second) {\n\t\tboolean result = \n\t\t\tfirst.getType() == second.getType() &&\n\t\t\tfirst.getIndex() == second.getIn... | [
"0.6749787",
"0.6714937",
"0.65884763",
"0.655669",
"0.65106285",
"0.6348506",
"0.6274615",
"0.6250004",
"0.62475276",
"0.62440646",
"0.62258583",
"0.6205136",
"0.6188154",
"0.6174038",
"0.6162682",
"0.6084542",
"0.6021661",
"0.59734887",
"0.59526366",
"0.5946615",
"0.5920792... | 0.6289314 | 6 |
TODO Autogenerated method stub | public static void main(String[] args) {
Scanner s=new Scanner(System.in);
System.out.println("Enter the number of elements you want to store");
int n= s.nextInt();
int a[]=new int[10];
int i;
System.out.println("Enter numbers");
for( i=0;i<=n;i++)
{
a[i]=s.nextInt();
}
System.out.print("numbers are");
for(i=0;i<=n;i++)
{
System.out.println(a[i]);
}
} | {
"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 |
create class Student (name, age, course) implements Comparable create list of students | public static void main(String[] args) {
List<Student> students = new ArrayList<>();
students.add(new Student(1, "Nazar", 24));
students.add(new Student(2, "Mykola", 17));
students.add(new Student(5, "Valentyn", 18));
students.add(new Student(4, "Oleg", 28));
students.add(new Student(3, "Maria", 20));
students.add(new Student(1, "Andriy", 44));
students.add(new Student(6, "Roman", 85));
// get iterator
Iterator<Student> iterator = students.iterator();
while (iterator.hasNext()) {
Student next = iterator.next();
System.out.println(next);
}
System.out.println();
// complex condition -> remove
Iterator<Student> iterator2 = students.iterator();
while (iterator2.hasNext()) {
Student next = iterator2.next();
if (next.getAge() > 30) {
iterator2.remove();
}
}
System.out.println();
// Iterator<Student> iterator3 = students.iterator();
//
// while(iterator3.hasNext()){
// Student next = iterator3.next();
// System.out.println(next);
// }
// foreach - show remove without iterator
for (Student student : students) {
if (student.getAge() > 30) {
System.out.println(student);
students.remove(student);
}
}
System.out.println();
for (Student student : students) {
System.out.println(student);
}
// fori - show how we can miss some objects
for (int i = 0; i < students.size(); i++) {
if (students.get(i).getAge() > 25) {
students.remove(i);
}
}
for (Student student : students) {
System.out.println(student);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Student(String firstName, String lastName, int age, double gpa, String major, String department, List<Course> courses) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.age = age;\n this.gpa = gpa;\n this.major = major;\n this.department = departmen... | [
"0.6891397",
"0.65031207",
"0.64392006",
"0.63815904",
"0.63386977",
"0.6315932",
"0.62944967",
"0.6182634",
"0.6088225",
"0.6078027",
"0.6076604",
"0.60557574",
"0.59656084",
"0.59557384",
"0.5946075",
"0.5943297",
"0.5936319",
"0.59177977",
"0.59088224",
"0.59083456",
"0.59... | 0.0 | -1 |
WebDriver driver = BrowserSetup.browserStart("chrome"," | public static void main(String[] args)throws Exception {
FileInputStream inFile = new FileInputStream("C:\\Users\\vshadmin\\Desktop\\Book1.xlsx");
XSSFWorkbook book = new XSSFWorkbook(inFile);
XSSFSheet sheet = book.getSheet("Sheet1");
// sheet.getRow(2).getCell(1).setCellValue("LNT");
// sheet.getRow(2).getCell(1).setCellValue("LNT");
//sheet.createRow(3).createCell(2).setCellValue("LNT");
FileOutputStream op = new FileOutputStream("C:\\Users\\vshadmin\\Desktop\\Book1.xlsx");
book.write(op);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@BeforeTest\r\n\tpublic void launch()\r\n\t{\r\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"C:\\\\Yogini\\\\chromedriver\\\\chromedriver.exe\"); //location of browser in local drive\r\n\t\tWebDriver driver = new ChromeDriver(); \r\n\t\tdriver.get(tobj.url);\r\n\t\tSystem.out.println(\"Before test, browse... | [
"0.8135636",
"0.80236727",
"0.789142",
"0.77268094",
"0.76564777",
"0.76478505",
"0.76322246",
"0.75341237",
"0.7529616",
"0.7515268",
"0.75112075",
"0.7509815",
"0.7482996",
"0.7466539",
"0.746335",
"0.7461419",
"0.7453724",
"0.74350536",
"0.7422387",
"0.74214137",
"0.740715... | 0.0 | -1 |
/ Showing splash screen with a timer. This will be useful when you want to show case your app logo / company | @Override
public void run() {
// This method will be executed once the timer is over
// Start your app main activity
Intent i = new Intent(SplashScreen.this, MainActivity.class);
startActivity(i);
// close this activity
finish();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void displaySplashScreen() {\n\t\t// Creates new thread to act as timer.\n\t\tThread logoTimer = new Thread() {\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\n\t\t\t\t\tint logoTimer = 0;\n\t\t\t\t\t// Pauses for SPLASH_TIME amount of time\n\t\t\t\t\twhile (logoTimer < SPLASH_TIME) {\n\t\t\t\t\t\tsleep(100... | [
"0.84425896",
"0.7591602",
"0.758093",
"0.7500748",
"0.7414789",
"0.7305223",
"0.7286512",
"0.7254691",
"0.7248612",
"0.7214067",
"0.71701914",
"0.7142932",
"0.7137518",
"0.70892787",
"0.70852166",
"0.7075123",
"0.704674",
"0.70043606",
"0.699664",
"0.69352084",
"0.68988055",... | 0.72074145 | 10 |
The prototype will use a file based authentication mechanism. All userid/password pairs are periodically read from a Properties file. | private boolean checkCredentials(final String userid, final String password)
{
if(userid == null || password == null || userid.trim().length() < 1 || password.trim().length() < 1)
{
return false;
}
this.loadPasswordFile();
if(LoginServlet.passwords.containsKey(userid))
{
final String expectedPassword = LoginServlet.passwords.getProperty(userid);
if(expectedPassword.equals(password))
{
return true;
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String readFile(File file, String password);",
"private static boolean authenticate(String username, String password) {\r\n\t\tFile file = new File(\"auth.txt\");\r\n\t\tScanner scanner;\r\n\t\tString user = null;\r\n\t\tString pwd = null;\r\n\t\ttry {\r\n\t\t\tscanner = new Scanner(file);\r\n\t\t\tString nextLi... | [
"0.654372",
"0.6497558",
"0.6484985",
"0.6428726",
"0.6385816",
"0.62410486",
"0.6220708",
"0.6156259",
"0.6144181",
"0.60678834",
"0.5988974",
"0.59840536",
"0.5950981",
"0.58872986",
"0.58802754",
"0.5862439",
"0.58596",
"0.58363354",
"0.58181846",
"0.57928187",
"0.57880324... | 0.5499196 | 48 |
used to maintain mapping between movie, shop and Entry | public MovieRentingSystem(int n, int[][] entries) {
cheapestUnrentedShops = new HashMap();
cheapestRentedMovies = new TreeSet<int []>((a,b) -> a[2] == b[2] ? (a[0] == b[0] ? a[1] - b[1] : a[0] - b[0]) : a[2] - b[2]);
movieToShopToEntry = new HashMap();
for(int []entry: entries){
int shop = entry[0];
int movie = entry[1];
Map<Integer, int []> hm = movieToShopToEntry.getOrDefault(movie, new HashMap());
hm.put(shop, entry);
movieToShopToEntry.put(movie, hm);
TreeSet<int []> ts = cheapestUnrentedShops.getOrDefault(movie, new TreeSet<int []>((a,b) -> a[2] == b[2] ? a[0] - b[0] : a[2] - b[2]));
ts.add(entry);
cheapestUnrentedShops.put(movie, ts);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) {\n\t\tHashMap<Integer, Movil> moviles = new HashMap<Integer, Movil>();\r\n\t\t\r\n\t\t/*\r\n\t\t//Utilizando \"var\" como en C#\r\n\t\tvar movilJuan = new Movil(111, 4, \"Samsung\", 4);\r\n\t\tvar movilMaria = new Movil(232, 6, \"Apple\", 4);\r\n\t\tvar movilPedro = new Movi... | [
"0.55342114",
"0.5373424",
"0.53349394",
"0.5324831",
"0.53115493",
"0.5233518",
"0.51531744",
"0.5087328",
"0.5084645",
"0.5083065",
"0.5080619",
"0.5032261",
"0.5013784",
"0.49902916",
"0.4969226",
"0.49654138",
"0.4961846",
"0.49493074",
"0.4928639",
"0.49270943",
"0.49182... | 0.548453 | 1 |
Test of isRut method, of class Entradas. | @Test
public void testIsRut() {
System.out.println("isRut");
String rut = "19.208.616-7";
boolean expResult = false;
boolean result = Entradas.isRut(rut);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isRSU() { return isRSU; }",
"@Test\n public void testNuevaLr() {\n System.out.println(\"nuevaLr\");\n Alimento a = new Alimento(\"nom1\", \"inst1\", \"tempC1\");\n String uMedida = \"u1\";\n float cantidad = 3.0F;\n Receta instance = new Receta();\n boo... | [
"0.64333516",
"0.6355556",
"0.61712396",
"0.6138846",
"0.61179346",
"0.6052615",
"0.5972634",
"0.5877821",
"0.5856574",
"0.5848803",
"0.5827389",
"0.5783025",
"0.5767358",
"0.5766264",
"0.57176906",
"0.57015103",
"0.567234",
"0.56476516",
"0.56402135",
"0.56267315",
"0.561646... | 0.7928583 | 0 |
Test of isNombre method, of class Entradas. | @Test
public void testIsNombre() {
System.out.println("isNombre");
String Nom = "Alfred";
Entradas instance = new Entradas();
boolean expResult = false;
boolean result = instance.isNombre(Nom);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n\tpublic void testLecturaNombre() {\n\t\tassertTrue(!esquemaReal.getNombrePatron().equals(\"\"));\n\t}",
"@Test\n\tpublic void testDarNombre()\n\t{\n\t\tassertEquals(\"El nombre esperado es Germán.\", \"Germán\", paciente.darNombre());\n\t}",
"@Test\n public void testIsApellido_Materno() {\n S... | [
"0.7426499",
"0.70815796",
"0.6884864",
"0.68585324",
"0.67618114",
"0.67568594",
"0.6713444",
"0.669975",
"0.66891664",
"0.6672074",
"0.65319246",
"0.6524987",
"0.64476216",
"0.6408214",
"0.6379629",
"0.63521695",
"0.63331646",
"0.6321231",
"0.63210356",
"0.63099253",
"0.623... | 0.8093563 | 0 |
Test of isApellido_Paterno method, of class Entradas. | @Test
public void testIsApellido_Paterno() {
System.out.println("isApellido_Paterno");
String AP = "ulfric";
Entradas instance = new Entradas();
boolean expResult = false;
boolean result = instance.isApellido_Paterno(AP);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n\tpublic void testDarApellido()\n\t{\n\t\tassertEquals(\"El apellido esperado es Romero.\", \"Romero\", paciente.darApellido());\n\t}",
"@Test\n public void testIsApellido_Materno() {\n System.out.println(\"isApellido_Materno\");\n String AM = \"Proud\";\n Entradas instance = new E... | [
"0.68822724",
"0.6828749",
"0.67537993",
"0.6713468",
"0.625542",
"0.6180176",
"0.61630195",
"0.6161732",
"0.60451365",
"0.6015332",
"0.60152924",
"0.5990691",
"0.5976951",
"0.58884597",
"0.5860053",
"0.5858057",
"0.58353674",
"0.583018",
"0.5827894",
"0.5808816",
"0.57800347... | 0.77244335 | 0 |
Test of isApellido_Materno method, of class Entradas. | @Test
public void testIsApellido_Materno() {
System.out.println("isApellido_Materno");
String AM = "Proud";
Entradas instance = new Entradas();
boolean expResult = false;
boolean result = instance.isApellido_Materno(AM);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testIsApellido_Paterno() {\n System.out.println(\"isApellido_Paterno\");\n String AP = \"ulfric\";\n Entradas instance = new Entradas();\n boolean expResult = false;\n boolean result = instance.isApellido_Paterno(AP);\n assertEquals(expResult, result... | [
"0.6679932",
"0.65841174",
"0.6476518",
"0.6451673",
"0.62969905",
"0.62313503",
"0.60451174",
"0.6029969",
"0.6018097",
"0.6013956",
"0.59560007",
"0.59081894",
"0.5889298",
"0.5887064",
"0.58830017",
"0.58753604",
"0.58696735",
"0.5867998",
"0.5832595",
"0.5831391",
"0.5796... | 0.7140544 | 0 |
Test of isEmail method, of class Entradas. | @Test
public void testIsEmail() {
System.out.println("isEmail");
String em = "alguien@algo.com";
Entradas instance = new Entradas();
boolean expResult = false;
boolean result = instance.isEmail(em);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean hasEmail();",
"boolean hasEmail();",
"boolean hasEmail();",
"boolean hasEmail();",
"boolean hasEmail();",
"boolean isEmailRequired();",
"boolean hasUserEmail();",
"@Test\n\t\tvoid givenEmail_CheckForValidationForEmail_RetrunTrue() {\n\t\t\tboolean result = ValidateUserDetails.validateEmails(\... | [
"0.79313123",
"0.79313123",
"0.79313123",
"0.79313123",
"0.79313123",
"0.76316",
"0.7353981",
"0.72750676",
"0.72708446",
"0.72268367",
"0.71987593",
"0.71743566",
"0.7158544",
"0.7156733",
"0.7023853",
"0.7023853",
"0.7023853",
"0.7023853",
"0.7011804",
"0.6988904",
"0.69706... | 0.838604 | 0 |
Test of isTelefono method, of class Entradas. | @Test
public void testIsTelefono() {
System.out.println("isTelefono");
int tel = 123456789;
Entradas instance = new Entradas();
boolean expResult = false;
boolean result = instance.isTelefono(tel);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean validarTelefonos() {\n\t\treturn telefonos != null && telefonos.length == 2;\n\t}",
"public boolean validarTelefono(String telefono){\n boolean isTelefono = true;\n isTelefono = validarLong(telefono);\n if(isTelefono){\n isTelefono = telefono.length()<15 && telefono... | [
"0.69667006",
"0.6908689",
"0.6734715",
"0.6722924",
"0.67033964",
"0.6640122",
"0.6551431",
"0.6513007",
"0.63710284",
"0.6355595",
"0.6325817",
"0.6294061",
"0.6276765",
"0.62695414",
"0.62592757",
"0.62530416",
"0.62365127",
"0.6195709",
"0.6129969",
"0.6105351",
"0.609733... | 0.80055165 | 0 |
Test of isMonto method, of class Entradas. | @Test
public void testIsMonto() {
System.out.println("isMonto");
int money = 1000000;
Entradas instance = new Entradas();
boolean expResult = false;
boolean result = instance.isMonto(money);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n\tpublic void testMonto1() {\n\n\t\tSystem.out.println(\" la cantidad introducida es menor de 1\"\n\t\t\t\t+ \"monto1: equivalencia: si el monto es menor de 1,ahora 0, el mensaje seria:\\n\");\n\t\tint cantidad = 0;\n\n\t\tString expResult = \"Error: La cantidad introducida es menor de 1\";\n\t\tString res... | [
"0.695648",
"0.6621337",
"0.64287585",
"0.62928915",
"0.62492996",
"0.6133738",
"0.61177355",
"0.603015",
"0.592576",
"0.58206266",
"0.5786982",
"0.5770768",
"0.57647234",
"0.57630587",
"0.5751455",
"0.5740243",
"0.57184577",
"0.5714145",
"0.57108694",
"0.5703117",
"0.5682123... | 0.80690217 | 0 |
Test of isValidarFecha method, of class Entradas. | @Test
public void testIsValidarFecha() {
System.out.println("isValidarFecha");
String fecha = "06/09/2018";
boolean expResult = true;
boolean result = Entradas.isValidarFecha(fecha);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Boolean validarFecha(LocalDate fechaIngresada);",
"public boolean validarFecha(LocalDate fecha) { \n // se comprueba que la fecha sea anterior o igual a la actual\n return fecha.isBefore(LocalDate.now()) || fecha.isEqual(LocalDate.now());\n }",
"public boolean validarFecha(Date fec... | [
"0.7849464",
"0.75405604",
"0.74763864",
"0.7330046",
"0.730225",
"0.72779644",
"0.710609",
"0.70735997",
"0.70118517",
"0.6972466",
"0.6946893",
"0.69318986",
"0.68432844",
"0.6839012",
"0.6776626",
"0.67107546",
"0.6676161",
"0.66395783",
"0.65831566",
"0.65560335",
"0.6555... | 0.8252578 | 0 |
Use AgentListResponse.newBuilder() to construct. | private AgentListResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Builder setListResponse(edu.usfca.cs.dfs.StorageMessages.ListResponse value) {\n if (listResponseBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n msg_ = value;\n onChanged();\n } else {\n listResponseBu... | [
"0.5830577",
"0.5824203",
"0.5763317",
"0.5728772",
"0.54754245",
"0.53072184",
"0.524849",
"0.5211073",
"0.5211073",
"0.5160566",
"0.51238847",
"0.4986003",
"0.49839762",
"0.49735034",
"0.4931963",
"0.4914954",
"0.4904375",
"0.48860452",
"0.4865652",
"0.48244134",
"0.4813584... | 0.7676625 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.