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
necrotic
Aug 2, 2005
I owe my brother big time for this!

HardDiskD posted:

MS and Mozilla are working together to make MDN the default JS reference.

Yes, but clearly some pieces are missing.

Adbot
ADBOT LOVES YOU

Mr Shiny Pants
Nov 12, 2012

Volguus posted:

If in your database you store your UUID as varchar (for whatever reason, incompetency or the database support), you are arbitrarily reducing speed. Made some tests many years ago on an Oracle database, testing varchar vs bigint as primary keys, and the insert was slightly slower while the select was a lot slower (more than 15% is I remember correctly).

However, yes, if you need to share data between databases, this is a hit that you are accepting and is part of the core functionality. There's no way around it. Using the UUID type in the database would most likely improve things to the point that speed is equal, though I have not personally tested that.

I am genuinely curious, I use Postgres UUIDs in my code as a primary key for a table and between the network speed and the speed cost, however much that is of using a UUID as a primary key, the network speed is almost always the bottleneck.
What is the problem? Is it just not done?

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe
If you use a text representation of a UUID then presumably it's always the same length so should be a CHAR at least, not VARCHAR

Vanadium
Jan 8, 2005

Maybe the text representation uses a variable-width encoding like utf-8 tho :colbert:

CPColin
Sep 9, 2003

Big ol' smile.
Convert the UUID to bits, encode that as base-65536, store as a UTF-8 string?

duz
Jul 11, 2005

Come on Ilhan, lets go bag us a shitpost


As long as you're not using insert time as the primary key like a vendor of ours does.

hailthefish
Oct 24, 2010

duz posted:

As long as you're not using insert time as the primary key like a vendor of ours does.

:stonk:

So.. are they like.. hiring? I mean, I'm a clueless retard and even I know better.

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

hailthefish posted:

:stonk:

So.. are they like.. hiring? I mean, I'm a clueless retard and even I know better.

Why would you want to work at a place where you know you're the smartest person there?

iospace
Jan 19, 2038


duz posted:

As long as you're not using insert time as the primary key like a vendor of ours does.

:jebstare:

Who on earth thought this was a good idea?

TooMuchAbstraction posted:

Why would you want to work at a place where you know you're the smartest person there?

Job security.

Volguus
Mar 3, 2009

iospace posted:


Job security.

There is no job security when the place folds 10 years later and you're 10 years older with nothing to show for it.

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice

duz posted:

As long as you're not using insert time as the primary key like a vendor of ours does.

As long as the insertion mechanism is a human sitting at a desk running a sql script, this works! You can even hire more people to insert as demand grows! Webscale!

Steve French
Sep 8, 2003

iospace posted:

Job security.

This is making a really questionable assumption that such a workplace would both recognize and value the quality of your work

Pollyanna
Mar 5, 2005

Milk's on them.


I fuckin love bugs that stop happening when I put logging statements in. :shepicide:

duz
Jul 11, 2005

Come on Ilhan, lets go bag us a shitpost


hailthefish posted:

:stonk:

So.. are they like.. hiring? I mean, I'm a clueless retard and even I know better.

Volguus posted:

There is no job security when the place folds 10 years later and you're 10 years older with nothing to show for it.

After ~3 years they decided they didn't want to be in that business anymore so they shut down that product. Apparently we were the only client that they were able to get for it and all our bug reports and support requests were causing issues with their numbers. We've since replaced them with our own in-house solution using their product as an example of what not to do.

VikingofRock
Aug 24, 2008




Pollyanna posted:

I fuckin love bugs that stop happening when I put logging statements in. :shepicide:

Concurrency problems?

Eela6
May 25, 2007
Shredded Hen

Pollyanna posted:

I fuckin love bugs that stop happening when I put logging statements in. :shepicide:

Heisenbugs are the worst thing

Achmed Jones
Oct 16, 2004



I've had that happen. It was something weird with variable initialization where any reference to the variable (including in a console.log, which is how I found it) would make the code function properly, but removing that statement would ruin your day.

I ended up just mentioning the variable on a line by itself, which made it work :shrug:

This was a couple years ago, though - maybe whatever bug was causing that behaviour has been fixed by now?

Joda
Apr 24, 2010

When I'm off, I just like to really let go and have fun, y'know?

Fun Shoe
My favourite is CSS bugs that go away as soon as you open the dev console.

PhantomOfTheCopier
Aug 13, 2008

Pikabooze!
I've definitely had that happen in scripting languages and it's usually a scope issue. (Mentioning it declares it so the scope problem disappears.)

Unless you're taking about Objective C, in which case don't bother trying to figure out when variables exist and cease to exist.

EssOEss
Oct 23, 2006
128-bit approved
Today I learned of a couple of horrors lurking in .NET Framework. I was streaming binary data from .NET code into the standard input stream of a process I started as part of some automated tests. Very basic thing, this code and these tests have worked fine for more than 5 years already.

Until I updated my build automation tooling to the latest version supplied by Microsoft. All this tooling does it call the compiler and then the test runner. Works fine on my PC. However, on build servers the stream suddenly contained invalid data for no obvious reason!

To be specific, it contained the UTF-8 byte order mark! That's funny because none of my code even deals with encodings or text - all it sends is binary data (random bytes, in fact). And the exact same test runner started with the exact same command works fine on my PC. So what gives?

Turns out that .NET Framework always creates a text writer for every standard input stream it writes to. My code does not use this text writer object because it does not write text and that's fine - I can just ignore the automatically created text writer. Naturally, this text writer has an encoding object associated with it. It would appear that when when you use Visual Studio Team Services build agents, this encoding object is configured to use a byte order mark! Even though I never use it, it still acts all helpful and outputs it as soon as the stream is open.

But that is only the first horror. Why is it acting different on my PC and the build server? Because, of course, .NET Framework does not bother to ask the developer for his opinion when creating this writer - it just makes one no matter what. Yet it somehow needs to specify some encoding. What does it use? It uses whatever encoding the console of the current process uses! The encoding configuration used by VSTS build agents themselves appears to use a byte order mark for whatever reason, so I get one too! What if I need to use different encodings in my process and a started process? Silly man, one should not want that much.

Now that I think about it, I wonder if there may also be race conditions there with regard to when this BOM is written by the text writer, competing with my own data output? Because it only happened in 1 test out of 5 that did this type of operation. Whatever, I don't want to know.

EssOEss fucked around with this message at 23:41 on Dec 15, 2017

duck monster
Dec 15, 2004

Pollyanna posted:

I fuckin love bugs that stop happening when I put logging statements in. :shepicide:

I had one of these last week. Php laravel thing I had cooked up for the marketing people , for doing reseller poo poo , on safari, and only safari, it'd randomly start breaking the http connection to the server on a particular page, and do it silently with nothing in any log I could find. So I started adding in logging (on the server) and the bug stopped. Remove logging, bug reappears. Put it back in, bug stops. Ended up just leaving the logging in and filing it under "Mystery" in the bug tracker. Later worked out that upping timeout on apache fixed it too, but I'm still none the wiser as to the real cause.

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!
If Heisenbugs are the worst bugs, the best bugs are finding something so catastrophically wrong in core code that's it's amazing anything ever worked at all.

Like...

code:
template<class T>
Ptr<T>& Ptr::operator=(const Ptr<T> &other)
{
    if (this->object != other.object)
    {
        if (this->object)
            this->object->Release();
        if (other.object)
            other.object->AddRef();

        this->object = other.object;
    }

    return *this;
}

Absurd Alhazred
Mar 27, 2010

by Athanatos

OneEightHundred posted:

If Heisenbugs are the worst bugs, the best bugs are finding something so catastrophically wrong in core code that's it's amazing anything ever worked at all.

Like...

code:
template<class T>
Ptr<T>& Ptr::operator=(const Ptr<T> &other)
{
    if (this->object != other.object)
    {
        if (this->object)
            this->object->Release();
        if (other.object)
            other.object->AddRef();

        this->object = other.object;
    }

    return *this;
}

:how:

FlapYoJacks
Feb 12, 2009
Today I learned that calling dlopen in a program that links against pthread causes a 32 byte block of memory to not free when the application closes. Even after calling dlclose. It's harmless, but dang it, I want valgrind to show me all 0's without a suppression file!!!!!

Coffee Mugshot
Jun 26, 2010

by Lowtax

OneEightHundred posted:

If Heisenbugs are the worst bugs, the best bugs are finding something so catastrophically wrong in core code that's it's amazing anything ever worked at all.

Like...

code:
template<class T>
Ptr<T>& Ptr::operator=(const Ptr<T> &other)
{
    if (this->object != other.object)
    {
        if (this->object)
            this->object->Release();
        if (other.object)
            other.object->AddRef();

        this->object = other.object;
    }

    return *this;
}

This is a really hosed up implementation for assigning Peters to each other

EssOEss
Oct 23, 2006
128-bit approved
Is the horror that it decrements a reference counter without removing the object on the other Peter or what? I don't speak C++ that good.

Joda
Apr 24, 2010

When I'm off, I just like to really let go and have fun, y'know?

Fun Shoe
I think it's decrementing the reference counter on the object you're assigning from? I'm not entirely sure how to implement smart pointers, but I don't think it's the job of the assignment operator to do that.

Also, what if this already has something assigned to it?

E: nvm I'm stupid

Joda fucked around with this message at 14:39 on Dec 16, 2017

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender
I still can't figure out what's wrong with it

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

Illusive gently caress Man posted:

I still can't figure out what's wrong with it
If the reference being assigned is a child of the current reference, then the Release will deallocate it. (The AddRef/Release order is backwards.)

Hughlander
May 11, 2005

EssOEss posted:

Today I learned of a couple of horrors lurking in .NET Framework. I was streaming binary data from .NET code into the standard input stream of a process I started as part of some automated tests. Very basic thing, this code and these tests have worked fine for more than 5 years already.

Until I updated my build automation tooling to the latest version supplied by Microsoft. All this tooling does it call the compiler and then the test runner. Works fine on my PC. However, on build servers the stream suddenly contained invalid data for no obvious reason!

To be specific, it contained the UTF-8 byte order mark! That's funny because none of my code even deals with encodings or text - all it sends is binary data (random bytes, in fact). And the exact same test runner started with the exact same command works fine on my PC. So what gives?

Turns out that .NET Framework always creates a text writer for every standard input stream it writes to. My code does not use this text writer object because it does not write text and that's fine - I can just ignore the automatically created text writer. Naturally, this text writer has an encoding object associated with it. It would appear that when when you use Visual Studio Team Services build agents, this encoding object is configured to use a byte order mark! Even though I never use it, it still acts all helpful and outputs it as soon as the stream is open.

But that is only the first horror. Why is it acting different on my PC and the build server? Because, of course, .NET Framework does not bother to ask the developer for his opinion when creating this writer - it just makes one no matter what. Yet it somehow needs to specify some encoding. What does it use? It uses whatever encoding the console of the current process uses! The encoding configuration used by VSTS build agents themselves appears to use a byte order mark for whatever reason, so I get one too! What if I need to use different encodings in my process and a started process? Silly man, one should not want that much.

Now that I think about it, I wonder if there may also be race conditions there with regard to when this BOM is written by the text writer, competing with my own data output? Because it only happened in 1 test out of 5 that did this type of operation. Whatever, I don't want to know.

Had a similar problem to this 2-3 years ago upgrading from Java 6 to Java 8. Application did some work on the client, spewed out a JSON document, deep sorted the keys of it, took the SHA of the result, and sent it to the server for validation. Server did the same work, compared the two SHAs and moved forward. Problem was that there was a change to how a sorted map in Java worked from 6 to 8 such that these SHAs were no longer the same. Looking through the Sorted Tree Map should fix thiings but again there were issues. After way way way too much time it turned out to be a difference in how the client and server processes were starting and their LC_* environment variables. Which for this purpose involved how jenkins was started on the slaves that would eventually kick off the unit tests that were failing. Keep in mind there was nothing out of 7 bit ascii in any of the keys, but without micromanaging locale settings the sort wasn't stable between client and server instances.

Spatial
Nov 15, 2007

Yesterday I debugged a hardware/driver problem that only occurred once every 4 million times a function was executed. Clock domain timing bugs and hardware race conditions are a goddamn nightmare.

Got some major kudos for that one.

Now it's time for a well-earned holiday, baby

The Phlegmatist
Nov 24, 2003


joke: codebase is a horror
woke: codebase exposes the horror to users as a cry for help

smackfu
Jun 7, 2004




You can use any symbol except spaces for your password. Except question mark and exclamation.

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe
Kaiser Permanente, my healthcare organization, has a messaging system built into their website, presumably to hide the doctors' email addresses. The restrictions on what symbols you can put into a message are heinously bad. If I recall correctly, all of the following are banned: {}[]$`;'\

It makes me seriously worried that they're generating SQL statements by blindly dumping user input into the query, and this is their method for preventing SQL injection attacks.

Volguus
Mar 3, 2009

TooMuchAbstraction posted:

Kaiser Permanente, my healthcare organization, has a messaging system built into their website, presumably to hide the doctors' email addresses. The restrictions on what symbols you can put into a message are heinously bad. If I recall correctly, all of the following are banned: {}[]$`;'\

It makes me seriously worried that they're generating SQL statements by blindly dumping user input into the query, and this is their method for preventing SQL injection attacks.

Worried? This is exactly what they're doing. The funny thing is that by posting this message publicly they automatically tell everyone what kind of sql injection attacks they're vulnerable to. I always love those that say: "If your name is O'Reilly please enter OReilly".

iospace
Jan 19, 2038


TooMuchAbstraction posted:

Kaiser Permanente, my healthcare organization, has a messaging system built into their website, presumably to hide the doctors' email addresses. The restrictions on what symbols you can put into a message are heinously bad. If I recall correctly, all of the following are banned: {}[]$`;'\

It makes me seriously worried that they're generating SQL statements by blindly dumping user input into the query, and this is their method for preventing SQL injection attacks.

Friendly reminder that code that determines if someone's health insurance paid out at a former job was the poster child for "spaghetti code". 1000 line functions, no comments, no one knew how it worked, even the people who originally wrote it.

Doc Hawkins
Jun 15, 2010

Dashing? But I'm not even moving!


It's a perfect candidate for machine learning.

Hughlander
May 11, 2005

TooMuchAbstraction posted:

Kaiser Permanente, my healthcare organization, has a messaging system built into their website, presumably to hide the doctors' email addresses.

Its actually HIPPA compliance. Cant be discussing medical information over unsecured E-Mail that you dont know who is able to read it. Most hospitals now have a similar portal where you can contact your physician through their secure systems that have the same level of storage and security as your medical records.

Not saying those arent a horror but its not just We cant let you know your Drs E-Mail.

iospace
Jan 19, 2038


Hughlander posted:

Its actually HIPPA compliance. Cant be discussing medical information over unsecured E-Mail that you dont know who is able to read it. Most hospitals now have a similar portal where you can contact your physician through their secure systems that have the same level of storage and security as your medical records.

Not saying those arent a horror but its not just We cant let you know your Drs E-Mail.

Considering how often those companies get hacked...

Doesn't give me much comfort. I will say HIPPA was taken seriously at that company though I worked at. I'm sure it's taken just as seriously elsewhere (because it's both legal and civil repercussions if you do gently caress up with it), but the legal fines by and large are wrist slaps.

Adbot
ADBOT LOVES YOU

Ranzear
Jul 25, 2013

Isn't HIPPA per-violation though, so if you leak 10,000 instances you get fined 10,000 times or some poo poo?

I almost got a medical-related job with the state, and it was looking to involve HIPPA. Still don't think it paid nearly enough to deal with that poo poo.

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