« first day (4421 days earlier)      last day (720 days later) » 

00:01
Ah, not supported in the TIO version of GCC, atleast for binary integers.
Binary integer literals are C23 so I'd be surprised if TIO supports them at all
huh.
@lyxal I remember writing this test framework for a personal project (that isn't public on Github or anything), it hid some downright ugly code behind macros but the end result looked like this:
testgroup(example_test) {
    testcase(this_test_passes) {
        test_assert(true);
    },
    testcase(this_test_fails) {
        test_assert(false);
    },
    testcase(this_fails_too) {
        test_fail();
    }
    testcase(exceptions) {
        std::vector<int> v;
        test_throws(v.at(1));
    },
    testcase(this_one_is_skipped) {
        test_skip();
    }
};

int main() {
    return test::run_all_tests();
}
unironically, that looks similar to some testing frameworks I've seen for other languages
Yeah that was kind of the point. But you don't want to see what that looks like after macro expansion
00:07
when you say it like that, I kinda do :p
If you don't want to run all the tests, you can call example_test.run_tests() (for all tests in one group) or example_test.run_test("this_test_fails"), which I think is pretty neat
@lyxal Give me a moment, I'll extract the test framework folder from that project into its own repo so I can make just that part public
that doesn't look so bad
There is some utter jank in test_group.cpp
grouping tests seems to always result in some sort of jank
I don't know what I'm looking at
jank similar to your test_group
basically, we both have a big mess for handling tests that need to be grouped together
00:24
I swear I had const char*& in here somwhere
Wait then right below it is const char* const&. What does that even mean
Wait, won't test::assert blow up if the user decides to #include <cassert>?
Wait, where do I even define it? Everything else uses test_assert, not test::assert
Maybe I renamed it and just missed that one spot
00:57
How long should you wait between posting something in the sandbox and posting it as an actual question?
Atleast 24h
More if it has had a bunch of discussion
01:55
@cairdcoinheringaahing Looking at 05AB1E compared to more modern languages, it feels somewhat dated. Whereas Jelly is still competitive with modern languages, 05AB1E often lags a few bytes behind.
Ngl, looking at some of the more "post-Jelly" languages and their builtins, I find myself agreeing more and more with the old "oh, they have builtins for everything" mindset :P
And Ohm is kinda feature-incomplete - it looks like a substantial part of its SBCS is unused
Like, a recent challenge where I saw that Vyxal had a "is the string balanced?" builtin, and my first response was "okay, so that doesn't count"
tbf i feel like that's more so something jelly is especially bad at
Hmm, looking at older golfing languages they really don't seem to take advantage of overloading as much as newer languages do
01:59
@UnrelatedString reduce by split on () is the best way :/
damn
this whole time i've been doing some funky cumsum shit and even that's not much better
@cairdcoinheringaahing looks at 300 digraphs whatever do you mean? :p
@cairdcoinheringaahing The non-builtin way is 4 bytes: k(Ǒ¬ - !remove_until_no_change(str,"()")
That wasn't even utc midnight...
It only sent once
Huh, it's twice on my end
02:01
Chat just decides to make it look like you've sent the same thing twice
gtg, o/
Refresh the page and the dupe goes away
@emanresuA o/
02:11
I think Jelly is the perfect amount of built-ins to not feel overfitted while still being golfy
With Ash I went way overboard, and with a now long dead planned followup I tried not having diagraphs at all, and neither was that fun
@emanresuA I'm sorry, is remove_until_no_change(str,"()") 1 byte in Vyxal?
Looks like remove_until_no_change is
k. is a constant, so k( is probably "()"
@cairdcoinheringaahing k( is as rydwolf described, Ǒ is remove until no change, and ¬ is logical negation
Perfectly fine, ehhhhh, perfectly fine
"remove until no change" is one of those things that, to me, seems kinda maybe okay, but just borderline
It's the default and only behaviour of ReRegex :P
Well, replace until no change is.
New compression now does 15 bytes for 'Hello, World!' but works really well for longer strings with lots of repetition.
For small strings, worst case is strlen+2, which is as good as just storing it and a string length.
02:28
@cairdcoinheringaahing hey you can't talk. You're special cased too!
Yeah, but I'm special
The words coinhering and aahing appear on Wikipedia less than 3 times, so I had to manually add them to the frequency list of words
I'm flattered, but also, why? :P
so you can't claim jelly is superior by having your username compress to 8 bytes while vyxal would compress it as 14 bytes
:p
in fact, Vyxal is superior here because it compresses your username into 7 bytes
02:48
@cairdcoinheringaahing You're caird. Get it straight.
BRB adding a caird coinheringaahin g constant to all my languages.
the word caird somehow occurs on wikipedia roughly 940, while the rest of the words in the name occur less than 3 times
which is strange given the word liberaldemokratische apparently occurs 3 times on english wikipedia
 
2 hours later…
04:30
CMQ: What does the lerp of two lists return.
List is defined as a non-specific length array of elements which may either be lists or numbers.
The number of trailing items the two lists have in common
(I just totally made that up btw :p)
(since lerp is prel backward and I could see prel meaning "prefix of lists" so that backwards would be "suffix of lists")
That is certainly an interpretation
To clarify, by lerp I meant Linear Interpolate
04:49
treat them as vectors? (not worrying about if the lengths don't match)
and do so recursively i guess
05:47
da hell is linear interpolate
Interpolate = Smooth transitions from A to B, linear = the transition you choose is just a line
06:02
isn't lerp a function of three values?
like, lerp(A, B, t) = A(1-t) + Bt
@Bubbler that kinda look like a parametric lol
@ATaco ^^
lerp(A, B, t) = A*(1-t) + B*t
whats t
Oh NVM that's the same as you said
06:08
Time
(or whatever you're using for your x-axis)
@user time?
If t is 0 the output is A, if it's 1 it's B, otherwise it will output something in between porportional to T
If this is a animation t will be time
@AidenChow Not necessarily time, just think of it as x
what the.... thats confusing
It's the interpolation factor
If t=0.5, it will output the midpoint between A and B
06:10
You pass through point A at time 0, and point B at time 1, moving at constant speed and direction
A and B are two y values, you want to pretend there's a line between them and then find out where on the line you would be at t=whatever
@mousetail wtf idk what u mean by that...
Then your location at time t is lerp(A, B, t)
t will be rescaled so the animation starts at t=0 and ends at t=1
so its not a math thing but for animation right?
06:11
it is animation and it is also a math thing
it's not just for animation, it's a general purpose thing
that's exactly what interpolation is
Like if you have data from a sensor at two points and want to try to form a line from that
how r u gonna apply this to anything other than animation.... maybe physics??
06:13
It's easiest to visualize when used for animation but can be used for many other things
For example, it's used for scaling up images
not much in math that uses time... except for applciations in physics and stuff
(Though it's pretty terrible at that, cubic interpolation is better)
It's not just for time
ok but i thought t is the time??
No it's the interpolation factor, often time but not always
06:14
this is actually just too big brain for me lol
Think of it as time, but know it doesn't have to be
"t is time" is just one possible interpretation, for easier explanation
then what is t....
if t is not time then only thing i can think of parametrics?????
T is how much the output should be like point B
It can be anythign depending on the context
06:15
@user ok wat
It's like taking the equation y = x^2 and asking "what is x?"
@mousetail and what is that supposed to mean, what do a and b represent
Literally anything depending on the context
wtf
it can be used in anything yet idk what it is lmfao
If T=0, output is A, if T=0.5, midway between A and B, and if T=1, the output will be equal to B. And for any other value it will be that proportion of the way between A and B.

That's all there is to it. It can be used for any situation where you need some point or value in between two other values
06:16
I'll bet no one among us have really used lerp function in a context
@mousetail but wats a and b
and why do we need t
A and B can be numbers or vectors, among many other things
so it can be anything???
Just consider numbers for now, to make it easier to think about
idek what to think about this lerp thing lol
hella weird
seems widely applicable based on what yall r talking about... but seems super complex at the same time
06:18
@AidenChow the answer is, you don't need to think about it until you have to apply it somewhere
For example, suppose you want to animate a circle moving from the left edge of the screen to the midpoint. You set A to be the left edge of the screen and B to be the middle. When drawing a frame, you know the time T. You use T to calculate where the circle needs to be at that time, then draw the circle there
And the circle will follow a straight line
so it is an animation thing???
wtfffff
It's one use
You have to understand it's a incredible generic concept that can be used pretty much anywhere
ok well it seems too complex for me...
like what is A*(1-t) + B*t ?????? and given a and b, how do u solve for t anyways
Ok suppose you have a image you want to scale up. You have a red pixel and a blue pixel next to eachother, but now you need 5 pixels in between. You can lerp red and blue at t=0, 0.2, 0.4, 0.6, 0.8, and 1.0 to calculate the color values of the new pixels in between
06:20
so weird
You don't solve for t, t is input
oh t is input and a and b are output???
then how u solve for a and b?
No, there are 3 inputs
no, a, b, t are input and lerp(a,b,t) is the output
06:21
what now
it's just a very simple arithmetic function
lambda a, b, t: a*(1-t)+b*t in python
@Bubbler not so simple to me... i have no idea what yall r talking about lol
It's just a function you can use if you want something in between 2 known values
@mousetail ok that just flew over my head, i read it and did not understand it at all
06:23
Let me draw a diagram
why u need .2 .4 .6 .8 1
is that the position of the pixels?
Since there are 5 pixels where there used to be 2
ok so its the pos of the 5 new pixels right
So you need one at every 1/5 interval of the original
Yes
so how da hell does the position of the pixels be used to get the colors
06:25
So for the pixel at 0.2, the color will be A*(1-0.2)+B*0.2
da hell.... i thought t was time
So if the pixel to the left was 0.3 and to the right was 0.9, the pixel at that point should have color 0.3*(0.8)+0.9*0.2
No it doesn't have to be time, it's just how much of B you want in the output
0.3 and .9 of what??
Consider them as greyscale colors, 0 being black and 1 being white
lerp(#000000, #FFFFFF, 0.5) = #808080
06:27
So the color at that pixel value would be 0.42, which is exactly 1/5th of the way between 0.3 and 0.9
@Bubbler how u even get this... those arent even number lol
Those are colors
ff = 255
in hex
@mousetail so as time increase does it become darker or lighter???
As you go left to right you get more like the pixel on the right
what if it goes past 1 second... what would happen
06:29
There is no time
This is like all sorts of ways to use lerp in a game
@AidenChow You can do that, it will extrapolate and start subtracting A from B to continue the line
But generally it's not used for that purpose
extrapolate?? theres a interpolate but now theres a extrapolate?? whats that called, lerp 2.0??
when 0 < t < 1, it's called interpolate. when t < 0 or t > 1, it's extrapolate
Interpolate = find a value between known values. Extrapolate = find a value outside known values
^^
The forumula is the same
It's literally the same function just used for a different purpose
06:32
@mousetail how do u know what t is... how is it only known inside 0 1 but outside its not known??
so if u somehow know t is in 0 1, how u find t?
I believe you can visualize t as a slider in geogebra rather than time.
why they use t.. this is confusing my brain with my previous notions of what t is
i thought t was time in physics and t is parametric in math... this seem like a totally different thing.... idek what it is
It can be basically anything
@mathscat so u slide the t to different value to find a and b numerically??
@mousetail so it doesnt even need to be number??
how do the between 0 1 condition apply for non number t?
@AidenChow Not to find A and B, but to calculate the output.
06:36
I made a desmos file do demonstrate: desmos.com/calculator/0v1b3oxb3b
@mathscat a and b is the output??
a, b, t are three inputs, and the output is somewhere between a and b (when t is between 0 and 1)
and yes, it is a kind of parametric
@mousetail wow that is a lot of variables... i dont really understand what is going on here
So A and B are points
You can set their X and Y
You see right?
so the red point can be used to find the purple and green point??
moving the red point seem to move one of the other points too... interesting
06:38
No, the red will be drawn on the line from A to B
How far along the line depends on T
@AidenChow no, red and green points are inputs, and t is another input, and the output is the location of purple point
@Bubbler ah ok so the purple point is depend on the red and the green?
As you can see, since t=0.3, the red point is 0.3 of the way between the green and blue point
wheres the bluep oint
06:39
the exercise is to move red and green points to some fixed location you like, and slide t to see how the purple point moves
Purple point
Here I added labels: desmos.com/calculator/i9gsdlkhs1
@Bubbler so the t affect how far purple is from green?
yes.
No, just change t and see
and the red determine the direction?
06:42
No, red is the ouput
it doesn't determine anything
oh so the color changed in the second version lol
wtfffff im so confused lol
i thinking bubbler saying purple is output lol
Sorry I think the colors are different on different versions
that makes things a bit confusing
The point that moves when you slide T is the output
4 mins ago, by mousetail
Here I added labels: https://www.desmos.com/calculator/i9gsdlkhs1
06:45
@Bubbler so the purple is output from a, then b choose which direction for purple to go to??
i mean red lol
not purple
I don't know what colors you are seeing so I don't know
@AidenChow yeah you can interpret it that way too
@Bubbler ok but then how u interpret t in that case?? the distance between red and a??
seems like it
t increase and red go further from a
kinda yes. more precisely it's (distance to red)/(distance to b)
06:48
this seems like smth specific to animation i dont see how any of this can be apply anywhere else...
it look like just moving dot in a straight line, pretty cool animation
@Bubbler isnt b the purple one
another interpretation is a weighted average
@AidenChow fixed
@Bubbler from origin right
Now time to explain quadratic interpolation (/s)
@AidenChow yes
@mousetail please no, at least not right now lol
ok now how da hell they come about this A*(1-t) + B*t
if t = distance to red/distance to b from origin
06:52
@AidenChow it's the same as A + (B-A)*t
wait how u even define this for non number t
@AidenChow you don't
distance dont apply to non number stuff right...
@Bubbler oh, then wat metric u use then?
t is always a number, A and B can be anything
waaaaat... didnt someone say that t can be anything
alsoo how u take distance to b if b is non number
06:54
Well it needs to be something for which distance makes sense though, like a color or a quaternion
quaternion, wats that
A and B can be a collection of numbers
like, in the earlier desmos example, A and B were (x,y) pairs
ok so they have to be number??? they cant be anything??
and in that case, you apply the same function to each component
@Bubbler yea i dont see how that helps explain it..
06:56
@AidenChow A rotation in 3d
@mousetail oh, like a matrix?
@Bubbler can they be anything else??
not that I know of
Yes, you can convert a quaternion to a matrix and vice versa, though a quaternion can't store shear or position
didnt someone say here that a and b and t can be anything..
like, colors are (r,g,b) triples, 3d locations are (x,y,z) triples, etc.
06:57
@mousetail i dont even have an idea of what a quaternion could be
like whats that
forget quaternion
It's like a complex number but with 4 numbers
what, they be making more types of imaginary numbers or what
There's also octurnions with 8 numbers, 1 real and 7 imaginary
@Bubbler why, seem like relevant to lerp
06:58
@AidenChow exactly, and it's kinda useful in computer graphics, but you don't need to understand it right now
@AidenChow It's not really
wat
say wat now
They use a different formula to calculate LERP to it would just add the the confusion
quaternion cant be use in lerp??
Yes they can
06:59
@mousetail oh
the cost of learning through random chat instead of proper education

« first day (4421 days earlier)      last day (720 days later) »