Skip Navigation

InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)C
Posts
0
Comments
521
Joined
3 yr. ago

  • NSFW Removed Deleted

    XXX

    Jump
  • In some places it is mandatory

  • The windows crate is full of Deref. Because the windows API is full of inheritance.

    It may not be what the trait was thought of for, but I'm glad we have it to interface with APIs that have actual inheritance.

  • But if I have to make an Array I have to inherit from Indexable which inherits from Collection which inherits from Object! How else am I supposed to implement an Array?

  • How many of those 8 hours are because bit bucket is down? I'd bet at least 1. I swear their uptime is measured in 8s instead of 9s (as in 88.88, not 99.88)

  • TIL: Besides offering a free compromised email check, haveibeenpwned.com also offers a free password compromise checking service (It's also fun to see what weird passwords have been used/leaked.)

    Jump
  • This service is for people that use the same password everywhere. It makes no sense for someone that uses a different password per site.

  • TIL: Besides offering a free compromised email check, haveibeenpwned.com also offers a free password compromise checking service (It's also fun to see what weird passwords have been used/leaked.)

    Jump
  • You enter your password in thousands of websites. Why is this one different?

  • I don't think you can qualify any trump scandal as an "earthquake". Earthquakes move things around. USAians would still vote for trump.

  • Deref works on top of encapsulation though. Inheritance syntactically hides the encapsulation, with Deref it's in the clear.

    It's true that it feels like inheritance, but I'm grateful for it. Otherwise it would be a pain to use the windows API.

  • I know this thread is old. But I disagree with you.

    I agree that depending on how you use a debugger, some race conditions might not happen.

    However, I don't agree that debuggers are useless to fix race conditions.

    I have a great example that happened to me to prove my point:

    As I was using a debugger to fix a normal bug, another quite strange unknown bug happened. That other bug was indeed a race condition. I just never encountered it.

    The issue was basically:

    1. A request to initiate a session arrives
    2. That request takes so long that the endpoint decides to shut down the session
    3. A request to end the session arrives

    And so handling the session start and session end at the same time resulted in a bug. It was more complicated than this (we do use mutexes) but it was along those lines.

    We develop in a lab-like condition with fast networking and computers, so this issue cannot happen on its own. But due to the breakpoint I put in the session initiation function, I was able to observe it. But in a real world scenario it is something that may happen.

    Not only that, I could reproduce the "incredibly rare" race condition 100% of the time. I just needed to place a breakpoint in the correct place and wait for some amount of time.

    Could this be done without a debugger? Most of the time yes, just put a sleep call in there. Would I have found this issue without a debugger? Not at all.

    An even better example:

    Deadlocks.

    How do you fix a deadlock? You run the program under a debugger and make the deadlock happen. You then look at which threads are waiting at a lock call and there's your answer. It's as simple as that.

    How do you print-debug a deadlock? Put a log before and after each lock in the program and look at unpaired logs? Sounds like a terrible experience. Some programs have thousands of lock calls. And some do them at tens of times per second. Additionally, the time needed to print those logs changes the behaviour of the program itself and may make the deadlock harder to reproduce.

  • 4k is noticeable in a standard pc.

    I recently bought a 1440p screen (for productivity, not gaming) and I can fit so much more UI with the same visual fidelity compared to 1080p. Of course, the screen needs to be physically bigger in order for the text to be the same size.

    So if 1080p->1440p is noticeable, 1080p->4k must be too.

  • Good rule of thumb. As long as it's not followed blindly of course.

    Structs with lifetimes are often quite convenient. Especially for performance.

  • Fair enough then.

  • Well that's because it isn't lol.

    My guess is, if the USA method was better:

    The USA would sanction countries until they adopted it. They would embed it in the national flag and insert it in the national anthem. They would make underwear out of it and put stickers on their 20yard-long cars.

  • Metric is a relatively recent invention. Every single country has had to ditch their measuring equipment in order to convert to metric.

    The reason it's so expensive in the US is because they refused to change for so long. As the economy grows, the amount of equipment grows, so the more time you take to switch systems, the more expensive it will be.

    If the US wanted to switch relatively painlessly, they'd just gradually make some measurements officially in metric. You can produce products labeled in metric with imperial tools. If those tools are precise enough, or the error margins big enough, you would not notice the difference between imperial tools and metric ones. In fact, there's probably many tools out there that can produce in both systems.

    It's not a simple problem. But if it never starts to get solved, it will never be solved.

    The main obstacle is not economic, it's cultural. People in the US are used to using imperial, many only used metric at school. They advocate online that their system is better, and keep using it.

    If USAians used metric in day-to-day life, they would prefer consuming products with metric info on them, so companies would produce more metric products, so they would have more incentives to adapt their tools to metric.

    How do you change culture? Simple. The first step is to make something "official". Making metric official and "deprecating" imperial would mean that communication with the government would be in metric. Laws would have metric measurements, technical documents provided by the government would have metric measurements.

    If someone wanted to use imperial, they would have to constantly convert the numbers of the government, and you can't ignore the government. So you either stubbornly convert each time, or you give up and start using metric yourselves.

    Of course in the early stages, the government could provide imperial measurements too, as a sidenote, a footnote or an appendix. But the main content would be in metric.

    But the US has decided it doesn't want to do that. I don't want to get too geopolitical, but that only works while the US is an economic superpower. We'll see what happens once that is no longer the case.

    In the meantime, all I can do from the outside is try to convince random people from the internet. If they don't switch to metric, they might at least stop advocating for imperial, and that would be a win.

  • That is in fact incorrect. And the reason is in that other comment. To make a summary of that other comment:

    If an only-metric guy wanted to communicate with an only-imperial one, each would need a table of conversions. For a basic use case, the metric cheat sheet would only need 8 entries, while the imperial one 10. That is, you need to memorize less "magic number"s for metric than for imperial. Furthermore, 5 of those entries in the metric cheat sheet are: 1000, 1000, 1/10, 1/100, 1/1000, which are obviously easy. So the real difference would be more like 3 entries to 10.

    Of course, any kind of real measurement you will need a calculator. But that is reality for any unit conversion across systems. The difference is that you only need to remember 3 numbers to convert to/from metric, but you need 10 to convert to/from imperial.

  • A: I don't know what point you are trying to make. Could you clarify? To clarify on my part, nobody would say what you said. We would probably choose one of the following options:

    1. 1.675m
    2. 1m 67.5cm
    3. 167.5cm

    Of course options 1 and 2 sound basically the same when spoken. And we wouldn't measure a human height to mm precision, so 1.68m, 1m 68cm, and 168cm.

    B: ad hominem.

  • As I said. You can use whatever units you want for yourself. I don't care about that.

    The problem is when we are communicating with each other. When communicating, it's more than one party involved. And our goal should be to communicate clearly and easily so both the talker and the listener have an easy time transferring information.

    This is not like language. Conversion between one unit and another is as simple as a multiplication. We can both speak in imperial and metric if we have a conversion table and a calculator.

    Now, let's say you communicate in imperial. And I communicate in metric. We are allowed to have a conversion table and a calculator. Here is my cheatsheet:

     
        
    Inch = 2.5cm
    Foot = 12inch
    Yard = 3 feet
    Mile = 1760 yards
    Fl oz = 28ml
    Gallon = 4.5l
    Oz = 28g
    Pound = 16 oz
    Stone = 14 lb
    Ton = 2240 lb
    
      

    Here is yours:

     
        
    cm = 1/2.5 inch
    ml = 1/28 fl oz
    g = 1/28 oz
    metric ton = 1000kg
    
    k (kilo) = 1000
    d (deci) = 1/10
    c (centi) = 1/100
    m (milli) = 1/1000
    
      

    I only included the most common usages. The full cheatsheets are much larger but I believe we can agree this is a fair representation of common usage.

    Your cheatsheet contains 8 entries. Meanwhile mine contains 10. Therefore, metric is objectively easier to convert in a ratio of 8/10. Furthermore, subjectively, the case is worse. Since metric ton, kilo, deci, centi and milli have an obvious pattern that is easy to remember and use. Meanwhile the only subjective "advantage" of imperial is that fl oz and oz is the same, but that goes both ways, since g is also the same as ml, so it would be 7/9, which is better for metric than 8/10. So i don't think there's any subjective advantage for imperial.

    So yes, using a less efficient method of communication because "I'm more used to it" is dickish. Especially if the entire rest of the world uses the more efficient one. Especially if you already know the more efficient method. As you said, it is taught in American schools.

    Do you know what is even more dickish? Defending its usage for communication.

    If we go back to the language analogy: If 95% percent of the world understands only English, and English is objectively easier than Spanish and you also speak English, and you approach someone in spanish, and you keep speaking Spanish even though they are speaking in English, you are a dick.

    Of course this analogy is not perfect. Since English is not objectively easier than Spanish (in fact, I subjectively believe Spanish is easier).

  • I put this as part of a response to another user. But since it also answers the main question of this post I'll repeat it here:

    Because it's not only better for me, but it's also better for you.

    It doesn't matter if I tell you a distance in meters or kilometers, you only have to remember what that means in feet so you can convert it to whatever imperial distance you want. Just multiply/divide by 1000 afterwards by moving the decimal point. If 53 meters is 863 yards, 53 kilometers is 863000 yards.

    However, it does matter what unit you choose to communicate with me. I know that 1 inch is about 25.4mm/2.5cm, but if I'm unlucky and you decide to say it in feet, I'm going to need to Google the conversion.

    I don't care what units you used for yourself, as you shouldn't care what units I use for myself. However, if we have to communicate, we should both be as helpful as we can so we can communicate as easily and effectively as possible. Communicating with someone using imperial is a pain in the ass, while communicating with someone using metric is as easy as it gets. The only thing easier than metric is scientific notation, since with that you don't even need to remember what the metric prefixes mean. However scientific notation is only easily written, not spoken. Speaking in scientific notation is a pain in the ass.