« first day (2403 days earlier)      last day (2443 days later) » 

12:07 AM
@Downgoat use bash
@Downgoat Yes (TIO compiler flags)
 
This is essentially a bucket sort, right? So it fails if the input doesn't fall in the range of the hash table size? Can that happen? — Jakob 6 mins ago
 
@totallyhuman Please don't draw attention to old conversations that set a poor example now that we're aiming for low noise.
 
@trichoplax oh I'm sorry I didn't realize
I found it funny
 
It would be considered noise by today's standards
 
Can somebody explain that comment to me?
@trichoplax alright I'll avoid that
 
12:09 AM
Great :)
 
I dunno what bucket sort or hash table mean
 
Fun fact! I hate SO with a passion!
 
@2EZ4RTZ yay
 
@totallyhuman pls do data structures course first.
 
Bucket sort, or bin sort, is a sorting algorithm that works by distributing the elements of an array into a number of buckets. Each bucket is then sorted individually, either using a different sorting algorithm, or by recursively applying the bucket sorting algorithm. It is a distribution sort, and is a cousin of radix sort in the most to least significant digit flavour. Bucket sort is a generalization of pigeonhole sort. Bucket sort can be implemented with comparisons and therefore can also be considered a comparison sort algorithm. The computational complexity estimates involve the number of...
 
12:10 AM
@ASCII-only no
:P
 
@totallyhuman ... then at least use Google...
 
TNB is usually much better at explaining stuff like this :P
 
@totallyhuman No, Wikipedia is almost always better
 
@trichoplax ok I don't see how my answer is using that algorithm
@ASCII-only Wikipedia can get extremely technical
 
@totallyhuman Simple English Wikipedia is also a thing
 
12:12 AM
I haven't seen the answer. If it's not using bucket sort you can just tell the commenter this
 
lambda l:{*range(min(l),max(l)+1)}&l
 
I guess it doesn't have this article though
 
@trichoplax I just wanna confirm what they're asking so I can answer their questions
 
@totallyhuman Thats not really a bucket sort
 
@totallyhuman Does that depend on the set being sorted?
 
12:15 AM
@trichoplax no
 
CMC: Bucket sort a list of Integers, the sorting method of the buckets can be anything.
 
@ATaco RProgN1 quine pls
@ATaco with duplicates?
 
@ASCII-only No, they're not important to the challenge.
@ASCII-only Makin' me do all the work 😆
 
@ATaco But it's too different from v2 >_>
 
@totallyhuman I'm lost. Is that bitwise AND of a set and a list?
 
12:18 AM
@trichoplax for sets, and is overridden to set intersection
 
@ASCII-only "%q ] F" ] F
Doesn't look at all different to me :P
 
@trichoplax He takes input as a set
 
@totallyhuman Ah I see. And the list l will be automatically converted to a set for intersection with a set?
 
@trichoplax No
 
Oh input is a set - I should have read the answer rather than just the code here - sorry
 
12:19 AM
@ATaco Yep looks totally identical :P
 
Well, that quine works as is in RProgN2.
 
@ATaco :/ the spaces are needed whyyy
 
@ASCII-only Because I am a horrible taco.
 
0/10 won't eat again
 
12:21 AM
 
> You must explain/list what sort method you used
 
... Ok fine it doesn't work apparently, dunno how that works
Wait I got downvoted, c'mon I'm about to fix it
 
@WheatWizard nice!
 
You can always delete while fixing to avoid downvotes
 
IiIgXSBkZWNvZGU2NCAu"" ] decode64 . was the first quine I wrote for it.
 
12:24 AM
How do you even do that?
How do you find a string that decodes into itself and the extra code?
 
@totallyhuman What????
@ATaco :/
 
@totallyhuman '"" ] decode64 .' encode64
 
@totallyhuman ^ It doesn't
 
@totallyhuman You answer didn't work because sets are not inherently ordered. The order you see when they output is based on a number of complex factors. I could explain if you would like.
 
It's the base64 of the right half, so I duplicate it, decode it, append it.
 
12:32 AM
...wow i'm getting a lot of stupidity rewards lol
thanks for explaining guys
 
@totallyhuman -1 byte :P
 
...that's a different approach
there are much shorter approaches
:P
 
Wait Sherlock9 already did that one last year
 
@flawr r/DnDGreentext is amazing
particularly by all-time top
 
just for fun, CMP: what is your idea for a logo for a golflang called neon
 
12:44 AM
@totallyhuman Neon lights spelling out neon
 
where's the golf part? :P
 
How can i add text to the end of a ( *char) string?
In C
 
1
Q: FORTY TWO? SIX? NINE? Understand these and much more!

fireflame241Given the written, spelled-out representation of an integer from 1 to 10^15-1 inclusive, convert it to an actual integer in decimal. Input Format The input will always be a string of groups, where each group is composed only of letters and spaces(). The groups are separated by commas. You may...

 
@2EZ4RTZ Do you know the length of the char*?
 
12:51 AM
@totallyhuman What kind of golfing language has a logo related to golfing
 
@ASCII-only Adding a space to the front seems to make it a quine.
 
@ASCII-only ಠ_ಠ
 
@WheatWizard Oh yeah thanks lol
 
@NewMainPosts Well, another duplicate question. Why am I not suprised
 
@WheatWizard 160 bytes
 
12:55 AM
@2EZ4RTZ Just use the string class instead of a char*
 
Right now the code uses putchar
@WheatWizard All my other code uses char*
 
Thats probably a bad idea
 
void f(char*s){char c,i=0,j=0;while(c=*(s++)){putchar(c);if(c==' ')++i;if((j<4&&i==7)||(j>=4&&i==6)){i=0;++j;putchar('\n');}}} is the code I need to save output to a char*
See my problem
@WheatWizard ideas?
 
My idea is to use a string instead
 
0
A: Sandbox for Proposed Challenges

Silvio MayoloCan I Settle Down? In The Settlers of Catan board game, there are five resource types: Brick, Log, Ore, Wheat, and Sheep. Building a settlement costs a Brick, a Log, a Wheat, and a Sheep. However, you can also trade in four identical resources to get a resource of a different type. For instance,...

 
1:02 AM
@WheatWizard You don't understand. I have thousands of lines of code needing it to be a char pointer.
 
Why?
 
Because they all are char pointers
 
I don't have any help to offer further than use strings instead.
 
Hmm
@WheatWizard how would I add text to a string? += is not a C thing
 
a = a + b
tbh I don't know C I'm just pretending its C++ for the most part.
 
1:06 AM
Yeah that doesn't work. THIS IS SO ANNOYING
I HATE C
SO MUCH
 
find somebody else who did the same thing in another language :P
 
@2EZ4RTZ ...
it's called strcpy
short for string copy...
but really you should probably malloc space for a new string and copy both there
 
or just realloc the old string?
 
@2EZ4RTZ ... this is why you don't copy code and have no idea how it works
or that ^^
 
@ASCII-only I know how it works but don't know some of the ins/outs of copying strings
 
1:12 AM
@2EZ4RTZ then please google tyvm
 
@ASCII-only why are you so against asking for code advice in TNB :P
 
@totallyhuman I'm not?
 
then why do you keep asking to google
 
I'm against "halp gimme teh codez"
it clearly shows no research effort like the majority of SO questions >_>
 
I asked about adding text to a string
I have spent quite a while on this and keep getting errors
Mainly because of bad SO questions :P
Gah
everything results in seg fault
 
1:16 AM
it's C what do you expect
 
@2EZ4RTZ ... you haven't tried realloc have you
 
MaybeLater now has an Esolangs.org Page
 
@ATaco 0/10 has space
 
@ASCII-only I am not concerned about that yet
I really don't care about taking up an extra 200 bytes of memory
 
Space is arbitrary and I don't care about it.
 
1:18 AM
(I understand that is a bad practice but it is just for a challenge)
 
@2EZ4RTZ and this is exactly why it's segfaulting
 
@ASCII-only oh
well
 
if you don't have the space, you're probably overwriting other important things
 
0
Q: Python read numbers until 0 entered then find mean, sum, min and max number

rowcoderI have an assignment in which I have to do the above with anyone language I would like. (background in java) I am trying to learn python and thought this wouldn't be too hard to implement. I just want pointers on how to structure this as I'm not sure of effective ways of coding in python. My idea...

 
I should have the space...
hmmm
 
1:19 AM
@2EZ4RTZ no?
Unless you mean the string is allocated with a really long length already
 
@ASCII-only hmmm
@ASCII-only well allocate all memory should fix it :D (joking)
 
@2EZ4RTZ >_>
>_> why did you even use c if you don't know how it works
 
Because of have 99.999999% of the program already
 
@NewMainPosts Is just like, 5 challenges mixed together, (And it's forcing you to use Python) :(
 
@NewMainPosts somebody pls help them out with comment
 
1:22 AM
@ASCII-only I also have a cold so most logical thinking parts of my brain are just ded (and the rest of my brain too)
 
> I have an assignment
<- writing quines with the flu
 
That is just a bad idea
 
no it isn't
 
Here is what sucks. I have the ouput that I need but the output is to STDOUT and I can't get the output to STDOUT to be saved to a char *
 
@2EZ4RTZ huhwhat
 
1:28 AM
@ASCII-only nvm got help
 
@2EZ4RTZ i don't even understand
@2EZ4RTZ if you have the output then why not print it :P
 
@ASCII-only because it is not the output. It is the formatted version of input that I pass to another function
 
> I have the ouput that I need
 
@ASCII-only I wrote the Forte quine if you need it :D
 
pls give ty
 
1:35 AM
@ASCII-only the function gives the result I want but it goes to STDOUT not a char *
 
@ASCII-only Boop
 
@ATaco I remember that!
 
Yeah! That was a fun one to write!
 
I was trying to do it at the same time
And I was sad and failed :P
 
Plus, I got a bounty for it! :D
I had the advantage, Quines are my Forté
Also, I don't have a quine for MaybeLater yet.
 
1:40 AM
:/
 
@ASCII-only I have my program. Everything works but the newlines are supposed to be added but they are never added. Even though the code section that has the newlines being added is run.
toString[num]='\n' is not working but toString[num]=c does
 
@ATaco do you have printf or string.format or the like?
 
Any idea why even if both are run it doesn't work?
 
Nope, no way to do the %q trick.
 
Anonymous
4
Q: redirect output from stdout to a string?

CSawyin C i want to redirect the output of a process from stdout to write to a "shared memory segment" which can be thought of as a char array or a string with a pointer i know that there is dup2 but it takes file discriptors as argument not a pointer to an array. is there any way to redirect it to a...

 
1:42 AM
damn
 
Anonymous
Please make an attempt to research questions before asking them
 
@ASCII-only TacO Quine
 
@Mego it goes on for pages
 
Anonymous
But that was the first Google result for "C redirect stdout to string"
 
1:44 AM
@Mego I actually looked at it but it wasn't working. I may have typed it wrong but will try once more
 
string monads?
 
@Mego yeah I am using char pointers
 
@2EZ4RTZ c has no strings btw
 
@ASCII-only yes they are char arrarys
 
C has no arrays.
 
1:51 AM
The two outputs literally get the same input
Right after each other
 
Not really, anyway.
 
@2EZ4RTZ pls pastebin
@2EZ4RTZ because they are clearly not getting the same input
 
void f(char*s,char*toString){char c,i=0,j=0;while(c=*(s++)){ int num=0;toString[num]=c; putchar(c);if(c==' ')++i;if((j<4&&i==7)||(j>=4&&i==6)){i=0;++j;toString[num]='\n'qa;putchar('\n');num++;} num++;}}
@ASCII-only there. All one line
the two items are toString and putchar.
 
hang on gtg for a while
@2EZ4RTZ qa???
 
@ASCII-only typo but still didn't fix
    char * sting;
sting = malloc(200);
    f(str,sting);
    printf(sting);
That is me running it. I gtg (bed) because school.
 
Anonymous
2:05 AM
@ATaco char response[] = "That's blatantly false.";
 
Anonymous
@2EZ4RTZ Then I think the problem is that you have a poor understanding of C.
 
-1
Q: About my chat suspension

MendeleevOver a month ago, my chat account was suspended for various reasons, most of which being that I was not thinking things through and annoying other chat users. According to the mods, the final touch was when I posted a rickroll link. I've thought things over for a while and I believe that I can r...

 
@2EZ4RTZ can't read pls don't golf
 
2:21 AM
@Mego That array is just a disguised pointer.
 
@ATaco Still an array
 
Traditionally, Arrays of size 5 don't let you index 6.
Then again, it's much faster not to think about it.
 
@ATaco Well of course but C is meant to be fast not safe
 
Not that that's a bad thing.
Of course, int foo[5]; is much easier than int* foo = malloc(sizeof(int)*5); (Or int* foo = (int*)malloc(sizeof(int)*5); in C++98)
But on the flipside for(char* str=foo; char c = *str; str++){} feels just a bit nicer to me than for(int i=0; i<(however you get the size of the array idk im new at c); char c = foo[i++]){}
 
2:42 AM
CMC: copy quines from here to here if they don't exist yet
 
@ASCII-only That Jelly quine doesn't look expendable.
That is to say, that that quine cannot be modified to do anything else whilst still being a quine.
 
:/ no it isn't
crap
and this one is payload capable but errors
 
I think errors are fine, but it's up to you.
Keep in mind I'm incredibly baised because I want to see RProgN2 hold the Quine Crown at all costs.
 
Anonymous
3:08 AM
@ATaco There's a considerable difference between the two. The first is statically allocated on the stack. Yes, it's possible to use an array variable as a pointer to the first element thanks to pointer decay, but arrays are not "just pointers".
 
Yay malbolge quine just made the quine markdown file like 10x bigger
 
Anonymous
A significant difference comes from the fact that array elements are guaranteed to be contiguous in memory, so pointer arithmetic within the bounds of the array is defined behavior.
 
That's rather interesting and not immediately apparent, i'm still tripping over pointer decay.
 
3:24 AM
Oh god I forgot indexing is two way
 
Anonymous
a[b] is equivalent to *(a+b) thanks to pointer decay. Commutativity of addition means that *(b+a) is also equivalent. Since the syntax translation isn't strict, b[a] is also valid.
 
Anonymous
C++ shut that down :P
 
I've found basically the best language ever: D, it's like C++ done right
 
Sadly parenthesis are needed, Because Lua assumes that no sane person would ever index a Number.
> /+ +/ comments
> Done right
:P
 
3:28 AM
wait what is that
I just found this language like an hour ago >.>
oh I see. that's odd. at least /* */ works
 
4:12 AM
@ATaco I think it's fair to say that that's one of the assumptions that Lua actually did get right.
 
Because mathematica
 
Because people still find it quaint when we have one.
 
5:08 AM
omg there's a non-profit that lets you buy a goat for people in need
 
6:03 AM
I'm hacking together an anyfix variant of RProgN
 
 
1 hour later…
7:13 AM
APN now exists, still very much so WIP.
 
7:54 AM
@EriktheOutgolfer Your code seems to work for [6,2] as far as I can tell. What was the issue?
 
@WheatWizard I fixed it now
 
Ok but your old code seemed to work anyway
 
it returned [1, 1, 1, 1, 1, 1, 1, 1] instead of [3, 3, 1, 1]
 
Oh I see
my version is even older still
you must have introduced the error when you golfed it down
 
I think so
anyways I fixed it and it's still the same size but now it's a full program
 
7:59 AM
I'm excited for the explanation
 
@WheatWizard ooh
42-byte jelly program doesn't have easy explanation lol but I'll try when I have time
 
8:19 AM
@ATaco what even
@ATaco :/ unprintables
RIP SPL will have like a 4MB quine
@EriktheOutgolfer Are you online
Oh @Mayube idea: set up hackmd with no max note length limit on the server :P
Also can someone unfreeze the Charcoal room
 
8:36 AM
Would it be interesting to have a challenge to merge a list of (non-conflicting) objects? E.g. [{"Val":1,"demo":{"Greeting":"hello","target":"World"}},{"answer":42,"demo":{"t‌​ime":"now"}}] gives {"Val":1,"answer":42,"demo":{"Greeting":"hello","target":"World","time":"now"}}‌​
 
8:55 AM
@ASCII-only I am now
@AdĂĄm and what about conflicting objects?
e.g. [{1:{2:3}},{1:{2:4}}]
we may assume there aren't any?
 
@EriktheOutgolfer non-conflicting
 
that's why I asked
 
@EriktheOutgolfer Uh, I wrote "non-conflicting", didn't I?
 
well, on its own it's a little bit unclear if the input will ever conflict though
and if it will, how to handle it
 
@EriktheOutgolfer Is merge a list of (non-conflicting) objects unclear‽
 
9:02 AM
nvm
 
9:22 AM
@EriktheOutgolfer ok so I still have no idea what sum should do for strings (and product too)
 
sum and product their codepoints?
 
:/ would that ever be useful
 
Anonymous
@ASCII-only I still say nothing
 
@ASCII-only or sum its digits?
 
@EriktheOutgolfer Oh yeah good idea autocast
 
9:25 AM
e.g. 991==x*(){}//500192is2o4 = 9 + 9 + 1 + 5 + 0 + 0 + 1 + 9 + 2 + 2 + 4 = 42
 
what just happened
 
991==x*(){}//500192is2o4 = 9 + 9 + 1 + 5 + 0 + 0 + 1 + 9 + 2 + 2 + 4 = 42
 
yeah that's what I typed
 
i have no idea what it's supposed to mean >_>
Oh wait hang on
 
9:27 AM
take its digits and sum them
ooh better idea
 
:/ would that ever be useful
 
sum its numbers
 
@EriktheOutgolfer Hmm, I'd say sum digits if the string is only digits
 
Anonymous
@ASCII-only "good idea" and "autocast" don't go together
5
 
e.g. 10=20//44:5'555\-33 = 10 + 20 + 44 + 5 + 555 - 33 = 601
 
Anonymous
9:29 AM
Do you want PHP? Because that's how you get PHP.
 
@Mego but... golfing languages have to make some pretty big sacrifices
Also what should increment/decrement/halve/double do for strings
 
maybe overload a bit?
 
like, something doing different stuff for numbers and strings for example
 
9:35 AM
@EriktheOutgolfer I know that, of course they should but I'm asking what the overloads should do
 
well, for example Subtract/Minus can be "negative filter" for str and lst
e.g. ⁝abcdefg¦eggs mc laren -> bdf
 
@ASCII-only Halve = cut in 2 equal sized pieces. Double = duplicate/bifurcate/palendromize. All commands could also work on codepoints for strings, but that might be a bit too situational
Increment could be useful on codepoints, but probably never halve/double
 
@Emigna "bifurcate" and "duplicate" can't be things in charcoal
it's not stack-based
 
Ah yeah, true
 
also if there had to be a duplicate command why restrict it to strings?
 

« first day (2403 days earlier)      last day (2443 days later) »