Asked 6 years, 10 months ago Viewed 23k times 1317 Stack Overflow's 6th moderator election has come to a close, the votes have been tallied, and the 3 new moderators are: They'll be joining the existing crew shortly — please thank them for volunteering, and share your assistance and advice with them as they learn the ropes! For details on how the voting played out, you can download the election results here, or view a summary report online. Oh, and one more thing...
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Articles by Reto Koradi
String Shenanigans
Challenge In this challenge, you are to code in any language a program or function that will take a string and replace certain characters within it with different characters. Input [string] [char1] [char2] string will be an indefinite line of characters surrounded by quotation mars, such as "Hello, World!" or "1 plus 2 = 3". char1 will be a single character within string. char2 will be a single character not necessarily in string.
Composite Number Sequences
Composite Number Sequences Inspired by this question Given a positive integer n, your code must output the first n composite numbers. Input / Output You may write a program or a function. Input is through STDIN or function argument and output is to STDOUT, or function return value. Output can be a List, Array, or String. Examples 0 -> 1 -> 4 2 -> 4, 6 3 -> 4, 6, 8 13 -> 4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22 Rules As always standard loopholes are disallowed.
Horizontal graph of word length
You can try it online (all you need to do is give input through the field near the bottom and then hit the button). Suggestions for further golfing are always welcome, especially ideas to remove those wasteful spaces in front of the second and third lines.
A calculator as a list of numbers and operators
Your task is to take a list of arguments that are either integers or operators, and parse them like so: There is a current operator, which starts as +. Each time an operator is found, the current operator will change to it. The possible operators are: "+", "-", "*", "/", and "%", which correspond to their meanings in C and most languages. There is a running solution kept, which starts at 0.
Dead code elimination
Dead code sits there doing nothing, staring at us knowing it will never be executed... but today we can take revenge. The input will be a multiline string. Each line may either be an assignment or an expression . An assignment is of the form where name is a sequence of letters, underscores and numbers, but not starting with a number. Variables may be assigned any number of times.
Fond Memories of Past Primes
Consider a prime number p, written in base 10. The memory of p is defined as the number of distinct primes less than p that are contained as substrings of p. Given a non-negative integer n as input, find the smallest prime p such that p has memory n. That is, find the smallest prime with exactly n primes as substrings. Input can be taken through any standard format. You must support input up to the largest n such that the output does not overflow.
Let's see some action!
Who doesn't love action movies with fast noisy cars, especially those with a lot of crashes? Who doesn't love action shots in ascii art? Two cars are starting at opposite sides of a straight road (with 60 spaces between). They start driving towards each other at constant speeds. The car to the left drives at 1 space per second, and the one to the right drives at 2 spaces per second.
Construct a polynomial with given roots
The challenge is to write the shortest function\program to find a polynomial given the roots. The function or program should take valid input; that is, a list of integers representing the roots of the polynomial, and return valid output. Output should return a sequence of numbers representing the polynomial. For example: I hope you get the idea. For an input of , the output should be , which represents the equation , or . For an input of , the output should be .
Necklace stones puzzle
Given a necklace with color stones (yellow, white, brown, etc.) of at least two different colors, we describe that necklace using letters that correspond to each color, choosing an arbitrary starting point. We try to answer these questions: How many distinct colors does the necklace have? What's the length of the longest segment of contiguous stones of the same color?
Print the Flag of the Arab Revolt!
SQL (PostgreSQL flavour), 284 bytes A nice verbose language that still came in under the byte size of the flag, with a bit of a margin :) Basically builds the top half of the flag in a CTE, outputs that and the outputs it again in reverse order WITH F AS(SELECT*FROM(VALUES(1,'+'||repeat('-',34)||'+'),(2,'|XXXXX'||repeat(' ',29)||'|'),(3,'|XXXXXXXX'||repeat(' ',26)||'|'),(4,'|XXXXXXXXX'||repeat('-',25)||'+'),(5,'|XXXXXXXXXXX'||repeat(' ',23)||'|'))F(I,S))SELECT S FROM F UNION ALL...
Me Want Honeycomb
Try it online in the CJam interpreter. repeats the pattern 38 times and splits it into chunks of length 21. If the chunks were separated by linefeeds, this would be the result: This clearly contains the desired honeycomb. All that's left to do is to replace some characters with spaces, cut off some others and actually introduce the linefeeds. generates the integer 74 100 000 036 and converts it into the array [7 4 1 0 0 0 0 0 0 3 6].
How can I find out what was deleted when I get one of those out-of-the-blue +1 reputation notifications?
Every now and then I'll get one of those +1 reputation notifications a lot of us get from time to time. I'm under no confusion about what causes it: something, somewhere, that I had cast a downvote on, got deleted. (Or I removed my downvote, but let's put that aside, as that case involves no mystery at all.) However, every time, I'm curious about what got deleted, and why.
Show More
loading
Actions
Is this you?
As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.Get in touch with Reto
Contact Reto, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack