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 |
|---|---|---|---|---|---|---|
Stores all owners in an arrayList only if they do not already exist in the arrayList | public void printOwners(){
ArrayList<String> ownerList = new ArrayList<String>();
for(RegistrationPlate plates: this.registrationList.keySet()){
if(!ownerList.contains(this.registrationList.get(plates)))
ownerList.add(this.registrationList.get(plates));
}
printAllOwners(ownerList);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setOwnerList(Collection<OwnerModel> ownerList)\r\n\t{\r\n\t\tthis.ownerList = ownerList;\r\n\t}",
"public OwnerList()\n {\n ownerList = new ArrayList<>();\n }",
"@Override\n protected void onCreate(KeyList<Ujo> list, InnerDataStore<Ujo> innerData) throws IllegalStateException {\n ... | [
"0.6049782",
"0.5878065",
"0.5613277",
"0.5512501",
"0.54950976",
"0.5407147",
"0.528551",
"0.52444434",
"0.51662934",
"0.51627034",
"0.51577324",
"0.5147139",
"0.5038",
"0.5031568",
"0.50169015",
"0.5016347",
"0.5002089",
"0.49741402",
"0.4948666",
"0.49109623",
"0.49068448"... | 0.5751105 | 2 |
Prints out all unique owners | private void printAllOwners(ArrayList<String> ownerList){
for(int i = 0; i < ownerList.size(); i++){
System.out.println(ownerList.get(i));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void printOwners(){\n ArrayList<String> ownerList = new ArrayList<String>();\n\n for(RegistrationPlate plates: this.registrationList.keySet()){\n if(!ownerList.contains(this.registrationList.get(plates)))\n ownerList.add(this.registrationList.get(plates));\n }\... | [
"0.7953477",
"0.6680996",
"0.6651351",
"0.6367799",
"0.63625026",
"0.62888306",
"0.6217204",
"0.619739",
"0.61909777",
"0.61285865",
"0.61285865",
"0.6066172",
"0.60347384",
"0.6007689",
"0.598002",
"0.59741354",
"0.592911",
"0.5913579",
"0.5887315",
"0.58827865",
"0.5851176"... | 0.7301542 | 1 |
Creates an instance of the adapter factory. | public ComponentAdapterFactory()
{
if (modelPackage == null)
{
modelPackage = ComponentPackage.eINSTANCE;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public LibraryAdapterFactory() {\r\n\t}",
"public static TypeAdapterFactory create() {\n return new AutoValueGson_MyTypeAdapterFactory();\n }",
"Builder adapterFactory(TypeAdapterFactory factory);",
"public AdapterFactory getAdapterFactory()\n {\n return adapterFactory;\n }",
"public Decl... | [
"0.7249992",
"0.7110674",
"0.68894076",
"0.66034395",
"0.65651506",
"0.65610856",
"0.6485339",
"0.6399168",
"0.6395684",
"0.637993",
"0.6320026",
"0.61370915",
"0.6113887",
"0.60633504",
"0.5996924",
"0.5993408",
"0.5991259",
"0.59895295",
"0.5981399",
"0.59707326",
"0.596523... | 0.0 | -1 |
Returns whether this factory is applicable for the type of the object. This implementation returns true if the object is either the model's package or is an instance object of the model. | @Override
public boolean isFactoryForType(Object object)
{
if (object == modelPackage)
{
return true;
}
if (object instanceof EObject)
{
return ((EObject)object).eClass().getEPackage() == modelPackage;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean isFactoryForType(Object object) {\n if (object == modelPackage) {\n return true;\n }\n if (object instanceof EObject) {\n return ((EObject)object).eClass().getEPackage() == modelPackage;\n }\n return false;\n }",
"@Override... | [
"0.75941044",
"0.7589447",
"0.7581897",
"0.75470054",
"0.75470054",
"0.75470054",
"0.75470054",
"0.75470054",
"0.75470054",
"0.75470054",
"0.75470054",
"0.75470054",
"0.75470054",
"0.75470054",
"0.75470054",
"0.75470054",
"0.75470054",
"0.75470054",
"0.75470054",
"0.75470054",
... | 0.7489246 | 42 |
Creates an adapter for the target. | @Override
public Adapter createAdapter(Notifier target)
{
return modelSwitch.doSwitch((EObject)target);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Adapter createAdapter(Notifier target) {\n\t\treturn (Adapter)modelSwitch.doSwitch((EObject)target);\n\t}",
"@Override\n public Adapter createAdapter(Notifier target) {\n return modelSwitch.doSwitch((EObject)target);\n }",
"@Override\n\tpublic Adapter createAdapter(Notifier target) {\n\t\tr... | [
"0.7459274",
"0.68758494",
"0.67918706",
"0.67918706",
"0.67918706",
"0.67918706",
"0.67918706",
"0.67918706",
"0.67918706",
"0.67918706",
"0.67918706",
"0.67918706",
"0.67918706",
"0.67918706",
"0.67918706",
"0.67918706",
"0.67918706",
"0.67918706",
"0.67918706",
"0.67918706",... | 0.6761169 | 34 |
Creates a new adapter for the default case. This default implementation returns null. | public Adapter createEObjectAdapter()
{
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\t\t\tprotected IAdapterFactory getDefaultAdapterFactory(Object type) {\n\t\t\t\treturn defaultAdapterFactory;\n\t\t\t}",
"@Override\n\t\tpublic <T> T getAdapter(Class<T> adapter) {\n\t\t\treturn null;\n\t\t}",
"@Override\n\tpublic Object getAdapter(Class adapter) {\n\t\treturn null;\n\t}",
"@Over... | [
"0.69044083",
"0.6790533",
"0.6787222",
"0.6748163",
"0.6748163",
"0.6607967",
"0.64543974",
"0.64543974",
"0.64543974",
"0.64543974",
"0.64543974",
"0.64543974",
"0.6427404",
"0.6427404",
"0.64170116",
"0.6408954",
"0.6408954",
"0.6408954",
"0.6408954",
"0.6408954",
"0.64089... | 0.6458888 | 13 |
Creates a new instance of this class using the given parameters. | public SystemModel2FileFilter(final Configuration configuration, final IProjectContext projectContext) {
super(configuration, projectContext);
this.outputFnHTML = configuration.getPathProperty(CONFIG_PROPERTY_NAME_HTML_OUTPUT_FN);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private Instantiation(){}",
"Reproducible newInstance();",
"Instance createInstance();",
"public Parameters() {\n\t}",
"public CMObject newInstance();",
"public ParameterizedInstantiateFactory() {\r\n super();\r\n }",
"public void create(){}",
"public T newInstance();",
"public ProductoCr... | [
"0.678845",
"0.67730236",
"0.6601447",
"0.6406006",
"0.6400361",
"0.63089955",
"0.6257244",
"0.61269534",
"0.6085336",
"0.60757774",
"0.6051267",
"0.60366774",
"0.603467",
"0.6005592",
"0.5934712",
"0.5934712",
"0.59226054",
"0.5921086",
"0.5895139",
"0.586138",
"0.58543855",... | 0.0 | -1 |
The method shows a login dialog for a given URI. The user field is taken from the URI if a user is present in the URI. In this case the user is not editable. | public static UserPasswordCredentials login(Shell parent, URIish uri) {
LoginDialog dialog = new LoginDialog(parent, uri);
if (dialog.open() == Window.OK) {
UserPasswordCredentials credentials = dialog.getCredentials();
if (credentials != null && dialog.getStoreInSecureStore())
SecureStoreUtils.storeCredentials(credentials, uri);
return credentials;
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void login(ActionEvent e) throws IOException {\r\n\t\t\r\n \tString username = loginuser.getText().trim();\r\n \t//if user is admin, change to userlist screen\r\n \tif (username.equals(\"admin\")) {\r\n \tPhotos.userlistscreen();\r\n \t} else {\r\n \t\tUser user = currentAdmin.findUser... | [
"0.6463621",
"0.63929445",
"0.6282286",
"0.60754555",
"0.60457337",
"0.601991",
"0.6017432",
"0.59937906",
"0.5970078",
"0.59588647",
"0.5957952",
"0.58972424",
"0.5884937",
"0.5859386",
"0.5855792",
"0.5852705",
"0.5834672",
"0.58320993",
"0.58209836",
"0.58016425",
"0.57936... | 0.61004615 | 3 |
The method shows a change credentials dialog for a given URI. The user field is taken from the URI if a user is present in the URI. In this case the user is not editable. | public static UserPasswordCredentials changeCredentials(Shell parent,
URIish uri) {
LoginDialog dialog = new LoginDialog(parent, uri);
dialog.setChangeCredentials(true);
UserPasswordCredentials oldCredentials = SecureStoreUtils
.getCredentialsQuietly(uri);
if (oldCredentials != null)
dialog.setOldUser(oldCredentials.getUser());
if (dialog.open() == Window.OK) {
UserPasswordCredentials credentials = dialog.getCredentials();
if (credentials != null)
SecureStoreUtils.storeCredentials(credentials, uri);
return credentials;
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void newPasswordForService(URI serviceURI) {\n\t\t/*\n\t\t * As this method can be called from outside of Credential Manager UI,\n\t\t * e.g. from wsdl-activity-ui or rshell-activity-ui to pop up a dialog\n\t\t * to ask the user for username and password, we also want to make sure\n\t\t * the main Credentia... | [
"0.6144896",
"0.5892288",
"0.5859414",
"0.55764157",
"0.5511585",
"0.5464661",
"0.5458301",
"0.5416133",
"0.5406961",
"0.539406",
"0.5378256",
"0.53369105",
"0.53346187",
"0.532736",
"0.52908516",
"0.5282328",
"0.5280629",
"0.52704936",
"0.52571875",
"0.5255841",
"0.5240812",... | 0.6768007 | 0 |
This is the interface through which the Manager will start and stop the NotificationCatcher. When the Manager is instantiated, it can in turn instantiate a named implementation of the NotificationCatcher. Since the NotificationCatcher holds on to system resources (i.e., network ports) for long periods of time, the NotificationCatcher should offer a shutdown() method that can be invoked by the Manager. Similarly, if the NotificationCatcher needs to perform initialization that must be done outside the constructor, the NotificationCatcher should offer a startup() method that can be invoked by the Manager. The device sends events (Notifications) to the NotificationCatcher. The NotificationCatcher collects them from the network, validates the device's certificate on the HTTPS transport used to deliver the notification, creates Notification objects from the raw message as obtained from the HTTPS transport, and places the Notification in the Manager's queue. The NotificationCatcher should maintain proper order of the Notifications. The NotificationCatcher sends acknowledgements to the device when it successfully receives a notification. The device uses this acknowledgement to guarantee delivery of all notifications to the NotificationCatcher. HTTPS will be used as the transport to deliver the notifications. The notifications will be in CBE format, and wrapped in a SOAP message for delivery over the transport. We need a way to guarantee event message integrity, meaning that the event came from a real device that we are managing, and is not an injection by a malicious 3rd party. If we did not have event integrity then the Manager could be vulnerable to a DoS attack, causing it to refetch a lot of data from the device that is not necessary. The integrity will be performed by using SSL for the transport. The device should present to the NotificationCatcher a certificate that is signed by a certificate authority that the NotificationCatcher trusts. The NotificationCatcher should have a default list of trusted CAs that work with the default certificates in DataPower devices. There should be a way for the customer to configure the NotificationCatcher to recognize a custom list of trusted CAs, which would match the CAs used to sign the device certificates. If the transport fails the integrity test, then the NotificationCatcher should discard the notification and optionally create a log entry. This should be an interface instead of a class because more than one implementation is expected. | public interface NotificationCatcher {
public static final String COPYRIGHT_2009_2010 = Constants.COPYRIGHT_2009_2010;
static final String SCM_REVISION = "$Revision: 1.2 $"; //$NON-NLS-1$
/**
* When the Manager is started, the Manager will invoke this method. The
* Manager needs a way to start the NotificationCatcher when the Manager
* starts. After that point, the NotificationCatcher can place Notifications
* on the Manager's queue. This method will allow the NotificationCatcher to
* do any initialization to receive events from devices (such as listening
* on a network socket) after it has been instantiated by the
* NotificationCatcherFactory.
*
* @see NotificationCatcherFactory
* @see Manager
*/
public void startup() throws AMPException;
/**
* When the Manager is shutdown, the Manager will invoke this method. For
* any resources that were obtained via the NotificationCatcher's
* constructor or {@link #startup()}, this method will allow those
* resources (such as network sockets) to be released when the Manager is
* shutdown.
*
* @see Manager
*/
public void shutdown();
/**
* Get the URL that this NotificationCatcher listens on so Devices know
* where to post Notifications. This URL is used when a subscription request (
* {@link Commands#subscribeToDevice(DeviceContext, String, StringCollection, URL)})
* is sent to a device so that the device knows where to send the
* notifications (events).
*
* @return the URL that this NotificationCatcher listens on so Devices know
* where to post Notifications. This value will be used when sending
* subscription requests to Devices. This may be an https or http
* url. Typically, the path part of the URL will not be relevant,
* the relevant parts are the protocol, hostname, and port.
*/
public URL getURL();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public NotificationService() {\n super(\"NotificationService\");\n }",
"public interface Notifier {\r\n\r\n public abstract void initialize();\r\n public abstract void sendNotification(Event event) throws NotifierException;\r\n public abstract SparrowNotifierConfig getConfig();\r\n public abstract ... | [
"0.666236",
"0.6551091",
"0.65102583",
"0.65018004",
"0.6292859",
"0.6226859",
"0.6151629",
"0.6111744",
"0.6009311",
"0.59682995",
"0.5854475",
"0.5847317",
"0.5809837",
"0.578947",
"0.5773947",
"0.5768769",
"0.5745486",
"0.5737327",
"0.5737327",
"0.57207125",
"0.57045794",
... | 0.80951303 | 0 |
$NONNLS1$ When the Manager is started, the Manager will invoke this method. The Manager needs a way to start the NotificationCatcher when the Manager starts. After that point, the NotificationCatcher can place Notifications on the Manager's queue. This method will allow the NotificationCatcher to do any initialization to receive events from devices (such as listening on a network socket) after it has been instantiated by the NotificationCatcherFactory. | public void startup() throws AMPException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public synchronized void startNotificationListener() {\n\t\tif ((notificationThread != null) && notificationThread.isAlive()) {\n\t\t\tthrow new IllegalStateException(\"The notification listener is already running.\");\n\t\t}\n\t\t\n\t\tif (smtpConfig != null) {\n\t\t\tnotificationThread = new Thread( new Runnable... | [
"0.69507605",
"0.69491285",
"0.6528895",
"0.6392935",
"0.6326857",
"0.616864",
"0.615034",
"0.607628",
"0.6043532",
"0.60303766",
"0.6029723",
"0.59805137",
"0.592152",
"0.58750874",
"0.5867886",
"0.58652043",
"0.58424217",
"0.5821348",
"0.5815117",
"0.5792428",
"0.5771721",
... | 0.0 | -1 |
crear vista y viewholder | @Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
LayoutInflater layoutInflater = LayoutInflater.from(context);
View viewCelda;
FragmentActivity unaActivity = (FragmentActivity) context;
FragmentManager fragmentManager = (FragmentManager) unaActivity.getSupportFragmentManager();
FragmentBusqueda fragmentBusqueda = (FragmentBusqueda) fragmentManager.findFragmentByTag("FragmentBuscador");
if (fragmentBusqueda != null && fragmentBusqueda.isVisible()) {
viewCelda = layoutInflater.inflate(R.layout.detalle_celda_busqueda, parent, false);
} else {
viewCelda = layoutInflater.inflate(R.layout.detalle_celda, parent, false);
}
FormatoViewHolder peliculasViewHolder = new FormatoViewHolder(viewCelda);
viewCelda.setOnClickListener(this);
return peliculasViewHolder;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public ViewHolder(View itemView) {\n tvGrupo = (TextView) itemView.findViewById(R.id.tvGrupo);\n tvNCD = (TextView) itemView.findViewById(R.id.tvNCD);\n tvACD = (TextView) itemView.findViewById(R.id.tvACD);\n ivCD = (ImageView) itemView.findViewById(R.id.ivCD);\n ... | [
"0.69834083",
"0.6978602",
"0.6905135",
"0.6837441",
"0.6671022",
"0.66662794",
"0.6660435",
"0.66389626",
"0.65238655",
"0.65183675",
"0.65144455",
"0.6495591",
"0.6489402",
"0.64833796",
"0.6472317",
"0.64536613",
"0.64507765",
"0.6435414",
"0.64271736",
"0.6424313",
"0.642... | 0.0 | -1 |
Gref = new Firebase(" | public void cekNotif(){
try{
Gref.addChildEventListener(new ChildEventListener() {
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String s) {
String a = dataSnapshot.child("to_id").getValue().toString();
if (a.equals(BerandaActivity.id)){
Toast.makeText(context.getApplicationContext(),"Ada pesan komunitas baru",Toast.LENGTH_SHORT).show();
}
}
@Override
public void onChildChanged(DataSnapshot dataSnapshot, String s) {
}
@Override
public void onChildRemoved(DataSnapshot dataSnapshot) {
}
@Override
public void onChildMoved(DataSnapshot dataSnapshot, String s) {
}
@Override
public void onCancelled(FirebaseError firebaseError) {
}
});}
catch (Exception e){
Log.e("eror add child : ",""+e);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void iniciarFirebase(){\n FirebaseApp.initializeApp(getApplicationContext());\n firebaseDatabase = FirebaseDatabase.getInstance();\n databaseReference = firebaseDatabase.getReference();\n }",
"private FirebaseUtil(){}",
"private void initFirebase() {\n //инициализируем на... | [
"0.76502347",
"0.74678916",
"0.7361463",
"0.73327595",
"0.72958595",
"0.7293901",
"0.6987904",
"0.6890367",
"0.6879775",
"0.6720616",
"0.66303587",
"0.65445375",
"0.6525206",
"0.6454002",
"0.6434519",
"0.64095503",
"0.632037",
"0.6273643",
"0.6210153",
"0.61488974",
"0.607499... | 0.0 | -1 |
Inflate the layout for this fragment | @Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_wallpaper, container, false);
folderTitle = view.findViewById(R.id.folder_title);
isFavorite = view.findViewById(R.id.is_favorite);
wallpaperGrid = view.findViewById(R.id.grid_view);
addWallpaperButton = view.findViewById(R.id.add_wallpaper);
//We take arguments passed to the fragment and set wallpaperDirectory Object for this fragment
//and set title to whatever wallpaper Directory title is
wallpaperDirectory = new WallpaperDirectory();
wallpaperDirectory.Title = getArguments().getString(FOLDER_TITLE);
wallpaperDirectory.PreviewUrl = getArguments().getString(FOLDER_PREVIEW);
folderTitle.setText(wallpaperDirectory.Title);
//we get sharedPreference Object for both settings and favorites
sharedPreferences =getActivity().getSharedPreferences(PrefsKeys.SETTINGS,Context.MODE_PRIVATE);
SharedPreferences favPreferences = getActivity().getSharedPreferences(PrefsKeys.FAVORITES,Context.MODE_PRIVATE);
//we check if current folder is favorited then we set isFavorite to checked
isFavorite.setChecked(favPreferences.contains(wallpaperDirectory.Title));
isFavorite.setOnCheckedChangeListener((buttonView, isChecked) -> {
isFavorite.setEnabled(false);
//we update the value whether or not isFavorite is checked
if(isChecked){
favPreferences.edit().putString(wallpaperDirectory.Title,wallpaperDirectory.PreviewUrl).apply();
}else{
favPreferences.edit().remove(wallpaperDirectory.Title).apply();
}
isFavorite.setEnabled(true);
});
return view;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_main_allinfo, container, false);\n }",
"@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup... | [
"0.6739604",
"0.67235583",
"0.6721706",
"0.6698254",
"0.6691869",
"0.6687986",
"0.66869223",
"0.6684548",
"0.66766286",
"0.6674615",
"0.66654444",
"0.66654384",
"0.6664403",
"0.66596216",
"0.6653321",
"0.6647136",
"0.66423255",
"0.66388357",
"0.6637491",
"0.6634193",
"0.66251... | 0.0 | -1 |
TODO Autogenerated method stub | protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.update);
setContentView(R.layout.new_activity);
et_title=(EditText) findViewById(R.id.et_title);
et_content=(EditText) findViewById(R.id.et_content);
tiem=(TextView) findViewById(R.id.tiem);
tv_tiem=(TextView) findViewById(R.id.tv_tiem);
but_set=(Button) findViewById(R.id.but_set);
final Calendar c=Calendar.getInstance();
calendar=Calendar.getInstance();
helper = new MyDBHelper(Update_Activity.this,Globle.DB_NAME, null,Globle.VERSION);
set_date=new SimpleDateFormat("yyyy/MM/dd hh:mm").format(new Date());
tiem.setText(set_date);
//查詢 獲取時間段
but_set.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
DatePickerDialog dialog=new DatePickerDialog(Update_Activity.this,new OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year, int monthOfYear,
int dayOfMonth) {
// TODO Auto-generated method stub
//把用户设置的时间存储
calendar.set(Calendar.YEAR,year);
calendar.set(Calendar.MONTH,monthOfYear);
calendar.set(Calendar.DAY_OF_MONTH,dayOfMonth);
date=year+"/"+monthOfYear+"/"+dayOfMonth;
TimePickerDialog time_dialog=new TimePickerDialog(Update_Activity.this,new OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
// TODO Auto-generated method stub
calendar.set(Calendar.HOUR_OF_DAY,hourOfDay);
calendar.set(Calendar.MINUTE,minute);
calendar.set(Calendar.SECOND,0);
date=new SimpleDateFormat("yyyy/MM/dd hh:mm").format(calendar.getTimeInMillis());
tv_tiem.setText(date);
}
},c.get(Calendar.HOUR_OF_DAY),c.get(Calendar.MINUTE),true);
time_dialog.show();
}
}, c.get(Calendar.YEAR),c.get(Calendar.MONTH),c.get(Calendar.DATE));
dialog.show();
}
});
} | {
"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 onClick(View v) {
DatePickerDialog dialog=new DatePickerDialog(Update_Activity.this,new OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year, int monthOfYear,
int dayOfMonth) {
// TODO Auto-generated method stub
//把用户设置的时间存储
calendar.set(Calendar.YEAR,year);
calendar.set(Calendar.MONTH,monthOfYear);
calendar.set(Calendar.DAY_OF_MONTH,dayOfMonth);
date=year+"/"+monthOfYear+"/"+dayOfMonth;
TimePickerDialog time_dialog=new TimePickerDialog(Update_Activity.this,new OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
// TODO Auto-generated method stub
calendar.set(Calendar.HOUR_OF_DAY,hourOfDay);
calendar.set(Calendar.MINUTE,minute);
calendar.set(Calendar.SECOND,0);
date=new SimpleDateFormat("yyyy/MM/dd hh:mm").format(calendar.getTimeInMillis());
tv_tiem.setText(date);
}
},c.get(Calendar.HOUR_OF_DAY),c.get(Calendar.MINUTE),true);
time_dialog.show();
}
}, c.get(Calendar.YEAR),c.get(Calendar.MONTH),c.get(Calendar.DATE));
dialog.show();
} | {
"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 onTimeSet(TimePicker view, int hourOfDay, int minute) {
calendar.set(Calendar.HOUR_OF_DAY,hourOfDay);
calendar.set(Calendar.MINUTE,minute);
calendar.set(Calendar.SECOND,0);
date=new SimpleDateFormat("yyyy/MM/dd hh:mm").format(calendar.getTimeInMillis());
tv_tiem.setText(date);
} | {
"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 boolean onCreateOptionsMenu(Menu menu) {
MenuItem item1=menu.add("保存");
MenuItem item2=menu.add("取消");
item1.setIcon(R.drawable.png_0044);
item2.setIcon(R.drawable.png_0652);
item1.setOnMenuItemClickListener(new OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
// TODO Auto-generated method stub
SQLiteDatabase db = helper.getWritableDatabase();
ContentValues values = new ContentValues();
values.put(Globle.TITLE,et_title.getText().toString());
values.put(Globle.CONTENT,et_content.getText().toString());
values.put(Globle.SET_ITEM,set_date);
values.put(Globle.ATTACK_TIEM,date);
String where=Globle._ID+"="+_id;
int i=DBUtil.update(db, Globle.TABLE_NAME,values, where);
if(i>=1){
Toast.makeText(Update_Activity.this,"修改成功 ",Toast.LENGTH_SHORT).show();
//
AlarmManager alarmManager=(AlarmManager) getSystemService(ALARM_SERVICE);
Intent intent=new Intent(Update_Activity.this,Ring_Activity.class);
intent.putExtra("text",et_content.getText().toString());
count++;
System.out.println(""+count);
PendingIntent p_intent=PendingIntent.getActivity(Update_Activity.this,count,intent,PendingIntent.FLAG_UPDATE_CURRENT);
alarmManager.set(AlarmManager.RTC_WAKEUP,calendar.getTimeInMillis(),p_intent);
Intent intent1=new Intent(Update_Activity.this,MainActivity.class);
startActivity(intent1);
}else{
Toast.makeText(Update_Activity.this,"修改失败",Toast.LENGTH_SHORT).show();
Intent intent1=new Intent(Update_Activity.this,MainActivity.class);
startActivity(intent1);
}
return false;
}
});
return super.onCreateOptionsMenu(menu);
} | {
"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 boolean onMenuItemClick(MenuItem item) {
SQLiteDatabase db = helper.getWritableDatabase();
ContentValues values = new ContentValues();
values.put(Globle.TITLE,et_title.getText().toString());
values.put(Globle.CONTENT,et_content.getText().toString());
values.put(Globle.SET_ITEM,set_date);
values.put(Globle.ATTACK_TIEM,date);
String where=Globle._ID+"="+_id;
int i=DBUtil.update(db, Globle.TABLE_NAME,values, where);
if(i>=1){
Toast.makeText(Update_Activity.this,"修改成功 ",Toast.LENGTH_SHORT).show();
//
AlarmManager alarmManager=(AlarmManager) getSystemService(ALARM_SERVICE);
Intent intent=new Intent(Update_Activity.this,Ring_Activity.class);
intent.putExtra("text",et_content.getText().toString());
count++;
System.out.println(""+count);
PendingIntent p_intent=PendingIntent.getActivity(Update_Activity.this,count,intent,PendingIntent.FLAG_UPDATE_CURRENT);
alarmManager.set(AlarmManager.RTC_WAKEUP,calendar.getTimeInMillis(),p_intent);
Intent intent1=new Intent(Update_Activity.this,MainActivity.class);
startActivity(intent1);
}else{
Toast.makeText(Update_Activity.this,"修改失败",Toast.LENGTH_SHORT).show();
Intent intent1=new Intent(Update_Activity.this,MainActivity.class);
startActivity(intent1);
}
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
protected void onResume() {
_id=getIntent().getLongExtra(Globle._ID,0);
System.out.println(""+_id);
loadData(_id);
super.onResume();
} | {
"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 |
Passing valid cell phone number | @org.junit.Test
public void testPositiveScenario() {
boolean result = Validation.validateSAPhoneNumber("+27712612199");// function should return true
assertEquals(true, result);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void validateMobileNumber(){\n /*\n Checking For Mobile number\n The Accepted Types Are +00 000000000 ; +00 0000000000 ;+000 0000000000; 0 0000000000 ; 00 0000000000\n */\n Boolean mobileNumber = Pattern.matches(\"^[0]?([+][0-9]{2,3})?[-][6-9]+[0-9]{9}\",getMobileNu... | [
"0.70040077",
"0.6886959",
"0.68506455",
"0.6724417",
"0.6696143",
"0.66611564",
"0.6616211",
"0.66057235",
"0.65191174",
"0.65173656",
"0.65089726",
"0.6491702",
"0.6491702",
"0.6491702",
"0.64861053",
"0.64701706",
"0.643656",
"0.6428982",
"0.6328045",
"0.6306943",
"0.62894... | 0.0 | -1 |
Passing invalid cell phone number | @org.junit.Test
public void testNegativeScenario() {
boolean result = Validation.validateSAPhoneNumber("071261219");// function should return false
assertEquals(false, result);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void validateMobileNumber(){\n /*\n Checking For Mobile number\n The Accepted Types Are +00 000000000 ; +00 0000000000 ;+000 0000000000; 0 0000000000 ; 00 0000000000\n */\n Boolean mobileNumber = Pattern.matches(\"^[0]?([+][0-9]{2,3})?[-][6-9]+[0-9]{9}\",getMobileNu... | [
"0.67350286",
"0.6622877",
"0.65375185",
"0.6524412",
"0.6508565",
"0.6435042",
"0.6426342",
"0.63960224",
"0.63548183",
"0.6342933",
"0.6330115",
"0.6327387",
"0.6304209",
"0.6270749",
"0.6233482",
"0.61416906",
"0.61229545",
"0.6109883",
"0.60648006",
"0.605951",
"0.6032104... | 0.0 | -1 |
create an elevator object?? | abstract void move_elevator(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Elevator() {\n\t\t\n \tsuper(\"Elevator\", RobotConstants.ELEVATOR_P, RobotConstants.ELEVATOR_I, RobotConstants.ELEVATOR_D);\n \t\t\n\t\t// TODO Auto-generated constructor stub\n\t}",
"Elevator() {\n _currentFloor = Floor.FIRST;\n _passengersOnboard = 0;\n _directionOfTravel = D... | [
"0.77969235",
"0.7479101",
"0.7475624",
"0.7423554",
"0.7353566",
"0.72347474",
"0.7213207",
"0.7056723",
"0.69009465",
"0.68263984",
"0.67846864",
"0.6729509",
"0.6596746",
"0.6468195",
"0.6412168",
"0.6409725",
"0.64042073",
"0.6391987",
"0.63160807",
"0.6237688",
"0.622305... | 0.5804266 | 33 |
move up or down depending on its current direction. Given an integer k and an array arr[] representing the destination floors for N people waiting currently at the ground floor and k is the capacity of the elevator i.e. maximum number of people it can hold at the same time. It takes 1 unit time for the elevator to reach any consecutive floor from the current floor. The task is to schedule the elevator in a way to minimize the total time taken to get all the people to their destination floor and then return back to the ground floor. | public void move_elevator() {
// Sort in descending order
int temp;
int n = passengers.size();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void siftDown( int k) \r\n {\r\n int v, j;\r\n \r\n v = h[k];\r\n while(k <= N/2)\r\n {\r\n j = 2k;\r\n if(j>N && dist[h[j]] > dist[h[j+1]])//If the node is > left child\r\n {\r\n ++j;//Increment child \r\n }\r\n... | [
"0.56670624",
"0.5502196",
"0.5493072",
"0.5485768",
"0.54629034",
"0.54601085",
"0.54569376",
"0.5425082",
"0.5379927",
"0.53044313",
"0.52742255",
"0.5252179",
"0.5236943",
"0.5207891",
"0.519288",
"0.5190546",
"0.51818365",
"0.5158599",
"0.5152826",
"0.5146945",
"0.5118187... | 0.46996865 | 98 |
Creates new form MenuTIK | public MenuTIK() {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
}
initComponents();
setResizable(false);
Dimension windowSize = getSize();
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
Point centerPoint = ge.getCenterPoint();
int dx = centerPoint.x - windowSize.width / 2;
int dy = centerPoint.y - windowSize.height / 2;
setLocation(dx, dy);
LoadTabelDataTIK();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void createMenu() {\n deleteMenuGroupError = false;\n createMenuGroupError = true;\n if (menu.createMenu()) {\n updateMenuError = false;\n deleteMenuError = false;\n createMenuError = true;\n } else {\n createMenuError = false;\n ... | [
"0.6965987",
"0.68075514",
"0.67703",
"0.6673377",
"0.6660199",
"0.6564256",
"0.6537275",
"0.64376354",
"0.6366956",
"0.63090175",
"0.6284427",
"0.6283258",
"0.62344325",
"0.62252456",
"0.6191138",
"0.6157892",
"0.6157868",
"0.6088007",
"0.60869586",
"0.6072285",
"0.60653806"... | 0.0 | -1 |
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor. | @SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
btnTambah = new javax.swing.JButton();
btnUbah = new javax.swing.JButton();
btnHapus = new javax.swing.JButton();
btnKeluar = new javax.swing.JButton();
btnRefresh = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
tabelTIK = new javax.swing.JTable();
setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
btnTambah.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N
btnTambah.setText("Tambah Data");
btnTambah.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnTambahActionPerformed(evt);
}
});
btnUbah.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N
btnUbah.setText("Ubah Data");
btnUbah.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnUbahActionPerformed(evt);
}
});
btnHapus.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N
btnHapus.setText("Hapus Data");
btnHapus.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnHapusActionPerformed(evt);
}
});
btnKeluar.setText("Keluar");
btnKeluar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnKeluarActionPerformed(evt);
}
});
btnRefresh.setText("Perbarui Data");
btnRefresh.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnRefreshActionPerformed(evt);
}
});
tabelTIK.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{"Erwin Kurniawan Adidharma", "Erwin", "3578241911950001", "Konghucu", "11-11-1111", null},
{null, null, null, null, null, null},
{null, null, null, null, null, null},
{null, null, null, null, null, null}
},
new String [] {
"Nama Lengkap", "Alias", "No. KTP", "Agama", "Tgl. Lahir", "Tempat Lahir"
}
) {
boolean[] canEdit = new boolean [] {
false, false, false, false, false, false
};
public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit [columnIndex];
}
});
jScrollPane1.setViewportView(tabelTIK);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(btnTambah, javax.swing.GroupLayout.PREFERRED_SIZE, 243, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(btnUbah, javax.swing.GroupLayout.DEFAULT_SIZE, 257, Short.MAX_VALUE)
.addGap(18, 18, 18)
.addComponent(btnHapus, javax.swing.GroupLayout.PREFERRED_SIZE, 243, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(btnRefresh, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnKeluar, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jScrollPane1))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnTambah, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btnUbah, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btnHapus, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 386, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnKeluar)
.addComponent(btnRefresh))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
pack();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Form() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n }",
"public frmRectangulo() {\n initComponents();\n }",
"public form() {\n ... | [
"0.73195183",
"0.7290407",
"0.7290407",
"0.7290407",
"0.72855854",
"0.7248445",
"0.7213232",
"0.72084314",
"0.7195551",
"0.71902007",
"0.71835697",
"0.7158979",
"0.71473545",
"0.70928645",
"0.70807934",
"0.70575565",
"0.6987147",
"0.6976941",
"0.69544566",
"0.69541115",
"0.69... | 0.0 | -1 |
1 = insert , 2 = update , 3 = liat data full dari form Pencarian | private void btnTambahActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnTambahActionPerformed
tambahUbah = 1;
TambahUbahTIK t = new TambahUbahTIK();
t.setVisible(true);
this.dispose();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static int save(Periode p){ \n int status=0; \n try{ \n //membuka koneksi\n Connection con=Koneksi.openConnection();\n //melakukan query database\n PreparedStatement ps=con.prepareStatement( \n \"insert into periode(tahun, awal, akhir) values... | [
"0.65636194",
"0.6562729",
"0.65265477",
"0.6406882",
"0.6406794",
"0.638193",
"0.63772",
"0.6364841",
"0.6245045",
"0.62175655",
"0.6217545",
"0.62164336",
"0.62035197",
"0.6150095",
"0.6142371",
"0.6140854",
"0.61362696",
"0.61136085",
"0.6107918",
"0.60423946",
"0.6035021"... | 0.0 | -1 |
Instantiates a new ufficio tecnico DB. With default connection manager | public UfficioTecnicoDB() {
this(ConnectionManager.getInstance());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public EtiquetaDao() {\n //subiendola en modo Embedded\n this.sql2o = new Sql2o(\"jdbc:h2:~/demojdbc\", \"sa\", \"\");\n createTable();\n //cargaDemo();\n }",
"public DatabaseManager() {\n try {\n con = DriverManager.getConnection(DB_URL, \"root\", \"marko\");\n } catch ... | [
"0.6992907",
"0.6901351",
"0.6833162",
"0.6829978",
"0.68128395",
"0.67881733",
"0.6742413",
"0.6726153",
"0.6665906",
"0.65839034",
"0.65787405",
"0.6573315",
"0.6568859",
"0.65479",
"0.65357316",
"0.65353566",
"0.65293443",
"0.65175635",
"0.6505596",
"0.6498219",
"0.6497733... | 0.83369774 | 0 |
This method inserts a technical office in the database. | @Override
public synchronized int insert(final UfficioTecnico uff)
throws SQLException {
final Connection connection = connectionManager.getConnection();
try {
final PreparedStatement preparedStatement = connection
.prepareStatement(INSERT_UFFICIO_TECNICO);
int i = 1;
preparedStatement.setString(i++, uff.getNome());
preparedStatement.setString(i++, uff.getTel());
preparedStatement.setString(i++, uff.getEmail());
preparedStatement.setString(i, uff.getUbicazione());
return preparedStatement.executeUpdate();
} finally {
connectionManager.freeConnection(connection);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic boolean insertOffice(Map<String, Object> params) {\n\t\treturn false;\n\t}",
"public void saveOffice(Office office) {\n\t\t\n\t}",
"@Override\n\tpublic void insertIPODetail(IPODetail ipo) throws SQLException {\n\t\t\n\t}",
"public void insert(TdiaryArticle obj) throws SQLException {\n\r\n... | [
"0.6370209",
"0.6216741",
"0.5982635",
"0.59812796",
"0.59205294",
"0.5913184",
"0.58676666",
"0.5842587",
"0.5768284",
"0.5730432",
"0.5726654",
"0.5694819",
"0.5692381",
"0.5683116",
"0.5662404",
"0.56598103",
"0.5641161",
"0.56386024",
"0.5629044",
"0.5612701",
"0.5608267"... | 0.5354141 | 60 |
This method allows everyone to get information from the database registered technical offices. | @Override
public List<UfficioTecnico> getAll() throws SQLException {
final Connection connection = connectionManager.getConnection();
try {
final PreparedStatement preparedStatement = connection
.prepareStatement(SELECT_ALL);
final ResultSet rs = preparedStatement.executeQuery();
final List<UfficioTecnico> uffici = new ArrayList<UfficioTecnico>();
while (rs.next()) {
final UfficioTecnico uff = new UfficioTecnico();
uff.setId(rs.getInt("Id"));
uff.setNome(rs.getString("nome"));
uff.setTel(rs.getString("tel"));
uff.setEmail(rs.getString("email"));
uff.setUbicazione(rs.getString("ubicazione"));
uffici.add(uff);
}
return uffici;
} finally {
connectionManager.freeConnection(connection);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@GET\n @Produces(MediaType.APPLICATION_JSON)\n public List<Officer> getOfficer() {\n return officerDao.listar(); \n }",
"public ReturnData queryEncounterForinfo(){\n ReturnData returnData = new ReturnData();\n String [] jsids = {\"03034a63-e8d6-49a4-8e71-58a544b8fca3\",\n ... | [
"0.5689077",
"0.5666572",
"0.54943705",
"0.5467836",
"0.5447199",
"0.54344136",
"0.5387761",
"0.5369641",
"0.5335903",
"0.53311527",
"0.5308171",
"0.5287695",
"0.52717173",
"0.52623135",
"0.5259285",
"0.5248221",
"0.5243422",
"0.5231266",
"0.52115256",
"0.52041626",
"0.520332... | 0.0 | -1 |
This method select the UfficioTecnico by a id from the database given all dates of UfficioTecnico. | @Override
public UfficioTecnico getById(final int aId) throws SQLException {
final Connection connection = connectionManager.getConnection();
UfficioTecnico uff = null;
try {
final PreparedStatement preparedStatement = connection
.prepareStatement(GET_BY_ID);
preparedStatement.setInt(1, aId);
final ResultSet rs = preparedStatement.executeQuery();
if (rs.next()) {
uff = new UfficioTecnico();
uff.setId(rs.getInt("Id"));
uff.setNome(rs.getString("nome"));
uff.setTel(rs.getString("tel"));
uff.setEmail(rs.getString("email"));
uff.setUbicazione(rs.getString("ubicazione"));
}
return uff;
} finally {
connectionManager.freeConnection(connection);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public List<UfficioTecnico> getAll() throws SQLException {\n final Connection connection = connectionManager.getConnection();\n try {\n final PreparedStatement preparedStatement = connection\n .prepareStatement(SELECT_ALL);\n final ResultSet rs ... | [
"0.64369947",
"0.631722",
"0.6166344",
"0.61662704",
"0.6139583",
"0.6118616",
"0.60933125",
"0.60572106",
"0.6056366",
"0.603877",
"0.60337114",
"0.60049015",
"0.59866756",
"0.5986531",
"0.59339285",
"0.5929441",
"0.5893701",
"0.58911926",
"0.5880412",
"0.58768743",
"0.58644... | 0.6826575 | 0 |
INTERNAL: Obtain and return the JTA TransactionManager on this platform. This will be called once when the controller is initialized. | protected TransactionManager acquireTransactionManager() throws Exception {
if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){
try{
Class clazz = (Class) AccessController.doPrivileged(new PrivilegedClassForName(TX_MANAGER_FACTORY_CLASS));
Method method = (Method)AccessController.doPrivileged(new PrivilegedGetMethod(clazz, TX_MANAGER_FACTORY_METHOD, null, false));
return (TransactionManager) AccessController.doPrivileged(new PrivilegedMethodInvoker(method, null, null));
}catch (PrivilegedActionException ex){
if (ex.getCause() instanceof ClassNotFoundException){
throw (ClassNotFoundException)ex.getCause();
}
if (ex.getCause() instanceof NoSuchMethodException){
throw (NoSuchMethodException)ex.getCause();
}
if (ex.getCause() instanceof IllegalAccessException){
throw (IllegalAccessException)ex.getCause();
}
if (ex.getCause() instanceof InvocationTargetException){
throw (InvocationTargetException)ex.getCause();
}
throw (RuntimeException) ex.getCause();
}
}else{
Class clazz = PrivilegedAccessHelper.getClassForName(TX_MANAGER_FACTORY_CLASS);
Method method = PrivilegedAccessHelper.getMethod(clazz, TX_MANAGER_FACTORY_METHOD, null, false);
return (TransactionManager)PrivilegedAccessHelper.invokeMethod(method, null, null);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private TransactionManager obtainTransactionManager()\n {\n TransactionManager tm = ec.getNucleusContext().getJtaTransactionManager();\n if (tm == null)\n {\n throw new NucleusTransactionException(LOCALISER.msg(\"015030\"));\n }\n else\n {\n return... | [
"0.7530958",
"0.7450226",
"0.73039025",
"0.72317743",
"0.6914171",
"0.68788517",
"0.6736421",
"0.6719863",
"0.6472154",
"0.6137429",
"0.61198187",
"0.6006335",
"0.59173685",
"0.5915105",
"0.58963746",
"0.58195543",
"0.57669175",
"0.57387614",
"0.5731604",
"0.5708728",
"0.5689... | 0.6745351 | 6 |
/ xxxCommand() methods: they will be called from main() where xxx is arg[2] | private static void statusCommand() {
String lineFormat = "%-8s | %-15s | %s\n";
List<Job> neededJobs = fetchNeededJobs();
// table header
if (neededJobs.size() < 2) {
System.out.printf(lineFormat, "STATE", "START TIME", "JOB DIRECTORY");
for (int i = 0; i < 78; i++) {
System.out.print(((9 == i || 27 == i) ? "+" : "-"));
}
System.out.println();
}
// table rows
ObjectCounter<JobState> counter = new ObjectCounter<JobState>();
for (Job job : neededJobs) {
Date startDate = job.getStartDate();
JobState state = job.getState();
counter.add(state);
String startDateStr = (null == startDate) ? "N/A" : new SimpleDateFormat("yyyyMMdd HHmmss").format(startDate);
System.out.printf(lineFormat, state.toString(), startDateStr, job.getDir());
}
// table footer
System.out.println();
String sumFormat = "%6d %s\n";
System.out.printf(sumFormat, heritrix.getJobs().size(), "TOTAL JOBS");
for (JobState state : JobState.values()) {
if (counter.getMap().keySet().contains(state)) {
System.out.printf(sumFormat, counter.get(state), state.toString());
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract void exec(CommandSender sender, String[] args);",
"public abstract boolean commandExecution(CommandSender sender, String label, String[] args);",
"void main(CommandLine cmd);",
"@Override\n public void execute(String[] args) {\n\n }",
"public abstract void execute(CommandSender sender... | [
"0.72506326",
"0.7044847",
"0.70265967",
"0.69460297",
"0.6931439",
"0.6770707",
"0.6729649",
"0.67262137",
"0.67253464",
"0.6696168",
"0.66832155",
"0.66293985",
"0.6580743",
"0.65511245",
"0.65373015",
"0.65362644",
"0.6527994",
"0.65067536",
"0.64933866",
"0.64633083",
"0.... | 0.0 | -1 |
Gets the value of the containerTemperature1 property. | public double getContainerTemperature1() {
return containerTemperature1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public double getContainerTemperature2() {\r\n return containerTemperature2;\r\n }",
"public void setContainerTemperature1(double value) {\r\n this.containerTemperature1 = value;\r\n }",
"public double getContainerTemperature3() {\r\n return containerTemperature3;\r\n }",
"publi... | [
"0.7999662",
"0.78022057",
"0.7763666",
"0.7272052",
"0.7233709",
"0.7103762",
"0.7095187",
"0.7084443",
"0.7066574",
"0.70318675",
"0.7028706",
"0.7001498",
"0.69923264",
"0.69393295",
"0.68462706",
"0.6833363",
"0.67164415",
"0.6678624",
"0.6655878",
"0.6585385",
"0.6580452... | 0.87562007 | 0 |
Sets the value of the containerTemperature1 property. | public void setContainerTemperature1(double value) {
this.containerTemperature1 = value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setContainerTemperature2(double value) {\r\n this.containerTemperature2 = value;\r\n }",
"public void setContainerTemperature3(double value) {\r\n this.containerTemperature3 = value;\r\n }",
"public double getContainerTemperature1() {\r\n return containerTemperature1;\r\n... | [
"0.77878654",
"0.7450925",
"0.73944503",
"0.66917384",
"0.65356576",
"0.65303504",
"0.65275687",
"0.64384276",
"0.63072973",
"0.6217388",
"0.6195689",
"0.60024405",
"0.59502506",
"0.59486663",
"0.5943269",
"0.5941811",
"0.59281963",
"0.59238654",
"0.578334",
"0.57160205",
"0.... | 0.8696229 | 0 |
Gets the value of the containerTemperature2 property. | public double getContainerTemperature2() {
return containerTemperature2;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public double getContainerTemperature1() {\r\n return containerTemperature1;\r\n }",
"public void setContainerTemperature2(double value) {\r\n this.containerTemperature2 = value;\r\n }",
"public double getContainerTemperature3() {\r\n return containerTemperature3;\r\n }",
"publi... | [
"0.8324069",
"0.79197097",
"0.77583045",
"0.73014",
"0.7213975",
"0.70756185",
"0.6980861",
"0.694693",
"0.6942522",
"0.6924695",
"0.69122905",
"0.6892608",
"0.6873116",
"0.6853915",
"0.6839456",
"0.67571974",
"0.6684461",
"0.66818833",
"0.6632255",
"0.65218055",
"0.6515896",... | 0.8840983 | 0 |
Sets the value of the containerTemperature2 property. | public void setContainerTemperature2(double value) {
this.containerTemperature2 = value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setContainerTemperature1(double value) {\r\n this.containerTemperature1 = value;\r\n }",
"public double getContainerTemperature2() {\r\n return containerTemperature2;\r\n }",
"public void setContainerTemperature3(double value) {\r\n this.containerTemperature3 = value;\r\n... | [
"0.79886454",
"0.7435535",
"0.736634",
"0.6890101",
"0.64106786",
"0.63375103",
"0.6331823",
"0.62511134",
"0.62261295",
"0.61535835",
"0.605788",
"0.60258234",
"0.59980035",
"0.5994971",
"0.5965043",
"0.59610933",
"0.5871542",
"0.5760039",
"0.5738554",
"0.5624614",
"0.562456... | 0.8696171 | 0 |
Gets the value of the containerTemperature3 property. | public double getContainerTemperature3() {
return containerTemperature3;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setContainerTemperature3(double value) {\r\n this.containerTemperature3 = value;\r\n }",
"public float getTemp3() {\n\t\treturn temp3;\n\t}",
"public double getContainerTemperature1() {\r\n return containerTemperature1;\r\n }",
"public double getContainerTemperature2() {\r\n ... | [
"0.81357086",
"0.79319537",
"0.7719091",
"0.7397239",
"0.6956967",
"0.69003826",
"0.6874303",
"0.67264086",
"0.6720815",
"0.6711745",
"0.67093176",
"0.66925687",
"0.66708195",
"0.6661842",
"0.66537416",
"0.6610163",
"0.6558505",
"0.6548452",
"0.6543761",
"0.6534174",
"0.65078... | 0.8898245 | 0 |
Sets the value of the containerTemperature3 property. | public void setContainerTemperature3(double value) {
this.containerTemperature3 = value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public double getContainerTemperature3() {\r\n return containerTemperature3;\r\n }",
"public void setContainerTemperature1(double value) {\r\n this.containerTemperature1 = value;\r\n }",
"public void setContainerTemperature2(double value) {\r\n this.containerTemperature2 = value;\r\n... | [
"0.76092446",
"0.7399833",
"0.7027071",
"0.65550274",
"0.6302711",
"0.6205349",
"0.6178216",
"0.6152165",
"0.601045",
"0.5994928",
"0.59848315",
"0.59225464",
"0.5900823",
"0.5836716",
"0.5811363",
"0.58042526",
"0.5784053",
"0.5702672",
"0.56975335",
"0.5677823",
"0.5553197"... | 0.88267016 | 0 |
Gets the value of the humidityValue property. | public double getHumidityValue() {
return humidityValue;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getHumidity() {\n\t\treturn humidity;\n\t}",
"public String getHumidity() {\n\t\treturn humidity;\n\t}",
"public double getHumidity()\n {\n return humidity;\n }",
"public Float getHumidity () {\n return humidity;\n }",
"public int getHumidity(){\n return VirtualHardw... | [
"0.80100715",
"0.80100715",
"0.799465",
"0.780267",
"0.7802065",
"0.7712235",
"0.7194963",
"0.69081026",
"0.66909254",
"0.6515009",
"0.64928275",
"0.64863086",
"0.64527977",
"0.6444452",
"0.6441571",
"0.6439433",
"0.6432736",
"0.6412895",
"0.6412895",
"0.6412895",
"0.6388432"... | 0.8661238 | 0 |
Sets the value of the humidityValue property. | public void setHumidityValue(double value) {
this.humidityValue = value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setHumidityTemperature(double value) {\r\n this.humidityTemperature = value;\r\n }",
"public void setHumidity(Float humidity) {\n this.humidity = humidity;\n }",
"public double getHumidityValue() {\r\n return humidityValue;\r\n }",
"private void updateHumidityValue(f... | [
"0.7908354",
"0.74230486",
"0.708647",
"0.68533105",
"0.65164447",
"0.62507814",
"0.62507814",
"0.6215269",
"0.6201233",
"0.6144284",
"0.61043894",
"0.61026645",
"0.6013679",
"0.5925997",
"0.59146243",
"0.5760156",
"0.57116896",
"0.5683089",
"0.56787914",
"0.5666641",
"0.5618... | 0.8510519 | 0 |
Gets the value of the humidityTemperature property. | public double getHumidityTemperature() {
return humidityTemperature;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public double getHumidityValue() {\r\n return humidityValue;\r\n }",
"public String getHumidity() {\n\t\treturn humidity;\n\t}",
"public String getHumidity() {\n\t\treturn humidity;\n\t}",
"public double getHumidity()\n {\n return humidity;\n }",
"public Float getHumidity () {\n r... | [
"0.832581",
"0.81935996",
"0.81935996",
"0.81141484",
"0.7900706",
"0.7868341",
"0.7849709",
"0.7781932",
"0.7749276",
"0.77217007",
"0.7706005",
"0.7688794",
"0.765404",
"0.760532",
"0.7586838",
"0.7582667",
"0.75660676",
"0.749987",
"0.74794066",
"0.7417123",
"0.7326216",
... | 0.8778658 | 0 |
Sets the value of the humidityTemperature property. | public void setHumidityTemperature(double value) {
this.humidityTemperature = value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setHumidity(Float humidity) {\n this.humidity = humidity;\n }",
"public void setHumidityValue(double value) {\r\n this.humidityValue = value;\r\n }",
"private void setTemp(int temperature) {\n\t\tthis.temperature.setValue(temperature);\n\t}",
"public void setTemperature(int va... | [
"0.8010704",
"0.749619",
"0.73966885",
"0.73718035",
"0.7341304",
"0.7279891",
"0.7174402",
"0.7010306",
"0.6985636",
"0.69727176",
"0.67644864",
"0.6621816",
"0.6572174",
"0.6490509",
"0.64781916",
"0.64450747",
"0.64450747",
"0.6273547",
"0.62484044",
"0.62011296",
"0.61191... | 0.84119326 | 0 |
Gets the value of the hvacStateOn property. | public boolean isHvacStateOn() {
return hvacStateOn;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setHvacStateOn(boolean value) {\r\n this.hvacStateOn = value;\r\n }",
"public double getHvacStateValue() {\r\n return hvacStateValue;\r\n }",
"public boolean isOn(){\n return state;\n }",
"public boolean isOn() {\n return onFlag;\n }",
"BooleanProperty ge... | [
"0.81264824",
"0.7535029",
"0.63062656",
"0.6092794",
"0.598566",
"0.59536654",
"0.5860806",
"0.5795082",
"0.57529783",
"0.57185024",
"0.56899184",
"0.56854033",
"0.568108",
"0.5654127",
"0.56527",
"0.56252253",
"0.5491733",
"0.5454812",
"0.5391448",
"0.53739554",
"0.5359428"... | 0.86555237 | 0 |
Sets the value of the hvacStateOn property. | public void setHvacStateOn(boolean value) {
this.hvacStateOn = value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isHvacStateOn() {\r\n return hvacStateOn;\r\n }",
"public void setHvacStateValue(double value) {\r\n this.hvacStateValue = value;\r\n }",
"void setOnStatus(Boolean on) {\n this.on = on;\n }",
"public double getHvacStateValue() {\r\n return hvacStateValue;\r... | [
"0.75395334",
"0.6563858",
"0.6000567",
"0.58157504",
"0.56955844",
"0.5658368",
"0.5631747",
"0.5611537",
"0.5585016",
"0.5573153",
"0.54924846",
"0.5465635",
"0.54577893",
"0.5450115",
"0.5426339",
"0.5394191",
"0.53924614",
"0.5308762",
"0.52858967",
"0.5278176",
"0.526564... | 0.8950799 | 0 |
Gets the value of the hvacStateValue property. | public double getHvacStateValue() {
return hvacStateValue;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setHvacStateValue(double value) {\r\n this.hvacStateValue = value;\r\n }",
"@java.lang.Override public int getVehicleStateValue() {\n return vehicleState_;\n }",
"@java.lang.Override public int getVehicleStateValue() {\n return vehicleState_;\n }",
"public boolean isHvacStat... | [
"0.6844658",
"0.6694851",
"0.66116977",
"0.64903986",
"0.63612294",
"0.61679375",
"0.6124196",
"0.6112105",
"0.6112105",
"0.6112105",
"0.6078525",
"0.6069734",
"0.60579",
"0.60579",
"0.60579",
"0.60387254",
"0.6009159",
"0.5936763",
"0.5936763",
"0.5936763",
"0.5923115",
"0... | 0.8602321 | 0 |
Sets the value of the hvacStateValue property. | public void setHvacStateValue(double value) {
this.hvacStateValue = value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setHvacStateOn(boolean value) {\r\n this.hvacStateOn = value;\r\n }",
"public double getHvacStateValue() {\r\n return hvacStateValue;\r\n }",
"public Builder setVehicleStateValue(int value) {\n \n vehicleState_ = value;\n onChanged();\n return this;\n }",
... | [
"0.73292476",
"0.6929527",
"0.61864036",
"0.59155285",
"0.5754152",
"0.5674077",
"0.5657478",
"0.5643497",
"0.5642843",
"0.56192166",
"0.5618418",
"0.56170017",
"0.56161267",
"0.55919033",
"0.5570602",
"0.5533912",
"0.5511229",
"0.54078233",
"0.53974146",
"0.53915316",
"0.537... | 0.8208204 | 0 |
Gets the value of the currentClampValue property. | public double getCurrentClampValue() {
return currentClampValue;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setCurrentClampValue(double value) {\r\n this.currentClampValue = value;\r\n }",
"public float getCurrentValue() {\n return currentValue;\n }",
"public Number getValue() {\n return currentVal;\n }",
"public float _getValue()\r\n {\r\n if (valueClass.equal... | [
"0.6642062",
"0.63439393",
"0.6342303",
"0.62491167",
"0.6057394",
"0.60486597",
"0.59004116",
"0.5811433",
"0.5811275",
"0.5765055",
"0.5750855",
"0.5750855",
"0.57323396",
"0.57275194",
"0.57062024",
"0.5700915",
"0.5695836",
"0.5677815",
"0.5676346",
"0.5676346",
"0.565945... | 0.9040615 | 0 |
Sets the value of the currentClampValue property. | public void setCurrentClampValue(double value) {
this.currentClampValue = value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public double getCurrentClampValue() {\r\n return currentClampValue;\r\n }",
"public void setCurrentValue(float currentValue) {\n this.currentValue = currentValue;\n }",
"public void setLimit(float value) {\n this.limit = value;\n }",
"@Override public void setMinMax(float minValue, f... | [
"0.71582097",
"0.57305264",
"0.5693314",
"0.56623584",
"0.5631227",
"0.551577",
"0.5514996",
"0.54669917",
"0.5421954",
"0.54153633",
"0.5399517",
"0.5384485",
"0.53473973",
"0.5275869",
"0.5241291",
"0.5223096",
"0.5190736",
"0.517201",
"0.5171213",
"0.5165257",
"0.5141105",... | 0.8679921 | 0 |
Gets the value of the externalTemperature property. | public double getExternalTemperature() {
return externalTemperature;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public HLAfloat32BE getTemperature() { return this.temperature; }",
"public AlarmTemperature getTemperature() {\n\t\treturn this.temperature;\n\t}",
"public String getTemperature() {\r\n\t\treturn temperature;\r\n\t}",
"public String getTemperature() {\n\t\treturn temperature;\n\t}",
"public void setExtern... | [
"0.7755546",
"0.76459664",
"0.7625731",
"0.7623033",
"0.75555164",
"0.7527008",
"0.7506011",
"0.748971",
"0.7446183",
"0.74107474",
"0.73967963",
"0.73932093",
"0.73705864",
"0.7313887",
"0.7249364",
"0.7222441",
"0.72033334",
"0.7195759",
"0.7141576",
"0.69569343",
"0.691501... | 0.8903679 | 0 |
Sets the value of the externalTemperature property. | public void setExternalTemperature(double value) {
this.externalTemperature = value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public double getExternalTemperature() {\r\n return externalTemperature;\r\n }",
"private void setTemp(int temperature) {\n\t\tthis.temperature.setValue(temperature);\n\t}",
"public void setTemperature(int value) {\n this.temperature = value;\n }",
"public void setTemperature(Floa... | [
"0.71892786",
"0.70085925",
"0.70024264",
"0.696696",
"0.69083667",
"0.68637776",
"0.67798865",
"0.6603896",
"0.6592485",
"0.63422495",
"0.63014174",
"0.62181",
"0.620914",
"0.6204994",
"0.6188286",
"0.6092177",
"0.6040147",
"0.60246074",
"0.59802127",
"0.59640944",
"0.592171... | 0.86162484 | 0 |
Gets the value of the parcelTemperature property. | public double getParcelTemperature() {
return parcelTemperature;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public IntegerProperty getTemp() {\n\t\treturn temperature;\n\t}",
"public int getTemperature() {\n\t\treturn temperature;\n\t}",
"public String getTemperature() {\r\n\t\treturn temperature;\r\n\t}",
"public String getTemperature() {\n\t\treturn temperature;\n\t}",
"public int getTemperature() {\n ... | [
"0.79467344",
"0.781432",
"0.780037",
"0.77868557",
"0.77559",
"0.76736414",
"0.7670287",
"0.76329625",
"0.7631255",
"0.75826395",
"0.75781685",
"0.7537095",
"0.74874103",
"0.74194044",
"0.74179196",
"0.7358361",
"0.7314101",
"0.72830003",
"0.7197498",
"0.7178249",
"0.7175479... | 0.8679418 | 0 |
Sets the value of the parcelTemperature property. | public void setParcelTemperature(double value) {
this.parcelTemperature = value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setTemperature(Float temperature) {\n this.temperature = temperature;\n }",
"private void setTemp(int temperature) {\n\t\tthis.temperature.setValue(temperature);\n\t}",
"public void setTemp(int temp) {\n \tthis.temperature = temp;\n }",
"public void setTemperature(int value) {\n ... | [
"0.744391",
"0.7405276",
"0.7332398",
"0.721018",
"0.70798117",
"0.7079475",
"0.70470685",
"0.70036244",
"0.6801054",
"0.65709144",
"0.645867",
"0.6450989",
"0.64086455",
"0.6198187",
"0.6118481",
"0.6092653",
"0.60002273",
"0.59732187",
"0.5944382",
"0.5941487",
"0.5936618",... | 0.8162002 | 0 |
Create the procedure setting composite | private Composite createProcedureSettingComposite() {
final Composite composite = new Composite(tabFolder, SWT.LEFT | SWT.WRAP);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout layoutComp;
layoutComp = new GridLayout();
layoutComp.marginWidth = 10;
layoutComp.marginHeight = 10;
layoutComp.numColumns = 2;
composite.setLayout(layoutComp);
final Label functionNameLabel = new Label(composite, SWT.NONE);
functionNameLabel.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
functionNameLabel.setText(Messages.lblProcedureName);
procNameText = new Text(composite, SWT.BORDER);
procNameText.setTextLimit(ValidateUtil.MAX_SCHEMA_NAME_LENGTH);
procNameText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
procNameText.addKeyListener(new org.eclipse.swt.events.KeyAdapter() {
public void keyPressed(KeyEvent event) {
}
public void keyReleased(KeyEvent event) {
if (StringUtil.isEmpty(procNameText.getText())) {
getButton(IDialogConstants.OK_ID).setEnabled(false);
return;
}
getButton(IDialogConstants.OK_ID).setEnabled(true);
}
});
if (isCommentSupport) {
final Label procDescriptionLabel = new Label(composite, SWT.NONE);
procDescriptionLabel.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
procDescriptionLabel.setText(Messages.lblProcedureDescription);
procDescriptionText = new Text(composite, SWT.BORDER);
procDescriptionText.setTextLimit(ValidateUtil.MAX_DB_OBJECT_COMMENT);
procDescriptionText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
}
final String[] userColumnNameArr = isCommentSupport
? new String[] {
Messages.tblColProcedureParamName,
Messages.tblColProcedureParamType,
Messages.tblColProcedureJavaParamType,
Messages.tblColProcedureModel,
Messages.tblColProcedureMemo }
: new String[] {
Messages.tblColProcedureParamName,
Messages.tblColProcedureParamType,
Messages.tblColProcedureJavaParamType,
Messages.tblColProcedureModel };
procParamsTableViewer = CommonUITool.createCommonTableViewer(composite,
null, userColumnNameArr,
CommonUITool.createGridData(GridData.FILL_BOTH, 6, 4, -1, 200));
procParamsTable = procParamsTableViewer.getTable();
procParamsTableViewer.getTable().addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent event) {
}
public void widgetSelected(SelectionEvent event) {
if (procParamsTableViewer.getTable().getSelectionCount() > 0) {
getButton(BUTTON_EDIT_ID).setEnabled(true);
getButton(BUTTON_UP_ID).setEnabled(true);
getButton(BUTTON_DOWN_ID).setEnabled(true);
getButton(BUTTON_DROP_ID).setEnabled(true);
}
}
});
procParamsTableViewer.setInput(procParamsListData);
procParamsTable.setLinesVisible(true);
procParamsTable.setHeaderVisible(true);
procParamsTable.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
// setBtnEnableDisable();
}
});
barComp = new Composite(composite, SWT.NONE);
final GridData gdbarComp = new GridData(GridData.FILL_HORIZONTAL);
gdbarComp.horizontalSpan = 2;
barComp.setLayoutData(gdbarComp);
GridLayout layout = new GridLayout();
layout.marginWidth = 10;
layout.marginHeight = 10;
barComp.setLayout(layout);
final Label javaNameLabel = new Label(composite, SWT.LEFT | SWT.WRAP);
javaNameLabel.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
javaNameLabel.setText(Messages.lblJavaFunctionName);
javaNameText = new Text(composite, SWT.BORDER);
GridData gdJavaNameText = new GridData(GridData.FILL_HORIZONTAL);
javaNameText.setLayoutData(gdJavaNameText);
return composite;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"ProcedureCall createProcedureCall();",
"public static <A> CompositeProcedure<A> procedure(Procedure<? super A> procedure) {\n return new CompositeProcedure<A>(procedure);\n }",
"protected PreDefinedProcedure() {\n super(new ParameterList(), new Block());\n this.name = null;\n ... | [
"0.6193302",
"0.5948211",
"0.5791394",
"0.5645342",
"0.554555",
"0.548782",
"0.5473813",
"0.541088",
"0.53624684",
"0.535167",
"0.53481597",
"0.5308254",
"0.5280035",
"0.52223957",
"0.51998544",
"0.5182923",
"0.5159044",
"0.5148896",
"0.5142143",
"0.51275283",
"0.5119975",
... | 0.71238863 | 0 |
Create the sql script composite | private Composite createSqlScriptComposite() {
final Composite composite = new Composite(tabFolder, SWT.NONE);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout layout = new GridLayout();
layout.marginWidth = 10;
layout.marginHeight = 10;
sqlScriptText = new StyledText(composite, SWT.BORDER | SWT.WRAP | SWT.MULTI | SWT.READ_ONLY);
CommonUITool.registerContextMenu(sqlScriptText, false);
sqlScriptText.setLayoutData(new GridData(GridData.FILL_BOTH));
composite.setLayout(layout);
return composite;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private String getSQLScript() {\n\t\tStringBuffer sb = new StringBuffer();\n\t\tStringBuffer javaSb = new StringBuffer();\n\t\tsb.append(\"CREATE\").append(\" PROCEDURE \");\n\t\tString procedureName = procNameText.getText();\n\t\tif (procedureName == null) {\n\t\t\tprocedureName = \"\";\n\t\t}\n\t\tsb.append(Quer... | [
"0.6939664",
"0.66297007",
"0.6523933",
"0.6518138",
"0.65102553",
"0.61504513",
"0.61359316",
"0.6087449",
"0.6072784",
"0.6048871",
"0.6044726",
"0.60420984",
"0.6011654",
"0.58969945",
"0.58858514",
"0.588034",
"0.5872639",
"0.58027303",
"0.5802102",
"0.5779321",
"0.576022... | 0.6730324 | 1 |
Constrain the shell size | protected void constrainShellSize() {
super.constrainShellSize();
CommonUITool.centerShell(getShell());
if (isNewFlag()) {
getShell().setText(Messages.titleAddProcedureDialog);
} else {
getShell().setText(Messages.titleEditProcedureDialog);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n protected void configureShell(Shell newShell) {\n super.configureShell(newShell);\n\n newShell.setMinimumSize(600, 400);\n }",
"private void basicSize(){\n setSize(375,400);\n }",
"public void setMaxPaddleLength(){\n myRectangle.setWidth(myScreenWidth - SIDEBAR_... | [
"0.64715385",
"0.6452448",
"0.6434437",
"0.62306845",
"0.61654174",
"0.6140732",
"0.61317325",
"0.6091371",
"0.6015649",
"0.5991018",
"0.59890807",
"0.59269637",
"0.5924503",
"0.5883554",
"0.5848117",
"0.5848117",
"0.583834",
"0.5805946",
"0.5769749",
"0.5765929",
"0.57622117... | 0.72364247 | 0 |
Create buttons for button bar | protected void createButtonsForButtonBar(Composite parent) {
createButton(barComp, BUTTON_ADD_ID, Messages.btnAddParameter, true);
createButton(barComp, BUTTON_EDIT_ID, Messages.btnEditParameter, true);
createButton(barComp, BUTTON_DROP_ID, Messages.btnDropParameter, true);
createButton(barComp, BUTTON_UP_ID, Messages.btnUpParameter, true);
createButton(barComp, BUTTON_DOWN_ID, Messages.btnDownParameter, true);
createButton(parent, IDialogConstants.OK_ID, com.cubrid.common.ui.common.Messages.btnOK, true);
getButton(BUTTON_EDIT_ID).setEnabled(false);
getButton(BUTTON_UP_ID).setEnabled(false);
getButton(BUTTON_DOWN_ID).setEnabled(false);
getButton(BUTTON_DROP_ID).setEnabled(false);
createButton(parent, IDialogConstants.CANCEL_ID, com.cubrid.common.ui.common.Messages.btnCancel, false);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void createButtons() {\n\t\tescapeBackground = new GRect(200, 150, 300, 400);\n\t\tescapeBackground.setFilled(true);\n\t\tescapeBackground.setColor(Color.gray);\n\n\t\tbutton1 = new GButton(\"Return to Game\", 250, 175, 200, 50, Color.cyan);\n\t\tbutton3 = new GButton(\"Exit Level\", 250, 330, 200, 50, Colo... | [
"0.7709257",
"0.76603633",
"0.7646985",
"0.76434356",
"0.75790167",
"0.7460187",
"0.74566406",
"0.744941",
"0.7400914",
"0.73766637",
"0.73757297",
"0.7358802",
"0.73516864",
"0.7342902",
"0.73278546",
"0.7322858",
"0.7320514",
"0.7296587",
"0.727006",
"0.7266252",
"0.7236662... | 0.7462435 | 5 |
When press button,call it | protected void buttonPressed(int buttonId) {
if (buttonId == BUTTON_ADD_ID) {
Map<String, String> model = new HashMap<String, String>();
try {
AddFuncParamsDialog addDlg = new AddFuncParamsDialog(
getShell(), model, sqlTypeMap, javaTypeMap, true, procParamsListData,
database);
if (addDlg.open() == IDialogConstants.OK_ID) { // add
procParamsListData.add(model);
procParamsTableViewer.refresh();
for (int i = 0; i < procParamsTableViewer.getTable().getColumnCount(); i++) {
procParamsTableViewer.getTable().getColumn(i).pack();
}
}
} catch (Exception e) {
LOGGER.error("", e);
}
} else if (buttonId == BUTTON_EDIT_ID) { // edit
int index = procParamsTable.getSelectionIndex();
if (index < 0) {
return;
}
Map<String, String> map = procParamsListData.get(index);
AddFuncParamsDialog editDlg = new AddFuncParamsDialog(getShell(),
map, sqlTypeMap, javaTypeMap, false, procParamsListData,
database);
if (editDlg.open() == IDialogConstants.OK_ID) {
procParamsTableViewer.refresh();
for (int i = 0; i < procParamsTableViewer.getTable().getColumnCount(); i++) {
procParamsTableViewer.getTable().getColumn(i).pack();
}
}
} else if (buttonId == BUTTON_UP_ID) { // up
int index = procParamsTable.getSelectionIndex();
if (index <= 0) {
return;
}
Map<String, String> map = procParamsListData.get(index);
Map<String, String> preMap = procParamsListData.get(index - 1);
procParamsListData.set(index - 1, map);
procParamsListData.set(index, preMap);
procParamsTableViewer.refresh();
} else if (buttonId == BUTTON_DOWN_ID) { // down
int index = procParamsTable.getSelectionIndex();
if (index < 0 || index >= procParamsListData.size() - 1) {
return;
}
Map<String, String> map = procParamsListData.get(index);
Map<String, String> nextMap = procParamsListData.get(index + 1);
procParamsListData.set(index + 1, map);
procParamsListData.set(index, nextMap);
procParamsTableViewer.refresh();
} else if (buttonId == BUTTON_DROP_ID) { // drop
int index = procParamsTable.getSelectionIndex();
if (index < 0) {
return;
}
procParamsListData.remove(index);
procParamsTableViewer.refresh();
getButton(BUTTON_EDIT_ID).setEnabled(false);
getButton(BUTTON_UP_ID).setEnabled(false);
getButton(BUTTON_DOWN_ID).setEnabled(false);
getButton(BUTTON_DROP_ID).setEnabled(false);
} else if (buttonId == IDialogConstants.OK_ID) {
if (valid()) {
procedureName = procNameText.getText();
CommonSQLExcuterTask task = new CommonSQLExcuterTask(database.getDatabaseInfo());
if (!newFlag) {
String dropSql = "DROP PROCEDURE " + QuerySyntax.escapeKeyword(procNameText.getText());
task.addSqls(dropSql);
}
task.addSqls(getSQLScript());
execute(IDialogConstants.OK_ID, new ITask[]{task });
}
return;
}
super.buttonPressed(buttonId);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void buttonClicked();",
"public void buttonClicked() {\n mSanitizorGame.buttonClicked();\n }",
"@Override\n\tprotected void on_button_pressed(String button_name) {\n\n\t}",
"public void sButton() {\n\n\n\n }",
"String handleButtonPress(Button button);",
"public void onButtonAPressed()... | [
"0.7932945",
"0.745327",
"0.7400083",
"0.73527503",
"0.73494935",
"0.7335038",
"0.7311492",
"0.7291526",
"0.7170221",
"0.71488017",
"0.71322185",
"0.710136",
"0.7049706",
"0.7033277",
"0.6979696",
"0.6972234",
"0.69514316",
"0.6921342",
"0.6914037",
"0.690808",
"0.6907661",
... | 0.0 | -1 |
Check the data validation | public boolean valid() {
if (newFlag) {
if (procNameText.getText() == null || StringUtil.isEmpty(procNameText.getText())) {
CommonUITool.openErrorBox(getShell(), Messages.errInputProcedureName);
return false;
}
if (!ValidateUtil.isValidIdentifier(procNameText.getText())) {
CommonUITool.openErrorBox(getShell(),
Messages.bind(Messages.errInputParameterNameValid, procNameText.getText()));
return false;
}
if (procNameText.getText().length() > ValidateUtil.MAX_SCHEMA_NAME_LENGTH) {
CommonUITool.openErrorBox(Messages.bind(Messages.errInputFunctionNameLength, "procedure",
ValidateUtil.MAX_SCHEMA_NAME_LENGTH));
return false;
}
}
String javaName = javaNameText.getText();
if (javaName == null || "".equals(javaName)) {
CommonUITool.openErrorBox(getShell(), Messages.errInputJavaProcedureName);
return false;
}
String[] javaNames = javaName.split("\\.");
boolean isValidJavaName = true;
if (javaNames == null || javaNames.length != 2) {
isValidJavaName = false;
}
for (int i = 0; isValidJavaName && i < javaNames.length; i++) {
if (!javaNames[i].matches("^[a-zA-Z_\\$].*")) {
isValidJavaName = false;
break;
}
for (int j = 0; isValidJavaName && j < javaNames[i].length(); j++) {
if (!Character.isJavaIdentifierPart(javaNames[i].charAt(j))) {
isValidJavaName = false;
break;
}
}
}
if (!isValidJavaName) {
CommonUITool.openErrorBox(getShell(), Messages.errValidJavaFunctionName);
return false;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void validateData() {\n }",
"protected boolean isValidData() {\n return true;\n }",
"private boolean validateData() {\n if (!mCommon.validateData()) return false;\n\n Core core = new Core(this);\n\n // Due Date is required\n if (TextUtils.isEmpty(getRecurringTra... | [
"0.8724793",
"0.8091506",
"0.77341616",
"0.7440744",
"0.7324354",
"0.7257509",
"0.72366476",
"0.7228365",
"0.72139657",
"0.7189038",
"0.717355",
"0.71403545",
"0.71310794",
"0.7112962",
"0.7108171",
"0.70919466",
"0.70708656",
"0.7026082",
"0.7013383",
"0.6970021",
"0.6966644... | 0.0 | -1 |
FIXME move this logic to core module | private String getSQLScript() {
StringBuffer sb = new StringBuffer();
StringBuffer javaSb = new StringBuffer();
sb.append("CREATE").append(" PROCEDURE ");
String procedureName = procNameText.getText();
if (procedureName == null) {
procedureName = "";
}
sb.append(QuerySyntax.escapeKeyword(procedureName)).append("(");
for (Map<String, String> map : procParamsListData) {
// "PARAMS_INDEX", "PARAM_NAME", "PARAM_TYPE", "JAVA_PARAM_TYPE"
String name = map.get("0");
String type = map.get("1");
String javaType = map.get("2");
String paramModel = map.get("3");
String description = map.get("4");
sb.append(QuerySyntax.escapeKeyword(name)).append(" ");
if (!paramModel.equalsIgnoreCase(SPArgsType.IN.toString())) {
sb.append(paramModel).append(" ");
}
sb.append(type);
if (isCommentSupport && StringUtil.isNotEmpty(description)) {
description = String.format("'%s'", description);
sb.append(String.format(" COMMENT %s", StringUtil.escapeQuotes(description)));
}
sb.append(",");
javaSb.append(javaType).append(",");
}
if (!procParamsListData.isEmpty()) {
if (sb.length() > 0) {
sb.deleteCharAt(sb.length() - 1);
}
if (javaSb.length() > 0) {
javaSb.deleteCharAt(javaSb.length() - 1);
}
}
sb.append(")");
sb.append(StringUtil.NEWLINE).append("AS LANGUAGE JAVA ").append(StringUtil.NEWLINE);
String javaFuncName = javaNameText.getText();
if (javaFuncName == null) {
javaFuncName = "";
}
sb.append("NAME '").append(javaFuncName).append("(").append(javaSb).append(")").append("'");
if (isCommentSupport) {
String description = procDescriptionText.getText();
if (StringUtil.isNotEmpty(description)) {
description = String.format("'%s'", description);
sb.append(String.format(" COMMENT %s", StringUtil.escapeQuotes(description)));
}
}
return formatSql(sb.toString());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n public void perish() {\n \n }",
"protected void additionalProcessing() {\n\t}",
"@Override\r\n \tpublic void process() {\n \t\t\r\n \t}",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void sacrifier... | [
"0.5705014",
"0.55672723",
"0.5538089",
"0.5428307",
"0.53785384",
"0.5323571",
"0.52985805",
"0.5289693",
"0.5286366",
"0.52749735",
"0.5272612",
"0.52709955",
"0.52709955",
"0.52507925",
"0.52505606",
"0.5250279",
"0.5235792",
"0.52190113",
"0.5212114",
"0.5206608",
"0.5205... | 0.0 | -1 |
Init the sql type map | private void initSqlTypeMap() {
if (sqlTypeMap == null) {
sqlTypeMap = new TreeMap<String, String>();
}
sqlTypeMap.put("--void--", "0");
FieldHandlerUtils.initSqlTypeMap(sqlTypeMap);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\t\tpublic void setTypeMap(Map<String, Class<?>> map) throws SQLException {\n\t\t\t\r\n\t\t}",
"@Override\r\n\t\tpublic Map<String, Class<?>> getTypeMap() throws SQLException {\n\t\t\treturn null;\r\n\t\t}",
"private void initJavaType() { // FIXME move this logic to core module\n\t\tif (javaTypeMa... | [
"0.7139734",
"0.7118448",
"0.69040334",
"0.6892424",
"0.6686532",
"0.65875167",
"0.6248621",
"0.6214681",
"0.61792624",
"0.6104074",
"0.60826325",
"0.59024686",
"0.58910173",
"0.5814971",
"0.5808944",
"0.5807305",
"0.575232",
"0.5707268",
"0.5697289",
"0.56516385",
"0.562771"... | 0.831517 | 0 |
Init the java type map | private void initJavaType() { // FIXME move this logic to core module
if (javaTypeMap == null) {
javaTypeMap = new TreeMap<String, List<String>>();
}
if (!javaTypeMap.containsKey("1")) {
List<String> list = new ArrayList<String>();
list.add("java.lang.String");
list.add("java.sql.Date");
list.add("java.sql.Time");
list.add("java.sql.Timestamp");
list.add("java.lang.Byte");
list.add("java.lang.Short");
list.add("java.lang.Integer");
list.add("java.lang.Long");
list.add("java.lang.Float");
list.add("java.lang.Double");
list.add("java.math.BigDecimal");
list.add("byte");
list.add("short");
list.add("int");
list.add("long");
list.add("float");
list.add("double");
javaTypeMap.put("1", list);
}
if (!javaTypeMap.containsKey("2")) {
List<String> list = new ArrayList<String>();
list.add("java.lang.Byte");
list.add("java.lang.Short");
list.add("java.lang.Integer");
list.add("java.lang.Long");
list.add("java.lang.Float");
list.add("java.lang.Double");
list.add("java.math.BigDecimal");
list.add("java.lang.String");
list.add("byte");
list.add("short");
list.add("int");
list.add("long");
list.add("float");
list.add("double");
javaTypeMap.put("2", list);
}
if (!javaTypeMap.containsKey("3")) {
List<String> list = new ArrayList<String>();
list.add("java.sql.Date");
list.add("java.sql.Time");
list.add("java.sql.Timestamp");
list.add("java.lang.String");
javaTypeMap.put("3", list);
}
if (!javaTypeMap.containsKey("4")) {
List<String> list = new ArrayList<String>();
javaTypeMap.put("4", list);
}
if (!javaTypeMap.containsKey("5")) {
List<String> list = new ArrayList<String>();
if (database != null) {
String jdbcVersion = database.getDatabase().getServer().getJdbcDriverVersion();
if (isAfterJdbc111(jdbcVersion)) {
list.add("cubrid.sql.CUBRIDOIDImpl");
} else {
list.add("cubrid.sql.CUBRIDOID");
}
} else {
list.add("cubrid.sql.CUBRIDOID");
}
javaTypeMap.put("5", list);
}
if (!javaTypeMap.containsKey("6")) {
List<String> list = new ArrayList<String>();
list.add("cubrid.jdbc.driver.CUBRIDResultSet");
javaTypeMap.put("6", list);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static void createTypeMap() {\n\n }",
"private static HashMap<String, String> initMapping()\n {\n HashMap<String, String> typeMapping = new HashMap<String, String>();\n\n typeMapping.put(\"boolean\", \"boolean\");\n typeMapping.put(\"float\", \"float\");\n typeMapping.put(\"double\", \"do... | [
"0.73695034",
"0.7352207",
"0.6867339",
"0.6646845",
"0.6473126",
"0.6339552",
"0.63006955",
"0.62794185",
"0.6238768",
"0.621275",
"0.61279345",
"0.6117586",
"0.6111849",
"0.61113447",
"0.61084545",
"0.60821086",
"0.60608447",
"0.60524905",
"0.60493904",
"0.60227406",
"0.595... | 0.7879367 | 0 |
Format the sql script | private String formatSql(String sql) {
String sqlStr = formator.format(sql + ";");
if (sqlStr == null) {
LOGGER.error("The formator.format(sql) is a null.");
return null;
}
String trimmedSql = sqlStr.trim();
if (!trimmedSql.endsWith(";")) {
return "";
}
String formattedSql = trimmedSql.substring(0, trimmedSql.length() - 1);
return formattedSql;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void formatSql() {\r\n if (sql == null || sql.trim().length() == 0) {\r\n throw new IllegalArgumentException(\"There is no SQL statement to format\");\r\n }\r\n sql = formatter.format(sql);\r\n }",
"String toSql();",
"protected String generateSQL() {\n String fi... | [
"0.7084737",
"0.6632544",
"0.6629594",
"0.65648204",
"0.65144783",
"0.65076524",
"0.644618",
"0.6268573",
"0.62072265",
"0.6203873",
"0.61247385",
"0.60779566",
"0.60773426",
"0.6057253",
"0.6048805",
"0.5974095",
"0.59367114",
"0.5904975",
"0.58781046",
"0.5874237",
"0.58499... | 0.66595656 | 1 |
TODO Autogenerated method stub | public static void main(String[] args) {
System.out.println(pow (3,1000));
System.out.println(pow (3,1000));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
Creates new form fixedCarEntry | public FixedCarEntry() {
initComponents();
this.setIconImage(new ImageIcon(this.getClass().getResource("/images/car-icon.png")).getImage());
this.setLocationRelativeTo(null);
getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
KeyStroke.getKeyStroke(KeyEvent.VK_ACCEPT, 0), "Accept");
getRootPane().getActionMap().put("Accept", new AbstractAction(){
public void actionPerformed(ActionEvent e)
{
priceTextFieldActionPerformed(e);
}
});
getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "Escape");
getRootPane().getActionMap().put("Escape", new AbstractAction(){
public void actionPerformed(ActionEvent e)
{
setVisible(false);
}
});
getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0), "F1");
getRootPane().getActionMap().put("F1", new AbstractAction(){
public void actionPerformed(ActionEvent e)
{
priceTextFieldActionPerformed(e);
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void AddCarGUI(Car newCar){\n \n switch (newCar.path) { \n case 0:\n carModel.addRow(new Object[]{newCar.carId,\"East\",\"West\",newCar.status, newCar.timeLeft});\n break;\n case 1: \n carModel.addRow(new Object[]{newCar.carId,... | [
"0.5766672",
"0.5700963",
"0.56188875",
"0.5597876",
"0.5550813",
"0.554811",
"0.5492984",
"0.5453417",
"0.53971833",
"0.5383777",
"0.5338573",
"0.5328128",
"0.53029835",
"0.53017867",
"0.5237113",
"0.52347934",
"0.52334166",
"0.521426",
"0.5193777",
"0.51723564",
"0.5170215"... | 0.60235804 | 0 |
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor. | @SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel3 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
entryTimeLabel = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
entryDateLabel = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
ticketLabel = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
priceTextField = new javax.swing.JTextField();
jLabel9 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
jLabel3.setText("jLabel3");
jLabel1.setFont(new java.awt.Font("Calibri", 1, 14)); // NOI18N
jLabel1.setText("HORA D'ENTRADA");
entryTimeLabel.setFont(new java.awt.Font("Calibri", 1, 14)); // NOI18N
entryTimeLabel.setForeground(new java.awt.Color(255, 0, 0));
jLabel4.setFont(new java.awt.Font("Calibri", 1, 14)); // NOI18N
jLabel4.setText("DATA D'ENTRADA");
entryDateLabel.setFont(new java.awt.Font("Calibri", 1, 14)); // NOI18N
entryDateLabel.setForeground(new java.awt.Color(255, 0, 0));
jLabel6.setFont(new java.awt.Font("Calibri", 1, 14)); // NOI18N
jLabel6.setText("NOMBRE DE COTXE");
ticketLabel.setFont(new java.awt.Font("Calibri", 1, 14)); // NOI18N
ticketLabel.setForeground(new java.awt.Color(255, 0, 0));
jLabel8.setFont(new java.awt.Font("Calibri", 0, 14)); // NOI18N
jLabel8.setForeground(new java.awt.Color(255, 0, 0));
jLabel8.setText("QUANTITAT PACTADA");
priceTextField.setFont(new java.awt.Font("Calibri", 1, 14)); // NOI18N
priceTextField.setForeground(new java.awt.Color(255, 0, 0));
priceTextField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
priceTextField.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR));
priceTextField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
priceTextFieldActionPerformed(evt);
}
});
jLabel9.setFont(new java.awt.Font("Calibri", 1, 14)); // NOI18N
jLabel9.setText("€");
jButton1.setText("Imprimir Ticket F1");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap(24, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton1)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(priceTextField)
.addComponent(ticketLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(entryDateLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(entryTimeLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel9)))
.addContainerGap(21, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap(67, Short.MAX_VALUE)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(entryTimeLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(entryDateLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(ticketLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel8)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(priceTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel9))
.addGap(18, 18, 18)
.addComponent(jButton1)
.addContainerGap(86, Short.MAX_VALUE))
);
pack();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Form() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n }",
"public frmRectangulo() {\n initComponents();\n }",
"public form() {\n ... | [
"0.73195183",
"0.7290407",
"0.7290407",
"0.7290407",
"0.72855854",
"0.7248445",
"0.7213232",
"0.72084314",
"0.7195551",
"0.71902007",
"0.71835697",
"0.7158979",
"0.71473545",
"0.70928645",
"0.70807934",
"0.70575565",
"0.6987147",
"0.6976941",
"0.69544566",
"0.69541115",
"0.69... | 0.0 | -1 |
Create an empty connection | public PhysicalLink() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Connection createConnection();",
"void createConnection();",
"public Connection() {\n\t\t\n\t}",
"private Connection() {\n\t\tSystem.out.println(\"--Connection Created--\");\n\t}",
"private Connection () {}",
"public AbstractConnection() {\n }",
"private void createConnection() {\n this.callb... | [
"0.766512",
"0.75754833",
"0.7311997",
"0.7272112",
"0.7232501",
"0.7053262",
"0.7000605",
"0.6930628",
"0.68422896",
"0.68120676",
"0.6796998",
"0.670253",
"0.6651761",
"0.65787363",
"0.6557283",
"0.65075004",
"0.6457524",
"0.6432525",
"0.63716984",
"0.63499373",
"0.6341383"... | 0.0 | -1 |
Create a connection between two devices | public PhysicalLink(Device deviceSource, int portSource, Device deviceDestination, int portDestination) {
this.deviceSource = deviceSource;
this.deviceDestination = deviceDestination;
this.portSource = portSource;
this.portDestination = portDestination;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void connectDevices() {\n Set<DeviceId> deviceSubjects =\n cfgRegistry.getSubjects(DeviceId.class, Tl1DeviceConfig.class);\n deviceSubjects.forEach(deviceId -> {\n Tl1DeviceConfig config =\n cfgRegistry.getConfig(deviceId, Tl1DeviceConfig.class);\n... | [
"0.6688644",
"0.65976924",
"0.6530609",
"0.6395609",
"0.63755447",
"0.63560754",
"0.63560754",
"0.63560754",
"0.6350922",
"0.6322047",
"0.62960327",
"0.6273654",
"0.6227304",
"0.6195672",
"0.61668223",
"0.6166321",
"0.613914",
"0.61301607",
"0.61094874",
"0.61015534",
"0.6072... | 0.0 | -1 |
Send a device to the destination. If there is no destination, the packet is ignored. | public void send(DataPacket packet){
if(deviceDestination != null){
deviceDestination.receive(packet, portDestination);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void send_data_packet(char dest, DatagramPacket dp) {\n if (win.is_local_name(dest)) {\n // Send to local node\n try {\n dp.setAddress(InetAddress.getLocalHost());\n dp.setPort(ds.getLocalPort());\n ds.send(dp);\n win.D... | [
"0.6092645",
"0.6012596",
"0.60090554",
"0.59283006",
"0.58234626",
"0.5754335",
"0.5690867",
"0.5676023",
"0.56621933",
"0.56449986",
"0.5595019",
"0.5517225",
"0.54761946",
"0.5440383",
"0.5411182",
"0.53399825",
"0.531895",
"0.5315918",
"0.5266743",
"0.525907",
"0.5255509"... | 0.708269 | 0 |
single method interface : functional interface > having single method | interface Shape{
void draw();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@FunctionalInterface\r\ninterface SingleMethod { // functional interface cant have more than one abstract method\r\n\tvoid method();\r\n\t\r\n}",
"@FunctionalInterface // or we can call it SAM\r\n interface ShowMe{\r\n\t\r\n\t void showOk();\r\n\t \r\n\tpublic default void one()\r\n\t {\r\n\t System.out.pr... | [
"0.74363744",
"0.7085697",
"0.70089453",
"0.6658784",
"0.66296613",
"0.66148335",
"0.6484289",
"0.6408373",
"0.64043444",
"0.6365112",
"0.63544446",
"0.63384616",
"0.63341993",
"0.63336605",
"0.6318386",
"0.62937903",
"0.62665445",
"0.6264772",
"0.6263576",
"0.6230613",
"0.62... | 0.0 | -1 |
To check before current day | public int isHistoryExist() {
int count = 0;
String selectCount = "SELECT COUNT * FROM" + DATA_TABLE
+ "WHERE" + Columns.DATE + " < DATE('NOW','LOCALTIME','START OF DAY')";
Cursor c = getReadableDatabase().rawQuery(selectCount, null);
if (c.getCount() > 0) {
c.moveToFirst();
count = c.getColumnIndex(Columns.DATE);
}
c.close();
return count;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean checkDate(){\n Calendar c = Calendar.getInstance();\n Date currentDate = new Date(c.get(Calendar.DAY_OF_MONTH),c.get(Calendar.MONTH)+1, c.get(Calendar.YEAR));\n return (isEqualOther(currentDate) || !isEarlyThanOther(currentDate));\n\n }",
"public static void playgroundForTi... | [
"0.7036067",
"0.70067894",
"0.6894435",
"0.6805271",
"0.6778581",
"0.6588725",
"0.6569387",
"0.6518489",
"0.6500328",
"0.6494263",
"0.6478323",
"0.64299345",
"0.6420058",
"0.63862234",
"0.6366325",
"0.6348187",
"0.6317097",
"0.6302585",
"0.6297255",
"0.6253501",
"0.6242844",
... | 0.568287 | 74 |
This program demonstrates the binarySearch algorithms. | public static void main(String[] args) {
List<Integer> integers = new ArrayList<>();
for (int i = 0; i < 49; i++) {
integers.add(i);
}
int i = Collections.binarySearch(integers, 20);
System.out.println(i);
System.out.println(integers.get(i));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n\tpublic void testBinarySearch() {\n\t\tint[] arr0 = {0, 1, 2, 3, 4, 5};\n\t\tassertEquals(0, _01_BinarySearch.binarySearch(arr0, 0, arr0.length - 1, 0));\n\t\tassertEquals(1, _01_BinarySearch.binarySearch(arr0, 0, arr0.length - 1, 1));\n\t\tassertEquals(2, _01_BinarySearch.binarySearch(arr0, 0, arr0.length... | [
"0.8023146",
"0.78956133",
"0.789333",
"0.76890516",
"0.7680474",
"0.7571359",
"0.75584894",
"0.7209756",
"0.7190228",
"0.71864414",
"0.7164502",
"0.7127718",
"0.71165955",
"0.71067023",
"0.7078976",
"0.7061505",
"0.704791",
"0.7034532",
"0.70176566",
"0.7007869",
"0.699922",... | 0.7084216 | 14 |
deleteUser: Elimina un usuario de la BBDD | @Override
@Transactional
public void deleteUser(Long id) {
UserEntity u = userRepository.findById(id).orElseThrow(() -> {
logger.warn(DataErrorMessages.USER_NO_CONTENT);
throw new UserNoContentException(DataErrorMessages.USER_NO_CONTENT);
});
for (RolEntity r : u.getRoles())
r.getUsers().remove(u);
userRepository.delete(u);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void deleteUser(User userToDelete) throws Exception;",
"public void deleteUser(Integer uid);",
"@Override\n\tpublic void deleteUser(User user)\n\t{\n\n\t}",
"public void deleteUser(long userId);",
"public void deleteUser() {\n\t\tSystem.out.println(\"com.zzu.yhl.a_jdk deleteUser\");\r\n\t}",
"void... | [
"0.8310827",
"0.8137065",
"0.8047431",
"0.80393016",
"0.801543",
"0.80139816",
"0.8010507",
"0.797415",
"0.7962837",
"0.7958931",
"0.7955162",
"0.79320264",
"0.7929311",
"0.78894794",
"0.78689283",
"0.7855704",
"0.7854756",
"0.7792027",
"0.7771958",
"0.7767561",
"0.7757925",
... | 0.0 | -1 |
getUsers: Muestra los datos de todos los usuarios registrados en la BBDD | @Override
@Transactional(readOnly = true)
public List<UserDto> getUsers() {
List<UserEntity> userEntities = userRepository.findAll();
List<UserDto> userDTOs = new ArrayList<>();
for (UserEntity u : userEntities)
userDTOs.add(etd.getUser(u));
return userDTOs;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List getAllUsers();",
"java.util.List<com.heroiclabs.nakama.api.User> \n getUsersList();",
"List<User> getUsers();",
"List<User> getUsers();",
"public List<User> getAllUsers();",
"public static List<User> getUsersList(){\n\t\tWSResponse response = null;\n\t\tList<User> resultList = new ArrayL... | [
"0.78470135",
"0.7592341",
"0.7558873",
"0.7558873",
"0.7523947",
"0.74917644",
"0.7491098",
"0.74889386",
"0.7467897",
"0.7467897",
"0.7450668",
"0.74199986",
"0.7419615",
"0.73916566",
"0.7318815",
"0.7318316",
"0.73168504",
"0.73166364",
"0.72908723",
"0.7264907",
"0.72307... | 0.6920353 | 67 |
Carga inicial de usuarios | @Override
public void loadUsers(List<UserDto> users) {
for (UserDto userDto : users) {
userRepository.save(dte.getUser(userDto));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void CargarUsuarios(){\n administradores.clear();\n usuariosList.clear();\n for (String i: BienvenidaActivity.UsuariosRegistrados.keySet()) {\n if(EsAdmin(i)){\n administradores.add(BienvenidaActivity.UsuariosRegistrados.get(i));\n }else{\n ... | [
"0.75745094",
"0.7522435",
"0.75197613",
"0.75144273",
"0.7483647",
"0.71692705",
"0.7089092",
"0.703124",
"0.7009955",
"0.6888007",
"0.6885774",
"0.6862427",
"0.6847042",
"0.6831291",
"0.6823443",
"0.6801252",
"0.6734518",
"0.6699745",
"0.6680509",
"0.66741025",
"0.66625506"... | 0.0 | -1 |
Query with from to option | public Map<Map<String, Object>, Map<String, Object>> queryFromAndTo(String siteId, int lastHours, String from, String to, String timeType) {
String[] fromToIndices = filterRangeDateIndices(from, to, lastHours, timeType);
boolean isLoggedTime = false;
if (lastHours > 0 || timeType.equals("h") || timeType.equals("m")) {
isLoggedTime = true;
}
return doMultiRequestForDays(siteId, fromToIndices, isLoggedTime, lastHours, timeType);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List<Timetable> getListSearch(String from, String to) throws Exception;",
"private String buildQuery(final String projectId, final Date date,\r\n\t\t\tfinal State from, final State to) {\r\n\r\n\t\treturn from.equals(to) ? buildReflexiveStateQuery(projectId, date, from)\r\n\t\t\t\t: buildFromToStateQuery(... | [
"0.62852967",
"0.61312455",
"0.6061059",
"0.60328877",
"0.59610724",
"0.5937072",
"0.59041274",
"0.5849119",
"0.5779491",
"0.5760647",
"0.57064116",
"0.5626522",
"0.5621093",
"0.55904573",
"0.5573877",
"0.5524749",
"0.5520023",
"0.54966265",
"0.5494475",
"0.5479024",
"0.54641... | 0.0 | -1 |
Inflate the layout for this fragment | @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_add_new_incident, container, false);
initView(view);
incidentData();
return view;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_main_allinfo, container, false);\n }",
"@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup... | [
"0.6739604",
"0.67235583",
"0.6721706",
"0.6698254",
"0.6691869",
"0.6687986",
"0.66869223",
"0.6684548",
"0.66766286",
"0.6674615",
"0.66654444",
"0.66654384",
"0.6664403",
"0.66596216",
"0.6653321",
"0.6647136",
"0.66423255",
"0.66388357",
"0.6637491",
"0.6634193",
"0.66251... | 0.0 | -1 |
root node is sequence | @Test
public void testSequence(){
Variable x = new Variable("x");
Operator plus = new Operator("+");
Expression one = f.createNumNode(1);
Expression two = f.createNumNode(2);
Expression exp = f.createInfixNode(plus, one, two);
Statement decl = f.createDeclNode(x);
Statement assign = f.createAssignNode(x,exp);
Statement seq = f.createSequenceNode(decl, assign);
assertEquals(seq.textRepresentation(), "var x; x = 1 + 2;");
ASTNodeCountVisitor v = new ASTNodeCountVisitor();
seq.accept(v);
assertEquals("sequence test1 fail", v.numCount, 2);
assertEquals("sequence test2 fail", v.infixCount, 1);
assertEquals("sequence test3 fail", v.decCount, 1);
assertEquals("sequence test4 fail", v.seqCount, 1);
assertEquals("sequence test5 fail", v.assignCount, 1);
assertEquals("sequence test6 fail", v.varCount, 0);
assertEquals("sequence test7 fail", v.strCount, 0);
assertEquals("sequence test8 fail", v.prefixCount, 0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void root(Node n) {}",
"@Override\r\n\tpublic Node<T> getRoot() {\r\n\t\treturn raiz;\r\n\t}",
"BiNode root()\n {\n return _root;\n }",
"protected IsamIndexNode getRoot() {\n\t\treturn root;\n\t}",
"public AVLNode getRoot() {\n return root;\n }",
"public Node getRoot(){\r\n ... | [
"0.6432339",
"0.63731587",
"0.6324098",
"0.617832",
"0.6107086",
"0.5991439",
"0.59525937",
"0.5935069",
"0.5910139",
"0.5908767",
"0.58819586",
"0.58312845",
"0.5828868",
"0.58168876",
"0.5803675",
"0.5773807",
"0.5768129",
"0.57662904",
"0.5760603",
"0.57599694",
"0.5746824... | 0.5666863 | 28 |
test Assignment root node | @Test
public void testAssignment(){
Variable x = new Variable("x");
Operator plus = new Operator("+");
Expression one = f.createNumNode(1);
Expression two = f.createNumNode(2);
Expression exp = f.createInfixNode(plus, one, two);
Statement assign = f.createAssignNode(x,exp);
assertEquals(assign.textRepresentation(), "x = 1 + 2;");
ASTNodeCountVisitor v = new ASTNodeCountVisitor();
assign.accept(v);
assertEquals("assignment test1 fail", v.numCount, 2);
assertEquals("assignment test2 fail", v.infixCount, 1);
assertEquals("assignment test3 fail", v.assignCount, 1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testAssignment() {\n try {\n Lexer lexer = new Lexer(new StringReader(\"n = 0;\"));\n Parser parser = new Parser(lexer);\n RootNode node = parser.program();\n AssignNode assignment = (AssignNode) node.get(0);\n assertTrue(assignme... | [
"0.7598308",
"0.6751423",
"0.660589",
"0.6367806",
"0.6331736",
"0.63049674",
"0.61460465",
"0.60963595",
"0.6074728",
"0.6010641",
"0.5973043",
"0.59586585",
"0.5953747",
"0.5904739",
"0.58141947",
"0.57918525",
"0.57812595",
"0.5764639",
"0.574947",
"0.57339334",
"0.5720572... | 0.66485035 | 2 |
test Declaration root node | @Test
public void testDeclaration(){
Variable x = new Variable("x");
Statement decl = f.createDeclNode(x);
assertEquals(decl.textRepresentation(), "var x;");
ASTNodeCountVisitor v = new ASTNodeCountVisitor();
decl.accept(v);
assertEquals("declaration test1 fail", v.numCount, 0);
assertEquals("declaration test2 fail", v.infixCount, 0);
assertEquals("declaration test3 fail", v.decCount, 1);
assertEquals("declaration test4 fail", v.seqCount, 0);
assertEquals("declaration test5 fail", v.assignCount, 0);
assertEquals("declaration test6 fail", v.varCount, 0);
assertEquals("declaration test7 fail", v.strCount, 0);
assertEquals("declaration test8 fail", v.prefixCount, 0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean hasAstRoot();",
"public Boolean isRootNode();",
"private boolean isDeclaration() throws IOException\n\t{\t\n\t\treturn isGlobalDeclaration();\n\t}",
"@Test\r\n public void testIsRoot() {\r\n System.out.println(\"isRoot\");\r\n ConfigNode configNode = new ConfigNode();\r\n ConfigNode childNo... | [
"0.63489604",
"0.62658757",
"0.611871",
"0.60003644",
"0.58676076",
"0.58304435",
"0.5802004",
"0.5767723",
"0.57513034",
"0.5738997",
"0.5731783",
"0.5727531",
"0.56941676",
"0.5660233",
"0.5646456",
"0.5646306",
"0.56400955",
"0.56318027",
"0.56183344",
"0.56157094",
"0.561... | 0.64957273 | 0 |
test InfixExpression root node | @Test
public void testInfix(){
Operator plus = new Operator("+");
Expression one = f.createNumNode(1);
Expression two = f.createNumNode(2);
Expression exp = f.createInfixNode(plus, one, two);
assertEquals(exp.textRepresentation(), "1 + 2");
ASTNodeCountVisitor v = new ASTNodeCountVisitor();
exp.accept(v);
assertEquals("Infix test1 fail", v.numCount, 2);
assertEquals("Infix test2 fail", v.infixCount, 1);
assertEquals("Infix test3 fail", v.decCount, 0);
assertEquals("Infix test4 fail", v.seqCount, 0);
assertEquals("Infix test5 fail", v.assignCount, 0);
assertEquals("Infix test6 fail", v.varCount, 0);
assertEquals("Infix test7 fail", v.strCount, 0);
assertEquals("Infix test8 fail", v.prefixCount, 0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private InfixExpression getNode()\n{\n return (InfixExpression) ast_node;\n}",
"@Test\n\t\tpublic void testExpression() throws LexicalException, SyntaxException {\n\t\t\tString input = \"x + 2\";\n\t\t\tPLPParser parser = makeParser(input);\n\t\t\tExpression e = parser.expression(); //call expression here ins... | [
"0.731527",
"0.7090504",
"0.6892176",
"0.64394957",
"0.6415602",
"0.6344996",
"0.6239656",
"0.6235181",
"0.6209506",
"0.6169098",
"0.61239386",
"0.6116347",
"0.61067665",
"0.6037107",
"0.6029156",
"0.6026183",
"0.601115",
"0.59992296",
"0.5996971",
"0.59913355",
"0.59646386",... | 0.754587 | 0 |
Wait until user comes to this tab before making the networking call. Also only make the networking call the first time the user comes to the tab. | @Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
if (isVisibleToUser && !alreadyMadeApplicationsApiCall) {
alreadyMadeApplicationsApiCall = true;
fetchItemsWithUrl(getActivity(), ApiManager.getApprovedApplicationsUrl());
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void doWhenNetworkCame() {\n doLogin();\n }",
"public void resetRoster() {\r\n\r\n\t\tif (NetworkAvailabilityReceiver.isInternetAvailable(ThatItApplication.getApplication())) {\r\n\r\n\t\t\tif(MainService.mService.connection.isConnec... | [
"0.60693604",
"0.5808356",
"0.5790863",
"0.5762867",
"0.5758331",
"0.5686667",
"0.56572586",
"0.5632522",
"0.5612135",
"0.5612109",
"0.5578145",
"0.5548482",
"0.5532156",
"0.5513182",
"0.5478879",
"0.5465606",
"0.545229",
"0.54249084",
"0.54220796",
"0.541424",
"0.5412872",
... | 0.0 | -1 |
No args constructor for use in serialization | public GenObfuscatedString() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"MyEncodeableWithoutPublicNoArgConstructor() {}",
"public ObjectSerializationEncoder() {\n // Do nothing\n }",
"@SuppressWarnings(\"unused\")\n public NoConstructor() {\n // Empty\n }",
"defaultConstructor(){}",
"public Data() {}",
"private SerializerFactory() {\n ... | [
"0.74630904",
"0.7387007",
"0.7210724",
"0.7029566",
"0.7018587",
"0.6977819",
"0.69339114",
"0.6881743",
"0.6739828",
"0.6727297",
"0.6717886",
"0.67169136",
"0.669586",
"0.669586",
"0.66750634",
"0.66246814",
"0.6604095",
"0.6532946",
"0.65235436",
"0.6500072",
"0.6466648",... | 0.0 | -1 |
Call only from assert! | public synchronized boolean verifyDocCounts() {
final int docCount = mInfo.getSegmentInfo().getDocCount();
int count;
if (mLiveDocs != null) {
count = 0;
for (int docID=0; docID < docCount; docID++) {
if (mLiveDocs.get(docID))
count ++;
}
} else {
count = docCount;
}
assert docCount - mInfo.getDelCount() - mPendingDeleteCount == count:
"info.docCount=" + docCount + " info.getDelCount()=" + mInfo.getDelCount() +
" pendingDeleteCount=" + mPendingDeleteCount + " count=" + count;
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected Assert() {\n\t}",
"private void assertAll() {\n\t\t\n\t}",
"protected Assert() {\n }",
"protected Assert() {\n }",
"@Override\r\n\t\t\tpublic void test() {\n\t\t\t}",
"private Mth()\n\t{\n\t\tthrow new AssertionError();\n\t}",
"private void test() {\n\n\t}",
"protected abstract void a... | [
"0.71831906",
"0.6944011",
"0.6692365",
"0.6692365",
"0.6540085",
"0.6291001",
"0.6276648",
"0.6235591",
"0.6223285",
"0.6172323",
"0.6161589",
"0.6136383",
"0.60860485",
"0.60597986",
"0.60423",
"0.5975468",
"0.59589034",
"0.5957881",
"0.5948926",
"0.5942799",
"0.59387165",
... | 0.0 | -1 |
Get reader for searching/deleting | public synchronized ISegmentReader getReader() throws IOException {
if (mReader == null) {
// We steal returned ref:
mReader = mWriter.getContext().newSegmentReader(mInfo);
if (mLiveDocs == null)
mLiveDocs = mReader.getLiveDocs();
}
// Ref for caller
mReader.increaseRef();
return mReader;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"DataReader reader();",
"public Reader getReader()\n {\n return reader;\n }",
"public JournalReader read() {\n return new JournalReader(this);\n }",
"protected final Reader getReader()\n {\n return _reader;\n }",
"public Reader getReader() {\r\n return reader;\r\n ... | [
"0.64184695",
"0.6249266",
"0.6232591",
"0.61696935",
"0.6167807",
"0.6103768",
"0.60477316",
"0.5872433",
"0.58551645",
"0.5829053",
"0.5818624",
"0.5773362",
"0.57303023",
"0.5691014",
"0.5665921",
"0.5593763",
"0.5519685",
"0.55166006",
"0.5497982",
"0.54692864",
"0.543536... | 0.5533503 | 16 |
Get reader for merging (does not load the terms index): | public synchronized ISegmentReader getMergeReader() throws IOException {
if (mMergeReader == null) {
if (mReader != null) {
// Just use the already opened non-merge reader
// for merging. In the NRT case this saves us
// pointless double-open:
// Ref for us:
mReader.increaseRef();
mMergeReader = mReader;
} else {
// We steal returned ref:
mMergeReader = mWriter.getContext().newSegmentReader(mInfo);
if (mLiveDocs == null)
mLiveDocs = mMergeReader.getLiveDocs();
}
}
// Ref for caller
mMergeReader.increaseRef();
return mMergeReader;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract Reader getReader() throws IOException;",
"public synchronized ISegmentReader getReader() throws IOException {\n\t\tif (mReader == null) {\n\t\t\t// We steal returned ref:\n\t\t\tmReader = mWriter.getContext().newSegmentReader(mInfo);\n\t\t\tif (mLiveDocs == null) \n\t\t\t\tmLiveDocs = mReader.... | [
"0.61853063",
"0.60354465",
"0.5982953",
"0.5927674",
"0.591132",
"0.59020746",
"0.58995587",
"0.57525575",
"0.57444835",
"0.57444835",
"0.5739936",
"0.57115763",
"0.5696198",
"0.5681752",
"0.5651881",
"0.564909",
"0.56227976",
"0.56227213",
"0.5609725",
"0.56008065",
"0.5597... | 0.7346101 | 0 |
NOTE: removes callers ref | public synchronized void dropReaders() throws IOException {
if (mReader != null) {
mReader.decreaseRef();
mReader = null;
}
if (mMergeReader != null) {
mMergeReader.decreaseRef();
mMergeReader = null;
}
decreaseRef();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void removeReference()\n {\n }",
"public void ref() {\n\n\t}",
"void unsetRef();",
"private void clearRefuse() {\n \n refuse_ = false;\n }",
"protected void releaseReferences() {\r\n\r\n\t}",
"private void removeCrossReference ()\n\t{\n\t\tif (crossReference != null)\n\... | [
"0.717062",
"0.695963",
"0.6954553",
"0.66937566",
"0.6501704",
"0.64368033",
"0.632554",
"0.61726403",
"0.60607964",
"0.59804446",
"0.5977138",
"0.5969302",
"0.5829081",
"0.5808377",
"0.58014786",
"0.57529914",
"0.56943005",
"0.5685309",
"0.56637955",
"0.5629829",
"0.5625672... | 0.0 | -1 |
Returns a ref to a clone. NOTE: this clone is not enrolled in the pool, so you should simply close() it when you're done (ie, do not call release()). | public synchronized ISegmentReader getReadOnlyClone() throws IOException {
if (mReader == null) {
getReader().decreaseRef();
assert mReader != null;
}
mShared = true;
if (mLiveDocs != null) {
return mWriter.getContext().newSegmentReader(mReader, mLiveDocs,
mInfo.getSegmentInfo().getDocCount() - mInfo.getDelCount() - mPendingDeleteCount);
} else {
assert mReader.getLiveDocs() == mLiveDocs;
mReader.increaseRef();
return mReader;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public ChannelReestablish clone() {\n\t\tlong ret = bindings.ChannelReestablish_clone(this.ptr);\n\t\tif (ret < 1024) { return null; }\n\t\tChannelReestablish ret_hu_conv = new ChannelReestablish(null, ret);\n\t\tret_hu_conv.ptrs_to.add(this);\n\t\treturn ret_hu_conv;\n\t}",
"public Function clone();",
"public... | [
"0.6621194",
"0.6586",
"0.65835977",
"0.6564742",
"0.6516611",
"0.6472608",
"0.6472608",
"0.64307976",
"0.64307976",
"0.64307976",
"0.64307976",
"0.63823354",
"0.63436985",
"0.63025284",
"0.6279054",
"0.62595576",
"0.6207339",
"0.61953443",
"0.61951363",
"0.6153301",
"0.61372... | 0.0 | -1 |
Discard (don't save) changes when we are dropping the reader; this is used only on the subreaders after a successful merge. If deletes had accumulated on those subreaders while the merge is running, by now we have carried forward those deletes onto the newly merged segment, so we can discard them on the subreaders: | public synchronized void dropChanges() {
mPendingDeleteCount = 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public synchronized void dropReaders() throws IOException {\n\t\tif (mReader != null) {\n\t\t\tmReader.decreaseRef();\n\t\t\tmReader = null;\n\t\t}\n\t\tif (mMergeReader != null) {\n\t\t\tmMergeReader.decreaseRef();\n\t\t\tmMergeReader = null;\n\t\t}\n\t\tdecreaseRef();\n\t}",
"private void removeDeadReaderIfThe... | [
"0.6590213",
"0.5627011",
"0.5511115",
"0.5326508",
"0.5324594",
"0.5312931",
"0.52996844",
"0.5260408",
"0.50678414",
"0.50587386",
"0.5058546",
"0.5044346",
"0.50385433",
"0.49518996",
"0.49214065",
"0.48828366",
"0.48741505",
"0.48280194",
"0.48088852",
"0.4777195",
"0.477... | 0.5500313 | 3 |
Commit live docs to the directory (writes new _X_N.del files); returns true if it wrote the file and false if there were no new deletes to write: | public synchronized boolean writeLiveDocs() throws IOException {
if (mPendingDeleteCount != 0) {
// We have new deletes
assert mLiveDocs.length() == mInfo.getSegmentInfo().getDocCount();
// We can write directly to the actual name (vs to a
// .tmp & renaming it) because the file is not live
// until segments file is written:
ILiveDocsFormat liveDocsFormat = mWriter.getIndexFormat().getLiveDocsFormat();
liveDocsFormat.writeLiveDocs(mWriter.getDirectory(),
(MutableBits)mLiveDocs, mInfo, mPendingDeleteCount);
// If we hit an exc in the line above (eg disk full)
// then info remains pointing to the previous
// (successfully written) del docs:
mInfo.advanceDelGen();
mInfo.setDelCount(mInfo.getDelCount() + mPendingDeleteCount);
mPendingDeleteCount = 0;
return true;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean hasDeleteFile();",
"public void testDeleteFileSuccess() throws Exception {\r\n assertNotNull(\"setup fails\", filePersistence);\r\n String writeString = \"Hello World\";\r\n String fileCreationId = filePersistence.createFile(VALID_FILELOCATION, FILENAME);\r\n filePersistence.a... | [
"0.5377575",
"0.5374879",
"0.53617215",
"0.53609097",
"0.53327113",
"0.5291388",
"0.52312416",
"0.51503015",
"0.5139182",
"0.51371944",
"0.5131613",
"0.5058936",
"0.5058736",
"0.5058736",
"0.50403917",
"0.5031166",
"0.50205934",
"0.5012844",
"0.5011731",
"0.50012255",
"0.4991... | 0.74154794 | 0 |
saveMemoryFile passTwo makes final pass at source, using symbol table to generate the object code | private ByteBuffer passTwo() {
// int hiAddress = ((((instructionCounter.getCurrentLocation() - 1) / SIXTEEN) + 2) * SIXTEEN) - 1;
int hiAddress = (instructionCounter.getCurrentLocation() - 1) | 0X0F;
ByteBuffer memoryImage = ByteBuffer.allocate(hiAddress + 1);
int lowestLocationSet = instructionCounter.getLowestLocationSet();
instructionCounter.reset(lowestLocationSet);
instructionCounter.setCurrentLocation(lowestLocationSet);
int currentLocation;
String instructionImage;
SourceLineParts sourceLineParts;
while (!allLineParts.isEmpty()) {
instructionImage = EMPTY_STRING;
currentLocation = instructionCounter.getCurrentLocation();
sourceLineParts = allLineParts.poll();
if (sourceLineParts.hasInstruction()) {
instructionImage = setMemoryBytesForInstruction(sourceLineParts);
} else if (sourceLineParts.hasDirective()) {
instructionImage = setMemoryBytesForDirective(sourceLineParts);
} // if
makeListing(currentLocation, instructionImage, sourceLineParts);
if (!instructionImage.equals(EMPTY_STRING)) {
buildMemoryImage(currentLocation, instructionImage, memoryImage);
} // if
} // while
tpListing.setCaretPosition(0);
makeXrefListing();
// makeMemoryFile(memoryImage);
return memoryImage;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void createExecutableFile() throws IOException {\r\n //if (report.getErrorList() == null)\r\n //{\r\n System.out.println(\"Currently generating the executable file.....\");\r\n executableFile = new File(sourceName + \".lst\");\r\n // if creating the lst file is successful... | [
"0.54986703",
"0.5362903",
"0.53182566",
"0.524686",
"0.5164923",
"0.5134443",
"0.5132224",
"0.51221",
"0.5117948",
"0.5107276",
"0.51012397",
"0.5098782",
"0.5042294",
"0.50321573",
"0.500858",
"0.5004245",
"0.49994096",
"0.49949932",
"0.4994825",
"0.49704355",
"0.4952268",
... | 0.62966317 | 0 |
makeListing passOne sets up the symbol table with initial value for Labels & symbols | private void passOne() {
// clearDoc(docListing);
int lineNumber;
String sourceLine;
// LineParser lineParser = new LineParser();
SourceLineAnalyzer lineAnalyzer = new SourceLineAnalyzer();
SourceLineParts sourceLineParts;
Scanner scannerPassOne = new Scanner(tpSource.getText());
while (scannerPassOne.hasNextLine()) {
sourceLine = scannerPassOne.nextLine();
if (sourceLine.equals(EMPTY_STRING)) {
continue;
} // if skip textbox's empty lines
sourceLineParts = lineAnalyzer.analyze(sourceLine);
if (!sourceLineParts.isLineActive()) {
continue;
} // if skip textbox's empty lines
lineNumber = sourceLineParts.getLineNumber();
allLineParts.add(sourceLineParts);
if (sourceLineParts.hasLabel()) {
processLabel(sourceLineParts, lineNumber);
} // if - has label
if (sourceLineParts.hasInstruction()) {
instructionCounter.incrementCurrentLocation(sourceLineParts.getOpCodeSize());
} // if instruction
if (sourceLineParts.hasDirective()) {
processDirectiveForLineCounter(sourceLineParts, lineNumber);
} // if directives
if (sourceLineParts.hasName()) {
processSymbol(sourceLineParts, lineNumber);
} // if has symbol
// displayStuff(lineParser);
} // while
SymbolTable.passOneDone();
scannerPassOne.close();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private SequentialSearchSymbolTable() {\n\t\t\tkeySet = new ArrayList<>();\n\t\t\tvalueSet = new ArrayList<>();\n\t\t\tsize = 0;\n\t\t}",
"public SymbolTable(){\r\n\t\tthis(INIT_CAPACITY);\r\n\t}",
"public SymbolTable()\r\n {\r\n // Create the tables stack and add the top level\r\n tables = ne... | [
"0.54990137",
"0.54648757",
"0.5428848",
"0.5428714",
"0.5412602",
"0.5410967",
"0.519192",
"0.5143189",
"0.50860745",
"0.50667536",
"0.50630045",
"0.5028162",
"0.5021958",
"0.50000477",
"0.49463484",
"0.49314165",
"0.49230894",
"0.49122375",
"0.48921254",
"0.48581058",
"0.48... | 0.47899213 | 25 |
resolveExpression / / / Launch the application. | public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
ASM window = new ASM();
window.frmAsmAssembler.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
} // try
}// run
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static InvocationExpression invoke(Expression expression, Expression arguments[]) { throw Extensions.todo(); }",
"void launchApp();",
"private void appLaunch(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_appLaunch\n String path = System.getProperty(\"user.dir\"); // Get the application path\... | [
"0.5620465",
"0.56057286",
"0.5579947",
"0.5558349",
"0.5384434",
"0.53202945",
"0.5188073",
"0.5002836",
"0.49598527",
"0.49281967",
"0.49277675",
"0.48254424",
"0.48131195",
"0.47931132",
"0.4790375",
"0.47465253",
"0.47424206",
"0.4738486",
"0.47291973",
"0.47246936",
"0.4... | 0.0 | -1 |
constructor Initialize the contents of the frame. | private void initialize() {
frmAsmAssembler = new JFrame();
frmAsmAssembler.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent arg0) {
appClose();
}
});
frmAsmAssembler.setTitle("ASM - assembler for Zilog Z80 2.1.0");
frmAsmAssembler.setBounds(100, 100, 662, 541);
frmAsmAssembler.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
GridBagLayout gridBagLayout = new GridBagLayout();
gridBagLayout.columnWidths = new int[] { 0, 0 };
gridBagLayout.rowHeights = new int[] { 0, 30, 0 };
gridBagLayout.columnWeights = new double[] { 1.0, Double.MIN_VALUE };
gridBagLayout.rowWeights = new double[] { 1.0, 0.0, Double.MIN_VALUE };
frmAsmAssembler.getContentPane().setLayout(gridBagLayout);
JPanel panelTop = new JPanel();
GridBagConstraints gbc_panelTop = new GridBagConstraints();
gbc_panelTop.insets = new Insets(0, 0, 5, 0);
gbc_panelTop.fill = GridBagConstraints.BOTH;
gbc_panelTop.gridx = 0;
gbc_panelTop.gridy = 0;
frmAsmAssembler.getContentPane().add(panelTop, gbc_panelTop);
GridBagLayout gbl_panelTop = new GridBagLayout();
gbl_panelTop.columnWidths = new int[] { 0, 0 };
gbl_panelTop.rowHeights = new int[] { 0, 0, 0 };
gbl_panelTop.columnWeights = new double[] { 1.0, Double.MIN_VALUE };
gbl_panelTop.rowWeights = new double[] { 0.0, 1.0, Double.MIN_VALUE };
panelTop.setLayout(gbl_panelTop);
lblSourceFilePath = new JLabel(NO_FILE);
GridBagConstraints gbc_lblSourceFilePath = new GridBagConstraints();
gbc_lblSourceFilePath.insets = new Insets(0, 0, 5, 0);
gbc_lblSourceFilePath.anchor = GridBagConstraints.NORTH;
gbc_lblSourceFilePath.gridx = 0;
gbc_lblSourceFilePath.gridy = 0;
panelTop.add(lblSourceFilePath, gbc_lblSourceFilePath);
JPanel panelMain = new JPanel();
GridBagConstraints gbc_panelMain = new GridBagConstraints();
gbc_panelMain.fill = GridBagConstraints.BOTH;
gbc_panelMain.gridx = 0;
gbc_panelMain.gridy = 1;
panelTop.add(panelMain, gbc_panelMain);
GridBagLayout gbl_panelMain = new GridBagLayout();
gbl_panelMain.columnWidths = new int[] { 80, 0, 0 };
gbl_panelMain.rowHeights = new int[] { 0, 0 };
gbl_panelMain.columnWeights = new double[] { 0.0, 1.0, Double.MIN_VALUE };
gbl_panelMain.rowWeights = new double[] { 1.0, Double.MIN_VALUE };
panelMain.setLayout(gbl_panelMain);
JPanel panelLeft = new JPanel();
GridBagConstraints gbc_panelLeft = new GridBagConstraints();
gbc_panelLeft.insets = new Insets(0, 0, 0, 5);
gbc_panelLeft.fill = GridBagConstraints.VERTICAL;
gbc_panelLeft.gridx = 0;
gbc_panelLeft.gridy = 0;
panelMain.add(panelLeft, gbc_panelLeft);
GridBagLayout gbl_panelLeft = new GridBagLayout();
gbl_panelLeft.columnWidths = new int[] { 0, 0, 0 };
gbl_panelLeft.rowHeights = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
gbl_panelLeft.columnWeights = new double[] { 0.0, 1.0, Double.MIN_VALUE };
gbl_panelLeft.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
Double.MIN_VALUE };
panelLeft.setLayout(gbl_panelLeft);
btnStart = new JButton("Start");
btnStart.setEnabled(false);
btnStart.setName(START_BUTTON);
btnStart.addActionListener(adapterForASM);
GridBagConstraints gbc_btnStart = new GridBagConstraints();
gbc_btnStart.insets = new Insets(0, 0, 5, 5);
gbc_btnStart.anchor = GridBagConstraints.NORTH;
gbc_btnStart.gridx = 0;
gbc_btnStart.gridy = 0;
panelLeft.add(btnStart, gbc_btnStart);
rbListing = new JRadioButton("Listing");
rbListing.setSelected(true);
GridBagConstraints gbc_rbListing = new GridBagConstraints();
gbc_rbListing.anchor = GridBagConstraints.WEST;
gbc_rbListing.insets = new Insets(0, 0, 5, 5);
gbc_rbListing.gridx = 0;
gbc_rbListing.gridy = 2;
panelLeft.add(rbListing, gbc_rbListing);
rbMemFile = new JRadioButton("Mem File");
rbMemFile.setSelected(true);
GridBagConstraints gbc_rbMemFile = new GridBagConstraints();
gbc_rbMemFile.anchor = GridBagConstraints.WEST;
gbc_rbMemFile.insets = new Insets(0, 0, 5, 5);
gbc_rbMemFile.gridx = 0;
gbc_rbMemFile.gridy = 4;
panelLeft.add(rbMemFile, gbc_rbMemFile);
rbHexFile = new JRadioButton("Hex File");
rbHexFile.setSelected(true);
GridBagConstraints gbc_rbHexFile = new GridBagConstraints();
gbc_rbHexFile.anchor = GridBagConstraints.WEST;
gbc_rbHexFile.insets = new Insets(0, 0, 5, 5);
gbc_rbHexFile.gridx = 0;
gbc_rbHexFile.gridy = 6;
panelLeft.add(rbHexFile, gbc_rbHexFile);
JButton btnLoadLastFile = new JButton("Load Last File");
btnLoadLastFile.setName(BTN_LOAD_LAST_FILE);
btnLoadLastFile.addActionListener(adapterForASM);
rbTerse = new JRadioButton("Terse");
rbTerse.setSelected(true);
GridBagConstraints gbc_rbTerse = new GridBagConstraints();
gbc_rbTerse.anchor = GridBagConstraints.WEST;
gbc_rbTerse.insets = new Insets(0, 0, 5, 5);
gbc_rbTerse.gridx = 0;
gbc_rbTerse.gridy = 8;
panelLeft.add(rbTerse, gbc_rbTerse);
GridBagConstraints gbc_btnLoadLastFile = new GridBagConstraints();
gbc_btnLoadLastFile.anchor = GridBagConstraints.NORTH;
gbc_btnLoadLastFile.insets = new Insets(0, 0, 0, 5);
gbc_btnLoadLastFile.gridx = 0;
gbc_btnLoadLastFile.gridy = 10;
panelLeft.add(btnLoadLastFile, gbc_btnLoadLastFile);
splitPane = new JSplitPane();
splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
splitPane.setDividerSize(8);
splitPane.setOneTouchExpandable(true);
GridBagConstraints gbc_splitPane = new GridBagConstraints();
gbc_splitPane.fill = GridBagConstraints.BOTH;
gbc_splitPane.gridx = 1;
gbc_splitPane.gridy = 0;
panelMain.add(splitPane, gbc_splitPane);
spSource = new JScrollPane();
splitPane.setLeftComponent(spSource);
lblSourceFileName = new JLabel(NO_FILE);
lblSourceFileName.setForeground(Color.BLUE);
lblSourceFileName.setFont(new Font("Tahoma", Font.PLAIN, 15));
lblSourceFileName.setHorizontalAlignment(SwingConstants.CENTER);
spSource.setColumnHeaderView(lblSourceFileName);
tpSource = new JTextPane();
tpSource.setFont(new Font("Courier New", Font.PLAIN, 14));
spSource.setViewportView(tpSource);
spListing = new JScrollPane();
splitPane.setRightComponent(spListing);
lblListingFileName = new JLabel(NO_FILE);
lblListingFileName.setHorizontalAlignment(SwingConstants.CENTER);
lblListingFileName.setForeground(Color.BLUE);
lblListingFileName.setFont(new Font("Tahoma", Font.PLAIN, 15));
spListing.setColumnHeaderView(lblListingFileName);
tpListing = new JTextPane();
tpListing.setFont(new Font("Courier New", Font.PLAIN, 14));
spListing.setViewportView(tpListing);
panelStatus = new JPanel();
panelStatus.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
GridBagConstraints gbc_panelStatus = new GridBagConstraints();
gbc_panelStatus.fill = GridBagConstraints.BOTH;
gbc_panelStatus.gridx = 0;
gbc_panelStatus.gridy = 1;
frmAsmAssembler.getContentPane().add(panelStatus, gbc_panelStatus);
GridBagLayout gbl_panelStatus = new GridBagLayout();
gbl_panelStatus.columnWidths = new int[] { 0, 0 };
gbl_panelStatus.rowHeights = new int[] { 0, 0 };
gbl_panelStatus.columnWeights = new double[] { 0.0, Double.MIN_VALUE };
gbl_panelStatus.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
panelStatus.setLayout(gbl_panelStatus);
lblStatus = new JLabel("");
lblStatus.setForeground(Color.RED);
lblStatus.setFont(new Font("Tahoma", Font.PLAIN, 14));
GridBagConstraints gbc_lblStatus = new GridBagConstraints();
gbc_lblStatus.gridx = 0;
gbc_lblStatus.gridy = 0;
panelStatus.add(lblStatus, gbc_lblStatus);
menuBar = new JMenuBar();
frmAsmAssembler.setJMenuBar(menuBar);
JMenu mnuFile = new JMenu("File");
menuBar.add(mnuFile);
JMenuItem mnuFileOpen = new JMenuItem("Open File");
mnuFileOpen.setName(MNU_FILE_OPEN);
mnuFileOpen.addActionListener(adapterForASM);
mnuFile.add(mnuFileOpen);
separator = new JSeparator();
mnuFile.add(separator);
mnuFilePrintSource = new JMenuItem("Print Source");
mnuFilePrintSource.setName(MNU_FILE_PRINT_SOURCE);
mnuFilePrintSource.addActionListener(adapterForASM);
mnuFile.add(mnuFilePrintSource);
mnuFilePrintListing = new JMenuItem("Print Listing");
mnuFilePrintListing.setName(MNU_FILE_PRINT_LISTING);
mnuFilePrintListing.addActionListener(adapterForASM);
mnuFile.add(mnuFilePrintListing);
separator_1 = new JSeparator();
mnuFile.add(separator_1);
JMenuItem mnuFileExit = new JMenuItem("Exit");
mnuFileExit.setName(MNU_FILE_EXIT);
mnuFileExit.addActionListener(adapterForASM);
mnuFile.add(mnuFileExit);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public BreukFrame() {\n super();\n initialize();\n }",
"public SiscobanFrame() {\r\n\t\tsuper();\r\n\t\tinitialize();\r\n\t}",
"public MainFrame() {\n\t\tsuper();\n\t\tinitialize();\n\t}",
"public Frame() {\n initComponents();\n }",
"public Frame() {\n initComponents();\n }",
"... | [
"0.78244245",
"0.74921596",
"0.7488774",
"0.72030306",
"0.72030306",
"0.7059994",
"0.7036561",
"0.6971081",
"0.6883096",
"0.68558747",
"0.6848607",
"0.68399507",
"0.68285596",
"0.6826888",
"0.68144494",
"0.6809286",
"0.67809606",
"0.67641187",
"0.67580295",
"0.6741946",
"0.67... | 0.0 | -1 |
Rest API controller for /widgets. | @RequestMapping(path = "/widgets")
public interface WidgetApi {
/**
* {@code GET /widgets}. <br>
* Lists requested widgets ordered by z-index in ascending order.
*
* @param limit Limits the amount of widgets in the output. Default value is 10 if not provided.
* Max value is 500.
* @param afterId ID token to perform widgets search after.
* @return {@link Page} of {@link List<Widget>} wrapped into {@link ResponseEntity}.
*/
@GetMapping(produces = APPLICATION_JSON_VALUE)
ResponseEntity<Page<Widget>> listWidgets(
@PathParam("limit") @Nullable Integer limit, @PathParam("afterId") @Nullable String afterId);
/**
* {@code GET /widgets/:id}. <br>
* Reads widget by provided ID.
*
* @param id ID to look for widget.
* @return {@link Widget} wrapped into {@link ResponseEntity}.
*/
@GetMapping(path = "/{id}", produces = APPLICATION_JSON_VALUE)
ResponseEntity<Widget> readWidget(@PathVariable("id") final String id);
/**
* {@code POST /widgets}. <br>
* Creates new widget. If z-index is not provided places the widget in the foreground of existing
* widgets. If z-index is provided and there is existing widget at that z-index than starting from
* the provided z-index all the widgets are shifted upwards.
*
* @param widgetToCreate Widget creation payload.
* @return {@link Widget} wrapped into {@link ResponseEntity}.
*/
@PostMapping(consumes = APPLICATION_JSON_VALUE, produces = APPLICATION_JSON_VALUE)
ResponseEntity<Widget> createWidget(@RequestBody final WidgetCreateRequest widgetToCreate);
/**
* {@code PUT /widgets/:id}. <br>
* Updates existing widgets by provided ID. If z-index is provided and there is already existing
* widget and new z-index acts similar to {@link WidgetApi#createWidget} and shifts existing
* widgets upwards.
*
* @param id ID to look for widget to update.
* @param widgetUpdate Widget update payload.
* @return {@link Widget} wrapped into {@link ResponseEntity}.
*/
@PutMapping(path = "/{id}", consumes = APPLICATION_JSON_VALUE, produces = APPLICATION_JSON_VALUE)
ResponseEntity<Widget> updateWidget(
@PathVariable("id") final String id, @RequestBody final WidgetUpdateRequest widgetUpdate);
/**
* {@code DELETE /widgets/:id}. <br>
* Removes existing widget by provided ID.
*
* @param id ID to look for widget to remove.
* @return Empty response.
*/
@DeleteMapping(path = "/{id}", produces = APPLICATION_JSON_VALUE)
ResponseEntity<?> deleteWidget(@PathVariable("id") final String id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List<Widget> getWidgets() {\n return widgets;\n }",
"public Action getIndexApiAction() {\r\n Thing object = new Thing.Builder()\r\n .setName(\"Dashboard Page\") // TODO: Define a title for the content shown.\r\n // TODO: Make sure this auto-generated URL is correct... | [
"0.57292897",
"0.5500789",
"0.53985196",
"0.5360569",
"0.5248249",
"0.5226917",
"0.5167984",
"0.516721",
"0.516721",
"0.516721",
"0.51336706",
"0.5131223",
"0.51290303",
"0.5127846",
"0.51075906",
"0.50901",
"0.50860256",
"0.50836587",
"0.50825286",
"0.50825286",
"0.50825286"... | 0.7103527 | 0 |
Do something before each test method. | @Before
public void setUp() throws Exception {
INIT_LOC = new Location(INIT_LOC_STRING);
ERR_LOC = new Location(ERR_LOC_STRING);
INIT_LOCGRB = new LocationGroup(INIT_LOCGB_STRING);
ERR_LOCGRB = new LocationGroup(ERR_LOCGB_STRING);
mockMvc = MockMvcBuilders
.webAppContextSetup(context)
.apply(MockMvcRestDocumentation.documentationConfiguration(restDocumentation).uris()
.withPort(8888))
.addFilters(new CharacterEncodingFilter("UTF-8", true))
.build();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void runBeforeTest() {}",
"@Before\n public void setUp() {\n System.out.println(\"\\n@Before - Setting Up Stuffs: Pass \"\n + ++setUpCount);\n // write setup code that must be executed before each test method run\n }",
"@Before\n public void beforeTest(){\n\n\n ... | [
"0.83572924",
"0.8082353",
"0.7994191",
"0.79801756",
"0.7842301",
"0.7835119",
"0.7835119",
"0.7819091",
"0.77521104",
"0.77314323",
"0.77110744",
"0.76923996",
"0.7684611",
"0.7680175",
"0.7680175",
"0.76422644",
"0.76041543",
"0.75971746",
"0.7537205",
"0.7537205",
"0.7537... | 0.0 | -1 |
TODO Check if .sqlite exists. If not, initialise one. | public void start()
{
try
{
new JDABuilder(this.appconfig.authType)
.setToken(this.appconfig.authToken)
.setAudioEnabled(false)
.setAutoReconnect(true)
.addEventListener(new DiscordMonitorListenerAdapterPrep())
.buildBlocking(); // TODO use .buildAsync()?
}
catch (LoginException | IllegalArgumentException e)
{
System.err.println("error: Log in failed. Please check provided token.");
}
catch (RateLimitedException e)
{
System.err.println("error: This application is being rate limited by Discord.");
}
catch (InterruptedException e)
{
System.err.println("fatal: Unexpected interrupt.");
e.printStackTrace();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void initialize() {\n if (databaseExists()) {\n SharedPreferences prefs = PreferenceManager\n .getDefaultSharedPreferences(mContext);\n int dbVersion = prefs.getInt(SP_KEY_DB_VER, 1);\n if (DATABASE_VERSION != dbVersion) {\n File dbF... | [
"0.64703035",
"0.64495844",
"0.644251",
"0.6418665",
"0.6382899",
"0.62805676",
"0.6230859",
"0.61717254",
"0.61601835",
"0.61522526",
"0.6130959",
"0.6099755",
"0.6096142",
"0.60049766",
"0.5998406",
"0.5988261",
"0.5980787",
"0.59629756",
"0.5958582",
"0.59373903",
"0.59294... | 0.0 | -1 |
Can apparently only happen in TextChannels (guilds). | @Override
public void onMessageBulkDelete(MessageBulkDeleteEvent event)
{
//These are provided with every event in JDA
JDA jda = event.getJDA(); //JDA, the core of the api.
long serverId = event.getGuild().getIdLong();
long channelId = event.getChannel().getIdLong();
boolean declaredLoggableHit = false;
for (DiscordMonitorTargetIdentifier targetid : DiscordMonitor.this.appconfig.logTargets)
{
if (!targetid.matches(serverId, channelId, null, null, null, MessageEventType.DELETE))
continue;
// All conditions passed.
if (!declaredLoggableHit)
{
declaredLoggableHit = true;
System.out.print("(i) Logging for:");
}
System.out.print(" " + targetid.identifierLabel);
}
if (declaredLoggableHit)
System.out.println();
boolean declaredNotificationHit = false;
for (DiscordMonitorTargetIdentifier targetid : DiscordMonitor.this.appconfig.notificationWatchlist)
{
if (!targetid.matches(serverId, channelId, null, null, null, MessageEventType.DELETE))
continue;
// All conditions passed.
if (!declaredNotificationHit)
{
declaredNotificationHit = true;
System.out.print("/!\\ WATCHLIST HIT:");
}
System.out.print(" " + targetid.identifierLabel);
}
if (declaredNotificationHit)
System.out.println();
StringBuilder msg = new StringBuilder("\n")
.append("Time: ").append(OffsetDateTime.now().format(DiscordMonitor.LOG_DATETIME_FORMAT)).append(" (approximate)")
.append("\nMESSAGES DELETED:");
for (String msgId : event.getMessageIds())
msg.append(" ").append(msgId);
//TODO Poll .sqlite db for previous message details
TextChannel textChannel = (TextChannel)event.getChannel();
System.out.printf("(%s)[%s]: %s\n\n", textChannel.getGuild().getName(), textChannel.getName(), msg);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"java.lang.String getChannel();",
"@Override\n\tprotected void channelRead0(ChannelHandlerContext ctx, WsClientMessage msg) throws Exception {\n\t}",
"@Override\n public void channelActive(ChannelHandlerContext ctx) throws Exception {\n super.channelActive(ctx);... | [
"0.62562484",
"0.614711",
"0.608656",
"0.60818833",
"0.6045069",
"0.60338587",
"0.60250765",
"0.60201836",
"0.59872633",
"0.59408593",
"0.5926235",
"0.5887051",
"0.58763343",
"0.5861408",
"0.5832927",
"0.582569",
"0.57994294",
"0.57975364",
"0.5751802",
"0.57416236",
"0.57311... | 0.0 | -1 |
EFFECTS: returns a String describing the location of the person, or the police station where the fingerprints are being held | String getLocation(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String location();",
"String location();",
"String location();",
"String location();",
"String location();",
"String location();",
"String location();",
"String location();",
"java.lang.String getLocation();",
"private String describeLocation() {\n\t\tSWLocation location = this.world.getEntityMan... | [
"0.6199599",
"0.6199599",
"0.6199599",
"0.6199599",
"0.6199599",
"0.6199599",
"0.6199599",
"0.6199599",
"0.5966612",
"0.5886528",
"0.5666697",
"0.5653689",
"0.5620554",
"0.56076473",
"0.5599191",
"0.5582682",
"0.5581724",
"0.55758053",
"0.5574918",
"0.55261105",
"0.5515098",
... | 0.613609 | 9 |
EFFECTS: returns an object to help police officers find suspect ex. the cell phone, or the person with the fingerprint | Object getTrace(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@RestrictTo(Scope.LIBRARY_GROUP)\n @Nullable\n Fingerprint getFingerprint();",
"public String getFingerprint() {\n return fingerprint;\n }",
"java.lang.String getFingerPrint();",
"private meterMaidPerception getPerceptions() {\n\t\t\r\n\t\tMessageTemplate mt = MessageTemplate.MatchPerformat... | [
"0.5227843",
"0.51711655",
"0.5168261",
"0.51660115",
"0.5090433",
"0.5064033",
"0.5064033",
"0.5064033",
"0.5017273",
"0.5015996",
"0.4974751",
"0.49521005",
"0.48710153",
"0.4853605",
"0.4852547",
"0.48478055",
"0.4847254",
"0.4810902",
"0.47980332",
"0.47955713",
"0.479031... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.