Help Bites


  • Banned

    @topspin said in Help Bites:

    @Unperverted-Vixen said in Help Bites:

    where TClient : ClientBase<TChannel>, new()

    I had to look up WTF the new() does here and... that seems like really random syntax to describe some special case in a very incomplete list of possible ways to constrain types.

    Constructors were a mistake.


  • BINNED

    @Gąska huh?


  • Banned

    @topspin constructors are conceptually just static methods that return an object. But there are so many special rules around them that you cannot actually treat them as methods - and so everything that deals with constructors is going to require special syntax to work. C#'s where...new() is just one of many examples. There's no other way the language designers could possibly achieve the same effect. Java, for example, doesn't have any such syntax, and so it's impossible to instantiate generic types there whatsoever.

    If the language didn't have constructors, these would be regular static methods behaving like every other static method. And the "I want to be able to instantiate this generic using these arguments" constraint would be encoded with a regular interface that defines appropriate static methods - which isn't possible either, but absolutely should be in a well designed language.


  • BINNED

    @Gąska said in Help Bites:

    @topspin constructors are conceptually just static methods that return an object. But there are so many special rules around them that you cannot actually treat them as methods - and so everything that deals with constructors is going to require special syntax to work. C#'s where...new() is just one of many examples. There's no other way the language designers could possibly achieve the same effect. Java, for example, doesn't have any such syntax, and so it's impossible to instantiate generic types there whatsoever.

    If the language didn't have constructors, these would be regular static methods behaving like every other static method. And the "I want to be able to instantiate this generic using these arguments" constraint would be encoded with a regular interface that defines appropriate static methods - which isn't possible either, but absolutely should be in a well designed language.

    But then you'd just have random, inconsistently named static methods everywhere.

    The thing here is that, afaict, you can specifiy a constraint for "has an appropriate constructor" but not for "has a method xyz". That you need weird syntax for the former doesn't affect the lack of any syntax for the latter. (Probably because to do that you would go down the insanity rabbit hole of C++ concepts)


  • Banned

    @topspin said in Help Bites:

    @Gąska said in Help Bites:

    @topspin constructors are conceptually just static methods that return an object. But there are so many special rules around them that you cannot actually treat them as methods - and so everything that deals with constructors is going to require special syntax to work. C#'s where...new() is just one of many examples. There's no other way the language designers could possibly achieve the same effect. Java, for example, doesn't have any such syntax, and so it's impossible to instantiate generic types there whatsoever.

    If the language didn't have constructors, these would be regular static methods behaving like every other static method. And the "I want to be able to instantiate this generic using these arguments" constraint would be encoded with a regular interface that defines appropriate static methods - which isn't possible either, but absolutely should be in a well designed language.

    But then you'd just have random, inconsistently named static methods everywhere.

    So?

    The thing here is that, afaict, you can specifiy a constraint for "has an appropriate constructor" but not for "has a method xyz".

    Because the latter is taken care by interfaces. Except they fucked it up and only allow non-static methods on interfaces. Happens a lot when generics are added as an afterthought instead of being core part of the language from the start.

    That you need weird syntax for the former doesn't affect the lack of any syntax for the latter.

    True. But design choices have big impact on each other. If feature A makes feature B much less important, then feature B will naturally get much less love and be far worse than it could be if designers cared.

    Probably because to do that you would go down the insanity rabbit hole of C++ concepts

    No, not really. You only need to allow static methods on interfaces. And then you define the constraint "has this interface", just like you already do for non-static methods. Guess which language has it working flawlessly without any kind of templates.


  • Considered Harmful

    @Gąska said in Help Bites:

    they fucked it up and only allow non-static methods on interfaces.

    C# fucked up a lot of things, to be fair. Java 8+ doesn't have this problem. Interface static and default methods very nearly allow diamond inheritance.



  • Do you have recommendations for a scientific calculator app that doesn't totally suck?

    I have my old faithful TI-85 from high school that I use quite a lot at work, but with work being in two places (home and office) now, I can't be bothered to carry it with my laptop so half of the time I don't have it. Plus, of course, I'm already carrying around a huge calculator (my laptop) or even two (my phone).

    Windows calculator sucks ass, hard, to the point where it becomes funny, as it truncates everything to 3 digits in a random manner. Representative example (and I didn't cheat in any way with the snapshot, I really just typed that):
    d9dbf040-eff6-4cac-b2e4-6c39e72166e0-image.png

    My phone has a default calculator which is better (at least it can do maths with 4 digits or more!) but is still too basic.

    So I'd like something that's kind of like my TI-85 (no, not an emulator, I want features, not carbon-copy). Wide range of common scientific operations, if possible some base conversion, that's about it. I don't care about programming, though an history of the most recent operations to avoid retyping everything would be nice. And that's about it. Anything overly stupidly fancy such as tweeting your calculation results will be a strong negative.

    I'm not opposed to paying the right price (a couple of eurodollars, I'd guess?) though of course I'm a cheapstake so free is better. But if it's a Windows program, it must work without install since I have restricted rights on my laptop (well actually not really right now, but this may change one day, plus there is no reason a calculator needs anything in addition to the exe except maybe a tiny settings file).

    I could write it myself but :kneeling_warthog: and there are so many around that it's almost literally reinventing the wheel in the middle of a wheel factory. I could pick any random search result but I'm guessing that 99% of what's available is either unfinished high school projects, obsolete code, riddled with ads or a trojan for virus. Or all four.

    Oh, and someone will make a joke about the :wtf: contest we had years ago, and ha ha ha that's a funny one, now that joke is made and let's move on to serious answers.


  • Notification Spam Recipient

    @remi said in Help Bites:

    So I'd like something that's kind of like my TI-85 (no, not an emulator, I want features, not carbon-copy).

    Well, shit...


  • BINNED

    @remi
    Must be a bug in the French version ...
    2ee1e2b7-60a3-4187-b07d-442eb1d62975-image.png


  • Notification Spam Recipient

    @Luhmann said in Help Bites:

    @remi
    Must be a bug in the French version ...
    2ee1e2b7-60a3-4187-b07d-442eb1d62975-image.png

    Yours is missing the period!

    acb8f508-951e-499c-962c-6f8b349b33a6-image.png


  • BINNED

    @Tsaukpaetra
    yours is even more kaput! (:surprised-pikachu: )
    you multiply two integers and get a decimal!



  • @Luhmann said in Help Bites:

    @remi
    Must be a bug in the French version ...
    2ee1e2b7-60a3-4187-b07d-442eb1d62975-image.png

    It is the French version. I've already posted about it in the WTF or UI or Windows bites some time ago, and searched about it at that time, and it does seem to be related to the localisation. Which is kind of weird because I've set up Windows to be in English for the most part, but it was still originally installed (by IT) as a French one, so maybe it's actually the mix that causes the issue.

    IT is also thoroughly uninterested about it. I showed it to them, they said "oh that's a funny one that we'd never seen" and stopped here.

    Anyway, such bug tells me that even if I could fix that specific one, I can't trust Windows' calculator to actually work, and if I'm doing more complicated computations with e.g. sin() and log() I might not spot at all a huge error like that. So I'm not really interested in fixing that bug -- well I would prefer it gone, but even then I would prefer using another calculator that works.



  • @remi I found HandyCalc pretty good. I didn't end up using it much or keeping it installed since most of what I did was just basic calculator stuff, but if you have a use for it you should check it out


  • Considered Harmful

    @remi I didn't want to be the first who posts their own favorite app (mostly because it's a calculator - it calculates, so we've never tried anything else)... so here goes: HiPER Scientific Calculator. Dunno how good it is really. I mostly use for HEX<->DEC and :kneeling_warthog: math problems, because I don't have any real ones, but all those cos, log and xy make me feel smart.



  • Thanks @hungrier and @Applied-Mediocrity. Don't be shy in posting your favorite app, since that's exactly what I'm asking for -- and yes, even though it's just a calculator, but not everything has to be about complicated stuff.

    HandyCalc seems a bit clunky to access what are fairly common functions for me (e.g. switching from deg to rad requires going into the settings each time -- that's also what I have to do with my old TI-85, but that doesn't mean it's the best way!). HiPER does seem a bit more complete at first glance. The only thing that I might criticise is that the history is not directly visible on screen, but it's not hard to access either, so that's not a huge issue.


  • Discourse touched me in a no-no place

    @Gąska said in Help Bites:

    it's impossible to instantiate generic types there whatsoever

    At the point where the instantiation is done, there's no idea what concrete type is going to be instantiated. The modern answer to that (in Java-land) is to hand in a Supplier<TClient> which in turn can be whatever factory you want.


  • BINNED

    @remi said in Help Bites:

    e.g. switching from deg to rad requires going into the settings each time

    Change it to rad and never switch it back?


  • Considered Harmful

    @topspin said in Help Bites:

    @remi said in Help Bites:

    e.g. switching from deg to rad requires going into the settings each time

    Change it to rad and never switch it back?

    Hey, no pure mathematics!



  • @topspin said in Help Bites:

    @remi said in Help Bites:

    e.g. switching from deg to rad requires going into the settings each time

    Change it to rad and never switch it back?

    Not too rad, you might end up like this:

    dfa14acd-20d0-4380-b1ad-30d52cdea7a0-image.png


  • Considered Harmful

    @hungrier said in Help Bites:

    @topspin said in Help Bites:

    @remi said in Help Bites:

    e.g. switching from deg to rad requires going into the settings each time

    Change it to rad and never switch it back?

    Not too rad, you might end up like this:

    dfa14acd-20d0-4380-b1ad-30d52cdea7a0-image.png

    Well sure, you're gonna run the risk of making fluid dynamics a little more tractable, but it's never gonna be that easy.



  • @topspin said in Help Bites:

    @remi said in Help Bites:

    e.g. switching from deg to rad requires going into the settings each time

    Change it to rad and never switch it back?

    And when I'll say that switching from rad to deg requires going into the settings each time, you'll tell me to change it to deg and never switch it back? 😵


  • Considered Harmful

    @remi said in Help Bites:

    @topspin said in Help Bites:

    @remi said in Help Bites:

    e.g. switching from deg to rad requires going into the settings each time

    Change it to rad and never switch it back?

    And when I'll say that switching from rad to deg requires going into the settings each time, you'll tell me to change it to deg and never switch it back? 😵

    No. Degrees are bad and they should feel bad.


  • BINNED

    @remi said in Help Bites:

    switching from rad to deg

    What part of “never switch back” would require this?



  • @topspin the part where I want to see result (or input values) in deg.


  • Considered Harmful

    @remi said in Help Bites:

    @topspin the part where I want to see result (or input values) in deg.

    This desire is afflictive and leads to suffering. Excise it.



  • @remi said in Help Bites:

    And when I'll say that switching from rad to deg requires going into the settings each time, you'll tell me to change it to deg and never switch it back?

    Did you try clicking the thing on the main screen that says "deg" or "rad" above the keypad?


  • Considered Harmful

    @hungrier said in Help Bites:

    @remi said in Help Bites:

    And when I'll say that switching from rad to deg requires going into the settings each time, you'll tell me to change it to deg and never switch it back?

    Did you try clicking the thing on the main screen that says "deg" or "rad" above the keypad?

    If this is followed by an "eme" key, you have acquired an overly specialized calculator which is unlikely to be fit for engineering purposes.



  • @Gribnit What does the eme key do, make you vomit?


  • Considered Harmful

    @hungrier said in Help Bites:

    @Gribnit What does the eme key do, make you vomit?

    The "deg" "rad" "eme" keyset is mostly used for lifestyle purposes vs engineering.

    Also, and to that end, sometimes yes.



  • @hungrier said in Help Bites:

    @Gribnit What does the eme key do, make you vomit?

    No, you're thinking of the key.


  • Banned

    @dkf said in Help Bites:

    @Gąska said in Help Bites:

    it's impossible to instantiate generic types there whatsoever

    At the point where the instantiation is done, there's no idea what concrete type is going to be instantiated.

    Yes there is. You have the type argument goddammit.

    ...Or rather, there would be, if Java didn't get the asinine idea of type erasure of generics.


  • Considered Harmful

    @Gąska said in Help Bites:

    @dkf said in Help Bites:

    @Gąska said in Help Bites:

    it's impossible to instantiate generic types there whatsoever

    At the point where the instantiation is done, there's no idea what concrete type is going to be instantiated.

    Yes there is. You have the type argument goddammit.

    ...Or rather, there would be, if Java didn't get the asinine idea of type erasure of generics.

    Pass a type token. It beats breaking backwards compatibility in a non-monopolized ecosystem.

    Also, 5 and 8 are both rather old versions now. I hear noise of reifiable complex types.



  • @hungrier said in Help Bites:

    @remi said in Help Bites:

    And when I'll say that switching from rad to deg requires going into the settings each time, you'll tell me to change it to deg and never switch it back?

    Did you try clicking the thing on the main screen that says "deg" or "rad" above the keypad?

    No, I did not. Thanks, that's helpful. But that was just an example of one thing where handyCalc feels a bit too simple for me.

    Other things that I noticed is that I have to type the full function names (e.g. sin) rather than having a dedicated key -- this is easier for the developer as they don't have to think about how to pick which keys are important and how to present them, but it's less convenient as a user, for the most common functions at least. Also, you can apparently only browse one item of the history at a time (I did not find a way to show a list of recent operations), which makes it a bit more awkward to use.

    I'm still test-running those two calc apps, so maybe in a few days I'll get used to it, but until now the other (HiPER) has the advantage.


  • Banned

    Looking for a half decent stud finder that doesn't cost a fortune. The only requirement is that it works. The $20 Zircon I've got at Home Depot shows me a completely different spot on each pass.

    Any recommendations?


  • Notification Spam Recipient

    @Gąska said in Help Bites:

    The only requirement is that it works.

    Idk my old shit one works fine once you realize it's not a mind reader.



  • @Gąska said in Help Bites:

    The $20 Zircon I've got at Home Depot shows me a completely different spot on each pass.

    I don't remember what brand it is, but yeah, it isn't very consistent. However, I've found that averaging multiple passes seems to work fairly well. Slide it back and forth a few times to find one edge (e.g., the left edge) of the stud, and take the average. Move a couple of inches to the right and try a few times to find the right edge, and take the average. Halfway between the two averaged edges will almost always hit solid wood, even if it's not perfectly centered in the stud.


  • Banned

    @HardwareGeek I did 20+ passes and standard deviation exceeds wall length. I guess I'll just start poking holes at random and hope to find it eventually.

    @error_bot xkcd 905


  • 🔀

    xkcd said in https://xkcd.com/905/ :

    Homeownership


    ­


  • @Gąska said in Help Bites:

    standard deviation exceeds wall length

    Use it as an entropy source? 🤷♂

    Have you tried a different heights? Wires or other stuff in the walls can confuse it, and sometimes moving up or down will give better results. If you've already tried that, your cheap stud finder is 💩. Unfortunately, I don't have any suggestions for a better one.



  • @HardwareGeek I've got a shitty dirt cheap one, and it works well enough to A) find studs and B) light up a different light when there's electrical wire nearby


  • ♿ (Parody)

    @Gąska said in Help Bites:

    @HardwareGeek I did 20+ passes and standard deviation exceeds wall length. I guess I'll just start poking holes at random and hope to find it eventually.

    Maybe you found a pipe or wires? I've had good results with my Zircon. Err...hello from next week. How did it work out?


  • Banned

    @boomzilla said in Help Bites:

    How did it work out?

    :kneeling_warthog:

    I plan to finish it sometime this week.



  • @Gąska said in Help Bites:

    Any recommendations?

    Get an old one with analog level control from a flea market. The new digital auto-adjust shit just plain doesn't work.

    Some months ago, I had to make a couple of holes in a concrete wall, and make sure there weren't any cables buried in it. The batteries in my old AC detector had corroded and leaked, so I threw it in the thrash and got a digital 3-in-1 from Lidl. On testing, that one couldn't detect the light switch wiring from either side of a drywall wall.

    Then I got a slightly more expensive one from the hardware store. Thit one found the light switch wire in that wall, but not in my living room, where it's buried in concrete.

    Finally, I dug out the old analog detector from my trash can, cleaned it up, and tested that it worked. That one found all the wires I could hope for. So I proceeded to scan the wall that I had to work on, and then drilled with peace of mind.

    Lesson of the day for me: If you can't manually adjust the detection threshold, then forget about it.



  • Could someone recommend some kind of self-hosted web-based file sharing software? The only additional feature that I need is some kind of invite link that gives full read and write access without any kind of account sign up: the people involved are getting old and bad with passwords, but are expected to be able to follow a link and bookmark it to work with their files.

    Are OwnCloud and NextCloud my only two options?


  • Banned

    @aitap FTP server?



  • I don't know about other browsers, but Firefox no longer supports FTP.


  • Java Dev

    @Zerosquare Browsers have only ever supported FTP for downloading. For uploading, you need to use explorer.

    No, not internet explorer. File explorer.


  • Banned

    @Zerosquare there must be some open sores FTP server with web frontend, right?


  • Notification Spam Recipient

    @aitap if you're into running a Windows desktop (not service, mind!) application, HFS by rejetto should have you covered!



  • @Tsaukpaetra Well, there's always NSSM.


Log in to reply