better binary representation

This commit is contained in:
rdavidek 2021-06-08 17:27:15 +02:00
parent 05425c0d04
commit 157ed1f162

View File

@ -30,7 +30,7 @@ public class MiningBean {
String currency;
String resultStr;
String restRequest;
int finished = 0;
int finished = 0b0;
public String updateAll(HttpServletRequest request, HttpServletResponse response) throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
@ -105,7 +105,7 @@ public class MiningBean {
} catch (Exception e) {
System.out.println(e.getMessage());
}
finished = finished | 1;
finished = finished | 0b1;
}
}).start();
@ -134,7 +134,7 @@ public class MiningBean {
} catch (Exception e) {
System.out.println(e.getMessage());
}
finished = finished | 10;
finished = finished | 0b10;
}
}).start();
@ -166,7 +166,7 @@ public class MiningBean {
} catch (Exception e) {
System.out.println(e.getMessage());
}
finished = finished | 100;
finished = finished | 0b100;
}
}).start();
@ -307,7 +307,7 @@ public class MiningBean {
} catch (Exception e) {
System.out.println(e.getMessage());
}
finished = finished | 1000;
finished = finished | 0b1000;
}
}).start();
@ -339,7 +339,7 @@ public class MiningBean {
} catch (Exception e) {
System.out.println(e.getMessage());
}
finished = finished | 10000;
finished = finished | 0b10000;
}
}).start();
@ -429,7 +429,7 @@ public class MiningBean {
} catch (Exception e) {
System.out.println(e.getMessage());
}
finished = finished | 100000;
finished = finished | 0b100000;
}
}).start();
@ -474,16 +474,18 @@ public class MiningBean {
} catch (Exception e) {
System.out.println(e.getMessage());
}
finished = finished | 1000000;
finished = finished | 0b1000000;
}
}).start();
}
while (finished != 1042431) {
while (finished != 0b1111111) {
//System.out.println(Integer.toBinaryString(finished));
Thread.sleep(2000);
}
finished = 0;
//System.out.println("Done: " + Integer.toBinaryString(finished));
finished = 0b0;
KeyValue wi = new KeyValue();
wi.setKey("Last Update");
@ -540,7 +542,8 @@ public class MiningBean {
}
public String getStringResponse(String urlStr) {
return getStringResponse(urlStr, Constants.DEFAULT_HTTP_CONNECTION_TIMEOUT, Constants.DEFAULT_HTTP_READ_TIMEOUT);
return getStringResponse(urlStr, Constants.DEFAULT_HTTP_CONNECTION_TIMEOUT,
Constants.DEFAULT_HTTP_READ_TIMEOUT);
}
public String getStringResponse(String urlStr, int timeout, int readTimeout) {