
Docker for Windows won't run if Razer Synapse driver management tool is running - edward
https://twitter.com/Foone/status/1229641258370355200
======
jordansmithnz
Ha, stackoverflow is a great tool, but... the more answers I see on an area
I’m experienced in, the more I realize how wrong they can be. Sure, the answer
usually gets the job done, but everything else about it might not be right.

If I need to use stackoverflow, these days I make sure I do a few things:

\- read a number of answers, comments included. Just because an answer is
accepted doesn’t mean it’s the best one

\- read API docs for anything I’m unfamiliar with, and make sure I understand
how the solution works

\- never copy paste; instead use the general idea or concept to rewrite a
solution in a safe, future proof manner

\- if an answer works but doesn’t feel like the right solution, be prepared to
do my own research to find a better approach

Hopefully this results in a better engineered product, but one of the main
benefits is learning and expanding knowledge of APIs/techniques.

~~~
rvschuilenburg
> read API docs for anything I’m unfamiliar with

One of the differences i've noticed between myself and some of the junior devs
i've worked with. I would usually use the official docs as my first resource,
and they would use stack overflow instead.

~~~
MperorM
This is a hard lesson I had to learn as a junior developer.

I'm impatient and Stack overflow can often give me an easy solution. But just
as often, it can't and I will spend 30 minutes unproductively trying things
with little progress.

As I become a better developer I become more inclined to spend 30 minutes with
the documentation instead.

~~~
tracker1
Depends on how clear the documentation/usage is... and sometimes you accept
that you have limited knowledge and understanding. Either way, it helps to
understand what you are doing, and when in doubt look it up.

~~~
nradov
If the library documentation isn't clear then that's a clear sign that whoever
created it doesn't take quality seriously and you shouldn't use it in the
first place. Of course sometimes there's no alternative so you just have to
deal with it.

------
MadWombat
I am a somewhat active SO user and one thing I see other contributors
repeating over and over is "stackoverflow is not a code writing service".
Usually this comes up in the context of some kid posting their college
assignment and asking people to solve it, but I think it should extend
further.

Do not copy/paste code from stackoverflow. SO is not a code writing service.
It is a problem solving/question answering service. Any code you see in the
answers should be takes as reference only. If you don't understand what the
code does, re-read the answer, check the documentation, understand and then
write your own code. What happened here is such a stupidly trivial bug. If
someone only took a second glance at this code it would be blindingly obvious
what is going on here. I saw it as soon as I looked at the SO code sample and
I don't even write C#. Do people at Docker even do code reviews?

Also, when I write answers in SO, I try (not 100% of the time, but I do try)
to make my code generic, so it solves the problem the user is having, but does
not include any specifics from the question. I suggest you all do the same.

P.S. I know that this rant of mine is rather idealistic. Nobody is going to
stop copy/pasting code and these things will keep happening. But writing this
was therapeutic.

------
LeonM
I think it would be a great addition for StackOverflow to have a sort of
report button for dangerous code.

Take for example libcurl (thus, implementation in PHP, Ruby, Go, etc). There
are sooo many posts with cURL example code where CURLOPT_SSL_VERIFYPEER is
disabled. These are often answers with thousands of upvotes, that have been
there for years.

Inexperienced developers copy/paste this code into production without
understanding what it does.

~~~
fctorial
You can report the errors in comments, and develop a habit of looking in the
comments for reports of dangerous code.

~~~
crooked-v
...if you have 50 reputation.

~~~
fctorial
You mean literally everyone who's been coding for more than 3 months. You need
5 upvotes on your questions to get that much.

~~~
crooked-v
Unless you've never made any particular use of StackOverflow, stumble on an
incorrect answer, realize you have no way to fix it, and then just leave
because you don't feel like jumping through hoops just to make somebody else's
day better.

~~~
jodrellblank
If you've never made any particular use of StackOverflow, why would you expect
them to care what you have to say about anything on the site?

It would probably take you as much effort to get 50 rep as it's taken you to
post multiple sour grapes comments about how dare they have a threshold which
excludes you, don't they know who you are??

~~~
crooked-v
> If you've never made any particular use of StackOverflow

I would have made use of it... if I didn't have to post questions I have no
interest in posting to farm enough reputation to actually do anything to fix
the incorrect answers I occasionally stumble across in Google searches.

> It would probably take you as much effort to get 50 rep

Again, I have zero interest in posting questions just to farm reputation. Less
than zero, actually, because of the mental overhead involved in doing so.

~~~
jodrellblank
Do you understand that from the other side, you aren't a known skilled
developer submitting valid corrections, you are indistinguishable from any
other internet IP address submitting spam and/or low grade buggy
misunderstandings?

One way they distinguish people who care about code from complete robo-junk is
with a minimal effort barrier of community upvotes, which you refuse to engage
with. They don't know you're special and important enough to skip the entrance
requirements - how should they know? What the system sees is that you won't
put effort in to get 50 karma. You want to skip their criteria because you say
you are good enough - yet everyone including spambots would say they were good
enough to skip the criteria.

If the filter was "verified members of the ACM/IEEE/IETF/whatever can bypass
the 50 point requirements" would that be better? Or would proving your
identity and membership details still be too high effort?

What test wouldn't be too high effort for you to bother, but would still be
something that could be automated by stackoverflow and would cut out a huge
mass of spam?

~~~
fwip
If it's trivial to reach 50 rep by asking questions, how does it prevent
unskilled developers from submitting corrections?

~~~
jodrellblank
Unskilled developers won't find it trivial. See the new question review queues
for the kinds of questions submitted by people who can be bothered to sign up
and try to participate for evidence towards this claim. e.g. right now there's
one which isn't about programming it's about system administration, doesn't
explain what they tried, and concludes with "it is not working" with no
further details. This first-question is not likely to get upvoted. By being a
minimum-competence filter it's not selecting in only the most skilled
developers, it's selecting out huge swathes of people who don't want to do
what stackoverflow wants its users to do.

People who submit terrible contributions will fall below 50 rep and lose the
ability to do so.

------
_-___________-_
If you're going to copy-paste code from Stack Overflow and deploy it to
millions of users' systems, I think you have some responsibility to understand
what the code is doing.

I can totally see how this happened, and I would definitely not say that I
would never make this mistake, especially under time pressure etc. But a
careful programmer would a) desire to understand what the code did, and thus
spend enough time reading it to spot the `GetType()`, and b) test that the
"prevent more than one instance from running" behaviour worked properly, which
would involve _both_ testing that you can't run two instances of the program,
_and_ testing that if you change the assembly identifier, you can run two
instances.

~~~
mdszy
How many times have you run `npm install` or used literally any programming
package management system without personally reading every line of code that
you're installing?

~~~
theamk
Well, if you are going to be passing something as your own work, you better
understand it well.

Also, you should look at least at the docs of the packages you install.. And
since most SO answers are shorter that introductory section of most docs, this
means reading and understanding entire answer.

~~~
mdszy
>Also, you should look at least at the docs of the packages you install

Brb reading the docs for every micro-package installed as a dependency for
what I just installed that provides functionality that could've been hand
written in five minutes.

Gonna spend the next few months reading about a thousand package README's for
this single package I installed and all its dependencies down the tree, be
right back.

~~~
falcolas
You say that like it's not a good thing to do? If you pull a library into your
project, you're taking responsibility for that library, for better and worse.

~~~
mdszy
I'm talking about how that's completely not feasible anymore because of how
every project has dependencies upon dependencies upon dependencies because the
general development attitude has shifted towards "import a single library that
tells you if a number is odd, and another library to tell you if one is even"

~~~
mperdoni
Ultimately, if a bug in a library causes issue with your program, and your
company loses $X, your superiors will not give a shit. You have the burden of
responsibility for the program.

For common major libraries used worldwide in enterprise products, you are
right in that there is an element of trust. They are made by people much
faster/better/stronger than most of us. If all else fails, the sheer magnitude
of people using it is a small insurance policy, as disastrous issues will
probably be quickly apparent. That still doesn't absolve you of
responsibility, but the overall risk is usually pretty low.

A segment of code on SO, or a weeny niche library? You only have your noggin
to vouch for its stability and accuracy.

~~~
mdszy
>They are made by people much faster/better/stronger than most of us.

lmfao no they're not

------
mannykannot
Every so often, someone will post that cheating in examinations is OK because
the important thing is to get the answer from wherever. This shows why
knowledge and understanding matter: that GetType() looks suspicious (the type
of something rarely uniquely identifies it), even if you don't know much about
the specific issue here.

------
Wolfspirit
This has been fixed in 2018!!! Why is this here?
[https://github.com/docker/for-win/issues/1723](https://github.com/docker/for-
win/issues/1723)

~~~
mwill
The title should probably be changed but it's still an interesting twitter
thread that has sparked interesting discussion here

------
kstenerud
> homework assignment for all programmers reading this thread: Think about how
> you'd find this bug in your own programs. You copy/paste the code, it seems
> to work, and you don't realize it's broken because you don't run either of
> these programs which made the same mistake.

Wait... WHAT??

Who the hell copy pastes code into their program without first examining and
understanding what each step is actually doing, how and why the pieces fit
together as they do, and how it works as a whole to solve the problem?

~~~
cstuder
Say hello to `pasteoverflow`: Paste code from Stackoverflow directly into your
editor.

[https://marketplace.visualstudio.com/items?itemName=matsz.pa...](https://marketplace.visualstudio.com/items?itemName=matsz.pasteoverflow)

~~~
mperdoni
Can it go one meme-step further and automate our jobs away? ;)

~~~
stmL
Does this work ?

[https://github.com/drathier/stack-overflow-
import](https://github.com/drathier/stack-overflow-import)

------
exikyut
To any Microsoft/.NET devs reading this:

What do you think the chances are that you could make exact references to

    
    
      Assembly.GetExecutingAssembly().GetType().GUID
    

return a compile-time warning?

That could make this go away very quickly.

(For bonus points, add relevant telemetry to VS. :P)

~~~
turc1656
A lot of the comments on this topic seem to be focusing on SO's nature or
something like what you proposed about .NET itself.

When I first read the Twitter thread I was sort of dumbfounded that whoever
did this originally didn't actually check it. That's not a SO or .NET problem
that needs to be caught. It's a developer problem.

If someone is copying code into their project that they've never seen before,
they should, at bare minimum, make sure it produces the expected result for
the first instance they are using it. That developer should have checked to
see that the GUID was actually the one from their assembly. Even if someone is
copying some complex code that they aren't 100% sure how it operates, they can
still test it to make sure it produces what they think it does.

The idea that someone working for Docker just copy, pasted, and then didn't
check that it actually did what it was supposed to do is sort of mind-blowing
to me. Not sure why no one else is talking about that. I've never used Docker
before, but this doesn't instill confidence. It's one thing to have something
like this in your end product - that's bad enough. It's another thing entirely
when your company builds tools for other developers to use. That shit needs to
be rock solid and this is one of those things that seriously worries me when I
see it because it's about a lack of effort/testing and someone just blindly
took code and didn't even bother to check it.

~~~
exikyut
On the one hand, I completely agree.

I remember reading something about reasoning through a very simple (couple of
divisions or something) math problem, where a deliberately (and later
obviously) wrong working-out was initially defined, then corrected, to
illustrate the importance of end-to-end understanding.

On the other hand,

a) Programming is equivalently complicated to "two-story-high whiteboard full
of Greek letters and integration functions", but is never acknowledged by
industry as such because of the associated responsibility nobody wants
anything to do with

b) We live in a world where entire industries - ML-based AI - are
_literally!!_ based on the idea of _not_ understanding the structure of the
solution to the problem.

------
userbinator
I looked at the title, then briefly glanced over the discussion here, and
guessed it correctly --- "same mutex name". I didn't guess they'd get to the
same name _that_ way, however. I thought someone had copy-pasted example code
from SO without changing a REPLACE_MUTEX_NAME or similar.

My preferred solution is simpler --- CreateMutex takes a mutex name of at most
MAX_PATH characters. That's almost begging you to make it the path to the
running executable.

    
    
        char name[MAX_PATH];
        GetModuleFileName(0, name, sizeof(name));
    

I know some of you may be thinking "but what if there are two copies of the
application in different directories?" Yes, that would result in two
instances, but how often is that a problem? If it is, then make it the binary
name-only without the path

    
    
        pname = strrchr(name,'\\');
    

and then unless you name your application something very generic like
test.exe, there can only be one. I guess the lesson here is to not overthink
things --- I see that often in SO answers too.

------
Aardwolf
And that just for some colored LEDs and such. I don't understand why you need
Windows-only software for that.

Doesn't a hardware maker want to make it as simple as possible to use their
hardware from any OS?

I used to use a Razer mouse when it had a switch on the mouse itself to toggle
between different speed settings.

But I changed away from them when that switch disappeared in later iterations
of their mice and instead depended on software that didn't work in Linux.

~~~
leppr
The new version of DeathAdder[1] reintroduced DPI adjustment buttons, and the
LED settings persist even when set with the open-source Linux drivers.

[1]: [https://www.razer.com/gaming-mice/razer-deathadder-
elite](https://www.razer.com/gaming-mice/razer-deathadder-elite)

------
NewLogic
Docker for Windows has had a fundamental Dns[1] bug since April of last year,
I've been forced to run v2.0.0.3 for months now to ensure yum repos resolve
inside AmazonLinux containers. Truly a second class platform. [1]:
[https://github.com/docker/for-win/issues/3810](https://github.com/docker/for-
win/issues/3810)

~~~
magduf
>Docker for Windows has had a fundamental Dns[1] bug since April of last year,
I've been forced...

>Truly a second class platform.

Now maybe some Windows users will see how Linux users have felt for over 2
decades.

------
taspeotis
Some tangential analysis of Synapse over here:
[https://twitter.com/davkean/status/1144498663122558977](https://twitter.com/davkean/status/1144498663122558977).

~~~
viraptor
Mouse./keyboard customisation software seems universally bad / lowest-bidder
style. Logitech's mouse button configuration tool for example weights over
400MB. Literally for a tool which requires a few dropdowns.

~~~
exikyut
Oooh. What does it have in it?

A home-made .NET-to-Java transpiler that requires custom builds of the CLR and
JVM?

The 300MB of random data at the end of the Windows XP install CD?

An encrypted archive containing the set of folders comprising the entire
source code history (the top level of which has an alarming number of entries
named like "revert_v5_bug [Final] - ACTUAL CURRENT") (because some developer
has OCD about backups)?

~~~
quantummkv
Given the state of Modern Software Development, It's most probably Electron.

------
Bedon292
So with tools like Sonarqube we get static code analysis on our code base
which shows code duplication within itself. I wonder if there is some way to
look for duplication from stack overflow? Not sure that is feasible, since no
one is going to want to post all of their proprietary code to some API, but
wonder if there is some system for local indexing SO that would also for local
duplication detection.

~~~
jodrellblank
StackExchange data dumps are (at least, were[1]) freely downloadable:
[https://meta.stackexchange.com/questions/2677/database-
schem...](https://meta.stackexchange.com/questions/2677/database-schema-
documentation-for-the-public-data-dump-and-sede)

[1] not sure what happens since they "illegally" retrospectively relicensed
all the content a few months ago.

~~~
Bedon292
Yeah I thought they had something like that. Might be interesting to play
with. I meant more of a question as to if anyone had actually done something
like that with it. Basically a Turn It In kind of tool that universities use
for plagiarism detection, but for code.

------
aeyes
Always interesting to see code from StackOverflow in a commercial product, as
always this is most likely also a licensing issue.

------
unnouinceput
When I need to ensure only one copy to run I never used GUID, I always used
some combination of project name + my name + current date + customer
name/business. This way is unique and with a personal touch. Also you can make
it as long as you want up to MAX_PATH, not the short style that GUID does it.

~~~
mapleoin
Sounds like a natural primary key.

------
nih0
For me overwatch wouln't start if razer synapse was installed.

------
nonbirithm
This is exactly the reason I can never understand how it is impossible for the
community in SO to override the accepted answer. The argument goes that the
accepted answer is the one that satisfies the asker's needs so it is always
the one that gets placed higher up. But in practice things aren't so cut and
dry.

\- The asker can misunderstand the response.

\- The asker can accept a response that for the general public's
interpretation of the question is incorrect. It doesn't matter what the asker
thought the question means to them if beyond their control their answer
becomes the first result on Google years later for a problem that might not be
exactly the same.

\- Technologies change and new libraries or language features can be added
since the question was asked. I've counted several times where people bunch up
below the accepted answer to say this is true, and 90% of the time it's the
better answer for my use case.

\- The question is similar to another that is far more popular and happens to
share the same SEO keywords but is completely unrelated, so another answer
with 1,000 upvotes in comparison to the original answer's 100 is added. People
have no choice but to put comments saying "this is the wrong answer if you're
doing X, use the other one," because the comment section of the accepted
answer is the highest up they can be seen. But the average user might not
listen or see the smaller comment text and use the wrong answer, just because
it was the accepted one.

This is because a _single person_ 's decision on what "correct" means is
valued more highly than the correctness of the more important answer which
thousands more people actually support, and is more critical to support
because of unintended search indexing.

Sometimes SO questions become used for a purpose completely unrelated to the
original questions and answers because of search engines. There should be some
kind of acknowledgement of this instead of being unable to protect clueless
people from themselves.

This isn't to support editorialization of old answers in general, it's a
problem of unintended consequences out of anyone's control because of what
gets indexed as the first search result on Google. Nobody can change what's
there if nobody but the original authors can edit the answer and they happen
to not do so for whatever reason, so we'd be stuck being misled forever. And
as we've seen people will copy and paste anything in the code box and not even
read the description and caveats if there's a fat green checkmark next to it
like a Pavlonian reflex. I'm guilty of this myself.

~~~
jhanschoo
You can still write your own answer and comment on the wrong answer.

Users who are callous enough to ignore such comments get what their lack of
due diligence deserves.

------
Causality1
Razer Synapse has been responsible for a variety of odd problems. Just myself
I've had it mess with Bluetooth connectivity and screen autorotation.

------
Kipters
The worst part is that they solved it in the "edge" branch (the one you need
to use docker on WSL2)... because they switched to Electron

------
kakuri
Razer went from making great hardware and drivers to making terrible drivers
that require you to sign in to a Razer account and constantly run Razer
software. I was a Razer die-hard for years, but with their transition from a
hardware company to a cloud-based user-data-mining company I avoid them. If
you want good hardware with good drivers I highly recommend SteelSeries.

~~~
m463
Steelseries drivers are phoning home more and more now...

However - you can configure the mouse, then uninstall the drivers and the
settings persist.

So I continue to use steelseries.

------
knolax
The author claims that this is the result of copy pasting from Stack Overflow
but it could be due to auto-complete as well. GetType and GUID both start with
'G' after all. Since the snippet is so small the similarity of the rest of it
could just be a coincidence.

------
noselasd
What am I looking for in the screenshot ?

~~~
_-___________-_
You would sadly have to find your way through the Twitter "thread" to fully
understand.

Someone at Docker and someone at Razer both copy-pasted the same faulty code
from Stack Overflow for preventing multiple instances of their program running
at once. Unfortunately the code took the assembly identifier and called
GetType() on it which returns the same value for all programs.

The Stack Overflow answer was later fixed but since the programmers no doubt
both felt they'd "solved" the problem, they didn't see the fixed answer.

~~~
Arnt
Which I suppose is an argument that pulling in eleventy thousand oneliners
from npm is better than copying oneliners using the editor: At least you can
run a batch upgrade without spending real brain cycles.

I'm sure someone has written a thingy to upgrade npm dependencies, rerun
tests, and bisect to tell you about the breaking upgrade if anything reaks.

Left-pad, come back, all is forgiven.

------
woozyolliew
A somewhat tounge-in-cheek comment: but I wonder if there could be a git/IDE
extension to track cut-and-paste code like this (especially from
stackoverflow) so that when things are corrected or flagged as broken at the
source, that change is propagated to your use of it.

------
PedroBatista
It also has an hard time string if another Hyper-V VM is running.

------
wnevets
On a related note I've found docker for windows so buggy at times.

~~~
fernandotakai
i feel like it's better than docker for macos, but that's not a really high
bar to clear tbf.

~~~
MadWombat
I have been using Docker on OS X for a while, haven't had any major issues,
but maybe my experience is atypical.

------
nlowell
Glad to see no one here ever has bugs in their code!

