« first day (2087 days earlier)      last day (3053 days later) » 

20:00
I'd love to see self driving bicycles
just keep a constant speed, and voila!
@flawr I'd love to see self-walking dogs
@muddyfish Just unleash them.
Dogs can very well care for themselves.
Hmm, Tesla's Model 3s start at 35,000 USD...that's only about 35 times as much as I have in my bank account...
20:03
0
A: Sandbox for Proposed Challenges

CopperConvert Birkana to Hexademical code-golf ascii-art string number hexadecimal Introduction Birkana is a not-very-well-known notation for hexadecimal using rune-like symbols. The general structure of a Birkana rune is like this: |\ <-- 0x1 |/ <-- 0x2 |\ <-- 0x4 |/ <-- 0x8 The ...

@trichoplax I already thought noone would get the reference=)
@trichoplax Hey, I remember seeing that...
I only heard about it yesterday, linked on from an article about self driving cars in the UK
^^ same
20:04
I think someone linked it back in april.
I definitely saw it at the beginning of April.
hell it was on our news ;_;
just google's video+commentary, nothing fancy
20:15
Do people have a strong preference between "Dog fido" / "Double x" or "fido : Dog" / "x : Double" for declarations?
the first
I like both.
also first
@flawr ;____;
@PhiNotPi latter assuming whitespace around : is free
@Downgoat Whitespace won't be required there.
> ??? idk what pytek functions are like
Hahaha. They're like this: func:foo[opts](args){code} for defining, and \foo[opts](args) for calling.
@El'endiaStarman Yeah I'm too lazy to go through so much chat logs ;_;
> Definitely not Python’s whitespace sensitivity
Q_Q
@ASCII-only :O spooky avatar is spooky
btw join us in VSL room?
@Downgoat Link?
20:37
@flawr why
@Dennis Hmm I don’t know Pyth all too well
Currently I have &Q+^.jZ1s+1.5ycPQ.n0
which is 20 bytes, like Jelly
> On due date, show the green with the green check marks on the screen in class, to be graded.
what is a green .___.
i being .jZ1 sorta sucks
@Lynn .j default is Z1
.j)
I don’t know how to use default arguments— oh!
20:40
wait what the hell its not working
TypeError: Pcomplex() missing 1 required positional argument: 'a'
Oooops
@isaacg ^
yeah its a bug
@MartinEnder The accident report stated that the cargo was badly secured, but that alone should have been recoverable. The crucial part that failed was a hinge on the elevators as far as I understand.
OK I have 19 yaaay
20:47
congrats=)
CMC: Given two int values, a and b, return true if either one is 6; or if their sum or difference is 6.
0
Q: Find the polynomial for a set of roots

orlpGiven a set of roots, find the simplest polynomial (in the number of terms) that has those roots, where the first coefficient is always 1. For example: Roots: x = 3, x = -2, x = 5. (x - 3)(x + 2)(x - 5) = 0 x^3 - 6x^2 - x + 30 = 0 You may assume that the roots are unique. You may give the answ...

@Downgoat absolute difference?
i.e. |a-b|, or a-b?
20:50
lambda a,b:6 in[a,b,a-b,b-a,a+b] or lambda a,b:6 in[a,b,a-b,a+b] depending on the answer to Conor’s question
so f(0, 6) would be a difference of -6, but absolute difference of 6
@ConorO'Brien how is relevant?
*votes to close as unclear*
(kidding, kidding)
I just need golfing halp on HW:
a == 6 || b == 6 || a + b == 6 || Math.abs(a - b) == 6
:|
20:51
Pytek link?
so, absolute difference

 Pytek

Discussion for this in-development language
J, 16 bytes: [:>./6=+/,|@-/,]
...*why* does this have to come up just as I'm leaving for work?! :P
20:53
CMC: Given a non-negative number "num", return true if num is within 2 of a multiple of 10.
@Downgoat (num+3)%10<6
It’s ,;+;a6e in Jelly, 7 bytes and all ASCII :3
Java HW makes good code-golf challenges :P
,         Pair inputs
 ;+       Append sum
   ;a     Append absolute diff
     6e   Is 6 an element of this list?
@ASCII-only doesn't that give that 7 is two from a multiple?
 0 1
 1 1
 2 1
 3 0
 4 0
 5 0
 6 0
 7 1
 8 1
 9 1
10 1
20:56
Oh no (num+2)%10<5
J, 8 bytes: 5>10|+&2 (stole from ^)
CMC: Golf tea >= 5 && candy >= 5 ? tea >= candy * 2 || candy >= tea * 2 ? 2 : 1 : 0
bruh if this is hw you should try doing it yourself
hahaha
;_; but golf
ok, yeah
20:57
@Downgoat ̤5‹ in osabie
CMC: given numbers m, k, n, output whether or not n is k away from a multiple of m
Can be negative?
@Lynn That's what I get for opening my big mouth. :P
is there a proper mathematical term for max(c.real, c.imag)?
Instead of dividing by pi, could you maybe use e^ipi...?
21:00
Aw hehe
@betseg all positive
@orlp Infinity-Norm if you consider it as a real vector.
@orlp With absolute values, you have the Chebyshev norm.
semi ninja'd
this is for a follow-up challenge on Martin's latest challenge
(m,k,n)=>!(n%m-k||n%m-m+k)
21:03
Ah ninja'd had just about the same thing in my mind
btw I tried you guys
max(c.real, c.imag)
should be
max(abs(c.real), abs(c.imag))
What does c do then?
TIL github has ><> syntax highlighting.
@flawr c is just a complex value
or a point
@ConorO'Brien O_o seriously?
wow
21:09
@Downgoat yup‌​.
I don't think it has seriously syntax highlighting :p
can you guys test this?
see whether this works?
@orlp I just see a signing in page.
really?
well that's lame
>Error

We're sorry! An error occurred while you were using GeoGebra. Please try again later and let us know if your problem persists. One of the following things has gone wrong:

You tried to access something which has been deleted from GeoGebra. Try using the search field above to find the material you are looking for.
You do not have access to the page you requested, some pages are only available for moderators or administrators. Please sign in and try to access this page again.
Sorry, there is a problem with this web address. Please go to this page in your web browser and copy the addre
@orlp i signed in and then clicked you link again ^
oh
@ConorO'Brien +1 cool
@orlp why don't you make a converntional gg file
@flawr I wanted people to be able to interactively see the Chebyshev norm without having to install anything
I had hoped the geogebra webapp let me do that
Or export as html and put it on a webserver
it doesn't have an 'export as html' option
and I don't feel like manually saving the page n stuff
21:14
@flawr about the answer you gave me about tensors earlier, by giving an angle, do you mean that the dot product is equivalent to the angle?
geogebra has such an amazing opportunity with a webapp like this
to give people the ability to creater interactive little demos
@Maltysen yes, up to a some constants/functiosn
possibly embedding them into blog posts and stuff
but forcing logins
and not even making sharing work
is just sad...
Surely there's such a thing. euclidthegame.com runs on GeoGebra, doesn’t it?
or maybe
I did something wrong
can you guys try that?
21:16
That works. ^v^
@Lynn pretty sure that's some heavy custom shit
@Lynn without logging in?
Yep
I think it's funny when my method names, despite being accurate, sound like they do something totally different. Any guess what autocompleteTyping() does?
@PhiNotPi typing as in Float/Double perhaps?
21:23
@PhiNotPi completes text with a trie? :P
@PhiNotPi Pulls the keyboard away from the user.
Something type system related?
@PhiNotPi Makes a plane crash?
It determines the fully-qualified type of a variable, from a "partially-qualified"(?, meaning context-sensitive) type.
@Lynn @Maltysen Fixed the .j bug
21:25
It might also make a plane crash.
*thumbs up*
@isaacg cool
Many people would call this activity "deduce type"
or "infer type"
those are less confusing though
The one you used isn't exactly accurate. How is this "typing"?
21:32
@ConorO'Brien the fishlanguage.com interpreter is pretty shoddy. You could link to TIO (although that doesn't have the debugging features of course).
wait, he owns fishlanguage.com? (Edit: nvm I was confused)
@MartinEnder are you ok
with me making a follow-up challenge on your chebyshev challenge
but with real numbers and arbitrary distance
Woo, I got another gold badge and I have 150 Youtube subscribers <3
2
Sorry, just wanted to brag :3
By the way
I propose a new coordinate system
instead of polar coordinates
we have Chebyshev coordinates
@orlp I am, thanks for asking
21:38
where a chebyshev coordinate is a 2-tuple (r, s), where r is the radius of a square centered on the origin, and s is a real number between 0-1 that increases linearly counter-clockwise along the perimeter of that square
@orlp sure, although I'm not sure the complex number solutions will need a lot of modification
@orlp haha cool
and s=0 is always on the positive x axis
@MartinEnder yeah. the main purpose I linked to fishlanguage.com is for the debugging features.
I assume the goal is to be awkward to calculate with. I don't think this goes far enough.
I think for each radius, there should be a differently shaped path.
Like r = 2.7 is a square
r = 2.735 is an octagon
r = 3 is a figure eight
21:41
I mean
@orlp you could do spherical coordinates and stuff with that too
as long as your curve definition is continuous over the plane
if you understand what I mean by that
Nah, that's the beauty of it.
The curve is totally different all the time.
well yes
So there are many ways to refer to each point.
21:41
oh
It is possible for the radius to equal the norm used?
I was going for a different beauty
where even though the shape of the curve changes over time
each point still has a unique representation
How can it every be unique?
@feersum ok
Since you can go around the curve more than once
21:43
no
I guess you could use arctan or something.
s is [0, 1)
where 0 = on positive x axis
and so is 1?
but 1 is not valid
[0, 1)
so that s becomes your parameter for the curve?
21:43
yes
it increases linearly along the perimeter of the curve, counterclockwise
so parametrized by arc length/arc length over entire thing
but as an example
let's say for r going from 0 to 10
@PhiNotPi I like this idea.
we have squares
then when r=10 we change how the curve changes
@orlp You could make the challenge to rotate a shape, rather than just a point
21:45
from r to 10 to 20 we start stretching the curve
So all the points it is made up of need to move
@trichoplax maybe as a follow up to this one
from a square to a diamond
@orlp having trouble visualizing this, will the curves cover all of space?
@Maltysen yes
It's funny how the 1-norm and infinity norm both make squares.
21:46
maybe I can give a visualization
actually
I have a formal definition
choose an angle alpha arbitrarily
which is the angle you look at from the origin
what is the infinity norm
if the distance from the origin to the curve from that angle is non-decreasing and approaches infinity as r approaches infinity
then the curve as a parameter of r covers the plane
p = (x^p+y^p)^(1/p) is it possible to solve for p here? x and y represent the cartesian coordinates of the point, while p is both the norm and distance.
Are you looking for integer solutions? Then no nontrivial solutions for p>=3 thanks to fermat and wiles.
no, those are real numbers
21:51
I assume p is positive?
yes (actually, let's assume everything is positive)
@PhiNotPi is this the p-norm?
yes (I think)
I don't think you can explicitly solve it, but as you're working with real numbers, and I assume you're working with finite precision, you can do it numerically.
that's an example
mess with slider b
right now the solution isn't unique for the corners
(ABCD)
but that can be fixed
do you see what I mean that the curve can change over time?
as long as the distance to the curve for any angle alpha is strictly increasing as r increases
the solution is unique and covers the plane
21:57
I see its continuous
that's the beauty I went for
you can make an incredibly complex coordinate system
that still has a unique representation for any point
Are the corners that appear to stay still during the transition from square to diamond actually moving very slightly to make the radius strictly increasing?
4 mins ago, by orlp
right now the solution isn't unique for the corners
Oops - I missed that bit :)
@trichoplax you can do that
22:01
I guess you could make their movement arbitrarily close to zero and still maintain the property
look in the top left
for the definition of c
and change that to
c=If[b<1,b,1+((b-1)/(10))]
as an example
this is all a proof of concept of course
but as long as for any angle alpha the distance of the origin to the curve at arbitrary r is strictly increasing, the coordinate system has a unique representation for any point
@orlp and s would go from [0,1) linearly with respect to arc length?
@Maltysen I wouldn't call it arc length
since that's specific to circles
@orlp no?
it isn't?
22:04
maybe differing terms cuz you're in a differnt country
in that case, yes
s=0 is the point on the x axis
Determining the length of an irregular arc segment is also called rectification of a curve. Historically, many methods were used for specific curves. The advent of infinitesimal calculus led to a general formula that provides closed-form solutions in some cases. == General approach == A curve in the plane can be approximated by connecting a finite number of points on the curve using line segments to create a polygonal path. Since it is straightforward to calculate the length of each linear segment (using the Pythagorean theorem in Euclidean space, for example), the total length of the ap...
and then goes up to but not including 1 along the curve
It could either be linearly with angle or with line length, but using "arc" could lead to confusion over which is being used
@trichoplax I guess in US its standard called integral of |v|
22:05
@trichoplax I want linear with line length
because then it makes rotation interesting
@orlp yeah that's what arc length does
@Maltysen Sounds like your usage is entirely correct. I guess it would be worth including an explanation in the challenge as "arc" is firmly connected with circle arcs for many (me...)
@trichoplax I guess line length is probably a better name. we still call integrals with respect to arc length, line integrals
I wonder if this rotation applied to avatars would be useful for halloween?
Hey, I heard some companies are requiring three-factor authentication now
22:19
@noɥʇʎPʎzɐɹC How's that work?
password, phone call, and come-to-your-house-and-ask-you
2
That's nothing. I know a guy whose workplace requires 14-factor authentication just to give the time of day.
@flawr are you on LSD, hm?
@EᴀsᴛᴇʀʟʏIʀᴋ Speaking for myself, but I'm always on LSD.
that's irrelevant
22:26
@EᴀsᴛᴇʀʟʏIʀᴋ nope, but this guy is:
WTF MURICA
Really though, two-factor authentication is enough as long as they're both large primes.
def cheb_to_p(r, s):
    assert 0 <= s < 1

    s %= 1/8
    s *= 8 * r
    if s < 1/8:
        return (r, s)
    elif s < 2/8:
        return (r-s, r)
    elif s < 3/8:
        return (-s, r)
    elif s < 4/8:
        return (-r, r-s)
    elif s < 5/8:
        return (-r, -s)
    elif s < 6/8:
        return (-r+s, -r)
    elif s < 7/8:
        return (s, -r)
    else:
        return (r, -r+s)
is there a better way to do this?
@flawr this is awesome
@orlp yes, a dictionary
oh it's bugged anyway
because I changed s
22:29
@flawr oh, you must be one of those lizards that secretes lsd from their skin.
@flawr i have to say wtf also
def cheb_to_p(r, s):
    assert 0 <= s < 1

    sr = (s % (1/8)) * 8 * r
    return {0: (r, sr)
            1: (r-sr, r)
            2: (-sr, r)
            3: (-r, r-sr)
            4: (-r, -sr)
            5: (-r+sr, -r)
            6: (sr, -r)
            7: (r, -r+sr)}[int(8*s)]
wait
that doesn't need a dictionary
just an array
LOL
I heard dictionaries can look up faster than arrays in Python.
But only if you convert the keys to strings!
@feersum there's no way that's true if you also create the dictionary every time
For fairness, you have to create the array every time too!
yes
that's what I mean
but creating a dictionary
is quite a bit more expensive than creating an array
so if you have to do both everytime there's no way the dictionary is faster
22:37
you could define it outside the function
@Maltysen no
it depends on r/sr
oops
you could define coefficients statically though
xr = [1,1,0,-1,-1,-1,0,1]
yr = [0,1,1,1,0,-1,-1,-1]
xs = [0,-1,-1,0,0,1,1,0]
ys = [1,0,0,-1,-1,0,0,1]
def cheb_to_p(r, s):
    assert 0 <= s < 1
    sr = (s % (1/8)) * 8 * r
    i = int(8*s)
    return (xr[i]*r+xs[i]*sr, yr[i]*r+yr[i]*sr)
something like that
pls halp java is doing a weird
  Polygon middle = new Polygon(
    { 2, 2.5, 2, 1.5 },
    { 1.5, 2, 2.5, 2 },
    4
  );
@Downgoat new double[]{ ... }
22:51
@Lynn In this answer you use Pyth's .R, which transforms -0.5 into 0. This is unlike Python's (and Matlab's) round, which according to the documentation would give -1. Are they different functions then? Do you know if there's a function in Python that corresponds to Pyth's .R?
floor(x + 0.5) ?
Does Windows (or really anything other than Linux) have setcontext/makecontext/swapcontext?
@LuisMendo Then that's truncate (Math.trunc in JS)
what do they do?
@feersum The function could be defined along those lines. What I find surprising is that Pyth uses a round function different than Python's homonymous function
22:55
@LuisMendo int() should do it
@ConorO'Brien Saves the current scope/state so that it can be jumped back to. I need it to transpile Pytek generators to C
@quartata I don't think so... lemme check
Although... I think I could actually use setjmp instead perhaps
That's supported a little better
There's a thing called "fibers" that lets you make new stacks and switch between them.
(and is also significantly simpler)
22:56
Using it would be a horrible idea though.
@feersum That's Windows only though right?
@quartata That's what you asked for.
Right, but do other POSIX systems have ucontext?
chat mini challenge
@ASCII-only int(-.6) in Python gives 0, whereas .RQZ in Pyth for input -0.6 gives -1
22:59
given x, y as real coordinates in the plane, return a number [0, 8) that indicates the octant that point is in
you don't have to have a particular order
just each octant must have a unique value
Oh lightbulb
Oh my bad
@orlp Is that purposely related to Martin's challenge? (It seems to be similar)
@LuisMendo math.ceil?
@LuisMendo yes
23:00
I think I can do this with some really hideous long jumps
Windows has setjmp right
0
A: Sandbox for Proposed Challenges

flawrChebyshev Rotation code-golf Given a number n, all the points on the plane with integer coordinates with Chebyshev-distance less or equal to n. Within this set, the Chebyshev-Rotation (as defined in this challenge) moves each point counterclockwise to the next point along it's contour line of t...

@ASCII-only Nope, that won't do it either. Pyth's .R doesn't seem to be like any of the (to me) standard floow, ceil, fix, round
I guess I should ask isaacg in Pyth's room
Why don't you look in the code?
Wait what am I saying, nvm
int(x + .5) would be typical golfing language implementation quality
23:02
@feersum Good idea. I don't know Python, but it has a name for being readable...
I thought setjmp/longjmp only let you move upward on the stack.
Like throwing an exception.
@LuisMendo .R is Python's round function
With 2 arguments
s is floor
.E is ceil
Wait, I'm stupid.
Ugh, who would have thought this would be such a pain
@isaacg In Python (2.7) round(-.5,0) gives me -1. In Pyth I get 0 Total newbie in both :-)
quadrant = int((degrees(atan2(y, x)) % 360) / 45)
that works
but is kinda complex
I wonder if there is a bunch of simple comparisons you can add together
23:07
round(-.5, 0)
-0.0
Python3
Pyth is written in and uses python 3
    int operator[](int index) {
      while (results.size() <= index) {
        result = setjmp(me);

        if (result == 0) {
          longjmp(*generator);
        }

        results.push_back(result);
      }

      return results[index];
    }
This totally makes sense and is very readable code
@isaacg Thanks. So round changed from 2.7 to 3.0? That's weird
Pretty much everything changed from 2.7 to 3.
> Then, everything changed when the Fire Nation attacked.
4
Thank you all for clarifying the issue
@Lynn Clarified now. It changed from Python 2.7 to 3
23:18
@El'endiaStarman s/Fire Nation/number 3/
Still waiting for Valve to attack with the number 3...
I'm pretty sure HL 3 is coming soon
23:50
CMC: round to closest halve, preferring upwards. 3 => 3, 3.4 => 3.5, 3.75 => 4
@ConorO'Brien eYo2/

« first day (2087 days earlier)      last day (3053 days later) »