« first day (2191 days earlier)      last day (2651 days later) » 

12:00 AM
and yes I know I'm doing something questionable
 
... okay, I was about to say, "why are you doing this??" Instead, I warn you: you're modifying internal code, so you really want to be sure about what you're doing.
 
I need to override some of the JS generator behavior to behave like Pytek generators while still being compatible with code included via @includejs
That means modifying the prototype
 
why not just create a class extension
wait, nvm
you're compiling to JS, right?
 
It's one of the transpilation backends yes
 
if I were you, I wouldn't modify the global generator prototype, but rather modify it on a per-need basis, e.g., let pytekGenInst = ...; pytekGenInst.prototype.next = Pytek.generatorNext
 
12:06 AM
I don't necessarily know if a function will return a generator
I can guess well enough to attach a function* but it could just return before yielding
 
so? You could still add next to the prototype. It's equivalent, except one is local and the other is global
 
hmm, I think my most successful esolang from a PPCG point of view has to be 7, because it's so good at exposing incorrect assumptions in the question
 
I think people won't expect to be able to call .next on an int. I can't catch that at compile without a type annotation
 
like "adding characters to a program, that are in the same character set as the program is, won't cause the program to be reinterpreted as belonging to a different character set, thus retroactively changing what those characters were"
 
@quartata you could to some reflection: if(thingy instanceof Generator) // do that thing
or GeneratorFunction, I always get the two mixed up
 
12:10 AM
I mean, it's fairly obvious that that assumption is incorrect, but without an esolang that pulls this sort of shenanigans as naturally as humans breathe, it's likely nobody would have noticed it was there
 
@ConorO'Brien I would rather V8 verify that in C. I do have to check things myself occasionally since Pytek is structurally typed but this isn't really one of those situations
Plus it's easier to modify the global prototype
 
right, but also causes further conflicts for any other JS resources included in your page. This may not be a concern for you, tho
 
It wouldn't cause any conflicts for things included with @includejs if that's what you mean
 
no, I meant any JS included by an outside source that uses generators
 
and it's in it's own scope so I wouldn't think it would affect globally
 
12:13 AM
sure it would. the prototype is attached to the object. If the object is global, so is the prototype, and the modification to the prototype persists outside of scope
String.prototype.foo;   // undefined

{   // new scope
    String.prototype.foo = function(){
        return this + " foo!";
    }
    "asdf".foo();       // "asdf foo!"
}

"Hello,".foo();         // "Hello, foo!"
 
Well, caveat emptor then. It would only be an issue if they included a script first that modified the prototype, then included a script after the Pytek script and expected those modifications
In any other situations they would just end up with mysteriously more efficient and powerful generators
 
right. there's that. I don't know the extent of the modifications you are making towards the generator prototype, but if it doesn't maintain default JS behaviour (or at least simulate), then scripts / code after and outside of Pytek may not work
e.g., gen.next() should return an object, { value: <thingy>, done: boolean }
 
@ais523 I think you're the quickest user to gain 10k rep (when you gain 10k rep).
 
@Qwerp-Derp I actually don't even know my own rep at this point, let me check it
 
In perl, print ~"fd3b:1d04:1d6b:7777::d83a:d8a4" gives ™›ÌÅΛÏËÅΛɝÅÈÈÈÈÅśÇÌžÅ›ÇžË but print ~"™›ÌÅΛÏËÅΛɝÅÈÈÈÈÅśÇ̞śǞË" gives =f=d<s=b<z<q=d<p<t<z<q=d<v=b<z<w<w<w<w<z<z=d<x<s=a<z=d<x=a<t
 
12:20 AM
Teach me your ways @ais523 :)
 
Why?
 
I decided a few weeks ago that I didn't care about my raw rep total any more, just Epic/Legendary progress (i.e. the number of days on which I receive 200 points from upvotes)
well the only actual use of reputation once you're over 2k is to offer bounties
and it's rare to get a good opportunity for those
 
Is ~ not bitwise not, or do I not understand how bitwise not works?
 
@Pavel I assume the first program gave a warning? ~ is round-tripping, but print isn't
 
But more rep = more brownie points on the internet
 
12:22 AM
you haven't specified an encoding anywhere, thus forcing Perl to guess, and the guesses don't roundtrip
 
Ah. Welp.
 
try running with -Mutf8 -C7
(be prepared for a bunch of control characters that don't copy-paste properly to be dumped as part of your output)
-Mutf8 = "literals in the program are encoded in UTF-8" (actually everything else too, but literals are what we care about); -C7 = "stdin/stdout/stderr are encoded in UTF-8"
that'll fix both points in your program where an encoding conversion is needed
 
Once you have earned 20 rep, you have all the privileges you really need
 
what privilege at 20 are you thinking of?
 
@ais523 Chatting
 
12:26 AM
chat?
ninja
 
@MistahFiggins Hahah get ninja'd
 
lol back atcha
 
I guess 150 for downvotes is where I'd draw the line, being able to discourage people from submitting uninteresting questions is kind-of needed to keep the site usable
 
See this is all the privilege you really need, the ability to ninja someone is better than anything
Happy Chinese New Year to anyone that cares about CNY!
 
Indeed
Oops, I sat down to turn my computer off, not spend a couple hours doing this. Cya all
 
12:28 AM
@ConorO'Brien or just: const GeneratorFunction = (function*(){}).constructor
 
@Downgoat that too
 
@quartata for Pytek? There's probably a better solution than modifying the prototype
also doing that for native objects is really slow
 
@Downgoat It's startup so it doesn't matter
 
I do not recommend changing prototype of them at all
 
Also scroll down
 
12:30 AM
@quartata not just for startup
(unless they get counted as a hotspot)
@quartata I don't see why you can't change what a generator yields or returns rather than generate some wrapper code around those statements?
 
MS updated their Fast Ring CDN it seems. I can finally download updates at >20MB/s again.
 
Guys, two questions: how do I get a domain name from an IP, and how can I do a (reversible) bitwise not on a String?
 
@Pavel nslookup <ip>
 
@Downgoat Because that's not what it's doing
 
@Downgoat Golfier: host ip
 
12:34 AM
Thanks
 
@quartata okay, well if you really have to absolutely have to modify the prototype (which I'm 94% you don't need to do), please use Object.defineProperty with hidden enumerability
 
What does that do?
 
Does anyone know how to find the bitwise not of a String?
 
@quartata allows you do modify property descriptors
 
No one is reading this code anyways so I don't care if it looks ugly
 
12:36 AM
As you can maybe tell by scrolling up, my attempts have failed me.
 
@Downgoat By the way, I had a related question
Is there a method I can override that gets called on missing key?
 
yes, Proxy
or you can use getters to create a dynamic object
 
@Downgoat Doesn't that override the whole get? I mean that works too (and would probably be more efficient) but
 
@quartata well you can do return target[prop] || determineProperty(prop)
though I don't see why you need to do this.
can't you determine this at-compile time?
 
That's not really what I'm doing
Since x[1] is equivalent to x.1
I want to know when it accesses out of bounds (meaning I need to generate more)
 
12:41 AM
my reccomendation is to make generated code:
 
Can't, really. I don't know if what I'm subscripting is necessarily a generator
 
if ("1" in x) {
    x[1]
} else {
    PytekError("you did a stupid");
}
 
Also I want code included with @includejs to be able to interface with it normally
 
includejs?
 
Including other JS files
 
12:43 AM
yeah, but what is includejs? (link?)
 
I don't really have a link because our spec is outdated
It's a Pytek thing not a JS thing
 
I think he means for includejs
@Downgoat would you say this is accurate?
 
@ConorO'Brien Looks good :D suggestion: describe __proto__ and the inheritance chain
 
I don't really know about __proto__ >_>
 
oh :|
well it basically contain's parent class's prototype
e.g.:
class B {}
class A extends B {}

A.__proto__ == B
 
12:49 AM
'night
 
oh, cool
 
-1
Q: How long is it before we get our own design?

Mark YisriWe have exited beta now, as far as I can tell. However, the site looks identical to most beta sites. When will we make our own design?

 
when will another ppcg post on medium be made?
 
@LuisMendo Thanks for catching that. I deleted my post and in case it doesn't notify you, I also replied there with some more details.
@Dennis Luis found out that the Newton's method implemented in J for inverse gamma overflows when the input is 1.5
 
How long ago did we graduate?
 
1:08 AM
@miles Oh well....
 
Would the syntax {x -> n} be considered valid output?
 
@DigitalTrauma Your answer seems to have a similar problem. Input 1.5 gives 1.499999, but it should be 1.662766.
 
Mathematica Solve solves all problems.
Still have no idea how mthmtca works tho
 
Except the fact that I don't have Mathematica.
 
And Mathics' Solve implementation fails for factorial, which is annoying.
@Dennis Mathematica has a free online implementation
 
1:15 AM
@DestructibleWatermelon sometime soon, for me
probably going to do another esolang highlight
 
@Pavel It does?
 
I might do one on my koth if I do that soon
 
@Dennis wolframcloud.com
You do need a Wolfram account tho
 
Well, free as in beer is something.
The fact that I can't use spaces in my password worries me.
 
@Dennis I hate that
 
1:20 AM
@DestructibleWatermelon where is this blog specifically (as in, a URL)?
this is the first I've heard of it, but it seems potentially interesting
 
I had to change my apple password a bunch of times because it didn't tell me I couldn't have spaces but I could accidentally press space when entering my password
or because it didn't tell me the space was ignored when entering it actually
 
@Pavel OK, I signed up and now I have a Viewer plan. I can look at things and browse documentation, but actually doing something appears to require a trial (barely 15 days) or a subscription ("only" $155 per year). That's not free by any definition of the word.
 
Yo folks !
 
@Dennis Yeah, it's really weird. I've had that notification for months now, and it hasn't stopped me yet.
I can't create new notebooks, but I have some preexisting notebooks I can open and evaluate things in.
You can also mess around in the demonstration/tutorial notebook
 
I've a question. So, I've posted an answer, codegolf.stackexchange.com/a/108434/55572 Makes use of `/proc/sysrq-trigger file on Linux, which is in python. Didn't notice someone already used that in bash ( codegolf.stackexchange.com/a/108093/55572 ). Is that OK or should I delete mine ?
 
1:27 AM
it's probably OK, especially if it's an independent discovery
 
As far as I understand, external files and commands technically can be reused, right ?
 
No need to delete it, especially if you came up with it independently.
 
having two identical answers by different people that were discovered independently is allowed, although the second one is unlikely to be upvoted, and people may well end up downvoting it
if they're in different languages, they aren't identical
when this happens to me, I often write a line like "this turned out the same way as USERNAME's answer"
to make it clear that it's independent but to show the connection
 
@Dennis yeah I don't have Mathematica Online and I can access everything in develop.wolframcloud.com/app
 
Well, OK then
 
1:28 AM
The entirety of wolfram.com is a massive pain to navigate, I feel your pain.
 
Now, question #2. Anybody familiar with perl ?
 
@Serg No, but ask anyway.
 
Just looking for a simple one-liner to write to a file. I could do something like . . .
perl -e 'open(my $f,">","out.txt") or die;print $f "TEST\n";close ($f) or die'
but I feel there should be shorter way
 
@Dennis Well thats a shame. Deleting for now. Hopefully I'll get some more time to spend on it.
 
1:49 AM
@Serg You can drop the or die and use old style opens if you don't care about error handling and clean code
What is this for?
 
And remove the close, probably.
 
@Dennis That's going a little far IMO but yeah
 
I think this is for a PPCG challenge.
But even if it isn't, closing file handlers is a bit redundant in a one-liner, isn't it?
 
@quartata curiosity and learning. I'm slowly learning perl, cooking up a few answers in it here and there on U&L.
 
2:05 AM
I just got the HTTP error code 408/409
 
So 0.9975550122249389?
 
idk
 
Seriously though, where did you get that?
408 happens all the time for me (a benefit of crappy internet connections). I don't think I've ever got 409 though.
 
It's probably Edge's fault
The wolfram cloud demonstrations
Supposedly 409 is when multiple requests conflict, for example two edit requests to one document at the same time.
The error message generated by Edge is 'too many people trying to connect to the server'
@Dennis I figured out your Mathematica problems, Mathematica Online is the one that costs money, you want Wolfram Development Platform, here
 
2:28 AM
@miles No, I didn't get notified. Sorry that your method doesn't work!
 
@Pavel That doesn't seem to load for me rn. I'll check it out later. Thanks in any case.
@LuisMendo Your 1.5 killed three answers. :P
 
Heh. I should be proud :-P
Can I claim the upvotes they had? :-)
 
Mine worked up until OP changed it to require solutions to be positive.
What can I do if OP invalidates my answer with an edit, and the answer isn't trivially modifiable?
 
You delete the answer.
 
:'(
 
2:31 AM
Or fix it non-trivially.
@LuisMendo No, but that was my highest voted answer I had to delete, which counts for something.
 
@Dennis Interestingly, that link only shows own content. So I'm seeing my deleted answers
... They are a lot!
 
Ah, deleted:1 is a mod thing... Still, my user ID's there, so I'm not sure why you would see your answers.
 
"Note: only content you own is returned when searching for deleted content"
 
Out of curiosity, how many do you have? I have 53.
 
i have 28
what was the highest voted answer you had to delete?
 
2:36 AM
It was a simple combination of two built-ins, so meh.
A tad surprising that it doesn't work though.
 
@Dennis 50. I counted manually, so it may be off by 1 or 2
 
@Dennis why? precision issues? doesn't cover the whole range?
 
It should say X results at the top.
 
Highest-voted deleted had 4 upvotes
 
37 votes for me
 
2:38 AM
Ok, so Wolfram Alpha can easily solve the inverse factorial task
But Mathematica just does not want to.
 
37... that must have hurt
 
5 for me, a few minutes ago.
 
@LuisMendo nah, it was a silly answer, though the upvotes gave me a perverse pleasure: meta.codegolf.stackexchange.com/a/5806/20260
 
@xnor It uses Newton's method, which appears to diverge for that input. Eventually gives a NaN error since the Pi/factorial no longer fits into a double.
 
@Dennis Push tinylisp?
 
2:39 AM
consider moving to another time zone, or not sleeping.
:-D
 
I made a bunch of cool features in TL, I kinda want to see it first-hand :)
@LuisMendo Abandon all sleep ye who enter here
8
 
@Qwerp-Derp Pulled.
 
@Dennis hmm, is that a bug in J's implentation?
 
I'm not sure. miles tried to implement it in Jelly and it had the same problem.
 
(load library)

((chain-last
   (s 0)
   (s 1)) 10)
Yay it works!
It's really unwieldy though
 
2:54 AM
AHAH! FindInstance works where Reduce and Solve fail!
 
Question: how should circular dependencies be handled?
Should I generate a stack of import callees and check if the desired import is in that stack?
that would break delayed dependencies however
or I could recall it and set the dependency to nil and then fill it in if applicable
 
@Downgoat like, in bootstrapping?
 
If there exists anywhere an import statement, parse what it's importing for other import statements (without evaluating the module itself) and this way generate the maximal dependency tree even with delayed imports?
 
@ConorO'Brien I think so? >_>
 
you're writing cheddar code in cheddar right
 
3:01 AM
some of it
well it actually is compiled to cheddar bytecode internally and executed there
actually, if anyone could help me resolve conflict in bison that would be great:
States with conflicts:
State 36
  PropertyHead -> Identifier . #lookaheads= . [ ( ) ? ,
  TypedIdentifier -> Identifier .: Identifier #lookaheads= ? ) ,
  TypedIdentifier -> Identifier . #lookaheads= . [ ( ) ? ,
why is this not legal I don't udnerstand
 
Look at the first and last rule more closely
 
no but they are in different context
if you notice TypedIdentifier is only valid before a ->
That should be considered lookahead token and therefore it should reduce to a TypedIdentifier if valid
it does not allow to reduce to PropertyHead since -> is only allowed after a TypedIdentifier
 
really quite out of my depth here >_>
 
PPCG Challenge Idea: Solve Bison grammar conflict given Bison grammar
 
I just wanted to get a quick opinion of a challenge idea. To promote my language, would a cops and robbers challenge where cops post golfed code in JavaScript and link whatever code-golf challenge it's for, and robbers attempt to crack the golfed code by submitting a smaller answer in Bean, be something worth trying?
 
It converges to an incorrect value when I try it in Mathematica `FixedPoint[# - (#! - 1.5)/(((1.001 #)! - #!)/(0.001 #)) &,
Log[1.5] // N]`, the output is `65807.7`
 
hm. it's a meta challenge encouraging golfing (yay) but has two problems: (1) it's too specific (2) and there is a problem when you get to answers that are already optimal
 
@ConorO'Brien would totally use but doesn't use export command :(
also no babel
so don't support all nodes
 
@Downgoat right. since there is no babel, there is no export command >_>
 
3:26 AM
I should have guessed the idea was too specific. I'm just annoyed that Bean isn't as golfy as I thought it would be
 
Question: does this converter work for most strings you can enter?
 
fails for ಠ_ಠ
also, removes leading _s. Is this intentional?
 
@ConorO'Brien example?
 
_preserve => Preserve
 
yeah that's correct
 
3:29 AM
you sure?
ok
 
this is for cheddar. it'll convert some file like test-cheddar-module to TestCheddarModule so import TestCheddarModule will work
 
@mınxomaτ what was "interpol" doing on your clipboard? lol
 
Oh hey, the RO nominations post has closed.
 
@PatrickRoberts ikr
 
3:33 AM
@Mego ^^
 
The Windows 10 Setup of Build 15019 is now speaking by default. I had a laptop installing sitting across the room. God that was startling...
 
Just one more reason why Unix master race
 
@mınxomaτ Do you mean insider preview?
 
Yes
 
3:39 AM
Ooh, time to check the blog
I'm a see what's new
 
@mınxomaτ huh, I thought you were a linux person >_>
 
I have to test Windows software that needs Hyper-V. Can't do that in a KVM.
Also
 
"FYI: This build does have some platform related bugs that will impact the ability to play popular games on your PC."
 
yesterday, by mınxomaτ
@quartata I don't. But I need at least one machine to run my DAW. Reaper works on linux, but it's just a bit too primitive.
 
haha. fun typo: instead of "shuntingYard", I typed "huntingYard".
@Pavel a little on the excessive side, isn't it?
 
3:41 AM
@Pavel Hey, not necessary.
 
They'd better not have killed mah games
 
(I am not kidding) I just opened Edge on the new installation to download chrome, and every Google website is blocked with an SSL error "weak signature".
 
only google websites?
 
As far as I can tell, yes. PPCG works.
 
does mozilla.org work?
 
3:49 AM
Yes
That has an EV cert.
domains.google works
 

« first day (2191 days earlier)      last day (2651 days later) »