12:00 AM
@ATaco going for the bonus, Pyth, 15 bytes: AE.A<H #m%Q^Gd

Would there happen to be a shorter way to do a,b=gets.split.map(&:to_i) in Ruby?

a,b=gets.split.map &:to_i

12:40 AM
Potentially really bad idea: Should I give Funky the ability to define Precompiler Macros?

why not
you can always strongly discourage it in the style guide a la C++

Anonymous
@StevenH. I wasn't upset. I just had other things to do.

1:03 AM
@ConorO'Brien That tries to apply the bitwise & operator to the result of gets.split.map with no arguments and to the symbol :to_i.

@Pavel Not if there's a space.

@Mego That makes me feel at least a little better. Still sorry for being so stubborn

0

The famous constructed language Esperanto uses the Latin alphabet (mostly, see the linked wikipedia page for details). However, there are some characters with accents: ĉ, ĝ, ĥ, ĵ, ŝ, and ŭ. (C-circumflex, g-circumflex, h-circumflex, j-circumflex, s-circumflex, and u-breve.) Naturally, these chara...

1:27 AM
@StevenH. FWIW that was all moot anyways since the definition of the Halting Problem requires finite input strings over a finite alphabet
Remember that it was made with Turing Machines in mind, not exactly an infinite ordinal friendly computational model :P
@ATaco Not a whole lot of point if it's not compiled

It has a tokenizing step, so you could insert the precompiler just before that in the pipeline.

Yeah but the point of preprocessing macros is to offload work onto compile time
well and code generation
If it's happening at runtime though there's no point
Reflection would probably be faster for the latter and the former is totally pointless

There is one compiled part of Funky. But it's to compile the tokenizer's tokens into a more digestable format, which happens once per version of the language.
And a precompiler isn't very useful for that.

1:44 AM
@ConorO'Brien Is it really solvable that way, I don't believe the *= and /= are in-place... CMC: Given a bignum x represent as a list of bytes (base256) or other format (but must not be in base 10), divide it by 10 with constant extra memory.

...Can I represent it as a BigNum..?

java.math.BigDecimal

It's easy to convert BF with input to BF hardcode input, just write a BF self-interpreter. As long as the input are computable.

@user202729 Doesn't matter if += is in place, if the architecture can't do it it'll use a register

1:48 AM
Well, so no.
I mean += for bignum. And I'm talking about *= and /=.
But assuming you can, what next? You can't do anything because java big decimal is immutable, and if you create a new one with size non-constant, you lose.
Unless you use some reflection to modify it and Java BigDecimal is implemented as base 10, then it is still not allowed.

Although a cheeky solution, this did not consider the constant memory restraint.

1 hour later…
3:04 AM
@ConorO'Brien teascript: "Aa"N0 idk if still works

0

Introduction Your friend somehow didn't learn that the number 2 comes before the number 3. Instead of correcting him, you decide to have some fun doing basic arithmetic with the numbers 2 and 3 swapped. Example of how he counts: 1, 3, 2, 4, 5, 6, 7, 8, 9, 10, 11, 13, 12, 14, 15, 16, 17, 18, 19,...

1 hour later…
4:16 AM
idea: programming language in which rearranging the characters of a program does nothing.

4:28 AM
Lenguage.

Ok but can it be golfier?

Of course.

1 hour later…
5:42 AM
I just edited my 128-year challenge: codegolf.meta.stackexchange.com/a/14279/47581 Thoughts?

6:05 AM
A solution to this shuffling programming language I've written is a bit of a strange one. Firstly we sort the program, because order obviously can't matter, then we take all bytes greater than 127 and multiply their (n-128)th primes, so essentially their an array of prime factors, but because that doesn't cover all outcomes (particularly large ones) we sum the rest of the bytes as well to this total. Then we use this total like we would for Lenguage.
I'll let you know if I find the cat program any time soon.

So how golfy can it be?
There would be binomial(n+255,255) programs with n bytes.

@WheatWizard That train of thought gave me a combinatorics question that I'm not sure how to answer. With a dictionary of "y" different letters, how many 'words" of length n are unique when sorted?

What is "y"? A variable?

For example, if the dictionary was {0, 1} and the length was 3, you'd have [000, 001, 011, 111] which is 4

6:17 AM
@DJMcMayhem Well, just binomial(n+y-1, n) == binomial(n+y-1, y-1).

@user202729 Just the length of the dictionary I guess

Yeah, what they said.

I feel like I'm kinda dense. I'm not sure exactly what that means

binomial(n,m) is n choose m

Oh, I would have understood that

6:20 AM
binomial(n, m) = (n choose m) = n!÷(m!×(n-m)!)

IT's F7 8E 77 by the way.

@user202729 Where n is word length and m is dictionary length?

I have an idea for the language, it's even character agnostic, i.e. it doesn't care what characters you use just how many

Which is Unary/Lenguage.

I need to sleep though, so that's for tomorrow (read as never)
@user202729 No its not, unary only cares about how long your program is e.g. aaab is the same as aaaa
Here aaab would be the same as cccd or eefe but not gggg

6:23 AM
So this one is <number of integer partition of size <= 256 of byte-count>

Would it be the same as ab?

Pretty sure there are nice g.f. , but probably not closed-form.

@DJMcMayhem No it would be the same as any program with 3 of one character and one of another.
@user202729 I don't really understand this, each program is basically 256 integers of unbounded size.

@WheatWizard Does position of first occurrence matter? (e.g. is "aaab" == "bbba"?)
Sorry for the edit pings

The easy way would be to use Hilberts hotel to generate a lenguage type number and decode into brainfuck, but that's boring.

6:26 AM
Mathematica have builtin for that: Length@IntegerPartitions[10, 256] returns number of 10-byte different program.

I kept noticing a single typo

@DJMcMayhem No it doesn't. aaab == bbba == babb. I don't mind the pings :P
@user202729 Well to be fair Mathematica has a builtin for everything.

But that's a very slow way of calculating... it enumerates all possible programs and count.

There is a nice closed form
but I've forgotten it and I'm to tired right now to find it
I think the one I was remembering required the partitions to be of size at least 1.
And I also think the order mattered.
Does mathematica care about the order in IntegerPartitions?

No.

6:32 AM
Well goodnight. I need to sleep.

7:03 AM
0

Objective Write a program that sorts out and returns the odd letter in the matrix of random size. Details You will be passed a matrix of random dimensions such as this. bbbbbbbbbb bbbbbdbbbb bbbbbbbbbb bbbbbbbbbb bbbbbbbbbb Your job is to find the letter that doesn't match the rest (in thi...

2 hours later…
9:09 AM
Hmm

"1. Confusion"?

Yes
I'm reading that as obscurity given it's in referral to the Caesar cipher

9:53 AM
I saw a car with the plate 'ROT 132'... just 1 digit too many

10:36 AM
does anyone here so maths? how can I write $/frac{1}{2+3x+4x^2}$ as a polynomial? It'll have an infinite amount of terms, but it's about the coefficients of the first few

you may want to look at Taylor series: wikipedia
@NieDzejkob here is your function in wolfram alpha

Well, just solve equation.

0

Let's define fn(k) as the sum of the first k terms of the natural numbers [1, ∞) where each number is repeated n times. k | 0 1 2 3 4 5 6 7 8 9 --------+------------------------------------------------- f1(k)   | 0 1 3 6 10 15 21 28 36 45 d...

10:52 AM
Too bad the denominator doesn't have nice roots...

@user202729 what do you mean?
what equation?

For the latter comment, wolframalpha.com/input/…
and for the former, you can get the coefficients into a system of equations and solve for each.

you need to explain how you make the system of equations. I assume both me and NieDze have no idea what you are talking about

You don't actually need to solve a general system of equation. Because (let bk = coefficient of x^k in the original sequence) you have for k != 0: ak * b0 + a(k-1) * b1 + ... + a0 * bk == 0 -> ak = (a(k-1) * b1 + ... + a0 * bk) / (-b0). n² solution, but I'm not aware of a faster solution.
What is <sup>superscript</sup> and <sub>subscript</sub> and strikethrough in comment?

11:33 AM
thanks, I'll do a Taylor series (btw, this is for OEIS)

12:28 PM
@user202729 compose key is a setting for linux, and you can download it for windows
it's usually not an actual compose key

12:50 PM
"compose" is something that you can bind a key to; then you can press compose + 2 or 3 other keys in order to type a character (whose appearance is similar to the combined appearance of those keys)
the default binding is shift+altgr, but it's moderately common to rebind it elsewhere
e.g. I rebound compose to be on the physical caps lock key (my caps lock input is shift-shift)

@ais523 default for what?

default binding for compose

at least for me, the default is no compose key at all
but maybe you have a checkbox that enables it, I have a drop-down with a disable option

huh, really? might be interesting to try shift-altgr to see if it works
I have a dropdown for that too (on a gtk-based desktop environment) but shift-altgr works regardless of the setting

yeah it works too

12:52 PM
this gets confusing sometimes, because I use altgr-shift a lot when typing Jelly and it took me ages to realise why it sometimes didn't work (because I didn't realise the two were different)

right shift and left shift are different keys

for comparison: altgr-shift-a ' is Æ', shift-altgr-a ' is Á
this is with left shift both times
this is one of the few cases I'm aware of where the order you type modifier keys is relevant

huh
for me both cases are á
I don't think modifier keys have any order when used like that

Why do you need á on the keyboard at all?

it isn't on the keyboard directly, which is why I need to use a key sequence to type it
the normal key sequence would be altgr-; a (altgr-; is a general way to type an acute accent on Linux with a UK keyboard layout)
but compose a ' works too and is easier to remember

12:56 PM
And the Æ happens to be on the same keyboard layout too, with a different order?

if you're asking why I need to type á, there's no particular reason why I should have to communicate entirely in English
Æ is altgr-shift-a because æ is altgr-a and the shift puts it in uppercase

(and it isn't shift-altgr-a only because shift-altgr is interpreted as compose)

I mean, if you need both á and Æ, why are you putting them at the same position?

the basic idea is that the keyboard has all the characters I'm likely to ever need
so that I don't have to change the keyboard layout just because I realised I needed a new character that I don't already have

12:58 PM
on my layout á is alt gr + é followed by a and æ is alt gr + a

the repertoire of characters I can type without using compose, incidentally, is very similar to Jelly's codepage; this is probably not a coincidence

unfortunately that's not the case with APL :p

á is usually ´ + a

@Fatalize I'm assuming you have a western European keyboard layout?

@Adám Pyth, string input: ssM or svM (3 bytes). Pyth, integer input: sjQT or svM or ssM (4 bytes).

12:59 PM
@J.Sallé huh

(the fact that you have a physical é key is something of a giveaway)

isn't it ' a

@ais523 I have BÉPO, this is basically the French DVORAK

somehow it didn't cross my mind that there'd be a french version of dvorak
although given that azerty is ridiculous, it's not surprising

1:00 PM
Well it is indeed not a coincidence. Jelly codepage is designed to be type-able.

with the exception of some hooked chars and middle-dot L and l and no-dot j

I cannot type any of it's non-ASCII atoms/quicks (other than € and a few others)

@ais523 yeah AZERTY is godawful

I had an azerty keyboard at work for several months for some bizarre reason

I remembered Mr.Xcoder can't install any thirdparty keyboard?

1:01 PM
I just set the keyboard layout to qwerty and ignored the keycaps
I can touchtype qwerty pretty well

@user202729 Huh?

@EriktheOutgolfer well, my keyboard is the ABNT2 standard (which is the standard for Brazilian Portuguese). ´ and  are a separate key.

Oh yeah keyboard layout creator apps are (IMO) awful for Mac

So 2 different chars use (almost) the same key in Linux by default? Is that weird?

@Fatalize that

1:03 PM
@user202729 it's only rarely used characters that have these really complex key sequences, in that case it doesn't really matter that some of them are almost the same

My best friend is Mego's tool.

while I have close to no experience with it, it already brings me nightmares

Well KLC on Windows is hard to use too, I used AutoHotkey to interact with the program, it's very useful.

commonly used characters are things like letters, digits, spaces
those all have physical keys (apart from capital letters where you need to use shift or caps lock)

@EriktheOutgolfer Good thing with BÉPO is that I can actually write Ερικ Τηε Ουτγολφερ
(though it's a bit annoying)

1:04 PM
one thing I'm really missing on my keyboard is a binding to type Greek, actually

Is that really complex? I often have AltGr+Shift+; AltGr+Shift+^ Shift+R to get ŒṘ in Jelly. Seems that I made my Jelly keyboard layout more complex than necessary.

it's possible that it has one and I just haven't found it yet, but I looked fairly deeply a couple of times

How do you type that in your layout?

@ais523 On mine it's alt gr + g which switches the layout to greek for the next letter

@user202729 Œ is capslock shift-O shift-E; Ṙ is altgr-shift-/ shift-R

1:06 PM
...capslock?
what operating system does that

Approximately as complex as mine.
16 mins ago, by ais523
e.g. I rebound compose to be on the physical caps lock key (my caps lock input is shift-shift)

right, the default binding is shift-altgr, as mentioned earlier

@ais523 on my keyboard, I have a mapping for <dead_greek>

Alt+CMD+R lets you view your website on different screens from Safari by opening dev tools, but it sucks

Wait, the compose key function like this: [compose] [char1] [char2] will get the character [ compose(char1, char2) ] ? Seems that there isn't such thing support in Windows natively.

1:09 PM
in windows? no
also it doesn't always take 2 chars

Compose works for any number of characters

it can take 2-4 chars
I think?

it's nearly always two
there are a few exceptions though
e.g. – is compose - - . and — is compose - - -

So you use [compose down] [c] [h] [a] [r] [s] [compose up] ? or the compose functionality have something like a "prefix-free dictionary"?

Wow SE chat throws 30 errors in the console for me

1:10 PM
Mine has compose \o/ as well

you can think of it like a one-argument function

I have the whole family: -–−—

then, this function, given an argument, will return another function

And main SE gives me warnings

You hold compose-key, or press compose-key?

1:11 PM
then, depending on the argument, the second function will return either a third function or a char

@user202729 it doesn't matter, normally I press it though

On a completely unrelated note, ಠ_ಠ I have as many gold badges on SO as I have on PPCG

So how does - - and - - - works together?

if a third function is returned, then again either a fourth function or a char will be returned

@user202729 it's - - . not just - -

1:12 PM
finally, if a fourth function is returned, then it will get an argument and return a char
for example

curried keypresses?

Ok, no problem, I understood. (still, that's a prefix-free key mapping dictionary)

Compose('a')('\'') -> 'á'
Compose('U')('*') -> 'Ů'

Windows can only nest one layer for each compose key (dead key) ... but it can have multiple dead keys.

@Mego Maybe you want to add one or more APL code pages to github.com/Mego/CodePageKeyboard?

Anonymous
1:29 PM
@Adám I certainly can do that

No challenge no Anagol for ages

any idea why "anarchy golf" abbreviates to "anagol" anyway? is it just to save one byte?

it's a commonly used shortening

I thought it was surprising that that abbreviation would have become commonly used over the more obvious "anagolf"

1:37 PM
We are also golfing site names

clearly PPCG v2 needs a name that looks more like an URL shortener

while such stuff is banned? ;-P

although the shortest you can practically go with an URL is 1.2, and most of the ccTLDs either won't sell you one of those at all, or charge a huge fortune for it
@EriktheOutgolfer I'm not saying it would be an URL shortener; just that those things have the most incentive to golf their names out of any websites at the moment

@ais523 well, currently

actually I think 0.2. was possible for a brief time? before ICANN banned it

1:46 PM
can I ask a question here regarding regex and Java?

Anonymous

(URLs have a trailing dot that shows that they're absolute rather than relative; basically nobody ever actually writes it, with browsers adding it implicitly if they can't find the domain name locally, but if the URL has only one component you actually need it)

Anonymous

that codepage is bizarre
it doesn't much resemble ASCII or EBCDIC
it's actually more like ASCII I think

Anonymous
shrugs I didn't invent the codepage - I just added it to my tool

1:52 PM
right, I'm not blaming you for the bizarreness

@Mego Wow, that was fast. However, I think you got some names mangled: "APL+" should be "A+" (a successor to A and precursor to K). "APL + Win" should either have no spaces or just be "APL+" (who cares that it is the Windows version of APL+?).

Heyho, maybe my question simply drowned. I am trying to solve the "odd em out" challenge and have a question regarding Java, something feels like a bug and I would like some feedback
well, java and regex to be more precise

Anonymous
@Adám I went by the names you gave on the meta post

Anonymous
But I did mess up A+

Anonymous
Names have been fixed

1:56 PM
@Mego And I've removed Win from the meta post.

@ais523 the ASCII standard wasn't even finished at the time of the first APL :p

@LucaH Ok what's the question?

btw @Mego your tool currently has a bug where if a char doesn't exist in an encoding then it stays what it was before you switched to that encoding

I am taking a String b="aaaaaab" and when I do "b.replaceAll(".\\1+", "");" and then return it, I still get aaaaaab. But when I do "System.out.println(b.replaceAll("(.)\\1+", ""));" It prints b correctly

@Mego: maybe it'd be worth adding an actual EBCDIC codepage; this one's my favourite

2:08 PM
@LucaH Strings are immutable, you need b = b.replace...

the "xor" is a character that IIRC isn't in Unicode, ∀ is normally considered the best approximation

⊻ ?

@user202729 oh god, thank you... I was going mad over here, how stupid...

Anonymous
@EriktheOutgolfer Fixed

2:10 PM
@user202729 no, it's defined as "a hyphen and a capital V typed with overstrike"
you could consider it close to "a capital V in strikethrough font"

Anonymous
@ais523 If you can give me a table of Unicode ordinals for a codepage, I can add it

I agree that ⊻ would probably be a better fit for the intent of the character, but that's not what it looks like

@Mego looks like it, thanks

@Mego I can try to convert that into the form you want, give me some time to write it out

2:12 PM
A hyphen is -, capital V with overstrike is V ?

ISO IR-68 is character set developed by ISO. It is used to write APL programming language. == Character set == == References == "APL Character Set for Workspace Interchange" (June 1, 1983)...

no, overstrike as in you put both characters on the same physical location of the page
it's something that all typewriters and old-fashioned printers can do trivially
but it's rather died out nowadays

Isn't that identical to the for-all character?

TIL that there is an encoding called WTF-8. It is for encoding invalid UTF-16. WTF‽

@Mr.Xcoder I've still got more gold & silver badges on SO... but I've got way too many bronze badges on PPCG

2:21 PM
@Neil I've got even more bronze badges on PPCG (I have 140, you have 138)

probably because I haven't asked enough questions

Yup
I have much more bronze and silver badges on PPCG compared to SO

2:26 PM
What?...
@user202729 My profile says "61 badges", which means I have 61 unique badges: I have some multiple times

Also, I hate onebox...

@user202729 that counts multiple of the same badge as one

For instance, I have 39 "Nice Question"s
@dzaima s/tag/badge/

Ok, how does tag badge work? What is "score"?

Score is the total number of upvotes - total number of downvotes you received on answers for challenges tagged with the one you are looking for.
You must have a certain threshold of answers too
Which increases as the value of the tag badge increases
P.S: Once you get a gold tag badge, you can hammer (single-handedly close / reopen) challenges with that tag that are/(n't) duplicates

2:35 PM
@Mego: I think this is correct (first column is position in codepage, second is character as string, third is character as Unicode codepoint)
several elements are omitted, those are gaps in the codepage
name should be "EBCDIC (CLC-INTERCAL)", I suggest

Shorter way in Ruby (<54 bytes, my best) to print n terms of an arithmetic sequence starting from 0 with common term r?

Input
6 2
Output
0 2 4 6 8 10

Input
4 0
Output
0 0 0 0

Anonymous
@ais523 Perfect! I can work with that!

@MarcusAndrews Ruby? Hm...?

Anonymous
@ais523 Done

thanks

Anonymous
2:49 PM
Let me know if you have anything else you want added

Anonymous
Also: JSON is the easiest format to work with, so if you can manage that, it makes my life a lot easier

wow, that really brings home just how weird EBCDIC is
I might need something in the future (I'm working on a golflang with its own encoding) but not right now

Anonymous
Sure! Just ping me and I'd be happy to help.

incidentally, EBCDIC is the reason why the C standards don't require letters to be contiguous

2:51 PM
(like they require numbers to be contiguous)
ASCII letters, that is

@MarcusAndrews 29 bytes: ->n,k{(0..n-1).map{|i|p i*k}}

output would need to be same line

Anonymous
EBCDIC 037 is the EBCDIC code page I'm most familiar with, thanks to having to learn COBOL in college

Pft
:P

2:52 PM
my best is

n,r=gets.split.map &:to_i
puts n.times.map{|i|i*r}*" "

Anonymous
That one is implemented in CPK as cp037

that one's a lot more complete but just as bizarre :-)

@MarcusAndrews 51 bytes
puts (0...(x=gets)[0].to_i).map{|i|i*x[2].to_i}*" "

impressive!

3:08 PM
If you allow quotes around the output, puts can be changed to p.

yay, the review queue icon changed...but is it clear?

@EriktheOutgolfer I'd say yes

Is there a shorter way to convert hex to decimal in ruby than p gets.to_i(16)?

@EriktheOutgolfer More clear than the previous writing-a-journal-entry icon.

well, "review" now comes to mind at least

3:24 PM
Or a bash method perhaps

echo $((0x$n))

any way to do this without read n?
for a single hex sent in through stdin?

I either have a nasty bug, read the formula wrong, or the g.f. for A636 is incorrect. Can you verify that (1/2) * (1/(1-x*R(x)) + (1+x*R(x)) / (1-x^2*R(x^2))) is $\frac{1}{2} \cdot \Big( \frac{1}{1-xR(x)}+\frac{1+xR(x)}{1-x^2R(x^2)} \Big)$?

@NieDzejkob Correct. / What do you get as R(x) (coefficients)?

nvm found shorter ways

Well, even if it is incorrect, we're confident that there exists a g.f. for this sequence and create one ourself.

3:34 PM
someone should check what's going on on this question; there's a 3-byte Jelly solution that fails on empty input, and a 5-byte solution that succeeds; people have been rejecting the 3-byte solution, so I tried to edit an explicit requirement to work on empty input into the challenge, but the author rejected it

my Taylor series implementation gets fibonacci right using the g.f. and it exercises basically every function

so at the moment the answers and questions don't match

Wait a minute, got to check ais523 linked question first.
Well, in competitive programming, people try to assume as little as possible (if something is not explicitly specified, it may be false), here people try to exploit as much as possible, such that a long list of banned things must be written.
Ok, return to the OEIS thing. The r is correct, but the A636 is not.
First I should check if Taylor implementation is correct.

9 mins ago, by NieDzejkob
my Taylor series implementation gets fibonacci right using the g.f. and it exercises basically every function
But if you want, here's my current implementation in Python:

Your implementation is correct, except that you forgot the 1/2. But it's nice, because now I have to think why does it work that way. Thanks OEIS for being incorrect!

3:47 PM
0

Gerrymander code-golf graphical-output grid Background The United States has a unique love of gerrymandering––the deliberate manipulation of an electoral district to predict certain voting results. Just recently there was a gerrymandering case brought before the Supreme Court. Gerrymandering, ...

@Fatalize Is the Brachylog chatroom frozen?

@Zgarb Yes

@user202729 yeah, right, I had the 1/2 before and it wasn't giving the right results so I removed it while debugging...

sorry, that's probably a consequence of me deleting my account a while back
I'd have had more to complain about if I was using it more actively ;-)

Hah

3:49 PM
Finally decided to polish up & publish my SOGL keyboard thing :D

There has been little activity on Brachylog overall in the past months, the main reason being that I kind of stopped working on improving it
this lead Erik and LeakyNun to not use it much anymore I think

I decided to give it a try, and my first program feels clunky.

well, it still has a much better paradigm for golfing than most other golfing languages
the list/generator split is really valuable

@Zgarb Well show us!

and the symbolic computation is mildly valuable because it means you don't need to explicitly specify a maximum for your brute-forcing

3:52 PM

(Brachylog sucks with floats btw :p)

that's not far off, this is just the sort of problem that misses all of Brachylog's strengths

Yeah, I realize that it's not optimized for numerical computation

^^

meaning that you're basically using it like Jelly without the various shortcuts Jelly has to improve this sort of thing

3:54 PM
Or probably just reference the wrong sequence. @NieDzejkob

Is there a simple way to bind the norm to a variable and map division by it over the input, or something?

no, and this is actually one of the largest fixable problems in Brachylog

@user202729 it is supposedly from the Polya paper but the link is paywalled

the parser can't handle communicating a variable from one predicate to the inside of another

3:56 PM
there's no inherent reason why that is, we'd just need a better parser

@Zgarb Yeah this is the main last thing I wanted to improve but it's obnoxious to implement
You can save one byte like this though: {^₂ᵐ+√}ᶻ⁰/ᵐ`
(brb)

@user202729 how?

learning German