logo
 drop

Main

Community

Submissions

Help

94420694 visitors

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - BRPXQZME

Pages: 1 ... 24 25 26 27 28 [29] 30 31 32 33 34 ... 65
561
Programming / Re: Need help.
« on: December 20, 2012, 12:53:01 am »
BRPXQZME, I'm not having a very hard time understanding what he means here. Why are you?
I understand perfectly well. I also have seen plenty of classmates—most of them 16–19 years old at the time—get cut down due to bad assumptions in all too many years of math classes.

562
Newcomer's Board / Re: Introduction Topic
« on: December 19, 2012, 09:26:59 pm »

563
Programming / Re: Need help. [SOLVED!]
« on: December 19, 2012, 09:19:19 pm »
That's not what I meant. I mean the ordered pairs. Like xy in the algebra system. I didn't mean that arrays and algebra coordinates were the same. I meant the ordered pairs are the same.
That’s wrong, too. Algebraic coordinates are continuous.

[snip]
It is indeed O(n2), which is indeed no good. You can’t avoid that for the second loop (technically), but in both cases more efficient code would use memset, which will be faster and less error-prone.

564
Programming / Re: Need help. [SOLVED!]
« on: December 19, 2012, 06:42:20 pm »
They are not the same at all! Algebra coordinates stretch off to infinity and array coordinates are limited, for one. In fact, you exceed these limits in your first set of for loops. The next difference is why you don’t crash anything: the location after map[r][29] is map[r+1][0] for r<29.

Also, these nested for loops are very inefficient ways to handle character arrays and the only reason it’s not causing trouble is that these are not very big arrays.

565
Drop-down items shouldn’t be selectable if non-applicable (this can be JavaScript-aided and server-enforced, which would degrade gracefully for those with JavaScript disabled).

566
Programming / Re: Need help.
« on: December 19, 2012, 05:54:20 pm »
Code: [Select]
for(int gx = 5; gx <= 15; x++) {

567
Script Help and Language Discussion / Re: Battle Zeque Den
« on: December 19, 2012, 05:33:47 pm »
Radical searches will not help.

I never actually figured out what that one was. Even a Chinese dictionary didn’t show me anything convincingly close. 収 was a candidate from the usual suspects, but it’s only on the assumption that it’s written an unusual way, for which I find no attestation. Same goes for 友 except again, no idea what that would mean whereas 収束 is definitely a word.

568
General Discussion / Re: Random pictures thread!
« on: December 19, 2012, 05:15:03 pm »
I think the lack of soundproofing would also lead to regret.

If I had to guess, the orangey thing on top is the case.

569
Script Help and Language Discussion / Re: Battle Zeque Den
« on: December 19, 2012, 04:57:15 pm »
天涯 has two meanings:
1) the ends of the sky; a place [land] very far away (from home).
2) all over the world; around [throughout / all] the world

The sixth one is not 喧轟.

570
General Discussion / Re: Random pictures thread!
« on: December 19, 2012, 04:48:14 pm »
Those are CD binder thingummies.

It run on love.

571
General Discussion / Re: Random pictures thread!
« on: December 19, 2012, 04:43:15 pm »
It get internet from outerspace.

572
General Discussion / Re: Random pictures thread!
« on: December 19, 2012, 03:41:44 pm »
Not enough elbow room.

573
Script Help and Language Discussion / Re: Battle Zeque Den
« on: December 19, 2012, 03:40:13 pm »
I think it’s really calling out for cheesy 90s level titles, like

1. Forest Fray
2. Gaia Grumble
3. Turbulent Torrent
4. Fluctuating Flames
5. Sweeping Sandstorm

the last one looks like 天涯友束, even though 友束 ain’t no word i ever hoid

574
ROM Hacking Discussion / Re: bad coding in roms
« on: December 18, 2012, 02:27:10 am »
>> is logical or arithmetic depending on the signedness of a variable.

I thought I had clarified that, but it turns out it got deleted at one of the draft stages. I’m in finals mode and shouldn’t be posting at the moment :P

575
ROM Hacking Discussion / Re: bad coding in roms
« on: December 18, 2012, 02:08:38 am »
examples:
x = 0 = 0x00000000
temp = x >> 31 = 0x00000000
x^temp-temp = (0^0)-0 = 0-0 = 0

x = 1 = 0x00000001
temp = x >> 31 = 0x00000000
(x^temp)-temp = (1^0)-0 = 1-0 = 1

x = -1 = 0xFFFFFFFF
temp = x >> 31 = 0xFFFFFFFF
(x^temp)-temp = (0xFFFFFFFF^0xFFFFFFFF)-0xFFFFFFFF = 0-(-1) = 1

x = -3 = 0xFFFD
temp = x >> 15 = 0xFFFF
(x^temp)-temp = (0xFFFD^0xFFFF)-0xFFFF = 0x0002-(-1) = 3

^ is a bitwise XOR in C, in case that isn’t clear.

Basically, it all works off several ideas:
- To negate a number in two’s complement, you flip the bits and add 1.
- XOR changes a value if you mask with a 1, and leaves alone if you mask with a 0.
- For a non-negative number, shift-extending the sign bit throughout all bits gives you a mask of all zeroes or ones
- Thus, XORing all bits in a number with its sign bits will flip the bits if the number is negative, and let it be otherwise
- Subtracting by negative one is the same as adding by negative one; adding zero wastes a little time but hurts nothing.
- You’re only bothering to do these extra operations because the time cost is peanuts compared to what branching might do. In general, on modern pipelining / branch-predicting architectures, it is worth replacing a single if statement with a couple of arithmetic statements if you can manage it.

576
ROM Hacking Discussion / Re: bad coding in roms
« on: December 18, 2012, 12:33:12 am »
Modern processors like what? :huh:

Anyway, this implementation is really only for architectures with branch slot delay like MIPS and... SPARC, I guess, out of all the things you’re likely to ever code on. For performance purposes, branching is something to avoid in general unless you are seriously starved for bytes (in which case, why are you using a RISC processor anyway?). For most uses nowadays a generic integer absolute is best accomplished by something like:
Code: [Select]
long abs(long x) {
long temp = x >> LONGSIGNBITSHIFT; // (sizeof(long)<<3)-1, which is 31 on a lot of current archs
return (x^temp)-temp;
}
which inlines to three instructions on most architectures if you don’t need to save anything.

577
ROM Hacking Discussion / Re: bad coding in roms
« on: December 17, 2012, 09:52:59 pm »
Silly MIPS trick to do absolute value in 8 bytes instead of 12:

bgtz a0, label
label:
subu a0, zero, a0
(but that should...

no wait...)

>witchcraft.gif

edit: When I did MIPS for a class in high school, we actually did have to know about the delay slot. When I took the same class at college level (because there simply isn’t anything that transfers like that), we had to program like it didn’t exist and I was like aw come onnnn!

Of course, my guess is you would want to avoid a branch on a modern pipelining processor but I’m no expert or anything.

578
General Discussion / Re: The Hobbit??
« on: December 17, 2012, 09:41:16 pm »
I see. Maybe Sony should be in the business of making computers, maybe then they’d anticipa——

oh right

579
General Discussion / Re: The Hobbit??
« on: December 17, 2012, 05:09:42 pm »
OS X has had some surprisingly obscure words in the spelling dictionary for as long as I’ve been using it.

580
General Discussion / Re: The Hobbit??
« on: December 17, 2012, 02:15:59 pm »
It’s kind of like the Old Testament (not coincidentally, either).

Also, Silmarillion is actually recognized by my spell checker. Huh.

Pages: 1 ... 24 25 26 27 28 [29] 30 31 32 33 34 ... 65