This question appears to be off-topic because it is a code review request. This might be better suited to the Code Review Stack Exchange site. Before posting there be sure to read their FAQ to ensure that your question meets their guidelines. — John Conde15 secs ago
The program is a little code about guns with user input. The program is a perfect representation of the beauty of functions.
import sys
import time
#determines reload time
def reloading(reload_time):
print('\nReloading', end='')
for dot in range(reload_time):
time.sleep(1)
...
I am new on code review stack exchange, I recently cloned a classical Spider Solitaire game from Microsoft Windows XP. I implemented almost all features of the game. Please tell me anything I can do in order to improve my coding style. Other suggestions are welcome. Thanks in advance.
I cannot
p...
stackblitz.com/edit/… - a small replica of mat select set value. If you have followed the same procedure and its not working there might be some other mistakes outside the syntax to set value for which a thorough code review must be done. — Atul Stha27 secs ago
How could I make my code follow the DRY principle?
I feel like they are better ways to do things in my code. So any feedback will help me!
js fiddle: https://jsfiddle.net/fr6ut238/
/*---------------------------
Variables
---------------------------*/
const $containerGrid =...
I am working PHP project on localhost using wamp, for debug process we using error_log() function, every time error_log() stored details of the error in wamp/logs, how can I view my error in the same project folder like wamp/www/goodgoal/.
eg: wamp/www/goodgoal/logs/error_log.log
Note : Pls...
@CaptainObvious @dfhwze Please don't edit titles by putting them in double-quotes. In general, any title on Code Review that is a question violates the How to Ask guidelines.
In any case, this particular question is off-topic.
I developed a function which checks if a array contains a value and returns it. I would like to know if there is already such a function which is more efficient or how I can make the function more efficient.
<?php
$params = "colorgroup-b;test;abc";
$paramsArr = explode(";", $params);
var_dump(a...
After watching this presentation, I decided that it would be a good project for me to undergo to practice my python skills. A summary of the presentation:
Jack Diederich, the presenter, talks about the overuse of classes in programming. A phrase he used a lot was "you shouldn't be writing a c...
This is a problem from Automate the Boring Stuff from "Pattern Matching with Regular Expression". I am a beginner in Python and the purpose of this program is to match urls which start with http:// or https://, with some urls having an optional www. after https://
How can this code be improved?
...
I made an WPF Application, called Palindrome Checker, it basically checks your input if the word/sentences a palindrome is.
Could you provide me myb better clean code if mine isn't that good ?
public class Check
{
/// <summary>
/// Method for checking if the word/text is a...
I have written a code that is live streaming a nature camera from my Raspberry Pi using a Pi Camera v2 to Facebook Live/YouTube.
I have ran into a couple of problems with the code that I can't solve and require some expert support.
This is the code:
raspivid -o - -t 0 -w 1440 -h 1080 -fps 3...
Stack Overflow is not the place to ask for code feedback. You could get that on the Code Review site, but asking for library recommendations is off-topic on both sides. Please see How to Ask — roganjosh27 secs ago
I am attempting to port a linear function that I designed in a spreadsheet into HTML and Javascript. It's based on linear least squares where I have to take a Matrix and multiply it by its transformation. At any rate. I am attempting to lay out a basic input system in Javascript/HTML where I can...
So currently I'm working on cleaning up a recently developed project and notice a lot of potentially un-needed code; whereas I create separate functions for very minimal stuff..
Here's an example of a module export I've done:
//MemCache
const Cache = require('memcached-promisify');
const cache ...
I became a moderator in the first election four years ago but it is now time to step down.
I came here to Code Review in November 2013, after browsing the site for a few days I posted my first comment, and later my first answer. I found chat and found the wonderful people Mathieu, Jamal, and Mal...
I became a moderator in the first election four years ago but it is now time to step down.
I came here to Code Review in November 2013, after browsing the site for a few days I posted my first comment, and later my first answer. I found chat and found the wonderful people Mathieu, Jamal, and Mal...
I practiced my java knowledge in the last couple of days. For that, i want to create a Rest API in a trimmed scale, because there a lot of aspects which must be considered in such an Api (Login, Sessionhandling ...). A lot of details aren't implemented, but the top priority was to understand the ...
Which approach is more convenient in an real life project? Can someone please enlighten me?
All of them give the same result. Classes are ES6.
2nd approach Constructor pattern combined with Revealing Module Pattern.
3rd is only a constructor pattern / function and the properties are used in an...
I tried to solve some Euler's problems, this is the solution I found for problem #3 with Python. The problem asks:
The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ?
Can you, please, suggests me improvements?
def get_largest_prime2...
I joined CR in May 2013, but only started living here in September of that year. I remember very well then, the site had been in beta for almost 1000 days, and I kept thinking that was a shame, CR was such an awesome twist of the Stack Exchange format, it had to "graduate".
Soon I met folks that...
@DerKommissar Depending on how much work those four mods put in. But the remaining mods will be discussing it with the community managers, then we'll see.
Yeah, I'm sure they'll get it figured out. I don't know what the distribution of mod-work was, really wish SE would share that with us (because it's extremely relevant for those running again).
I wrote some code to generate Latin hypercube samples for interpolation over high-dimensional parameter spaces. Latin hypercubes are essentially collections of points on a hypercube that are placed on a cubic/rectangular grid, which possess the property that no two points share any individual coo...
I saw someone mention facepalm here last week, this was my facepalm question. I know I didn't answer well because I just wanted someone to remove it. codereview.stackexchange.com/questions/223493/…
Here is the problem: some script is injecting some HTML5 elements (actually a button with the #thebutton ID) to the current DOM.
But this is a third party script and I have no control of when this will be injected to the page.
I need to click automatically on this button when the button is inje...
@dfhwze Applying your own close vote will put a question into the review queue. Also, downvoting below 0 will attract attention. No need to clutter the revision history of a question that should be closed anyway.
I'm new to C++ programming, and I'm building an Image Editor software like Lightroom/CameraRaw from scratch.
Apart from procedural code (actually seems that all the functions works correctly) my goal is to improve the Design of my classes.
For this I used OpenCV just for basics functions like ope...
Thanks a lot for your attention.
I came here with a problem and I reaaly have no ideas how to get it over.
The problem is that a consumer that populates its storage of items at a set interval has sometimes irrelevant items.
It's time to details.
I'm working on my first ever .NET application o...
@janos - it's mostly healthy. There are some "first world" problems - in broad strokes, everything is good, but when things are good, small issues appear larger.
I am not thrilled with the site growth (or lack of it), but it's healthy
I came in to this mod term expecting to be a more behind-the-scenes mod, and I have been. It's time to step front and center for a bit, though, and then step back when things settle down.
I decided to create implement Conways Game of Life for my first project using Rust. I also haven't had much code review ever, and have been looking for a good critique of my code so I can improve my skills. Here is the code:
extern crate glutin_window;
extern crate graphics;
extern crate piston;...
Heh ... mixed ;-) It's summer, the weather is fine, got a new hobby this summer, and I'm excited. Work is crazy busy, lots of responsibility though, but although stressful, it's all good.
I'm coordinating a team of a dozen folk around the world and "interfacing" with probably a dozen other teams to get stuff done. Lots of meetings, not enough actual coding.
Sounds familiar if I look at some senior coworkers
I'm also not getting that much coding done, but that might be because I'm mostly integrating components and maybe our tooling is just so efficient that you don't actually need to code a lot
I first created my function using an imperative approach. This is just how I naturally write code most of the time. I then tried to think about the problem using a "What I want to accomplish?" approach, rather than "What do I want it to do?" In the end I think I still ended up with an imperati...
I'm trying to solve this question:
Andryusha goes through a park each day. The squares and paths between them > look boring to Andryusha, so he decided to decorate them.
The park consists of n squares connected with (n - 1) bidirectional
paths in such a way that any square is reachable...
At least here in IBM we can set ourselves on a "technical path" instead of a "management path".... in reality, it means I'll never have direct reports, but I will lead projects.....
It may not be the right advice for everyone, but if you want a good job at IBM it probably makes sense to get in the door first at a not-so-good fit role.
i written a simple code to check your answer in 5 queens, i finished with horizontal positions but i have a problem in diagonal positions .
when the code is executed i observe in some cases a strange numbers that was supposed to be not displayed, this an example (the strange nubers is with yellow...
Yeah, I'd have to do the whole authorization thing. There's an easy way to do it, a 1800 number, to notify them of your intentions to be in US water, and then you have to report to a port-of-entry if you actually land.
It's not actually hard, just have to follow procedure.
That's awesome.... it's riught next to an African Safari Park... to be clear, though, I don't expect to get beyond Georgian bay for the first year at least.....
As many have done on this site, I decided to create a progress indicator using a modeless Userform. However, my goal was to make said progress indicator as generic/reusable as possible.
While doing some research, I stumbled upon @MathieuGuindon 's post titled The Reusable Progress Indicator. I q...
Are there any efficent way to solve this problem,
for example using bitwise operator?
public static boolean isPal(long num)
{
String numStr = Long.toString(num);
String rNumStr = "";
boolean result = false;
for (int i = numStr.length() - 1; i >= 0 ; --i...
I set out to create an example or proof of concept of an idea I had and would be interested in receiving constructive feedback on my idea. I needed a Java factory pattern that allowed the end-user of the application to extend it (think add-ons, plug-ins, user contributed content, etc.). So I crea...
How would I go about shortening this code?
I'm sure there's a smarter way to write the code.
It's working fine, it's just ugly.
It is a way to scrape the number of items on an e-commerce site.
import requests
from bs4 import BeautifulSoup
import re
url1 = "https://us.pandora.net/en/charms/?sz=30
This post is an update of the one from here. I've updated the code and a couple pieces of the post itself.
I've been writing some functions used to find paths between two types of triangles - alphas and betas. Alphas are triangles that have been in a zone we consider important, have an "interest...
I just asked a different Code Review request, which included my e-commerce scraper. This time my question is regarding the second part of my scraping objective: Getting all the items on sale from each category. This is what I ended up with. I tried putting it into a loop, without any luck.
I ho...
I have started the Hackerrank interview preparation kit. The first problem I have solved with Swift is as follows:
Emma is playing a new mobile game that starts with consecutively numbered clouds. Some of the clouds are thunderheads and others are cumulus. She can jump on any cumulus cloud ha...