|
iret is an interrupt vector return. If I'm understanding this right, it's like a hosed up longjmp.
|
# ¿ Mar 26, 2008 01:56 |
|
|
# ¿ Apr 28, 2024 22:11 |
|
Triple Tech posted:Often, the source of these horrors is someone trying to do something brilliant, even proper, but not knowing or having a succint/correct way of expressing it. Example: Duff's Device.
|
# ¿ Mar 28, 2008 20:03 |
|
Ryouga Inverse posted:No, Duff's Device is brilliant in every way. It's an awesome hack... But come on, it's a hack. Using fallthrough like that is an anti-pattern unless you REALLY need the speed, like Tom Duff did. Anyone else using it is just masturbating.
|
# ¿ Mar 28, 2008 21:31 |
|
MrMoo posted:The performance can actually be terrible as the increment is quite expensive, I found this out with a basic vector add & multiply. Array offsets work better ([n+1], [n+2], ...). If you read about the history of the code, Duff was working for Industrial Light & Magic trying to program some kind of video system and the normal while (count--) {*to = *from++;} just wasn't cutting it. He wrote the switch as a forced-hand loop-unroll/jump-table combo. Pretty standard idiom in assembler, he just moved it to C. But I guess I don't understand your comment; you're saying that a register increment is expensive? inc reg is probably the cheapest op you can perform aside from the nop. Maybe I just don't understand what you mean. Take into account this was written in 1983, and while there certainly were vector processors back then, I don't think his target was one.
|
# ¿ Mar 29, 2008 06:41 |
|
MrMoo posted:
Well, it's not equivalent code, but I see your point. FYI, Duff's device needs the jump-table generated by the switch statement because of unaligned data sets. Also, his target was most likely not an Intel 8086 series processor with free index offsets.
|
# ¿ Mar 29, 2008 18:40 |
|
Victor posted:Clearly the input should be s and the output should be ret. Why not just r?
|
# ¿ Apr 2, 2008 17:47 |
|
Victor posted:I reserve r for Regex instances. Boo! I use re for regex. It's far less common than returning a value, so it can get the extra letter.
|
# ¿ Apr 3, 2008 03:48 |
|
I think the wtf there is rolling a DFT in python when FFTW is free.
|
# ¿ Apr 15, 2008 16:57 |
|
shopvac4christ posted:An enumeration I found, the values of which are used in a database table. Everything is a Foo!
|
# ¿ Apr 23, 2008 18:35 |
|
argolithm posted:But... well: FYI, I'm almost positive that word.length() call will get optimized into an inline by HotSpot. I actually thought javac would take care of it, but the disassembler says otherwise.
|
# ¿ May 4, 2008 03:57 |
|
tef posted:Here is a bit of a security coding horror: This is a goddamn nightmare from the depths of hell itself. We have a lot of jobs that use scp, and a lot of Ubuntu servers. gently caress me
|
# ¿ May 13, 2008 18:26 |
|
6174 posted:What I find interesting from that links.org post is a lot of people are railing on Debian for not contributing the patch upstream, or at least asking upstream if it was an issue. Yet in the comments there is a link to a openssl-dev thread (http://marc.info/?t=114651088900003&r=1&w=2) where they did precisely that and no one mentioned it was a bad idea, and one of the responders, Ulf Möller (listed as a dev team member on http://openssl.org/about/) said he was in favor of removing the calls. Seems to me that at least some of the blame for this should be on OpenSSL. I agree. This whole thing is a (drat annoying) lesson in how to behave in a public programming ecosystem, IMO.
|
# ¿ May 13, 2008 21:04 |
|
There really should be an &= operator or something for referential equality.
|
# ¿ May 16, 2008 06:18 |
|
MrMoo posted:Well don't these operators map into the extra math symbols, we have =, ≡, and ≣, so you could have === (≡) as data equality, and ==== (≣) for class equality. You're right, it would be &== and not &=. As for the rest of that, I can't wait for Unicode keyboards. Using proper symbols would be a godsend, not some ==== bullshit. I know you can do Unicode in C# but typing in the codes is a pain in the dick.
|
# ¿ May 16, 2008 07:01 |
|
Scaevolus posted:I bet he means an APL keyboard. Look at all those beautiful, succinct glyphs... just waiting to be used
|
# ¿ May 17, 2008 17:36 |
|
deimos posted:Python would like a word with you. I'd like a word with python.
|
# ¿ May 30, 2008 15:55 |
|
That Turkey Story posted:Whoa, whoa, backup. Are you saying Java isn't a lovely language? Oh come on when is this poo poo going to end? It's not that bad.
|
# ¿ Jun 17, 2008 23:21 |
|
I just ran into a class that has a member variable boolean m_immutable; In every loving mutator function, it tests this, and if it's true, it just returns. For example: code:
|
# ¿ Jun 20, 2008 21:19 |
|
Evis posted:That's pretty cool. I take it that it would have to be a type conversion or something? Could you post an example? It's just the way languages like C handle their if statements. Java specifically decided to not allow it to work that way because of the specter of "ambiguity".
|
# ¿ Jun 20, 2008 21:57 |
|
Mr. Herlihy posted:System.String is sealed in the .NET Framework. And java.lang.String is final. You'd have to facade it, and lose a bunch of syntatic sugar.
|
# ¿ Aug 27, 2008 19:52 |
|
fansipans posted:Ugh... why is this page taking forever to load?!?!? I am in awe.
|
# ¿ Sep 11, 2008 21:16 |
|
JediGandalf posted:Probably not exactly hungarian notation but it's along the same lines. I present you our old table and column naming scheme.
|
# ¿ Oct 3, 2008 16:50 |
|
ashgromnies posted:
Instead of doing a modulus, just keep making $n = !$n after the assignment.
|
# ¿ Oct 8, 2008 23:19 |
|
BigRedDot posted:Seriously, what is attempting to iterate past the end of a sequence, if not an exceptional circumstance? The language shouldn't even let you
|
# ¿ Nov 8, 2008 18:54 |
|
Flobbster posted:the Java compiler is smart enough (that's a phrase you don't hear too often!)
|
# ¿ Nov 19, 2008 21:44 |
|
Painless posted:GCJ Can't Java It's getting there: http://en.wikipedia.org/wiki/Icedtea
|
# ¿ Dec 9, 2008 02:27 |
|
beuges posted:This is what the douchebags who wrote the Amazon implementation at my shop did. They were masturbating themselves that they did it in 6 weeks, but maintainance is impossible. It literally takes almost 6 weeks just to fix bugs or update the feeds when Amazon changes the spec.
|
# ¿ Dec 10, 2008 03:51 |
|
Painless posted:Yesterday, I was asked "do you know why this crashes?" based on an "application has done terrible things and must die" dialog. I looked at the source, and it looked like this: We have a Java app similar to this at my shop. Holy poo poo, what a pile of garbage. It keeps throwing "out of heap" errors so I keep giving it more. It's amazing in its ability to use way over a gigabyte of RAM to make a 2MB file.
|
# ¿ Jan 3, 2009 20:15 |
|
weaaddar posted:I suppose my thread here: http://forums.somethingawful.com/showthread.php?threadid=3061838 I did something similar in Javascript and it was only slightly more readable. Ugh. Square peg meet round hole. A line from OsCommerce that I feel really exemplifies the entire project: code:
|
# ¿ Jan 24, 2009 19:24 |
|
tripwire posted:There is no god I think it's more proof that the designers of RFC 822 were not very forward-thinking when they came up with it.
|
# ¿ Feb 12, 2009 04:51 |
|
McGlockenshire posted:
xxxxD forces the number xxxx to a double. Can do the same with xxxxF for float.
|
# ¿ Feb 23, 2009 03:31 |
|
McGlockenshire posted:But... if it's being created as a double, why is he immediately casting it to an int? And since when have primitive non-decimal numbers been anything but ints? This assumes that the coder thought of this. This code makes my head hurt. I couldn't even venture a guess. Probably some rear end in a top hat making things more complex than they need be to justify how smart they are.
|
# ¿ Feb 23, 2009 15:35 |
|
UberJumper posted:
You could put it in a pastebin, but I think it's worth it to see this poo poo in all its glory. To be perfectly frank, I feel a lot better about some of the poo poo I've written in a rush or early in my career... nothing was ever this bad. Also, I personally love this part: code:
|
# ¿ Feb 24, 2009 01:12 |
|
Mill Town posted:Right, but the class still needs to be defined somewhere. Can you do that with reflection, too? I'd like to know! (I like reflection) You could do it with CGLIB or ASM. With either you can basically class load arbitrary streams of bytecode on the fly and give them arbitrary class names so long as the class can be verified and the name is valid according to the JLS.
|
# ¿ Feb 24, 2009 14:15 |
|
j4cbo posted:For what it's worth, even C isn't Turing complete... The C standard defines recursion, wouldn't that qualify it as being Turing complete (for values of "Turing complete" that incorporate resource limits) despite the data-width issues?
|
# ¿ Apr 13, 2009 03:56 |
|
rjmccall posted:C is Turing-complete. Turing-completeness does not require that an unbounded amount of memory be simultaneously addressable; after all, that is not true of Turing machines themselves. I think it depends on the definition of Turing Complete you use. In the strictest sense, a Universal Turing machine requires an unbounded tape and any resource-limited machine cannot fit that definition. That said, most people use the looser definition where any language that would be Turing Complete when run on some theoretical unbounded machine is considered TC.
|
# ¿ Apr 13, 2009 15:24 |
|
rjmccall posted:Unbounded, not infinite. If you formalize C as running on a theoretical machine with finite memory, then yes, your statement is correct; but if you formalize it as running on a machine with the full capabilities of, say, an IBM PC AT, then its space is theoretically unbounded, because if it runs out of space locally it can pause execution and say "Insert a new disk in drive A:". Yes but you'd run out of matter eventually. I feel dirty for how pedantic this is getting
|
# ¿ Apr 13, 2009 17:53 |
|
TheSpook posted:After five minutes of trying to remember lambda calculus . . . can you explain this? It's the fixed point function, also called the Y-Combinator.
|
# ¿ Apr 27, 2009 22:04 |
|
Lexical Unit posted:That was surely their intention, but w/o use strict the bare text false becomes a string literal which evaluates to true more evidence of this: Shaggar posted:any language that starts with p is terrible.
|
# ¿ Jun 12, 2009 04:11 |
|
|
# ¿ Apr 28, 2024 22:11 |
|
Janin posted:our VCS doesn't have atomic commits, so any bug fixes are an all-or-nothing affair sounds like quittin' time to me
|
# ¿ Jul 3, 2009 19:46 |