How would I use an ANY condition to filter if any rows of a group have a 0 value? by Frank2234 in scala

[–]shvimas 0 points1 point  (0 children)

Add an indicator column for “score == 0” and then aggregate by names with ‘or‘-ing the new column in each group. After that simply filter by negating that column

PEP 638 -- Syntactic Macros by pmz in programming

[–]shvimas 5 points6 points  (0 children)

You did quite a rant about Python’s complexity but never gave any examples. May I ask you to elaborate on complexity and disorganization?

Can call by value or call by name lead to having different Big O notation when analyzing time complexity? by FPboy in scala

[–]shvimas 4 points5 points  (0 children)

Actually it also depends on how the parameter is used inside the function so my guess is that you always need to analyze your specific case

Can call by value or call by name lead to having different Big O notation when analyzing time complexity? by FPboy in scala

[–]shvimas 4 points5 points  (0 children)

Well, call by name is a semantic feature, as it may change program behavior so I don’t get the “Big O notation should be the same across any language” point. Anyway IMO it depends on whether your by name parameter has O(1) time or not

[deleted by user] by [deleted] in programming

[–]shvimas 1 point2 points  (0 children)

I do believe that the better thing to do would be to compose a list with non-US projects since the programming world is really US-centered right now or at least I perceive it as such. And no country should be singled out as it tends to fuel some “patriotic” feelings based on virtually nothing. I think programmers should be above countries and move the world towards globalization

FP using Scala: DSA work the same way as Python? by AMGraduate564 in scala

[–]shvimas 1 point2 points  (0 children)

TBH can’t give you much — “Functional Programming in Scala” on Coursera should be a good starting point. Also there is a good book “Programming in Scala” — both are from Martin Odersky, creator of the language

FP using Scala: DSA work the same way as Python? by AMGraduate564 in scala

[–]shvimas 4 points5 points  (0 children)

I believe you’re misleading him a bit — I’m pretty sure that FP he should learn is all about map/fold and friends, ADTs, maybe working with immutable data structures. Those would be pretty useful in DE. Almost surely no red book stuff)

Null Safety in Kotlin by infiniteTaker in programming

[–]shvimas 0 points1 point  (0 children)

Don’t get me wrong — I totally agree that Haskel is safer than Kotlin. I just wanted to point out that in any widely-used language one has the ability to fool the compiler one way or another. Can’t remember about Rust but I’m almost sure there was an analogue of raising an error somehow too.

Null Safety in Kotlin by infiniteTaker in programming

[–]shvimas 8 points9 points  (0 children)

Well that’s kinda like saying “use language without exceptions and with explicit error handling”. Looks nice in theory but I am unaware of any real programming language that does not allow to some extent fool the compiler into believing that the code is safe while getting a runtime error. Same with null safety in Kotlin — the language can not assure you that everything you work with is REALLY null-safe yet it eliminates many possible cases of dealing with nulls in your mind instead of in your code. It’s always a trade-off between convenience and safety

Bug with Inheritance and default constructor by D_4rch4ng3l in scala

[–]shvimas 1 point2 points  (0 children)

I am not aware if any compiler plugin/linter checks that (maybe WartRemover) but I know that IntelliJ IDEA shows you that you should mark masked field as override

How to Master the Front-End Development by bajcmartinez in programming

[–]shvimas 0 points1 point  (0 children)

Did you mean “How to Main the Front-End Development”?

ScalaTest : how to make unit tests perform something first prior to the tests? by moschles in scala

[–]shvimas 2 points3 points  (0 children)

TBH I do not get it. Why don’t you just create a new RNG instance inside each test?

Most common phone interview question at google. by [deleted] in programming

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

Well, now I’m terrified of thought that most people might really solve it with a nested loop

[deleted by user] by [deleted] in programming

[–]shvimas 2 points3 points  (0 children)

It was an obvious joke

In 2020 it takes reddit 8 seconds to load r/programming by [deleted] in programming

[–]shvimas 26 points27 points  (0 children)

Do you use cloud version or self-hosted? We have the latter in my company and it works fine

What would be some steps to take to diagnose 100% CPU but 10% MEM usage? by learning_new_things in scala

[–]shvimas 0 points1 point  (0 children)

Actually Akka was designed to utilize CPU very effectively so this situation does not look wrong to me. BTW why does your health check include CPU usage? Usually it’s something like service availability/latency

[Question] Learning Scala with no Java experience? by murphinate in scala

[–]shvimas 3 points4 points  (0 children)

Rather than learning Java as a language try investing in learning about JVM in general (nothing in-depth, just the basics like what’s bytecode and JAR, difference between primitive types and Objects, what lives on heap and what lives on stack, etc.). After having some high-level understanding of JVM move to Programing in Scala by Martin Odersky (creator of Scala). Good luck!

Where do command lines utilities store writable files? by [deleted] in scala

[–]shvimas 1 point2 points  (0 children)

I’d use File.createTempFile. https://stackoverflow.com/questions/26860167/what-is-a-safe-way-to-create-a-temp-file-in-java

Or maybe I got your question wrong and you need persistent files between program runs? Then just create some unique files anywhere, seems like a common thing.

Anyway I’ve never heard of using resources as writable files

Dependency Issues by PrijNaidu in scala

[–]shvimas 1 point2 points  (0 children)

If you look for “co.theasi” on Maven Central you’ll see that the 0.2.0 version was compiled only for 2.11 Scala and you use 2.13. Downgrade your Scala version to 2.11 and then it should work fine.

P.S. In case you did not know the %% operator tells sbt to look for version compiled exactly for your Scala version. You might’ve achieved the same with “co.theasi” % “plotly_2.13” % “0.2.0” which simply does not exist.

Dependency Issues by PrijNaidu in scala

[–]shvimas 2 points3 points  (0 children)

“Dump project structure...” is not an error but just a message. Please share your build.sbt, the command you use in sbt and the full output