why does this javascript code jump into jQuery code? appendChild conflict?
Tag : jquery , By : Priyatna Harun
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , I will be using some jQuery below this chunk of code (which I may rewrite as jQuery). jQuery is loaded. But I don't understand why, when I step through this code in the debugger, the debugger jumps into jQuery on the line indicated, and I am get the error that "UL.appendChild" is not a function. // Here UL will be the id attribute, not the <ul> element.
var UL = document.createElement('ul').id = 'meta-ul';
// this doesn't makes sense... (id.appendChild)
UL.appendChild(li1) ;
// solution:
var UL = document.createElement('ul');
UL.id = 'meta-ul';
|
Ruby Code navigation, reading tips and tools, how to locate a code in the file system, jump to and read
Date : March 29 2020, 07:55 AM
|
How exactly DO lines of code relate to each other in assembly code when jump is involved?
Date : March 29 2020, 07:55 AM
it should still fix some issue If you are confused about the opcode you are a long way from understanding this. You need to start with documentation on the instruction set. which for x86 is plentiful, its not great documentation but still the opcodes are pretty clear. With instruction sets like this not hard to find a web page with a chart of opcodes and then you click on that to find the rest of the instruction definition. Fairly typical that the relative address is based on the byte after the instruction. If you were working on a team for a brand new processor, then you would just go down to one of the chip folks cubes and ask (since it wouldnt be well documented yet) but since this is an old design there are tools available that will simply give you your answer without asking anyone else. a0: jle a0
a1: jle a1
a2: jle a2
a3: jle a3
a4: jle a4
b0: jle b1
b1: jle b2
b2: jle b3
b3: jle b4
b4: jle b5
b5: nop
c0: jle c0
c1: jle c0
c2: jle c0
c3: jle c0
c4: jle c0
d0: jle d4
d1: jle d4
d2: jle d4
d3: jle d4
d4: jle d4
0000000000000000 <a0>:
0: 7e fe jle 0 <a0>
0000000000000002 <a1>:
2: 7e fe jle 2 <a1>
0000000000000004 <a2>:
4: 7e fe jle 4 <a2>
0000000000000006 <a3>:
6: 7e fe jle 6 <a3>
0000000000000008 <a4>:
8: 7e fe jle 8 <a4>
000000000000000a <b0>:
a: 7e 00 jle c <b1>
000000000000000c <b1>:
c: 7e 00 jle e <b2>
000000000000000e <b2>:
e: 7e 00 jle 10 <b3>
0000000000000010 <b3>:
10: 7e 00 jle 12 <b4>
0000000000000012 <b4>:
12: 7e 00 jle 14 <b5>
0000000000000014 <b5>:
14: 90 nop
0000000000000015 <c0>:
15: 7e fe jle 15 <c0>
0000000000000017 <c1>:
17: 7e fc jle 15 <c0>
0000000000000019 <c2>:
19: 7e fa jle 15 <c0>
000000000000001b <c3>:
1b: 7e f8 jle 15 <c0>
000000000000001d <c4>:
1d: 7e f6 jle 15 <c0>
000000000000001f <d0>:
1f: 7e 06 jle 27 <d4>
0000000000000021 <d1>:
21: 7e 04 jle 27 <d4>
0000000000000023 <d2>:
23: 7e 02 jle 27 <d4>
0000000000000025 <d3>:
25: 7e 00 jle 27 <d4>
0000000000000027 <d4>:
27: 7e fe jle 27 <d4>
804839c: 7e 0d jle 80483ab <silly+0x17>
|
My code that makes me jump in my platformer also breaks my collision code
Date : March 29 2020, 07:55 AM
will help you The logic of collision undoes the clamping in X if Y is also out of bounds. Try clamping in both x and y and then update the body if there's a change: public void collision() {
Rectangle body = jan.getBody();
int bodyX = (int) body.getX();
int bodyY = (int) body.getY();
int clampedBodyX = Math.min(Math.max(0, bodyX), 780);
int clampedBodyY = Math.min(Math.max(0, bodyY), 360);
if (bodyX != clampedBodyX || bodyY != clampedBodyY) {
body.setLocation(clampedBodyX, clampedBodyY);
jan.setBody(body);
}
}
|
IntelliJ Idea - Jump to test code of covered code?
Date : March 29 2020, 07:55 AM
Does that help @jonrsharpe gave me the resources to answer this question, so thanks! check this out here, it will give you all the information you will need: info on viewing code coverage resultsthis feature can be accessed by clicking on the coloured line by your code and clicking on a button called 'show tests covering line' this option is only available if you enable 'tracing' for your code coverage. this option can be enabled from configuring the test task. info on this bit here: info on configuring run profiles for code coverage
|