« first day (2685 days earlier)      last day (2150 days later) » 
00:00 - 15:0015:00 - 00:00

12:00 AM
@Zacharý more than the value?
 
As in A+A←2 (with A hardcoded as 1 beforehand) gave 3.
I also just realized I've been importing a file from within that file >_<
 
12:14 AM
@Zacharý is this not supposed to happen
 
@ASCII-only No, it is not. RAD is RTL, so A+A←2 is A+(A←2)
 
@Zacharý ah. A=2 is evaluated first
 
Yep
 
@Zacharý how does the set help
 
It allows me to store the variables name w/o confusing it for a string
 
12:18 AM
@Zacharý ...
 
@ASCII-only Like I said, it's very hacky
 
clearly the way your interpreter works is just inferior
@Zacharý correction: it's nowhere near hacky enough...
 
I originally had an entire class for it, but the magic methods were too much
 
@Zacharý but you don't need an entire class for it?
 
That won't work with the way I set up my code.
 
12:27 AM
@Zacharý exactly. you're not doing things hackily enough >_>
 
It is so hard to debug something that disappears when you try to debug!
 
@Zacharý yes it is
:thinking: is doing that like a rite of initiation to PPCG
 
12:49 AM
@ASCII-only What?
 
@Zacharý debugging a Schrödinger's bug because if you haven't come across that then the things you've been doing haven't been hacky enough :P
 
@ASCII-only I remember hearing someone (not me) talk about a Schrödenbug before
It was Heisenbug, whoever said it before
 
1:13 AM
@Zacharý apparently a lot of people have said it before
 
@ASCII-only ?
 
Apparently I have a weird one. I think I know what's causing it (calling a function on a raw variable), but NO clue how to fix it
 
oops
 
@H.PWiz what?
 
1:25 AM
just being clumsy
 
CMP: Should strings in Proton be primitives (faster, probably easier for me) or represented as lists of numbers (slower, probably more memory-inefficient, probably harder for me, but follows the Proton structure of only numbers+lists being Python objects)?
I prefer just making it primitives because a) I'm lazy and b) I want this to actually work.
 
@HyperNeutrino That's pretty much most of the non-APL design in RAD.
 
@HyperNeutrino b pls.
 
1:36 AM
@ASCII-only You mistyped a
 
@ASCII-only hm?
 
@HyperNeutrino so it's not "slower, probably more memory-inefficient"
 
oh ok
 
I'm just going to push, and wait until tomorrow. A+A←3 works, but (A←2)+A doesn't (with A hardcoded as 1)
 
1:45 AM
@Zacharý ...
i don't even want to know how your code manages to do that >_>
:O :O :O
https://tio.run/##7T1rd9u4lZ/tX4EorS3KeliTbKeVbOfYsZLROY6cWnJnpnFGh5YomxuK1JKUH536y/6Gftxftz9kZ@@9eBDgQ5ITaybbbec0JgHcB4CL@wJAjWaz2tVo9Msvz11/5M3HDttzgygOHXt6sJmUTe2Z/hrF9uiTXnAZAFDDc@7cke0NR3YU169ns2yLeex6bnzfAAqufzUMnUl@O9u7CkI3vp6Klg1A6QxHgX8j20/GzoR93@0dn37f18C/d/1xcBvVr6GN44/dyebzuY9Ne@cnJ5vP4cn1HXb@fli@sxjRarXiYDifzZwQ8M/uoW/jVotTPShrLwBgaQgQXq99NC5rc7PRYIPT49MWu7Qjd8SgezCwfswmgTeGVqwcBWF4X2V@EDN6tBKQccC6DKbJ8@6Z7zhjFgdsHjnwfPuKAY9jFsxj5vosvsbCu5g5MzcKYIyCCRuH9lXgA1nPSzBO3DtoP3ZHTlRlTjSrI7RzNwuTJtG9H9t3zAnDIBS1m5u@PYXW9shhfz6ifvy8ubnh@PMpG3l2FLF@bMcOFG5s9E7P3h2eVOHpzXnv9aB72h
 
@ASCII-only What?
 
@Zacharý crappy QBasic interpreter actually partly works now
 
2:01 AM
@Zacharý reversed([deset0(i) for i in reversed(f)]) there's your problem...
 
@ASCII-only How is that my problem?
 
@Zacharý you evaluate all variables from right to left
unless i'm stupid
 
Nope, still gives 4.
I might just have to start over again tomorrow.
 
@Zacharý what did you change it to...
 
@ASCII-only The commented-out statements
 
2:08 AM
@Zacharý wait. it isn't supposed to give 4?
 
should be 3
 
@Zacharý that's even less correct though...
 
right to left is correct
 
@FrownyFrog hmm. then it should be correct
 
@ASCII-only If I get rid of the dset0 (which doesn't even actually call activate), Python freaks out
 
2:09 AM
idk
the parentheses confuse me
 
@FrownyFrog Adám suggested [} and {] for Monadic and Dyadic Ops >_<
 
@Zacharý ok. so what does deset even do
it doesn't handle operators right
also my laptop is stuck in alt lock. rip
 
Would anyone mind giving feedback on this?
0
A: Sandbox for Proposed Challenges

dylnanFind unique elements based on given key Input Take a list of values xi each paired with a key yi. [(x1, y1), (x2, y2), ...] Output Return a list of values from {xi} such that for each unique key k in {yi} there exists exactly one xi in the list that has key k. Details You can assume al...

 
@ASCII-only deset0 changes all {A} to the corresponding variable value.
 
@Zacharý ok. where is standardizefunction
 
2:13 AM
@ASCII-only RAD_Atoms
 
@Zacharý btw: UNKOWN ERROR XD
 
@ASCII-only Yeah, I'll leave those messages for errors that shouldn't happen
 
@Zacharý "UNKOWN"
 
J says nonce error
I assume it measn the same thing
 
@Zacharý I was close. deset2 is the problem... it does deset0(u) before deset0(v)... (unless args are already passed in reverse?) (this is the same with deset3)
 
2:16 AM
nonce = nonsense?
 
@ASCII-only I don't call any monadic ops, therefore that doesn't even get called.
 
@Zacharý >_> wait. 2 args = monadic?
@Zacharý also hmm. nvm then?
 
@ASCII-only Monadic Operators. APLspeak. + ¨ 1
 
¨ only sees the +
 
fair enough
 
2:19 AM
@FrownyFrog Which sees the 1. Hence, it's a curried function when represented in Python
 
@Zacharý ok. for (A←2)+A what functions are called
 
@ASCII-only deset0, deset1, StandardizeFunction, VectorizeMonadic, Add, Assign and activate (along with the parser/evaluator functions),
 
@Zacharý what part of the expression does deset0 handle
 
@ASCII-only It's called indirectly to change every occurrence of {'A'} to RAD_NS['A']
 
@Zacharý >_< i meant deset1
also :|
 
2:26 AM
@ASCII-only It returns a function-argument, but with dset0 called on the arguments.
 
	if "activate" in type(arg).__dict__:
		return arg.activate()
@Zacharý what is passed to deset1? (A←2)+?
 
No, just + (the function-value of +)
 
@Zacharý >_> oh yeah. so what is passed to deset1(+)
 
@ASCII-only (A←2) and A. (What I meant by + is lambda *args: StandardizeFunction(Conjugate, Add, *args))
 
@Zacharý i'm guessing it's called from here?
 
2:30 AM
Yes, and that deset0 is leftover from testing.
 
@Zacharý what if you remove that. still 4?
 
@ASCII-only Yup
 
@Zacharý ok. i'm aware that this is a heisenbug, but try dbging deset0's tuple result?
 
It's a Heisenbug because if I try to test it within the RAD code it reverts to 3. The Python code isn't really Heisenbug-y
NVM, forgot about arguments
 
@Zacharý ?
 
2:38 AM
@ASCII-only Forgot that *args gives a tuple for a sec
 
@Zacharý :|. ok what's the result
 
(2, 2)
That means that the left is getting evaluated before the right (Or () causes premature evaluation, but I have no way of testing between the two), but I've tried changing everything I think would cause that, and still I get 4
 
@Zacharý ok. now dbg the dset0 inside that. (well print(i) or dbg(deset0(i)))
@Zacharý what about the other one
 
I meant :
Whoops! Thefirst one is {'A'} 2, other one is 2 2
 
@Zacharý yeah. looks like that's your problem
 
2:46 AM
No clue how to fix it though
 
@Zacharý try doing (A←2)+A+A+A+A?
 
It gives 6, the correct response.
 
wait.
wat
 
@ASCII-only exactly.
 
@Zacharý (A←2)+A+A?
 
2:48 AM
@ASCII-only Already tested that one, gives 4 (correct as well)
 
@Zacharý :||||||||||||||||||||||||||||||||||||||||| oh wait
@Zacharý it evaluates A+A first. of course it's right
@Zacharý ok. now debug(*u) in deset1 maybe?
uh. debug(u)
 
But then it should evaluate the plain A
 (2, {'A'})
    4
And it's dbg,
 
@Zacharý hm?
 
@ASCII-only If it evaluates A+A first, it should evaluate just plain A first as well
 
@Zacharý no...
 
2:56 AM
@ASCII-only Why not
 
@Zacharý it's RTL. so (A←2)+A+A -> (A←2)+2 which is right...
but for (A←2)+A the right side isn't a number yet
 
I thought you meant evaluate as in get the value (dset0)
 
@Zacharý well. A + A isn't dset0'd
ok. now in RAD.py under NFN change res_V = S[1].value(S[0].value, deset0(S[2].value)) to res_V = print(S[0].value, S[2].value) or S[1].value(S[0].value, deset0(S[2].value))
 
4
 
hang on. what?
what is S[0].value and S[2].value
 
3:04 AM
the value of the left and right arguments
 
@Zacharý nonono i mean that are their values
 
CallObject<<function CodeObject.__init__.<locals>.<lambda> at 0x7f5ff929f158>, (CodeObject<A>, 2)>
CodeObject<A>
 
hmm. so it's not evaluated yet there
 
I THINK I FIXED IT
I don't know, but I think I did
 
@Zacharý HOW
 
3:18 AM
elif T == "NFN":
    	    	S2 = deset0(activate(S[2].value))
    	    	S0 = deset0(activate(S[0].value))
    	    	res_V = S[1].value(S0, S2)
    	    	res_S = Segment("N", S[0].code + " " + S[1].code + " " + S[2].code, res_V)
    	    	break_flag = True
 
:||||||||||||||||||||||||||||||||||||||||||||||||||||||||
hacky. but i guess it works
 
Give me a long expression using only +, -, A, (), and numbers that you think RAD will fumble on
 
@Zacharý well you fixed it >_>
 
Yeah, once I push this I'm done programming for the day, except maybe testing
 
@Zacharý maybe (A←2)+(A←3). or maybe (A←2)←3
 
3:24 AM
@ASCII-only It works :D.
D'ya see the commit message
 
@Zacharý :D (but i didn't actually do anything >_>)
 
I definitely wouldn't have found that. I was never really looking at RAD.py
 
@Zacharý well still it's not the source of the issue. we just found a place where it wasn't evaluated yet
 
@ASCII-only It works though!
Now, implementing dfns/dops is going to be a nightmare.
 
 
2 hours later…
6:09 AM
Anyone see any more microoptimizations for https://codegolf.stackexchange.com/a/163215/77964 ?
I'm flat out stumped now. Beginning to think it's at minimum size
 
@moonheart08 (do you know any opcode table or something that can be used to get the byte size of the comamnds?)
or something useful for codegolf in machine code?
 
I usually check manually. The byte size of commands is in the documentation, but it's highly variable, even the smallest things can add or remove bytes
 
Looks like just a "command list sorted by size" can make a good golfing tips.
 
6:55 AM
[
 
2
Q: Double, XOR and do it again

ArnauldWe define the function g as g(n) = n XOR (n * 2) for any integer n > 0. Given x > 0, find the smallest integer y > 0 such that gk(y) = x for some k > 0. Example x = 549 549 = 483 XOR (483 * 2) (as binary: 1000100101 = 111100011 XOR 1111000110) 483 = 161 XOR (161 * 2) (as binary: 1111...

 
 
2 hours later…
8:39 AM
Does anyone know what's the shortest way to have lambda function in Java (for example when you need recursion or to do the same thing in different positions)
 
@user202729 there's not shorter way though?
just use a normal function. in this case it's almost certainly shorter (than having to declare a class, and a signature, and a lambda)
 
Hm...
Fine.
 
8:56 AM
anyone here good with C++?
 
Yes.
 
if you pass, say, a map to a function, it don't be modified right oh. :|
 
(???)
 
what does type& name in arglist do
pass by reference?
 
Yes.
 
8:59 AM
ah
yay :D
https://tio.run/##7T3bdtvIkc/SV7TpjERQvEi2k0lIST6SSXl4jkw5opSZieXhgUhQwhoEuABoSZnoZb8hj/t1@ZCdraq@oBsAQcoSHe/ZZE4sotFVXV1dXbe@YDid1q6Gw99@e@76Q282ctiuG0Rx6NiT/fWkbGJP9ccotoef9ILLAIAannPrDm1vMLSjuH49nWZrzGLXc@O7BrTg@leD0Bnn17O9qyB04@uJqNkAlM5gGPifZf3xyBmzH7u99smPfQ38R9cfBTdR/RrqOP7IHa8/n/lYtXd@fLz@HH65vsPO3w/KtxajtprNOBjMplMnBPzTO@jbqNnkre6XtQcAsDQECK@/fTAua3290WBnJ@2TJru0I3fIoHvAWD9m48AbQS1WjoIwvKsyP4gZ/bQSkFHAugyGyfPumO84IxYHbBY58PvmNQMaRyyYxcz1WXyNhbcxc6ZuFACPgjEbhfZV4EOznpdgHLu3UH/kDp2oypxoWkdo53YaJlWiOz@2b5kThkEo3q6v@/YEattDh/35kPrx6/r6muPPJmzo2VHE@rEdO1C4ttY7OX13cFyFX0fnvTdn3ZPe
(that took too long to debug)
now time to figure out how to do rounding
 
Qbasic interpreter? ...
How can it be that imprecise? float?
 
@user202729 yeah.
QBasic uses standard float and double too, but idk how they round to an appropriate number of d.p.
 
Try std::setprecision.
 
wait i'm an idiot they only show a certain number of d.p.
@user202729 good idea
 
hello
is 05ab1e turing complete? and whats the proof?
 
9:09 AM
All golfing languages should be Turing-complete.
But proving it is often unnecessary.
 
there are no loops
and i could not see anything stating it being turing complete
 
@BoraCalim who said >_>
 
maybe i may have missed something
 
@BoraCalim of course? golfing languages are more high level than normal TC programming languages...
 
@BoraCalim I don't know 05ab1e, but it should have loops.
 
Otherwise it's going to be very very long in challenges involving loops.
 
ctrl+f, "loop"
 
> µ 44 = pop a while counter_variable != a, do...
 
so you are saying 05ab1e is turing complete and do not say why is it
 
8 occurrences
 
9:11 AM
> [ = infinite loop start
 
ok thanks
 
@BoraCalim in languages that are that high level you don't need a mathematical proof >_>
 
@BoraCalim Why would somebody cares whether a golf lang is TC? What you care is that they're competitive in most challenges people can think of.
@ASCII-only Fun fact: C is not proven to be TC.
 
@user202729 also, technically no implementation is TC, although I guess that's another thing entirely
 
@ASCII-only Language != implementation.
 
9:13 AM
@user202729 yeah. hence the part at the end
@user202729 wait. isn't a BF interpreter in C basically a proof
 
I'm saying the language C is not proven to be TC. Ofc all implementations are non TC.
@ASCII-only You can't write a conforming one...
(for example, you will eventually get NULL malloc)
 
@user202729 null malloc?
 
malloc returns null if there are no memory available.
 
@user202729 yes. but is that not part of the implementation not the language
 
malloc is a part of the spec...
The spec also specifies that pointers must have fixed size.
29
Q: Is C actually Turing-complete?

TLWI was trying to explain to someone that C is Turing-complete, and realized that I don't actually know if it is, indeed, technically Turing-complete. (C as in the abstract semantics, not as in an actual implementation.) The "obvious" answer (roughly: it can address an arbitrary amount of memory,...

 
9:18 AM
@user202729 then C cannot possibly be TC
(or not)
 
9:44 AM
You can write C without using pointers.
 
@feersum Even if you don't use pointers, (non-register) variables have an address.
Also you do need malloc (or infinite recursion) to allocate arbitrary memory.
 
@user202729 Wrong. They don't have to have an address unless you specifically take it.
Real machines cannot be Turing complete, obviously.
The abstract machine can.
 
Even then...
50 secs ago, by user202729
Also you do need malloc (or infinite recursion) to allocate arbitrary memory.
malloc uses pointers.
 
Recursion is the key.
 
Then?
> With unbounded recursion depth, and the restriction that a function can only get data from its direct caller (register arguments) and return data to its direct caller (the function return value), you get the power of deterministic pushdown automata.
Each recursion level can only access finite memory.
return is destructive.
 
9:48 AM
Huh, it's harder than I thought.
Surely there is some escape though...
 
10:01 AM
Actually I think the finite number of distinct pointers is not an issue at all.
IIRC it is undefined behavior to compare two pointers that are not part of the same array.
Although that might only be for "less" or "greater", and not equals...
 
But each array length can be at most size_t.
 
I wasn't thinking to use arrays.
It can allow data transfer between stack levels that are arbitrarily far apart.
I'm not sure that it would be TC though.
 
> All data can represented as an array of bytes
@feersum What "it"?
 
question: how to c++ setprecision
it appears to not be working
 
@user202729 Use of pointers.
 
@user202729 What are you quoting? I'm not finding that in the standard.
 
@user202729 ok. q1: does std::cout << std::defaultfloat; modify std::cout
 
Setting the precision is dangerous. If it goes too high, you might run out of RAM!
 
@ASCII-only Yes.
Actually...
it will only modify std::cout if initially std::cout is not defaultfloat.
 
Huh, apparently K&R say that == is undefined for pointers not in the same array, but the modern standard says it is defined.
 
10:07 AM
hmm. is defaultfloat default?
 
@ASCII-only Yes.
 
nvm i'm an idiot
 
Blame the iostream API, not yourself. It's just a bad design.
 
@feersum nah. that's fine. i was doing string + boost::lexical_cast(myfloat)
 
obviously I don't know what is boost
 
10:10 AM
Boost? Never mind, do blame yourself.
 
@feersum :|
ok. well I don't actually really need boost
@feersum hmm. is boost that bad
 
I don't know, but making fun of it is an entertaining meme.
I would imagine some parts are higher quality than others.
 
@feersum :|
ok. how do i get the cursor position on linux with c++
 
@ASCII-only Use... why do you need it?
 
@user202729 reasons
more specifically, padding to the weirdest 14-char columns
 
10:22 AM
@ASCII-only (of course if the cursor is currently at a position divisible by 14, you can just compute 14-<width>)
 
@user202729 how to read in C++ though
actually. @user202729 does this even work on TIO
 
Of course not, as TIO doesn't have a terminal.
 
11:29 AM
0
Q: Get duplicates from an array

AJFaradaySo, I have an array ['a', 42, 'b', 42, 'a'] I want to alert users to the fact that 42 and 'a' appear in it twice. some_function(['a', 42, 'b', 42, 'a']) should return ['a', 42] Write some code to extract the duplicates from an array. It should accept an array as input. The array can ...

 
 
1 hour later…
12:37 PM
:|
turns out it's harder than i first thought to try and figure out what chars are being printed to stdout
well actually
i can just set cout to some kind of stringstream can't i
but you can't reassign std::cout
:||||||| C++ isn't hacky enough
 
1:41 PM
CMP: How should I implement Proton objects? Either Python dict (better object structure) or Python objects (probably more efficient implementation).
 
2:15 PM
@ASCII-only If you have to do that something is wrong...
Some older possible-duplicate-targets: Non Unique Elements -- problem: allow snippet, which is normally not allowed; Removing unique elements from string -- problem: limit possible languages. — user202729 1 min ago
 
Opinions? Should we close as duplicate some of them?
@BoraCalim You can flag instead.
 
i flagged
 
Not sure how many track the queues, but DJ definitely.
Anyway...
 
-2
Q: how to prevent r studio from altering header title upon import

user9903833I want to import a CSV file into r but it takes the date column and creates a new column for it then renames the next column date and the column after that the name that should of been assigned to the second columns (see pictures). how do I prevent this from happening. I am very new to r. Here i...

 
2:18 PM
If I do give suggestions on how to improve the questions assume it's on Stack Overflow, OP will think that it needs to be improved and then it can be ontopic here, not good. If I don't, somebody else on Stack Overflow will and ...
 
2:38 PM
Any final recommendations before I post my latest CnR challenge?
 
Why is this MO question on HNQ?
8
A: Hexagonal maze time!

boboquackHexagony, 2437 bytes The long-awaited program is here: (.=$>({{{({}}{\>6'%={}{?4=$/./\_><./,{}}{<$<\?{&P'_("'"#<".>........_..\></</(\.|/<>}{0/'$.}_.....><>)<.$)).><$./$\))'"<$_.)><.>%'2{/_.>(/)|_>}{{}./..>#/|}.'/$|\})'%.<>{=\$_.\<$))<>(|\4?<.{.%.|/</{=....$/<>/...'..._.>'"'_/<}....({{>%'))}/.><...

 
@AdmBorkBork "2) [...] and write code that takes no input and outputs the code from the first half of the problem" so Python_code should output Jelly_code when run?
 
That's correct. Can I word that better?
 
"... and outputs (code) A"?
oh you do explain the example in the bottom
 
oh, the irony, when a question about duplication turns out to be a duplicate
 
2:44 PM
No, that's a lot more clear. Thanks for pointing that out.
 
also should the cop state the input/output format of their code A (and enforce robbers to follow the same rule)?
 
is there a low-tech way of determining whether a^b < c^d is true, given a,b,c,d positive integers of arbitrary size?
(floats are high-tech)
 
@LeakyNun Logarithm approximation...
Related: Somebody has a fastest-algorithm challenge to compare exponentiation tetration in the sandbox.
 
right, but log is definitely allowed there
the thing about log is that you're passing to the real numbers. real numbers don't have decidable equality, let alone decidable order, whereas a^b<c^d is obviously decidable
 
@LeakyNun But idk how to compute log* as float ...
@LeakyNun Can you assume that the numbers are "pretty far apart"?
 
2:49 PM
@user202729 not really :)
 
Then...
if the numbers are sufficiently near there is no way except to compute exact or approximate them to the required precision.
 
I don't believe you
computing the exact numbers is inefficient
i'm sure there's a faster way
 
@LeakyNun But if the numbers are near then you have to compute (near) exact anyway...
Of course if the numbers are far apart there are better ways.
 
1
Q: Find unique elements based on a given key

dylnanInput Take a list of values xi each paired with a key yi. [(x1, y1), (x2, y2), ...] Output Return a list L containing only values from the set {xi}. The length of L must be equal to the number of unique keys k in the set {yi}. For each unique key k there must be a value from {xi} that has...

 
So obviously they're equiv to compare b log a and d log c.
 
2:51 PM
@Cowsquack That's a good point. I think I'll leave that part more open, so that Robbers have a slightly easier time.
 
or log a / log c and d / b.
Hm...
 
6 mins ago, by Leaky Nun
the thing about log is that you're passing to the real numbers. real numbers don't have decidable equality, let alone decidable order, whereas a^b<c^d is obviously decidable
 
Seriously, I believe the best way is to (1) use log approximation (2) if they're sufficiently near check if they're equal (by taking the gcd of a and c etc.) (3) if they're not equal then compute full precision.
Do you have any test cases etc.?
 
I think the most useful think I've gotten from APL is the ability to type arrows easily. ↑↓←→
 
@user202729 not really
 
00:00 - 15:0015:00 - 00:00

« first day (2685 days earlier)      last day (2150 days later) »