« first day (2691 days earlier)      last day (2152 days later) » 
00:00 - 18:0018:00 - 23:00

12:22 AM
@LeakyNun Nice attempt
 
lol
 
But... it is not really reachable in general case. (can it?)
 
how do I know
I'll just optimize it as much as I can
I'm now at (0.4 n + 5.09) steps
 
each operation gives at most log2(n-3) bits of operation, and there are n bits.
What is n/log2(n-3)?
Huh?
 
what is it
 
12:24 AM
No, it cannot be sublinear. Can it?
I mean, try to do the reverse action
 
it's a regression, I do not care about what happens when n goes to infinity
 
(use the reverse operations to shuffle it)
 
I'm just doing regression on n from 100 to 1000
regression is not asymptotic analysis
 
Ok then
 
so basically it's possible that leaky's solution is really suboptimal for low n
 
12:26 AM
CMC Prove/disprove that the optimal solution can take sublinear number of operations in the worst case.
 
@user202729 ... it's linear time
 
@ASCII-only ?
Whoops.
There, fixed.
 
@user202729 still linear...
 
@ASCII-only Why?
@ASCII-only 'operation' here refers to the output.
 
yes...
but if it's of the form y=mx+c then it's still linear?
linear just means "in a straight line"...
 
12:29 AM
@ASCII-only But why?
 
O(n) is equivalent to O(0.5n)
 
@ASCII-only suboptimal meaning better than optimal or worse than optimal?
 
(1) Leaky's solution is not necessarily optimal,
 
@LeakyNun worse
 
oh wait you can't be better than optimal
 
12:29 AM
What...
4
 
@user202729 what does this have to do with anything >_>
@LeakyNun yeah :P
 
I meant "less than linear"
 
@user202729 but according to the regression analysis Leaky's solution is linear?
 
CMC Prove/disprove that the optimal solution can take o(N) number of operations in the worst case.
(o is not O)
 
It is taking o(n) operations though?
 
12:31 AM
@ASCII-only O(n) is not o(n).
Theta(n) is not o(n).
 
@user202729 doesn't mean most rules that apply to O just magically don't apply to o...
 
@ASCII-only >.<
Your turn: Explain what is o(N).
 
well actually
it's not taking o(n)
 
Hm
Right.
I disproved it myself.
 
or it is >_>
 
12:34 AM
It must take Omega(N).
 
(apparently o(n) is right)
since constant factor is important here wait
nvm
 
And that's why complexity analysis confuses the f**k out of me
 
Now that I proved it I challenge the resto to prove it. (that in the worst case it must take Omega(n))
 
and that's why I do regression, not complexity analysis
 
@user202729 but omega(n) is best case?
 
12:37 AM
The best case does not matter.
 
@LeakyNun I can deal if it's some code and certain operations are given O(1), I can deal with that.
 
(read again. Obviously sublinear = o(N))
 
O, why must these things even exist?!
 
@Zacharý ?
 
@user202729 (Counting the number of operations :P)
 
12:38 AM
I'm yalking about asymptoticnumber of operations in the output.
 
@user202729 no. apparently omega(n) means best case...
 
@ASCII-only I used big omega, not small omega.
 
@user202729 *Omega
doesn't change the fact that [Oo]mega is best case
 
@ASCII-only I still don't understand what's wrong.
 
@user202729 you still can't score my submission?
 
12:43 AM
@user202729 i mean, the problem might be Omega(n) but that probably doesn't mean what you think it means
 
Cant ise computer for a few days.
You see the typo, you know.
@ASCII-only What do you think I think it means?
(getting recursive)
 
@user202729 :| just because you're not at a computer doesn't mean typos are fine
@user202729 probably something other than O(n) but for best case instead of worst case
 
@ASCII-only Its not like that I intentipnally make typo...
@ASCII-only What... How is Omega related to best case?
 
@user202729 Omega is best case
 
Ok, link to Wikipwdia:
 
It's probably just conflicting notation
 
...
 
the conventional definition is probably the Knuth definition
because this is complexity theory after all
 
12:50 AM
I bever said "prove that it's Omega n"
Because it's trivially false.
 
17 mins ago, by user202729
It must take Omega(N).
 
I said "prove that in worst case it's Omega n".
@ASCII-only ...
 
... this topic seems ... complex.
 
@user202729 but Omega means best case?
@Zacharý it really isn't
 
maybe you guys can actually write a solution instead of arguing about complexity... doesn't feel good to be the only contestant
 
12:52 AM
@ASCII-only (I wanted to make the pun)
 
Problem with pronoun.
@LeakyNun I told youI don't have access to comp...
 
not you then
 
@LeakyNun well do i seem smart enough to get a solution under O(n!) >_> (okay, probably. but i probably wouldn't be able to get it o(n^3))
 
@ASCII-only yes
 
@ASCII-only I claim that it's wrong.
 
12:56 AM
@user202729 hmm?
but is that not the definition of Omega notation
 
We're going in circles. no?
 
First. You recall what does f(n) = Omega(g(n)) mean.
@Zacharý I blame ASCII.
 
Why blame an encoding?!
 
Ok, regardless of the exact definition.
Given an algo A, n->WorstCase(A,n) is a function.
n->n is also a function.
 
@user202729 doesn't WorstCase(A, n) mean A is O(n) so A should be O(WorstCase(A, n))
 
12:59 AM
@ASCII-only ?
Ah, Ididnt define it.
Let WorstCase(A,n) be the value of the worst case when A is eval on an inout with size n.
@ASCII-only Yes.
But that doesn't matter.
Note that
2 mins ago, by user202729
Given an algo A, n->WorstCase(A,n) is a function.
Now substitute f(n) with WorstCase(A,n) and g(n) with n in f(n) = Omega(g(n)).
 
@user202729 yes?
 
And that's whay my CMC ask you to prove.
Nothing related to best case.
 
Omega is best case though...
like how O is worse case
 
No.
Every algo is Omega(1).
 
yes?
 
1:03 AM
Doesn't imply that every algorithm has best case Theta(1).
The reverse is true.
 
same as how every algo is O(infinity)
@user202729 fair enough
@LeakyNun :| but i don't think many people can do number of operations < n
 
I also didn't think I could
 
@ASCII-only Who says ypu must beat somebody.Just try as best as you can.
30 mins ago, by user202729
Now that I proved it I challenge the resto to prove it. (that in the worst case it must take Omega(n))
Anyone else cn prove ^ ?
CMC Solve it in O(n^2) steps and polynomial time. Leaky already solved it on main so don't need to answer this.
Just an idea suffices,, implementation details does not matyer much.
@Adám So if I understood correctly ≠\ in a wprd is calculated in (popcount of the input) word steps?
 
what is it with asking main as cmc
 
@LeakyNun Main is 'as few as possible'. This is 'O(n^2)'.
 
1:11 AM
3 hours ago, by Adám
Anyway, gtg for the night ○/
 
still
 
@Zacharý That will generate an inbox notif anyway.
 
@user202729 ?
 
@user202729 Looks like it, one xor for each bit
 
I feel that
Well...
 
1:13 AM
*set bit
 
a^=a<<1;a^=a<<2;a^=a<<4;a^=a<<8;...
would be much faster.
That's only log of sum number of bits,
And the best known popcount alg use an alg similar to that anyway. (with a multiplication at the end)
Assume bits are little endian.
(a[0]=a&1, etc.)
 
@LeakyNun wait what
https://tio.run/##xVdLU9swED47v0I9MGPHNiPZFJoM4diTj71lPB03UcBDYntsZyi/nu5Dkp0mQGHaggeLXe3j208rWTSP/V1dpU/lrqnbXrRFta53EyNV@13z@LTWG9EUbV/22s@C@cTT1fq22GmxEMtZNItS@E3gwVFFEkYJkiRZgiaFh@clzSuax/csmniedKIkMzZJSOZAHIIflOyTjkNIF105FDbb8B5LNrgcUAzqU2P6229iEAGKfOLVm02neyBFTbyu102H/IAe6ds36wLZi2giKqs18shm50XTAKO@8Q8FzsJkuRFSXC9QFLAqOIapuBZbXfEyeF6r@31bCZ@jZss52ORhtiTTuflrTlKOIfW20@TYtGXVm4yIJsoCileUnZ5gZiWquoeUIkN7kwerebgrt9pgEDfiiqBJZ/mw@b6606t7qJ1tUEcu2VLm4tNCSAZQEz2xylGyXgnoYkUa8vnW7hmvV8IM@KBDSAbGojwkhFiDqnOxsJk4mSW5DIyuFCGtFP44Wqw@JaHoOg2bAMNDBKzW4WQEI9TWiCa6pljh7vAN4pgRhio
what does this even mean
 
interesting
ya I didn't really think about small cases
but ugh i'll fix it
 
@user202729 As far as I can tell dyalog uses the MSB of a word for the first bit in a vector. Also I'm not sure why you're bringing popcount into this, are you suggesting that the algorith they use would require it?
Actually you can just shift right instead of left, for a different bit order
@user202729 How does this work?
nvm, I figured it out. Pretty neat
 
1:42 AM
@ASCII-only fixed
 
:|
what
you improved the score
 
isn't really statistically significant
 
2:14 AM
@H.PWiz Ah...right. Computing popcnt is not very necessary.
 
Still, your method seems to me like it would be faster. although I am rather uninformed on the matter
 
@H.PWiz link
 
@ASCII-only I'm talking about the xor-reduce of a word
 
@H.PWiz xor-reduce?
ah
 
xor
 
2:25 AM
@H.PWiz sorry typo >_>
@H.PWiz yeah that would be faster
it's basically like the black magic of parallel reduce
except on bits
 
Context if you missed it
I really meant scan when I said reduce...
 
 
2 hours later…
4:42 AM
CMC: given a string, output the shortest possible printable-ascii sequence that doesn't appear in that string
they are multiple correct outputs for every input
 
5:23 AM
@user202729 No, one less step than the number of elements (along the trailing dimension). The first element of the result is always the unaltered first element (along the trailing axis) of the argument, and the function isn't called at all for that one. (Btw, to go along the leading axis, use .)
 
I have plans to make a Sequel of sorts to Funky.
Called Funkier.
It's going to be so wonderfully terrible.
 
@Adám That question was referring to the number of steps for a machine word. With popcount being the number of 1s
 
5:39 AM
Could a mod unfreeze the Brachylog room (chat.stackexchange.com/rooms/34284/brachylog)?
@Mego ^
 
@H.PWiz Oh, I didn't realise that. So it isn't my department. I generally have no clue what goes on below the surface…
@user202729 My misunderstanding of your question was corrected by @H.PWiz ^^^^ I suggest you leave questions on the blog page or email the author directly: marshall@ (domain should be obvious).
 
@ATaco Most people call those "updates"
 
Most updates don't change core features of the language.
Or rewrite the language in a different language
 
Well, any self-hosting compiler had to go through a port at one point
and Python 2 -> 3 was a pretty big change
While I don't know much about Perl, I hear v5 was a pretty big rewrite and changed quite a lot of things
 
Eh, Funky 2 doesn't feel right for it though.
 
6:04 AM
Then call the original Funky v1 and the new one Funky
that's what TIO does with Brachylog
(The language "Brachylog v1" has url tio.run/#brachylog, and "Brachylog" has url tio.run/#brachylog2)
 
 
1 hour later…
7:29 AM
@EsolangingFruit However, Seriously v2 is Actually.
 
7:51 AM
@ATaco I think that's what recently happened with Jelly, but it's still Jelly :)
 
@EriktheOutgolfer Were those changes not purely additive?
 
@Adám the code page was changed (so your answer over meta might need to do so as well...), there's now something called "aliases" (i.e. shorter versions of already-existing primitives, e.g. ) -> µ€), and there have been many atom and quick additions...btw, Dennis is in the process of de-aliazing Jelly to some degree :P
btw I'm not sure as to why ) is considered to be an alias, since it's actually a chain separator on its own (µ€ isn't one but two tokens)
 
@EriktheOutgolfer If the code page has changed, doesn't that mess up base-250 encoding?
 
@Adám ØJ has changed too
that, since ØJ is set to be the codepage variable and not a constant string
 
@EriktheOutgolfer Hehe, Jelly adopting ⎕AVU-like functionality.
 
7:57 AM
@Adám no
that's ØJO¤, not a built-in
and no, you can't assign anything to ØJO¤, because 1) it's not a variable 2) the only variable is the register
 
@EriktheOutgolfer ⎕AVU is not ⎕UCS ⎕AV. ⎕AV is ⎕UCS ⎕AVU, and ⎕AVU is a settable variable.
 
@Adám ninja ^^
 
8:19 AM
@EriktheOutgolfer Thank you for editing. Perfect timing, as I was just about to begin.
 
@Adám It should be 'actually v2 is seriously'?
 
@user202729 Oh, got them mixed up then, but the point stands.
 
@EriktheOutgolfer But they're equivalent? (except in string literal)
@Adám Why?
 
many built-ins can be implemented while not using them, that doesn't make them "aliases", does it?
 
0
A: Sandbox for Proposed Challenges

Kevin CruijssenIndexing Cha-Cha Slide code-golfnumber Introduction: Although I originally had a Dutch song in my head, where the lyrics are: "Do 'n stapje naar voren, en 'n stapje terug" (which translated to "Take a little step forward, and a little step back"), when I searched for the full lyrics, I realize...

 
8:23 AM
I think "alias" is a term for single-byte tokens which have taken the place of deprecated double-byte ones
 
@user202729 Well, not if just glyph-swaps, and the Unicode-to-Jelly converter considers both original and new chars the same. But I didn't know that.
 
@Adám also, the "Unicode-to-Jelly converter" is kinda messy in a few places (e.g. ¶)
I had to open an issue so as to make ⁾¶¶ behave as it should
 
8:50 AM
I have no idea why the "What..." message is starred...
4
 
9:01 AM
CMC Design an algorithm to solve Downgoat's CMC above in linear time.
Bonus if you don'y use suffix tree.
 
 
1 hour later…
10:17 AM
@user202729 Marshall says that that was their previous algorithm, and that the one outlined in the blog is substantially faster. Part of the problem is that the operations can't be pipelines. I emailed him after having previously corrected a typo in the post
 
 
2 hours later…
11:59 AM
2
Q: ASCII art uncompression from a base-n number

Jo KingThis is inspired by an 05AB1E answer by Magic Octupus Urn. Given two arguments, a positive integer and a string/list of characters: Translate the number to base-n, where n is the length of the string. For each character, replace every appearance of the index of that character in the base-n num...

 
 
1 hour later…
Anonymous
1:13 PM
@EsolangingFruit Done
 
2:18 PM
4
Q: The Unique Padlock PIN List!

SEJPMIntroduction In a private chat, a friend of mine apparently recently stumbled across a security system which has the following two restrictions on its valid pins: Each digit must be unique (that is "1" may only appear once) The order of the digits doesn't matter ("1234"="4321") So to illustr...

 
^ I'm around if the need arises
 
2:31 PM
@NewMainPosts CMC Formula for the length of output n
 
3:03 PM
@DJMcMayhem Haskell 22 bytes
 
3:22 PM
did you guys ever settle on the difference between bigO and bigOmega
bigO is an upper bound while bigOmega is a lower bound
that's all
so if i wanted to say that an algorithm takes "at least" some amount of time
that's bigomega
 
4:16 PM
How does /usr/bin/read work? How do you get the read result?
 
read var;echo $var?
 
@Cowsquack The shell builtin works like that. /usr/bin/read doesn't , try it.
 
$ which read
/usr/bin/read
$ /usr/bin/read q;echo $q
asldhjasljll
what, why do they behave differently despite pointing to the same thing?
 
@Cowsquack Witchcraft, says I.
 
@Cowsquack Doesn't work for me
 
4:24 PM
which part doesn't work?
 
[pavel@localhost ~]$ which read
/usr/bin/read
[pavel@localhost ~]$ /usr/bin/read q; echo $q
foo

[pavel@localhost ~]$
 
that's how it behaves on mine too (notice the trailing empty newline)
 
Yes, exactly
 
@Pavel And it can't. Calling an external command cannot modify a variable.
 
(Sorry I said that a bit weird)
@Dennis Exactly. So what's it for?
Same with /bin/alias
 
4:27 PM
Beats me. openSUSE doesn't have it.
$ cat `which read`
#!/bin/sh
builtin read "$@"
wat
 
mine is slightly different
$ cat `which read`
#!/bin/sh
# $FreeBSD: src/usr.bin/alias/generic.sh,v 1.2 2005/10/24 22:32:19 cperciva Exp $
# This file is in the public domain.
builtin `echo ${0##*/} | tr \[:upper:] \[:lower:]` ${1+"$@"}
 
Mine is the same as Dennis'
 
(TIO's)
 
Oh yeah that would be the Fedora one.
 
4:30 PM
Apparently, it came with the bash-4.4.19-2 package.
 
@Cowsquack this file is the same for other builtins, like alias
 
Wait, FreeBSD?
 
@Pavel macos
 
Seems to be the result of an (overly literal) interpretation of POSIX.
 
4:36 PM
@J.Sallé We can still do CMCs in TNB, so we'll survive.
 
I guess /usr/bin/read has at least some use cases, even if none of them involves storing user input in a variable. /usr/bin/cd could be used to test if we may cd into a directory.
 
@Adám yeah actually it happened for like 40 seconds on Boardgames.SE
 
You could run a debugger on /usr/bin/read in order to retrieve the parsed input :P
 
That's insanity, not a use case. :P
 
> You can use GDB to debug programs written in C, C@t{++}, Fortran and Modula-2.
What is this "C@t{++}" language?
#!/usr/bin/env pwsh
param ( [string]$Variable )
Set-Variable -Name $Variable -Scope 'global' -Value ([Console]::ReadLine())
PowerShell read script works :P
PS>read foo
bar
PS>$foo
bar
 
5:05 PM
Unix shells: We have two output streams. Output, and Error.
PowerShell: We have 6 output streams. Output, Error, Warning, Verbose, Debug, and Informational
 
@Pavel can't say MS is not thorough with their outputs
 
The last 4 are supressed by default and you need a flag to enable them, so you don't really have to worry about them generally.
Actually, IDK about Informational. I think that one is shown anyway.
It's not used much.
 
My knowledge of powershell goes as far as "it's a way to use linux commands on windows"
 
@J.Sallé For me it's a way to use Windows commands on Linux
 
@J.Sallé That's WSL
 
5:15 PM
They've been putting a lot of the "unixy" commands into stock CMD anyway
You've got curl and tar and cat and whatnot
Although nothing has grep yet
 
@DJMcMayhem no idea what that is
 
Windows Subsystem for Linux (WSL) is a compatibility layer for running Linux binary executables (in ELF format) natively on Windows 10. WSL provides a Linux-compatible kernel interface developed by Microsoft (containing no Linux kernel code), which can then run a GNU userland on top of it, such as that of Ubuntu, openSUSE, SUSE Linux Enterprise Server, Debian and Kali Linux. Such a userland might contain a Bash shell and command language, with native GNU/Linux command-line tools (sed, awk, etc.) and programming language interpreters (Ruby, Python, etc.). When introduced with the Anniversary Update...
 
@Pavel pisses me off every time I type ls into CMD and it throws an error
 
Powershell is a shell
 
@DJMcMayhem sounds pretty cool actually
 
5:18 PM
@quartata It's a really nice shell :P
@J.Sallé It's like Wine, but backwards
 
@Pavel That is very subjective.
 
Exactly what I thought
 
ksh is better
 
@Dennis It has braces instead of fi/done/esac crap, ergo it is better.
 
Speaking of powershell, I have a new favorite command: w | !powershell.exe "python.exe -u test.py \| tee output.txt"
(from vim)
 
5:21 PM
hello
 
Also, thanks @Dennis for informing me of -u
 
@DJMcMayhem What does w do on Windows?
 
It's a vim command
 
@Pavel I think that's a vim "save" command
 
Oh. I thought it was a shell command.
My bad.
 
5:22 PM
It's (w)rite (|)and (powershell ...)
 
@Mego Thanks
 
@Pavel I'm not a friend of esac, but it's a small price to pay.
 
@DJMcMayhem I downloaded gvim on a whim and forced myself to learn how to use it
Gotta say it's pretty neat
 
@Dennis For what? I'm actually curious what anyone likes about bash. I feel like it's just a mess of weird syntax.
 
5:26 PM
Also, I found out the other day that if you do an s/something/somethingelse on discord it will edit your latest message.
 
Skype for mac supports full sed I hear
 
I typed it as a joke to a friend and I got confused when it didn't come through, then I saw my message had been edited
 
@J.Sallé it's annoying that discord thinks the ending / is a part of the replacement
 
@Pavel Maybe pwsh is just too different to what I'm used to. Set-Alias is a lot more complicated then alias, yet it doesn't allow you to do simple things like `alias lsl='ls -l' without creating a function.
 
@Dennis Oh yeah, good point. I have a really hacky solution to the alias problem.
Here's a file called ~/bin/pwsh-aliases/alias.sh:
#!/usr/bin/zsh

COM="$(echo $0 | sed 's/.*\///')"

case $COM in
	"ls" )
		exec exa --git -Fh --group-directories-first "$@"
		;;
	"l" )
		exec exa --git -h --group-directories-first -Flah "$@"
		;;
	# More aliases...
esac
ls, l, etc. are files in the same directory that are symlinked to alias.sh.
And my $PROFILE contains
Set-Alias l  /home/pavel/bin/pwsh-aliases/l
Set-Alias ls  /home/pavel/bin/pwsh-aliases/ls
# More aliases...
So I wrote a function to register a new alias
function Register-Alias ($Name, $Command) {
	pushd "~/bin/pwsh-aliases"
	sed -i "$ d" alias.sh
	"`t`"$Name`" )" >> alias.sh
	"`t`texec $Command `"$@`"" >> alias.sh
	"`t`t;;" >> alias.sh
	"esac" >> alias.sh
	ln -sf alias.sh $Name
	"Set-Alias $Name /home/pavel/bin/pwsh-aliases/$Name" >> $profile
	popd
}
(`t is tab, `" is escaped quote)
 
5:38 PM
I'll stick with esac. :P
 
Getting sudo to work right with powershell builtins was fun too. It took some effort, but IMO it was worth it.
Syntax highlighting :P
 
@Cowsquack I hadn't noticed that, but I think that's because I didn't use the trailing /
 
00:00 - 18:0018:00 - 23:00

« first day (2691 days earlier)      last day (2152 days later) »