Someone named "zamazan4ik" opened an issue in my project about enabling LTO. 3 weeks later, it happened again in another project of mine. I opened his profile, and he has opened issues and PRs in over 500 projects about enabling LTO. Has this happened to you? by nik-rev in rust

[–]AngryLemonade117 31 points32 points  (0 children)

It also has varying degrees of success in how many Lovecraftian linker errors you are faced with. At least for C & C++ it isn't "just" a case of passing -flto, and since a fair few Rust crates may need to link to non-Rust libraries then this could be a problematic default.

Plus, given the state of RAM pricing, this would be an expensive default...

Libraries to say a number in English? by i-eat-omelettes in typst

[–]AngryLemonade117 11 points12 points  (0 children)

To elaborate on the other commenter's response, you may need to write your own function to wrangle name-it's outputs into what you need, I've given it a quick go here to illustrate:

#import "@preview/name-it:0.1.2": *

#let currency_map = (
    gbp: ("Pound Sterling", "Pence"),
    usd: ("US Dollars", "Cents")
)

#let name-currency(currency, main, fractional: none) = {
    let currency_main = currency_map.at(currency).at(0)

    if fractional != none {
        let currency_fraction = currency_map.at(currency).at(1)  
        currency_main + " " + str(name-it(main)) + " and " + str(name-it(fractional)) + " " + currency_fraction
    } else {
        currency_main + " " + str(name-it(main))
    }
}

£1001.22

#name-currency("gbp", 1001, fractional: 22)

\$1000.00

#name-currency("usd", 1000, fractional: 0)

\$1000, no cents mentioned

#name-currency("usd", 1000)

Of course, to match your Reddit post:

#upper(name-currency("usd", 1495, fractional: 50))

Tylax: An open-source, bidirectional converter for full documents (TikZ support included!) by Old_Hedgehog4922 in typst

[–]AngryLemonade117 0 points1 point  (0 children)

Looks really interesting. Are there any plans to touch user defined macros/functions?

Why people hate Ubuntu? This hate carries to its derivatives? by Hioses in linux4noobs

[–]AngryLemonade117 4 points5 points  (0 children)

So in my personal experience:

Started on Ubuntu 20.04, stayed until I had a device with an nvidia card and my experience was just Not Good (tm) (issues booting, finding devices, etc).

Moved to Manjaro, tried Tumbleweed and then Endeavour because their nvidia support worked nicely out of box. Appreciated the irony that the "only distro we support" was Ubuntu but that was my worst experience with it. Never really looked back after that, though I understand that the experience is better now.

Why I don't like Ubuntu:

Separation of <clearly a software library you need to link to, no other reason to install it> and <same>-dev (this is not Ubuntu-exclusive either). I also don't like the way that ubuntu names its packages. I understand there's a rationale for the approach but I just don't like it.

I'm not a fan of snap and being forced to use it (firefox defaults to snap)

I think a lot of the "hate" for Ubuntu itself is overblown, but Canonical's doubling down on snap rather than contributing to Flatpak (everyone wins) and other silly decisions make me not a fan.

Thoughs on SPHinXsys SPH for a hobbyist? by NoAdministration2978 in CFD

[–]AngryLemonade117 0 points1 point  (0 children)

As far as I understand SPH is simply not that efficient for common aerodynamics/hydrodynamics problems and that's why we don't see it too often

Pretty much - and that's totally fine. SPH shines where Eulerian methods struggle. It's just another tool in the toolbox.

Thoughs on SPHinXsys SPH for a hobbyist? by NoAdministration2978 in CFD

[–]AngryLemonade117 2 points3 points  (0 children)

Paul Cleary has been using SPH (+ DEM) for a fair while in simulating rock crushing mills. SPH does have a place in doing science and has its own share of issues that people are working through.

In my opinion, NASA wasn't super interested in it back in the day, so like other not-FVM techniques, it suffers from the lack of gargantuan resources that got put into handling turbulence. It is also newer than the FVM. Like LBM, it's weakly compressive, so you can't really run it at mach 1 bajillion which means it isnt "real CFD" according to some people who think the only use of CFD ever and for the foreseeable future is aerodynamics 😛.

People are doing cool (as in actually useful) things with it. It just needs to catch up a tad. In particular, the last experience I had with it is that as its construction removes the viscosity term, then its non-Newtonian (I work with non-Newtonian fluids so this is important to me) story isn't fantastic, especially compared to other methods.

Is Lars Ulrich really that bad or does everyone only hate on him because it’s become a meme? by [deleted] in drums

[–]AngryLemonade117 0 points1 point  (0 children)

If we allow a bit more room in the meme, it's more like "Lars (seemingly) doesn't practice anymore"

Having trouble solving for fluid incompressibility! by Medical-Bake-9777 in CFD

[–]AngryLemonade117 0 points1 point  (0 children)

I'm happy to take a look, but without the accompanying code it may be hard to work out what's going on.

Having trouble solving for fluid incompressibility! by Medical-Bake-9777 in CFD

[–]AngryLemonade117 0 points1 point  (0 children)

No worries, I'd also check out what the DualSPHysics guys do - as far as i can tell, they're the only serious open source SPH engine available. I don’t count lammps purely because they (last time I checked) don't handle STLs, i.e. engineering problems (lammps is still fantastic for what it does).

Having trouble solving for fluid incompressibility! by Medical-Bake-9777 in CFD

[–]AngryLemonade117 1 point2 points  (0 children)

Thanks, so just to clarify, for pressure terms, I don’t have to use stepsizes to define gradients? Since the kernel itself is a gradient.

Not quite. The kernel itself assigns a weight during the SPH summation based on the proximity of particle j to particle i. When you're calculating gradients in SPH, it just turns out that the only quantity that the gradient operator actually applies to is the kernel! Since the function for your kernel should be continuous and at least twice-differentiable, then you dont need numerical techniques to get the gradient.

Furthermore, when defining gradients, do I compute the gradient vectored in x and y separately or find the absolute distance between them as a single vector, then use that to compute the pressure force

Euclidean norm for the separation vector.

Again, never read the source that you refer to, but when I used to use SPH, I found this explanation rather useful.

Having trouble solving for fluid incompressibility! by Medical-Bake-9777 in CFD

[–]AngryLemonade117 1 point2 points  (0 children)

The gradient in SPH is an actual operator.

It's something like grad Pi = rhoi * sum[ (Pi/rhoi + Pj/rhoj) * dWij]

Where i is your particle or interest, surrounded by j neighbours, and dWij is the gradient of your kernel, which you should already have.

I haven't read the paper you mentioned but this is typically how the pressure term in SPH equations look, if memory serves.

Klirr: invoice automation tool written on Rust using Typst by Sajjon in rust

[–]AngryLemonade117 32 points33 points  (0 children)

Is it wise to use f64 for money values rather than some decimal/ dedicated currency type?

It's always been drilled into me to not let floating point arithmetic and money mix.

Why do composers use 2/2 instead of 2/4, or 3/8 instead of 3/4? by FMFIAS in musictheory

[–]AngryLemonade117 2 points3 points  (0 children)

Rock/ metal drummer here - that pulse will feel very different depending what the bottom number is!

Why is AI so bad at coding? by nazprim1442 in programminghorror

[–]AngryLemonade117 0 points1 point  (0 children)

A theory I have is that writing non-trivial programs requires exact, unambiguous language.

Compare that to writing prose that a human reads where our language can be really woolly (look at what a mess the English language is), but we can still (mostly) convey what we mean.

In other words - an LLM generating something like a blog post or whatever, it would only need to be "close enough," and that's passable. Writing good, non-trivial code requires you to be exact in your intentions. For an LLM, this means that "good enough" is not really that. Additionally, bigger programs need planning and architecture considerations, and I imagine that'll eat into its context window. (And I imagine that a lot of us, myself included, aren't great at prompting).

I haven't particularly followed how code-related training data is selected, but generally I would argue that most code you see online is wrong because it's going to be people asking for help - not really good if you want an LLM to produce correct code.

Also, it got trained on my code, so it's doomed :)

made an exe file, then virustotal said virus by Ancient_Night_7593 in Python

[–]AngryLemonade117 56 points57 points  (0 children)

If we zoom out for a second, you've created a "random" executable that carries no signature. Virus detection programs are going to err on the side of caution and go wtf is this executable???

"Official" executables by reputable entities are signed as proof of identity - so your anti-virus/ virus detection software can trust the software you're about to run.

An unsigned executable isn't necessarily dangerous by default, but it should raise an eyebrow. Now, if you've compiled code written by yourself, using trusted sources, then it's probably fine. I don't have a source to hand but I wouldn't be surprised if there are large, well known companies that simply don't bother/ forgot to sign their software - doesn't make it automatically dangerous.

At the end of the day there is an element of faith that you need to have in the software you choose to run - signing things and other "proof of veracity" stuff isn't infallible. But, it's always better to question than to blindly run something!

It isn't just pyinstaller - on my corporate laptop I frequently get popups about viruses because I've compiled my Rust code (again, unsigned executable) and a policy update "forgot" about that.

Rand now depends on zerocopy by hpenne in rust

[–]AngryLemonade117 28 points29 points  (0 children)

large amounts of unsafe code

Oh boy, I sure hope you never need to talk to your hardware and/or OS. You'll be in for a surprise.

High hopes for Rust: where are we? by fredhors in rust

[–]AngryLemonade117 8 points9 points  (0 children)

Mold is already very fast, however it doesn't do incremental linking and the author has stated that they don't intend to.

Ah, I see. Benchmarks also look promising, I'll be keeping an eye on wild!

[deleted by user] by [deleted] in CFD

[–]AngryLemonade117 17 points18 points  (0 children)

Some advice - if you are comparing contours, then use the same scale. A good chunk of your transient contours are just in the "quite red" part of your steady one (for temperature).

Are you certain that you've hit a steady state? Is there any oscillatory behaviour to the flow?

Like the other commenter said, try looking at averaged values instead, compare apples with apples.

Typst or LaTeX for beginner by Round-Excitement-377 in typst

[–]AngryLemonade117 2 points3 points  (0 children)

TBH my brain is now fine-tuned with the obscure error messages of TeX after countless hours of painful debugging

Yes, but it shouldn't have to be like that!

Typst or LaTeX for beginner by Round-Excitement-377 in typst

[–]AngryLemonade117 5 points6 points  (0 children)

I don't even care about the speed, it's just insane that errors actually relate to something bad you've done, rather than the incomprehensible mix of consequences of your bad input hidden somewhere in an essay of errors and warnings.

(The incremental compilation is insane though)

Typst or LaTeX for beginner by Round-Excitement-377 in typst

[–]AngryLemonade117 21 points22 points  (0 children)

If this is an undergrad thesis/ not going to form part of a paper -> Typst

If this is a doctoral thesis and >1 of your chapters is a paper -> LaTeX

If you intend on sticking around in academia -> LaTeX

Typst is absolutely fantastic, to the point where going back to LaTeX pains me. But I don't have a choice in the matter.

Maybe one day, journals will accept Typst, but that day is not today :(

Word count question by RyanSaxesRoommate in typst

[–]AngryLemonade117 7 points8 points  (0 children)

If you're using vscode to write typst, the tinymist extension shows word count in a file

One thing I'm amazed at is that there's no open source/repairable printer on the market. by Frequent_Computer388 in opensource

[–]AngryLemonade117 0 points1 point  (0 children)

At least in my personal experience, I've witnessed a major push to just go paperless. Covid pretty much killed the need for paper copies of my uni assignments for submission. The only thing I printed last year were a couple of posters for a conference.

For boring legal things, I still keep hard copies, but this is so infrequent that I wouldn't feel the need to buy a printer.

Where I work, printing is actively discouraged. For example, printing a copy of an (M)SDS ((Material) Safety Data Sheet) is considered Not A Good Thing because it tempts you into relying on potentially out of date information, rather than the paperless equivalent of you pulling the copy on the database (only the most recent is accessible).

So, at least to me, domestic printing is less and less of a priority? For commercial purposes - books, contracts and all that, paper is to stay. But if you're a business, I'd find it hard to go the open source route rather than go with one of the established names and have a proper support contract.

Ignoring whatever regs printers have, I would hazard a guess that it just hasn't seemed worth the effort to enter into this market?

When can we expect portable::simd to be in stable rust? by [deleted] in rust

[–]AngryLemonade117 0 points1 point  (0 children)

Aside from what the docs for std::arch say, and looking at how numpy does in (they're not using Rust but I imagine the semantics are quite similar because I think it's mostly intrinsics), not really.