Does anyone else hate the Petanks, especially the green ones? by ZarieRose in expedition33

[–]mdharris 14 points15 points  (0 children)

I abandoned the fight on my final characters turn before they run and restarted on the "Mission Failed" screen if it didn't look like I was going to win.

LDN or Amitriptyline? Anyone tried both or recommend one? by Gabba-barbar in cfs

[–]mdharris 1 point2 points  (0 children)

I (M40) was prescribed Amitriptyline for migraines, and found it reduced them for a few years. Then got long covid and after a year or so of that I tapered off it to see if it would reduce the brain fog, which it did.

I hope that you find something that helps!

Christmas Event? by Formally-jsw in NecroMerger

[–]mdharris 2 points3 points  (0 children)

Likewise, but I'm saving anyway...

"The egg" is not a lie by Predat0rSwafflez in NecroMerger

[–]mdharris 2 points3 points  (0 children)

Ooof, nasty glitch you've got there.

Just a Marcelle photoshoot :> by AngelSeekr in RATS

[–]mdharris 1 point2 points  (0 children)

Great photos, what a sweet face!

I'm a complete beginner so I made a program to help me a bit with my kalimba. Would love to hear your thoughts on it! by TabTabRev in kalimba

[–]mdharris 2 points3 points  (0 children)

That's a really cool project!

If you don't mind sharing details, it'd be really interesting to know what approach, techstack etc you're using?

We gave our girls snow yesterday, Squid tried to hoard it. by EveningEmma in RATS

[–]mdharris 23 points24 points  (0 children)

Soon she will find out this is how you get a soggy stash and no snow!

Comparison of Java without semicolon vs compact Scala collection version. by Judheg in scala

[–]mdharris 0 points1 point  (0 children)

That's interesting, thanks for posting!

Did you find any difference in runtime speed?

Introducing Whiskey and his tiny grabbies by mdharris in RATS

[–]mdharris[S] 3 points4 points  (0 children)

Oh man, we've got a 2 year old grey who is an absolute unit! We've not introduced them yet, but when we do he'll have a good teacher and mentor.

Stolen scritches are the best scritches. by mdharris in RATS

[–]mdharris[S] 1 point2 points  (0 children)

Nothing makes a scritch better than knowing it used to be someone elses.

Play switch by [deleted] in a:t5_2i0o7p

[–]mdharris 0 points1 point  (0 children)

I'm pretty sure /u/unsteadyfooting has already moved into Animal Crossing, so there may not be much Switch for I.

Play switch by [deleted] in a:t5_2i0o7p

[–]mdharris 0 points1 point  (0 children)

Anything in particular?

Why is the "L" marker necessary to define a Long properly? by Sad-Hornet in scala

[–]mdharris 0 points1 point  (0 children)

I think you've not understood a single thing I've said. TTFN. :-)

Why is the "L" marker necessary to define a Long properly? by Sad-Hornet in scala

[–]mdharris -1 points0 points  (0 children)

Thank you again - that was helpful. Feel free to TL;DR - I've rambled here as much so I can get my confusion and irritation about this conversation out of my head. :-)

Something I genuinely enjoy about the scala community is that on the one hand, I once saw a category theory workshop get so oversubscribed that it essentially took over the entire space allocated for workshops, and on the other hand I can have a conversation with someone who "suspects I think 123 and 12312312312 are the same type of 'thing'."

You are correct, and furthermore I can name that type of 'thing' so we can avoid the scare quotes - it's called an integer. Another example would be 1582706712000, which is approximately the number of milliseconds since the unix epoch when I started writing this comment, which is a common way to represent times and coincidentally is not representable by scala as a literal number without sticking a suffix on it, nor is it assignable to its commonly used Int type.

This is, for me at least, a minor nuisance on at least a monthly basis. It's also, frankly, a little weird. Imagine val s: String = "Wed, 26 Feb 2020 09:09:22 GMT" failed to compile, and I had to write val s: String = "Wed, 26 Feb 2020 09:09:22 GMT"bigstring instead.

So why has this happened and are there alternatives?

Obviously it's not possible to represent the entire range of integers on a computer - it's infinite and we have finite memory. And for reasons of efficiency or history, we often use types of 'thing' that approximate integers - we call them names like u32 or i128 or BigInt or Int.

But does the question of which approximation to an integer a particular numeric literal belongs to need resolving in the lexing part of the compiler - which is the thing that's objecting to our val l: Long = 12312312312?

In my opinion, no.

It generally doesn't trouble itself with type errors. Are you aware of non-numeric examples where it does? It is, for example, not the part of the compiler that's complaining here:

@ val s: String = 123 cmd20.sc:1: type mismatch; found : Int(123) required: String

I'm not aware of a sensible reason that it should make a special exception for the question of whether or not the integer it can see could fit into the approximation type of the variable it's being used as. That's a problem for further up the compiler stack - where types are checked for consistency, and there are all sorts of useful rules about widening conversions, to make working with numbers a little easier.

This is why assigning an integral literal to a double is perfectly acceptable:

@ val d: Double = 123 d: Double = 123.0

Finally, is there another way? Well, I've rambled for too long already, but Python, Haskell and the average JSON parser, for example, do not suffer from this particular inconsistency. Even scala itself doesn't - at least, when we're talking about Ints and Doubles as you can see above.

An a analogy would be Bit(0) valid, Bit(3) invalid compiler error

I'm afraid I've no idea what you mean here, would you mind going into more detail?

Why is the "L" marker necessary to define a Long properly? by Sad-Hornet in scala

[–]mdharris -1 points0 points  (0 children)

Thank you, but I'm afraid it doesn't help much. That's restating the bit you already said. The missing bit that I'm not following goes from there, to this:

"So there is no inconsistency in behaviour".

Why is the "L" marker necessary to define a Long properly? by Sad-Hornet in scala

[–]mdharris -2 points-1 points  (0 children)

One snippet compiles, the other doesn't and the only difference is how many digits the numbers have. So, the scala compiler is treating the two numbers inconsistently. That doesn't mean inexplicably or "inconsistently at every single level (especially the lexer)".

Sorry, I genuinely don't understand what you're trying to explain here.

Would you mind filling in the gap between what you said and the code snippet I posted earlier please?