« first day (2951 days earlier)      last day (1898 days later) » 

12:45 AM
also, 56 for english to alien translator: r"%v"_d"a_oauieu_o"pu)+Zv d'i"ni"'o"pi"'u"ki"'a"bo"'e"nu
no idea how to make it shorter. other golflangs appear to be using titlecase, which Japt lacks :(
@DJMcMayhem re: that score system post, there is a way that works almost all the time, since we have (mostly) consistent post formatting... it's called SEDE querying
53: r"%v"_d"a_oauieu_o"pu)+(A="iniopiukiaboenu" tAbZv)Ä,2
 
1:10 AM
47: r"%v"_da¬auieu¬pu)+(A=Ä<piukia¾u` tAbZv)Ä,2`
 
1:26 AM
maybe i should start using something other than japt. i wonder what would be a good idea
 
Isn't there a way to do a codeblocks without the indent?
'''
''' or something like that?
 
``` or ~~~, optionally with language name after the opening one for highlighting
 
Figured out the backticks right as you posted that. Thanks
 
2:03 AM
@Shaggy any clue why "factorial\nsquare\ncube\nprime\ncomposite\ntriangular\npositive\nnegative" makes shoco error when running it through your permutation string array thing?
 
2:14 AM
Snapped off a challenge that is kinda simple but I think unique enough to possible be interesting
please no bully
 
0
Q: Generate a Baseball Pitch String

VeskahGoal Write a program or function that takes a positive integer n and randomly generate a legal series of pitches (a Pitch string) of length n. Input A non-zero, positive integer n <= 100 Output Return a random string, or list of characters, that represent a possible, valid pitch string of le...

 
2:29 AM
.h(n,x) or i(a,n=0)
.i(n,x) or i(a,n=0)
:| japt documentation, why
 
0
A: Sandbox for Proposed Challenges

Quinteckolmogorov-complexity Kolmogorov Complexity Machine Given a string, return a golfed program (in any language, not necessarily the language of the answer) that outputs that string. Just an idea fragment currently, I see many issues Scoring? I thought of (average ratio of (output / length of in...

 
 
1 hour later…
3:38 AM
0
Q: Am I a Rude Number?

GryphonFor a while now, I've been running into a problem when counting on my fingers, specifically, that I can only count to ten. My solution to that problem has been to count in binary on my fingers, putting up my thumb for one, my forefinger for two, both thumb and forefinger for three, etc. However...

 
3:50 AM
0
A: Sandbox for Proposed Challenges

CG One HandedUnique Skittle Pairs code-golf This is my first question, so hopefully it's OK. I like to eat Skittles. However, I only like to eat them in pairs, and and those pairs must not have two Skittles of the same color. Your task is to find the most pairs that you can that match these requirements. C...

 
 
1 hour later…
5:16 AM
I'm actually surprised how golfy Japt is even though it's a variable(?)-based language
 
 
3 hours later…
8:41 AM
Subscribe to Pewdiepie
 
9:12 AM
CMC: Write a program that outputs a string made by concatenating all the characters at odd indexes of the original program (assuming 1-indexing).
 
@Arjun Program/function/expression?
 
Whatever you wish
 
@Arjun APL (Dyalog Unicode), 8 bytes ` 4 / ' '` (has leading space)
For once, a competitive APL answer that is ASCII-only!
 
I am pretty sure many esolangs will do this in single byte
so not a good challenge :|
 
3 bytes in 05AB1E (or 8 bytes for ASCII-only)
 
9:26 AM
@Arjun PHP, 1 byte: ` `
 
html too, I guess
 
Ah, I read input, not program so ignore my comment :P
 
 
1 hour later…
10:42 AM
0
Q: It took me a lot of time to make this, pls like. (YouTube Comments #1)

ArjunHold up..... this isn't trolling. Background These days on YouTube, comment sections are littered with such patterns: S St Str Stri Strin String Strin Stri Str St S where String is a mere placeholder and refers to any combination of characters. These patterns are usually accompanied by a I...

 
 
2 hours later…
12:38 PM
I'm not sure where, but I think I've seen this site's favicon before... blloc.com
10
 
Ven
1:23 PM
o_o
 
1:48 PM
@NewMainPosts I swear this is a dupe, but I can't seem to find it.
 
2:06 PM
@AdmBorkBork Maybe thinking about this?
 
@Fatalize Similar, sure, but the one I'm thinking of took input.
 
Can't find it either
 
2:39 PM
@Dennis It's an APL symbol:
 
Ven
2:57 PM
wait, it is?
TryAPL gives me "invalid token"
 
@Ven Not in use by any APL I know of, but Unicode has it as an APL symbol. ¯\_('⍜')_/¯
 
Ven
Do you know of one that used to?
 
@Ven No.
 
Ven
Well. There are some keys on my keyboard I don't use, so..
 
@Ven is on all current APL keyboards without being used by any current APL
 
Ven
3:01 PM
Just in case you need that surprised-pikachu-face in one of your matrices..:)
 
@Ven I've used it in my Extended Dyalog APL for Over/Depth.
 
 
1 hour later…
4:07 PM
@Fatalize Found the one I was thinking of. Not a dupe, but closely related.
 
Hey @JoKing
https://code-golf.io/scores/perl6
 
4:25 PM
@Dennis Sideways TIO? I guess the design is simple enough that it's probably not just someone copying you
or did you copy them
O.O
 
Negative. They both copied the Q Source.
 
4:59 PM
@AdmBorkBork TNB: come for the code golf, stay for the Biblical scholarship...
 
Hey, I gotta put my minor in Religious Studies to good use somewhere.
 
5:30 PM
Random C++ question: Is there a way that I could force this program to give a single error on line 16 rather than the gross long errors that boost gives?
Just to make the stuff class easier to use.
 
6:09 PM
i just wasted an hour reading biblical authorship theories <_<
 
What can I say except "you're welcome"?
And now that's stuck in my head...
 
7:06 PM
2
Q: Swapless distances

Sriotchilism O'ZaicSuppose you have a string \$s_0\$ and someone else has a hidden string \$s_1\$. You don't know what \$s_1\$ is but they tell you that they can get from your string, \$s_0\$, to their string by making a certain number of moves \$d\$. Each move can be one of the following: Insertion : Add a ch...

 
 
1 hour later…
8:21 PM
Actually used the sandbox instead of being Silly on Main
 
0
A: Sandbox for Proposed Challenges

Seanny123Reducing switches in a binary array Write a function to reduce an n-dimensional array's toggle/switch count for each row to be less than or equal to a desired toggle count. However, simply sorting the array isn't an option, because: The Hamming distance between the original and modified array ...

 
Yes, that's me!
Thanks bot.
 
8:47 PM
Ideas for empty set symbol? There's about a gazillion in the unicode space - there's one listed as an APL symbol so that's probably well supported by fonts, but it isn't called an empty set there. Alternative would be the one in the math space, or maybe others?
 
I believe ∅ is the correct one to use
 
@Οurous APL's is an empty numeric vector (which is a set, yeah), but I'd use the default mathemathical notation for them
 
@Οurous The APL symbol is the empty simple numeric list (APL differentiates between the types of empty arrays), which is why it is a digit zero with the APL symbol for "without" ~.
 
Yeah I'll go with ∅, thanks :)
 
APL symbols might be appropriate for programming languages, but likely aren't for mathematical discussion, the same way you wouldn't use === for equality in a maths paper
 
8:51 PM
In fact, the same value as returns can be obtained with 0~0
 
although most languages use digraphs of ASCII for operators, rather than having their own set like APL and Brachylog
 
@Adám I personally like 0 0⍴0 best :p
 
@J.Sallé But that's a 0-by-0 matrix, which btw can be golfed as the emoticon ⍬⊤⍬.
 
I mean 0⍴0 actually. 0 0⍴0 is a matrix
That's a nice emoticon btw
 
I'll assign ⍬ as an alternate for the same thing, since lists only have one type in Dirty
 
8:54 PM
does APL distinguish between ordered lists and unordered sets?
 
@J.Sallé Also ⍴⍨0, but why do you like 0⍴0 over ?
 
@Adám over 0~0. It looks better IMO
 
@ais523 No, it has a very simple type system. There are only arrays.
 
fwiw, I think the optimum for a golfing language, except possibly one where the operators do things that vary wildly based on context, is for the only data types to be "number" (probably bignum-rational), and "array"
 
@ais523 I settled on that too a few days ago, actually :)
 
8:57 PM
I think it's probably best to allow arrays to be untyped in the sense that they don't care what type their elements are, because some problems require heterogenous arrays to work
now a string is an array of codepoints, etc.
 
Huh. Somehow I think I'm in the wrong. For the YouTube comments challenge, the two PowerShell answers print "O\nO\nO" for input "O" while every other answer just prints "O"...
 
@ais523 A number is just a 0D array
@ais523 A string is a 1D array of characters, not codepoints.
 
well, if "number" is your only base type, there's no character/codepoint distinction
in every golfing language I've seen which makes the distinction, it causes problems
also, forcing your arrays to have fixed numbers of dimensions is a problem in programs that want output like [[],[[]],[[[]]],[[[[]]]]]
those maybe aren't that common, but they come up often enough to want languages to be able to deal with them
I guess there's a big difference in philosophy between languages that want the data types to reflect the data directly, and languages which just want to provide a set of data types that can be used to encode any data you care about
 
CMC: Given an array of positive integers, output an array where each element corresponds to an empty array at depth n. For example, 1, 2, 3, 4 -> [[], [[]], [[[]]], [[[[]]]]]
 
@DJMcMayhem Can we take the array-1 instead?
 
9:05 PM
Sure, why not
 
Brachylog, 8 bytes: {;Ėg₍}ᵐc Try it online!
if you're taking the array minus 1 you can omit the final c, for 7 bytes
also, first time g₍ has actually been useful?
Brachylog has several builtins that are there for elegance/orthogonality rather than because they're expected to come up in practice
 
Hurray, finally cracked 1k. Fun fact: It takes less time if you do more challenges
 
the real challenge is getting 1k from a single question
(stasoid has gotten over 5k from a single question)
 
@ais523 Wouldn't you want more types? That way you could infer from the problem what is more likely wanted? For example if the problem is on a graph your array manips would probably mostly do nonsensical operations on it while you could have a bunch operators specifically for graphs.
 
9:12 PM
@SriotchilismO'Zaic that's what I was hinting at when I said "operators that do things that vary wildly based on context"
even then, though, you end up spending lots of linking charactetrs to convert between types
 
and a good set of builtins could well do reasonable things on both arrays used to represent arrays and arrays used to represent graphs
(e.g. matrix multiplication is a meaningful operation on adjacency matrices)
 
@ais523 I would suspect that a need for lots of links would be because you chose your builtins poorly.
 
well, the extreme is where you basically have two separate languages, one for array manipulation, one for graph manipulation
based on what data types you have in the input
 
@ais523 Would that be for like transition matrices?
 
9:14 PM
but a surprising number of problems benefit from jumping around between definitions
 
@ais523 And another for string manipulation, another for Kolmogorov-complexity, etc.
 
in general, I think string manipulation and array manipulation challenges tend to need similar builtins
the main difference is for charset-dependent builtins like "lowercase", array problems tend not to need those
in Brachylog, I've often been frustrated by the array builtins I wanted to use not working correctly on strings
 
@ais523 Sure, but K and Extended Dyalog APL pair the arithmetic function(s) with case folding.
 
addition is a meaningful operation on codepoints, often; I guess multiplication and division are less often meaningful
although if you have a problem like "decode UTF-8 without the use of encoding-related builtins", being able to mix strings and integers and arrays is pretty useful, as it doesn't naturally fall into any of those categories
 
@DJMcMayhem 05AB1E, 3 bytes: €F)
 
9:18 PM
@ais523 Floor and Ceiling are obviously lowercase and uppercase.
 
hmm, those don't obey quite the same arithmetic properties; floor(ceil(x)) = ceil(x), but lc(uc(x)) = lc(x)
 
@ais523 One thing I've contemplated for arithmetic on characters is for the system to "remember" that this number "wants" to be a character and change it back to a character asap. E.g. ⌈'y'÷2⌉ should give '='
 
would be nice if we could somehow create an encoding so that the mathematical effect on codepoints matched the alphabetic effect on strings
 
@ais523 True, that's one of the complaints I've gotten for my idea. K only has floor though.
@ais523 E.g.?
 
floor(ceil(x)) should equal wall(x)
 
9:23 PM
like, there's some useful mathematical operation on numbers, and if you perform that operation on the codepoints, it does case-folding (or some similar string operation)
 
@AdmBorkBork wall?
 
@AdmBorkBork not really, the floor of the ceiling is the bottom of the ceiling, which is still at the top of the room
 
Nevermind. Apparently it was funnier in my head. ;-)
 
(which is why you have floor(ceil(x))=ceil(x) mathematically)
 
@AdmBorkBork No, it was good. I exhaled through my nose slightly harder than usual
 
9:24 PM
the wall connects the floor to the ceiling, so it's more like range(floor(x), ceil(x))
which is Jelly's actual behaviour if you try to use a non-integer real number as an array index
 
lower(upper(x)) is actually useful for "normalising" Turkish. I've mapped that to abs(). So |'İiIı' is the same as ⌊⌈'İiIı' which gives 'iiii' whereas ⌊'İiIı' gives 'iiiı' and ⌈'İiIı' gives 'İIII'
 
9:41 PM
well, i and ı are entirely different letters in Turkish, so normalising them to the same thing will destroy the original meaning of the string
it'd be like normalizing l and f to the same letter in English
 
@ais523 What's wrong some arguments causing the function to have different properties? The floor of a real non-integer is always to the left of that number, but the floor of a complex non-integer may be to the right (but below). E.g. ⌊0.9+0.1i⌋=1 if ⌊z⌋ is the complex integer y such that |z-y| is minimised.
 
@Adám I consider that to be wrong, too; in general I don't think floor is a meaningful operation on complex numbers
for the same reason that greater-than isn't
 
@ais523 I realise that, but that's the only sensible locale agnostic normalisation since Unicode refused to encode lowercase i with dot and uppercase i without dot.
 
there is no sensible locale agnostic normalisation, the best you can do is a non-Turkic casefold
which would presumably treat İ and ı as invalid input
 
@ais523 Wolfram Language instead floors each dimension separately. APL does as I described. It is of course easy to do the parts separately, but the closest integer isn't so easy.
 
9:47 PM
http://mathworld.wolfram.com/FloorFunction.html
> The floor function |_x_|, also called the greatest integer function or integer value (Spanier and Oldham 1987), gives the largest integer less than or equal to x.
 
doesn't this mean that floor(0.9+0.000000001i)=1?
under the APL definition?
 
if we've already decided that greater-than isn't meaningful for complex numbers
 
that seems wrong
 
@ais523 Comparing magnitudes is obviously easy, but then you end up with things like neither a<b nor a>b being true while a≠b. In the Total Array Ordering we recently added to Dyalog APL, we compare the real parts first, and tie-break by the imaginary part.
 
then "less than or equal to" surely isn't
therefore floor isn't
 
9:48 PM
fwiw, my preferred treatment of complex numbers is to interpret them as vectors
so 3+4i would be the array [3, 4]
 
seems like wolfram is just doing its best to guess
 
most operators generalise the same way to both representations, when they generalise at all
(this implies in turn that lexicographic ordering of complex numbers is likely to be the "correct" one)
 
@ais523 That's what we do for ordering.
 
so logically, floor(3.5+6i) should be 3+∞i
as the greatest complex integer less than 3.5+6i
 
@ais523 well... it would be meaningful if there were separate types for different representations of a complex number/representation matters, and then you floor each component and return a vector :P
 
9:51 PM
@ais523 No, because the magnitude of a NE number cannot increase.
 
floor(-5.5) is -6, that causes the magnitude to increase
I think your definition is broken if you have floor(-5.5)=-6 but floor(-5.5+0i)=-5
 
@ais523 -5.5 isn't a NE number.
 
i'm pretty dead today. is this convo about operator overloading?
 
@Poke yes
 
@Poke It started with the question of desirable number of types in a golfing language, inspired by a request for a good symbol for the empty set, with the suggestion of APL's which is a type-specific empty list.
 
10:00 PM
i like operator overloading in the simple case of string concatenation and not much else
makes the code harder to read for a noob
 
@Poke Hardly a concern for golfing langs
@ais523 Hm, some of what I wrote wasn't quite right. The full treatment is given by E.E. McDonnell (1973)
 
are golfers usually concerned with Asymptotic Time complexity and DS
because it seems like they would have to be
or is the objective to simply do it in as short a statement as possible.
or are these things mutually exclusive
 
@Rick Short code length is the only objective. We'll still wait for the result, long after the heat death of the universe.
 
@Adám but isn't length a relative term. There might be a huge method underneath an otherwise short method name.
even vectors and arrays have underlying methods from which they emerge.
 
IMO, if you have a program that solves your problem and you can't run it in a reasonable length off time, what you need is a better compiler rather than a faster program
 
10:14 PM
@Rick Sure, that's the point of dedicated golfing languages; move as much code as possible from the "user code" to the interpreter/compiler.
 
@Rick the way to think about it is that we're trying to communicate the idea behind the task we've been set as tersely as possible; so code golfing is about discovering new forms of communication
what's the shortest way we can express the concept of "print all odd integers from 100 to 1 in reverse order", for example?
 
I was about to type something up to a similar effect, but that's a way better wording than I could have come up with
 
@Rick Well, one could make a competition in least amount of NAND gates (or NOR gates), but that isn't very fun for more complex tasks, I'm afraid.
 
besides, implementing a problem entirely using NAND gates probably isn't the most efficient way in practice
 
@Rick FWIW, some people also golf in Machine code, or turing tarpits which is like the opposite of using libraries or long methods. Even expressing simple concepts can be really challenging
 
10:17 PM
if you want to know which of two (real-life) objects is heavier, you don't make a set of digital scales and a comparator, you use a pair of analog scales (which is just a stick and a pivot)
 
(Side question: are modern computers build of NAND or NOR gates?)
 
People use those in spite of them being less competitive, simply because they're fun to golf
 
so to say something in as concise a manner as possible, or to boil it down to its essence.
 
@Adám not entirely; if you don't count the RAM, though, they're about 99% made of PMOS and NMOS transistors, which are typically combined into NAND, NOR, NOT, or a variant/mix of those
 
@ais523 Uh, I didn't mean that as a yes/no question, but as a "which one" question.
 
10:19 PM
PMOS and NMOS give you "true if 0" and "false if 1" conditions which can be combined with and/or; so a "NAND gate" is an arrangement of PMOS and NMOS transistors that form the expression "the output is true if input A is false or input B is false, and the output is false if input A is true and input B is true"
I believe NAND gates are more common than NOR gates, although they're both used, as are NOT and various complex hybrids
 
@Rick Yes, or to achieve a task in spite of the simplicity of the language/computation model
 
but PMOS and NMOS are the core
RAM is an exception because it contains a large number of capacitors, which have time-dependent behaviour
(this is because the purpose of RAM is to persist values over time, and it's much cheaper to use a time-dependent component and refresh it now and again than it would be to use a bistable circuit)
incidentally, the reason to use NAND gates isn't just because they're universal, but because the definition of CMOS (i.e. a PMOS/NMOS combination) requires you to invert the inputs every time, so a NAND gate is easier to build in hardware than an AND or OR gate
 
@Rick Yes, and the ultimate brevity is of course the single built-in for the entire problem posed.
 
Could someone, in the same way, say, that all probability problems are just volumetric problems in disguise.
 
and the reason NAND gates are more common than NOR gates is that the 0 and 1 logic levels aren't symmetrical in practice, normally your ground has more capacity than your power supply does, so a 0 pulls "stronger" than a 1, and that affects things like how many devices you can connect without an amplifier in between
but CMOS allows you to create any Boolean expression as long as the output is (non-strictly) decreasing in every input
so NAND, NOR, NOT, and various combinations are all used as single gates
 
10:24 PM
@Rick I wouldn't say that. Rather there exists a set of essential operations (like subtraction and multiplication) that are very versatile for both domains.
 
@Adám not necessarily, sometimes people outgolf single-builitin Mathematica questions via finding a multiple-builtin solution with shorter names
even within Mathematica itself
(most languages, however, don't add builtins if it would be shorter to write the program without them; Mathematica is something of an extreme case)
 
@ais523 Sure, but then it is just a matter of spelling.
 
not quite; the more builtins you have, the longer their names will have to be
a golfing language I've been working on uses a six-bit character set (so 64 characters); that means the builtins have shorter names than in almost any other language, but means you can't have nearly as many single-char builtins
 
@ais523 Sure, but again, this is just a matter of spelling. Ultimately, an infinite collection of languages, each with a single (the empty program) built-in for a particular problem ensures "winning" every challenge.
 
@Adám also known as MetaGolfScript
but it isn't interesting, because no single language in the collection is a good one for general-purpose communication
a special-purpose language will always be capable of beating a general-purpose language if both are written well, but it's general-purpose communication that we care about
 
10:29 PM
@ais523 ngn has for a while been asking for a Huffman encoded dialect of a strong golfing language.
@ais523 Exactly.
 
@Adám I would like to see that too, but you'd need to golf a lot of programs to gather information to determine suitable weights
not only that, but some builtins would likely become unnecessary if you Huffman-coded the language, due to duplicating something that would have a comparable length if written using different builtins
 
@ais523 Hm, wouldn't it be wonderful if there was a publicly accessible website with a large collection of code golf problems solved in a couple of strong golfing languages…
 
@Adám indeed; in fact, there are two of them, although Anarchy Golf would probably be an easier one to parse the programs from
I'm not sure if it contains many really modern golfing languages, though
even then, though, I'm not sure the collection on PPCG is large enough
and it's also biased in that easy problems are more likely to be solved (both in general, and in golfing languages in particular) than hard oens
 
@ais523 Good point. One would need to define each not-obviously-needed built-ins each in a variety of ways using obviously-needed built-ins, and iterate encodings to gradually optimise.
 
in Pycnolog (one of the golfing languages I'm working on) I'm going to the extent of making all redundant builtin combinations into new builtins
e.g. the code which would mean "add 0" is interpreted as an entirely different builtin, because adding 0 is not a useful operation
 
10:34 PM
@ais523 I suspect that it is good enough consistently beat Jelly and O5AB1E.
 
@Adám well, yes, but I'm a perfectionist
 
@ais523 it can be useful in a recursive function
 
@Rick I mean, the literal code for adding 0; if you add a variable that happens to hold the value 0, then that just adds 0
it's an encoding, not a semantic
 
Interesting
 
@ais523 Ah, so and ÷1 and -0 etc. just map to something else.
 
10:37 PM
right
it seems like an easy way to get a set of two-char builtins without losing any of the space for one-char builtins
 
And so too (if you have normal decimal numbers; though I doubt that) 00 doesn't equate 0 and 1.00 doesn't equate 1.0 (or 1)
 
in Pycnolog, small numbers are written in bijective base 11
or, not quite bijective as Jelly defines it, but a bijection is involved
 
@ais523 OK, but how would you avoid the 1 in gluing together with whatever is on its left?
 
of course, with larger numbers, you want an asymptotically optimal encoding
@Adám by using a more consistent syntax than the one you've shown
 
@ais523 You should map all numbers in ascending length order to the most-to-least frequently used numbers!
 
10:41 PM
as a concrete example, "multiply by 1" is X1 (which IIRC is a primality test), and all integer constants must be immediately preceded by a capital letter, thus it's impossible for the 1 to merge with anything else
 
@ais523 OK, but can an integer follow that then?
 
@Adám I considered that, and did in fact give shortcut encodings to a few commonly used high numbers; the issue is that low numbers tend to be used more frequently than high ones as-is
@Adám what are you doing with the integer?
an integer by itself is not a program
 
@ais523 I think 10 is more frequently used than 7
@ais523 Dunno, is it stack-based?
 
@Adám yes, but they're both 1 character long in base 11
@Adám no, it's using a method of passing information around which I don't know has a name yet; it's inspired by tacit syntax but isn't the same
 
@ais523 OK, 100 is more used than 7 too.
 
10:44 PM
@Adám I'm not sure on that; let me find my list of numbers by frequency of use
 
@ais523 Even if not, surely 1000 is more used than 23, no?
 
1, 2, 3, 4, 5, 6, 10, 8, 7, 9, 20, 12, 15, 11, 14, 0, 30, 13, 16, 18, 25, 17, 19, 24, 100, 21, 22, 50, 23, 40, 28, 26, 27, 29, 31, 60…
and yes, 100 is more used than 23, but they're both two digits in base 11
 
@ais523 are bijective sets a subset bipartite sets.
 
there's a reason I picked base 11 and not base 10
@Rick no, bijective means that two things have a 1-to-1 correspondence with each other, you can convert one to the other and back again and always end up where you started
fwiw, I find the "list of numbers by how often they're used" really interesting to look at
 
@ais523 For which language?
 
10:47 PM
the original source is the entire text of English-language books in Google Books (I obviously don't have access to the original raw source for copyright reasons, but I do have access to the frequencies of every word that appears ≥30 times in it, and numbers are treated as though they were words)
so English, I guess
fwiw, I've long had a project to use this data to create a string compressor for a golfing language
 
@ais523 Oh, but that's probably radically different from in programming.
 
Yeah, I'd imagine powers of two show up a lot more in programming than in English
 
@Adám maybe not radically; the powers of two are the main exception that comes to mind, but both programming and English are meant to describe real-world problems
fwiw, 4294967296 is the 36481th most common number in this list, so pretty common compared to how large it is
but 256 doesn't appear until position #376
65536 is in position #4734
(even then, 256 in golfing challenges seems to appear almost exclusively in the concept of "number of possibilities for a byte")
actually, the list goes down to numbers that were used 40 times, not 30 times
such as 119146, 447457, and 2042000000
 
@ais523 I just analysed 2000 lines of random APL code: 1 0 2 4 3 32 5 6 9 8 11 10 22 326 256 226 80 64 14 35 7 400 13 4070 1159 999 911 819 260 141 82 30 19 2350 922 255 239 191 187 184 140 134 83 34 29 983103 3503 3501 1000 902 254 186 164 160 138 127 120 100 96 92 86 79 63 62 61 60 58 56 44 41 28 27 24 20 18 16 15 12
 
that 32 looks really out of place to me; does it have some special purpose in APL?
presumably this is affected a lot by sample size
 
10:55 PM
@ais523 This particular code deals with lots of system related stuff, so it probably refers to 32 bit systems.
 
as well as the numbers that come to mind when people happen to need an arbitrarily large number
now I'm reminded of Perl modules; they're supposed to return a value saying whether they loaded correctly, but because Perl has exceptions nowadays, they basically always end with an arbitrary truthy constant; most people just use 1 but some people are more creative, and there are people who gather lists of all the truthy constants found at the end of Perl modules
 
@ais523 OK, removing all the single-use numbers: 1 0 2 4 3 32 5 6 9 8 11 10 22 326 256 226 80 64 14 35 7 400 13 4070 1159 999 911 819 260 141 82 30 19 2350 922 255 239 191 187 184 140 134 83 34 29
@ais523 Also 326 is the code for a pointer. 80 is ASCII text. 4070 is user account name. 819 is lowercase…
 
:49239591, if it's just 1 to 1, would that just mean they are injective. Wouldn't they have to be both injective and surjective for it to be considered a bijection?
 
@Rick 1 to 1 normally means 1 in one set matches 1 in the other set; injections/surjections are "1-to-many" or "many-to-1"
where "many" here means possibly 0
@Adám oh, because APL indexes builtins by number
 
@ais523 For some special system services, yes. 4070 and 819 in this case. 326 and 80 mean 32 bit pointer and 8 bit text.
 
11:00 PM
fwiw, the list of interesting truthy constants observed at the end of Perl modules: returnvalues.useperl.at/values.html
hmm, I like the use of !(); () (an empty list) is the consensus false value, so negating that should produce a consensus true value by definition
(it became the consensus false value because it's not only falsey, it also has a length of 0 in all contexts, whereas 0 has length 1 when viewed as a string. and "" has length 1 when viewed as a list, because it listifies to (""))
 
@ais523 OK, here's the frequency table for numbers occurring at least thrice in almost 7kloc of much more representative APL code:
   1 1538
   0 1155
   2  550
   3  129
   4   87
   5   85
  10   47
   9   35
  11   34
   8   27
   6   27
  16   20
 100   19
  13   15
  50   13
   7   13
  31   12
 256   11
  32   11
  60   10
1000    8
  25    8
  12    8
 133    6
  83    6
  20    6
  64    5
  30    5
  23    5
  22    5
 255    4
  24    4
4792    3
 365    3
 101    3
  85    3
  53    3
  40    3
 
that looks plausible
hmm, would be interesting to do something like this across the whole of Github
numbers tend to be fairly comparable in usage across languages (apart from languages which use line numbers, which will disproportionately be attracted to 10, 20, 30, 40, etc., but those are rarely used nowadays)
 
@ais523 From another almost 7kloc from a charting application:
    0 1479
    1 1136
    2  464
    3  152
    4   63
  255   55
    5   53
   10   37
   50   33
    8   23
   40   21
    9   18
   30   16
10000   15
   60   15
    6   15
  256   14
  100   14
   32   14
  192   12
   20   12
    7   12
  200    9
  128    9
   95    9
   18    9
   15    9
   16    8
   12    8
   11    8
  300    6
  160    6
   90    6
   13    6
 1000    5
  400    5
  224    5
   80    5
  324    4
  150    4
  110    4
   64    4
   36    4
   34    4
 1234    3
  500    3
 
your code seems to really dislike the number 6 for some reason
I'm guessing that 10000 is an "arbitrary large number" rather than that specific value being required
 
@ais523 It is the max number of points in a single line in the graph for many line types.
 
11:14 PM
OK, so fairly arbitrary, you could reasonably make it 10001 without changing much
hmm, shouldn't that be a constant rather than a magic number?
so that it can easily be changed everywhere at once?
 
@ais523 It is a constant table for all types.
 
aha, so the various uses could plausibly be changed independently
 
@ais523 Yes.
 

« first day (2951 days earlier)      last day (1898 days later) »