|
In any case, the correct form of the test is:code:
|
# ? Jun 4, 2008 09:56 |
|
|
# ? Apr 26, 2024 09:42 |
|
At one of my old jobs people didn't really understand the idea of CVS conflicts. If there was a conflict they would just open the file and delete all the "arrow things" and mark it as resolved.
|
# ? Jun 4, 2008 17:55 |
|
php:<? private string ValidateFileContent() { // Validates the file content against the selected target // table. //if (StringUtil.EqualsIgnoreCase(this.DataTarget, this.TableName) == false) //{ // // Does not match target type. // return "Invalid"; //} // No errors. return null; } ?> Edit: c# not php, just did that for coloring.
|
# ? Jun 5, 2008 16:05 |
|
Cazlab posted:
This isn't necessarily terrible. I mean, the fact that it's a string instead of a bool or throwing an exception is pretty bad, but the way they removed the check isn't terrible, since maybe a lot of code calls it. Yes, that's what search and replace is for, but maybe they wanted the code to stay for now. It's bad, but not a horror.
|
# ? Jun 5, 2008 18:33 |
|
Ryouga Inverse posted:This isn't necessarily terrible. I mean, the fact that it's a string instead of a bool or throwing an exception is pretty bad, but the way they removed the check isn't terrible, since maybe a lot of code calls it. Yes, that's what search and replace is for, but maybe they wanted the code to stay for now. At first I was willing to give the benefit of the doubt as well. And I should have mentioned this in my post, but the only time that function is called is on page load where a variable is assigned it's value and that variable is not referenced anywhere else other than the assignment.
|
# ? Jun 5, 2008 18:47 |
|
return0 posted:It is however slightly incorrect in that zero is incorrectly considered to be a power of two, I think this can be used to fix that: Two to the negative infinity!
|
# ? Jun 6, 2008 02:11 |
|
from the forum bug reporting threadElDouche posted:Seriously, the database needs to "warm up"? That is stupidest thing I've ever read, aside from Dreamhost and their excuses. I was going to give it as pass as just someone who thought they knew more than they did, then I noticed that in this guy's profile it said "code monkey". oh jeez.
|
# ? Jun 6, 2008 02:23 |
|
Oh, Slashdot http://developers.slashdot.org/article.pl?sid=08/06/03/210224 leads to the following reply: http://developers.slashdot.org/comments.pl?sid=572807&cid=23645679 quote:I agree that there hasn't been enough progress in this field, just slow, incremental improvements. Hey, if you have perpendicular harddisks, you could try perpendicular database tables, right?
|
# ? Jun 6, 2008 09:57 |
|
IcePotato posted:from the forum bug reporting thread The amount of downtime was pretty ridiculous. We have sites that get 30,000 requests per minute and don't allow that to happen. Then again, this is just a pretty small website ran by a handful of people and not a company.
|
# ? Jun 6, 2008 17:54 |
|
Yoozer posted:Hey, if you have perpendicular harddisks, you could try perpendicular database tables, right? What, didn't you know joins take a long time? gently caress that noise.
|
# ? Jun 6, 2008 19:49 |
|
Yoozer posted:Hey, if you have perpendicular harddisks, you could try perpendicular database tables, right? I'm having a hard time coming up with any design that involves 1000 columns, unless you're doing something retarded like altering the table to add more columns whenever you need a new relation. I will admit I did this once, before I really understood databases
|
# ? Jun 6, 2008 21:53 |
|
I wonder how many NULLs are in that table. That is probably one of the most sparse tables ever created.
|
# ? Jun 6, 2008 22:24 |
|
Chain Chomp posted:I wonder how many NULLs are in that table. That is probably one of the most sparse tables ever created. IS_FLAG, IS_NOT_FLAG
|
# ? Jun 6, 2008 22:31 |
|
ZorbaTHut posted:I'm having a hard time coming up with any design that involves 1000 columns, unless you're doing something retarded like altering the table to add more columns whenever you need a new relation. quote:My database stores the behaviors of visitors to develop predicative modeling applications for a mid-sized online retailer. The data collection process is automated, and responses can fill up the tables very fast. I've found that takes a lot of data to accurately run a regression, as the behaviors of Internet users is pretty much random. In my system, each participant is a row, and each response is a column. Many people tend to revisit the site on a regular basis, and it is not uncommon at all for the click-throughs of certain users to exceed the 1000 column limit over a period of time. I tend not to get angry at people over the internet, but, man I really want to yell at this guy.
|
# ? Jun 6, 2008 22:50 |
|
Not what I've seen, but what a friend just told me about :quote:buddy: I think .. I may have found some of the worst PHP code ever
|
# ? Jun 6, 2008 22:54 |
|
Ok, I was right, that table is incredibly sparse. It's kind of funny that an hour's worth of reading about database theory would have eliminated this problem.
|
# ? Jun 6, 2008 22:54 |
|
Chain Chomp posted:Ok, I was right, that table is incredibly sparse. I can't even figure out what he's thinking. Two minutes of asking a question would have solved his problem. I remember when I was first trying to figure out how to make a web-based game, having only done one in mIRC script (christ, that's a coding horror all its own) and coming to the conclusion that I was probably going to have to make a separate table for each player. I had to ask someone how I'd pull that off and she was like "wtf??? NO" and that pretty much fixed me.
|
# ? Jun 6, 2008 23:23 |
|
Ryouga Inverse posted:I can't even figure out what he's thinking. Two minutes of asking a question would have solved his problem. For "easy" languages like web programming, I've always learned just by reading others' code and doing some basic playing with the code, and then delving into books. It removes all those reinventing the wheel obstacles.
|
# ? Jun 6, 2008 23:26 |
|
Ryouga Inverse posted:I can't even figure out what he's thinking. Two minutes of asking a question would have solved his problem. I think he's thinking he has to put each visitor into their own row and add a column for each time they click. I'm not sure how one would ever come to that `solution`.
|
# ? Jun 6, 2008 23:30 |
|
duz posted:I think he's thinking he has to put each visitor into their own row and add a column for each time they click. I'm not sure how one would ever come to that `solution`. It would look like this I guess code:
|
# ? Jun 6, 2008 23:37 |
|
Chain Chomp posted:It would look like this I guess Not only is that a retarded DB design, it also is completely useless. Nothing that a database can do that a spreadsheet (or hell a flat text file) cannot do is applicable to that layout.
|
# ? Jun 7, 2008 00:11 |
|
ZorbaTHut posted:I'm having a hard time coming up with any design that involves 1000 columns, unless you're doing something retarded like altering the table to add more columns whenever you need a new relation. It was un-elegant, but I actually had a DB with about 200 columns. Though that was for the result of lab tests, where each test gave 200 distinct values. I'm not proud of it, though.
|
# ? Jun 7, 2008 00:36 |
|
ymgve posted:It was un-elegant, but I actually had a DB with about 200 columns. Though that was for the result of lab tests, where each test gave 200 distinct values. My current project has a 180+ column table for medical records since each claim is 180 fields. I argued that we could normalize it further (i.e. don't store duplicate drug descriptions and the like) but I was shot down .
|
# ? Jun 7, 2008 01:57 |
|
I'm fixing an application right now for a children's foster home. Previously, they went with the lowest bidder they could find ($20/hr, I think). That guy apparently subcontracted it out to someone who charged even less. None of them understood databases or DRY or much of anything. Here's some of their work:code:
code:
The PDF rendering code is broken up logically into "RenderPage1", "RenderPage2", and so on. So if I want to delete a section, everything has to be moved "up a function" to get the pagination right. I hate this codebase so much. The guys who wrote it have been working on it since last November.
|
# ? Jun 7, 2008 04:08 |
|
return0 posted:if( ((num-1) & (num)) == 0 ) is not a test for evenness, it's checking for if num is a power of two. But zero is a power of two. 2**64 = 0.
|
# ? Jun 7, 2008 04:36 |
|
For a Facebook app I inherited there was a function to add some code to your profile, but since this code was dynamically generated there was a PHP script to do it. This script was called by a php script which used curl on it.
|
# ? Jun 7, 2008 10:50 |
|
Someone from my team decided to check this in today:code:
this.value = value.replaceAll("&", "&"); hey wiz fucked around with this message at 03:50 on Jun 10, 2008 |
# ? Jun 10, 2008 02:48 |
|
No, I don't see it. What's the bug? EDIT: oh, yeah, index.length(). Easy to miss for a human - shouldn't the compiler catch that, though? JoeNotCharles fucked around with this message at 03:00 on Jun 10, 2008 |
# ? Jun 10, 2008 02:58 |
|
index.length() should be value.length() ?
|
# ? Jun 10, 2008 03:00 |
|
hey wiz posted:Someone from my team decided to check this in today: While that's not ideal code, it's hardly a horror. It looks a lot like everything every C programmer ever wrote in javascript.
|
# ? Jun 10, 2008 03:51 |
|
dustgun posted:index.length() should be value.length() ? JoeNotCharles posted:No, I don't see it. What's the bug?
|
# ? Jun 10, 2008 03:52 |
|
Who would have thought that this code would have resulted in issues?code:
|
# ? Jun 10, 2008 21:31 |
|
ashgromnies posted:and most of it is equally unreadable... blargh. It leans more towards retarded than unreadable, quite a few people skip using unless but it's a bit sill considering the post-conditional check.
|
# ? Jun 10, 2008 21:50 |
|
MrMoo posted:It leans more towards retarded than unreadable, quite a few people skip using unless but it's a bit sill considering the post-conditional check. Well it makes it unreadable because I pared it down a little. There are big ol' chunks of code inside those if-else blocks that you have to read to... then you realize the code in the else block won't do anything because the second line is "return if the condition that got me here is still false". If not user.. try harder to get the user!
|
# ? Jun 10, 2008 21:59 |
|
Old QuickBasic program:code:
|
# ? Jun 11, 2008 22:02 |
|
This one from my previous job just floated into my mind:code:
|
# ? Jun 12, 2008 10:16 |
|
My boss found this today in our app.code:
Randomosity fucked around with this message at 16:11 on Jun 13, 2008 |
# ? Jun 13, 2008 14:31 |
|
Was the . vs , typo in the original, or did you make that just now?
|
# ? Jun 13, 2008 15:42 |
|
Today's horror is that I'm still arguing with people about why you can't delimit a file with literal 0xFE bytes when you want the delimited data to contain utf8 multibyte characters. A couple of people have now actually said "...but I thought all bytes were valid utf8?"
|
# ? Jun 14, 2008 03:12 |
|
|
# ? Apr 26, 2024 09:42 |
|
yaoi prophet posted:Today's horror is that I'm still arguing with people about why you can't delimit a file with literal 0xFE bytes when you want the delimited data to contain utf8 multibyte characters. You mean CAN, right? 0xFE and 0xFF aren't valid in UTF-8, which is why they're good markers for UTF-16 data. Can the delimited data contain U+0000? If not, I'd just use 0x00 - it's clearer, UTF-8 is guaranteed never to use a 0 byte anywhere except the representation of U+0000, and it makes it less likely some one will look at your stream of UTF-8-plus-0xFE-delimiters and conclude it's UTF-16 because part of a BOM is present. (On the other hand, it means you have to be careful not to treat it as a 0-terminated string.)
|
# ? Jun 14, 2008 05:40 |