|
j4cbo posted:I wrote this. You'll need a decent grasp of x86 assembly to comprehend the horror...
|
# ¿ Mar 26, 2008 00:48 |
|
|
# ¿ Apr 29, 2024 20:58 |
|
http://luke.breuer.com/time/item/MeditechCodeProcessor/318.aspxcode:
Scaevolus fucked around with this message at 22:46 on Mar 29, 2008 |
# ¿ Mar 29, 2008 22:43 |
|
nebby posted:If we had editors that let you have rich symbology, colors, icons, tables, and flow diagrams instead just a static grid of ascii text of course this whole argument we just had would be moot since naming would take a backseat. Fortress doesn't count because you have to run the whole thing through LaTeX, and it's read only.
|
# ¿ Mar 31, 2008 23:09 |
|
Project Euler Problem 22 posted:Using names.txt (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order names.txt posted:"MARY","PATRICIA","LINDA","BARBARA","MARIA","SUSAN","MARGARET","DOROTHY","LISA","NANCY",..."ALONSO" code:
|
# ¿ Apr 12, 2008 04:49 |
|
Smackbilly posted:That's terrible not only for the redundancy but also for the fact that it sefaults your program if either node or parent is NULL.
|
# ¿ May 13, 2008 00:36 |
|
Regarding the OpenSSL vulnerability, http://metasploit.com/users/hdm/tools/debian-openssl/ It looks pretty bad-- quote:Removing this code has the side effect of crippling the seeding process for the OpenSSL PRNG. Instead of mixing in random data for the initial seed, the only "random" value that was used was the current process ID. On the Linux platform, the default maximum process ID is 32,768, resulting in a very small number of seed values being used for all PRNG operations. So for a given architecture and release, there's only 215 different keys. He completely brute-forced the two most commonly used keyspaces in about 62 CPU hours.
|
# ¿ May 15, 2008 04:24 |
|
Melonhead posted:What the hell is a Unicode keyboard? I am imagining a keyboard with over 100,000 buttons here. Additional characters: \ _ ¨ ¯ × ÷ ← ↑ → ↓ ∆ ∇ ∘ ∣ ∧ ∨ ∩ ∪ ∼ ≠ ≤ ≥ ≬ ⊂ ⊃ ⌈ ⌊ ⊤ ⊥ ⋆ ⌶ ⌷ ⌸ ⌹ ⌺ ⌻ ⌼ ⌽ ⌾ ⌿ ⍀ ⍁ ⍂ ⍃ ⍄ ⍅ ⍆ ⍇ ⍈ ⍉ ⍊ ⍋ ⍌ ⍍ ⍎ ⍏ ⍐ ⍑ ⍒ ⍓ ⍔ ⍕ ⍖ ⍗ ⍘ ⍙ ⍚ ⍛ ⍜ ⍝ ⍞ ⍟ ⍠ ⍡ ⍢ ⍣ ⍤ ⍥ ⍦ ⍧ ⍨ ⍩ ⍪ ⍫ ⍬ ⍭ ⍮ ⍯ ⍰ ⍱ ⍲ ⍳ ⍴ ⍵ ⍶ ⍷ ⍸ ⍹ ⍺ ⎕ ○ Let's stick to ASCII.
|
# ¿ May 17, 2008 01:01 |
|
No Safe Word posted:Monkeypatching FTL.
|
# ¿ Aug 27, 2008 17:46 |
|
Flobbster posted:So the original question was, how efficient is this compared to a chain of if-statements? With -O3 enabled, the compiler does a phenomenal job of inlining this and it turns out it's exactly the same:
|
# ¿ Aug 28, 2008 01:21 |
|
Flobbster posted:-O2 comes out the same as -O3, compiled into to an inlined sequence of cmp/branch instructions. Under -O/-O1 though, the class, instantiated object, and method calls remain. I ask because -O3 can cause some weird bugs, so I tend to use -O2.
|
# ¿ Aug 28, 2008 04:17 |
|
JoeNotCharles posted:if you just automatically make an int, but you know it'll never get a value less than 0, you might want to change it to an unsigned int later to get more range. never is a strong word
|
# ¿ Oct 3, 2008 09:48 |
|
Zombywuf posted:Yes, yes, and holy gently caress python makes Ctrl-C an exception. Sheesh. But fair enough, go ahead and catch KeyboardInterrupt, pass the rest. Scaevolus fucked around with this message at 15:00 on Nov 5, 2008 |
# ¿ Nov 5, 2008 14:57 |
|
royallthefourth posted:Dude, you just pre-incremented in order to increment the post! It seems like a post-increment would have been better suited! With complex object types, which post almost certainly is, as ++post implies all the tasks of logging in, finding a thread, writing a reply, etc., the pre-increment is more efficient that the post-increment, which tends to make useless copies of the object that most compilers are unable to optimize away.
|
# ¿ Jan 9, 2009 02:29 |
|
huge sesh posted:I've always thought this one was real pretty
|
# ¿ Jul 11, 2009 23:23 |
|
xkcd jokes get more hilarious with each repost!!
|
# ¿ Jul 21, 2009 23:20 |
|
Dijkstracula posted:Well, given it's wrong, I should hope it's not used very often! What's wrong with it?
|
# ¿ Jul 24, 2009 04:02 |
|
Avenging Dentist posted:The sine function generally does not range from -0.0174532778 to 0.0174532778. The only thing I can find wrong with it is that it uses degrees instead of gradians.
|
# ¿ Jul 24, 2009 05:20 |
|
Avenging Dentist posted:Why would a system that uses 400 units for the angle of a circle be better? Why would a 404 help your point?
|
# ¿ Jul 24, 2009 05:25 |
|
Avenging Dentist posted:If you can't be bothered to figure out what the URL should be, perhaps you should go and hit the books mayhaps? 3 char extensions should be good enough for anyone!
|
# ¿ Jul 24, 2009 05:27 |
|
Avenging Dentist posted:You know, if you got a 3-char extension maybe you wouldn't be a 2-bit poster anymore! 0_0
|
# ¿ Jul 24, 2009 05:28 |
|
quote:There's a bit of controversy going on as to why the passwords were stored in plain text in the first place, with some arguing that it was because of the very large user base. Password hashing was apparently on the TODO list for the future, but that has become a priority now.
|
# ¿ Aug 4, 2009 01:54 |
|
4VAlien posted:
Here's the real horror.
|
# ¿ Aug 12, 2009 14:33 |
|
I thought it was a video encoder because of mbebuff_energy.
|
# ¿ Aug 31, 2009 08:50 |
|
10:33:11 < MononcQc> This has to come close to balls next to a cliff in terms of analogies: http://groups.google.com/group/comp.lang.scheme/msg/e7431893c4da4bbf?hl=en Hi, I understand continuations as taking a photo of what is happening, a special photo that you can use afterwards to go "to the past" where the photo was taking. Continuations are very good on daily work, because you can take a photo (capture the *current* continuation) while you're having beers at the bar with your friends. If your daily work is boring you can always get your photo from your pocket and go instantly back to the bar with beers and friends. Great!! Furthermore, when you take your photo (capture the *current* continuation) you pass a procedure to your camera (you *call* this procedure with the *current* continuation). The value returned by this procedure is then substituted in the very place you took your photo. So continuations are a way to "return values from the future too" (you *call* a procedure with the *current* photo). And this is fantastic!! Imagine, for instance, that you're having beers with your friends at the bar. You then capture the current, comfortable, beer&friends continuation (take your photo) and say "let's capture a continuation here, and let's call a procedure that seeks what the winning lottery number is". You then go to work, and you find in google what the winning lottery number is. You then pass this value (the value returned by the procedure) to the photo (the captured continuation). As a consequence you go immediately back to the bar... knowing what the winning lottery number is going to be!! Now, isn't this fantasic? You just can win the lottery while being at the bar with beers and friends!! You won't have to go back to work again if you don't want to!! In real life continuations don't exist (I wish they existed!), but while working with Scheme you can use continuations for doing some sort of things: - Take a photo before seeking for something in a list. Pass a procedure to the photo that seeks for something in the list. (Looping). - Iterate over all possible solutions to a problem. For each possible solution take a photo and pass it a procedure that sees if the solution is acceptable or not (backtracking). - Perform a task. In the middle of the task take a photo and pass it a procedure that does another task (multitasking). For examples of real-life usages of continuations you can take a look at [1], that contains "Design Patterns" explaining common situations for using continuations. Cheers, Antonio
|
# ¿ Sep 5, 2009 17:46 |
|
chocojosh posted:So this is such a bad varation of the for-switch that once it matches either "mail", "facsimiletelephonenumber", or "telephonenumber" it's going to exit the loop. Serious question, have you ever used C, C++, C#, or Java?
|
# ¿ Oct 7, 2009 04:15 |
|
Janin posted:Why is it so much shorter than Mail::RFC822::Address?
|
# ¿ Oct 7, 2009 04:59 |
|
Janin posted:Well if you don't care about adhering to the standard, here's an even shorter regex:
|
# ¿ Oct 7, 2009 05:02 |
|
ErIog posted:I need a verdict. Is this a coding horror? Yes, because you should be using lxml.
|
# ¿ Mar 10, 2010 22:42 |
|
Seth Turtle posted:
|
# ¿ Mar 27, 2010 04:24 |
|
PHP arrays: because every other data structure in the standard library is even worse.
|
# ¿ Apr 8, 2010 11:15 |
|
Captain Capacitor posted:(Yes, I'm well aware of the etymological reasons behind this name) It doesn't make it any less of a horror.
|
# ¿ Apr 10, 2010 19:29 |
|
The real horror of ftp is that the file list format isn't specified in the RFC, so clients have to implement multiple parsers to handle the different ways ftpds present information.
|
# ¿ Apr 17, 2010 02:34 |
|
Janin posted:Some people don't put spaces around '=' for keyword arguments, but they're dumb. code:
|
# ¿ May 19, 2010 07:32 |
|
C++ written by a former Fortran programmer:code:
(You don't want to see the GTK interface code...)
|
# ¿ Nov 14, 2010 19:42 |
|
Janin posted:You needn't even get that fancy; a simple parser class could clean up the duplicated code and symbol vomit:
|
# ¿ Nov 15, 2010 09:26 |
|
Jabor posted:Probably, but it's even easier to do
|
# ¿ Dec 1, 2010 21:07 |
|
code:
1) this.pendingChunks averages 3000-5000 objects. 2) Collections.sort allocates a new array of the same size, copies all the elements out of the ArrayList, sorts them, then copies all the elements back. 3) The code always terminates at point 1 or 2, unless firstRun is true (i.e., it only processes the last ~3 objects in the list) This method is called every frame, and accounts for 30% of CPU time on slower systems.
|
# ¿ Jan 4, 2011 06:59 |
|
HardDisk posted:This came from Minecraft's source code, by any chance?
|
# ¿ Jan 5, 2011 07:52 |
|
crazylakerfan posted:Dammit Notch, please let one of your employee rewrite your engine wlievens posted:Do you mind sharing where you got this code from? Is Minecraft's code public? Or was this decompiled and cleaned up?
|
# ¿ Jan 7, 2011 13:50 |
|
|
# ¿ Apr 29, 2024 20:58 |
|
A pragmatic reason for code sucking doesn't mean it's not a coding horror.
|
# ¿ Jan 7, 2011 18:30 |