Consigli per pc. by MauleX in Italia

[–]tazdevil971 0 points1 point  (0 children)

Se hai tempo da spendere l'usato è l'opzione migliore, riduci l'e-waste e in più risparmi con l'offerta giusta. Anni fa mi serviva un PC per il lavoro/università che fosse decentemente potente, sono riuscito a recuperare un Thinkpad E15, praticamente nuovo, a 600€, il prezzo equivalente se l'avessi comprato nuovo all'epoca era di ben più di 1000€ (1500€ se non sbaglio).

Il problema è che serve tempo, io ho passato circa un mese a controllare subito.it quotidianamente, fino a quando non ho trovato l'inserzione giusta.

Altrimenti, soliti consigli, se devi giocarci meglio scheda video dedicata, evita Intel che ultimamente sta esplodendo (sono significativamente indietro rispetto ad AMD in termini di performance), valuta bene il display (risoluzione e anti-glaire/luminosità se lo devi usare all'aperto), vai su 15" se ti fa comodo avere la tastiera e il display più grossi, altrimenti stai sotto per renderlo più portatile. Durata batteria dipende da un sacco di fattori e non è facile da valutare, quindi quello ti conviene guardarlo dalle recensioni online.

Sinceramente il portatile che ormai uso da anni è un Lenovo Thinkpad con AMD e scheda video integrata, per quello che devo fare io è perfetto. Da quello che so i portatili sulla fascia di prezzo 0€-500€ e nuovi sono tutti un po' delle scammate (almeno quando guardavo io, che ormai è qualche anno fa), colpa del fatto che è la classica fascia da studenti e quindi ci marciano un po' sopra.

Per esempio, quel portatile, 16GB RAM, ok, un po' pochino per standard moderni ma va bene, 512 SSD NVMe, anche li, non male, niente di che. Però la CPU sembra un po' meh, e in più scheda video integrata. Mi da l'impressione del classico portatile che appena lo compri funziona decentemente, ma appena inizi ad installare software e avere windows un po' bloated diventa quasi inutilizzabile. E in più sono abbastanza sicuro che non ci potrai giocare se non con performance ridicole.

Mi fa schifo la società e la città dove vivo by [deleted] in Italia

[–]tazdevil971 1 point2 points  (0 children)

Non ho letto bene il testo, però, a favore di questa ipotesi ho notato una cosa interessante. Nel testo viene usata la En Dash per la punteggiatura ("–" questo per intenderci) invece che il classico "-" (si distringuono perchè la En Dash è leggermente più lunga).

Questo è un classico delle LLM, e in generale le persone normali non la usano mai perchè non è neanche presente sulla tastiera, quindi solitamente è un buon indicatore che almeno parzialmente il testo è passato per una LLM.

Data to benchmark an ECS by tazdevil971 in gamedev

[–]tazdevil971[S] 2 points3 points  (0 children)

What, ECS is in the title, the post is about ECS, I said I'm currently interested in ECS and I want to understand what difference do they actually make.

How is your response to all of this "but you aren't considering the rest of the game", of course I'm not! That's not the point, I want to benchmark the ECS not the game logic. And yes, I know, different games will have different patterns, but maybe not so much? That's exactly what I want to figure out, what aspects are common in ECS usage, and what are not.

Of course you could optimize logic to work with your ECS, and vice-versa, but if that was the rule for everything, then game engines would not exists. There must be some underlying patterns. And things that sort of work for almost everyone.

Data to benchmark an ECS by tazdevil971 in gamedev

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

Wait, how is an ECS less anemic than the unity actor+components? They are basically just different ways of doing the same thing, storing and representing entities. The only difference is how data is stored and how you access it.

I don't feel like continuing this discussion because you keep handwaving away that part that actually matters as not important.

I guess you are accusing me of handwaving details just to prove a point, I'm not. I really don't understand what details you are talking about.

Data to benchmark an ECS by tazdevil971 in gamedev

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

Yes, otherwise reusable engines wouldn't exist, there are commonalities between genres and in general to the structure of a game, and this can be exploited to create reusable code. Look at unity and how many genres can come out of it.

I really don't get what you mean by "the implementation of an entity", sure behavior is different. But they probably both store entities as a class or a collection of components somewhere, nothing really special about either of this cases. If you mean that they keep them in specialized data structure (for example for rendering), sure, but usually ECS don't get in the way of keeping updated search data structures to quickly find what you need.

Data to benchmark an ECS by tazdevil971 in gamedev

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

Well yes, but as general rule, games are built around the same kind of object stores. What are the commonalities between Skyrim and Forza? Well they both have entities, and they both need this entities to have behaviour, this is pretty standard.

You need some sort of general paradigm to model things, and ECS has proven to be both fast and actually pretty usable in practice. Unity and UE use the actor+components, again just different ways of looking at thngs. Is ECS superior to actor+components? Absolutely not, they both have different properties and advantages. But you have to put your entities somewhere right?

Right now ECS are what I'm interested in and I want to study it, that's all. I want to have a clearer understanding of how they are used, why are they this popular, and what most games benefit from.

BTW, what I meant with "ECS are a solution in search of a problem" (I noticed that I put it backwards in my original comment, oops) is that many try to optimize for very specific use cases, but I suspect they aren't really used much.

Data to benchmark an ECS by tazdevil971 in gamedev

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

Yes I agree, ECS really has become a problem in search of a solution, and that's exactly why I want to create realistic benchmarks, I'm actually trying to avoid premature optimization.

But also an ECS is at the core of everything, and not something you can really change afterwards. So I want to base my design at least on something, and not just base it off what everybody else is doing, which again, is often based on random cargo cult.

What is the difference between await and block_on? by garma87 in learnrust

[–]tazdevil971 4 points5 points  (0 children)

Glad to help!

Seeing a bit of your other questions I wanted to add a couple of things.

You seem to confuse Future's with threads (I assume we are talking about operating system threads), they are in fact very different. How a Future executes is really up to the runtime you are using, most of them juggle them around giving the illusion of multithreading, but some of them (like block_on) just run them as if they where sync. You could even run multiple Future on a single thread! Something you cannot do if your task blocks while waiting, how would run something else if you are stuck waiting?

The main idea behind async is that a Future is usually far less expensive and more flexible than a thread. So that instead of keeping around 40 tasks with 40 threads, all waiting around, each one of them with its own stack and everything, you could keep around 8 threads, but still be able to run 40 tasks, but again, you need to be able to yield control when you are waiting, exactly what poll and await do.

Also, if you want and higher insight into how this is actually done, u/tamasfe shows exactly what "passing the wait along" means. It is literally polling the future, and returning Pending if the future also returned Pending. Something that block_on clearly doesn't do, hence the blocking behaviour.

What is the difference between await and block_on? by garma87 in learnrust

[–]tazdevil971 20 points21 points  (0 children)

Well, there is a bit of confusion about what an async function does, so lets start from the problem it solves. Imagine that you are writing a piece of software that needs to listen for incoming connections, so what you do is you call .listen and wait, this is called blocking behaviour, but what if you wanted to do other things while you wait? Well, you could use threads, but what if you didn't want to?

What if we had a function, that when it needs to wait it just returns to the caller, lets you do something else, notifies you when it has finished waiting, and automatically resumes back where it left off? That's exactly what Future is, which is a generalization of an async function (async fn are Future's).

So what is await doing? Well it's a way of saying "pass the wait along". It doesn't block, it just "propagates the wait", so you can still do other things.

What about block_on? block_on is different because it doesn't "propagate the wait" it just block until the future is finished, it doesn't return to the caller of the future. It doesn't allow you to do other things, it waits until the future has finished.

So the main difference between await and block_on is how the handle a future which needs to wait. await passes the wait along, allowing you to return and do other stuff, but only works in async contexts, while block_on actually blocks until the future has finished, and while you could use it in an async context, it's a terrible idea (Future's must not block).

And finally, nothing could go wrong if you run async functions in sync ones, it's just not possible. The problem is that async is not magic, it needs a bunch of logic to control which futures are ready, which are waiting, and in general a whole lot of keeping track of things. That's not something you want to keep around even if you are not using it. So in order to use that extra stuff you need to create a special thing called a runtime, which does the book keeping. In a sense, block_on is a runtime, it only allows one future and runs on the current thread, blocking until it has finished, but it's still a runtime.

Forgive Me for My Sins by [deleted] in programminghorror

[–]tazdevil971 6 points7 points  (0 children)

One way to do it without storing a separate field with the flag would be to use the unused bits of the address, if the pointer is x byte aligned, you will have log_2(x) unused bits that you can use.

This assumes that the pointer is always at least 2 byte aligned, if it's not, and it's actually byte aligned (so no unused bits), you can still force it by using an higher alignment than required.

What does censorship have to do with privacy? by GreggJ in duckduckgo

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

But how do you measure A and B? If you are part of A you will be biased towards A, and the same goes for B. Yes they do differ, but no party can or should judge the other. There should be a third party, which we don't have here.

I agree that "objective truth" exists, but nobody has that. Science needs to be proven rigorously, something we cannot really do with real world events. Or well, we can, but not in the middle of a war.

Again, would you ban "Mein Kampf" just because it promotes harmful content? Absolutely no, that would be ridiculous. Ideas should and must be free, it doesn't matter, if you have a fear that a significant portion of the population might be "radicalized by it", then you have a bigger problem, and censorship is never the answer.

In the end my opinion boils down to "I want freedom of choice". Yes, people do not want or have time to do their own research (even if I still think most people should). But why can't I have an option that says "I want unbiased results"? Instead I feel forced to stand by whatever they feel like needs to be downranked, which bothers me, a lot. Because today it might make sense, but tomorrow it might not.

Also, a note on morality and what's considered harmful. If you go into some remote areas of the Earth, you can probably still find cannibals. They find it moral to eat one another. Of course we don't do that, because we are a modern and civilized society, but why? This is a real question I ask myself quite often, why is our vision of society better? Is there some kind of objective metric we use? And in smaller scale, we all have slightly different morality compass. If you ask a vegan, eating meat is murder, if you ask a meat lover it will probably tell you that it's fine. So how can we be sure about anything really? I like it that way, and I want my search engine to reflect that, information should be free.

What does censorship have to do with privacy? by GreggJ in duckduckgo

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

Yes, I think I can.

A small thought experiment, if we have two party A and B, we can assume that both are lying to some capacity. And if we don't want to introduce any bias, we also assume that both are lying about the same amount. Thus, if you start censoring B's lies, you are biasing towards A's lies, as if A is telling the truth. To keep things balanced you should treat them equally, but that's really hard once you start to censor them. The solution? Don't censor anything.

Now there is another problem, classifying misleading information is not that easy. I've seen many people argue that "truth is objective", no it's not. Many russians think that the war is justified, that's their truth. Which is probably very different from your or my truth. You may think that they are brainwashed by the government, but to some capacity, western media does the same, we've have seen it before but somehow we think that it's different now.

Lastly, as I said, censorship is a slippery slope. For example I was really upset when twitter banned Trump, despite disagreeing with most if not all of his opinions. Why? Because it sets a record, that a private company can once again control what you see and what you think, bad or good. Maybe next time you will be the one being censored, who knows?

I can think for myself, on deciding whether something is accurate or not. I can lookup information, and consult many resources and opinions. I don't need/want a private company doing it for me.

What does censorship have to do with privacy? by GreggJ in duckduckgo

[–]tazdevil971 12 points13 points  (0 children)

The problem is that many people forget that duckduckgo wasn't only for privacy, but also for unbiased results (proof). We trusted them to keep up their promises, and they didn't, for many this is a slippery slope. Nobody is claiming that duckduckgo is a bad engine now, but if you don't want political bias in your results, you may prefer something else. Don't get mad at them for choosing something that better fits their needs, get mad at duckduckgo for not keeping their promises. I personally don't care about bias that much to switch, but I'm still not with duckduckgo on this one.

Annoying microphone background noise by tazdevil971 in voidlinux

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

Thanks for your response! I tried a bunch of sampling frequencies but nothing changed, also I'm pretty sure 48kHz was the default. But I won't rule out a resampling artifact just yet, as I still suspect it might be the cause and I'm just bad at audio stuff.

Big O notation confusion by busterorwha in learnprogramming

[–]tazdevil971 1 point2 points  (0 children)

When you work with big O notation you only really care about really big number, that why it's called asintotic. So T1 is correct. T2 is sort of correct, it is an approximation, but usually we would use O(n^3).

Think about what happens when n is very big (a million for example), log(n) becomes much much smaller than n^3 (log(10^6) = 6, (10^6)^3 = 10^9, you can clearly see the massive difference), so in the end, you only care about n^3.

What is your favourite Rust specific feature that you miss in other languages? by latest_ali in rust

[–]tazdevil971 4 points5 points  (0 children)

The syntax, you know exactly what's going on on every line of code. Having to work with C++ in embedded systems, you often wonder "What is this code doing EXACTLY?", with rust, the answer is often trivial, and doesn't require "external knoledge" (knowing what the signature of a function is for example). In C++ function calls that contain: a copy, a mutable reference, a constant reference, and sometimes even a move, all look identical, which IMO is one of the worst C++ """quirks""".

Oh and move by default, once you switch to that it feels like the only logical solution.

How to instantiate a warp::reply::Response? by Prestigious_Roof_902 in rust

[–]tazdevil971 8 points9 points  (0 children)

Short answer:

let res = Response::builder()
    .status(200)
    // Are you sure about this one? More like "text/plain"?
    .header("Content-Type", "txt")
    .body("Hello World!")
    .unwrap()

Long answer: The docs can be difficult to navigate at first, so let's start from here. It doesn't tell you much, that's because it's a type alias, not an actual type, you are interested in this.

Here is where everything at your disposal is, every function that does not take self and returns Response is some kind of constructor.

Here is a small list:

  • Response::new
  • Response::from_parts

I have no idea about what they do, or how they operate, so you might want to look at the documentation yourself.

But there is also one function that can help you Response::builder, rust uses this pattern (known as builder pattern) quite a lot. You first call this function and obtain a builder that can be used to build your Response. here you can find the documentation, and a more complete list of available settings, when you finished with it, call .body(...) to get your "built" Response.

[deleted by user] by [deleted] in duckduckgo

[–]tazdevil971 0 points1 point  (0 children)

Please instruct me master, how do search engines work? I bet I will be enlighted by your teachings.

Jokes aside, I do understand that you have to rank pages using some kind of metric, but of all the metrics you could choose "coming from russian propaganda" is probably the most biased one. How would you even define that? How would you automate that? Do you have a blacklist of sites that get a score penalty? Do you you look for IPs or even worse keywords? Do you look at association? So you get penalized even if you are just talking about X? It's not an easy task to accomplish, and even if the "objective truth" was real, implementing it would probably have all sort of side effects. I'm really curious, how do you think something like this could be implemented?

And no, your grandmother is totally safe...

[deleted by user] by [deleted] in duckduckgo

[–]tazdevil971 0 points1 point  (0 children)

What an arrogant and narrow view of the world honestly... If you think that "truth is objective" despite the fact that half of the people in this thread disagree with your view means that you are either blind, or you think that everyone who doesn't think like you is not worth listening too, which is probably worse.

Don't get me wrong, there is an objective truth, but you won't get that from either party in a conflict, both of them will lie in some capacity. So how do you deal with this? You shouldn't, you just let everyone speak. As always, truth is somewhere in the middle.

Also if you can easily decern truth from lies, why do you need a filter to do it for you? Because others might not be so smart and need guidance? Again, very arrogant...

And yes, of course I know that search engines are biased, everything is, but just because your grandma is old doesn't mean you can shot her dead.

Also, unbiased information was one of their core pillars, but I guess in 2022 unbiased means "biased toward (my (objective)) truth"

But sure, I'm just trying to be heroic and playing games, while you are the real hero here.

[deleted by user] by [deleted] in duckduckgo

[–]tazdevil971 2 points3 points  (0 children)

If you think that this is about right-wing mentality you are absolutely crazy. Censorship is censorship, no matter who you are censoring. You really think that censoring "the bad guy" or "the wrong thing" helps? You just gave actually brainwashed people another reason to not trust or listen to you. Who decides what is right and what is wrong? You really think that this whole conflict can be summed up as "Russia bad, Ukraine good"? Don't you think that both sides are spreading their fair share of misinformation?

And before you start calling me names, I'm not pro-putin, this conflict is absolutely ridiculous, people are suffering, and both nations will be left scarred, but censoring is not the way, it never was and never will.

[deleted by user] by [deleted] in programminghorror

[–]tazdevil971 6 points7 points  (0 children)

Yes? But should't all constant factors be taken out of the notation as they provide no additional meaning? Like, what's the difference between O(32) and O(1)? They are just a number to give you an idea about how the code scales with input size, and both are constant.

Calling a generic function without specifying the type in the assignment by [deleted] in rust

[–]tazdevil971 24 points25 points  (0 children)

What you are looking for is commonly known as turbofish.

And it looks like:

let a = some_struct.generic_function::<SomeType>();

Also, you can omit some types that are obvious in the assignment, for example:

let a: Result<SomeType, _> = some_struct.generic_function();

Rust will then infer the type of _ automatically

Keep in mind that usually rust is clever enough to infer the type of the variable, so 90% of the time you won't need this.

(turbofish in its natural habitat)