|
Presto posted:This is C/C++, plus is higher precedence than shift This is a horror.
|
# ? Jul 13, 2011 19:04 |
|
|
# ? May 14, 2024 22:31 |
|
qntm posted:This is a horror. The language or the precedence choices?
|
# ? Jul 13, 2011 19:12 |
|
qntm posted:This is a horror.
|
# ? Jul 13, 2011 19:15 |
|
Wheany posted:
It's a trick. If you look up the entry in the bug database, you'll find that the reported bug is "Frank, opened this to track that issue we talked about." The entry is closed with "Successfully reproduced complex, obscure scenario in which issue arises, that I'm not going to document here (or anywhere else). Fixed issue." That, or you open the bug and it's something totally unrelated, because the developer made some mistake typing the ID (optionally followed by half an hour of searching for the correct bug entry, only to find aforementioned "information"). The one I get sometimes around here that drives me nuts is a change will be marked with the ID for an entry in our development tracker that fixes a dozen bugs, none of which have any apparent relation to the change.
|
# ? Jul 13, 2011 19:23 |
|
Aleksei Vasiliev posted:There are languages that prioritize shifts over addition/subtaction? There are languages that have uniform operator precedence rules, at least. Lisp, Forth, PostScript, APL, etc. For the most part people seem to prefer expressions to look like textbook arithmetic for some reason.
|
# ? Jul 13, 2011 19:28 |
|
qntm posted:This is a horror. values of β will give rise to dom!
|
# ? Jul 13, 2011 19:30 |
|
Aleksei Vasiliev posted:There are languages that prioritize shifts over addition/subtaction? I would have thought every language did this. A shift is, after all, a glorified multiplication or division in most cases. But apparently not, and it trips me up every single time.
|
# ? Jul 13, 2011 20:37 |
|
From my first post in this thread:Wheany posted:Multiplication is a slow operation: Gotta optimize those preprocessor macros and variable initializations!
|
# ? Jul 13, 2011 21:23 |
|
Just a tiny one, displaying a DateTime in a razor view...code:
|
# ? Jul 15, 2011 16:52 |
|
Please tell me chopped off that guy's thumbs. I keep a cigar cutter handy for that purpose.
|
# ? Jul 15, 2011 17:34 |
|
toiletbrush posted:Just a tiny one, displaying a DateTime in a razor view... So he took a date, made it a string, parsed a date from that string and turned that date into a string... That's some inception horror there.
|
# ? Jul 15, 2011 21:58 |
|
Lysandus posted:So he took a date, made it a string, parsed a date from that string and turned that date into a string... I do that sort of thing semi-often when I'm coding late at night, tired, and haven't planned out what I'm doing ahead of time. I like it because I always get a laugh out of it when I come back the next day to see why my code is weirding out on me.
|
# ? Jul 15, 2011 22:33 |
|
Legitimate use when dealing with a database that only takes specifically formatted dates and user design forcing another format, parsing a user string to a date to a string to an sql date. Depending on how the formatting class in use here works and how the original date was obtained (what is this, .NET?) but it looks like that's not quite the same thing and this is still a coding horror.
|
# ? Jul 15, 2011 23:52 |
|
baquerd posted:Legitimate use when dealing with a database that only takes specifically formatted dates and user design forcing another format, parsing a user string to a date to a string to an sql date. Depending on how the formatting class in use here works and how the original date was obtained (what is this, .NET?) but it looks like that's not quite the same thing and this is still a coding horror. Razor is the new UI syntax in ASP.NET MVC. It looks like they're turning a DateTime into a string, then parsing that back to a DateTime (resulting in a potential loss of precision depending on their globalization settings), then turning that back into a *different* string to display to the user. It wouldn't even make sense in the context of databases, anyway, because you can just pass the DateTime directly rather than converting it into a string. One of our projects at work contained something similar, Convert.ToInt32(int.Parse(someInt.ToString())). Gotta make sure it's really, really an int.
|
# ? Jul 16, 2011 01:30 |
|
This was the very first bug I ever got given when I had just started being a professional programmer.code:
|
# ? Jul 19, 2011 05:15 |
|
First you'd have to have a sensible concept of a const statement. Even something as simple as dereferencing a pointer can't be removed without potentially effecting the behavior of the program.
|
# ? Jul 19, 2011 05:53 |
|
While not exactly a coding horror... I do have way too much fun when coding scripts and jobs into apps that only I should be able to see/use. Pushing the button runs (or will run, when I'm done working on it) a conversion job that will translate older MARC records to newer fancier MARC records. An actual coding horror: A huge number of our databases have horrible names that weren't changed from the original names on the mainframe. BOOKMASTER being one of them (or more accurately BOOKMST), which is what houses all of our MARC records for books we sell. The app that edits those records was also called the Bookmaster. So when making the new fancy 2.0 version I google image searched for bookmaster and found the Kingdom Hearts 2 character art.
|
# ? Jul 19, 2011 22:15 |
|
Frozen-Solid posted:A huge number of our databases have horrible names that weren't changed from the original names on the mainframe. BOOKMASTER being one of them (or more accurately BOOKMST), which is what houses all of our MARC records for books we sell. The app that edits those records was also called the Bookmaster. So when making the new fancy 2.0 version I google image searched for bookmaster and found the Kingdom Hearts 2 character art. Now you've got splash screen material (seriously)!
|
# ? Jul 20, 2011 01:44 |
|
Ugg boots posted:Now you've got splash screen material (seriously)! It's the program's icon, though it's hard to tell in that screenshot.
|
# ? Jul 20, 2011 03:16 |
|
Some HTML that I have to GET and parse to scrape some values from. From what appears - on the page - to be tabular data. . Thanks, taiwanese coders. Thaiwanoders.
|
# ? Jul 20, 2011 16:31 |
|
Let me guess: They used tables for layout.
|
# ? Jul 21, 2011 23:32 |
|
this is what css selectors and xpath are for. if your scraping library does not support these, abandon it.
|
# ? Jul 22, 2011 02:19 |
|
tef posted:this is what css selectors and xpath are for. if your scraping library does not support these, abandon it. How many identical ID tags are you 'supposed' to have in an HTML document?
|
# ? Jul 22, 2011 02:54 |
|
kalleth posted:How many identical ID tags are you 'supposed' to have in an HTML document? 1. Unless you were being sarcastic, in wich case, congratulations on a trap well sprung.
|
# ? Jul 22, 2011 05:20 |
|
Pardot posted:1. My point was that: 1) Tabular data. That's what tables were invented for. Why shoehorn UL's into a table format using CSS when its... tabular data? Just to avoid tables for the sake of it? 2) The code has about ten identical ID tags against the UL objects. Also, css selectors on ID in most libraries don't let you iterate through an ID-type selector. It's not that I -can't- traverse it, its that the code made me laugh, then cry, which i thought was the point of the thread
|
# ? Jul 22, 2011 12:47 |
|
Ghettocode horror: find nd replace 'id=' with 'class=' then iterate through that
|
# ? Jul 22, 2011 14:23 |
|
I would guess that somebody just told them "tables are evil!" and forgot to add "except for tabular data!"
|
# ? Jul 22, 2011 16:13 |
|
Biowarfare posted:Ghettocode horror: find nd replace 'id=' with 'class=' then iterate through that I used a simple CSS selector based on element type rather than ID/class excepting those with a class i didn't want, seemed to work fine for my application.
|
# ? Jul 22, 2011 17:10 |
|
In the ~Professional~ version of this compiler I'm using for embedded work it tries to optimize the width of pointers based on where the object being pointed to is in memory. For some reason its goofin' pretty bad when I try to use void pointers. So far the only solution is to turn it back to Lite mode and manually set the pointer size to 24-bit, because there isn't a way to turn off pointer size optimization in professional mode
|
# ? Jul 23, 2011 01:24 |
|
dietary supplement posted:In the ~Professional~ version of this compiler I'm using for embedded work it tries to optimize the width of pointers based on where the object being pointed to is in memory. For some reason its goofin' pretty bad when I try to use void pointers. So far the only solution is to turn it back to Lite mode and manually set the pointer size to 24-bit, because there isn't a way to turn off pointer size optimization in professional mode
|
# ? Jul 23, 2011 01:49 |
|
PrBacterio posted:What the HELL kind of moon architecture is that supposed to be? A 24-bit address space ? The 286 had a 24 bit address space. The 68EC020 used in the Amiga 1200 had a 24 bit address space available to it too. The 68000 in the original Mac was also limited to a 24 bit address space.
|
# ? Jul 23, 2011 02:03 |
|
x86 in 32-bit mode has 48-bit
|
# ? Jul 23, 2011 02:25 |
|
fishmech posted:The 286 had a 24 bit address space. The 68EC020 used in the Amiga 1200 had a 24 bit address space available to it too. The 68000 in the original Mac was also limited to a 24 bit address space. .. in the latter two of your examples it's only the *physical* address space you're talking about anyway. Virtual addresses were still 32 bits in those CPU's, as that was the width of the address registers, I think?
|
# ? Jul 23, 2011 02:25 |
|
PrBacterio posted:What the HELL kind of moon architecture is that supposed to be? A 24-bit address space ? Or is that just for immediate addressing modes with an operand address contained within a 32-bit instruction word, in which case you've probably got your sections all set up in a weird way so that the compiler doesn't know how to handle them. Contemporary x86-64 processors have a 48-bit address space: http://en.wikipedia.org/wiki/X86_64#Virtual_address_space_details Also in 8086 16 bit mode, the addressing was 16 bit offsets with 16 bit overlapping segments every 4 bits for 20 bit effective addressing.
|
# ? Jul 23, 2011 02:32 |
|
PrBacterio posted:What the HELL kind of moon architecture is that supposed to be? A 24-bit address space ? Or is that just for immediate addressing modes with an operand address contained within a 32-bit instruction word, in which case you've probably got your sections all set up in a weird way so that the compiler doesn't know how to handle them. Microchip's PIC18. On die I don't think any part has more than about 4k, but some parts have the option to use external memory blah blah blah. I just don't know what the compiler wants me to do to be able to use void pointers. It has a lot of quirks that you can get around if you rub it the right way. Like the pic18 doesn't have a linear memory space, so if you want to create an object that spans a page you have to alter the linker script, create a new psect, declare the object as global and access it via a const pointer. FUN.
|
# ? Jul 23, 2011 06:23 |
|
http://en.wikipedia.org/wiki/31-bit
|
# ? Jul 23, 2011 13:02 |
|
Biowarfare posted:Ghettocode horror: find nd replace 'id=' with 'class=' then iterate through that Man I've been dealing with django templates from a graphic designer where there are no classes just ids repeated over and over again code:
Worst part is if I change half of them to classes (and the corresponding css) it somehow introduces mysterious subtle layout changes and since I'm completely terrible at CSS (Yet not terrible enough to confuse ids and classes) fixing them has been a real manual-at-side oval office.
|
# ? Jul 23, 2011 17:11 |
|
duck monster posted:Man I've been dealing with django templates from a graphic designer where there are no classes just ids repeated over and over again :s/id=\"paragraph\"/class=\"paragraph\"/g :e public/stylesheet.css :s/#paragraph/.paragraph/g
|
# ? Jul 23, 2011 21:53 |
|
why the gently caress do you need to add a 'paragraph' class to a 'p' element? That's what 'p' stands for already. If you really need to, just do your selectors based on context (#article p { ... } vs. #header p { ... }) and override for the others (#article p.advertisement { ... }). The selector is going to be more precise and take precedence anyway. Get something readable there. Hatin' on people writing poo poo HTML/CSS.
|
# ? Jul 25, 2011 16:27 |
|
|
# ? May 14, 2024 22:31 |
|
code:
|
# ? Jul 25, 2011 17:20 |