take an array of two numbers who are not necessarily in order, and then add not just those numbers but any numbers in between. For example, [3,1] will be the same as 1+2+3 and not just 3+1.
function sumAll(arr) {
let start = arr[0];
let end = arr[1];
if (start > end) {
let temp = start;...
This is my first real personal application and I'm just looking for some outside feedback.
Completely built in Python, this is a Pokédex for the Pokémon Mystery Dungeon series.
I hope to eventually publish to the Android app store.
If you choose to check it out... don't be nice. Tell me how bad i...
When I click on "Ask Question" on codereview.stackexchange.com, it gives me a form that is filled with my previous question. It is not giving me an empty form. Why is this happening? How will I post new question now?
So to check my Python knowledge I am building a cricket scoreboard in Python. My scoreboard could be able to can be used to store previous matches ' scores. A work in progress as of now. But as of now, it is a 50/50 success. I might have done 50% of the work already, but I am can't move forward. ...
My boss asked me, a Polar researcher whose major is biology (surprise!), to do a coding work which I am NOT really good at, for our satelite data processing module. (I'm not even sure why he asked me to do this in the first place...sigh...corporate culture)
He said
his codes have methods but no ...
I have implemented a library which makes Java Swing programming easier. I am just posting the library. There is a program that uses this library to implement examples of many Swing components but I cannot include that program here because the total size will become more than the allowed limit of ...
Thank You in advance for spending your valuable time for me
So this is my brief intro, I am a teenager and I learnt coding myself through various platforms , the first language I learnt was Python. I have a intermediate knowledge regarding Python. So after a while I got a idea of creating a simpl...
This is in continuation of my previous post for code review of Java Swing Library: Java Swing Library
Since the limit on total number of characters is 65K, I split my program in two parts. The first was Java Swing Library and the second one is this one.
I have implemented a program that uses my J...
Background:
Hello, I'm a student (since 2 months) and I've created a small MVP of a weather application. So now I'm refactoring my code because it looks hideous and it is hard to work with.
The problem:
In the snippet I will provide you will see that I repeat code for a .map(), which I know is no...
When you run a Java Jar program then you don't get a console. But this program gives a solution of this problem.
This program implements a console which can be used to get user input / print output. You can include this program in your software to get a console when you run your software as a JAR...
I have this function where the entry is a string of size '5376000' chars containing hex values.
Len is given in bytes so 2688000.
Calculating the start and ending time of the operation it takes about 5 seconds which is a lot considering this function is called thousands times....
def ProcessFrame...
As already written in the title I want to count the numbers in a range in which the sum of the digits in odd places have the same parity of the ones in even places.
I made this code:
def findIntegers(x, y):
count = 0
for k in range(int(x)+1, int(y)+1):
odd_sum = 0
even_sum = 0
k =...
For a program I'm writing, it requires a lot of printing and receiving user input. I've found it cumbersome to keep specifying the type strings in printf, and having to write another printf before using scanf to receive input. I've decided to write two macros, print and input, that achieve exactl...
Modules for FPGAs for generating a pseudo-random bit sequence are presented. The first module generates a bit sequence. The third module speeds up the generation by transferring the bus to, for example, a multiplexer which is controlled by a faster device. Hence this bus is serialized into a bit ...
Here is my little program (it is supposed to check if a number is a perfect square), but it has an error somewhere, can someone help!
import math
a=0
def is_square(n):
a = math.sqrt(n)
if a % n = 0 :
return True
else:
return False
I want to simplify some code I have written but not sure how to go about doing it. When my workbook opens it checks the current date and compares it to dates I have on a sheet. If the current date is <= date on sheet it writes the date range to a cell. My issue is I have 13 If statements and woul...
Good day. I have to field DtLargeur and DtLongueur and what I want is to have (DtLargeur*DtLongueur)/144 to the field tbxQuantity. What is the right code . It's a custo in
Epicor.
private void BtCalcul_Click(object sender, System.EventArgs args)
{
SetValue TbxQuantity = ((DtLargeur*DtLong...
Is this the correct way to calculate leap years in a range of [y,x) ?
def bis(y1,y2):
mas = max(y1,y2)
mini = min(y1,y2)
k=0
for i in range(mini,mas):
if i % 4 == 0 and i % 100 != 0:
if i % 400 != 0:
k=k+1
return k
print(bis(1904...
I want to write a for loop that make six decks of cards into variables but I cannot figure out how to write the code to determine what number the card is on.
for i in range(1, 313):
for j in range(1, 53):
for k in range(1, 5):
if k == 1:
color = "clubs"
...