« first day (2868 days earlier)      last day (2271 days later) » 

01:07
I see that AoC has "λy.2018" as one of its ways to say this is the year 2018, anybody know what language that syntax is from? looks like apl or a derivative but I think that's :=
also I find it very amusing, I'm 90% certain the people at the top of the PPCG leaderboard (top 4 at least) are all non-US
considering each problem opens in the morning/mid afternoon for uk/turkey
@Riker I thought it's some kind of lambda calculus? I don't think it's related to APL
Also, the problems open at 2PM here in East Asia
@Bubbler see, you guys have a large advantage :p
it's 2100 for me, and i'm in the westernmost portion of the continental US (east coast has 0000)
@Bubbler ah yeah that's right, I was stuck on thinking about languages
though it's probably the syntax for some lambda calc esolang
02:07
0
Q: Summation through controu integration

ImranI am trying to prove this sum formula. $$\sum_{n = -\infty}^{\infty} g(n) = \frac{1}{2i}\int\frac{\cos{\pi x}}{\sin{\pi x}}\; g(x) \;dx.$$ I do not understand why cos{\pi x} is needed here. This is because poles of sin{\pi x} are at x=0,\pm 1, \pm 2 .... Any help will be highly appreciated.

 
1 hour later…
03:07
@Riker I'm pretty sure that it opens midnight for EST.
03:30
@NathanMerrill iirc JS lint doesn't mandate but 90% of JS ppl I've seen use 4 spaces
I reserve my permanent spot at the bottom of the AoC leaderboard to work on halite
04:25
@Zacharý eh close enough
@Quintec fair
05:12
I have done a terrible thing. I wrote an Eval() command for my 2D language.
Pops a string, creates an execution context using that string as code, returns a Func<bool> that gets pushed to the pointer's stack, further executions of that pointer pop that func, invoke it (running 1 tick in the Eval-context), it returns whether or not it should continue executing. If so, push the func back onto the pointer's stack and don't move, otherwise increment pointer position.
AoC Day 6 is out
This one's pretty well suited to APL
(and part 2 is way easier than part 1, weird...)
 
2 hours later…
06:57
0
Q: C++ help please :)

ExpertProgrammer2.) A user-defined function that will prompt the user to input how many words (1 to 10 only). The input word/string must be converted to uppercase. Determine how many of the strings entered is PALINDROME or NOT A PALINDROME. A palindrome is a word, phrase, number, or other sequence of symbols or...

07:29
@Bubbler hmm, how long did your solution take to run?
@Cowsquack About a second for both parts, in Python. Didn't actually try in APL.
My solution is like O(rows*cols*#coords) where rows and cols were determined by manual inspection
huh that was also mine, but it took a lot longer
(30s to do both parts, with part a taking over 20s, in apl)
How large was your actual size? Mine was 500*500*50
I had 320*320*50
probably poor apl skills on my part
Building a very large intermediate array takes long indeed
07:43
before going off to school i spent ~10 mins trying to do it but forgot to take equal distances into consideration so nothing worked :|
07:57
@ASCII-only @dzaima fixed if you wanna check link i think the problem was doing monomer* head = (monomer*)malloc(sizeof(head)); instead of monomer* head = (monomer*)malloc(sizeof(monomer));
@betseg Looks like sizeof(head) would be only 4 or 8 bytes. That's definitely an issue
yeah
08:24
0
A: Sandbox for Proposed Challenges

Vedant KandoiFill the bucket Your task is to fill the bucket with numbers upto a given input. Numbers start filling from the left, then right. After overflow, the numbers start to gather around the bucket. For more then 10, use the rightmost digit The bucket: | | | | | | | | |------| ...

 
1 hour later…
09:25
0
A: Sandbox for Proposed Challenges

Vedant KandoiNumbers that can eat itself Given a positive integer, output a truthy/falsy value as to whether the number can eat itself. How it eats: number=2632 leftmost is the head, rightmost is the tail if the head is greater than or equal to the tail, the head eats the tail and the new head becomes the...

0
Q: What is the minimum number of adjacent swaps necessary to remove all instances of "ab" in a given string?

Justin CaseFor example, how many adjacent swaps are at least needed to convert some string such as abaaccbabaabcab (representing all other characters as c) to one without any instances of "ab"?

09:39
@Shaggy This will probably not hold for long, but right now ...
:p
09:54
@betseg oh :| i looked at that but didn't think that was it as the program generally worked well
10:28
-2
Q: 2D Arrays User inputs a row number and a column number then the it outputs what character that is

J.RhodesAsk a user to enter a number between 0 and 6 - This will be the rows Ask a user to enter a number between 0 and 1 - This will be the columns If the user enters an invalid response then the following should be displayed "Element not recognised" If valid then output the value at that position in...

@betseg :|
@Downgoat ...ew. semistandard standard > 4 spacces
@NewMainPosts CMC: Given a matrix and a row number and a column number, output the appropriate element from the array, but if input is invalid (out of bounds, non-int, etc.), output Element not recognised.
@Draco18s well. every language that is even remotely decent should have eval
10:48
js is really bad at AoC without libraries :(
@Adám wouldn't this usually just be a try/catch
@ASCII-only Sure. Pretty simple, good for CMC.
AoC day 3 is already getting complicated :/
11:10
nvm. you can just "brute-force" it. (in quotes bc it seems large but is actually tiny and even charcoal could probably do it quickly)
@ASCII-only did you join the PPCG leaderboard? :D (it's on starboard)
@betseg not yet
dang, three on the leaderboard have already finished all
@betseg what's with the number to the left of the stars
> For N users, the first user to get each star gets N points, the second gets N-1, and the last gets 1.
:/
noooo
spoilers: my solutions
11:36
mine btw
Day 1 has emojicode solutions :D
12:55
Absolutely beautiful
13:55
Rep on this site is messed up.
4
@AdmBorkBork In what ways?
My throwaway answer on Arnauld's "Universe" challenge, posted just to show an upper bound, is the highest-voted on the challenge.
@AdmBorkBork I'm not surprised. The same think happened with Moby Dick and probably several other code-challenges.
21
Q: Are baseline submissions serious contenders?

DennisOne of PPCG's oldest rules, mentioned in What topics can I ask about here?, is that all answers to challenge questions must: Be a serious contender for the winning criteria in use. For example, an entry to a code golf contest needs to be golfed, and an entry to a speed contest should make som...

14:24
@ASCII-only Haha. Its not like I'm against adding it. It'll be difficult to work with afterall, due to certain characters being unable to be read in string mode (namely " and \n) and any IP spawners inside the string will spawn a pointers in the base code as well (so that's 6 characters that are problematic). It was more of a joke comment about it being a bad thing (eval is evil, etc)
@ASCII-only C
I'm also contemplating a "function call" type instruction (jump to location, get old location pushed to the stack)
 
1 hour later…
15:32
-1
Q: Measuring Mountains

SkidsdevSum-It is a language I created (quite late) for the Language Design Contest in TNB, for which the theme was "Range". Naturally I interpreted this as "Mountain Range" and created a language about mountains. Sum-It code takes the form of several ASCII art mountains, using only the / and \ characte...

@Zacharý I find it interesting that he's sitting infront of a large Transgender Flag
Ah, I see now that it's because the money raised for him to make this video was donated to Trans*Code
15:55
@Dennis FILE *foo = fopen("./foo.c", w); fprintf(foo, "%s", your_code); execl("/usr/bin/bash", "bash", "-c", "gcc ./foo.c -o foo && chmod +x foo && ./foo")
exec is cheating. :P
@Dennis ah but he didn't use exec... he used execl ;)
There's even libtcc for a real eval, but it's arguably not part of C.
something something goto*&L"FOO";
That's machine code though, not C.
16:09
oh yeah
I've always wondered why you need the *&, it seems like a redundant operation
GCC extension...
Why are open and fopen in different manual sections (2, 3) when the pages are both for C library calls
open is a system call.
16:26
filename must be either a binary executable, or a script starting with a line of the form:

           #! interpreter [optional-arg]
What if I have binfmt configured to run plaintext F# scripts :thinking:
Considering the 5+ seconds F# needs to print Hello World, isn't it a weird choice for scripts?
Not if I'm working on advent of code and will only run the script once
It's just a more convenient way to compile& run them from the console.
However usually it doesn't work when there is >1 optional arg.
Also,
$ time fsharpi hello.fsx
Hello, World!
fsharpi hello.fsx  2.16s user 0.11s system 101% cpu 2.245 total
Ah, it's for AoC. That makes sense.
Still 3 seconds on TIO. :/
16:37
I like how it used 101% of the CPU to process that.
Probably some parallelism in the fsharp interpreter
It used 1.01 cores on average. Calling that 101% is a weird choice.
I feel like that is normal. I remember at an old job where we had 1600% cpu
for some reason I have the sudden urge to learn C and make an interpreter for a CIL-inspired language
@NathanMerrill at my old job we used AWS virtual instances, and it was always fun to see a 4 core VPS reporting a load average of 879 in htop
@Skidsdev Why learn C? The C# interpreter is written in C# and the F# interpreter is written in F#.
16:48
@Pavel right, but their job is to transpile said languages to CIL afaik, not execute said CIL
@Pavel Why not learn C?
also ^
That's a good point
that point is much more valid than mine, because .NET Core, which does execute said CLI, is still 60% C#
@Skidsdev So what you actually want to make is an runtime/assembler?
16:51
@Pavel interpreter in the sense that it parses and executes the code in realtime, like JavaScript. ie: as opposed to a compiler
CIL-inspired ie: has similar syntax to CIL
Ah
Well, my favorite language for language parsing is Scala.
it has a fantastic library called fastparse, and everything else in scala is awesome too :)
so I recommend Scala, even though you probably won't take it :)
I won't
From what I can tell, Scala is to Kotlin what Luigi is to Mario
@Pavel better, yet underappreciated?
16:54
@Pavel better in every single aspect?
Basically, yeah
does that make clojure wario?
The only complaint I have about Scala is how much people love to use custom operators so it can be really tough to figure out what a piece of code is really doing
I don't know, I always felt like Luigi was a little green.
If you think of "Non-shite JVM language" you think of Scala, Kotlin, Clojure, and Groovy, which I've been trying to cram into my mario bros. analogy but haven't succeeded at yet.
16:57
@Pavel which one's the best JVM Language?
Ironically, Java
/s
because the best Mario bro is Waluigi, so that needs to line up
Waluigi > Luigi > Mario > Wario
6
I guess Groovy is waluigi, becuase he's kinda weird and the least mainstream
Except Groovy isn't actually good
creating a statically, strongly typed language in NodeJS
17:25
Hey uh I have some unallocated to the left of a LUKS encrypted partition, I found ways to grow it to the right but not left. How can I move the partition to the left so I can grow it to the right, or how can I grow it to the left?
18:11
@Skidsdev Let's be honest: with how distanced and debated Waluigi is ... he's most likely JavaScript
@Zacharý ooh I like it
Also I just finished Jon Skeet's C# reading and I loved every minute of it
Also I'm now learning C and I'm loving every minute of it
Was that last one sarcastic?
No
ooh I have the most starred messages right now :D
@Zacharý If he just started he hasn't gotten to the "good part"
@Pavel is that the part where I start screwing around with segfaults?
18:14
That.
Also, libc
Which is extremely difficult to use compared to many other languages' standard libraries
When you see a segfault in not C / C++, you know you screwed up.
@Pavel it seems to have piss poor documentation
I think all stdlibs should take a leaf out of Mozilla's book when it comes to documentation to be honest
because, as questionable as JS might be, MDN is by far the best and easiest to use docs site I've ever used
even better than MSDN, which is also really good for C#
@Zacharý Even in C/C++ you know you screwed up when you see a segfault
@Skidsdev Are you on Linux by any chance
You can find libc docs in section 3 of the manual
18:24
@Pavel I'm on Win10, but I have a Xubuntu VM running
Documentation for gcc itself is available from info, though
@AdmBorkBork thanks for dupehammering my challenge for me, I'm surprised one can't dupe hammer one's own challenge
@DJMcMayhem yeah. It just feels a bit more "WTF" to me in say D or APL than C and C++
@Skidsdev You're welcome. I agree that's a weird restriction.
18:47
Really? I'm pretty sure you can dupe hammer your own challenge even without a tag badge
@DJMcMayhem One other person has to VTC as dupe
Then you can "accept" the duplicate
At which point Community dupehammers it
@Pavel really? i have it the other way around: Kotlin is underappreciated italian twin to Scala
¯\_(ツ)_/¯
I guess its gotten more popular
i dont like either
(wields a +2 katana, ready for the Trolls and Rival Influencers)
@quartata What do you like
19:02
katanas, apparently
and codename
i like C and i like lolcode and i like enslaving little tiny bacteria to write code for me so i actually dont have an opnion
@Skidsdev actually katanas are not as good as sodegarami
I was about equally prepared for the answer to be C, Perl, or Cheddar
@Pavel the trouble with perl is that you have to use real camel probiotics for that and theyre too expensive
anyways: why sodegarami
you see the only time you die at te hands of a katana is if your rich. the samurai would not waste katanas on commoners
but the sodegarami were the instruments of direct oppression against the lower classes. theyre infused with there screams.
and it just makes the experience much richer
also they deal 1d10
better than long sword
The katana is mightier than the sword.
@quartata That was a cool read. Never knew about the comblex world of feudal japanese weapons. Thank you.
19:18
@quartata so do katanas
@Skidsdev only one lets you grapple
@PostLeftGarfHunter thank
@quartata you should probably read something about Tsujigiri if you really believe that
@quartata depends which edition we're talking about
in 5e the katana is 1d8 Versatile(1d10)
meaning you can 2h it for the 1d10, then switch to 1h (free action) to grapple
because according to the RAW you need only 1 free hand to grapple
however in 3.5e, the last edition to include the Katana as an official weapon, it was just a 1h 1d10 weapon
@J.Sallé every time a samurai gets a new weapon, 10 trillion Criminals are released to be hunted and poked with sodegarami
fact.
Can't argue with those numbers.
19:29
@quartata Weren't the Torimono Sandōgu used by samurai?
well yes but only by the low-level, Toddler samurai. they got the grunt work of poking anyone who looked too poor. so they poked a lot of people and there souls infused into the wepon
the ones with katanas were Upper Case Samurais -- minimum 1K followers
@quartata I thought toddlers used machetes.
@PostLeftGarfHunter times have changed
barely anyone is still alive from that era
True, I guess you could say a machete is just an evolved sasumata.
speaking of which
i think the toddlers have started their own fascist state next door now that theyve killed the neighbors. should i go spray them with a garden hose or sit and keep staring at this photo of bookchin.
star this message for yes
6
star this message for no
Chomsky taught me this trick. its called "elections,"
19:37
Is this one of those "interactive stories" I always hear about where you decide the outcome by making choices?
yeah so the good ending is i keep staring at this photo while the world burns
and the bad ending is i actually do praxis
You Pick
Hm I'm partial to praxis, but you said the other one was good.
they just stole one of my soup kitchen vouchers so i guess ill go get the garden hose. they took it too far.
brb
election cancelled
ok so i just turned on all the sinks in the house and i guess that was enough to overthrow them. but now i just killed about a thousand barrel cacti filled with water in the process "Balance in all things"
if this is an interactive fiction then this is really realistic moral choices
@Pavel So open just returns you a raw filehandle whereas fopen gives you a nice userland file object that takes care of buffering
You just need to keep your finger on the previous page so you can go back if you don't like your choice.
All of the f* operations are just hiding the syscalls from you but it's good because doing raw read is painful
19:50
fscanf is nice, yes
even fread. the idea is that it reads as much as can be efficiently gotten in one syscall and returns bits and pieces of what it got on demand
that's that buffering
splintering it across many reads is inefficient
especially if youre working with lines
userland does some important things (citation needed)
I'm confused by fread
It has arguments for number of items and size of item
Doesn't it just read in a single continues stream of characters?
you can make each block bigger than one character
i guess for faster moves from the buffer
It's just to make your code clearer.
size*count
20:03
@Dennis Oh so like what calloc is for
Idea: Instead of Haskell's Prelude having functions in terms of concrete types you have each function related to a type class (e.g. instead of and :: Bool -> Bool -> Bool you have and :: (Andable a, Andable b) => a -> b -> Bool).
I have a macro, #define TALLOC(type, count) (type*)(calloc(sizeof(type), count))
@Pavel What would you use instead of calloc?
@Dennis malloc and multiplication
calloc returns zeroed memory.
So you can always use calloc instead of malloc (although it might be slower), but not vice versa.
20:09
TIL, I thought both were zeroed
Memory blocks returned by malloc might be zeroed. Large memory blocks use mmap (which returns zeroed memory), unless a freed memory block can be recycled.
20:25
CMC: Given x, y and n, return the nth hyperoperation of x and y. Examples: x = 3, y = 2, n = 3 -> 3² = 9 and x = 3, y = 2, n = 4 -> 7,625,597,484,987
20:36
@cairdcoinheringaahing This isn't golfed, but F#:
let rec hyperoperation n x y =
    match n with
    | 1 -> x + y
    | _ -> List.replicate y x |> List.reduce (hyperoperation (n-1))
@Pavel Hm, I wrote exactly (I think) the same in APL as {1=⍺⍺:⍺+⍵⋄(⍺⍺-1)∇∇/⍵⍴⍺}, but I don't seem to get the right result ⍨
...which doesn't work. Dang it.
@Adám What do you get for 3 2 4?
'cause I get 27
@Pavel You mean 3[4]2? I get 27.
Yep
CMC: Consider the class class Sndable f where {snd :: f a -> a}, and instance Sndable ((,) a) where {snd (a,b) = b}. Make the corresponding instance for class Fstable f where {fst :: f a -> a}.
20:46
Isn't that just instance Fstable (a, (,)) where {fst (a,b) = a}
Or am I missing something
That won't compile
Isn't this just knuth up arrow notation past a point?
@Pavel I get the same result by implementing
@Adám So the test cases are wrong?
20:52
...the image isn't loading for me
 H←{ (n a b)←⍺⍺ ⍺ ⍵
      n=0       : b+1
     (n=1)∧(b=0): a
     (n=2)∧(b=0): 0
     (n≥3)∧(b=0): 1
                  a((n-1)H)a (n H) b-1
 }
@Pavel ^ is the APL code which resembles traditional notation (the image from Wikipedia) the most.
Ah
@Pavel Either that, or we don't understand how to implement fairly simple formulas from Wikipedia.
@Adám Wait ... that works?
@Zacharý Works as in "is valid APL" or as passes caird's test cases?
21:07
Valid APL.
@Zacharý Yes… why not?
Weird switch/case-like structure?
NEER MIND
I FEEL STUPID
@Pavel Nah, he probably was just confused by me beginning with
It just looked so much like a tradfn that I thought it was some syntax I missed.
21:09
H←{ (n a b)←⍺⍺ ⍺ ⍵
instead of
Don't worry, I always feel stupid
H←{
    (n a b)←⍺⍺ ⍺ ⍵
Yeah, that was it.
@Pavel It is just a bunch of if-statements, exactly like on Wikipedia. Only the condition is on the left of the colon, and the result if true is on the right. The last line has no condition, so it is "otherwise".
@Skidsdev Weegee > Wario > Mario > Waluigi is the true rank
21:12
@Veskah okay well first of all
Mario > Wario, because Everyone > Wario
and secondly (and more importantly) Waluigi > Everyone
Wario is a small business owner trying to live the Italian-American dream, how dare you
OK, this APL looks even more like traditional mathematical notation and still gives same non-test-case'y result:
 H←{ n(a b)←⍵
     n=0        : b+1
     (n=1)∧(b=0): a
     (n=2)∧(b=0): 0
     (n≥3)∧(b=0): 1
                  H(n-1)(a,H(n)(a,b-1))
 }
Called with e.g. H(4)(3,2)
0
Q: Walk Across a Keyboard

VaelusGiven a word (or any sequence of letters) as input, you must interpolate between each letter such that each adjacent pair of letters in the result is also adjacent on a QWERTY keyboard, as if you typed the input by walking on a giant keyboard. For example, 'yes' might become 'ytres', 'cat' might ...

Would that usage of parentheses be considered standard usage? (n=1)∧(b=0) instead of (n=1)∧b=0? Or are both equally good-style code?
21:21
also 1 0 ≡ n b is a possibility
@Zacharý It is quite normal when trying to clarify a structure to the reader. E.g. one might define parallel resistors as R←{÷(÷⍺)+(÷⍵)}.
@dzaima Yes, but that is then more removed from TMN, and the symmetry breaks at the partial inequality.
@dzaima One could also move the "otherwise" up:
 H←{ n(a b)←⍵
     n=0:b+1
     b≠0:H(n-1)(a,H(n)(a,b-1))
     n=1:a
     n=2:0
         1
 }
@Zacharý You should rather ask about H(n)(a,b-1). That's decidedly un-APL'y.
21:45
@Pavel Yes, the test case is wrong. I misread the examples here
@cairdcoinheringaahing Well, Dyalog APL, 23 then: {1=⍺⍺:⍺+⍵⋄(⍺⍺-1)∇∇/⍵⍴⍺}
@Adám I have no idea where to begin dissecting that function :/ Everything just seems more alien than normal APL
F#, some amount of bytes: let rec f x y=function|1->x+y|n->List.replicate y x|>List.reduce(hyperoperation(n-1))
@cairdcoinheringaahing It is really quite simple. It is a higher-order function. ⍺⍺ is n and is a and is b.
Which ungolfs to:
let rec f x y =
    function
    | 1 -> x + y
    | n -> List.replicate y x |> List.reduce (hyperoperation (n-1))
Which has less useful currying behaviour than
let rec hyperoperation n x y =
    match n with
    | 1 -> x + y
    | _ -> List.replicate y x |> List.reduce (hyperoperation (n-1))
21:55
@cairdcoinheringaahing Then it says if ⍺⍺ (that is, n) is 1, then:⍺+⍵ (that is, a+b). Else () use itself∇∇ but with the new n being ⍺⍺-1 (that is, n-1) to reduce / over (b) repetitions ( Rho=Repeat/Reshape) of (a).
I forgot how much I like F#
@Adám I can tell that is un-APL-y.
22:50
-3
Q: I need help!!! Please!!! DDDD:

mahnamejeffwhat does 010011 001001 010011 010100 001111 000110 010111 000011 010010 010100 000001 001111 010010 001000 010011 001111 011001 001001 001110 001100 mean? Has to be in a Format: Xxxxx xx xxxx xxxx'x xxxx.

0
Q: Map the cheaters!

K Split XAfter all assignments are submitted, a dictionary is created that maps student number to the hash of their file. This dictionary, or hashmap, or mapping (whatever your language calls it) will look as follows: {100: "aabb", 104: "43a", 52: "00ab", 430: "aabb", 332: "43a"} The key is the student...

:DDDDD
> Because of a bug in the day 6 puzzle that made it unsolvable for some users until about two hours after unlock, day 6 is worth no points on the global leaderboard.
whaaaat
RIP in peace
23:30
@Bubbler oh thank god that makes me feel better
i stayed up late to solve it early and then ragequit when it wasn't working
lmao
@quartata i'm assuming you mean the planetary destruction method from star trek. do you mean that, the marxist thing or what
23:44
praxis is when you spray people with a garden hose and the more you spray the more praxisy it is

« first day (2868 days earlier)      last day (2271 days later) »