Top new questions this week:
|
Randal Schwartz stole LISP's decorate-sort-undecorate idiom when he came up with what we'd later call the Schwartzian Transform. With all of my LISP knowledge disappeared through nine half lives, but ...
|
The code will move the mouse from a start point (xs, ys) to finish point (xe, ye) like a human would.
I'd like some help possibly shortening the code (by optimizing it) and making it more readable.
...
|
def greatest(a,b):
if a>b:
return a
return b
def odd_check(a):
return not(a%2 == 0)
def go(x,y,z):
a = odd_check(x)
b = odd_check(y)
c = odd_check(z)
if a and b ...
|
I'm trying to recreate a printer in java,I'm fairly new to programming so I'm using huge if else blocks inside a single function to dictate the logic of the program, I'm noticing this is creating a ...
|
First Class Functions
So, VBA doesn't support functions as first class objects - no passing functions as arguments or storing them in variables.
I eventually found a way to implement function ...
|
I am writing a program in Python that takes a folder of images and animates them.
For example, going through a list of pictures like this and animating them one by one:
Relevant features include:
...
|
I wrote a React app to adjust the serving size of a recipe. For example, if the recipe serves 4 people and requires 4 eggs, scaling it down to serve only 1 person should only require 1 egg. I try to ...
|
Greatest hits from previous weeks:
|
I have recently written the following Pong game in Java:
Pong class:
import java.awt.Color;
import javax.swing.JFrame;
public class Pong extends JFrame {
private final static int WIDTH = 700, ...
|
NodeData stores all information of the node needed by the AStar
algorithm. This information includes the value of g, h, and f.
However, the value of all 3 variables are dependent on source ...
|
Can you answer these?
|
So far, I've been using codes based on solutions other people wrote, and I'm trying to learn by modifying those codes. My problem now is that my code ended up too messy (a lot of script tags, jquery ...
|
Is pattern matching within a unit test a code smell?
Do I really need to throw an exception just for my test to fail if the function under test receives invalid arguments (i.e. not Succeeded case ...
|
All my projects have a fairly similar package layout:
package_name/
package_name/setup.py
package_name/package_name/__init__.py
package_name/package_name/data/foo.txt
...
|