|
hackbunny posted:I'm not sure I get it. Is it the shader compiler doing an unsafe transformation of floating point code? Using one kind of operation in one place and a slightly different kind in another, and erroneously considering them equivalent? And in doing so, it's creating a situation where if (a<b) can execute neither branch when a and b are too close together.
|
# ? Dec 22, 2017 23:34 |
|
|
# ? May 16, 2024 09:27 |
|
The Fool posted:All of humanity's problems can be traced back to the invention of numbers. Oh wait numbers are symbols. Transitively, all of humanity's problems can be traced to sexual reproduction. In other news, I'm not quite sure how many code reviews it's going to take before this engineer understands the difference between configuration validation, operational preparation, and execution. Stop preparing case-specific settings in the execution code. For fucks sake, go read an intro OO/SOLID principles book "senior" software developer.
|
# ? Dec 23, 2017 00:33 |
|
I just spent the past week looking into possible reasons left/right channels are swapped on a device's input roughly 4% of the time. The device in question runs on linux 2.6.36 or so. There are a few key places throughout the kernel's sound framework code where spin locks are employed, including in some threaded IRQ handlers Today I found out that when the kernel is not configured with preemption or smp support (which is the case with the device in question), there are still kthreads but most in-kernel locking is basically optimized to no-op functions. I still don't have any idea where the channel swap is coming from, but basically enabling kernel preemption is it's own pandora's box on this fairly mature system, and I'm left with no real good way to have any sort of synchronization throughout the audio driver so I guess I basically have to say 'gently caress it' now.
|
# ? Dec 23, 2017 00:56 |
|
Colonel Taint posted:I just spent the past week looking into possible reasons left/right channels are swapped on a device's input roughly 4% of the time. The device in question runs on linux 2.6.36 or so. Is it a TI DSP?
|
# ? Dec 23, 2017 02:40 |
|
Yes it is. I was able to mostly deal with the interleaving alsa/irq threads, and cut down the error rate in a test program from ~1 error in 100 test cases to ~1 in 10000 test cases. When it does reach an error case now, there's seemingly no indication at all from the hardware - no IRQs or anything. On top of that, when I run real-world tests with the thread interleaving fixed, it doesn't seem to make a difference compared to without the fix.
Colonel Taint fucked around with this message at 03:15 on Dec 23, 2017 |
# ? Dec 23, 2017 02:58 |
|
Code that was giving me a headache today from systemd:C++ code:
|
# ? Dec 23, 2017 03:59 |
|
Considering that all the other casts are using types with explicit sizes, my first question would be, what is result of sizeof(int)?
|
# ? Dec 23, 2017 04:26 |
|
I have to admit the first thing I was wondering is why the "if (p)" wasn't put outside the switch statement.
|
# ? Dec 23, 2017 04:28 |
|
ratbert90 posted:Code that was giving me a headache today from systemd: C doesn't have a boolean type (C++ does, but AFAIK systemd is written in plain C). Functions in C that take or return "booleans" conventionally use int, not uint8_t or similar -- see, for example, feof(3). So this looks entirely reasonable -- it's 1 byte on the wire, but an int in memory. The real horror is over in bus-type.c: code:
|
# ? Dec 23, 2017 17:02 |
|
ToxicFrog posted:C doesn't have a boolean type (C++ does, but AFAIK systemd is written in plain C). this fact brought to you by the year 1998
|
# ? Dec 23, 2017 17:22 |
|
Soricidus posted:this fact brought to you by the year 1998 I keep forgetting <stdbool.h> exists.
|
# ? Dec 23, 2017 19:19 |
|
ToxicFrog posted:C doesn't have a boolean type (C++ does, but AFAIK systemd is written in plain C). Functions in C that take or return "booleans" conventionally use int, not uint8_t or similar -- see, for example, feof(3). So this looks entirely reasonable -- it's 1 byte on the wire, but an int in memory. While this is true, to be fair, systemd isn't trying to run on an Atari ST or MSDOS or something. Are there any Linux platforms where gcc has a 16 bit int?
|
# ? Dec 23, 2017 19:24 |
|
I remember that at last year's systemd.conf there was a contingent of folks from some automotive manufacturer.
|
# ? Dec 23, 2017 19:46 |
|
feedmegin posted:While this is true, to be fair, systemd isn't trying to run on an Atari ST or MSDOS or something. Are there any Linux platforms where gcc has a 16 bit int? iirc one of the unix standards linux follows does guarantee that int is at least 32 bits
|
# ? Dec 23, 2017 19:56 |
|
does C99 bool have any size constraints either? i thought it was just "at least large enough to hold 0 or 1"
|
# ? Dec 23, 2017 20:44 |
|
In C, a byte is 8 bools, if you want.
iospace fucked around with this message at 20:48 on Dec 23, 2017 |
# ? Dec 23, 2017 20:46 |
|
There's language about things needing to be made of entire bytes, and you'd likely be violating some rules with pointers.
|
# ? Dec 23, 2017 23:58 |
|
_Bool is guaranteed to only hold 0 or 1. Converting a value to _Bool does a nonzero test exactly equivalent to what happens with && and if-conditions. That is the whole point of having a special _Bool type. sizeof(_Bool) is not guaranteed to be 1, and in fact it’s 4 on old PPC ABIs (including macOS), presumably out of some dumb attempt to preserve ABI compatibility with int.
|
# ? Dec 24, 2017 05:34 |
|
Not sure this is a coding horror, cause I guess I should of known better. In csharp, you can do class Foo : object or class Foo (they mean the same thing). I do the first one, I suppose for just being explicit I guess. Anyway, in Unity I had some objects on a list and when accessing I kept getting object is null. So I thought oh I must of messed up adding objects to a list. So I made a quick test file, and I was still getting objects are null. Finally I tested the objects themselves, and low and behold they were null even though I very clearly declared them on the line above. In desperation and about to rip my own hair out, I decided to look through Unity docs to see if they do anything weird with the Object class. They do. And what's worse is the object behaves like a regular old object with one tiny exception. When you do Foo foo = new Foo(); using Unity's object, it will of course always return null. So I guess that's one reason I should change my habit to just class Foo...
|
# ? Dec 24, 2017 16:15 |
|
Interesting. At a quick Googling it seems like their special object with custom behaviour is actually named UnityEngine.Object. Was it a namespace import that caused you to inherit from the wrong Object, or were you actually inheriting System.Object?
|
# ? Dec 24, 2017 16:29 |
|
Nude posted:So I guess that's one reason I should change my habit to just class Foo... Here's another reason: Redundant code is bad. It's the same reason that writing var foo = new List<Bar>() is better than writing List<Bar> foo = new List<Bar>() or writing if (booleanExpression) {} is better than writing if (booleanExpression == true){}.
|
# ? Dec 24, 2017 16:40 |
|
I hear a lot about how Unity's .NET/C# functionality is very limited compared to the real thing but I never saw an article covering it in depth with any juicy details. Is there some good reading material to understand it in depth? I want more than horrorsnippets!
|
# ? Dec 24, 2017 17:20 |
|
NihilCredo posted:Interesting. At a quick Googling it seems like their special object with custom behaviour is actually named UnityEngine.Object. Was it a namespace import that caused you to inherit from the wrong Object, or were you actually inheriting System.Object? Guilty as charge, I did have using UnityEngine, as I was using Unity's math library because they use float over double for everything. It's why I don't consider this to be a "true horror" cause I should of considered Unity could be overwriting the object class. But the reason I posted it cause I thought it was pretty that Unity purposely made the object return null no matter what. New Yorp New Yorp posted:Here's another reason: Redundant code is bad. It's the same reason that writing var foo = new List<Bar>() is better than writing List<Bar> foo = new List<Bar>() or writing if (booleanExpression) {} is better than writing if (booleanExpression == true){}. Good point, didn't think of it as redundant, but it is. EssOEss posted:I hear a lot about how Unity's .NET/C# functionality is very limited compared to the real thing but I never saw an article covering it in depth with any juicy details. Is there some good reading material to understand it in depth? I want more than horrorsnippets! I would love to read that as well if anyone has it. One thing I know is serialization. Unity's engine only supports serialization for one collection which is lists. And the list serialization doesn't support polymorphed objects. It also doesn't support serialization of properties. Not trying to put down Unity too much tho as I still enjoy using it. You do have access to .net's serialization libraries, so if it's a .net object you have way more serialization options. Which is why I personally switched, but then stumbled upon what I just posted above . Nude fucked around with this message at 22:36 on Dec 24, 2017 |
# ? Dec 24, 2017 19:20 |
|
https://twitter.com/slatestarcodex/status/944739157988974592
|
# ? Dec 24, 2017 21:49 |
|
Nude posted:low and behold You meant "lo and behold" btw
|
# ? Dec 24, 2017 22:11 |
|
Thank god for the computer wizards making all our lives so easy and trouble-free
|
# ? Dec 24, 2017 22:14 |
|
The real horror is the dude in the replies to that tweet yelling about how easy it is to just turn off autocorrect as though that's the real issue.
|
# ? Dec 25, 2017 01:21 |
|
Autocorrect replacing correct words with other words is a pretty common thing, so it's not exactly surprising that it does so in cases where it's dangerous rather than merely confusing or funny. I'm not sure that a solution to that problem exists.
|
# ? Dec 25, 2017 01:27 |
|
Plorkyeran posted:Autocorrect replacing correct words with other words is a pretty common thing, so it's not exactly surprising that it does so in cases where it's dangerous rather than merely confusing or funny. I'm not sure that a solution to that problem exists. Hmm, I don't know, maybe it can actually update its dictionary? So that it can learn new words? Auto-suggestions I understand suggesting the wrong thing, after all is just a guess. Autocorrect is supposed to correct a misspelling, a something that doesn't exist in the language's dictionary with something that does. Therefore which and witch would be both perfectly valid words, though only one of them appropriate in a resume.
|
# ? Dec 25, 2017 01:36 |
|
Plorkyeran posted:Autocorrect replacing correct words with other words is a pretty common thing, so it's not exactly surprising that it does so in cases where it's dangerous rather than merely confusing or funny. I'm not sure that a solution to that problem exists. iOS autocorrect has being doing some strange poo poo recently, I wouldn’t be surprised if that medication thing is some machine learning gone awry and is genuinely a new issue. You’re right in the abstract of course but there’s a new autocorrect implementation or someone flipped a switch or something because it used to be completely different. May be new to iOS 11.
|
# ? Dec 25, 2017 01:40 |
|
Volguus posted:Hmm, I don't know, maybe it can actually update its dictionary? So that it can learn new words? Auto-suggestions I understand suggesting the wrong thing, after all is just a guess. Autocorrect is supposed to correct a misspelling, a something that doesn't exist in the language's dictionary with something that does. Therefore which and witch would be both perfectly valid words, though only one of them appropriate in a resume. This wouldn't help with the issue described in the tweet since it's pretty clear that "duloxetine" wasn't in iOS's dictionary at all, while "fluoxetine" was. The only solutions are either have a dictionary that's constantly up to date with every single technical term and compound word for every discipline (not practical), or turn off the automatic correction and stick to suggestions, alerts, highlighting, anything that involves user confirmation basically.
|
# ? Dec 25, 2017 01:50 |
|
Hammerite posted:You meant "lo and behold" btw actually it's "low and beehold"
|
# ? Dec 25, 2017 01:57 |
|
NihilCredo posted:This wouldn't help with the issue described in the tweet since it's pretty clear that "duloxetine" wasn't in iOS's dictionary at all, while "fluoxetine" was. The tweet talks about MacBooks not iPhones. Does macOS proper do autocorrect now? Because that would be pretty stupid, as the only reason autocorrect is necessary in the first place is that touchscreen keyboards are so ridiculously inaccurate. Text entered with an actual physical keyboard should not be altered without user intervention.
|
# ? Dec 25, 2017 01:57 |
|
E: thoroughly beaten, what soricidus said
|
# ? Dec 25, 2017 01:58 |
|
Plorkyeran posted:Autocorrect replacing correct words with other words is a pretty common thing, so it's not exactly surprising that it does so in cases where it's dangerous rather than merely confusing or funny. I'm not sure that a solution to that problem exists. The solution is to not autocorrect words in your OS by default. We're talking about a MacBook, not a phone e: gently caress
|
# ? Dec 25, 2017 01:58 |
|
Hammerite posted:Thank god for the computer wizards making all our lives so easy and trouble-free DERP LEARNING, BRO!
|
# ? Dec 25, 2017 02:00 |
|
QuarkJets posted:actually it's "low and beehold" low Dan beehive!
|
# ? Dec 25, 2017 03:14 |
|
NihilCredo posted:This wouldn't help with the issue described in the tweet since it's pretty clear that "duloxetine" wasn't in iOS's dictionary at all, while "fluoxetine" was. The actual coding horror here is that autocorrect changes words when it knows for a fact that it does not have an up to date dictionary (you said it is not practical). When your name is Apple and the company is worth $700B you either make that update practical or you simply do not automatically correct, but instead suggest spelling mistakes and let the user decide. Can't have it both ways: I know I'm right and you're wrong, but I do not make sure that I'm right.
|
# ? Dec 25, 2017 03:37 |
|
Nude posted:When you do Foo foo = new Foo(); using Unity's object, it will of course always return null. What the gently caress? How? Why? How? Why? I'm actually in awe - this is quite possibly the most perfect coding horror. I don't think this is even possible without loving up the runtime itself. I guess Unity is just going to have to totally give up on the nullable reference type thing coming in C#8? Nude posted:It's why I don't consider this to be a "true horror" cause I should of considered Unity could be overwriting the object class This is absolutely a true horror. Silently stealing the name of .NET's most fundamental type and then tacking on some loving absurd behavior is entirely Unity's fault. I'm surprised the compiler didn't complain about ambiguous class names. What happens if you do new object() vs new Object()?
|
# ? Dec 25, 2017 03:38 |
|
|
# ? May 16, 2024 09:27 |
|
Volguus posted:The actual coding horror here is that autocorrect changes words when it knows for a fact that it does not have an up to date dictionary (you said it is not practical). When your name is Apple and the company is worth $700B you either make that update practical or you simply do not automatically correct, but instead suggest spelling mistakes and let the user decide. Can't have it both ways: I know I'm right and you're wrong, but I do not make sure that I'm right. It's not impractical in the sense that it costs too much. It's impractical in that having every sequence of characters that someone might want to type in your dictionary simply isn't possible, and would actually be less useful in many cases than a less inclusive dictionary (because many typos are technically words that someone might want to type). Autocorrect on by default is dumb, but not because of this issue in particular.
|
# ? Dec 25, 2017 03:53 |