package bmi;
import java. util. Scanner;
public class BMI {
private String name;
private int age;
private double weight;
private double height;
public static final double kilograms_per_pound = 0.45359237;
public static final double meters_per_inch = 0.0254;
public BMI(String name, in...
Inspired by this question on Puzzling.StackExchange, I've decided to write a small python script that determines if a word is a BFF Word. Below are the parameters, solved by Puzzling user Stiv, also discussed in the program module docstring:
If you remove two letters, you are left with an ana...
I am making a video game in my coding class. its nothing glamours but its a fun scp foundation based game (I DO NOT INTEND TO PUBLISH IT) the end of the game is a random.randit scenario, however it keeps looping back to the start. also i do not know how to make the PLAY AGAIN feature appear after...
Assignment for C++ intro class, I understand the programing concepts completely but I am struggling with the actual code creation part,
the task is create a menu, apparently that's a popular assignment for new programmers, I got the first part but got confused when trying to figure out the next...
https://leetcode.com/problems/divide-array-in-sets-of-k-consecutive-numbers/
Given an array of integers nums and a positive integer k, find whether
it's possible to divide this array into sets of k consecutive numbers
Return True if its possible otherwise return False.
Example 1:
Input:...
Why did I make this? I'm building an interactive data structure visualization, and when certain errors are thrown from certain parts of the code, they are displayed on screen for the user. I have not included that displaying logic.
The if checks seem somewhat smelly to me, but they might be simp...
I am new to Python and I have my code below that after the user enters a number; they should return the value of the number but in text form. However, the numbers after first, second, and third, they output as 5th, 6th, 7th, etc., up to 12th. I cannot understand how to make the output show the wo...
Imagine I have 10 person in my contact list and I have given all the details of those person in JAVA. But all the details are based on individual person's first name. If I type the first name of person A, then I will get all the details of person A. Then when I press enter, the program should ask...
I am a beginner and trying to send data from AWS DynamoDB to Azure Queues. Note that this code will be invoked 10,000 and alot more. Can you guys review it once.
using System;
using System.IO;
using System.Text;
using Newtonsoft.Json;
using Amazon.Lambda.Core;
using Amazon.Lambda.DynamoDBEvent...
getPixelColor in C++ on Linux
For a long period of time I worked on this code, mostly trying to understand it, which I still fail. That is the main reason for needed review. Second reason is simply that I would like to optimize it in any way you can find. If possible from your side, could you ...
> I am asking this question as a result of my recent interactions with the moderators of the Medical Science Stack Exchange site, one of whom invited me to ask SE corporate to force them to make changes to their site's policies.
The 'invitation':
@nick012000 LOL, okay, we're done here. You go ahead and get SE corporate to change things. — Carey Gregory ♦55 mins ago
I made this simple program that can solve every set of linear equations in two variables.
You just need to enter two linear equations of the form ax+by=c (without any unnecessary spaces) where 'a' is a positive integer (i.e. x should not have a negative coefficient) and b and c are just integers...
This is the first time that I have tried programming in such a general way using c++. I have tackled this pattern before in other languages such as golang, but this is my first attempt with cpp.
Subscriber template
// class template for a subscriber that wishes to be informed of the
// occurren...
This is a program that can decrypt the codes that have been encrypted using the algorithm that my previously posed encryption program follows, you just need to enter the encrypted text from that propgram.
I got a lot of suggestions from people on the encryption post, I have tried to make this pr...
I am new to machine learning, and i discovered some days ago the isolation forest algorithm, which would help me deal with my outliers. Unfortunatly, i haven't been able to quite get how the algorithm needs to be setup and processed.
I have a dataframe with 4 columns, each representing a measur...
I often see very long code lines like this:
<input type="email" name="email" autocomplete="email" id="email_address" value="<?= $block->escapeHtmlAttr($block->getFormData()->getEmail()) ?>" title="<?= $block->escapeHtmlAttr(__('Email')) ?>" class="input-text" data-mage-init='{"mage/trim-input":{...
given are two arrays with different amount of rows but same amount of columns
arr1
array([[36, 16, 32],
[36, 7, 24],
[84, 2, 45],
[98, 7, 56]])
arr2
array([[36, 16, 32],
[36, 7, 24],
[49, 16, 18],
[56, 13, 12],
[12, 56, 98]])
In the end ...
This is code for finding if inequality abc < 2( area of triangle)
where a,b,c are the sides of any triangle.
The given below code is working with the intended result but is taking a lot of time for processing(when max tries is increased).Is there a way to improve the below without reduce max_t...
FWIW, you can link to any post by getting the link https://chat.stackexchange.com/transcript/message/53916102#53916102 and then taking that duplicated number and starting a message with :53916102.
@ankii IDK, I've got most of my stuff public for free TravisCI, only have a couple of private ones
If this is a Code Review question and you need to wait a little while to post another question there, why not wait that time and then post it there? — halfer36 secs ago
The data use data in a file called test.txt, which is available at https://drive.google.com/file/d/1g0ffvH5oP5C4Cp6ciEp_L1Rst6WeTuYG/view?usp=sharing. There are some odd formatting things about it which I cannot replicate by putting on this website, hence I'm hosting it on my Google Drive. It is ...
Please don't roll your own password hashes. You really should use PHP's built-in functions to handle password security. Make sure you don't escape passwords or use any other cleansing mechanism on them before hashing. Doing so changes the password and causes unnecessary additional coding. — Jay Blanchard41 secs ago
I have the following code. Everything seems to be working as it should, but when I multiply a 3x3 matrix and a 3x1 matrix, it outputs a 3x3 matrix instead of a 3x1 matrix. The first column is the result I am actually after. What is going wrong?
import math
import numpy as np
import matplotlib.py...
If the code you have works, and you'd like a review of all aspects of the code, and your question meets their criteria, you may be able to ask this question on Code Review. — Heretic Monkey16 secs ago
Are you using a web server? It sounds like You really shouldn't use your own salts on password hashes and you really should use PHP's built-in functions to handle password security. Make sure you don't escape passwords or use any other cleansing mechanism on them before hashing. Doing so changes the password and causes unnecessary additional coding. — Jay Blanchard26 secs ago
I am creating a small program to parse the contents of Excel files. There are two types of Excel files, containing the same data, but with different templates.
It is possible to tell them apart with 100% certainty by checking the contents of a specific cell, which I call the fingerprint.
In o...
I've built out a section on a page that contains multiple instances (why I'm using querySelectorAll()) of this Request Brochure form. They are using Campaign Monitor so much of the form code has been removed for this post.
Operation
On click of the 'Request Brochure' button preventDefault is a...
I'm working full-time already for over three years now and finished university like half a year before that, and spent five years on my Bachelor's in total
This question might be a better fit for codereview.stackexchange.com. Stackoverflow is a QA site for specific coding questions and answers, so I'm not sure you'll get what you're looking for here. — Tim Lewis21 secs ago
My Laravel project starts to grow up and I'm starting to dealing with fat Controllers and Models. Probably I'm for away from the SOLID principles path and my code is not DRY.
I decided to refactor my layers logic to follow more SOLID and try to be more DRY. After some research over the internet ...
I have a RadioStation class, and a view controller in which I create a FM and AM station from this class.
I have a simple UI, with labels for name, frequency and band and then corresponding labels to display these values. I have two buttons, one for FM and one for AM, so that when you press FM y...
I mean this could be StackOverflow question but I think it fits more the CodeReview Page. Regardless please specify your question a bit more by e.g. adding your written code. — Cedced_Bro35 secs ago
I have a RadioStation class, and a view controller where I create an FM and AM station based on this class.
I created both of these station objects in the same init method. Was this the best way to do this? Or should I have created two separate init methods, one for each new object?
RadioStati...
I've decided to implement a simple case of the Observer pattern. I've gone about this considering you can only register 1 single observer in the Observable, instead of allowing multiple ones.
I would really like feedback about what'd be the proper way to return the listener in the run method wh...
I am dealing with a large amount of XML files which I obtained from here https://clinicaltrials.gov/ct2/resources/download#DownloadAllData. The download yields around 300.000 XML files of similar structure which I eventually want to load into a single dataframe / csv. The code gives the result th...
So I wrote this a while ago and yesterday I was going through it and trying to remember every line of code and how it works.
Well, the program simulates a online bank account as well as an ATM. You register your account, you are able to withdraw, deposit, and transfer money. There is a limit to t...
If the code works and is complete, it should really be on Code Review instead of here. This site is primarily for fixing broken code. — Carcigenicate38 secs ago
I just started programming a week ago. Online tutorials aren't my thing, so I decided to just start projects and learn what I need for the project. My first project is a guess the number game. The user is asked to guess a number between 0 and 20. If the user's guess is too high, he/she will be to...
I am trying to migrate from request to axios, since request has been deprecated.
Suppose that the url 'https://www.example.com' receives a post request with formdata that contains login information, and also suppose that I need to maintain the current session across multiple requests(for that I n...
I have an application developed in ASP.NET Core C#, where according to a configuration it must replace certain urls of a text when an http request is made and the text must be returned as soon as possible in response, the text can change on each request.
At this moment the code I have is workin...
I'm creating a small crud using PDO, but I had a little doubt about the vulnerability if it has any problem that could prevent it or something, because the intention is to use to delete either 1 line or several lines from the database. data, I am studying more deeply about PHP coding, if you can ...
Its been a while since I have written PHP or HTML for a project, so I could use some thoughts on improving the code below. I wrote all of this going off of old knowledge, so I imagine its really sloppy and can be written a lot cleaner. All of the code below works and if you need to see any of t...