« first day (2593 days earlier)      last day (2240 days later) » 

12:15 AM
F# has optional arguments. F# also implicitely curries functions. I'm not sure how this makes sense.
 
@Pavel :| "implicitely"
makes it sound like like implicit is a british swear
 
oops ¯\_(ツ)_/¯
 
@ASCII-only classes in Python always looked hacky to me. At least syntactically.
 
yep
 
12:30 AM
My main complaint is the __magic__(self) method names.
 
12:41 AM
very yes
but also the lack of constants and access modifiers
 
12:52 AM
@Pavel if I imagine their idea for classes was a functional approach where it's just an abstract constraint for some data that allows methods to be associated with it, it's slightly less irritating.
But instead it's some weird halfway OO stuff.
 
@Pavel tbh I've mostly come to the conclusion that access modifiers are garbage
 
ಠ_ಠ
 
._.
 
Might as well just make everything global then
 
python just has the convention that things you probably shouldn't use lead with underscores. and that's great because actually limiting stuff is a nuisance when you need to do something lower level
use common sense, not inflexible restrictions
 
12:57 AM
@Pavel Everything global implies no instance members. Everything public at least allows for stateful objects.
 
@quartata C# and Java still allow for accessing private members through reflection. If you really need to, you can modify private fields, but for normal use private fields make it a bit harder to fuck stuff up.
 
@Pavel do you have any idea how slow that is
and ugly
Ruby at least just has .send
 
OTOH, if you really need to in python, you can make something really private by putting a local into a closure, and then returning a function reference.
 
Not slower than Python
 
I'd be surprised on that.
 
12:59 AM
And it's supposred to be ugly you're not supposed to be poking around in there in the first place
That's why it's private
 
maybe I'm biased because I have to work with private members that really shouldn't be private quite a lot
but really you shouldn't be punished for another party's design choices. just be conscious of what you're doing with a few extra keystrokes
For reference I recently needed to hook into some private stuff in regex which is probably one of the most common Python modules out there. what I wanted probably shouldn't be part of any public API (I needed to count how many capture groups a regex had and join the FSAs together) but all the functionality was there and easy to use, just protected
should I really have to incur a performance hit for that
no
just know what you're doing
 
You're using Python
Performance is clearly not a priority here
 
plus your internal API should be just as nice as your external
@Pavel hell yes it is.
 
It's no Perl 6 but Python is still one of the slower languages out there
 
Python is slow at some things, not at others. The stuff I was calling into was all C anyways.
@Pavel Ruby is much slower
Python is above average for most scripting languages if you do it right
Perl is much faster of course but it's much simpler
 
1:07 AM
Still slower than C# with reflection
 
Perl 5 is much faster of course but it's much simpler, and more of it is in C
@Pavel I mean in general, relative to te language's normal speed
 
I'm modifying my esolang, what should () be used for (while loops and while not loops, and if else are already filled)
 
imagine Python forcing me to use getattr
that's what I mean
 
also doesn't pypy make python really fast if you can be bothered figuring out how to get pypy?
 
Or Cython.
 
1:09 AM

 Quarterstaff to BF challenge

The interpreters have been made, so the challenge will be made...
 
In those if you had to use reflection then it would really tank though
Java's reflection is particularly egregious style-wise
It's probably what has created the bad stigma around reflection
In Smalltalk reflection is its lifeblood
it's not burdened down by horrid OOP patterns mind you
 
Don't have that problem in functional land.
 
C# reflection is surprisingly not awful
 
I'm on the fence about Ruby's access modifiers because its reflection is so much better
 
Is there a way to get ls to ignore directories that don't exist instead of failing
Like if I pass a b c d e to ls, and only c and d exist, I want it to list of their contents and quietly ignore the others
 
ngn
1:18 AM
@Pavel ls a b c d e 2>/dev/null ?
 
Mm, right
 
1:35 AM
Are the directories really called a b c d e? If so, ls [a-e] does the job.
 
@Dennis Actually, it's ls $(echo $PATH|sed 's/:/ /g')
 
You have directories on your PATH that do not exist. o_O
 
Yeah, /root/bin
This is a clean install of Fedora Server and I'm logged in as root btw
 
ngn
@Pavel if this is bash, you can write ${PATH//:/ } instead of $(echo $PATH|sed 's/:/ /g')
 
Oh cool
The full command was ls $(echo $PATH|sed 's/:/ /g') | uniq | wc --lines
 
1:48 AM
uniq accomplishes nothing here. What are you trying to do?
 
@Dennis Determine how many executables there are in my PATH
But things like ls are listed multple times in /bin and in /usr/bin
 
That's because /bin is a symlink to /usr/bin on Fedora.
 
Usage: uniq [OPTION]... [INPUT [OUTPUT]]
Filter adjacent matching lines from INPUT (or standard input),
> adjacent
dammit
 
sort -u does what you want.
 
Oh thanks
 
1:52 AM
find ${PATH//:/ } -type f might be closer to what you want. It lists only actual files and skips symlinks entirely.
 
Thanks a bunch!
 
A malicious PATH could wipe your entire system though, so be careful with these things.
 
Wat
Oh because there could be directories that start with - that get passed to find as flags
 
Exactly. And if one of them is -delete...
 
find -type f -- ${PATH//:/ } maybe?
IDK if find cares about argument order
 
1:56 AM
It does.
 
Well, the reason I have a server in the first place is so that I can play around with a Linux box without fear of anything breaking since I can just tell DO to recreate the droplet
Also to play nethack with my friends so we share a leaderboard and bones file
 
That's not really something to worry about. Any variable you use as an argument to a program can wreck things. And if someone has the ability to modify root's PATH, it's game over anyway.
 
Well, because it's shared across a couple of nethack players, someone screwing with PATH could be a prank and not a hacker. So that's actually a good thing to keep in mind.
 
Do others have root access?
 
I made it so you login only through ssh key instead of a password and I haven't figured out how to allow loging in as something other than root in this case yet.
 
2:02 AM
If it works for root, it should work for everyone.
 
Well, the user pavel exists, but ssh root@<ip> works and ssh pavel@<ip> doesn't
I didn't do the configuration for root in the first place, that was how DO set it up
Do I just create a .ssh/authorized_keys file in the users' home directories?
 
Yes. The permissions have to be set correctly as well.
 
Well I hope DO set them up so they are
 
When you recreate things elsewhere, I mean.
They are for root. sshd is quite strict with this and won't allow you to log in if they aren't.
 
Anonymous
cat person_public_key.pub >> /home/person/.ssh/authorized_keys
 
2:10 AM
Well that didn't work
 
Anonymous
Also chown -R person /home/person
 
guess I do have to set some setting
 
It's most likely the permission issue. ls -ldZ ~pavel/.ssh and ls -lZ ~pavel/.ssh, please.
 
[root@droplet ~]# ls -ldZ ~pavel/.ssh
drwxrwxr-x. 2 pavel pavel unconfined_u:object_r:ssh_home_t:s0 4096 Mar  6 02:09 /home/pavel/.ssh
[root@droplet ~]# ls -lZ ~pavel/.ssh
total 4
-rw-rw-r--. 1 pavel pavel unconfined_u:object_r:ssh_home_t:s0 409 Mar  6 02:09 authorized_keys
 
chmod 700 ~pavel/.ssh
chmod 640 ~pavel/.ssh/authorized_keys
 
2:14 AM
As root or as pavel?
 
Either.
 
Oh ok
\o/ works now
Thanks a bunch!
 
np
 
2:26 AM
Time to add sysadmin to skills section of LinkedIn
/s
 
3:04 AM
I just love it when I'm about to answer the first challenge in a language and there's a horrific bug in functionality that I need to use.
 
3:26 AM
> Each red flag, during its validity, carries an implicit downvote from the Community user (...)
So Community can vote down multiple times?
 
0
Q: What is the policy on asking questions on ongoing competitions hosted on other sites

Weijun ZhouThis question is closed recently because it is off-topic. It has been commented that we are not supposed to ask questions that may be coming from ongoing contests. While sometimes it is obvious the the question is not by the asker himself and need proper attribution (For example, through text wi...

 
I think there is a dupe on Meta Stack Exchange.
 
4:03 AM
it's time to relearn how to use git again i guess
 
TIL Y ou ca  n ma k e ba d k e rning
 
hair spaces?
hah a I've don e that be fore
 
4:27 AM
Hello I am new to this chat room. ;) I have a question about the meta post about editing off-topic questions. Should suggestions that may make the question on-topic also avoided?
 
Anonymous
@user71546 I don't think so
 
@Mego When I commented on an off-topic challenge post that it may be a good candidate for code-golf if reworded, someone replied me with the link to that meta post, so I doubt if I should avoid such suggestion.
 
Anonymous
I personally disagree with that, but I'm just one guy penguin
 
Is there a way to chown a directory so it acts like every user owns it
So like anyone can do whatever to it, including setting permissions and such.
 
You might need a 777 ;) nope it's too dangerous.
 
4:41 AM
codegolf.stackexchange.com/a/157368/18730 Wooooo first answer in Dirty. I only found about 4 bugs writing that.
 
> Note: There are some rude words in this question.
> first answer in Dirty
2
I see what you did there
 
First Dirty answer in a question with dirty words lol
 
@EsolangingFruit *keming
 
If a group owns a directory, and a user makes a file in that directory, does the group own the file or does the user?
 
@Pavel ... I'm confused. Doesn't every file or directory have both an owner (user) and a group?
 
4:55 AM
@DLosc Maybe I don't get how ownership works
 
You're talking Linux, right?
 
Yes
Like what happens if you do chown :users
Then no individual user owns the file, right?
 
No, that changes the group, actually.
The convenience syntax is admittedly a bit confusing
 
I see
 
It's chown newuser:newgroup
Or chgrp newgroup
 
4:57 AM
Who can set permissions on a file? Anyone with w permission?
 
...Probably? Not entirely sure.
That makes more sense than r or x permissions, anyway.
 
All I want is for two users to share ownership of a file ;-;
 
@Pavel Then you probably need a (new) group
 
@ASCII-only The problem is that even with chmod 777, the user owner still can do things group members can't
 
@Pavel wait. wat?
 
5:08 AM
Like chmod the file. You can't have a file chmod-able by more than root and the owning user.
We're considering making a user to own the directory and just agree to su as it whenever we work with it.
 
I swear I can't escape Dennis
I was just searching for how to convert a string to lowercase in Python and I find a SO answer by Dennis
 
@EsolangingFruit .lower()
 
you don't even need SO for that, docs exist for a reason
 
Why use docs when there's SO?
 
5:26 AM
Docs are usually hard to read
 
Lol I’m in the same situation but with Martin Ender... I was looking for a pendulum formula and I saw one of his Physics.SE answers. I once looked for something on SO, I saw one of his answers.
 
@Pavel man can be, but API docs are pretty straightforward if they exist
 
harder than SO
 
...
how is this harder than SO
 
Because I don't know to look for the documentation of the string class. It might be lower(str), in which case it would be a builtin and on a different page.
After all, it's not [foo].length, it's len([foo])
 
5:32 AM
@Downgoat Did you solve that problem you had with AppDelegate?
 
{#toLower c \\ c <-: string} oh wait
 
wat
 
@Mr.Xcoder yeah, looks like I had to use swift -frontend -c and add a Stub.swift file so Swift would interpret it as a module
 
My second attempt would be to map a character-to-lower function over the string.
 
@Downgoat O_o Ok... Good to know
 
5:33 AM
I'm making porting Swift's UIKit interface to VSL: github.com/vsl-lang/vsl-ios since you have iOS experience, idk if you'd be interested in helping develop it :3
 
I might be interested, but I have some exams in the next few months so maaaybe after that?
 
ok sure
 
Anyway gtg now
 
5:55 AM
> next few months
how many exams is that lol
@Pavel ... all builtins are on the homepage
 
It's still easier to search "How do I make a string lowercase in python"
 
@Pavel ... and that's only because len applies to all sequence types maybe
@Pavel >_> yeah but still
add python docs as search engine -> magic. zero time needed.
 
or SO as search engine
 
:O that is an amazing idea how have i never thought of this
 
... or both?
 
6:01 AM
yeah but having python docs too is a bit redundant. depends what you need to look up I guess
 
Question: Does display as an arrow for anyone who sees as a box
 
@Οurous Yup! I can see #1 but #2 is a box.
 
@DLosc Excellent. I'll add #1 as the default alternative for the command currently assigned to #2. That's four less boxes in the charset because of all four directions!
 
Just use APL arrows
←→↓↑
@Οurous APL character render basically everywhere
 
6:17 AM
@Pavel I am. There aren't enough different arrows in the first arrow block.
 
How many arrows do you need ._.
 
1
Q: Create this "String Mix-Up" function in as few bytes as possible

RyanThis is my first time here at Code Golf SE so feel free to add your input/advice/suggestions to improve my post if necessary. The week after my computer science exam, the solutions were publicly published. One problem had a 45 line example solution but my solution was only 18 lines, (which I was ...

 
6:41 AM
@Pavel 56. Currently 57. Will be removing one and changing another.
 
@Οurous what. O_o
what kind of language needs so many arrows
 
@ASCII-only It helps to give the language some direction.
I'll see myself out.
 
 
1 hour later…
7:52 AM
@EsolangingFruit you're still here
 
8:03 AM
:O charcoal is fixed
this is amazing
@Neil Hmm off the top of your head can you think of anywhere the current deverbosifier doesn't work properly (apart from after numbers)? Or would it be better if I just pushed so you could test it yourself
 
@ASCII-only Bye
 
@Fatalize I think prolog was my third language. It ended up getting me interested in alternative styles of programming, and I ended up liking functional. I've been meaning to actually do more than sample the language so this is a nice resource to have :)
 
@Οurous I didn't expect my previous message to get 8 stars, so seems like at least a few other people are interested
 
9:04 AM
Anyone know how python's base64 is different from ruby's?
I'm getting different results from equivalent code
 
... other than the cases I've previously told you?
 
Yeah (I think I already have all the other test cases)
 
i need help with my quarterstaff to bf challenge i think

 Quarterstaff to BF challenge

The interpreters have been made, so the challenge will be made...
 
9:21 AM
Charcoal TIO link generation works :D
Now I just need to figure out how to add flags
 
10:03 AM
@ASCII-only Yup, 3 exams and an olympiad
 
10:16 AM
@Neil Do you think it would ever be useful to specify header and footer to Charcoal?
 
No, but then again (not that they don't exist) I've never seen headers or footers for 05AB1E or Jelly answers.
 
Also, re: input methods, what do you mean by Charcoal should have more?
Should Charcoal have another input type that literal_evals the next input?
 
well, the input format on the answer on which I commented was a bit ugly
I was thinking possibly a JSON input format
 
As in provide all inputs as JSON?
Or read next input as JSON
Or both at the same time?
 
2
Q: This challenge is about recursion (Cops' thread)

SanchisesCops' thread In this thread, your task is to make a recursion-based program/function to generate any integer series. Robbers will try and find a shorter loop-based solution over in the Robbers' thread. Challenge synopsis In many languages, recursive functions can significantly simplify a prog...

1
Q: This challenge is about recursion (Robbers' thread)

SanchisesRobbers thread In this thread, your task is to find a loop-based solution which produces the same integer series of a submission not marked as 'safe' in the Cops' thread. Challenge synopsis In many languages, recursive functions can significantly simplify a programming task. However, the synt...

 
10:30 AM
My first CnR challenge... fingers crossed. But hey, I passed 5k rep!
 
@Neil
 
10:50 AM
not sure what you mean about all inputs as JSON
 
@Neil as in should input be provided as a JSON array of all the inputs
e.g. inputs of "1", "2" and "3" would be provided as ["1", "2", "3"]
 
you can already do that: Try it online!
 
actually, never mind >_>
One thing: Charcoal uses Python literals, should I switch to JSON? wait I'm stupid Python literals are JSON anyway
 
but you're still limited to integer and string values
 
Then there should be a command and operator to get the next input as its original type, right?
 
11:55 AM
2
Q: Compute the Kolakoski sequence

Martin Ender This is a repost of an old challenge, in order to adjust the I/O requirements to our recent standards. This is done in an effort to allow more languages to participate in a challenge about this popular sequence. See this meta post for a discussion of the repost. The Kolakoski sequence is a f...

 
@Neil
 
yeah I guess that would work
as long as you can input an array
 
@Neil So fullwidth A for array would work? (This would work for objects too, it's just that A is a character that was freed when I switched Assign to )
 
sounds good to me
 
12:25 PM
Such a massive commit
Most of the stuff in it wasn't Charcoal stuff though >_>
I really hope nothing is broken too
All the tests pass but I'm sure there's plenty I haven't covered
 
12:42 PM
tfw you make a comment, then think you've misread the answer, so you delete the comment, then find you misread your misreading of the answer
 
@Neil what is this, ?
@Dennis Even better: tio.run/…
 
Ooh, didn't know that was a thing.
 
@Dennis Well, it's an experimental mutable type that AFAICT is gmpy2-specific
 
1:08 PM
0
Q: If I'm new, where do I begin as a programmer?

user78729I want to learn programming, where from shall I start and how? I m confused what I'm asking. But I do wanna learn. Sorry if my question is bothering you.

 
I wouldn't be surprised if Charcoal's source shrinks by >1k sloc after switching to gmpy2
 
@NewMainPosts Just replace "programmer" and "programming" with "code golfer" and "code golfing".
 
@Adám then it would be a POB...
 
(goto ppcgmeta? not sure if that would be on-topic...)
 
uses lru_cache and prays it works
 
1:20 PM
meta? how is that anything about PPCG, it's just something that wouldn't be on-topic for Stack Exchange in general
 
Also while I'm at it, I probably need a more efficient prime generator, anyone know of any good algorithms/python bindings for C libraries?
 
@Dennis ah very nice, I was already afraid I'd beat both Jelly and osabie with Wumpus :P (I've got 13 bytes there, but I'll wait a while longer before posting it)
 
Anonymous
@ASCII-only numpy
 
@MartinEnder Woah, it's a 2D language and it's still this golfy?
 
it normally isn't, but somehow in this case it is
 
1:24 PM
it's actually a triangular language
 
the program isn't even 2D
 
@Mego Apart from numpy (doesn't it take forever to import? or is that sympy?)
 
Anonymous
@ASCII-only Sympy takes forever. Numpy is actually not too bad to import because it's fairly well modularized into submodules. You have to import a gazillion things from different submodules for hardcore math, but just importing the base module is cheap.
 
@Mego How long does it take?
 
1:27 PM
:/ 1.2 seconds woah nice
 
Try again.
 
Time to bloat Charcoal with more dependencies that don't even help with ASCII-art then, I guess
 
1:48 PM
Morning o/
 
Morning \o
 
@Dennis despite the explanation I have no clue how and why your Jelly answer works :D
 
:P
Any particular part I should make clearer?
 
@betseg ive just noticed this message is starred, why is this message starred
because of the caching thing?
 
2:03 PM
@Dennis ah never mind, now I get it. on the first read I no clue how your algorithms relates to the definition at all, but it makes sense now.
that answer is actually amazing
what now...
 
How would i represent a encoding table for a 9 bit format?
 
4 bits on one axis and 5 on the other?
 
Yea, that'd work. I'm just incapable of considering that solution, for some reason :P
 
I'd probably use 32 rows of 16 characters, but which way round is better probably depends on your specific encoding and use case.
 
In this case, the usecase is a golfing language.
i'm setting it up in LibreOffice, so the first one, 4 bits on one and 5 on the other, might work better. (The description and basic spec, that is.)
 
2:33 PM
Hmm, libreoffice kinda doesn't like tables that big. Guess i'll split it into two 16x16 tables.
 
2:50 PM
I lost 10 score
A user was removed
So cool
 
@FrownyFrog unlucky
 
@moonheart08 I'd do a 2×16×16 table.
 
@Adám That's what i'm doing. LibreOffice doesn't like 16x32 tables :P
 
@moonheart08 It may also be easier for readers to grasp, like two normal 256-char code pages, and a bit to select code page.
 
@Adám That's what i decided on. It's easier for me to grasp too lol
I'm focusing my golfing lang on geometric/trig problems.
So, all the mathematical operators
 
3:04 PM
@moonheart08 Just make sure an empty program outputs Jabberwocky
 
@moonheart08 What symbols will you use for sin, cos, arcsin,... arccoth?
 
Depends, i'm looking into it. I'm thinking to use the Tilde and Reverse Tilde for sin and cos, because they look similar to the resulting wave
I have 512 chars to work with, so i can be pretty thorough
 
0
A: List of bounties with no deadline

NieDzejkob500 rep for a Beatnik solution to Multiply two numbers. I've tried it myself, and I've found it difficult. Good luck.

 
@moonheart08 APL folds 26 such functions into a single symbol.
 
@moonheart08 huh, I was confused about what a reverse tilde was and googled it, and it looks wrong to me >.>
 
3:07 PM
@J.Sallé haha
~ ∽
 
See, that's just wrong D:
 
@Adám Neat-o. But i can expand all 26 functions to their own symbol without much of a penalty, and a big gain, so \o/
(Seriously, 512 chars is a lot more space than i thought. You can do a lot of wasting for some big gains)
 
@moonheart08 Or sin= cos= tan=Ø...
 
On that note, how'd i forget to add pi to the table lol
 
@moonheart08 How many built-ins does Jelly have?
 
3:10 PM
uh, about 25something?
maybe 300?
no idea
i don't use jelly
 
@moonheart08 It has lots of bi-glyphs.
 
Yea. I know.
 
272 atoms, 49 quicks.
 
and with a 9-bit encoding a 1-char program will always be a 2-byte program
 
@EriktheOutgolfer Yea, but some programs could have advantages. Plus noone seems to have done 9 bit encoding, so :P
 
3:12 PM
Someone did 10-bit though.
 
I mean, i'm not aiming to make the world's best golfing language, i'm just aiming to have a bit of fun :p
And learn along the way
 
The name was ESMin if memory serves.
 
ESMin uses UTF-8
and it's actually called 𝔼𝕊𝕄𝕚𝕟 :P
 
Did he switch back? I wrote the 10-bit codec myself.
 
3:16 PM
I assume this is what you're referring to, right?
 
On that note, why don't many codegolf langs have Generators? Those can be useful as hell in some situations, like generating the primes and printing. (Implictly printing a generator, if it was implemented right, would output it's results)
 
Yes, I'm planning to do that for Jelly 2. By the time I realized how useful they were, I already had to rewrite everything from scratch to be able to use generators...
 
lol
Generators <3
 
Husk has infinite lists, which sort of serve the same purpose. And so did Burlesque long before it.
 
3:34 PM
Rename jelly2 to jam and leave bits of fruit in it
4
 
@Dennis How you tried doing statistics on usage of Jelly built-ins?
 
@Adám I don't know about any statistics, but I'm pretty sure that Æ! Convert from integer to factorial base. has never been used in a main answer
 
@cairdcoinheringaahing ngn has occasionally vented the idea of a Huffman coding for Jelly.
 
@Dennis as you're making a jelly 2, here's a request: Don't use Regexes to parse pls
 
Half the fun of making a language is facedesking because you had a typo in an insanely complicated regex :P
 
3:43 PM
lol
@cairdcoinheringaahing Parse HTML using CSS/HTML!!!1!!1!11
 
Pyke has generators. Though there's not much that can really be done with them
 
Hmm. What symbol should i use for tan?
 
@moonheart08 what do you use for sin and cos?
 
3:49 PM
@NieDzejkob I use ∼ and ∽, because they look like the respective waves
 
ngn
@Adám or any golfing language; I've seen similar comments from other people, but nobody has implemented a huffman-encoded golfing language afaik
 
@moonheart08 maybe ∻ ? tan = sin over cos, and this looks like division but with a tilde in the middle
 
That'd work.
 
@ngn I think Luis Mendo did something like that with MATL. & gives an alternative input-output specification of a built-in, and when it was implemented, they scanned through all existing MATL answers to see which specification was used most frequently for each built-in.
 
@NieDzejkob Just need to give spots to a handful of other common trig and geometry functions and i'll be great.
Then i can start actually prototyping before expanding further :P
 
3:58 PM
@ngn I wanted to, several times, but as always, I had a list of many things I wanted to do with that too, so never finished it :p
 
ngn
@Zgarb interesting, I wasn't aware of that
 

« first day (2593 days earlier)      last day (2240 days later) »