Complement a Regular Expression
Given a regular expression as input, output its complement. If the given regular expression matches a string, its complement should not match it, and the regex: (regex given)|(complement) should match any string.
Regex for input and for output will be POSIX ERE, ...
The Harry Potter series is one of the best-selling book series ever. Add to that the 8-film franchise, and it may well be the best selling series of all time.
Severus Snape once ordered a class to: "Turn to page 394."
Let's see who can come up with the awesomest way to display the number 394....
Since it may be an hour before someone sees this, I'll just ask.
- Is http://www.lettercount.com/ with character count mode selected a solid tool for checking character counts? - Is 3-5 days an acceptable time limit? - I've been imposing input restrictions on questions and some people choose not ignore the restriction. The most refined verbage I have is "may be provided from stdin, read from an arbitrarily named file, or accepted an an argument to the program". Can that be refined further, or should that restriction simply be removed?
@Rusher Re: whitespace - if no-one says otherwise whitespace does count towards the character count. That's one of the reasons you'll find lots of answers with code all on one line - trying to eliminate the newlines. That question you link to added the extra 'whitespace won't count' rule and was exploited because of it.
@Rusher There's no rule about time limits. Some people never accept an answer because they feel it'll stop people from answering their question in the future, others accept the first answer that arrives and update the accepted answer as new shorter ones arrive. My personal opinion is that you should accept an answer, but that the time limit is up to you and whether or not you keep it up to date is also up to you.
@Rusher if people provide ungolfed versions they enter the competition with an unnecessarily high number of bytes. Their problem. Of course you are allowed to give hints on how to spare some bytes but I would generally let them to the job as golfing can make the code more fragile or even break it. You are not their debugger ;-)
@Rusher It's up to answerers to golf their code. If they don't they won't get any upvotes and they may well get downvotes. I'd just comment on their post and point out that it's code-golf and they're expected to at least try.
@Rusher Oh and on limited inputs and other rules: tell them and neither upvote nor accept them until it is fixed. Maybe they were just concentrating on a different aspect of the task and forgot about this.
What might be good would be to disallow anyone from posting questions to the main site and only allow them to be migrated from the sandbox. Or maybe not, that would require a lot of work on the part of the moderators.
Unfortunately the horse has already bolted on that one. A lot of users have gained a lot of reputation on the back of answers to not very challenging challenges and they in turn are posting equally challenge-free questions. There's been some discussion here into what we can do to incentivise the better questions and not the trivial ones. I'm not sure we're any closer to a solution yet though. :-(
You have lifted a rock under which a busy ant farm toils away solving programming puzzles and participating in contests. You were probably looking for the much bigger rock covering the underground kingdom of industrious goblins who run a steampunk robot factory and spend their off hours answering random questions about programming. We call it Stack Overflow. — Jonathan Van Matre1 min ago
@Rusher Re time limits: I agree with Gareth but I would add one thing: in my opinion, the first question you ask yourself should be "Why does this question need a time limit?" king-of-the-hill questions benefit from a deadline because of the interaction between answers, but most questions don't.
What setting a time limit communicates to me (perhaps not to others, because I remember when they were rare) is that the person asking the question doesn't care about their own question enough to bother upvoting late answers.
@Gareth Unless there's a feature to convert an answer on meta directly into a question on main, I think that would clutter up meta with redirecting questions. If we go for a technical approach to the question quality issue, I wonder whether a good one would be for all questions on PCG main to start closed and needing 5 open votes.
@Quincunx I think the minimal DFA for ^([helo][world])+$ has four states, of which one is accepting, so its complement has three accepting states: ^$, ^[helo]([world][helo])*$, and ^(([helo][world])*[^helo]|[helo]([world][helo])*[^world]), so one complement would be ^(([helo]([world][helo])*)?$|([helo][world])*[^helo]|[helo]([world][helo])*[^world]). It might not be minimal, though. Your suggested complement doesn't seem to work for input h
@PeterTaylor and @Gareth I don't think it is wise to implement doormen for this community. The whole idea is that it is easy to ask questions and get direct feedback. Testing questions for quality beforehand is imho counterproductive - it repels question askers if they have to wait (maybe for hours) before their contribution is accepted.
Plus it is about giving other the opportunity to share their questions (without heavy barriers). I still hope that we can give the askers enough guidance such that almost all new questions become good questions.
Retire Windows XP
As we all know, or should know, Windows XP is being retired on April 8th, 2014. Your challenge is to write a program to notify people that their operating system is not supported anymore and is susceptible to viruses. Most interesting solution, as determined by popularity-con...