|
bmoyles posted:
|
# ? Apr 12, 2008 20:30 |
|
|
# ? May 14, 2024 04:11 |
|
gibbed posted:I see this all the time and it makes my heart sad . It's the `Even tho register_globals is turned off, I want to use them anyways` move
|
# ? Apr 12, 2008 20:57 |
|
_aaron posted:No space before the comma? Clearly this person doesn't know how to properly use white space. they should be using tabs, not spaces. code:
edit: GAH, just turned avatars back on. When did I get that one? rotor fucked around with this message at 23:44 on Apr 12, 2008 |
# ? Apr 12, 2008 21:43 |
|
Scaevolus posted:
I dont think it's really fair to complain about software engineering rights and wrongs in projecteuler answers. I thought it was a reasonable way to get everything in rapidly - not like there was going to be a code injection attack in the middle of it (and maybe he even checked)
|
# ? Apr 12, 2008 23:37 |
|
Some of the old perl code I've found here was written by someone who seemed to think entire subroutines had to be on a single line. Lots ofcode:
|
# ? Apr 12, 2008 23:41 |
|
Just found this.. not really a horror per say, but WTF:php:<? <style> <?if(!$_GET['article']){?> *{ } <?}?> </style> ?>
|
# ? Apr 14, 2008 17:17 |
|
Before now I was on the fence about going and talking to the department head since previous lectures hinted that my professor actually isn't half bad. Well, not after today. I'm going to have nightmares about this I think:code:
code:
fret logic fucked around with this message at 07:54 on Apr 17, 2008 |
# ? Apr 14, 2008 19:14 |
|
fret logic posted:Before now I was on the fence about going and talking to the department head since previous lectures hinted that my professor actually isn't half bad. Well, not after today. I'm going to have nightmares about this I think: I don't understand how this is supposed to be especially awful for what is, I assume, supposed to be an in-class example or something.
|
# ? Apr 14, 2008 19:18 |
|
rotor posted:I don't understand how this is supposed to be especially awful for what is, I assume, supposed to be an in-class example or something. It's GUI code and no one likes writing GUIs? <--- (this smiley shows how insanely clever I am, fyi)
|
# ? Apr 14, 2008 19:20 |
|
rotor posted:I don't understand how this is supposed to be especially awful for what is, I assume, supposed to be an in-class example or something. for loops, have you heard of them?
|
# ? Apr 14, 2008 19:22 |
|
if you're doing an in-class example and want to make sure everyone knows what you're doing... then this is better than a for loop due to clarity, at least in my opinion.
|
# ? Apr 14, 2008 19:24 |
|
rotor posted:I don't understand how this is supposed to be especially awful for what is, I assume, supposed to be an in-class example or something. The horror is obviously Swing itself
|
# ? Apr 14, 2008 19:25 |
|
Zombywuf posted:for loops, have you heard of them? -funrolloops
|
# ? Apr 14, 2008 19:25 |
|
I'm not sure what you can do to make that code a lot better. I mean, putting all the JButtons into a hashtable to cut down on variables and allowing you to loop over them to do the repetitive stuff, but if this is a lower level class I'd have second thoughts about even that. It's sort of crummy code, but it's not a horror or anything.
|
# ? Apr 14, 2008 19:25 |
|
narbsy posted:if you're doing an in-class example and want to make sure everyone knows what you're doing... then this is better than a for loop due to clarity, at least in my opinion. /me shudders with horror at the thought that GUI coding should be taught before for loops.
|
# ? Apr 14, 2008 19:26 |
|
Zombywuf posted:/me shudders with horror at the thought that GUI coding should be taught before for loops. I actually agree with narsby. If I was teaching Swing to students, I'd probably keep loops out of the picture as well in a little example like this. I'd be a little if I saw it in production code, but the new JFrame("Chris Busch's CALCULATOR!!!!!!!!"); probably would be a bigger issue. edit: Ah, JingleBells in #cobol caught something: he should be using variables for the label names instead of magic values. Nothing happens when you press the '.' button. doubleedit: oh rotor fucked around with this message at 19:41 on Apr 14, 2008 |
# ? Apr 14, 2008 19:34 |
|
rotor posted:I actually agree with narsby. If I was teaching Swing to students, I'd probably keep loops out of the picture as well in a little example like this. I'd be a little if I saw it in production code, but the new JFrame("Chris Busch's CALCULATOR!!!!!!!!"); probably would be a bigger issue. The only problems I've found are that nothing happens when you click the decimal point button, and that if you close the window the GUI disappears but the program doesn't exit as no default close action has been specified.
|
# ? Apr 14, 2008 19:40 |
|
Decimals are for Chris Busch's CALCULATOR 2.0!!!!!!!!, obviously.
|
# ? Apr 14, 2008 20:05 |
|
What's the issue with my excitement over the most amazing CALCULATOR? It's just disgusting looking code, I feel like a for loop statement would be nice to clear it up. I mean, we have learned how to create GUI's, and all of the loops. Why would one of the last programs we write not implement this? edit: You're probably right though, the entire class was yelling at him to slow down the entire 2 hours we spent doing this, so maybe loops would have been a bad idea. fret logic fucked around with this message at 20:34 on Apr 14, 2008 |
# ? Apr 14, 2008 20:30 |
|
duz posted:It's the `Even tho register_globals is turned off, I want to use them anyways` move That guy wants GET to have more precedence then POST.
|
# ? Apr 14, 2008 20:49 |
|
Cheesus posted:Not quite. So he likes register_globals but finds it too secure?
|
# ? Apr 14, 2008 21:09 |
|
the language is stackless python, definitions cut off for brevity code:
MasterSlowPoke fucked around with this message at 07:59 on Apr 15, 2008 |
# ? Apr 15, 2008 07:57 |
|
MasterSlowPoke posted:the language is stackless python, definitions cut off for brevity It doesn't usually matter too much on self contained mathematical operations like that, because you can prove the correctness of the routine with relatively straightforward regression testing and then leave it alone for years. The most important thing is: does it have the reference to the original paper in the comments?
|
# ? Apr 15, 2008 09:26 |
|
I think the wtf there is rolling a DFT in python when FFTW is free.
|
# ? Apr 15, 2008 16:57 |
|
TSDK posted:The most important thing is: does it have the reference to the original paper in the comments? There are no comments. That c/p is from the source code for Eve Online, and over half of it is fully undocumented.
|
# ? Apr 16, 2008 00:01 |
|
MasterSlowPoke posted:There are no comments. That c/p is from the source code for Eve Online, and over half of it is fully undocumented. That usually happens when you DECOMPILE source. That's not stolen source. I wish people would stop saying this poo poo. Edit: wait a second, that's not even python.
|
# ? Apr 16, 2008 00:04 |
|
deimos posted:That usually happens when you DECOMPILE source. That's not stolen source. I wish people would stop saying this poo poo. This statement would seem to contradict the half that IS documented, wouldn't it?
|
# ? Apr 16, 2008 00:10 |
|
deimos posted:That usually happens when you DECOMPILE source. That's not stolen source. I wish people would stop saying this poo poo. There was a leak. If this were merely decompiled it'd be out there for a long time now. deimos posted:Edit: wait a second, that's not even python. It's apparently "stackless python", a language pretty much exclusively used by CCP for Eve. I'm unsure how it differs from Python as I've never used it.
|
# ? Apr 16, 2008 00:10 |
|
MasterSlowPoke posted:There was a leak. If this were merely decompiled it'd be out there for a long time now. That's not stackless python or any kind of python. Stackless and CPython have pretty much the same syntax (but various different behaviours). That looks like C or delphi. crazypenguin posted:This statement would seem to contradict the half that IS documented, wouldn't it? not if they're docstrings
|
# ? Apr 16, 2008 00:15 |
|
MasterSlowPoke posted:It's apparently "stackless python", a language pretty much exclusively used by CCP for Eve. I'm unsure how it differs from Python as I've never used it. Stackless Python has true coroutine support, and allows continuations to be pickled (so you can send them to another machine and resume them, for instance). It also has some other concurrency related features, and I believe it does away with the GIL. I personally haven't used it, but it seems interesting. Also, whatever you pasted isn't Stackless Python, it looks like a custom language they made. Stackless isn't a different language, it's just a different interpreter.
|
# ? Apr 16, 2008 03:35 |
|
MasterSlowPoke posted:It's apparently "stackless python", a language pretty much exclusively used by CCP for Eve. I'm unsure how it differs from Python as I've never used it. From the comments, I'm guessing this is code out of a sound card driver or something.
|
# ? Apr 16, 2008 05:40 |
|
trashmatic posted:Nope. It looks like assembly language for some DSP chip The language looks like the DSP filter assembly language discussed here: http://www.analog.com/library/analogDialogue/archives/31-2/dsp.html
|
# ? Apr 16, 2008 05:55 |
|
Someone just pointed out a great structure in my code:code:
code:
|
# ? Apr 19, 2008 02:45 |
|
MrMoo posted:Someone just pointed out a great structure in my code: Deceptively simple answer, really: code:
crazypenguin fucked around with this message at 03:00 on Apr 19, 2008 |
# ? Apr 19, 2008 02:56 |
|
a for-while loop, neat. That and a do-switch and I'll be all set.
|
# ? Apr 19, 2008 04:38 |
|
I may have found my new favourite control flow structure, the fordowhile loop:code:
|
# ? Apr 19, 2008 10:41 |
|
I found this in one of our apps this week.code:
|
# ? Apr 19, 2008 15:56 |
|
standard posted:I found this in one of our apps this week.
|
# ? Apr 19, 2008 19:05 |
|
Jethro posted:Maybe they don't trust the collection.getDetails().size() method? What the hell indeed...
|
# ? Apr 19, 2008 19:45 |
|
|
# ? May 14, 2024 04:11 |
|
Seems to me like it used to test some property of the object and only include some of them in the count, and when they updated it to count all of them they just took the test out. Or they planned to add a test and never got around to it. Here's my latest: in the constructor of a QDialog. Note that the only point of giving a dialog a "parent" widget is that it'll be centered on the parent; if none is given it just opens in the center of the screen. code:
1. That's a member variable called "sv", which is against the project's naming conventions of starting all member variables with "m" and globals with "g". 2. Why does it set focus to the scrollview and immediately back to the dialog? 3. This doesn't put the scrollview in the parent's layout or anything, so it would just show up in the top left of the parent window, at a default size, and get drawn overtop of other widgets. (And I don't even know what would happen if there was no parent.) 4. If you're trying to change the parent of a widget, addChild() is not the way to do it (and the docs even say so!) In Qt 3, addChild reset the parent of the dialog to sv, so it didn't crash or anything, but that was an undocumented implementation quirk. In Qt 4, this code fucks up event propagation and locks up the entire app. 5. Put the dialog in a scroll view? What the HELL?
|
# ? Apr 19, 2008 22:55 |