« first day (2189 days earlier)      last day (2662 days later) » 

12:00 AM
@Pavel Wouldn't that be really easy? You just write the BF code at the start and then the Flakky code at the end
 
@Qwerp-Derp Brain-flak and Brainfuck both use the symbols []<>, and brain-flak requires them to be matched properly.
 
Yeah but that wouldn't be too hard though
 
That's why it's a CMC.
 
Once you've printed everything you can just match it up
But you would need a cell-wrapping BF interpreter or you're not allowed to use <> at all
Cause the first <> has to be a < for brainflak
 
Sure
Actually, some versions just have the tape go infinitely in both directions.
And then you need to golf it, because why else would you do it?
 
12:04 AM
@Qwerp-Derp You can write a quine without <> IIRC
 
@DJMcMayhem Mini-flak has a quine
 
Or you could put it in a loop so that it doesn't get executed by brainfuck [<>]
 
@ConorO'Brien Not particularly good
 
what would you suggest?
 
12:06 AM
The font looks weird with some characters, like @ for example
Consolas
 
hm, ok
 
@Pavel Yup
 
@Qwerp-Derp do all systems have that? (Am designing website)
 
@ConorO'Brien Fira Code
 
@ConorO'Brien source code pro
 
12:08 AM
Not sure, but it looks good
 
Actually, if you just need something that looks nice and is available on all system, Courier New is the most universal.
 
I'll check
 
@Pavel but it's kinda ugly
 
@Pavel Eww Fira Code
It looks ugly af, I like the -> replacement but that's about it
The others look ugly IMO
 
I will fight you.
 
12:12 AM
@Adnan thanks, this looks pretty. I think I'll use this one
@Pavel okay fira is a great idea but it looks blergh
 
Yuck the #_( comment thing looks really bad for Clojure
It's like melded together like Frankenstein, it looks abominable
 
only things good are the arrow and the :=
 
@ConorO'Brien Yes I agree 100%
The || and the various ++ things actually look decent
The one-bar __ thing for Python will confuse me if I ever use Fira (which I probably won't)
 
the equal signs look too similar
!! just looks ugly
 
The less-than and more-than look good
 
12:15 AM
I used to use Fira Mono, then decided to try it out with ligatures.
Never changed back.
 
Actually scratch that ++ looks pretty weird
@Pavel I don't understand you
 
Fira Mono is the same font but without the special symbols for multiple chars together.
 
I like Fira Mono but not Fira Code (eww), I think they botched that one
Monoid does a much better job than Fira Code IMO
 
To be fair, the only language I actively code in is Java, where only != == <= >= // /* */ apply 99% of the time, and those have nice symbols in Fira Code.
 
Ah, Java. that explains it
 
12:24 AM
The only other languages I use/plan to use are C and Python, which give :: and ** which also have pretty good ligatures.
 
good logo or bad logo
 
Pretty good
I like it
What Fira Code doesn't do well are F# pipes and some of the arrows. Basically everything else is pretty good, and the Fira Mono base is great.
 
12:37 AM
@ConorO'Brien yeah, it's cool
 
awesome :D that means a lot from a logoist (I think you are anyhow :P)
 
Huh, apparently IntelliJ comes with Fira Code
That's cool
 
Monoid is borked anyway, and it turns out Fira is pretty good with its symbols
 
@Qwerp-Derp As of like last week
 
12:41 AM
OK [] is borked in Fira
 
Question: As a High School student, anyone have idea on where I should attempt to apply for like internship or something. It seems like good idea but I am not having like PhD so Google does not have any opportunity :(
Microsoft also only takes Washington people :(
 
@Downgoat That would be because Microsoft is located entirely in Washington.
Also, vihan.org scores a solid 59/100 for mobile speed
 
@Downgoat You know there are these fancy things called counselors
I highly doubt you'll find a good answer here, at any rate :P
 
According to Google, you should:
Eliminate render-blocking JavaScript and CSS in above-the-fold content
Optimize images
Prioritize visible content
Leverage browser caching
 
I talked to counselor and they said "I don't really know you'll have to search some up"
 
12:44 AM
@Downgoat whatever you do stay away from PHP like the plague
 
@Downgoat That's a terrible counselor
 
50% of stuff is for getting more girls in CS and other 50% is for people who are obtaining masters
 
At minimum they'd show you how to find stuff
I mean, you're in the Bay Area right? There has to be plenty of tech companies. Just look up if they have some internships
 
I'd think
 
Silicon valley much? You probably have it relatively easy.
 
12:46 AM
Chevron HQ is like walk down the street yet I can't find any opportunity for a young goat, passionate about computer science and cheese
 
Maybe look at some smaller but not too small companies
 
So google is probably too ambitious then D:
 
dkudriavtsev.xyz scores are actually good
 
You know, since this is something that you'd have to ask your parents about anyways, I'm sure they'd be happy to help you find things. If they work in the Bay Area I wouldn't be surprised if they had connections or at least knew some places
 
actually maybe I can volunteer in africa that will look good to colleges
 
12:49 AM
Isn't Apple based in Cal?
 
Why can't I call functions from the main function?
 
@Qwerp-Derp What lang
 
@Pavel Java of course
 
12:50 AM
@Pavel hahaha
 
@Downgoat I recommend imo.im
 
@Qwerp-Derp Because it's static
 
@Qwerp-Derp main is static, so every field and function it accesses must also be static.
 
They have to be class methods not instance methods
 
So how do I call function when I run the Main class
 
12:51 AM
> BS/MS/PhD in computer science (or the equivalent)
 
@Qwerp-Derp either make your function static, or first instantiate yourself
 
The temperature is the only degree I have
 
@Maltysen instantiate?
 
@Qwerp-Derp new MyClass()
 
12:52 AM
No that won't work
 
160
A: What is the difference between class and instance methods?

Johannes FahrenkrugAll the technical details have been nicely covered in the other answers. I just want to share a simple analogy that I think nicely illustrates the difference between a class and an instance: A class is like the blueprint of a house: You only have one blueprint and (usually) you can't do that m...

 
It's a compiler error
 
@Downgoat they take interns, not sure about high school students, but uni definitely (before graduating)
 
Feq how do I make this work
package com.qwerpderp.blackhole;

import java.util.Scanner;

public class Main {
    private Scanner reader = new Scanner(System.in);
    private int players;
    private Game game;

    public static void main(String[] args) {
        init();
        loop();
    }

    public void init() {
        System.out.println("Enter amount of players: ");
        players = reader.nextInt();
        game = new Game(players);
    }
}
I'll make loop later
It doesn't work rn because init is not static
 
you have to be pretty good at algorithms though
 
12:53 AM
@Qwerp-Derp static void init() {...}
 
And if I make init static I can't change players or game
Because they're non-static
 
All the variables have to be static too
 
Main main = new Main(); main.init();
 
@quartata Or I can just do that
 
public static void main(String[] args) {
    (Main m=new Main()).init();
    m.loop();
}
 
12:54 AM
@Pavel no stop
it hurts my eyes
 
@Qwerp-Derp You can, but it's generally bad practice. Unless you need to instantiate Main down the line, it saves memory to make everything static.
@quartata Welcome to PPCG
 
Really?
But making everything static is annoying :(
 
Well, you need to allocate memory for the object and all the fields
 
@Qwerp-Derp and this is why no one like java
 
@Pavel But it's not even golfed
@Qwerp-Derp I think if you find yourself doing that you don't really get how static works
 
12:56 AM
@Maltysen ahem
 
@Pavel except he's obviously going to expand this class. players should very obviously be an instance variable
even if it might end up being a singleton class
also it doesn't make any difference memory wise, or at least a tiny one
 
I suppose...
According to Google's analysis, tio.run/nexus needs to 'Leverage browser caching'
 
@Maltysen That deserves a downdoot
@Dennis Push tinylisp?
 
Given the amount of times I have needed to clear my cache specifically for TIO, I think it could benefit from less caching.
 
@quartata Do you know how hard it would be to make a survival Minecraft mod where the F3 menu only shows player coordinates, so all the other stuff isn't in the way? Or alternatively, a mod where you can type e.g. /location and it will return x y z of player coords?
 
1:04 AM
Why is there a Integer class and an int class
Cursive is bad :( I can't even do projects
 
@Pavel Are you referring to languages.js? That isn't cached anymore.
 
@Qwerp-Derp because objects and primitives
 
@Qwerp-Derp int is not a class
 
@Qwerp-Derp Integers can be objects, this allows you to, for example, put them in ArrayLists or have them be in the same array as other data types.
 
@HelkaHomba the custom command should be pretty easy
 
1:07 AM
@HelkaHomba Yeah, the command would be easy. I don't know anything about how the f3 menu works but I know there are hooks for it
 
In addition, the Integer class has convenient methods like Integer.parseInt("123") which returns an int given a string.
 
a true golfer would use valueOf instead
 
@aditsu A true golfer would use new Long()
The constructor accepts a String
 
depends on the context :p
 
When would that not work?
 
1:10 AM
when you need an int?
 
Ok, but it's still shorter to do new Integer() than Integer.valueOf()
 
@Pavel proper solution would be have primitives be objects like swift or something. It's not even that big of a performance hit because VM
 
@Maltyquart Ok, I'll give the command a try
 
fair enough (unless you already have an Integer)
 
True
 
@Dennis What did you just say about the language list not being cached? The fact that I just got an Error would like to disagree.
 
The server no longer includes the headers that make the file cacheable. If your browser decides to cache it anyway, that's not on me.
Hopefully, at least a soft refresh will update it now.
 
A hah! Refreshing a few times fixed it!
Was that link supposed to be a quine?
 
Yes.
 
Does https not work for chat? It keeps redirecting me to HTTP?
 
1:21 AM
@Downgoat https works for me
 
Does it actually redirect you or is it just no green because of unsafe resources?
 
it redirects me
 
Anyway, https chat isn't recommendable. It makes all main/meta links https as well, and https is broken on meta.
 
... seriously O_O
 
@Qwerp-Derp Because it's hypothetical. I haven't tested it at all, I just put that there as a guide so that I know what an example call might look like.
 
1:38 AM
What's a good alternative to \/ mirrors in a 2D language? I want to use / for division.
Or, what could I use for division if \/ mirrors are just that useful?
 
I've seen % used for division before (i think). You'd have to find another for mod tho...
Limited to ASCII 32 - 126?
 
0
A: Sandbox for Proposed Challenges

Wheat WizardDoes Mathematica Have a builtin? Mathematica has a lot of builtins. Your task is to take in a question by either its question id, its name or both; and to guess whether or not Mathematica has a builtin that solves that question. Rules Your code must be less than 100 bytes long You may access...

 
java solution:
boolean a(){return true;}
For befunge: 1.@
;P
 
@MistahFiggins ()->0<1, lambda expression
 
Ah yes. But it's not code-golf, is it?
 
1:52 AM
Tru
 
2:07 AM
Hello, can I enlist some people to find questions where mathematica has a builtin? It doesn't matter how simple or complex I just was hoping to find a bunch of examples and I could only find 7
 
Leave it in the sadbox for a bit, and write a few of your own?
 
2:22 AM
so, many chess engines look forward X moves, and give a score to a particular chess configuration. Is there anyway I can capture that last step of scoring a particular chess configuration without requiring them to do the recursive search?
(in a challenge)
the problem is that you can't say "no looking X moves ahead" because that is so hard to define (and is largely non-observable)
 
2:39 AM
@NathanMerrill If you want generic chess state "scoring", I'd say no. But you could ask for basic, non-recursive metrics, like how many pieces are attacking/being attacked
 
yeah, but I feel like there are tons of ways to score those things, and I was hoping for competition to be in that space, rather than a code-golf challenge
 
How would you decide whose state scores are the most accurate anyway? Chess library?
 
play a game
 
As in koth?
 
not really sure. regardless, if I can't figure out how to define it objectively, no point in figuring how I score it :P
I do think its pretty impossible to define objectively, but its an idea I've had for a long time, so I was hoping somebody in here would have an idea
 
3:00 AM
CMC: print this text:
 !"#$
%&'()
*+,-.
/0123
45678
 
Uhhh I have question in LC and CL
LC = lambda calculus, CL = combinatory logic
 
@ConorO'Brien Pip, 9 bytes +1: PA@<25<>5 with -n flag
 
   λnfx.f(nfx)
-> λx.f(nfx)
 = (S λx.f λx.nfx)
 = (S (K f) (n f))
-> λnf.(S (K f) (n f))
-> λf.(S (K f) (n f))
 = (S λf.(S (K f)) λf.nf)
 = (S (S (λf.S λf.(K f)) n)
 = (S (S (K S) K) n)
-> λn.(S (S (K S) K) n)
 = (S (S (K S) K))
 
@ConorO'Brien for(int i=32;i<56;i++)System.out.println(((char)i)+(i%32==1)?"\n":"");
It might be shorter to hardcode the string...
 
Is the above correct?
 
3:10 AM
Do many people here know CL and LC?
 
Zgarb does, I'm waiting for him to get on
 
Oh right, TIO has Mathics now! https://tio.run/nexus/mathics
You can try mathematica code online, and it work most of the time!
 
3:50 AM
4 hours ago, by Pavel
CMC: Write a Brainfuck/Brain-flak solution to http://codegolf.stackexchange.com/questions/98938/the-meta-polyglot-quine
 
4:01 AM
Yay I have 4 snippets in the tinylisp answer thing!
1
A: Showcase of Languages

Qwerp-Derptinylisp Factoid: tinylisp is a language made by @DLosc for an "interpret this language" challenge. Its intent is to demonstrate what a Lisp-like language can do using only very few builtins. Here is an interpreter. Snippet 1: d This single character is perhaps the most used builtin in tin...

 
@Pavel I will try it
 
@Pavel You can try to make a fraction "class" thing in tinylisp if you have the time
 
4:16 AM
@Dennis annoying thing about TIO: when you have a permalink, click the little "TIO" link/button in the top left, it takes you to the tio about page not the nexus
I want to test more code in a different lang, but now I have to figure out where the little nexus link is on the new page
 
@Riker Suggestion: vihan.org/p/tio ;P </shameless self promotion>
 
lel
@Qwerp-Derp > 99%
I fixed 1 typo lol
 
@Riker ???
 
in your showcase answer
> 7 revs, 2 users 99%
Qwerp-Derp
 
@Riker 99% lol
I'm planning to post 2 snippets a day, you can post extra snippets if you want
 
4:24 AM
Am I allowed to ask a question on SO about a programming question where problem might be due to a mistake I made
I am really scared about this
 
@Downgoat Just make the question up to standard and you should be fine
 
@Qwerp-Derp I don't even knwo it
I'll try to learn though
this was "lator" -> "later" edit
@Downgoat what lang?
 
@Riker You should learn it, it's a cool lang
 
Parser question, it's about conflict in LALR
 
@Riker The TIO icon is supposed to point to the home page. To switch languages, click switch languages.
 
4:26 AM
I need to scroll on my phone tho
@Qwerp-Derp will do tomorrow
@Downgoat ah ok
 
btw: I put HTTPS on my sites so now my sites are more secure than SE
 
@Downgoat Command-line arguments don't seem to be doing anything. They also don't resize with input, making anything longer than two characters extremely hard to read. And there's no debug field, so when anything goes wrong, there's no easy way to figure out what it is.
@Riker Right, I see how that can be annoying.
Ah, finally figured out why my shutdown answer works.
 
@Dennis command line args are supposed to resize with input. works on safari and chrome for me (tested safari & chrome on mac and chrome on windows)?
 
Well, I'm on Chrome on Linux, and they don't.
 
:( any error in console?
 
4:33 AM
@Downgoat Also fails on MS Edge, Windows
 
Nothing related, I think. The area gets bigger eventually, but you still see only two characters.
Horizontally, that is. It resizes vertically if I press Enter.
Actually, after pressing Enter, horizontal resizing seems to work as well.
 
@Pavel ok well there is your problem
@Dennis oh no, does chrome for ubuntu not properly support .oninput O_O
 
I'm pretty sure it does; I'm using it on my TIO frontend.
And I'm not on Ubuntu anyway.
Creating permalinks fails because the permalink is still HTTP, and history.pushState blatantly refuses to change origins.
 
ok, can you try now?
I switched to using keydown too
 
No difference.
 
4:37 AM
Nada
 
have you try clearing caches?
 
The bigger issue is that command-line arguments aren't sent to the server though.
 
I can't really add CLAs ATM because I previously inspected what binary data was being sent to server and now that you are using different backend. I first have to try to understand what is happening now.
 
@Downgoat Of course. That's the first thing I do when to tell me to try something again.
But run-legacy is still the same backend...
Anyway, if they're not supposed to be working, remove the textarea or add a notice. Trying to work with CLAs that are simply ignored is just frustrating.
 
@Dennis my backend I mean the interface. I dunno where CLAs went into binary string
 
4:40 AM
Ah.
After the input, followed by NUL bytes.
 
anybody have the link to view-a-random-webcam github repo?
 
And prefixed by the number of args.
 
was is mınxomaτ who did it?
 
minxomat created the database of the webcams and the linked guy just made a website which goes through them
btw there are the bytes "99, 96, 128, 3, 198, 228, 140, 212, 148, 148, 196, 34, 24, 15" that prefix every request, do you know what they mean?
 
thanks :)
 
4:47 AM
Should the -D compile flag in C be a standard loophole, as proposed by Mego in this comment? If so, are there similar features in other languages that should fall in the same category?
 
@DLosc What does it do?
 
@DLosc no. It could be used for useful golfing, you simply have to include the byte count
I mean, as a standard loophole for quines, definitely
 
@Pavel It allows you to include preprocessor definitions on the command line instead of using #define in the source code.
 
@DLosc I mean if it's abused in the way described I'm all for it
 
it doesn't really fall under our definition of a quine, as it doesn't encode the source code
so, even if somebody were to post that, we'd already be covered
 
4:49 AM
I mean you could argue that "A" is the encoding of the source code
but it is not encoded itself in the source code
 
right
 
Won't 'A' by itself not compile?
 
it will with the right #defines :)
 
@Pavel normally, but you have the macro which the preprocessor will expand to main(){ .... }
 
Ok. I really need to learn C
 
4:53 AM
@NathanMerrill That's basically the point of the meta question: what is the "source code" of a quine, when command-line flags are an integral part of making the code work the way it does?
 
right, but Mego's answer is on point: the flags are not part of the source code at all
if it is part of the source code, then you would have to output it as part of your quine. If its not part of the source code, then a -D quine doesn't work, because there isn't this encoding-a-different-part-of-the-source-code
 
@NathanMerrill Hm, I see what you mean. There's probably still a way to circumvent that using two letters, though.
 
I wonder if it's always possible to write a quine in a TC language capable of outputting arbitrary strings.
 
@Pavel It is
 
Cool!
Golf you a quine for great good doesn't have a Forte entry yet, someone should make one.
 
4:59 AM
23
Q: Is it possible to create a quine in every turing-complete language?

subI just wanted to know if it is 100% possible, if my language is turing-complete, to write a program in it that prints itself out (of course not using a file reading function) So if the language just has the really necessary things in order to make it turing complete (I would prove that by transl...

 
@NathanMerrill Something like code AB, flags -D'A=main(){' -D'B=printf("AB");}'. The B in the code encodes both the A and the B, right? (And the A is just needed to make the B part run.)
 
5:19 AM
@DLosc Can you introduce lambdas to tinylisp?
So something like ((q ((n) (s 1 (s 0 n)))) 1) evaluates to 2?
 
@Qwerp-Derp It does. ;)
 
Whoa that's cool
I kinda want to make a fraction class in tinylisp but I don't have the foggiest idea as to how...
 
@Qwerp-Derp That's what's really going on with named functions, too: when you do (d succ (q ((n) (s 1 (s 0 n))))), you're binding the name succ to a lambda function, and when you call (succ 1) it evaluates succ to that function and calls it on 1.
@Qwerp-Derp Given that it's not an object-oriented language, I think your best bet is to make a library of functions that take 2-element lists and do math on them as if they were fractions.
 
Yeah, I was thinking of something like that
Or I could do something like (q (Fraction 1 2)) and alter it somehow
Like maybe (+ (Fraction 1 2) (Fraction 3 4)) or something
But I need fraction-specific operators
 
Most likely.
 
5:28 AM
Are you allowed to (def + (...))?
 
@Pavel Yup
 
I have a bit of a tinylisp "standard library" built up, but I never put it in the repository. Maybe I should?
 
Oh, so you can overload the + operator for lists.
 
@DLosc You definitely should
@Pavel In normal Lisp or tinylisp?
If it's tinylisp it doesn't have a + operator
 
Oh
@DLosc can you overload builtins?
 
5:29 AM
So is your team name for the hackathon thing still for i in team:?
 
Yes
 
That's a lame name, you should do for (Member i: team) {
 
Downgoat has already informed me of that.
 
@Pavel No. Once you use d to define a name, it can't be redefined (and builtin names can't either.)
 
Dammit
 
5:31 AM
That's to enforce its status as an almost completely pure functional language.
 
@DLosc This probably defers from your original intent for tinylisp, but maybe imports?
That would be cool
 
Either way, you could define + to work on two lists of length two, where each list is (numerator denominator)
 
@Pavel Yeah, that was my original intention
 
@Qwerp-Derp There's already a load builtin, it just won't do anything on TIO because there aren't any files available to be loaded.
... YET.
 
You can test it out using TIO bash
 
5:32 AM
So (load derp.tl) works if I have an external derp.tl?
Whoa that's awesome
Dammit @DLosc now you've got me completely hooked to tinylisp
 
@Qwerp-Derp Yes, and in fact (load derp) works too. If the name doesn't end with .tl, it adds the suffix.
:D You're welcome
Right now I'm testing whether (load library/foo) will work for loading files from a subdirectory...
 
Definitely add the standard library, make sure Dennis adds it somewhere it can be loaded
 
Yes, it works! \o/ Lemme move a few things around and commit.
 
@DLosc My mind is entirely blown with tinylisp, thanks for making this a thing!
I should make a question on CR about it
 
LOL
 
5:36 AM
@Qwerp-Derp What's CR?
 
Code Review
 
> Answer is always tail-recursion
 
Yes, you definitely should.
 
@DLosc So functions and variables can have any characters right?
So I can make a function called +frac?
 
Considering + isn't defined, you can probably just call it +
Is all of Unicode supported?
 
5:38 AM
@Qwerp-Derp Anything except whitespace and parentheses.
 
Is something like Clojure's multi-arg-choice function thing supported in TL?
 
@Pavel I think it should be--anything Python 3 can handle as input.
 
So something like Clojure's
(defn derp
  [x y] (+ x y)
  [x y z] (* x y z)
)
 
In a roundabout way. You can define a function with variadic args, but you'll have to write the tests for the different possibilities yourself.
 
Oh
Why does (t (2 1 2)) come up as an error
 
5:47 AM
You need to quote the list.
 
@Qwerp-Derp It tries to evaluate 2 as a function
 
^
 
You need (t (q (2 1 2)))
 
(d len
  (q (
    ()
    args
    (i (e () (t args)) 1
      (s 1 (s 0 (len (v (t args)))))))))
 
How do you define a function to take parameters?
 
5:50 AM
Doesn't work :(
 
@Qwerp-Derp Why are you defining it as a macro?
 
What do you mean?
Isn't that what you're meant to do?
 
macro != lambda
(if that's what you mean)
 
It's a len macro
It gets a number of args, and is meant to return the amount of args
But it doesn't work
 
Lemme look at it.
 
5:52 AM
I think it's because when recursively called it returns the args wrapped around parens, and I don't know how to get rid of it
 
Ah, yes, that would be it.
Probably the easiest way is to make a helping function/macro that takes a list as an argument, do all your recursive stuff in there, and then call it with args from your main function/macro.
Actually, I would use the name len for a function that takes a single list, not variadic arguments.
 
Well this works:
(d len
  (q (
    (list)
    (i (e () (t list)) 1
      (s 1 (s 0 (len (t list))))))))
 
Yeah, that.
Although: no tail-recursion = :(
(Except for golf. 90% of my golf submissions don't use tail recursion. :P)
 
What but that's tail-recursion
What is tail-recursion?
 
It's "improper" tail recursion, and it's not a kind that my implementation can handle well.
 
5:56 AM
Oh.
So proper tail-recursion is one that just has (len...) as the outer macro in place of the (s...) thing, right?
 
Right. The problem is that your recursive call is passed to a couple of s calls after it returns, so the interpreter can't optimize it into a loop. You'll hit the recursion limit for large lists.
 
To optimise it I need a helper function, right?
 
Yep.
I think we should have a naming convention for helper functions.
Maybe start with an underscore?
 
And ? on the end if we're returning a boolean, like prime?
 
Good with me.
 
5:59 AM
Should we make a tinylisp room for this?
 

« first day (2189 days earlier)      last day (2662 days later) »