Is it Really Canada Day
Today, July 1st, is Canada day (yay Canada)! Or is it? It seems that the wikipedia page for this day has a lot of Canada related content, but is there another day which is more Canadian?
Your task is to write a program or function which takes a date (month and day) as i...
user214599
Are New main posts, New Meta Posts and New Sandboxed Posts Bots?
Based on this question from Code Review
Given a non-empty string of printable ASCII characters, output the second non-repeating character. For example, for input DEFD, output F.
Input
A single string, in any suitable format.
Output
The second character that doesn't repeat, when reading le...
Sandbox posts with several downvotes (such as the one about lolcats) are signs of what the community doesn't like. Should we keep them to remind users about what not to "ask"?
@uoɥʇʎPʎzɐɹC Oh, my Spacewar! KotH? Yeah, I haven't been doing much. I've been working on a new programming language (not a golfing one) though, so once I get to a certain point with that, I'll start answering challenges with it.
(if I had arrived at my answer by golfing yours, I would have posted it in a comment, but I had actually already finished it and was just waiting for Timmy to clarify the challenge before posting it)
this has definitely happened before where someone golfed a worse solution and gradually converged to a better solution because they were using the same general approach.
I agree with the wikipedia definition. It's a sequence of characters. As the name suggests, it's one-dimensional. I program a lot in C and sometimes in Pascal, which both implement strings in different ways.
C doesn't have a string type, only char[] with a string by convention being terminated b...
working with strings directly is near impossible for most nontrivial tasks, so you always need Characters@ (to split it into a list of singleton strings) and ""<> at the end to join things back together
the really stupid thing is that they're gradually adding String* functions which do essentially the same as the corresponding * function, but on strings except on lists
it would really be better to make most things treat strings at lists instead
@TimmyD btw, I like your challenge, but I feel that the case insensitivity is unnecessary fluff.
my point is, it has nothing to do with the core of your challenge, and while some languages can get the case insensitivity for a byte or two, languages that don't have a concept of letters might spend the majority of their code on the case insensitivity when the actual task is actually not too bad
so whether it's common practice or not, it doesn't improve the challenge
Since this isn't explicitly codified anywhere, and was sparked by discussion surrounding my recent challenge, I figured I'd bring it up here for consensus before modifying the tag.
Related:
string
What's a string?
What are string literals?
Things to avoid when writing challenges: Adding unnece...
Sometimes when no one answers it just means that no one knows the answer, and everyone posting "I don't know" doesn't exactly contribute to the conversation.
@NewMetaPosts There should also be two more answers for "No, strings default to case-insensitive" and "Whether strings are case-sensitive must be defined in the question".
var del = document.querySelectorAll("#BingAsDefaultSearchEngine,#MsnAsDefaultHomePage");
for(var i = 0; i < del.length; i++){
del[i].checked = false;
}
Perl 5, 30 bytes
for$x(1..$_){$_=abs$_-reverse}
Input and output in $_. May be run using:
perl -ple '...'
so that each line of stdin produces one line of stdout.
It iterates n=|n-rev(n)| n times, so output is 0 if there is no loop, >0 otherwise. Dennis already proved this is enough.
Mmm, kinda. The $_ variable in Perl is really similar to the $_ variable in PowerShell (that was the inspiration for the PowerShell team), and I think only works in a REPL style environment.
Type It In! codegolfkeyboard
Given the input of a sequence of normal keyboard keys and keyboard actions, output the product when all the actions are processed based on an English QWERTY keyboard.
Rules
The input will always be a sequence of the normal keyboard keys (i.e. those whose character...
Type It In! codegolfkeyboard
Given the input of a sequence of normal keyboard keys and keyboard actions, output the product when all the actions are processed based on an English QWERTY keyboard.
Rules
The input will always be a sequence of the normal keyboard keys (i.e. those whose character...
@R.Kap I get the difference between what shift and caps do, I'm just saying that I think it would be more interesting and true to real life to not have shift as a toggle. That's just my two cents.
I just went to a question I had already voted on, and wasn't sure which way I had voted:
Intuitively, it seems that the brighter arrow (down) would be the direction I voted - but I actually upvoted the post.
Compare to a post I haven't voted on:
The arrows feel too bright overall; distrac...
@Liam All right, although I don't really see how that's more true to real life. I mean, I always use Shift to access all special characters whereas usually use Caps Lock when we have to enter many uppercase letters in a row without having alternate characters output when keys other than the alphabet keys are pressed.
I've got an easy challenge for you all.
You need to get the MD5 hash of the input, and print it out.
For PHP, the input is $_POST['Input'].
The less byte count wins.
Go!
Create a program that prints the MD5 sum of its source in the form:
MD5 sum of my source is: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
No cheating - you can't just read the source file and compute its sum. The program must not read any external information.
Of course you can use a MD5 library availabl...
I don't consider that a dupe - I think the old question should be a dupe of this if the new gets cleaned up - the quine is just extra work for no real gain
Domain Name Appraisal
code-challenge
Domain name trading is big business. One of the most useful tools for domain name trading is an automatic appraisal tool, so that you can easily estimate how much a given domain is worth. Unfortunately, many automatic appraisal services require a membershi...
My main concern with it is the exact scoring method. The question is: if your program guesses $X and the correct value is $Y, how many points should you get? Right now I'm using abs(log(X) - log(Y)).
Type It In! code-golfstring
Given the input of a sequence of normal keyboard keys and keyboard actions, output the product when all the actions are processed based on an English QWERTY keyboard.
Rules
The input will always be a sequence of the normal keyboard keys (i.e. those whose character ...
@flawr I did say based on a standard American-English QWERTY keyboard, but if that is not clear enough, I will add an image of what I am talking about.
Type It In! code-golfstring
Given the input of a sequence of normal keyboard keys and keyboard actions, output the product when all the actions are processed based on the following keyboard, where the actual symbol of each key is shown on the bottom, and the result of shift being held down while...
Type It In! code-golfstring
Given the input of a sequence of normal keyboard keys and keyboard actions, output the product when all the actions are processed based on the following keyboard:
+-------------------------------------------------------+
| ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | ...