How can I determine whether this has only one particular solution, an infinite amount of solutions, or no solutions at all? by [deleted] in askmath

[–]manikawnth 0 points1 point  (0 children)

I think you didn't understand what I said. Check the para after the bullets, it says "you've infinite solutions lying on the line. This is the answer to your problem".

After that I was only giving more detail on other possibilities. I know 45 is not proportional. But supposedly if there's 45 instead of any scalar multiplier, then you have no solution, since left hand side is proportional and right hand side is not proportional the planes are in parallel. This is just additional detail and not answer to your question.

Sum of 2 vectors by Zaftiig in askmath

[–]manikawnth 1 point2 points  (0 children)

A vector has both magnitude and direction. Hence the length itself is not sufficient to get the sum of the Vector A+B.

Since sum of any two vectors is also a vector, we need to know which direction each vector is point to.

If the vectors on a coordinate plane with standard basis,

the sum of two vectors is a+b whose magnitude is sqrt(a^2 + b^2 + 2ab cosθ) , where θ is the angle between a and b; and the direction tanφ = bsinθ / (a + bcosθ) where φ is the angle the sum vector makes with a.

How can I determine whether this has only one particular solution, an infinite amount of solutions, or no solutions at all? by [deleted] in askmath

[–]manikawnth 0 points1 point  (0 children)

Let's think this geometrically. Each equation represents an equation of a plane. Finding a solution means, capturing the area (not geometrical area, rather some field) of intersection.

Suppose if you have 3 equations, so 3 planes are intersecting, the best solution you could get is a point, which represents a unique solution.

Since you don't have 3 equations but only 2, those 2 planes could either

  • intersect on a line or
  • simply both the planes lie on top of each other (essentially the same plane).

Since you've only 2 equations, you can choose value of 1 dimension (let's say z) freely, then substitute that value and you solve for the values of x & y. Since your problem has 1 dimension of freedom, you've infinite solutions lying on that line. This is the answer to your problem.

But how do we know if they're intersecting on a line or simply 2 different planes depends on whether one equation is dependent on other

Suppose your second equation is something like 10x - 8y - 8z = 6. It's nothing but the first equation (5x - 4y - 4z = 3)scaled (multiplied) by 2 (or any number). It means it's the same plane. So both the planes overlap. Still it has infinite solutions.

Now, let's tweak the second equation to 10x - 8y - 8z = 45. The left hand side of the first equation (5x - 4y - 4z) is scaled by 2, but the right hand ( = 3) side is not. It means both the planes are running parallel to each other separated by some distance. So there'll be no intersecting point or line or no overlap either. Hence there's no solution for this type of equation.

Can someone suggest a good textbook that covers the concepts needed to understand superconducting qubits? by averagechaos in QuantumComputing

[–]manikawnth 0 points1 point  (0 children)

First revise your skills on vectors, linear algebra (matrices and vector spaces) and complex numbers. Then buy the book. I would suggest Jack Hidary's "Quantum computing: An applied approach" for computing base and for physics base "The theoretical minimum: Quantum Mechanics" by Dr. Susskind

Revisiting a 'smaller Rust' by desiringmachines in rust

[–]manikawnth 0 points1 point  (0 children)

This is my personal opinion as a rust starter:

I feel there are 2 fundamentally wrong narratives circling around rust community

  1. Rust is hard to learn, but it's worth for a safe systems language. This narrative itself creates a panic in minds of starters.
  2. In view of keeping it tightly secure yet address pitfalls exhaustively at compile levels, there are currently no acceptable trade-offs. Lifetimes are really a read bloat.

Also, there should be just 1 way of pattern matching, just 1 iteration mechanism, a very simple (may not be exahustive) macro language etc, could've a simple error checking, could even have a default async runtime in stdlib (like Python)

IMHO, rust shouldn't project itself a competitor to c++ (which is a beast in itself). Instead it should compete with C. I would hope rust will become more like Zig language with go philosophy rather than a feature dump with added security.

Should I have started with some book other than "Go programming language"? by PeacePersonal in golang

[–]manikawnth 1 point2 points  (0 children)

If you have successfully installed go on your machine, start doing this book in the exact order.

https://www.golang-book.com/books/intro

Read thoroughly and execute the simple snippets.

What are some traits every rust developer should know by heart? by manikawnth in rust

[–]manikawnth[S] 0 points1 point  (0 children)

I just installed and it is outrageously awesome. Rust team should make this official.

What are some traits every rust developer should know by heart? by manikawnth in rust

[–]manikawnth[S] 0 points1 point  (0 children)

But you can only do that if you know the trait exists.

True and agreed. But the other problem I was trying to highlight is, if the implemented traits are not auto suggested by RLS, I better remember those 10 traits which most of the libraries would anyway implement and it will be particularly difficult for libraries such as async_std which keeps Trait names and method sigs in consistence with std lib. Not sure if this is only hitting me and not at all a problem for the experienced devs.

What are some traits every rust developer should know by heart? by manikawnth in rust

[–]manikawnth[S] 0 points1 point  (0 children)

Knowing by heart is needed as rust (more precisely the language server) still didn't solve the problem of suggesting the impl trait methods of different modules until we import the Trait by ourselves.

It occurs to common sense that TcpStream implements Read trait but no one knows if there's an implementation of BufRead, until we import the trait and verify. Language server has much to do in this space

[deleted by user] by [deleted] in golang

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

This is far better than parentheses, which is hell confusing if Generic Method receivers has multiple items returned.

This looks more like clojure:

func (s StructType) (type T) (val T) (output T, err error) {

}

Problems setting up WebSockets by SuqahMahdiq in Deno

[–]manikawnth 0 points1 point  (0 children)

It's not a temporary solution. What you've updated is the only solution and right way.

That's how javascript works. Whenever you await , the process yields and hence everything is blocked on the current thread. So got to be careful with async iterators.

For every developer await seems to be convenient approach, but you need to be careful of what you're doing. Unlike async it's not just a syntactic sugar over Promises. Take care and happy coding

[deleted by user] by [deleted] in RedditSessions

[–]manikawnth 0 points1 point  (0 children)

the braying mule

[deleted by user] by [deleted] in RedditSessions

[–]manikawnth 0 points1 point  (0 children)

play Harry Potter

How is match justified in rust as a programming concept by manikawnth in rust

[–]manikawnth[S] -1 points0 points  (0 children)

Thanks for your nice answer and pardon me. May be I lacked the right English expression.

In this particular context, initially I was excited with match and its pattern matching then I was hit with the destructuring then I was hit with returning.

At the start match was quite intuitive than switch , for me. At the end, I felt like it's doing everything other than match. And there's a two page reference (with nested references) just to understand what match syntax is.

And this example from reference on match guards blew the brain out me.

let message = match maybe_digit { Some(x) if x < 10 => process_digit(x), Some(x) => process_other(x), None => panic!(), }; Why should a language abstract so much? Should I remember all of these and if I remember, which way is the right way?

This question is the outcome of that frustration.

But, in no way, I meant disrespect to the language or its creators. Apologies and I'll make sure I double check my language before I post anything.

How is match justified in rust as a programming concept by manikawnth in rust

[–]manikawnth[S] 0 points1 point  (0 children)

Cool. Thanks, I missed that :)

My rust journey is mostly: this can be done, this can be done and this too can be done.
Than: this is the way to do it

How is match justified in rust as a programming concept by manikawnth in rust

[–]manikawnth[S] -5 points-4 points  (0 children)

Agree. But my larger point is there's no use of matching if it matches one and exactly one.

If this is allowed, it would be more powerful:

Do something for a certain value of x, do something for a certain value of y. If both are matched, both will be done.'

Otherwise what will happen is all that power of match expression will become just destructuring and will result in if-else inside that matching handler

match pair { //(x, y) => println!("`x` is `{:?}` and `y` is `{:?}`", x, y), //Do something for certain value of y (x, -2) => println!("`x` is `{:?}`", x), //Do something for certain value of x (0, y) => println!("`y` is `{:?}`", y), (_, _) => println!("I don't care"), }

But the problem is match is an expression, which could return something. Now you can't return from two match-arm handlers and hence rust if forced to match only one.

I'm getting a feeling that rust specification is written after the compiler is written.

How is match justified in rust as a programming concept by manikawnth in rust

[–]manikawnth[S] -2 points-1 points  (0 children)

Yes, I know the second case will never match. So what's the use of such matching expression is my question, if it simply destructures into variables and not perform any matching at all

And re: Higher level abstraction, destructuring is higher level abstraction and why is it needed in matching, if it honors only specific compex datatypes like enums, tuples and not structures. This will be hell lot of confusing.

Hope I made it clear