« first day (2215 days earlier)      last day (2622 days later) » 

6:00 PM
C golfing question: which compilers allow f(a,b) in place of int f(int a, int b)?
 
@DJMcMayhem GCC is fine with K&R for the most part.
 
You're right, GCC seems very forgiving: Try it online!
At least, for C. C++ less so
 
Yeah, most of the weird weak typing possible in C is not allowed in any C++ compiler.
Part of the standard.
 
Actually, it seems TCC is even more forgiving, given that you do not even need return statements in functions, and that it's based of GCC.
 
6:10 PM
@EriktheOutgolfer You don't need returns in GCC under special circumstances: tio.run/nexus/…
2
 
Woah. That's a huge golfing tip. What are those circumstances?
 
Huh? I'd swear this didn't work earlier that I had tried.
 
Anonymous
@DJMcMayhem The implicit return type is the result of the last expression (usually/sometimes)
 
@DJMcMayhem Yeah, it even beats preprocessor solutions.
 
Anonymous
Err, rather, it's stored in the first argument
 
6:12 PM
7
A: Tips for golfing in C

G BAssign instead of return. This is not really standard C, but works with every compiler and CPU that I know of: int sqr(int a){return a*a;} has the same effect as: int sqr(int a){a*=a;} Because the first argument is stored into the same CPU register as the return value. X-Macros Another u...

 
@Mego Then why doesn't this work: Try it online!
 
Anonymous
You have to store it in a
 
Nevermind
Then why does this work? Try it online!
 
Anonymous
That's weird
 
@DJMcMayhem Because you are assigning something to something
 
6:14 PM
That might be a GNU C extension.
 
Anonymous
I always thought it was the first arg
 
Oh wait nevermind
I misread it
 
Apparently when I do a+=2 (or even b+=2) it returns 0
 
Also, why does this work Try it online! but this doesn't: Try it online!
 
Anonymous
But when you do a+=a, it works
 
6:15 PM
(I'm filled with questions today)
 
Anonymous
It must be because a temporary copy of a is pushed on the stack, and that is implicitly popped and returned
 
Anonymous
a+=2 probably gets optimized
 
@DJMcMayhem But this works: Try it online!
 
Anonymous
@DJMcMayhem Second one is a constant function that doesn't depend on the args, so it gets optimized
 
@KritixiLithos woooooaaah o_O
 
6:17 PM
It's like magiC
2
 
0
Q: Find Recursively Prime Primes

Wheat WizardThe Recursively Prime Primes is are sequence of primes such that p(1) = 2 p(n) = the p(n-1)th prime Here is an example of how one might calculate the 4th Recursively Prime Prime. p(4) = the p(3)th prime p(3) = the p(2)th prime p(2) = the p(1)th prime p(1) = 2 p(2) = the 2nd prime p(2) = 3 p(...

 
I regularly use C, I'm obsessed with code-golf, how have I never known this before?
 
@DJMcMayhem That's how I felt when I saw this tip for golfing in Processing being used in an answer.
 
It's even cooler when it's a language you use regularly. Good vim answers blow my mind
 
@KritixiLithos wait, what?
That's so bizarre
 
6:31 PM
@Doorknob I think eax is just a convenient register, so the compiler puts whatever it can there, and that happens to be where it looks for a return value later.
 
@Doorknob Not really. gcc doesn't try very hard to optimize by default, but it still recognizes int c = 42; as useless and optimizes it out. With -O1, the int c = a*b; version also stops working.
 
I mostly meant the whole "return without return" thing in general
 
@Dennis But why is int c = 42; useless but c = 42 + (b=0); not?
 
This is shorter: Try it online!
@KritixiLithos because it forces the compiler to evaluate b?
 
@KritixiLithos Both are useless, but the first is easier to recognize.
 
Anonymous
6:35 PM
@KritixiLithos Because it references one of the args. Since gcc isn't trying too hard to optimize at default optimization, it doesn't expend the effort to realize that is the same.
 
is youtube down
 
0
A: Sandbox for Proposed Challenges

billpgSolve The Halting Problem Write a program that will take the text of another program as input. Your program will examine the code and output a result that the program either halts or will keep running forever. That's impossible? Nonsense! To show how wrong you are, I've written this program tha...

 
@DJMcMayhem But int c = 42+b-b; doesn't work...
@betseg Not for me
 
gives 500 for me
 
6:37 PM
> It's not just you! youtube.com looks down from here.
 
@KritixiLithos super weird
 
@KritixiLithos That's also an easy optimization, as -b+b is superfluous in all well-defined situations. This isn't the case for /b*b; you have to know the value of b to know the result.
 
Other similar sites say it's up though.
 
Oh, it was *b/b, not /b*b.
 
Is b an int or a double?
 
6:39 PM
Int
@Dennis because it might be zero or out of bounds?
 
3/2*2==2
 
@DJMcMayhem Yeah, it looks like gcc has reservations about this, even with -Ofast. Division by 0 is still UB though, so the compiler could technically optimize out *b/b out if it wanted to.
So is signed integer overflow.
 
@Downgoat Yeah, basically >_>
 
@TuxCopter In that case I am dead
 
Well no, visibly the angine -> angina is only fr -> en
 
6:52 PM
Is angina sore throat?
 
@LegionMammal978 No, this is welsh
 
Nov 28 '16 at 17:08, by Eᴀsᴛᴇʀʟʏ Iʀᴋ
user image
 
7:14 PM
@Riker Yr wyf yn $100% yn rhugl yn y Gymraeg wyf yn golygu dod ar ymladd mi MBGI (mewn bywyd go iawn)
 
lol
 
Huh
I translated the lyrics to "Never Gonna Give You Up" and got the TTS to read it
 
@LegionMammal978 There's nothing really surprising, Old Frisian shares a common ancestor with Old English
 
It (the Welsh TTS) sounds like it's saying stuff in English (or at least the same syllables)
 
@TuxCopter Old English actually "evolved" out of an old germanic language
The language that gets closest to that and is still spoken today is Frisian.
 
7:24 PM
@Luke Old English and Old Frisian has the same ancestor which is a child of Old Germanic
 
Yes
 
@LegionMammal978 Welsh has the same phonemes of English with some exceptions, so it's not surprising
 
Peidiwch â gadael eich breuddwydion fod breuddwydion
Ddoe dywedasoch yfory
Felly dim ond yn ei wneud
Gwnewch eich breuddwydion yn dod yn wir
Dim ond yn ei wneud
@LegionMammal978 relevant ^
lol google prettifier thinks welsh is code
 
If you have it on, won't it force anything formatted as code to be highlighted?
 
yeah, but it has particular formatting for welsh
single characters are green, and the first word of every line is purple
 
7:30 PM
Screenshot, please?
 
@Riker CMC: Make a programming language using Welsh keywords
 
@Pavel blue highlight bc my message
@TuxCopter "for"?
 
@TuxCopter Welsh is a subset of Latin-1, right?
 
like using welsh versions of keywords?
@Pavel yeah
 
@Pavel The welsh alphabet is the latin alphabet + âêîôûŵŷ
 
7:32 PM
once @DJMcMayhem figures out people's python then I'll work on welsh
it's practically the same thing
 
Interpreter: Take input, feed through Google Translate, feed into Python.
 
no bc strings
what if you actually want to put in 'peidiwch' as a string?
you can't, because the translate would replace is with 'do'
 
@Riker every developer: "Why would anyone want to do that?"
 
Ignore strings/names.
 
tra 1:
    brint("Helo, Byd!")
 
7:34 PM
@muddyfish yeah but for consistency
@Pavel how?
easier said than done
 
@Riker not really
 
Eh, regex.
 
you just feed it through the tokenize module
 
ah
I'll try to do that later then
whenever I remember
 
Leave anything matching /".*?"/
 
7:35 PM
nested?
 
@Pavel commented out?
 
If it's commented, then it doesn't matter what you do with it.
I supposed exec would be a bit broken.
 
@Pavel not if it's not closed
 
/'''.*?(''')?/
Obviously implement for both ' and ", remember to escape \", etc.
Seems simple enough.
 
try it
it's harder than it looks
regex just isn't designed for arbitrarily nested stuff
 
7:38 PM
Why are we arbitrarily nesting anything
What exactly is being nested?
 
@Riker Hence the parsing HTML with regex meme
 
yeah
@Pavel quotes
you can't make 1 or even a bunch of regexen to match quotes perfectly, because they can be arbitrarily nested
 
Uh, you can't nest quotes.
 
since when?
 
Like, can you give an example?
 
7:39 PM
You can nest mixed quotes without ambiguity
 
So '"'foobar'"' is literally the string "'foobar'"?
 
"this is a quote about 'this quote which quotes "this one" ' "
 
I did not know that.
 
@Pavel no, that's just <error>
 
Depends on whether your language recognises that, but you could in principle
 
7:41 PM
it would be the string of ", then the command foobar, and then " again
 
We're talking about Python.
 
but that would error in most langs
 
So, how do you nest quotes, then?
 
 "this is a quote about 'this quote which quotes \"this 'test \"test\" ' one\" ' "
 
Ah right. In python you can only nest one - it doesn't recognise beyond that
 
7:41 PM
You can use a lookbehind to check for \
Right?
 
@Riker I have literally no clue where to start
 
prolly tokenizer module like muddy suggested
@DJMcMayhem I'll help when I get time if you want
just finished raging at sans, got some schoolwork to do, should be done in 15 min
 
Haha
 
it's hard ok
and the disturbing smile
 
@DJMcMayhem I would tokenise it, replace NAME tokens with your tested values with the builtin ones and then untokenise it and then run exec on it or something
 
7:46 PM
/"(?<!\\).*?"/
 
There, matches " quotes. Use or to make it work with ' quotes.
 
@muddyfish this is cool module thanks for telling me about it
 
Wait no I put the lookbehind in the wrong spot.
 
rip
 
7:49 PM
Pretend it's before the last "
 
@Pavel "Hello"' '"World"
 
Matches "Hello"and "World"
That string it an error, no?
 
@Pavel you're missing the space
@Pavel it's perfectly valid syntax
 
>>> "Hello"' '"World"
'Hello World'
>>>
 
It's three strings in a row.
 
7:52 PM
@Pavel concatenation by default
 
Oh, I didn't know python did that.
 
yep
only certain cases
 
@Pavel it's really to provide strings separated across lines
 
Like I said, it doesn't work with ', you can trivially modify it and use or. and then you get 3 strings instead of 1, which it technically is.
How many special cases can you have for Strings >_>
I suppose I also need to account for r"foobar\", if I recall how r"" works.
 
raw
backslashes are literal, not used to escape stuff
it's really just escapes turned off iirc
 
7:55 PM
So yeah, case for that.
Wait, python 3 has f"" now.
 
@Pavel also unicode
 
That breaks everything
 
but that's prolly pretty easy
 
Yeah, unicode doesn't seem like an issue, just a check for u?
Exec is kill tho
 
@Pavel ((?:[bB][rR]?|[rR][bB]?|[uU])?'[^\n'\\]*(?:\\.[^\n'\\]*)*'|(?:[bB][rR]?|[rR][bB]?|‌​[uU])?"[^\n"\\]*(?:\\.[^\n"\\]*)*")
 
7:59 PM
That's a bit of a horrifying Regex.
8
 
@DJMcMayhem -1 peoples python does not pop up on google for "peoples python dj <your name>"
 
or any combination of those words
@ATaco Congratulations, you have just won the understatement of the year award!
 
I don't even know regex
 
good
you should stay that way
 
8:04 PM
hello
 
Regex is a very useful tool and the moment you learn it you will wish you never did.
 
@seshoumara o/
 
Or you learn Retina, which is even worse than normal regex.
 
If I see an answer that isn't golfed, and I mean verbose C or Java program, would downvoting be in the spirit of this site or not?
or any language for that matter, python etc
 
You can flag for not an answer.
If there was obviously no effort put into golfing it, using a language difficult to golf in is to be rewarded.
 
8:09 PM
The answer does what is needed and no, it was an easy language to golf in. Even if it wasn't, variable names are verbose, so not even that.
 
Leave a comment, flag for non-answer.
 
@seshoumara flag it then
 
Assuming it is a
 
@ATaco I've flagged non- answers as nongolfed in review before
needless to say they were rejected
 
@Riker sowee ;_;
 
8:12 PM
lol
 
CMC: find the pattern
0 -> 2
1 -> 12
2 -> 59160
3 -> 110160221250592251028406545681140772978982039413717521677966633224768994790960
 
@DJMcMayhem V's repo pops up for "dj github" in my search history tho so I found it
@ConorO'Brien there isn't one?
 
oh, there is
 
@Riker it also shows up if you search my username
 
oh true
 
8:14 PM
As well as some really random imgur posts I've never seen before
WTF?
 
@ConorO'Brien that was the "i am too lazy to try to figure it out so heres an answer half hoping it's right but knowing it's not" answer
 
@ConorO'Brien programmed in 69 bytes in stacked
@Riker lol
 
@DJMcMayhem what, "djmcmayhem"? nope
all I get is twitter + GH + SE
hahahahaha
 
Really? I get V as the second link
 
oh it does
GH meant your repos
I was commenting on the lack of imgur
@DJMcMayhem I found your dumplogs from ascension.run/dank.ninja, the nethack server
 
8:16 PM
Try images
 
for user DRHamJam
and your current one, djmcmayhem
 
That's funny
 
hahahaha @DJMcMayhem I found a aviation.se question you commented on once
tons of images from SE posts you've commented on, but no "weird imgur stuff"
 
@Riker That's hilarious. Link?
 
9
Q: What aircraft did this canopy come from?

Brenda SeitzThis canopy was found near Wetumka, Oklahoma in a small creek running through my best friend's property. The canopy is about 12 feet long. Can anyone tell me what aircraft it came from, or who I could contact to ask? A loving cup from 1906 dedicated to a Miss Grace Walling Spore from the USS All...

Please do not vandalize your own posts. If you really want to delete it, either hit the delete button, or flag it and ask a moderator to delete it for you. — DJMcMayhem Oct 17 '16 at 1:10
 
8:20 PM
Hahahaha
 
@DJMcMayhem imgur.com/gallery/ADcSE imgur gallery you once commented on
that's the only imgur stuff
 
Check edit history, that's probably something charcoal reported
 
@ATaco hmm, flagging an ungolfed answer is a bit too much, even for code-golf. The answer shouldn't win, maybe a few downvotes and a comment, but it is still a valid answer, is it not?
 
nope
the consensus is not golfed = invalid
 
34
A: Definitive policy about answers not meeting the challenge specification

DennisScope As I see it, there are five types of invalid answers: Answers that produce incorrect results. This is the most common type, and usually an accident. Answers that produce correct results, but break a rule of the challenge, ignore parts of the spec or violate a loophole. For example, ans...

Item 3 of the scope, specifically.
 
8:23 PM
I think this is probably the most obviously NAA answers has appeared in review
 
Yeah, just saw that
 
@Dennis mod hammer plz
 
ok, I'll stick to the policy with no regret then
 
yep
 
does everyone else see this as your own reviews? They should be Martin's in the first posts queue
 
wat
8:27 PM
> Unix has been used as a brand name for various products including book shelves, ink pens, bottled glue, diapers, hair driers and food containers.
-- Wikipedia
 
@muddyfish yes
 
so, is there a queue for flagged answers to be reviewed?
 
@Riker ?
 
@seshoumara that's it
@muddyfish think so
@seshoumara VLQ generally
 
@seshoumara A moderator only one
 
8:28 PM
well yeah, but very low quality flags also put it in the low quality posts queue
@muddyfish hm, the tokenize module strips out delimiters (as it should), do you know if there's a way to find them back?
 
@Riker do you need them?
(hasn't a clue what the technical term for delimiters is)
 
ok, thanks
 
@muddyfish yes
for outputting the code w/ replaced words
 
so you don't get the same(ish) thing as you put in when you do untokenize?
 
@muddyfish Why would my review history show Martin's?
 
8:32 PM
@muddyfish 1 sec
@AdmBorkBork the URL has the userid of 8478
martin's user id
 
Oh, hah, didn't even notice.
 
0
Q: How did I end up with this FizzBuzz?

walpenFizzBuzz is so simple, bet you can do it backwards. In this challenge, you will be given the length of the FizzBuzz string and must give the positive integer that produced that string. Description To break this down, a FizzBuzz string for n is generated by the following algorithm. Start with ...

0
Q: Calculate ELO Rating Expected Score

OkxYour task is to calculate the expected chance of winning for 2 players in some game, each with their own Elo Rating. Player A has ELO Ra and player B has ELO Rb The expected score for Player A (Ea) is: 1 / (1 + 10(Rb - Ra) / 400). There is a similar equation for Player B (Ea): 1 / (1 + 10(Ra - R...

 
lol, was just reading through O'Hair v. Paine
The allegations are pretty silly to begin with
 
Martin peter
	return "food"
you "pls test me"
@muddyfish ^ is input
should output:
False for
    return "food"
print "pls test me"
nonsense but it works as a test
 
@Dennis today I was getting incorrect results from a dc code that I was running on TIO
 
8:35 PM
but it doesn't have some spaces, it actually outputs
Falsefor
    return"food"
print"pls test me"
no spaces between a keyword and the next
 
try Untokenizer().compat(tokens.next(), tokens)
 
@seshoumara There's not much I can do with that information. I'd need the permalink of whatever you tried to run and the expected output.
 
@Dennis Example: AZ5E^z-f taken from my answer codegolf.stackexchange.com/a/110768/59010 The 5E trick wasn't working, see details there.
 
@muddyfish "StopIteration"?
 
(I have no idea what that might do but it looks older)
@Riker catch that. It just means it's done?
 
8:40 PM
ah
 
actually
no
I have no idea what it's meant to do
 
lol
 
ok
 
idk either
 
create an Untokenizer object
run that function on it
catch the error
 
8:41 PM
which function
 
compat
 
@muddyfish it doesn't output anything though, that's the problem
 
@seshoumara Where does it work? 5Ep prints 59 on my computer, not 64.
 
Just golfed 28 bytes off of someone else's bflack program :D
 
nice!
 
wat
8:41 PM
cool
 
and look in Untokenizer.tokens
 
ah
 
maybe
 
wat
hey guys if anyone wants to submit new retina answer to the multiply challenge, do it now, the bounty ends in 3 days
 
@muddyfish []
 
8:42 PM
@Dennis that's wrong, at least based on the dc version I've always had. This input trick in base 10 using hex letters surely is used across this site, nothing new.
 
are you running from the interpreter or a file?
 
file
not the repl
I assume that's what you mean by interpreter, the repl
 
could you pastebin it?
 
@seshoumara I'm not sure what you mean by wrong. It's what dc does on both my desktop computer and TIO, both from a file and in the REPL.
Do do perhaps have a different version?
 
paste.ee/p/SuplR @muddyfish
 
8:45 PM
@Dennis Most likely. Mine is dc (GNU bc 1.06.95) 1.3.95
 
Both TIO and my desktop are running dc (GNU bc 1.06.95) 1.3.95.
OK, now I'm confused.
 
@seshoumara OS?
@Dennis ^?
it could be a linux/mac/windows thing, or different distros
 
do I get a peoples.txt?
 
openSUSE at home, Fedora on TIO.
 
and assignments.txt
 
8:46 PM
let's discuss further on chat.stackexchange.com/rooms/44639/bash-sed-and-dc if you wish
 
@muddyfish neither are particulary important, but pastebinning now. peoples.txt is the input code, and assignments.txt is a massive dict
scroll down on the paste for more of it
 
Scratch that, I just golfed 159 bytes off of a brain-flak answer. :D
 
nice!
how long was it to start?
 
wat
> scratch
 
Theirs is 223, mine is 64
 
8:50 PM
@Riker 160 bytes
 
wat
Scratch that, I just golfed 3 blocks off a scratch answer
 
@DJMcMayhem nj
 
Wait, I thought Brain-Flak had to be balanced? How did they have 223?
 
wat
> OpenSUSE
Why?
 
@AdmBorkBork +3 for a flag
 
8:51 PM
Why not? It's an awesome distro.
 
Ah, that makes sense.
 
wat
49 secs ago, by wat
Why?
 
Everything works as intended. It's a very nice looking and stable KDE, and I had no problems with upgrades so far. Packages are not quite bleeding edge, but new enough and without weird bugs. That's a lot more than I can say about the distros I've tried before.
 
@muddyfish sorry, I have to go, thanks for the help you gave
 
@Riker I'll ping you when I get it working
 
8:57 PM
thanks!
 
> bleeding edge
that reminds me,
sudo pacman -Syu
woah 3 updated packages in 2 hours
 
poll: how long is your shell profile/startup settings (whatever you use, sum of them if multiple) in lines and characters?
 
i use zsh, both are zero
 
my .profile-user is 73 lines. 1991 bytes
 
@betseg fixed
 

« first day (2215 days earlier)      last day (2622 days later) »