Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [beginner]

Add this tag to your question to indicate that you are new to the language of your code. This will often be taken into consideration by reviewers when assessing your code.

3
votes
1answer
7 views

Forcing the user to choose from a set of options (in Python)

First Code Review request =) I wrote this after making several projects that required a user to pick an option. I wanted to have a set way of forcing that choice in all of my projects. The module also ...
1
vote
0answers
17 views

Codewars: N smallest elements in original order

I am consistently timing out on the mentioned kata: Task You will be given an array of random integers and a number n. You have to extract n smallest integers out of it preserving the original ...
3
votes
1answer
26 views

Bash script to backup a LAMP server

I wrote a bash script for backing up my LAMP server. To be honest that's my first experience in bash so I want to ask you for help in its improvement. ...
3
votes
1answer
28 views

Noughts and Crosses Version 2

Made the game much more user-friendly than previous version - has an example grid to demonstrate input, Xs and Os are now used. Game can now detect draw. Changed the algorithm to detect winner, it'...
8
votes
3answers
537 views

XML node removal method with 5 arguments

I read somewhere that you should try to have as few method arguments as possible to make code easier to read, understand and use. I agree with this to a point but I'm not sure how I can make the ...
1
vote
1answer
29 views

Noughts and Crosses

My first program using C. I would appreciate pointers on how to improve the code. I exit just before turns reach 9 and the grid is filled because it causes all sorts of bugs. The computer is random. <...
1
vote
1answer
23 views

CSS and React.js for a basic navigation drawer

I am trying to optimize my navigation drawer code. I have tried and followed the BEM naming convention for my CSS although I would like it reviewed with respect to the best practices being followed. ...
2
votes
1answer
44 views

Fast Factorisation (Python Implementation)

An algorithm for finding prime factors of a number given a list of all primes up to the square root of the number. It's worst case time complexity is \$O(n^{1/2})\$, the best case would be \$O(\log(n))...
0
votes
1answer
50 views

Fast Prime Sieve (Python Implementation)

A modified version of the prime sieve. I actually doubt it could be implemented any faster, but I might be wrong: ...
3
votes
1answer
41 views

Passing a callback to a component in Vue.js

I'm currently trying to teach myself Vue.js and I've just created my first small project: a simple todo list. While writing the component I discovered that you can't access methods from the parent ...
1
vote
0answers
41 views

Simple Mastermind in c++

i created this console application ( it's actually a Mastermind) and i would like to know what can i improve as a beginner. Thanks ! ...
5
votes
3answers
91 views

Student grade calculator using classes/ structs in C++

I am trying to teach myself C++ and using Problem Solving in C++ by Walter Savitch. This is a program project from the book that I used to practice using classes/ structs and would like some feedback, ...
5
votes
3answers
73 views

K&R C book, Exercise 1-21: Replace tabs with spaces

I'm new to C, just started reading K&R C book, and am working through exercises. This is my solution to 1-21, and as far as I tested it works. Anything that I'm doing wrong, or that it's not ...
2
votes
2answers
51 views

Chained Sort Python Implementation

So I've run into a few occasions where I'd want to sort a list according to a criteria, then for all loosely sorted sublists (a sequence of equal elements), I'd want to sort those sublists according ...
5
votes
2answers
408 views

Python update SQLite DB Values

At the moment I try to get used to SQLite and Python. I started with insert, select and so on. But now i want to get a bit further. Now I have a DB with 200 rows for testing and in want to update two ...
5
votes
3answers
86 views

Most basic fantasy combat simulator

I was wondering if anyone had anything to recommend for how to clean up the code I made below. Essentially I am asking if my code is messy or not and if there are any recommendations for my ...
3
votes
0answers
28 views

Generic router in Rust

I am trying to make a router in Rust using Rocket.rs. I'd like to devise a way to use a default router for my more simple db tables that don't require different logic, to prevent rewriting the same ...
-4
votes
0answers
18 views

java variable not expected result [closed]

my code is based on a form in a servlet, issue is with java the bmr is not returning the appropriate answer ...
4
votes
1answer
108 views

Quiz program that asks 10 questions, repeats incorrectly answered ones a second time, gives results at end

I'm currently attending ERAU (online), and in my Computing for Engineers class we are learning C#. An ongoing project throughout the class is to build a "quiz" program that asks 10 questions, in order,...
0
votes
0answers
52 views

Aggregate sensor readings from multiple sources

I've developed a toy example to investigate how async works in C#. Though I've learned a lot this week, I'm still unsure of the finer details, as this is my first C#...
6
votes
1answer
85 views

First OOP in Python 3: Pygame Pong

I have been studying Python for a few months and just recently decided to stop avoiding OOP and reworked a Pong game to a more object oriented style. Please tell me how I should improve my code. Some ...
8
votes
4answers
1k views

Counting lowercase and uppercase letters in a string in Python

I am writing a program to count the number of uppercase and lowercase letters in a string. I came up with something that works, but as I am still a beginner I have a feeling writing the code this way ...
2
votes
2answers
58 views

JavaScript flood fill

I tried to implement a very simple color flood fill to experiment a bit with Javascript. All comments about the code are welcome but I am especially interested in performance as it seems to be a bit ...
1
vote
1answer
96 views

Customer segmentation using RFM analysis [on hold]

Currently, my code works perfectly well but i would like to make it cleaner for other users by removing the duplicate and similar lines of code into functions or for loops. Because I am still new ...
0
votes
2answers
61 views

Select nth smallest distinct integer from inputs

Kata in question Given a list of integers, return the nth smallest integer in the list. Only distinct elements should be considered when calculating the answer. n will always be positive (n > 0) ...
5
votes
2answers
71 views

Simple front end TODO list

I have implemented a very basic TODO List with no database or backend support. Though I have coded in C++ and Python before, this is my first HTML and JavaScript code. Please review the code and let ...
3
votes
1answer
79 views

Circuit builder that calculates resistance/current/voltage

I am somewhat new to programming. I've written a program that takes user input accepting voltages and resistors, and calculating total resistance/current/voltage in the circuit. I am looking for ways ...
7
votes
3answers
674 views

C++ arithmetic on two numbers [closed]

I need someone with experience to judge my first project to let me know what I have to work on. I recently started learning C++ using resources like Solo Learn and Bucky's tutorials on YouTube hoping ...
0
votes
0answers
29 views

Tic Tac Toe game in Python 3.X using tkinter GUI version 2

I am completely new to programming and to python and as my first self-learning project I am creating a simple Tic-Tac-Toe game. I have already posted a version of my code here on stack: Tic Tac Toe ...
0
votes
0answers
48 views

Python Program Generating N-Gram Language Model

I am pretty new to python, and I am writing this program to randomly generate sentences based on the n-gram language. It takes me very long to run this with the large input file I have, so it is very ...
3
votes
0answers
48 views

Download a Git repo without .git folder

Coming from Python, JavaScript and PHP, I'd like to learn to write Ruby in the way it's "supposed to". Well-written Python code is called "Pythonic", so I'd like to know how idiomatic my Ruby code is. ...
3
votes
0answers
35 views

Download and analyze PDFs of Congressional records

This is built with Python 2.7.15. The goal of this script is to count the number of words spoken by each Senator on the floor of Congress between given dates. It pulls from the Congressional Record, ...
2
votes
1answer
41 views

Sharing data with another thread using lock_guard

I wrote a updater_thread() and a reader_thread(), and used lock_guard to protect a global ...
1
vote
3answers
64 views

Password generator class and CLI

I made a password generator class in C++. I am not as familiar with C++ as I am with C, so I am looking for ways to move to a C++ mindset. I am also trying to use embedded practices like avoiding ...
2
votes
3answers
61 views

Free time calculator

I started learning Python 2 about a week ago, using Codecademy and Stack Overflow answers to help me learn. I wrote a code to calculate the user's free time based on user sleep and work time. It also ...
5
votes
1answer
95 views

Find the longest common sequence of two strings in Rust

I've attempted to solve a small coding challenge I found online as a nice way to begin learning Rust. The largest challenge I feel going in with Rust is how working with strings is so fundamentally ...
5
votes
1answer
135 views

Unit-testable C# FizzBuzz

To support a demonstration I'm going to be doing, I need a short C# program that can be unit tested. I decided to make a FizzBuzz split into a few methods: ...
2
votes
2answers
74 views

Number of anagrams in an array of words (Codewars)

Codewars Kata in Question. An anagram is a word, a phrase, or a sentence formed from another by rearranging its letters. An example of this is "angel", which is an anagram of "glean". ...
2
votes
1answer
90 views

Offering coffee

I'm new to programming and even more new to C++. Anyway, I started to watch and read some tutorials and resources I found on the web. I created this program to offer the user a coffee, expecting an ...
3
votes
1answer
44 views

Reading releases details from github and writing to google sheet file

I am a beginner Python developer and I wrote a python script which reads releases data from Github for a specific release of a repository and write those release details to a specific file in google ...
2
votes
1answer
118 views

Implementation of login and registration functions in servlet filter

I'm a newbie in servlet API. I have a test task to create a very simple web app with one home page and an authorization form. The requirement is to use filter somewhere in my app. Given that it's a ...
1
vote
1answer
40 views

Transforming a dict of lists into a list of dicts

I would like to transform a dict of one format into a dict of another format. The raw_input dict will have the shape: ...
3
votes
4answers
635 views

Testing a Collatz Conjecture Conjecture (Python)

I had an intuition that the maximal trajectory lengths for collatz conjecture numbers would be produced by numbers of the form (2**n)-1 so I wrote a program to test ...
2
votes
1answer
31 views

Text interface for employee management in Rust

I'm in the process of reading The Rust Programming Language, and decided to do the 3rd task at the end of the 8th chapter. The description is as follows: Using a hash map and vectors, create a text ...
4
votes
2answers
79 views

Shopping List program made in Python 3

This is a shopping list program made in Python 3 and it will send the list by email. I am not very experienced but I consider this program as a starting point to what I will do next. ...
19
votes
3answers
2k views

Snake++ game (in C++ with SDL)

Yes, It's called Snake++. I build it to learn C++. What features and techniques can be improved? I used SDL for some basic rendering, but my concern is more about ...
4
votes
2answers
101 views

Guess-the-number game by a Python beginner

For some background I'm pretty much a beginner and attempting to learn Python currently. So I decided after a few days of lessons I'd look for some beginner projects to test my knowledge. A website ...
2
votes
3answers
81 views

VBA code slowing workbook

I have a spreadsheet with five sheets all of which run the same VBA code; everything was good when it was on just the one sheet, but now it's running on all five sheets Excel is extremely slow to load ...
1
vote
1answer
54 views

Developer Assignment - Family Tree

I have an alternative solution for family tree that have been posted some time ago and please forgive the similarity of the task but when i tried to post alternative solution in someone else's post ...
3
votes
1answer
69 views

Plots of prior and posterior distributions for a model

I have an exercise that ask to plot the prior and posterior distribution in the Poisson-Gamma model. I did it (I think it's correct) inspired in the answer of this question https://stats.stackexchange....