« first day (2404 days earlier)      last day (1091 days later) » 

1:21 AM
... hey is there a cryptocurrency that's actually based on everyone gaining exactly as much as every one else, that is; a cryptocurrency where every human gains 8 hours worth of "value" per day
 
 
2 hours later…
2:55 AM
@Stargateur
 
3:06 AM
Why do you call it "shitcoin"?

From the technical point of view, it has a really fast and scalable sPoS model. The whitepaper is well written and the code is open source.

From the economics point of view, it's clear why it's sustainable on a long term. Initially the rewards come from inflation, but gradually they are replaced by fees from projects built on this protocol. This is how the current 3200 validator nodes will be paid. And also the people who stakes (~2/3 coins are staked).
 
3:28 AM
I'm not the one who wants to convince you to buy anything. Actually, the opportunity for a Rust dev is not the coin itself, but the smart contract royalties, because 30% of the gas spent on SC calls go to its author.

Regarding that <<buy these coin using "dollar">>, there are 3 main options, right?
- to work for it
- to buy it (using USD/EUR/etc.)
- to gain it
Which is the best in your opinion?

<<I happy to talk about concept but not about "insert_here_coin is the best blockchain try it">>
I didn't say that it's the best, I say that there are some really good fast projects with their own
--------------------------------------------------------
@FélixGagnon-Grenier , just a joke regarding this:
<<Under capitalism, man exploits man. Under communism, it's just the opposite.>>
 
 
4 hours later…
7:42 AM
Good morning :-)
 
 
1 hour later…
8:51 AM
Fiat is the real shitcoin
 
9:20 AM
> Regarding that <<buy these coin using "dollar">>, there are 3 main options, right?
My point is that a popup that ask this, look like a regular scam site
^ how is this not look like a scam ?
"and start earning rewards"
 
Fiat is the real scam
 
9:32 AM
I got it. :) It's just for marketing, I would also doubt it, if I didn't know the reality.
Because "rewards" sounds too good to be true.

But probably most of the users (not those with a technical background, but somehow like gamblers) are probably more attracted to see words like "rewards", "win now", etc.

But, because it's based on sPoS, the coins can be staked, and the rewards are real, like a bank interest, but bigger. Let's say APR = 15% per year. They are locked for 10 days, but that's the only disadvantage.
 
10:19 AM
these questions are being out of control
 
 
2 hours later…
1:02 PM
 
wow I can't see the removed post...
never have this case
 
Whoops
That's because I messed up @Stargateur
0
Q: Matrix-matrix multiplication using einsum in Rust

MonicaI would like to multiply arrays with random numbers using einsum. Here is the snip of my implementation: use ndarray_einsum_beta::*; use ndarray::Array; use ndarray_rand::RandomExt; use ndarray_rand::rand_distr::Uniform; fn main() { let m1 = Array::random((100, 100), Uniform::new(0., 10....

A bad case of the dependencies, but it seems to have been resolved.
 
1:56 PM
@Stargateur I can't find it atm, but I remember reading an article about optimisation, and generally all these "why does this code run so bad when I try it with my favourite language", where the general idea was that "computers are fast, your code just suck". This has been a very valuable thing to keep in mind.
 
@FélixGagnon-Grenier I clearly wanted to comment your code suck but that not "welcoming" as their say :p
 
that is indeed not welcoming, but I understand the spirit :P
 
so I just downvote and vote to close :p
I'm sure @E_net4thejanitor would be proud of me
 
Oh I am proud of you too. not interacting with the OP and using the tools at our disposal is often the healthiest thing to do for everyone involved. I'm way less into moderation activities these past years but I've had my fair share of hard interactions.
 
2:17 PM
... anyway I haven't really profiled and benchmarked code, I've never worked on projects where speed was so critical as to warrant doing more than avoiding common slow pitfalls, but shouldn't an inquiry about performance feel a bit more... structured than that question?
like, actual benchmarks, both corresponding code, randomization of disk location and probably many things I don't even know about?
anyway, unrelatingly, I believe this cargo make task should compile only the specified binary, but when I run it with cargo make compile it builds all targets :
[tasks.compile]
command = "cargo"
args = ["build", "--bin", "journaling", "--release"]
is there a typo I am not seeing or something, or should this really compile only journaling?
 
3:08 PM
@Stargateur Uh, ah, yeah, sure sure why not, have a star.
 
3:37 PM
I should have ping shep, he is way more funny ^^
@FélixGagnon-Grenier I have no idea what is task.compile never saw it before
 
@Stargateur it's just custom name, I wrote compile myself. that's how one makes a cargo make command yes?
for instance, I have another command that is
[tasks.transpile_bundle]
script_runner = "@rust"
script = ''''''
er maybe there is a crucial piece of context I failed to give
that's in makefile.toml, along the use of cargo make
 
so you are asking specific question on a tool only use by you ? :p
 
@FélixGagnon-Grenier I believe cargo --bin name, will only build name yes, that the point
 
Does it work without --release at the end @FélixGagnon-Grenier?
 
3:48 PM
@Jason huh, yes, it does
@Stargateur I mean, cargo-make does seem to be used by not only me :)
... ohno
 
yes but I didn't read what was inside your custom tool config
do better question :p
 
what "custom tool config" are you talking about?
 
nevermind, you got your answer anyway
 
@FélixGagnon-Grenier Ha, it still does not work?
@FélixGagnon-Grenier I think the Makefile.toml for cargo-make?
 
.. ok so a lot of things happened in a few minutes :P
1. It appears that when a cargo-make task is named "build" it will also actually run cargo build --all-features
2. @Stargateur was right (fml) and I did not give all information
3. it actually worked already, but also launched the whole build afterwards, which made me question the whole process
4. and it was obviously mentioned in the documentation github.com/sagiegurari/cargo-make#default-tasks-and-extending
I hate this programming thing :P
 
4:08 PM
why partition_map is not in std - -
@FélixGagnon-Grenier funny, strange, don't like it
 
it does seem not to respect the "principle of least astonishment"
 
 
2 hours later…
6:18 PM
Oh shit, I just dupe-hammered an answer because it had the tag... There should be a warning ^^
Can a rust educated person check the closing here was ok ? stackoverflow.com/questions/67538438/…
 
well, answer don't cover proc macro
but i think build.rs must be a better solution on this case
so ok for me
also you are a rust educated person
 
Not enough to dupe hammer questions
When you get the gold badge, it's also mean you saw many questions and answers and have a clearer idea of what really is a duplicate. This is a good criterium. Except when it applies because of a minor stupid tag like
 
@Stargateur wouldn't fold or a wrapper around it be fine?
I've only used the itertools version once, but can't recall why...
 
I'm learning proc macros right now. It's... messy...
I feel like the main reason I'll end up doing even simple things with the syn and quote crates is because there's no correct documentation for the standard API
 
6:48 PM
This discussion came up a while ago, but simply tacking on const to a function doesn't guarantee compile-time function evaluation, right? Is there a way to guarantee this?
I'm thinking about that question you linked @DenysSéguret
 
@DenysSéguret Hence my (not official) wish that macro-2.0 (or let's call it 3.0) would introduce a unified way of doing macros, without all the hassle. I don't understand personally why this is not a higher priority, I bet there would be less demand from the language itself to incorporate certain features when they could be "mimiced" or fully implemented with macros. Macros that are easy to write, read, reuse, and integrated into the language.
> [...] tacking on [...] ?
If a function is const and the place where it is invoked is also a const-context, then the execution will happen at compile time, if this is what you're after.
@PeterVaro I mean, this is already happening: features could be introduced with macros, the part that's not happening is the "easily" and "consistently" and in an "integrated" way.
 
@PeterVaro I'll have to play around with this, thanks!
 
7:04 PM
@Jason I think the rule is pretty simple here, though I must confess I was confused about this as well: for a long time I thought if a function is declared as const it "must" be invoked at const-contexts. But the rule is actually much more flexible: such functions must be able to be invoked at const-contexts, but if they are not invoked at such places, they may or may not be executed at compile time.
(At least this is my current understanding, I still could be very much wrong.)
 
For me a const function is just a function that can be invoked in a const context. This involves a few details, like purity
 
That's exactly what I said above. But I'm not 100% sure about purity though, I have a few ideas which needs to be tested that would have side effects (even if those would happen at compile time), i.e. rendering such functions impure.
 
Having impure const functions seems hard to manage in a safe way. How about ordering ? Parallelizing ?
 
Oh, so you didn't say "impossible" you just stated "impractical"?
(BTW you could be right about purity, as I said above, I have to run a few tests to figure out what I think is impossible)
 
Regarding that question @DenysSéguret, would the following be evaluated at compile time? play.rust-lang.org/…
 
7:15 PM
no, the const function isn't called in a const context, there
 
I thought loops weren't allowed
 
Things you can have in const functions are always more numerous
This would probably be good:
const xs: [A;32] = gen_list(1, B::One);
const ys: [A;16] = gen_list::(8, B::Two);
And you probably should answer
I reopened because a) I never meant to dupe-hammer. b) I think there are better answers possible in 2021 with const fn — Denys Séguret 6 secs ago
!!afk need to sleep
 
7:45 PM
@DenysSéguret and @PeterVaro I'd love to help that person with a proper answer, but it seems it's evaluated at runtime, right? godbolt.org/z/onzrhzYPh
 
@Jason Which question? Where's your const function?
 
@PeterVaro the question Denys prematurely closed. I thought it was interesting.
1
Q: Const array from range

LiterallyCodeHow can I generate a long const array with values taken from a range? Bonus: 1) working with no_std, 2) without using any crates What I would like to do: struct A { a: i32, b: B } enum B { One, Two } const AS: [A; 1024] = [A{a: 1, b: B::One}, A{a: 2, b: B::One}, ..., A{a: 1024, ...

Is it impossible to avoid something like a build script in the above question?
 
8:13 PM
@Jason I'm packing for hiking tomorrow (that's why I'm not so responsive, sorry 'bout that), but as I mentioned above you didn't create a const function at all. If you would do such a thing, which would return a "newly created" array, which then would be assigned to a constant variable then that would happen at compile time. But because const functions as they are today are rather limited, I would likely use a macro for the above as it would be more flexible in this specific scenario.
 
Ah, right, I see!
The following does seem to work
#[derive(Copy, Clone)]
pub struct A {
    a: i32,
    b: B,
}

#[derive(Copy, Clone)]
pub enum B {
    One,
    Two,
}

const fn gen_list<const N: usize>(offset: i32, b: B) -> [A; N] {
    let mut res = [A { a: offset, b }; N];

    let mut i = 0;
    while i < N as i32 {
        res[i as usize].a = offset + i;
        i += 1;
    }

    res
}

const VALUES: [A; 64] = gen_list::<64>(1, B::One);

pub fn example() -> [A; 64] {
    VALUES
}
@PeterVaro Also, the hiking sounds fun! Enjoy :-)
 
That could work, I was trying to do something similar with MaybeUninit (otherwise if your function is called in a non-const context it would initialise the entire array first and then immediately override all the values) but that didn't seem to work with min-const-generics.
(But maybe I'm just not paying enough attention to this now, because my mind is elsewhere..)
 
8:29 PM
Thanks for the pointers so far @PeterVaro and @DenysSéguret! Even though I'm not satisfied with my answer, I'll post it, as it seems it might help them. I can always update it later on.
I'll leave you to packing your things :-)
 
No worries, if you could manage to make it work with MaybeUninit and (likely) transmute then I think it would be a perfect answer. (Also, I would use the variable name list instead res, after all you call it gen_list, but TBH I would call it generate_array and the variable name array #nitpicking)
 
8:43 PM
@Jason well technically you can do all in a for loop, the point is hiding hide effect using iterator
 
@PeterVaro Ah, I named it similar to what the author had, but I prefer array as well. :-)
@Stargateur Haha, yes
I thought fold would be on the "not great, not terrible" scale here.
I like that .partition_map indicates intent, whereas you'd have to scan the .fold function first to understand what the author tries to do.
 
9:17 PM
battery die, almost explode, buy new battery, new battery doesn't seem to reload and heat already... amazing
ask for a refund ? yes in theory, but in france it's illegal to send used battery so I can't return it...
thanks "german quality" battery made in china (yes It literally write that on the battery)
 
@Stargateur you have got to be kidding
 
damm, stock energy is so hard, we still don't have any good way to do it except using water...
@FélixGagnon-Grenier no, that a safety rule, don't send device that can explode...
 
I mean, I understand, but still
 
I think all EU have this rule
 
@Stargateur you mean like barrages hydroélectriques?
 
9:21 PM
@FélixGagnon-Grenier exactly, and the one that can stock energy at demand are call STEP station de transfert d'énergie par pompage, but I have no idea how it's called in english
STEP is the best of the best of energy storage
 
My city is powered by such an instalment
 
so great that people want to transform the manche sea into a GIANT STEP, you know the sea between france and england :p
but our battery suck so much
 
hahaha, wonder who's gonna end up on the wrong side...
 
trust me this giant STEP would be a amazing thing, probably the biggest construct of human BY FAR and so useful than we could use it to stock renewal energy for all EU
problem is... nobody know how to made it xd
10 hours of load, one reboot, go from 53% to 44%
I hate battery so much
 
9:54 PM
@Stargateur Is this the pumped hydro?
 
@Jason probably, this video don't look great, the tittle itself is click bait, anyway, learn french et see youtube.com/watch?v=ECXJ5rTNi74
there is subtitle so you can trad auto to english :p
 
@Stargateur I don't like the title either and was going to mention that, but found the content to be interesting.
Mostly because I had no idea that method even existed.
 
yeah, and it's literraly the best we have, the best for ecology, the best for efficiency, the only problem is... it's require to be able to stock water, a BIG volume of water that why people was like... "oh look this sea look great let use it" :p
 
10:11 PM
Haha, unfortunately that likely wouldn't be as effective here with the amount of land that's below sea level.
 
Here in Québec, to the north, are lands upon which it is very suitable to build big hydroelectric dams.
 
there is a test in canada about a big heat pump underground that store energy in summer and heat in winter
 
so great too but also require specific geo
 
I'm unaware of that, it sounds very nice
 
10:19 PM
@FélixGagnon-Grenier dlsc.ca/index.htm
 
the video that explain it again in french :p youtube.com/watch?v=oDyvDvQ5JkU
yes this man is the best
a true scientific
 
this is magnificent
 

« first day (2404 days earlier)      last day (1091 days later) »