user2999870

1

votes
1

answer
1.1k

views

What does Znwm and ZdlPv mean in assembly?

I'm new to assembly and I'm trying to figure out how C++ handles dynamic dispatch in assembly. When looking through assembly code, I saw that there were 2 unusual calls: call _Znwm call _ZdlPv These did not have a subroutine that I could trace them to. From examining the code, Znwm seemed to return...
user2999870
1

votes
1

answer
358

views

How do I implement a mouse event outside the Java frame?

I am trying to make a return program which will press the enter key when the left mouse key is clicked... with courtesy of http://www.java-tips.org/java-se-tips/java.awt/how-to-use-robot-class-in-java.html (for void typing method) and 'thenewboston' I have gotten so far... I am trying to make it s...
user2999870
1

votes
1

answer
34

views

How do I fix my computer key configuration after using robot.keyPress()?

I have been using the java.awt.Robot class (especially pressKey() method) in my code. However, once my code terminates, my keys get reconfigured. In my case, I had robot press Ctrl and R. Afterwards, my key functions for Start and Escape switched roles. And that was just one of several switches. Wha...
user2999870
1

votes
3

answer
43

views

Would I be able to run Java programs without having the entire kit downloaded?

I have recently started coding in Java. I was wondering, is it mandatory to have the entire Java kit to run the computer from a different computer? Because, I am not using the resources from the entire API, just a few particular ones. I wouldn't want to get the entire JDK pack for a single project....
user2999870
1

votes
1

answer
37

views

Is there a way to halt a method until a button is pressed?

I have been coding for a card game and cannot get my method to wait for a button to be pressed. The general code goes like this. When I run the code, doTask() has a segment where it needs to wait for a button to be pressed. However, the method does not wait for the button and just loops through. I a...
user2999870
1

votes
1

answer
53

views

What rounding method should I use for my case?

I am building a class that will be required to round doubles. In it, based on input n, it will (at max) have n decimal places and skip trailing zeroes if possible. //If n = 2, //1.697 -> 1.7 (instead of 1.70) (edit) //1.000 -> 1 (instead of 1.00) //1.658 -> 1.66 There see...
user2999870
3

votes
3

answer
566

views

RoundingMode HALF_UP is not working properly

From my understand, RoundingMode.HALF_UP uses our tradition style of rounding. However, it is not giving me the desired results: I'm using DecimalFormat() with different parameters(#, #.#, ... etc) and inputting the double 3.5545 // taken from Util public static void setRound(int a) // Set...
user2999870
1

votes
1

answer
193

views

How does LEA do computation in x86?

From experience, I have seen that, lea rax, [2*rax + rax +1] is equivanelt to: mul rax, 3 inc rax But, what is LEA exactly doing? If rax = 3 prior to the instruction, is it returning the address of wherever 10 is stored in memory? How can that address be the number 10 itself? Any help would be appre...
user2999870
2

votes
2

answer
49

views

How to alternate between printing in console and printing in a text file

My code requires the program to print an array of numbers in a text file. So, during these periods, I want to change my output stream: System.setOut(new PrintStream(new FileOutputStream('data.txt'))); So, how would I return to printing in the console? Any help would be appreciated. Thank you.
user2999870