« first day (2003 days earlier)      last day (2841 days later) » 

5:02 PM
@LegionMammal978 @zyabin101 No docs, es6-only, but it's here.
 
@CᴏɴᴏʀO'Bʀɪᴇɴ why data is a object?
 
@CᴏɴᴏʀO'Bʀɪᴇɴ thx, gonna start answering some of those Kolmogorov-complexity vector image challenges
 
in js arrays can be assigned even outer it's length: a = []; a[1000] = 10 will work
 
@LegionMammal978 feel free to commit to it btw :) I could add you as a contributor
@TùxCräftîñg where are you looking?
 
@CᴏɴᴏʀO'Bʀɪᴇɴ in stack.js
this.data = {}; can be replaced to this.data = [];
more efficient and more logic
 
5:04 PM
@LegionMammal978 Problem: It's non competing in all flag drawing challenges I know. D:
 
@TùxCräftîñg actually, less efficient.
 
and javascript have [].push and [].pop
 
the data object is bare, and the array has an entire prototype .
 
@zyabin101 Doesn't mean I won't write non-competing answers anyway
 
I know what I'm doing :P
 
5:05 PM
ಠ_ಠ
so TIL ¯\_(ツ)_/¯
 
further, using an array is more error prone.
 
I'm only accessing a handful of members at a time. by keeping track of the attributes myself, I can strictly define what I want as opposed to using what other people may have modified.
 
whelp, I got translating brainf*** programs to vim keystrokes working somehow. Vim is turing-complete I guess
 
so you want to prove the turing completeness of vim ಠ_ಠ
 
5:08 PM
@Zwei Somewhere floating in the abyss that is Usenet there is an ancient Turing machine simulator in vim
Pretty cool stuff
 
like the turing-completeness of vim was a surprise, though
 
i think you can fill the buffers with lines 0\n0\n0\n0... for the memory, the memory pointer is the cursor Y position
 
yup, exactly what I did
 
@Zwei Not really. It's pretty obvious that it can do tag systems at least
 
and you can use vim math operations to increment
 
5:08 PM
yup
 
for the loops i think recursive macros
or any other form of loops
 
and then I used recursive macros ending with :if getline('.') != '0' | exe 'normal @q' | endif<CR> for the loops
 
but input and output ¯\_(ツ)_/¯
 
I haven't got I/O working yet, but I figure you could use 3 tabs
 
@quartata that's true
 
5:10 PM
one for the input bytes, one for the tape, and one for the output bytes
 
Hello, World! teletext page :3
 
@zyabin101 what is that?
 
@Mego haha
 
@TùxCräftîñg This is a teletext page (Mode Seven, of course) that says "Hello, World!" in its content (the second row).
 
if it means anything, I got >+>+>++++<[>[-<+++++>]<<]> converted to vim keystrokes. Dealing with nested loops is what appears to have caught up other people that tried to convert brainf*** to vim. It did place 106 on the second line, which is a great start
 
5:13 PM
nested loops are hard
 
dont have vim, cant find a version working on windows :/
 
? I have one
 
I have vim on Windows, but I don't really remember how I got it. :P
 
I would hand you the resulting keystroke sequence, but it's pretty long
 
5:14 PM
Hi @DrGreenEggsandIronMan
 
@TùxCräftîñg How is possible? It's literally the first link if you Google "vim windows".
 
C:\Users\Elie>nvim
Neovim was built without a Terminal UI,press Ctrl+C to exit
currently listening on the following address(es)
        \\.\pipe\nvim-6928-0
^C
i see ಠ_ಠ
 
ven
makes sense.
 
Yeah, neovim really sucks on windows
 
5:16 PM
ah, I'm not sure if neovim works on windows
I do prefer it over vim while on linux, though
 
@TùxCräftîñg it doesn't work in the terminal, you need nvim-qt.
 
@TùxCräftîñg Wait, I think you said vim is evil?
 
@zyabin101 no finally vim is great like jquery
 
\o/
Then, ed is evil?
 
@Zwei Nice! I'd love to see it if you feel like posting it in gist or something.
 
5:17 PM
wolfram alpha say it so it is
 
So you're partially normal. Yeah, that would be a long ride.
 
okay, let me type it out into a gist
 
;_; blank screen
 
Yeah
 
@TùxCräftîñg Does it close slowly for you too?
 
5:19 PM
@DrGreenEggsandIronMan yep
 
@TùxCräftîñg Start typing!
First, try pressing i to enter Insert mode.
 
@zyabin101 <troll>ah i have messed up vim</troll>
i know how vim works
 
Speaking of vim, that moment when you try to exit SRCDS by typing :q!
 
llama@llama:~$ grep ':q' misc/ZSH_HISTORY
\:q!
\:q
\:q
\:q
\:q
 
5:22 PM
I may have made an error typing it out
 
@Zwei you speedrun games? :O
 
yup, the trailing k is supposed to be a j
 
I used to. I hold vvvvvv no-death-mode world record but that game is VERY broken
 
@DrGreenEggsandIronMan Haha, nice
 
5:24 PM
installed vim, typed vim in the terminal, ok it works. i have a vim windows. iHello, World! correctly type Hello, World!. so <BACKSPACE> and the cursor is moved backward without removing ಠ_ಠ
 
weird
 
oh work now
ಠ_ಠ
 
@TùxCräftîñg :set backspace=2
 
@DrGreenEggsandIronMan hahaha
 
now i have to relearn vim
 
5:26 PM
@quartata yeah, it's my best alias. Only downside is that I occasionally do :q! instead, and then I get sad when it doesn't work.
 
TIL dont try to use accents in CP437
(look at the mode)
 
llama@llama:~$ alias ':q!'='echo this works'
llama@llama:~$ :q!
this works
 
I would write a tool to convert brainf*** programs to vim, but I just don't feel like it right now. Maybe later.
 
ven
Alphabet in CJam. 26,{97+c}%... No better way? :(
doesn't look like there's a variable for that
 
@ven AFAIK there is a variable for alphabet in CJam
 
5:29 PM
no there isn't
 
ven
I know there's in Pyth and Jelly, but not in CJam.
 
where is the .vimrc on Windows?
 
@ven '[,65>
 
probably in C:/Users/<user>/.vimrc but i'm not sure
 
ven
@quartata that's only caps :(
 
5:31 PM
@ven Do you want lowercase alphabet or both?
 
ven
lowercase only
why did 97> fail o.ô
 
> VIM - Vi AmÚliorÚ
ಠ_ಠ
 
'{,97> for lowercase
 
ven
why { and not ` O.ô
 
> pour accÚder Ó l'aide en ligne
ಠ_ಠ
 
5:32 PM
@CᴏɴᴏʀO'Bʀɪᴇɴ Is there supposed to be a draw.js/draw.css in the repo?
 
@TùxCräftîñg I use have gVim
 
@ven Because it's generating all characters up to [
Then it slices off the junk
 
@LegionMammal978 uh oh
 
ven
ooooh okay :D
I was thinking backwards.
 
@LegionMammal978 one sec I am terribly sorry
 
5:33 PM
@CᴏɴᴏʀO'Bʀɪᴇɴ i have cmdline vim, there is some encoding problems, but it work
anyone know how to change the language of vim?
 
@LegionMammal978 should be working now
 
@TùxCräftîñg :set langmenu
But it should use $LANG already
Oh right, Windows.
 
ven
@quartata thanks<3
 
bane of all things
@ven np
6
A: Tips for golfing in CJam

DennisPushing concatenated character ranges The string containing all digits "0123456789" can be written as A,s The uppercase ASCII letters (A-Z) can be pushed as '[,65> which generates the string of all characters up to Z, then discards the first 65 (up to @). All ASCII letters (A-Za-z) can be...

some more strings
 
ven
I there an equivalent to Pyth's I in CJam?
 
5:36 PM
anyway my lang is set to french, and latin-1 !== CP437, so characters are really strange, so i want to change the interface to english
 
ven
oh amazing
 
@ven &?
Unless you're referring to invariant in which case no
 
ven
no, invariant
okay, thanks :-) (indeed meant the pfn)
 
Yeah invariant is a fancy schmancy Pyth thing
 
what isaacg calls "pseudo-functional"
 
ven
5:39 PM
pfns are an interesting way to do "functional" programming aye...
well CJam has f that looks very much like Pyth's pfns
 
@CᴏɴᴏʀO'Bʀɪᴇɴ totally not stolen from J or anything
 
@quartata invariant? J really only has the hook -:f
 
@MartinEnder If you don't know the t instruction you should definitely learn it.
 
@CᴏɴᴏʀO'Bʀɪᴇɴ Wait, what? I'm 99% certain there was something
 
how to use spaces rather than tabs for tabs in vim?
 
5:42 PM
@quartata I could be wrong, but I'm pretty sure I haven't seen anything like that.
 
@TùxCräftîñg :set ts=num and :set expandtab
 
@CᴏɴᴏʀO'Bʀɪᴇɴ Could you add me as a contributor? I found a couple bugs
 
ven
meh, I is {_\~=}, basically.
 
@LegionMammal978 definitely.
 
@LegionMammal978 Why not pull request?
 
5:42 PM
@LegionMammal978 what is your github username?
 
@zyabin101 Why not not pull request?
@CᴏɴᴏʀO'Bʀɪᴇɴ LegionMammal978
 
invited
BTW, shortest cheddar quine to date:
print fn.rflx(IO.sprintf)('print fn.rflx(IO.sprintf)(%s%s%s,@"39)',@"39)
 
@CᴏɴᴏʀO'Bʀɪᴇɴ O_o
 
@CᴏɴᴏʀO'Bʀɪᴇɴ fn.rflx?
 
longer than Java
3
 
5:44 PM
(requires fn lib, still under development)
@quartata function reflexive.
 
Ah, nice.
 
@quartata i get number required after =: ts=num
 
@TùxCräftîñg The num was a placeholder
Replace it with the number of spaces
 
@Optimizer except it isn't.
nvm
looking at wrong java
nvm the nvm, this is 72 bytes, shortest java is 106
 
5:46 PM
and that is Java!!
 
that makes no sense -.-
 
of course it makes sense. Everyone knows that we have to multiply the code length by 2 to compare with Java!
 
ಠ_ಠ i have created a env variable and setted it to C:/Users/%USERNAME%, and now when i type echo %HOME% i get C:/Users/SYSTEM
 
@TùxCräftîñg did windows change backslahses to forward slashes?
 
no
i have typed forward slashes
 
5:50 PM
Did anyone here ever work with decision trees?
 
exempt
 
decision trees?
   /    \
 yes    no
 
@flawr I think u got your answer
 
I mean decision trees as in ML.
 
5:53 PM
@CᴏɴᴏʀO'Bʀɪᴇɴ ^ Hello World program
 
   ⎧ decision trees?
ML ⎨   /    \
   ⎩ yes    no
@LegionMammal978 yup. you found it :3
I need to add a draw text tho
 
i open vim, :echo expand("~") and i get C:\Users\SYSTEM
ಠ_ಠ
 
@CᴏɴᴏʀO'Bʀɪᴇɴ Also, fixed a bug where it wouldn't delete old SVGs
 
@LegionMammal978 that was more intentional than anything, but it makes more sense your way
 
> not what I meant, echo >_<
ahh windows echo...
 
6:06 PM
I used quotes :P
 
@CᴏɴᴏʀO'Bʀɪᴇɴ So how does that work in this case? Does it fill in every argument?
 
@quartata that would be fn.reflexive. fn.rflx simply duplicates its arguments and applies it to the core function
 
@CᴏɴᴏʀO'Bʀɪᴇɴ So it's not ~?
 
@quartata rflx is ~.
cheddar> fn.rflx((*))(3)
9
 
But how does it work for things greater than dyads
 
6:07 PM
   *~ 3
9
@quartata fn.rflx(func)(args) = func(...args, ...args) In this case, fn.rflx(IO.sprintf)('string',@"39) is IO.sprintf('string',@"39,'string',@"39)
So, %s%s%s is the quote, then the string, then the quote.
 
@CᴏɴᴏʀO'Bʀɪᴇɴ OK, so if I had a function that takes three arguments it wouldn't fill in the third
 
is there a autoexec.bat equivalent for win10?
because running chcp 65001 each time i launch cmd is silly
 
@quartata if you want auto fill, fn.reflexive(f)(arg) fills the arguments with arg. I forget how it handles multiple args.
if it doesn't already, I'll make it fill.
 
What's the difference between fn.reflexive and fn.rflx
 
fn.reflexive fills to number of expected arguments. fn.rflx duplicates args.
@TùxCräftîñg what does chcp 65001 do?
 
6:12 PM
@CᴏɴᴏʀO'Bʀɪᴇɴ set cmd to unicode 'codepage'
 
@CᴏɴᴏʀO'Bʀɪᴇɴ change code page
 
:o ~/.vimrc E37: No write since last change (add ! to override) :o! ~/.vimrc E477: No ! allowed
vim logic
 
at least :q! work
oh wait
vim is in english \o/
 
6:17 PM
nice!
 
because fichier Úcrit is strange ._.
 
do we have any machine learning / artificial intelligence tags?
 
@quartata (and anyone who has 2 cents) Say F(f, n) = f(...a) => F(...a.slice(0, n)), i.e., first n arguments. What would you call the behaviour ?
 
wacked out
 
6:27 PM
TIL %USERPROFILE%
 
@CᴏɴᴏʀO'Bʀɪᴇɴ Got a more concrete example?
 
@El'endiaStarman you familiar with JS's String.fromCharCode?
 
The name seems self-explanatory.
Is it like Python's chr()?
 
@El'endiaStarman yep
 
String.fromCharCode(num1[, ...[, numN]])
okay?
 
6:29 PM
but this is very verbose
like everything in javascript ಠ_ಠ
 
@TùxCräftîñg that's false.
 
@CᴏɴᴏʀO'Bʀɪᴇɴ Oh, optional number of arguments?
 
@El'endiaStarman When you try to do [32, 33, 34].map(String.fromCharCode), you end up getting String.fromCharCode(element, index, array).
F(String.fromCharCode, 1) would "limit" the arguments to the first.
 
@CᴏɴᴏʀO'Bʀɪᴇɴ New feature: d takes the X, Y, radius, and color and creates a filled disk
 
So you could do something like [32, 33, 34].map(F(String.fromCharCode, 1))
@LegionMammal978 oo, nice!
 
6:31 PM
@CᴏɴᴏʀO'Bʀɪᴇɴ Oooh, okay, I can see how that would be useful.
 
fromCharCode takes 3 arguments? What sort of abomintaion is this?
 
@feersum takes N arguments.
> String.fromCharCode(32, 33, 34)
' !"'
A call from map passes three arguments--element, index, array.
 
So the problem is that map is broken?
 
...oh, that's messed up. And makes sense. And wasn't well-thought-through.
 
@feersum There is no problem.
@El'endiaStarman why? it makes perfect sense.
 
6:34 PM
I can see why you might like to pass the index and array to the function you're mapping, but to do it by default indicates a lack of foresight. The function should just be applied to each element, period.
 
I should know by now but I can't help being ever shocked anew by the deranged design of JS.
 
prefixes = (array) => array.map((e, i, a) =>
    a.slice(0, i + 1)
)
> prefixes([1,2,3])
[ [ 1 ], [ 1, 2 ], [ 1, 2, 3 ] ]
Because it isn't what you usually use doesn't mean it's bad--in fact it's very useful.
 
found a workaround for the chcp problem: configure cmder to launch bash instead of cmd
 
How sane languages do it: In Python if you want both the index and element you do map(f, enumerate(a)). In Ocaml you do List.mapi f a.
Whereas you use map f a if you don't want the index.
 
@feersum what does enumerate do? it looks long and unnecessary.
 
6:39 PM
>>> s = "hello"
>>> for i,k in enumerate(s):
	print(i,k)


0 h
1 e
2 l
3 l
4 o
 
I mean, <array>.map((e, i) => ...) or even <array>.map(e => ...) still work
 
@CᴏɴᴏʀO'Bʀɪᴇɴ enumerate([1, 4, 6]) return [(0, 1), (1, 4), (2, 6)]
 
It just ignores the rest of the arguments
 
@TùxCräftîñg ninja'd
 
@LegionMammal978 And that's wrong.
The function shouldn't be able to be called with the wrong number of argumetns.
 
6:40 PM
@feersum you think logically. here it's js.
 
@feersum Well, it can
 
@feersum That's wrong.
 
ninja'd
 
I mean as in morally wrong.
 
34 secs ago, by TùxCräftîñg
@feersum you think logically. here it's js.
 
6:41 PM
@feersum are you thinking functionally?
 
@CᴏɴᴏʀO'Bʀɪᴇɴ What?
 
@feersum are you thinking with portals?
 
@feersum monads and dyads within in the same function are profoundly useful.
 
If you have 2 functions it's not that hard to give them 2 different names.
 
@feersum it's like default values but in better
 
6:43 PM
@feersum do you know any functional langs? J, haskell, etc?
 
@CᴏɴᴏʀO'Bʀɪᴇɴ @feersum Related: codegolf.stackexchange.com/questions/75128/…
 
OCaml.
 
I got many of my rooms frozen.
 
then I don't understand how you can't appreciate monads and dyads in the same function being useful
 
OCaml is not about write-only programming.
 
6:45 PM
@feersum What you perceive to be write only is irrelevant ;)
 
In fact the only overloading in Ocaml is on comparison operators.
 
@feersum you think functional, which is a bad idea in imperative languages
 
Not all "functional languages" look like J.
 
@feersum I never said they were.
 
There are no such things as dyads in OCaml.
Every function takes exactly one argument.
 
6:47 PM
@feersum ._. that's gravely unfortunate.
oh, currying?
 
Yes.
 
not bad
is there a shortened version of currying, then? so you don't have to do f(a)(b)(c)...
 
f a b c
 
oh that's beautiful
 
@CᴏɴᴏʀO'Bʀɪᴇɴ welcome to functional programming
 
6:48 PM
@TùxCräftîñg I've been there for a while.
 
I'm merely talking about syntax, not the actual functional style.
 
@CᴏɴᴏʀO'Bʀɪᴇɴ haskell have the same syntax
 
@TùxCräftîñg I don't know much haskell.
though it's on the todo list
top of it is Z80 asm >_<
 
6:55 PM
@isaacg You're on ConwayLife? :O
 
sad that LDIR dont have a x86 equivalent
 
7:07 PM
I was thinking of a challenge which was to read in a text file, one line at a time, backwards
that is without first reading in the whole file and reversing it
what do you think?
code-golf
 
@CᴏɴᴏʀO'Bʀɪᴇɴ Learn Racket first
 
@quartata Pixley?
 
@feersum oh wow that's actually a thing. It's not really in the docs though. Judging by the code, it just teleports anywhere?
 
too easy?
 
7:10 PM
Nah, Racket is nice because its standard library is much larger than other Scheme flavors
 
ven
Racket is best <3
 
in python it seems quite verbose stackoverflow.com/a/23646049/2179021
 
@Lembik That's because that's not golfed :P
 
@quartata well yes :) I was just using it as possible evidence that it's not too trivial :)
is there some language where it is trivial?
 
0
Q: Collect and place items

helloworld922The goal of this challenge is to collect selected items in a list and move them to a certain location in the list. As a visual example, take the input values (represented by black boxed integers) and a corresponding list of truthy values where true denotes the item is selected (represented by bl...

 
7:19 PM
In V it is ç^/:m0 I think
 
But does that load the whole file into memory first?
I think that's the point, you're supposed to seek instead
 
Oh, I didn't see that restriction
 
Perl 52 bytes sub{use Tie::File;tie @f,"Tie::File",pop;reverse@f}
 
what do you call a 1d grid where each "cell" has the same width?
 
@flawr Tape?
 
7:29 PM
More mathematically
damn, I just cannot find the word in any language=)
 
I can't think of a good one either.
 
equidistant!!!
@quartata thanks=)
 
@MartinEnder Oops, didn't realize it's not in the docs :(. It teleports to any non-slimed square in the grid, and then the next char will match on the same square that was teleported to.
 
7:49 PM
0
A: Sandbox for Proposed Challenges

flawrGrow and Visualize Decision Tree META: work in progress... code-golfgraphical-outputgraph-theorymachine-learning Given two sets of points in the plane with coordinates x,y, both in [0,1), grow a (binary) decision tree as specified below and output a image of 256x256 pixels, that visualizes the...

 
^ Is this readable/understandable?
so far?
 
hi
i have tried to enter selection mode and deleted the entire content of my vimrc ಠ_ಠ
 
My current rep: 6,321. What a nice number... ^_^
 
Still ahead
6,544
 
Mmhmm just you wait...
 
7:56 PM
Yeah, I haven't done anything at all recently
 
> writing under the name Harry Dweighter ("harried waiter")
 
Although this KoTH will hopefully have me rolling in rep
 
@El'endiaStarman May I bother you for an opinion on the most recent sandbox post?
 
@quartata ?
 
Damn, this Grime update is more complicated than I expected...
 
7:59 PM
> If you currently previously considered the x-coordinates, switch to then consider the y-coordinates and vice versa.
 

« first day (2003 days earlier)      last day (2841 days later) »