|
OriginalPseudonym posted:We have CCTray. Real conversation:
|
# ? Nov 22, 2011 10:28 |
|
|
# ? May 17, 2024 01:58 |
|
No Safe Word posted:Revert that fucker's changes. Ahaha, you think Sourcesafe can revert sanely. Let me just put it this way: 10,000 source code files. No atomic transactions. Which is to say, every individual action on every individual file is it's own "transaction", and on a project that size, there's no easy way to say "Get every change made by X in the last N hours" because the first thing it does is start pulling the full history on every...single...file. And we've been using SS for the last 7 years.
|
# ? Nov 22, 2011 10:37 |
|
OriginalPseudonym posted:We have CCTray. Real conversation: The worst thing was, he kept a checklist of features he'd added, and passed that along to the Division Manager (above our team lead and project managers), and get patted on the back for it. If we reverted his changes, the Div. Manager would check logs and see that one of the other guys had reverted it, and the conversation would go: : : His commits didn't work, he improperly merged without testing. It broke the entire project. : IT'S NOT Instead of having to deal with lovely upper-management and having to fix all his crap, we (dickishly, I admit) kept track of what features he was working on and as a group beat him to almost every single one of them for close to a month, so when he went to commit his changes the team lead rejected them for needless duplication. We all had a good laugh until we found out he was still filling out his checklist and passing it along to the division manager and getting props for his good work, so I guess the moral of the story is be a bad developer and get mad props, or something.
|
# ? Nov 22, 2011 11:24 |
|
The Gripper posted:Instead of having to deal with lovely upper-management and having to fix all his crap, we (dickishly, I admit) kept track of what features he was working on and as a group beat him to death
|
# ? Nov 22, 2011 11:38 |
|
code:
|
# ? Nov 22, 2011 16:54 |
|
I have to ask, can you catch null as an exception?
|
# ? Nov 22, 2011 16:59 |
|
Never but that's not even the worst part. Instead of doing that moronic if check they should just be catching that ClientAbortException instead of IOException. I don't even want to know about the horros that are code:
|
# ? Nov 22, 2011 17:01 |
|
Doc Hawkins posted:I don't know why I follow the DailyWTF, since most of the time I don't like it, but today's did get a laugh out of me. The idea is that searches for typical english characters also match their accented counterparts. Wrap it up mysqailures http://www.postgresql.org/docs/9.1/interactive/unaccent.html
|
# ? Nov 22, 2011 17:33 |
|
The Gripper posted:We had a guy that would do this regularly, and it frustrated every other person on the team to the point where no one even spoke to him anymore. Almost everything he committed wouldn't compile because he had things checked out for weeks, and it was on everyone else to make their code work with his broken merges. You aren't being clever enough. Break his stuff when it's merged in and modify commit history (exercise left to reader) so the bugs come in blaming him. Complain behind his back to upper management - use phrases like "his brain doesn't work right". Crack jokes. Set other managers against him.
|
# ? Nov 22, 2011 17:57 |
|
Pardot posted:Wrap it up mysqailures http://www.postgresql.org/docs/9.1/interactive/unaccent.html *le sigh* The real horror is not using some sort of appropriate collation order instead of hacking up your own thing that will break in Hungarian, Polish or Nynorsk.
|
# ? Nov 22, 2011 18:04 |
|
Pardot posted:Wrap it up mysqailures http://www.postgresql.org/docs/9.1/interactive/unaccent.html I can't tell whether you're bashing MySQL here, or Postgres, or both.
|
# ? Nov 22, 2011 18:05 |
|
Zombywuf posted:*le sigh* How would an appropriate collation order help lazy Americans who can't be bothered to type diacritics or even remember where the diacritics are at in the first place?
|
# ? Nov 22, 2011 18:21 |
|
Hammerite posted:Some of you might get a kick out of this. http://stackoverflow.com/questions/8220399/is-this-a-php-bug I've gotten burned by this once. gently caress php.
|
# ? Nov 22, 2011 18:36 |
|
OriginalPseudonym posted:Five dollars says that there's PHP scripts that rely on the fact that an iterator doesn't get nulled out outside of it's block. I specifically bet something very much like this exists somewhere php:<? //found a super clevar way to get last from ary function lst_ary_elm($ary){ //its super short: speed++ foreach($ary as &$elm){}; return $elm; } ?>
|
# ? Nov 22, 2011 18:51 |
|
Hammerite posted:Some of you might get a kick out of this. http://stackoverflow.com/questions/8220399/is-this-a-php-bug mutation is the devil
|
# ? Nov 22, 2011 18:58 |
|
pseudorandom name posted:How would an appropriate collation order help lazy Americans who can't be bothered to type diacritics or even remember where the diacritics are at in the first place? http://dev.mysql.com/doc/refman/5.0/en/charset-collation-implementations.html Even MySQL can do accent insensitive collations. EDIT: it wouldn't surprise me if it did them by default.
|
# ? Nov 22, 2011 19:01 |
|
Plorkyeran posted:mutation is the devil It's non-obvious mutation due to php's scoping rules, though.
|
# ? Nov 22, 2011 19:06 |
|
Forgive my clumsy anonymizing, but jesus christ
|
# ? Nov 22, 2011 19:22 |
|
TRex EaterofCars posted:It's non-obvious mutation due to php's scoping rules, though. can't have non-obvious mutation if you don't have any mutation at all
|
# ? Nov 22, 2011 19:28 |
|
Plorkyeran posted:can't have non-obvious mutation if you don't have any mutation at all Wanna bet?
|
# ? Nov 22, 2011 20:10 |
|
Zombywuf posted:Wanna bet?
|
# ? Nov 22, 2011 20:30 |
|
Jabor posted:Well this is just begging the question. Contra Duck posted:Screw that, I want to know if you ever bought that 36kbps modem. Did I mention the VB code was commented in a mix of English and Japanese? I think it retrieved xml message through some wonky file loader (also as I remember it, the previous developers had ignored the extensible part of XML and instead just rammed information into <notes> and <notes1> nodes) so seemed to bypass the network part entirely....somehow. I told my manager the system was a shitheap that we couldn't support and we managed to palm it off on another department, I think it's still in use somewhere in the company.
|
# ? Nov 22, 2011 21:07 |
|
Plorkyeran posted:can't have non-obvious mutation if you don't have any mutation at all can't have any output either. gotta mutate something sometime or the only side effect of your application is heat.
|
# ? Nov 22, 2011 21:47 |
|
Munkeymon posted:I specifically bet something very much like this exists somewhere The more common case is probably: php:<? foreach($arr as &$e) { if(some_condition($e)) break; } //Oh hey look now $e refers to the thing we found ?>
|
# ? Nov 22, 2011 22:39 |
|
Jabor posted:The more common case is probably: I recently encountered C++ code that used this idiom, relying on the broken scoping of 'for' loops in VC6
|
# ? Nov 22, 2011 23:06 |
|
TRex EaterofCars posted:can't have any output either. gotta mutate something sometime or the only side effect of your application is heat. side-channel attacks based on the amount of heat generated
|
# ? Nov 22, 2011 23:24 |
|
Plorkyeran posted:side-channel attacks based on the amount of heat generated They exist already w/ thermal imaging attacks.
|
# ? Nov 23, 2011 00:35 |
|
Solution: don't mutate the instruction pointer.
|
# ? Nov 23, 2011 00:48 |
|
Plorkyeran posted:side-channel attacks based on the amount of heat generated this actually works http://www.cl.cam.ac.uk/~sjm217/papers/ccs06hotornot.pdf 'Unfortunately for anonymity, the result of temperature on clock skew can be remotely detected through observing timestamps'
|
# ? Nov 23, 2011 01:46 |
|
Pardot posted:Wrap it up mysqailures http://www.postgresql.org/docs/9.1/interactive/unaccent.html This is what the guy who submitted to the DailyWTF refactored it to: code:
|
# ? Nov 23, 2011 02:14 |
|
Zombywuf posted:http://dev.mysql.com/doc/refman/5.0/en/charset-collation-implementations.html It does do them by default. At least, the default collation both for Latin-1 and UTF-8* encodings is an case- and accent-insensitive one. That's why I couldn't work out what the other guy was having a go at. * MySQL's "utf8" is actually not UTF-8, but that's another issue.
|
# ? Nov 23, 2011 03:41 |
|
I thought utf8_bin was the right one.
|
# ? Nov 23, 2011 03:47 |
|
MEAT TREAT posted:I thought utf8_bin was the right one. I don't know what you mean by "the right one". utf8_bin is the binary collation for the utf8 character set. It compares all strings as binary strings. The default is utf8_general_ci, which is case- and accent-insensitive.
|
# ? Nov 23, 2011 04:05 |
|
Dear coworker: JavaScript is not assembler for some underpowered microcontroller, and variables are not registers, you don't have to reuse them, especially long strings of:code:
|
# ? Nov 23, 2011 08:04 |
|
Hammerite posted:I don't know what you mean by "the right one". utf8_bin is the binary collation for the utf8 character set. It compares all strings as binary strings. The default is utf8_general_ci, which is case- and accent-insensitive. Binary comparison for unicode strings is almost always wrong. Defaulting to case insensitive is pretty normal for SQL databases sadly. But yeah, I'm going to keep repeating this, use the unicode aware functions for string handling/comparison provided by your system. The library author almost certainly knows more about it than you do. If you insist on doing it yourself you need to read this book first: http://www.unicode.org/versions/Unicode6.0.0/
|
# ? Nov 23, 2011 12:29 |
|
Hammerite posted:I don't know what you mean by "the right one". utf8_bin is the binary collation for the utf8 character set. It compares all strings as binary strings. The default is utf8_general_ci, which is case- and accent-insensitive. I know that utf8_general_ci is the default and I thought that this collation was not actually UTF-8. In reference to this quote:* MySQL's "utf8" is actually not UTF-8, but that's another issue.
|
# ? Nov 23, 2011 16:33 |
|
MEAT TREAT posted:I know that utf8_general_ci is the default and I thought that this collation was not actually UTF-8. In reference to this utf8 is a character set, not a collation. In MySQL's terminology the "character set" of a string determines what characters can appear in a string, and how those characters are encoded. It's the character encoding of the string. To each character set is associated at least one collation, usually more than one. A collation is a set of rules for comparisons between strings in the character set: when two strings are equal, and what order they should be in when sorted. It does not make sense to say that a collation "is not UTF-8", except insofar as it might be taken to mean that the collation is not a collation of the UTF-8 character set, because UTF-8 is a character set, not a collation. If you compare two utf8 strings using the utf8_bin collation, then they are compared as binary strings. If you compare them using the default utf8_general_ci collation, they are compared in a case- and accent-insensitive fashion. There are quite a few other collations for utf8, most of them intended for text in specific languages. There is also utf8_unicode_ci, which is slower but does a better job than utf8_general_ci of taking various unicode rules into account. When I said that MySQL's utf8 is not UTF-8, what I was referring to is that MySQL's utf8 only allows a subset of the characters that are allowed in true UTF-8. In UTF-8 each character takes up between 1 and 4 bytes. MySQL's utf8 only allows each character to take up between 1 and 3 bytes. If you give it a UTF-8 string containing 4-byte characters, it will give you an error message or not store it correctly. Of course there is nothing wrong with them implementing such a character set, what is wrong is that they would implement it and then call it UTF-8 when that's not what it is. In more recent versions of MySQL they actually have implemented a character set that really is UTF-8, but because the name "utf8" was already taken they had to call it something else! (it's called "utf8mb4", or something like that).
|
# ? Nov 23, 2011 16:51 |
|
MEAT TREAT posted:I know that utf8_general_ci is the default and I thought that this collation was not actually UTF-8. In reference to this It seems like you are confusing character encoding and string collation. UTF-8 is a character encoding, as such it represents a string of characters as an array of bytes. It says nothing however about the sort ordering of said strings though. The same string can be represented by many different arrays of bytes through many different encodings. A string, being a sequence of characters, is a logical entity with certain operations defined on it, the collation order determines the operations of <, = and > (and possibly others such as length). These typically are locale dependant and deal with complexities such as Dzs being a single letter in Hungarian which affects the sort ordering in a strange way (strange at least to those of us with English as a first language). In general when manipulating strings in a program you should not care about the character encoding, you should care about things like locale dependant collation. The time you care about encoding is when you are reading data in and out fo external sources. The only time you should compare strings by their bytes is when humans will never see the result of the sorting (e.g. when you are using the strings as keys into a dictionary for quick machine lookup rather than user presentation). MySQLs utf-8 limits the character encoding the 3 bytes and as such cannot represent the full unicode range and will silently replace those characters outside of its range when you try to store them. This has nothing to do with sorting and everything to do with stupidity on behalf of MySQL's developers. EDIT: beaten! also sup person who actually understands unicode Zombywuf fucked around with this message at 16:55 on Nov 23, 2011 |
# ? Nov 23, 2011 16:51 |
|
I actually do understand and the difference between the character sets and the collations. What's really tripping up the discussion is that I'm mixing the collations with the character sets because in MySQL the collation implies the character set. I knew about the 3 byte limit, but I thought that it only applied to the utf8_general_ci collation/character set and that it had been fixed in the utf8_bin collation/character set. That obviously doesn't make sense because as you point out they are both using the same character set and it would be ambiguous if they used differnt character sets but shared the same name. I was unaware that they had to create a new charset name called utf8mb4 (a.k.a the right one) to fix this. Thanks for clearing that up guys.
|
# ? Nov 23, 2011 17:38 |
|
|
# ? May 17, 2024 01:58 |
|
OriginalPseudonym posted:Ahaha, you think Sourcesafe can revert sanely. You can actually do this in SourceSafe if you make some clever batch files and do it all through the command line. Yeah... I was in a dark place for a long long time... I know a bit too much about VSS.
|
# ? Nov 23, 2011 20:27 |