Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
No Safe Word
Feb 26, 2005

OriginalPseudonym posted:

We have CCTray. Real conversation:
:v: : Hey, so I saw that the build broke because of your checkin...
:) : Oh, whoops.
:v: : So can you fix it?
:) : Nope, you're welcome to though.
Revert that fucker's changes.

Adbot
ADBOT LOVES YOU

Ursine Catastrophe
Nov 9, 2009

It's a lovely morning in the void and you are a horrible lady-in-waiting.



don't ask how i know

Dinosaur Gum

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.

:suicide:

The Gripper
Sep 14, 2004
i am winner

OriginalPseudonym posted:

We have CCTray. Real conversation:
:v: : Hey, so I saw that the build broke because of your checkin...
:) : Oh, whoops.
:v: : So can you fix it?
:) : Nope, you're welcome to though.
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.

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:
:mad: : REDACTED added this feature and the system says you deleted it, why are you deleting other peoples work. I told the client this feature was complete.
:confused: : His commits didn't work, he improperly merged without testing. It broke the entire project.
:mad: : IT'S NOT REDACTED's JOB TO MAKE EVERYONE ELSES CODE WORK, EVERYONE HAS TO TAKE RESPONSIBILITY.

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.

Malloc Voidstar
May 7, 2007

Fuck the cowboys. Unf. Fuck em hard.

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
This is more what I was expecting.

npe
Oct 15, 2004
code:
catch (IOException exception) {
       if (null != exception && exception.getClass().getName().contains("ClientAbortException")) {
         // Occurs if the user hits the stop button. This is
         // considered a valid response that simply never reached the
         // client per the user's request.
         found = true;
         break;
       }

Vanadium
Jan 8, 2005

I have to ask, can you catch null as an exception?

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe
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:
found = true; break;

Pardot
Jul 25, 2001




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.

code:
SELECT *
  FROM Persons
 WHERE /* HACK! Being SQL, there's no concept of 
          RegEx, so we have to this horrible hack  */
       Replace(Replace(Replace(Replace(
       Replace(Replace(Replace(Replace(
       Replace(Replace(Replace(Replace(
       Replace(Replace(Replace(Replace(name, ' ',''),
         'É','E'),'È','E'),'Ê','E'),'Ë','E'),
	 'À','A'),'Â','A'),'Ä','A'),
	 'Ï','I'),'Î','I'),
	 'Ç','C'),
	 'Ô','O'),'Ö','O'),
	 'Ü','U'),'Ù','U'),'Û','U') 
       LIKE @name AND 
       /* HACK AGAIN! Oh yeah, no cod reuse.
          Why are we doing this in SQL!? */
       Replace(Replace(Replace(Replace(
       Replace(Replace(Replace(Replace(
       Replace(Replace(Replace(Replace(
       Replace(Replace(Replace(Replace(surname, ' ',''),
       'É','E'),'È','E'),'Ê','E'),'Ë','E'),
       'À','A'),'Â','A'),'Ä','A'),
       'Ï','I'),'Î','I'),
       'Ç','C'),
       'Ô','O'),'Ö','O'),
       'Ü','U'),'Ù','U'),'Û','U') 
       LIKE @surname 
 ORDER BY name, surname

Wrap it up mysqailures http://www.postgresql.org/docs/9.1/interactive/unaccent.html

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

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.

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:
:mad: : REDACTED added this feature and the system says you deleted it, why are you deleting other peoples work. I told the client this feature was complete.
:confused: : His commits didn't work, he improperly merged without testing. It broke the entire project.
:mad: : IT'S NOT REDACTED's JOB TO MAKE EVERYONE ELSES CODE WORK, EVERYONE HAS TO TAKE RESPONSIBILITY.

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.

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.

Zombywuf
Mar 29, 2008


*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.

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

I can't tell whether you're bashing MySQL here, or Postgres, or both.

pseudorandom name
May 6, 2007

Zombywuf posted:

*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.

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?

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.

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.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



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. :v:

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;
}
?>

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

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

Zombywuf
Mar 29, 2008

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.

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.

Plorkyeran posted:

mutation is the devil

It's non-obvious mutation due to php's scoping rules, though.

TasteMyHouse
Dec 21, 2006
Forgive my clumsy anonymizing, but jesus christ

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

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

Zombywuf
Mar 29, 2008

Plorkyeran posted:

can't have non-obvious mutation if you don't have any mutation at all

Wanna bet?

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

Zombywuf posted:

Wanna bet?
can't have bugs that accidentally delete files if your file system doesn't allow mutation

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


Jabor posted:

Well this is just begging the question.

How badly would it break if something with ID=0 did exist?

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.

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.

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.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

Munkeymon posted:

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;
}
?>

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
?>

TasteMyHouse
Dec 21, 2006

Jabor posted:

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
?>

I recently encountered C++ code that used this idiom, relying on the broken scoping of 'for' loops in VC6

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

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

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.

Plorkyeran posted:

side-channel attacks based on the amount of heat generated

They exist already w/ thermal imaging attacks.

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal
Solution: don't mutate the instruction pointer.

tef
May 30, 2004

-> some l-system crap ->

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'

Doc Hawkins
Jun 15, 2010

Dashing? But I'm not even moving!



This is what the guy who submitted to the DailyWTF refactored it to:

code:
SELECT * 
  FROM Persons 
 WHERE name collate Latin1_General_CI_AI LIKE @name 
   AND surname collate Latin1_General_CI_AI LIKE @surname 
 ORDER BY name, surname

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

Zombywuf posted:

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.

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.

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe
I thought utf8_bin was the right one.

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

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.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
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:
function parse(value){

var reg0 = /f(art)z/;
var reg1 = /butts?/;
reg2 = /qwe(rty)u/; // sure, let's make reg2 a global for some reason.
...
var reg10 = /a(s)df/;

var tmp = reg0.exec(value);

if(tmp && tmp[1]) {
    tmp = reg1.exec(value);
}

tmp = reg2.exec(value);
How the gently caress am I supposed to know what the value of 'tmp' is, or could be, without dropping a breakpoint on every loving row and watching every variable.

Zombywuf
Mar 29, 2008

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/

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

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.
So I thought the utf8_bin was the right one to use, but I obviously didn't understand what you meant. Could you elaborate some more.

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

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
So I thought the utf8_bin was the right one to use, but I obviously didn't understand what you meant. Could you elaborate some more.

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).

Zombywuf
Mar 29, 2008

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
So I thought the utf8_bin was the right one to use, but I obviously didn't understand what you meant. Could you elaborate some more.

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 :respek:

Zombywuf fucked around with this message at 16:55 on Nov 23, 2011

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe
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.

Adbot
ADBOT LOVES YOU

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

OriginalPseudonym posted:

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.

:suicide:

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.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply