id stringlengths 36 36 | text stringlengths 1 1.25M |
|---|---|
b69c80a2-dfd4-4b88-b670-d62bb2a3e9a4 | @Override
public void run() {
try {
Server.main(null);
} catch (IOException e) {
throw new RuntimeException(e);
}
} |
cb6ba945-ca9e-4b20-8a69-235f842c49de | @Test
public void testServer() throws Exception {
Socket socket = new Socket("localhost", 1755);
ObjectInput in = new ObjectInputStream(socket.getInputStream());
HarvesterInfo harvesterInfo = (HarvesterInfo)in.readObject();
assertNotNull(harvesterInfo);
assertTrue(harvesterInfo.getFreeRam() > 0);
assertTrue(harvesterInfo.getFreeSwap() > 0);
} |
df435d68-c7b4-4390-a386-aa642a69a95f | @After
public void tearDown() throws Exception {
serverThread.stop();
} |
9f675d60-f63e-42bb-873a-ea474b499df2 | @Test
public void testCollect() throws Exception {
NodeInfoCollector testClass = NodeInfoCollector.getInstance();
HarvesterInfo harvesterInfo = testClass.collect();
assertTrue(harvesterInfo.getFreeRam() > 0);
assertTrue(harvesterInfo.getFreeSwap() > 0);
} |
bca1c1df-7f0a-4d7d-a023-d7634bbaccd7 | public Long getId() {
return id;
} |
4c646e2d-3e53-4e2f-b1ce-75629e369c10 | public void setId(Long id) {
this.id = id;
} |
c1cf1ea4-62b2-4d28-96c4-6670fc4709a2 | @Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
} |
11dd18b8-1e62-4c07-8068-6175d1a417f6 | @Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Mensajero)) {
return false;
}
Mensajero other = (Mensajero) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
} |
b158b9b6-43fe-4e8f-9702-f48bd76f2804 | @Override
public String toString() {
return "com.superenvios.model.Mensajero[ id=" + id + " ]";
} |
aafe25cd-c1e2-46cf-a3aa-a5a1abe72edb | public Boolean getActivo() {
return activo;
} |
da82895c-43b2-45a0-8142-088a44fa0c18 | public void setActivo(Boolean activo) {
this.activo = activo;
} |
1b9b1d1d-d23e-43ef-a5b0-63acc93c2d24 | public Envio getEnvio() {
return envio;
} |
d8d4e5f2-2b3a-4dd8-8eb7-0efa34386f79 | public void setEnvio(Envio envio) {
this.envio = envio;
} |
c977fc2c-6364-4f33-99d0-5fad4a7bf9d7 | public Long getId() {
return id;
} |
c8ad5b06-01fb-45b3-a319-e5674bbf473d | public void setId(Long id) {
this.id = id;
} |
5202976c-4d0e-41e5-8fc1-1313cbbb18e9 | @Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
} |
32c86277-3837-45a0-97bb-22bee5ba786b | @Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Rol)) {
return false;
}
Rol other = (Rol) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
} |
93816da8-4b24-4124-a63b-737d3a814d3c | @Override
public String toString() {
return "com.superenvios.model.Rol[ id=" + id + " ]";
} |
ab130818-987a-49d2-b908-038af71a779a | public Set<PERMISOS> getPermiso() {
return permiso;
} |
f1c1d5bb-d781-49bb-b950-acb25134d531 | public void setPermiso(Set<PERMISOS> permiso) {
this.permiso = permiso;
} |
1f8cad9e-d999-4870-a7d2-54bd0f0333c2 | public Long getId() {
return id;
} |
5b43ab7a-20a0-48b8-8d84-45b2bc588dcc | public void setId(Long id) {
this.id = id;
} |
ebc26d56-c19f-4af4-9a17-c85ed3d7815e | @Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
} |
df29fb0d-b735-4a78-85c2-55b44d2a8f2d | @Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Persona)) {
return false;
}
Persona other = (Persona) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
} |
962328c0-192b-47a0-89bb-4195cd461660 | @Override
public String toString() {
return "com.superenvios.model.Persona[ id=" + id + " ]";
} |
4c496fbe-0082-4008-9892-e237cb1b18f3 | public Long getCedula() {
return cedula;
} |
9f44a448-5991-4564-8fef-2da03bd445a5 | public void setCedula(Long cedula) {
this.cedula = cedula;
} |
9053360e-26bb-40f1-8da7-579cad959ee1 | public String getNombre() {
return nombre;
} |
fdb889c5-1842-49d5-9891-03332a7e26e9 | public void setNombre(String nombre) {
this.nombre = nombre;
} |
7a6f0362-39fa-4521-8759-5be072ee9aef | public Rol getRol() {
return rol;
} |
50f09a97-8959-4db5-8a6c-8516931cc6a4 | public void setRol(Rol rol) {
this.rol = rol;
} |
b51246db-3af8-492c-960d-e8cd44cfeb03 | public Long getTelefono() {
return telefono;
} |
a2b6ce98-4df0-4faf-b60c-b1dfb8db6d8c | public void setTelefono(Long telefono) {
this.telefono = telefono;
} |
c2b6eab7-65e0-4d28-bcdb-594547a9da2d | public String getPassword() {
return password;
} |
5c099328-f727-4f51-8ed8-7ee979ee06f7 | public void setPassword(String password) {
this.password = password;
} |
720dbc2f-2619-4483-b786-8e1d846823c7 | public Long getId() {
return id;
} |
550d712c-0ac5-4200-a670-80bfe632e5f8 | public void setId(Long id) {
this.id = id;
} |
9eb3495b-568a-4d1f-a863-3259b9b20e85 | @Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
} |
a35e92b7-9a06-46ee-8a01-76e0ccd5bcfb | @Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Envio)) {
return false;
}
Envio other = (Envio) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
} |
b9772660-d4f3-46c2-b40c-54d6a8914441 | @Override
public String toString() {
return "com.superenvios.model.Envio[ id=" + id + " ]";
} |
ac2c5967-f456-450e-8b60-d39af742c77c | public String getOrigen() {
return origen;
} |
68653536-414c-41e0-a610-f7a86375e797 | public void setOrigen(String origen) {
this.origen = origen;
} |
4f158cb9-36ab-4518-bdfd-bb6528dcbfbc | public String getDestino() {
return destino;
} |
11fd7de2-d67a-4b00-8f3b-ad760c6db486 | public void setDestino(String destino) {
this.destino = destino;
} |
8ae11960-4fe6-4a59-b405-a7a1887a6919 | public STATE getEstado() {
return estado;
} |
834e2d13-8902-426f-87b8-c64feac5c5ef | public void setEstado(STATE estado) {
this.estado = estado;
} |
72684bb0-7d43-479f-8a90-dae02de886fa | public String getNombreDestinatario() {
return nombreDestinatario;
} |
7c8c9017-bf7a-46fa-8f1b-6e685f8ff017 | public void setNombreDestinatario(String nombreDestinatario) {
this.nombreDestinatario = nombreDestinatario;
} |
3c219294-961f-4eda-b6cb-c133c0449b4e | public String getObservaciones() {
return observaciones;
} |
9cd401d7-b4fa-4e35-b9ff-1336a1d98a1d | public void setObservaciones(String observaciones) {
this.observaciones = observaciones;
} |
6a74da5c-34a4-46e1-a6d9-bbb705741080 | private STATE(String name){
this.name=name;
} |
02c3c68e-b7e2-4f33-bf40-41a6dd19141d | public String getName(){
return name;
} |
38105ba7-93b7-4bd0-8b2e-55e7b067bc4a | void create(Persona persona); |
78eaf904-f8db-4890-aaee-fdb68fd401bb | void edit(Persona persona); |
4e64e466-5d15-4fc2-b312-d0ab8c495df6 | void remove(Persona persona); |
f516b79d-ea89-4c5b-bdcc-68978434dd79 | Persona find(Object id); |
9aa71d01-3f3c-41ca-b190-5a4c474486f9 | List<Persona> findAll(); |
122346c1-4abb-413a-b23c-68b3b309cc0c | List<Persona> findRange(int[] range); |
74a5ec31-f926-4598-9960-cc6f7cb8b4be | int count(); |
dee38077-d588-4e6a-87b1-90a38f7e3898 | public Persona login(String userName, String password); |
b1a8b563-1280-4214-b95c-83c9a18f5710 | void create(Rol rol); |
8187d755-5cf8-4397-a954-c634379a55ef | void edit(Rol rol); |
f5a42ae8-1fdb-4ccd-a054-f8be9257be02 | void remove(Rol rol); |
072ab626-c3f8-45ce-967d-b76fc8bc2e62 | Rol find(Object id); |
cffe74a2-c8bb-4d92-bd41-674c621fe4b7 | List<Rol> findAll(); |
5e359ecd-4825-4c5a-8da6-b557f33df025 | List<Rol> findRange(int[] range); |
e9f999b8-7078-45e9-adc1-9495ceecf613 | int count(); |
5f216f6a-949b-4dcd-9d36-81c5ad131c46 | void create(Envio envio); |
7be30a82-3a33-4023-83bd-f4647a61a872 | void edit(Envio envio); |
261aabb7-8ff5-494d-b42c-e4d668eb045a | void remove(Envio envio); |
cc1aac4d-9e3a-4faa-affa-d8f055d6c39e | Envio find(Object id); |
a95b86da-a245-4bf0-bda3-f51b2b62eae1 | List<Envio> findAll(); |
819598de-2da9-4cb7-a8e6-da7c5794bad3 | List<Envio> findRange(int[] range); |
5b2261e5-9d2c-4e23-99d4-282aee41610e | int count(); |
d33d6385-4058-4c4c-8076-750c9ba8e0b1 | public Long createEnvio(Envio envio); |
50a8b6a6-9c21-4de3-abc9-46afe6cbc7e5 | void create(Mensajero mensajero); |
f1dea084-1d6b-44cb-a004-c01087b7a5b5 | void edit(Mensajero mensajero); |
de9c713f-c193-490f-bd41-3f91f85d7ff2 | void remove(Mensajero mensajero); |
d20d5e6e-5ec1-4f20-844d-25024bd43332 | Mensajero find(Object id); |
f951a859-cfd0-4291-9b95-a32d73c0cae3 | List<Mensajero> findAll(); |
64a2c920-1ff0-42bb-a80a-504a92567494 | List<Mensajero> findRange(int[] range); |
6487e64f-4d70-4853-a694-894aeb718118 | int count(); |
791da6b1-43c0-4f15-b855-ba741bce29f2 | public List<Mensajero> findActivos(); |
009feca2-a43c-4081-b7ab-3230873317e8 | public int contains(int[] arr, int searchNum) {
if (arr.length == 0) {
return KEY_NOT_FOUND;
}
int first = 0;
int last = arr.length - 1;
while (first <= last) {
// Search key is in arr[first..last] or not present.
int middle = (first + last) / 2;
if (searchNum == arr[middle]) {
return (middle + 1);
} else if (searchNum > arr[middle]) {
first = (middle + 1);
} else if (searchNum < arr[middle]) {
last = (middle - 1);
}
}
return KEY_NOT_FOUND;
} |
4fb6b16b-163e-4fa8-9fd9-0e6fe5082f46 | public int recursiveBinarySearch(int[] arr, int first, int last, int key) {
if(first < last) {
int middle = (first + last) / 2;
if(key == arr[middle]) {
return (middle + 1);
} else if(key < arr[middle]) {
return recursiveBinarySearch(arr, first, middle, key);
} else if(key > arr[middle]) {
return recursiveBinarySearch(arr, (middle + 1), last, key);
}
}
return KEY_NOT_FOUND;
} |
f465907f-8adf-4438-9c71-5d45a3d27cd1 | public int[] sort(int[] array, int min, int max) {
int range = max - min + 1;
int[] result = new int[range];
for(int i : array) {
result[i]++;
}
return result;
} |
2c521977-e107-4230-8607-60f13de1af6b | public int findSingleOdd(int[] array) {
int res = 0;
for (int i : array) {
res = res ^ i;
}
return res;
} |
e5c5866f-bc49-4745-a195-34dc6c94e3eb | public int[] bubbleSort(int[] array) {
if (array.length == 0) {
return array;
}
int size = array.length;
int i = 0, j, k = 0, temp;
while (i < size - 1) {
k = size - 1;
for (j = k; j > i; j--) {
if (array[j] < array[j - 1]) {
k = j;
temp = array[j];
array[j] = array[j - 1];
array[j - 1] = temp;
}
}
i = k;
}
return array;
} |
82dda22e-68db-46c8-928b-6f9ab9b84f93 | public int[] selectionSort1(int[] array) {
if (array.length == 0) {
return array;
}
for (int i = 0; i < array.length; i++) {
int min_index = i;
for (int j = i + 1; j < array.length; j++) {
if (array[j] < array[min_index]) {
min_index = j;
}
if (min_index != i) {
int temp = array[i];
array[i] = array[min_index];
array[min_index] = temp;
}
}
}
return array;
} |
4282c71e-bf2a-4b58-9632-58cbf96f9f4e | public int[] selectionSort2(int[] array) {
for(int i = 0; i < array.length; i++) {
for (int j = array.length-1; j > i; j--) {
if(array[i] > array[j]) {
int temp = array[i];
array[i] = array[j];
array[j] = temp;
}
}
}
return array;
} |
1c2e3c3a-c2a0-4caf-ba6e-ef1745ebf053 | public int[] shortSelectionSort(int[] array) {
for(int i = 0; i < array.length; i++) {
for (int j = array.length-1; j > i; j--) {
if(array[i] > array[j]) {
array[i] ^= array[j]; // example: array[i] = 20, array[j] = 10, here result is array[i] = 30
array[j] = array[i] ^ array[j]; // Here result is array[j] = 20
array[i] ^= array[j]; // Here result is array[i] = 10
}
}
}
return array;
} |
7be276b2-7d8f-4491-ade5-606032e25c98 | public static void main(String[] a) {
User user = new User();
user.setName("ok");
user.setNumber(120);
changeUser(user);
A aa = new InterfaceTest();
aa.print();
B bb = new InterfaceTest();
bb.print();
} |
0653d1da-7df8-41f8-ab65-7ded3f101c32 | private static void changeUser(User user) {
user.setName("change");
user.setNumber(123);
} |
cffb6889-f81f-46c8-a1ab-6c6d73d8ab31 | public String getName() {
return name;
} |
906b6232-ea8e-4aa6-a544-92ab8cb9e183 | public void setName(String name) {
this.name = name;
} |
87ed6f1a-e9df-4df3-ab44-b02f04a0f485 | public int getNumber() {
return number;
} |
ae8cc8fa-2e64-4c13-9685-eb6b4d492817 | public void setNumber(int number) {
this.number = number;
} |
0eb3a727-9f51-4caa-8139-1f137f6ba138 | @Override
public String toString() {
return "User [name=" + name + ", number=" + number + "]";
} |
31d64e45-b982-4bba-9f32-c0900bc0d7fa | public void print() {
System.out.println("OK");
} |
4bb474d2-1c08-48e0-8b36-4624d4b87f38 | public void print(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.