« first day (2354 days earlier)      last day (2493 days later) » 

2:02 PM
can happen
 
For the file, it will be automatically closed when the program exits, and if it leaves scope before then the garbage collector might get to it before exit.
 
Okx
@Mayube I made a program that searches the OEIS for sequences containing this kind of formula, and see for yourself... ghostbin.com/paste/dv3c4
 
use a context manager
 
You should use with to explicitly scope the lifetime of the file, which ensures that it will be closed at the end of the with block.
 
with open('file.txt', 'rw') as f:
    f.write('hi')
 
2:03 PM
For the URL, I have no idea what it means to "open a URL" in python.
^
Argh, why is @Zacharý's name a unicode disaster for me, I had this working earlier ;.;
 
I mean urllib.urlopen. And why is my name a unicode disaster for you?
 
use requests
it's a much better web thingy module
 
I have no idea. I get the event from Stack as 'Zacharý' but by the time it makes it to IRC it's 'Zacharý' instead and I can't figure out why.
 
ý is in Latin-1 Supplement, it shouldn't be giving you problems.
 
Wait, is your name in latin-1 rather than utf-8?
 
2:08 PM
I don't remember ... I'm saying ý is in the Latin-1 Supplement block of unicode.
 
hey what's a tough language to do fibonacci in
 
Brainfuck.
Befunge.
 
brainfuck is easy
 
Aah.
adds some code to log the actual bytes being received
 
befunge is 2d and 2d is confusing for me
 
Okx
2:09 PM
@totallyhuman ;#
 
@Okx NaL
 
@Okx tough != impossible
 
@totallyhuman ;#+
 
that's better
 
Okx
okay you want me to make a language based off ;# that makes it really tough
 
2:10 PM
@totallyhuman Fission
 
Forgot my end
 
@totallyhuman Define "tough".
 
Unlambda.
 
Boolfuck
 
@Christopher Why have you voted to reopen this?
 
Okx
2:14 PM
How do you know it was him?
 
Yeah, I was pretty stupid in saying Fibonacci in Fortress is hard... I keep forgetting to add end at the end of my if-then-else statements...
 
bonks head against desk
 
@Okx I checked the Review Queue to see who reviewed it and how the voted
 
Found the problem
 
Problem with what?
 
2:15 PM
your username
 
StackExchange sends your name as 'Zacharý' when you are actually talking, but as 'Zachar\\u00FD' in the user list
Which means they have to be decoded differently, and stuffing the former into .decode('raw_unicode_escape') destroys everything.
 
Does @Adám 's do that as well?
 
Yep!
 
So, I'm going to assume ಠ_ಠ as a username would thoroughly break whatever you are currently using.
 
@Zacharý Huh? What? Where? Oh.
 
2:18 PM
Sorry, I just tabbed to get your name and forgot to delete the @
 
I was testing earlier using just the user list and it seemed to work fine, so I couldn't figure out why it stopped working as soon as anyone with a non-ascii name started talking.
 
Okx
Where's the user list?
 
@Zacharý What languages did you use before Fortress which do not have closing-clauses on blocks?
 
Okx
you mean the list of pictures on the right?
 
That would show up as ಠ_ಠfor me, I think. But now that I know what the problem is I can fix it.
@Okx in this case, the list of users in channel returned from the JSON API, but that's what's used to populate the list on the right, yes
 
2:19 PM
@ToxicFrog Wait, that's important! How did ಠ_ಠ become ಠ_à²?
 
Okx
the pictures on the right look fine
as in, when i click on them
 
@Adám borked unicode decoding
 
@Mayube I know, but I want to understand what went wrong, as we have that problem too.
 
The way they're structured threw me off...
I was thinking of Python's if-then-else ternary, which is different from Fortress's if-then-else-end style ternary. (I just finished programming the bit of Python for the OEIS scraper)
 
Okx
they're*
 
2:21 PM
There, are you happy now?
 
they're*
 
@Zacharý How can you call if-then-else ternary? Isn't it arbitrary numbered?
 
^ * there, that one is supposed to be there.
 
@Adám have you not heard of a ternary operator?
condition ? true : false
 
@Mayube Operator, yes, but never heard the control block called that.
 
2:22 PM
The thing is, Fortress needs the end in the ternary-like statement.
fib(n) = if n = 1 OR n = 2 then 1 else fib(n-1)+fib(n-2) end
 
@Mayube What do you call:
If cond1
AndIf cond2
AndIf cond3
    true
ElseIf cond4
OrIf cond5
    false
ElseIf cond6
AndIf cond7
    maybe
EndIf
?
 
Very verbose code.
 
@Adám ugly
 
@Zacharý How would you write it?
 
(cond1 && cond2 && cond3) ? true : (cond4 || cond5) ? false : (cond6 && cond7) ? maybe : no :D
 
2:28 PM
I haven't used :AndIf nor :OrIf.
 
@Mayube Does actually work, as in does it evaluate cond2 if cond1 is false?
 
@Adám depends on the language, in JS, Java and C#, it won't evaluate cond2 or cond3 if cond1 is false, in Java you can change && to & to fix that (unsure whether that also works in C# or JS)
 
Does your APL do that?
 
@Zacharý Dyalog APL skips to the next condition set as soon as one of a AndIf-condition-Block evaluates to false.
 
:If cond1 ∨ cond2 ∨ cond3
true
:ElseIf cond4 ∨ cond5
false
:ElseIf cond6 ∧ cond7
maybe
:EndIf
 
2:32 PM
@Zacharý Right, that's if you do want full eval.
 
Assuming no side effects occur in the conditions.
 
I figured out the formula to getting lots of rep: post in a really hard to program in language while the question is still on HNQ
 
are you referring to your Shakespeare language?
 
@Mayube No, the Taxi answer I posted recently
 
oh right yeah that's what I meant
 
2:35 PM
@StepHen Now do this one
 
No it's because the challenge name contains
Taxi
 
yeah the formula to getting lots of rep is posting in an obscure language that matches the challenge
like the challenge where you had to blank out all text except for the word "Rex" and somebody did it in REXX
 
or the Adam West one in WordF***
 
yeah
hmm.. the problem with CodeReview SE is when you don't receive any answers you're not sure whether nobody's bothered to answer or whether your code is just that good
 
@Mayube Bounty it then :P
@WheatWizard It's hard to do arrays or whatever in taxi
That one would be possible if I could guarantee each item in the arrays would be a single positive digit because of Chop Suey
but Taxi doesn't have array-type input, and I'd have to tokenize the input to get a line, and that would be just way too difficult
 
2:38 PM
@StepHen it's only been up an hour or so, I'm just impatient :P
 
@Adám ಠ_ಠ gets sent through .encode('utf-8').decode('raw_unicode_escape') and somehow this ends up decoding it as iso8859--1
 
@Mayube I actually successfully got an answer on SO for work when I bounty'd my question
 
The reason it gets sent through that encode/decode is that this is necessary to properly decode the names sent in the user list, which don't use unicode at all, they're plain ascii with \uXXXX escapes in them.
And looking at the docs, raw_unicode_escape is indeed "latin-1 with \uXXXX and \UXXXXXXXX for other code points"
 
anybody like deciphering ciphertexts?
 
@ToxicFrog ok, thanks.
 
2:41 PM
I wrote a cipher this morning for somebody to decipher, pastebin
 
This is an easy fix (decode names differently depending on whether they came from the user list or MessagePosted events) but I'm baffled that it's even necessary.
 
I really need to find the time to work on braingolf's node interpreter more, instead of adding more stuff to the python interpreter
 
Okay, I'm going to attempt to find Fortress 1.0 ... instead of 0.1 ALPHA.
 
'œ': # parity test, 0 if even, 1 if odd
lambda stacks, stk_no, stack: stack.push(lit_eval(stack.pop()) % 2)
question:should i flip it?
1 for even, 0 for odd?
 
@totallyhuman No. This way it is equivalent to mod-2.
@Zacharý :
 ⎕←'Please input one or more numbers with an avg of 0'
 numbers←⎕
 :If 1|⎕DR'numbers'
 :AndIf 0=+/numbers
     'correct'
 :Else
     'wrong'
 :EndIf
 
2:50 PM
That looks much better when it is actually being used.
 
@Zacharý Eh, the quotes around numbers need to go away
 
I see used a lot in APL, I used to think it was the "your font is missing this character" symbol, but it's wider than that, what is it? And what does it do in APL?
 
It's IO or system function.
 
@Mayube It means "system", as in I/O or constant, variable, function, operator, or namespace.
 
so ⎕← is output to system, ie Console.WriteLine, and ←⎕is read from system?
 
2:54 PM
@Mayube Well, ⎕← is STDOUT and ⍞← is STDERR, while ←⎕ is evaluated input and ←⍞ is text input.
 
ah okay
 
Also, the assignment arrows are not necessary, they are just here for clarity.
 
so what is 1|⎕DR?
 
@Mayube mod-1 of the Data Representation code.
@Mayube And a typo, should be 2|
Here is a working version:
 res←foo
 ⎕←'Please input one or more numbers with an avg of 0'
 numbers←⎕
 :If 2|⎕DR numbers
 :AndIf 0=+/numbers
     res←'correct'
 :Else
     res←'wrong'
 :EndIf
 
Does APL have any OOP structures?
 
2:58 PM
@Mayube structures?
 
did my question just get hammered shut, reopened and then hammered shut again >.>
 
Can you define classes? Can classes inherit? Can you define interfaces?
 
19
Q: Fibtraction - Fibonacci but with subtraction

totallyhumanThe Fibtraction sequence (as I call it) is similar to the Fibonacci sequence except, instead of adding numbers, you subtract them. The first few numbers of this challenge are: 1, 2, -1, 3, -4, 7, -11, 18, -29, 47, -76, 123, -199, 322, -521, 843, -1364... The sequence starts with 1 and 2. Ever...

of course Peter Taylor dupe hammers it :(
 
@Mayube Absolutely, Dyalog APL has full C# style OO: tio.run/##lZG/…
 
mm this is ridiculous
 
3:00 PM
cool, I'm gunna port one of my C# projects over to APL at some point for fun then
 
@Mayube OK, but you can also just use .NET to communicate with your existing code. Dyalog APL is on Microsoft's official list of .NET languages.
 
yeah but then I might as well just keep writing it in C#, I'll use the .NET support to be able to keep using the Nuget packages I'm currently using
 
maybe more eople will come in and reopen
it happened before
 
@totallyhuman that's what I was aiming for
 
@Mayube Using .NET in Dyalog APL:
TimeUser;⎕USING;begin;end
⎕USING←'System'
⍞←'Hit Enter twice, with as little delay in between as you can!'
{}⍞
begin←⎕NEW DateTime ⎕TS
{}⍞
end←⎕NEW DateTime ⎕TS
⎕←'You had a gap between your presses of:',end-begin
 
3:10 PM
tbf there are more people voting to reopen than people voting to close
seriously hammers are weird
 
Hm, .NET doesn't handle negative years.
 
3:29 PM
> Names of other programming languages are Fortran, APL, Pascal, and PL/I.
(from cs.virginia.edu/~evans/cs655/readings/steele.pdf) does that indicate anything about the age of this talk?
 
@Christopher yes I'm planning on posting it but I still need to finish it
no you cannot have it
 
@Zacharý Brilliant speech.
 
What, just due to the fact he mentions APL, or actually brilliant, or both?
 
@Zacharý Actually brilliant. I hadn't seen his treatment of APL when I wrote that.
Reminds me of Thing Explainer language.
 
Yeah, I'll have to actually read it some time (instead of freaking out due to the email of the leader of Project Fortress being present at the top of the pdf)
 
3:47 PM
@totallyhuman I would have hammered it as well, we already had a lot of really similar challenges about fibonacci and relatives
 
4:07 PM
If it reopens, please don't hammer it shut again >.<
 
@Riker Ok
@WheatWizard past me was a bit dum
 
well you're still on ppcg so...
 
Hey, @Adám is the problem in the quote "The name of a piece of user code is a word, but things that are built in are named by strange glyph" fixed by Dyalog APL's dfns?
 
HEATHEN PPCG is not dumb!
 
Every now and then, I'm thinking about how specific behaviour in Braingolf works under certain circumstances, and I realise I have no idea how braingolf would react until I test it
 
4:14 PM
Wait, who is the creator of BrainGolf?
 
mayube it's mayube
 
-4
Q: PRINT BIG LETTERS

Paul StrobachYour task is to write a program that gets a string of uppercase letters as input and prints them in a bigger format using only the one letter that is currently printed out: Example: CAT becomes: CCCC AAA TTTTT C A A T C AAAAA T CCCC A A T Of c...

 
<--
 
-25% byte count if it is a actual ascii art. (made with slashes like usual art)

-1/2*votes % byte count.
 
What is "specific behaviour" then?
 
4:15 PM
On a level of Dennis to me how bad is that voting bonus for code golf?
 
Well in this case I was wondering what happened if you ran . (duplicate) on an empty stack
turns out it throws an index out of range error, which is what python throws when you pop from an empty deque
 
Link to github?
 
oh believe me you don't wanna see the code
 
*links*
oh nvm
 
braingolf.py is the current interpreter, braingolf.js is a very early WIP re-write in node, that currently lacks almost all of the features
also I gotta say, I figured the new (...) loop would be super useful for certain challenge types when I added it, but so far none of those challenges have popped up since the one I added it for >.>
 
4:17 PM
Avocado
 
avodad
 
AVACADO How would you rate the bonus for code-golf i gave?
 
@totallyhuman I'm guessing you gave up on using braingolf on ppcg? :P
 
IS that the same as giving up on my brain?
 
no but my first instinct is to try python
 
4:19 PM
@Mayube if you paid me to use braingolf i would use it
 
and then i add features appropriately to my own language when i realize the challenge is impossible in my language
 
If you paid someone to use <insert language here> they would use it.
 
hmm, how would you guys expect niladic +-/*^% to function?
 
uhh some random useful constants?
 
+ no clue
- negative one
/ some fraction
* no clue
^ some high valued number
% 100
 
4:21 PM
hmm idk, what if you wanna access those constants when the stack isn't empty?
 
Don't make the same mistake I did, use implicit input.
 
you can't have them do both at the same time
 
@Zacharý / wouldn't work, because Braingolf only supports integers, but the others seem good
@Zacharý Braingolf's always had implicit input and output
 
@Zacharý Even if you just gave me a upvote I would use it
 
O_O I'm assuming you want niladic +-*/^% when there is no input and the stack is empty.
 
4:23 PM
input goes directly to the stack
 
Oh, then have / + and * just push their code points for now, because I have no clue otherwise.
 
I'm gunna make + push 20
because if the stack is empty, implicit output will just output a newline, which has an ASCII value of 10, and monadic + doubles the number
and in that same vein, / will push 5
^ will push 1,000,000
so I guess * will push 1,000
 
@Zacharý No, you still cannot name things with a glyph, except in ngn/apl. And you can't even add to the "primitives" that have English names (system functions). However, I see that as a strength. It is always clear which "Lego" pieces are immutable.
@Mayube The identity element for each one.
 
Well, sort of (∆). In the original APL, would you be able to call tradfns like left function right.
 
@Adám wouldn't that be a waste?
0, 0, 1, 1, 1
 
4:35 PM
@totallyhuman Is it for golfing?
 
yup
>< 4 reopen votes
 
@totallyhuman Ah. Yeah, I guess random constants. But implicit input is neat in golfing langs.
 
Braingolf has implicit input, it pushes the arguments directly to the stack,.
 
modulo doesn't have an identity element right?
 
@Zacharý Yes, that is a core tenant of APL. Dfns and tradfns work exactly the same seen from outside. One new thing is user defined operators and operands. That didn't use to be allowed.
@totallyhuman 0
 
4:38 PM
that's division by 0
 
@totallyhuman No, the other argument!
 
any number greater than the number you are moduloing
>>> 0 % 42
0
 
Infinity.
 
???
apparently i'm dominating the starboard o0
 
Or the highest number available in Braingolf (once you port to Node.js)
 
4:42 PM
0
Q: Subtract my odds from my evens

Mr. XcoderGiven a non-negative integer, return the absolute difference between the sum of its even digits and the sum of its odd digits. Default Rules Standard Loopholes apply. You can take input and provide output by any standard Input / Output method This is code-golf, so the shortest code in bytes i...

 
@totallyhuman 17 mod-3 is 2 because the largest number 3n<17 gives 17-3n=2. 17 mod-0 is 17 because the largest number 3n<17 gives 17-0n=17.
 
Or one could define it in terms of remainder, in which case ...
a mod b=a-b floor(a/b)
 
4:59 PM
good god
hammered shut, reopened, hammered shut, reopened, vote to close
 
I think a mod should probably lock it and we should discuss on meta. That amount of open/close activity is not normal
 
yeah it's because of hammers >.>
in total, 3 close votes and 10 reopen votes
 
Hammers exist for a reason
 
not a good one
especially in ppcg
 
if the most experienced users on the site think a question is a dupe it probably is a dupe
 
5:02 PM
but if 10 people who have the privilege to reopen it think it should be reopened, it doesn't matter?
 
I think we need to discuss this on meta. I am not dismissing the inexperienced user's opinions. But I feel you are being a little flippant about the votes of the badge holders.
 
0
A: Sandbox for Proposed Challenges

Steven VascellaroJava is to JavaScript as Car is to Carpet (Alternate title: Java is to JavaScript as Ham is to Hamster) code-golf string Title stolen inspired by Greg Hewgill's answer to What's the difference between JavaScript and Java? Introduction Java and Javascript are commonly used among programmers, ...

0
A: Sandbox for Proposed Challenges

Socratic PhoenixGlue the Strings The task is simple, give a single string a and a list of strings, join the strings in the list with a as a separator. Specifics You may not use builtins that perform the above task (ex. Java's String.join, Python's str.join, etc.) You may write a function or a program You may...

 
Then again, Dennis did post an answer.
 
i'm not arguing about their opinions
 
I don't think opening and closing the same challenge over and over until one side runs out of votes is a productive way of dealing with the issue
 
5:04 PM
i'm saying the hammer is unjustified
@WheatWizard agreed
i walked into this knowing they'll be controversy, but the hammers make it weird
 
Something weird about Python I learned today: default arguments are mutable.
 
mm it makes for bad golf
 
Oh yeaaaaaaaaah, I feel as if I had that problem before.
 
def counter(f = [0]):
    f[0] += 1
    return f[0]
 
Well ... when it's a list ... it sort of makes sense.
 
5:11 PM
@PhiNotPi A year or two ago I had an absolutely killer bug that was related to this. It took me weeks to figure out what was going on.
 
@PhiNotPi Ugh, does that change the value of f outside counter too?
 
No, it does not (I think)
 
@PhiNotPi It is just weird. How can counter know the name of its argument?
 
alright imma just stuff answers into the question until it gets closed again
 
I have a feeling it'll get dupe hammered.
 
5:14 PM
@totallyhuman Are you writing a meta about the question? Do you want me to? I think it is best to address as soon as possible. I have already flagged for moderator attention.
 
@Adám No, it does not.
 
should i incorporate into the current meta question?
 
I don't think so
 
mm ok
i'll write one up a bit later
 
5:15 PM
codegolf.stackexchange.com/a/131763/55550, wow, those upvotes came fast.
 
@Zacharý it's been hammered two times so...
 
<insert look of disapproval>
 
><
aw kotlin doesn't have ternary operator
 
Let's hope if it gets closed, it does so without a hammer.
 
5:23 PM
@WheatWizard unlike SO, on PPCG the tag badges' hard part is the answers count.
 
Can you double-hammer if you have a gold of each of two tags that are on a post?
is the only gold badge that someone who isn't Dennis has.
 
Which two people dupe-hammered the question?
 
downgoat and peter taylor
 
@totallyhuman Downgoat should change username to Downgamr.
 
aaaand i get an achievement for the question
 
5:33 PM
If you're going to put any answers up ... then do it fast.
 
Question: what if your favorite implementation of submodules
@Adám .______.
 
@Downgoat what if your favorite implementation of submodules what?
 
@Zacharý just because it is an old question does not mean it isn't dupe ಠ_ಠ
@Zacharý like the way Java does it with packages, the way C does it with #imports
 
Oh, what is!
Then D's import.
What did that say?
 
5:59 PM
Isn't there a Turing complete language utilizing C++ templates only?
 
@Zacharý Wait for the submodule!
 
>.<
 
Woo, first answer in my language
 
What language?
 
Even though it's not done it still beat everyone so far ¯\_(ツ)_/¯
 
6:07 PM
0
A: House of cards (version 1)

Business CatGaia, 22 bytes :┅“/\“--”צ¦_€|-1<¤±×n I have some planned operators that are still unimplemented that could golf this even further. Explanation : Push 2 copies of the input ┅ Get the range to the input. If positive: [1 .. n]. If negative: ...

 
Answer?
Ninja'd'
 
Sadly there's no docs and the parser is a horrible nightmare
I guess I should start writing some docs
 
My language is limited due to my laziness.
 
Um. Where is the parser
I just see function definitions
Oh nvm
 
Why ... why use instead of interrobang ()
 
6:12 PM
Because is the opposite of
 
... how?
Wouldn't the opposite of be ?
 
Well is filter to just elements that pass the condition and is filter to just elements that fail it. My thinking is query (?) for true (?), or query (?) for false (!)
 
Oh...
 
Considering ¿ is if-true-do and ¡ is if-false-do
By the way, is there an easy way to write arbitrary bytes to a file (in Windows)? I'm having some difficulty testing if my code page decoder actually works
 
open(...,"w").write("\x00\x11...")
 
6:19 PM
I'll try that
 
@EriktheOutgolfer 0 and -1 are off by all the bits.
 
we're talking about arbitrary precision here, how do ∞ bits fit in your ram or something?
 
They don't, it's just that if you thoeretically had ∞ memory, then an integer could be any size.
 
you wish...unfortunately no money for that...at least for me
 
I didn't say infinite, I said all of them.
 
6:26 PM
you mean they're finite? I WAS LIED TO BADLY >.<
 
@TheWanderer Yeah because YouTube then streams it at better quality (even at non 4k resolutions), though I record at 1920x1080 and just upsample it.
 
I just posted a pop-con. Rip me
@Dennis You know what this means? Ternary computers are off by 2/3 of the bits
 
That's going to be closed fast.
 
@Zacharý not a dupe
Read them both
 
Still ... vote to close.
 
6:35 PM
But the language is still usable. clear(this) would be invalid in JS
It removes every feature. All that should be done is the minimal removal of features that make JS TC
 
0
Q: Make your language non Turing complete

ChristopherThe challenge: Write some code that when run makes your language non-Turing complete. However, the language must still function with every feature that does not allow Turing completeness. EX: Brainfuck code that prevents you from using > and non wrapping cells. Rules: Pop-con so most votes wi...

0
Q: Trigger the chutes and protect the jackpot

Peter TaylorYou are going to participate in a gameshow. One of the challenges works as follows: The first room contains a large number of identical balls. The second room contains a series of chutes, each of which has a sensor which counts how many balls have been placed in it. A ball which is placed in a ...

 
If the Dennis disapproves, then most likely it's not a good challenge.
 
@Dennis did you disapprove?
Well he didn't VTC
 
Wouldn't that have hammered it?
 
yes
 
6:38 PM
That's why.
 
@Christopher that's because diamond has hammer in it...people who own hammer need an extra level of confidence to vtc
 
@EriktheOutgolfer Ah. I still deleted it as for some reason if the challenges have close concepts but a large difference in the voting criterion voters still vtc as dupe
 
huh?
it's not deleted?
 
I un removed it to leave it
 
I love how this community "downvotes things into oblivion".
 
6:48 PM
@Zacharý Maybe because bad content should be downvoted?
4
 
I understand that, but into oblivion...
 
Only the very bottom few get that many downvotes. The vast majority of bad challenges get a score of -2 or -3, which really isn't "oblivion"
 
Is there an example of this "oblivion" (got the term from the meta about languages newer than the challenge)
 
why are there so many single star messages
 
Because people think it's going to be star-spam.
 
6:54 PM
also my question broke the first page barrier
yay
even though there's dozens of people tryna close it
 
No. I think they've stopped now.
 
there are 3 close votes rn
 
It's gonna stay that way.
 
what makes you think that?
 
It's been that way for a while.
> Can the truthy value be 0 and falsy value be anything but 0
How did you say that @totallyhuman
 
6:59 PM
@PeterTaylor is it correct that for the n = 1 chute case there are only two viable strategies, putting the maximum number needed into a single chute or the minimum number needed into every chute?
 
Click to see funny video at own risk
 

« first day (2354 days earlier)      last day (2493 days later) »