« first day (2172 days earlier)      last day (2673 days later) » 

10:01 AM
example?
 
The leaderboard C++ entry was the first I noticed; it's simply: operator+
 
Anonymous
@HWalters Though the input and output may be represented as a binary value in memory, it is usable as a decimal value. The decimal rule is most likely to avoid unary nonsense.
 
@Mego I have absolutely no clue what "it is usable as a decimal value" means.
 
@HWalters Mine works just fine :P
...I think.
 
Anonymous
@HWalters It means you can get a decimal value out of it - like cout << value << endl; would output a decimal value for an int, but not for a unary string
 
10:11 AM
@Mego But it's not because value "has a decimal in it"; it's because std::ostream's streaming facilities convert it to decimal
 
...
if you were going to do operator+(foo, bar)
foo and bar are decimal
pigeon script has kind of a debatable answer
 
Anonymous
I think you're reading too deeply into this
 
@Mego Well consider this. If I were submitting a solution using the C preprocessor, and we just want to add numbers, it's 3 characters; X+Y
I've so far golfed down reducing this number (which is the actual interesting part) to about 3337 characters
(Under the constraint of covering the entire range of the integer)
So, is a C preprocessor solution 3 characters or 3K?
 
Anonymous
I'm going to stick with "I think you're reading too deeply into this"
 
Anonymous
Ooh, tasty spam on the front page
 
10:19 AM
Maybe, but I don't know how to get unstuck from that reading. The spec's pretty clear; output in decimal.
 
@Mego I saw that, it got 0.2 seconds after I flagged it
 
Anonymous
It's dead now. Good riddance.
 
 
10:34 AM
@DestructibleWatermelon I've no problems with the input. Your decimal numbers are converted to binary by your compiler, but in your language it's a decimal, and the spec explicitly says these may be inputs to the function. The output OTOH, maybe because I bothered coding the C preprocessor solution, sure does seem to take a whole hell of a lot of work to get that decimal out; work that analogously in C++ is done by the << that's not in the C++ solution
But I think the best approach right now... is to just golf/submit the C preprocessor solution (maybe tomorrow)... it might become an Eris golden apple though
 
11:22 AM
Hi, moders, can you unlock this golf? I'm improve it's.
http://codegolf.stackexchange.com/questions/106192/converting-floating-numbers-to-string
 
Strangely fascinating: Playing Rock-Paper-Scissors against the computer in Veteran mode.
 
@monobogdan1 This makes even less sense than before - floating point integer?
Try posting this to the sandbox and getting more experienced people to help you edit it.
 
@StewieGriffin rpscontest.com
 
You're basically playing against the average player among thousands of players... And I win! :)
 
You can choose any bot, and click "computer vs human" and play against it!
 
11:26 AM
Fixed
 
Yes, but the bot on the nytimes website has been up against thousands of people (not bots), so it "knows" what the average person would do. Your challenge is then: Figure out what the average person would do in your situation, thus also figuring out what the bot would do. Then you simply choose the hand that beats it...
 
And the example, monobogdan
 
Anonymous
@StewieGriffin I'm losing against the novice :(
 
@flawr, the thing that was fascinating me was: I have approximately 45% chance of winning, and 35% drawing. So I'm only losing a bit more than 1/5 hands.
 
@StewieGriffin I wonder how this bot exactly works=)
 
11:32 AM
@Mego, you're playing against the bot... I would probably lose too. I'm playing against all other previous players (sort of)...
 
PS: I know we should not talk about politics here
but I have to show you this
 
Anonymous
@StewieGriffin I'm doing better against veteran than against novice lol
 
@flawr That was actually the title picture for an article in ZEIT Online
 
@mınxomaτ O just don't know whether it was constructed that way=)
 
@Mego That was my point too... I'm quite sure I'd lose against a bot if it was trained against me. But a bot trained against "everyone" else is a different thing :)
"What would other people play here?"
 
Anonymous
11:36 AM
@StewieGriffin So ironically, the "veteran" bot is easier to beat than the "novice" bot
 
Anonymous
@flawr I don't get it. Can you draw a diagram?
 
@flawr This is the photographer: javierjaen.com (beware of slightly nswf art)
 
tfw it thunders in CA rains
 
@Mego Is there any political figure that has a slight resemblence?
 
Anonymous
@flawr Nope. None whatsoever. You're not making any sense.
 
11:38 AM
@flawr I didn't get it before you wrote that comment...
hehe :)
 
Anonymous
@mınxomaτ The elephant made me chuckle
 
> 2016, Personal
What a contrast to NYT, Fortune etc. covers.
What kind of drugs do you have to be on to think of something like this.
 
Anonymous
@mınxomaτ Artist drugs. So, all of them.
 
...
Apparently my wizard has "one of the most useful spells NetHack has to offer."
I'm starting to think my kitten is trying to starve me...
 
12:00 PM
Eugh, had my first day at school today after xmas vacation. I feel like I was working hard for some 10 hours...
 
It's holiday for heavy snowing in almost all of Turkey, and it's sunny here :/
 
When I was in school, a normal day was 7:30 to 16:15 (plus 1.5 h homework period), about 10h.
 
12:18 PM
0
A: Sandbox for Proposed Challenges

Qwerp-DerpConvert between balanced bases! code-golf math Balanced bases: Balanced bases are essentially the same as normal bases, except that digits can be positive or negative, while in normal bases digits can only be positive. From here on, balanced bases of base b may be represented as balb - so bala...

 
Anonymous
@NewSandboxedPosts This looks really well-specified
 
@Mego Yey
This challenge is simple enough anyway
Also, is there a challenge for arbitrary base conversion?
Because I saw a challenge which only allowed for base conversion up to 36, if I increase the base to 1000, does that warrant a different challenge post?
 
hello
 
@TuxCopter hai
 
Anonymous
12:35 PM
@Qwerp-Derp I don't think so. Maybe if the challenge didn't have an upper limit on the base (aside from language restrictions)?
 
1:09 PM
Why are PayPal withdrawals so random. Sometimes it takes a day, sometimes a week.
 
I am shocked that PPCG wasn't mentioned in the comments here: At what point is brevity no longer a virtue?
(And no, that's not an invitation to add one.)
 
Anonymous
@El'endiaStarman I was really tempted
 
1:27 PM
True story about invisible water vapor. In many power plants today, steam is used to drive turbines (heated by various means). In the case of a steam leak, the steam is at tremendously high pressure and temperature. This means fast streams of steam that don't start to form visible condensation for 15-20 feet, or more. It's also terribly noisy, so you can't hear where the leak is. When looking for these leaks, one waves a broom handle in front of them. They know when they found the leak because the steam will literally cut the broom handle in half! That is invisible water vapor! — Cort Ammon 9 hours ago
Holy crap.
 
Anonymous
The lesson I took away from that is that invisible steam leaks will really mess you up if you stand in front of one
 
Yup. I wonder how they learned that lesson the first time (or knew enough to avoid it).
 
Anonymous
Trial and error and error and error
 
Oh no.
 
1:37 PM
To be fair, that is pretty useless packaging, too.
 
2:22 PM
0
A: Sandbox for Proposed Challenges

flawrThe picture is going to fall! code-golf There are 3 nails in the wall. You've got a piece of string that is fixed to the picture frame with both ends. To hang the picture, you entangled the string with the nails. Now you noticed: The middle nail is soon going to fall out. Can you predict whethe...

 
@El'endiaStarman Expertly drawn rectangular non-freehand circle in OP's post!
 
@NewSandboxedPosts Seems like someone's been reading some Martin Gardner. :P
(IIRC he posed a similar puzzle in one of his books/columns, but in an abstract sense.)
 
@El'endiaStarman No, but I just found some old books from him in an online shop!
 
@mınxomaτ Oh, I was commenting with what the character is saying. Very meta of it.
 
is it bad practice to nominate your own posts for best of 2016
 
2:27 PM
But yes it might originally be from him. I know it from the puzzle collection of our math department when persenting the curriculums to interested possible future students.
 
@flawr I'm not sure it's originally from him, but that's where I heard it.
 
@GabrielBenamy Not if you nominate a worthy post... which one were you thinking about? (out of curiosity :) )
 
@Dada I have a couple, including this one for kansas city shuffle
 
@El'endiaStarman Do you have any of hsi books?
@GabrielBenamy I think it is explicitly allowed.
 
I was thinking about this one of yours too, it's a nice one for kansas city shuffle I think
 
2:32 PM
Strange, the Best of PPCG 2016 post has the -tag, but doesn't show up on the featured list.
Does anyone know why?
 
Anonymous
@flawr Gremlins
 
It's kinda fun going back through old challenges and answers, picking out ones to nominate.
 
-4
Q: C program to check the input whether it is an integer,float, string or something else?

GauRav MisHra#include<stdio.h> #define MAX 100 int main() { int idx; char str[MAX]; scanf("%s",&str); for(idx=0;idx<=MAX;idx++){ if((str[idx]>='a' && str[idx]<='z') || (str[idx]>='A' && str[idx]<='Z')) printf("this is type of string"); else if(str[idx]<='-32767' || str[idx]>='32768') printf("this is type of ...

 
2:48 PM
@flawr Hah, I was literally just about to hit "Save Changes" on my edit, also nominating that answer.
 
@TimmyD =D
Doesn't hurt to get nominated twice!
feel free to add your own text or improve what I've written.
Oh you already did =)
 
@flawr I got the Colossal Book of Recreational Mathematics for Christmas one year. I loved it.
 
@flawr Weird. It did show up for a few hours, now it's gone again.
@flawr Hey thanks! I just noticed that the LaTeX API I was using completely glitched out and all the equations are messed up. They are right in the MD, but they don't render correctly.
 
0
A: Sandbox for Proposed Challenges

Titusbroken keyboard workaround |nspired by BASTA´s song and memories from earlier work: Your keyboard is broken but there is some urgent work you have to complete; you have no back^up hardware - and the shops are closed so you can´t buy a new keyboard! All you have left to work with is your mouse....

 
3:10 PM
2
Q: Count the squares

Keyu GanChallenge Origami (folding paper) is a creative form of art. Let's start from beginning - convert a rectangular paper to a square one. So the paper is divided into squares. We remove the biggest square which shares one shorter edge with the current shape, step by step (see the picture below). A...

 
3:46 PM
Very inactive today.
 
eh
it's a monday
first day back to school (for many people)
 
School cancelled for me, snow
 
@noɥʇʎԀʎzɐɹƆ snow?
 
@flawr Been there. Done that. Overanalyzed questions that make no sense
@EᴀsᴛᴇʀʟʏIʀᴋ roads blocked
 
3:49 PM
> closed on Monday, January 9, due to inclement weather
 
Going to send that article to my LA teacher
 
what state are you in?
rn some roads are closed here in CA due to a shitton of rain and mud, but nothing else
 
@EᴀsᴛᴇʀʟʏIʀᴋ nc
 
-3
Q: functions a challenge

HolyGangsta I just started c programming as a hobbies and so far I've really enjoyed it.....my only little hurdle is functions. I'm using an app and a couple of books to learn. I'm stuck on a question in my app please help....I've given a pic to show you and if anyone can refer me to a book or site to help...

 
4:08 PM
Looking through some related questions on ppcg and i think this is an interesting format that I personally wouldn't mind more of: codegolf.stackexchange.com/questions/8554/…
it could do with better winning criteria
like 1 point per solution or something
 
For those interested in the Discord server and the Discord music bot, we have a new music bot that works! Invite link: discord.gg/ByTwy2y
 
4:26 PM
@El'endiaStarman Do you agree with the following: To see whether the picture falls when removing nail A, we just remove all A and a from the string. Then we simplify: If the same letter in uppercase ad lowercase sit's next to each other, they cancel out. We repeat this until we cannot cancel anymore. If the string is empty, the picture falls, otherwise it doesn't.
 
don't use that on mona lisa pls
 
@noɥʇʎԀʎzɐɹƆ There is a ton of better paintings in my opinion. If we'd destroy Mona Lisa, people coming to the louvre would perhpas notice that.
 
I'm new to this site. Would a crashed program's exit code considered a valid way of output (for example, SIGSEGV)? — Shmuel H. 24 mins ago
Opinions?
Although I wrote the answer Schmuel is commenting on, I don't feel comfortable interpreting the answer since it's really owned by the community, not me.
 
@flawr I believe that's right. You could perhaps prove it by "working backwards", so to speak. Start with the string off the nails and then manipulate it so it loops around the nails.
 
@El'endiaStarman Right, as long as you do not add any knots in the middle of the string=)
@wat seriously?
 
4:30 PM
Rainbolt
 
wat
Tfw the shipping on my thing costs more than the actual thing
@flawr It's my username
I wouldn't mind it if other people spammed wat
 
OMG I HAVE TO STAY UP LATE
 
wat
I actually don't mind "spam" as all the people on the room call it
 
I would, and I immediately regretted my decision to spam my own username (because deleting it would take up just as much space)
 
1:30AM POKEMON EMERALD ANY% GLITCHLESS 3 HOURS :OO
 
wat
4:31 PM
It keeps the room active
> RainboltRainboltRainboltRainboltRainbolt
 
I'm getting too used to Slack, where deleted messages are actually deleted and not replaced with [deleted]
 
@NewMainPosts why are people answering off-topic questions?
 
Anonymous
@orlp Oh man, I forgot that it's AGDQ time again
 
Anonymous
@DJMcMayhem I don't know, and it bugs me when people do it
 
@wat: Many people are aggravated by noise such as that. Including for the purpose of "keeping the room active". You might not think it's spam, but other people do, and continuing to post such noisy/spammy messages even after being told not to is rude.
3
 
4:34 PM
@orlp who's the runner
 
@quartata TheTyrant14
 
Anonymous
This room is plenty active on its own - people don't need to poke it
 
@Mego agreed
It drives me crazy
 
We're almost on our fourth line of users in the room, which is something I don't think I have seen before in here
 
It's been on four lines often for me (at least, on this specific laptop monitor).
 
4:36 PM
Oh, I guess making the window smaller yields six lines of users.
 
It's almost 3 lines for me
 
@El'endiaStarman "four lines" ?
 
Anonymous
Ooh, this year they're doing super metroid hundo 4-way race
 
Oh wait, clicking on the ellipsis yields five lines.
@noɥʇʎԀʎzɐɹƆ Of user avatars in the side bar.
 
Okay how many profile pictures per line? I have 4 lines, 11 when full, 1 missing, and so 43 people
 
4:38 PM
Each line holds 15 for me
 
I get 43 also. 10 per line.
 
13 per line for me
 
15 per line here too
 
I'm on mobile, so I have 44 lines. :P
 
Rod
@Mego and because of twich, I remembered the 2 bot chatting with each other powered by Cleverbot running on Google Home Devices
 
Anonymous
4:41 PM
I have 11 per line
 
nobody else with 13?
 
Anonymous
I see 4 full lines with the ellipse
 
@Mego Same
 
My screen is golfier, it only uses 3 lines.
 
How do I test code-golf C solutions like this one?
 
Anonymous
4:44 PM
@redstarcoder tio.run/nexus
 
Thanks
 
what is the maximum length username on stackexchange?
 
The code's invalid, that was my issue (not my code)
Now I feel less dumb :)
 
Anonymous
On this challenge, should we merge all of the * answers into one CW answer and have people add languages to a list in it?
 
I don't think so. the posters may care about rep
I mean, I might ask Erik the Golfer to merge his, but I don't think merging other people's really is a good idea
 
Anonymous
4:53 PM
Nobody is going to upvote a trivial answer like that
 
Anonymous
Having a hundred billion answers with the same code will make it harder to find the answers where work had to be done to solve the challenge
 
there are a bunch of * answers that are upvoted
 
I don't think there should be hordes of the exact same solution, but can we really enforce just one? I see this as more of an issue in the challenge : /
 
I mean, I think the ideal would be if somebody were to post a multi-language answer, then update it with more languages from the start
but since that didn't happen...
 
Yeah that's usually what seems to happen
 
Anonymous
4:56 PM
@redstarcoder Yes, the challenge encourages trivial builtin solutions, and that sucks, but we can't change that. We can do something about the hordes of identical solutions.
 
...changing the question to disallow certain answers is just as bad as changing the answers
 
0
Q: Implement Exclusive OR

P. KtinosChallenge Without the use of any built-in mathematical operations / methods that solve this problem, XOR two decimal integers that you take as input, and output the result in decimal. Example I/O Input: 72 85 Output: 29 Input: 4123 4123 Output: 0 This is a code-golf thus shortest c...

 
@Mego I agree that we should, but can we demolish the 1 byte * answers into a single CW post without upsetting anyone?
I'd be 100% on board with that
 
Anonymous
@redstarcoder Oh, we'll definitely upset some people. That isn't important - what's important is, is it the right thing to do? I think so.
 
0
Q: Signup email link doesn't work when your name is... unusual

orlpI tried to register an account with the name ௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵௵...

:P
 
4:59 PM
@Mego me too, I can't delete posts though so is there anything I can do to help?
(Just trying to figure out procedure )
 
@Mego you have no meta basis for doing it. I definitely think it's not the right thing unless you get a basis for it
as far as I know, we have nothing in meta against identical answers in different languages
 
Yeah maybe a meta post, I'll help by voting
 
Why, just why?? — bluefeet ♦ 1 min ago
4
 
Anonymous
I'll make one
 
honestly, i consider both making trivial challenges and posting trivial answers to be exploits of the rep and HNQ systems
 
5:03 PM
I think we've done this before actually
Turning a ton of similar answers into one CW. Trying to remember where
 
dice problem?
 
trivial challenges for sure. Trivial answers really only get upvoted if they are humoruos
like the brachylog one
 
@xnor Link?
 
@NathanMerrill quite to the contrary, I can find examples
HNQ voters are clueless and upvote anything
50
A: Determine dice value from side view

xnorThere's a nice polynomial expression modulo 7 for the third side given two sides a and b. or factored The modulo 7 maps to a remainder in {0,1,2,3,4,5,6}. I explain why it works in this Math SE answer, though I do think there probably is a cleaner argument I'm missing. The only other two-t...

 
they'll vote the winner, for sure, but I don't see them voting *
because its boring
 
5:05 PM
@quartata note that these weren't turned into CW but added aferwards
 
you need something else to make it interesting
 
@xnor Yes that's it
 
@NathanMerrill here's an example
 
@Mego Maybe cite this in your post
 
huh... this is startlingly difficult
 
5:06 PM
@NathanMerrill most of the top-voted answers are nothing but a built-in for the identity
 
@xnor that CW seems like a rather bad idea. They all are the same on formula, but differing in code
 
@NathanMerrill yes, that's true
I linked it to justify though that boring answers get upvoted
 
oh, I thought that was an example of a good CW answer
I agree that there are some, but that's not one of them :P
your second link is a good example of a boring, upvoted answer, though
 
I can't seem to think up a regex that matches any lowercase character followed by itself in upper-case
 
Sorry :(
 
5:10 PM
@Mego It seems you're featured here‌​.
 
@GabrielBenamy do you care about internationalization? Or a long regex?
(aA|bB|cC...)
 
@NathanMerrill I can do the obvious, but I want to golf it.
 
ah, you're golfing :P
 
because I'm gonna also try and do the reverse -- an uppercase followed by itself lower-case
 
Anonymous
@flawr Neat
 
5:15 PM
0
A: Sandbox for Proposed Challenges

Horváth DávidTime a loop code-golfkolgoromov-complexitytimenumber Summary Write a program or function, which doesn't take any input, and outputs all the integer numbers, your programming language supports in ascending order, to the stdout, one per line, like this: -9223372036854775...

 
Interesting. The math operators in pidg work almost exactly like in befunge
 
Anonymous
I was quite happy with how my avatar looked with the Mad Hatter hat
 
@Mego you should really pick a different submission as your CW answer
I definitely think its a bad example of a CW answer
its got 20 different languages and 20 different codes
 
Anonymous
@NathanMerrill The point of including that was to point out that we've merged less-similar answers in the past, so why not nearly-identical ones?
 
because "should we merge identical answers" is a totally different question than "should we merge similar answers"
I agree with the former, disagree with the latter
if they are similar, then there is room for golfing
 
5:20 PM
how exactly do you meant identical?
would * and (*) count?
 
the code is literally the same
no, those would be different
 
because maybe the language auto-closes parenthesis
so, I could golf it to ( *
but the instant you CW it all, you've lost all momentum for golfing
 
I was thinking Haskell where operators must be in parens
i wouldn't even call that golfing
it would be obvious to anyone who knows the language
 
that's so ambiguous then
 
5:22 PM
please excuse the nubness, but what is CW?
 
community wiki
nobody gets rep, anybody can edit
 
Anonymous
@NathanMerrill I'm not asking about merging similar answers. Again, the reason for including that was to point out that we've merged similar answers in the past, so there's precedent for merging answers.
 
like, "how close is too close"
@Mego right, but then its misleading. We've had identical answers merged in the past, let me find one
 
Anonymous
@NathanMerrill I tried looking, but couldn't find an example easily. We've had one person (Dennis) post a conglomerate answer before others were posted, in recent memory, but that's not quite the same.
 
5:24 PM
why does /(.)\l\1/ not match a character followed by a lower-case version of itself?
 
2
Q: Should we combine answers where the same code works in many different languages?

MegoTake this recent challenge for example. There are many languages where the shortest solution is simply *. Likewise, for other trivial challenges, the same 1-byte program and/or function works in many different languages. Should we combine these answers into one?

 
Anonymous
@GabrielBenamy Because that's not how backreferences work (I think)?
 
@xnor wait I did that gag before already
let me find it
 
@quartata oh, i didn't know, i'm curious to see
 
@Mego What do you mean?
/(.)\1/ matches any character appearing twice in a row
 
5:27 PM
@Mego hmmm...I'm strugging as well. Perhaps you edit your answer to make that more obvious?
that said, was that question simply a result of multiple people editing their answer in, or did they literally delete a couple of other answers, and merge them in?
the first post says "feel free to add your port", which makes it seem like the former
so, its not really a precedent
 
I don't think we have an example of combining answers after the fact
hence a meta post asking about it
 
then, yeah the sentence "Plus, combining many similar answers into a single CW answer has been done before." is misleading
I mean, its technically true
 
oh, i see
 
but it makes you think that they took existing answers and combined them
 
yes, that's misleading
 
Anonymous
5:30 PM
Oh, I thought that was what happened
 
@xnor Looks like mine was for answers: pastebin.com/m20e4SXb
 
I don't think so. There aren't any deleted answers that feed into it as far as I can tell
 
Hello, I'm new to PCG, can you give me a feedback about my answer?
 
/(.)\lA/ <-- matches any character followed by a lower-case A
/(.)\1/ <-- matches any character followed by itself
/(.)\l\1/ <-- does nothing
 
@ShmuelH. that's funny how return 0 (no error) is falsy
but it looks like a good answer to me
I'm no systems programmer though, so I can't say anything about the validity
 
5:35 PM
@NathanMerrill, yes, it is strange, and thanks.
 
@ShmuelH. it looks good to me. Welcome to the site!
 
@DJMcMayhem Thank you! :)
 
@ShmuelH. really well written! I like the reference list at the bottom!
 
@ShmuelH. Question - how is it 3 bytes when it's 8 characters?
 
Anonymous
@TrojanByAccident That's a hexdump
 
Anonymous
5:37 PM
Each hex pair is a single byte
 
Oh
are spaces not counted as well?
 
They're not needed
 
Anonymous
The spaces are just for formatting
 
spaces aren't hexadecimal. Only characters from 0-9A-F are
 
That's not how hexdumps work
 
5:38 PM
@redstarcoder Thank you! I had to do some research about for each operating system so I posted some of the links.
 
The hexdump is a representation of the actual bytes since the actual bytes can't be displayed
 
Anonymous
If it was encoded in CP437, the code would be @̀
 
Anonymous
In Windows-1252, it would be @Í€
 
Anonymous
It's much simpler to just give a hexdump when dealing with raw bytes like that
 
I'm looking for some advice - Is there a better approach to writing a 30+ case switch statement?
 
5:40 PM
Depends.
 
Anonymous
@confusedandamused Yeah. Have you tried not doing that?
 
I mean, it totally depends on what you are doing
 
@confusedandamused Yes.
 
Anonymous
Whether or not you are golfing is an important consideration
 
Non-golf
 
5:41 PM
@confusedandamused depends on the language and the goals
 
like, if you are parsing input, and doing a switch statement on a string, use a dictionary
 
The situation - In the code I'm figuring out which template (word document) I'm going to be using based on some properties of an element. there are 30+ templates to choose from.
It's in c#
 
that sounds like a great use case for classes
you have multiple properties where each subclass has different values for
 
Currently from what I'm thinking the choosing of the template will depend on either 1 or 2 different string values (I'm literally just calling a .Contains())
 
@confusedandamused can you provide your code?
 
5:44 PM
Any reason not to do the giant switch block?
 
@TrojanByAccident I haven't written the huge switch yet - I've just been reading about other ways to approach it. It's pretty trivial that way, but I can see how classes could prove to be useful
 
Anonymous
On the other hand, sometimes a huge switch statement is the only way to go. Seriously has the equivalent of a 202-case switch statement.
 
@redstarcoder Not really - it just seems like a maintainability issue
 
@confusedandamused Then, what is the switch about? (what variable). A cleaner way to do that is by an array (or a map) and the switch value is the index for the array.
 
@confusedandamused Ah
 
5:45 PM
Classes would likely over-engineer the solution
 
@Mego that's not a switch, that's a dictionary
 
@Mego Well, dispatch table is a little cleaner
ninja'd
 
Anonymous
@NathanMerrill It's used as a switch-statement, because Python doesn't have switch-statements
 
@redstarcoder It's just tiring to type out and long and ugly, is all
 
right, which is a good thing
I'd still use the dictionary even if python did have switch statements
 
5:46 PM
@ShmuelH. Essentially - It's just going to be taking a string, calling .contains, and matching/choosing which template I use.
 
@TrojanByAccident I don't use C# often, but usually I find case/switch blocks to be nicer looking and shorter than if/elseif chains (which AFAIK is why they exist)
 
because semantically it says "I have this string that matches with this function". A switch statement doesn't really carry those semantics
 
@redstarcoder Aren't long switch statements just if-else chains on the back end?
 
Depends on the language
 
I'm talking c#
 
5:47 PM
they aren't in Golang
 
@redstarcoder Yes, switch/case is much better than if/elifs, but there are some other options
 
if they are long enough, they can be converted to jump tables in C#
 
@confusedandamused No idea.
 
but if they are short (like 2-3 of them), then they get converted to if/elseif
 
5:48 PM
Yeah jumptables are just hashtables with function pointers right?
 
Anonymous
@confusedandamused Sort of. Some languages allow fall-through in cases (where a single state can trigger multiple cases). That's pretty different.
 
@Poke ohh man
ahahahaha
 
Think I can run Go on something like this? I ordered it yesterday and I'm very excited.
 
@Poke Bahahaha.
 
5:51 PM
I am most definitely going to try that some time
 
@Poke This is beautiful
 
Anyone mind running a bit of befunge code for me and telling me the output so I can register for esolangs.org?
 
Anonymous
@TrojanByAccident tio.run/nexus/befunge
 
@Mego Can't access it :/
 
@TrojanByAccident Nice try, bot.
(In all seriousness, what's the code?)
 
5:58 PM
\#+:#*9-#\_$.@
 
@Zgarb I didn't think about . Can I integrate that comment into my post?
 
@TrojanByAccident Does this one work for you? quirkster.com/iano/js/befunge.html
 
Anonymous
@redstarcoder Depends on the size of the Go infrastructure. Arduino boards run ARM code.
 
It's Befunge 93 only, though.
 
Hey everybody, our very own punguin @Mego made it onto the Farewell winterbash blog post!
 
5:59 PM
@El'endiaStarman no, it doesn't
 
Anonymous
@TrojanByAccident Drink your Ovaltine
 
0
Q: Linear Regression on a String

carusocomputingThis challenge is a little tricky, but rather simple, given a string s: meta.codegolf.stackexchange.com Use the position of the character in the string as an x coordinate and the ascii value as a y coordinate. For the above string, the resultant set of coordinates would be: 0, 109 1, 101 2, 1...

 
Anonymous
> punguin
 
Anonymous
:D
 
@Mego According to the registration page, it outputs a number t-t
 

« first day (2172 days earlier)      last day (2673 days later) »