because I have from blah import post and now I have to do feed_post instead of post
Anonymous
Ok first you were complaining about Python supposedly doing hoisting, but I gave you an example that showed that they don't... Now you're saying it's annoying that Python doesn't hoist? Also something about module-level imports and name resolution?
Question 1: "Pseudorandom Numbers"
Develop a recursive linear congruential number generating function that is a given an
element of the sequence Xi as an argument and will produce the floating-point value between
0 and 1 (inclusive) that is to be the next element of the sequence. You will need to...
Input:
A decimal
Output:
The input truncated
How to truncate them?
The integer part of the input will remain the same. The decimal part of the input will be truncated based on the lowest digit in consecutive order. The two step-by-step examples below should clarify what I mean by that:
Exam...
@Bubbler As user202729 said, Leaky isn't pingable from the room, and the rest of us only visit every few days, so Erik may not have seen any new applications
Dirichlet Convolution
code-golfarithmeticnumber-theoryarithmetic-functionsmathconvolutionblack-box-function
The Dirichlet convolution is a special kind of convolution that appears as a very useful tool in number theory. It operates on the set of arithmetic functions, and there is even a identit...
Through Space and Time
code-golfintegernumber
Introduction:
In general we usually speak of four dimensions: three space dimensions for x, y, and z; and one time dimension. For the sake of this challenge however, we'll split the time dimension into three as well: past, present, and future.
Inp...
Not sure how this is typically done... if I want to run a Java KOTH what is the standard way to share the controller/classes needed? Maven? Or just share the files and have the participants compile it themselves
@Quintec I don't remember seeing Java KotHs but usually the controller's source code is made public so people can analyze it. I don't see why would people run the controller themselves though, it's usually ran by whoever issued the challenge.
There is a "sorting algorithm" sometimes called Stalin sort in which in order to sort a list you simply remove elements from the list until it is sorted. For example the list
[1, 2, 4, 5, 3, 6, 6]
When "sorted" using Stalin sort becomes
[1, 2, 4, 5, 6, 6]
The three was removed because it w...
Someone sent me this description of a joke sorting algorithm, and I thought it would make for a fun golf.
Given a list of positive integers remove all elements that aren't larger than all elements that precede them. Here's an example in Haskell.
stalin :: [Int] -> Int -> [Int]
stalin [] n = []
...
Generate a random number (in the millions) like 2,000,000. Then increase the number a million each time in 8 times. Your code should display like this:
random number
randomnum+1000,0000
randomnum+2000,0000
until you increase it a million each time eight times.
@NathanMerrill I managed to BS management that I needed my own Azure credit because the group I was in managed to max out the number of VMs they could use
We don't have food from "named" restaurants, it's all subsidized by microsoft. They also grow the salad right there in the building, there's a small-ish hydroponics setup
Introduction
Your challenge today is to output the lyrics of "99 bottles of beer":
99 bottles of beer on the wall, 99 bottles of beer.
Take one down and pass it around, 98 bottles of beer on the wall.
98 bottles of beer on the wall, 98 bottles of beer.
Take one down and pass it around, 97 bott...
Is this a Major Scale
The major scale (or Ionian scale) is one of the most commonly used musical scales, especially in Western music. It is one of the diatonic scales. Like many musical scales, it is made up of seven notes: the eighth duplicates the first at double its frequency so that it is ca...
Inspired by "You had me at hello"
Introduction
For those who don't know, hexadecimal is a base system like decimal. Contrary to decimal however, it uses 16 (hence the name) digits instead of 10.
Here are the first few numbers while counting up in hexadecimal to maybe give you a feel of things,...
I'm also curious if there's a meta post about asking one challenge twice, once as a code-golf, and once as a fastest-code. I searched but haven't seen one yet
Here are the basics.
There are 200 people on a train, all with assigned seats.
The first person to board does not sit in his seat, and takes a random seat.
If a person discovers their seat has been taken, they will take a random seat.
If their seat isn’t taken, they will ...
We define the most basic form of the UNIX cat program: Copy data from stdin to stdout verbatim. Data means arbitrary 8-bit binary data.
The challenge: Implement cat using only bash built-in commands. The program may fork, but may not cause any program to exec, other than bash.
The winning solut...