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.
6,736
questions
3
votes
1answer
224 views
Implementation of Scytale cipher (encryption and decryption)
This is web exercise 3.1.41. from the book Computer Science An Interdisciplinary Approach by Sedgewick & Wayne:
The scytale cipher is one of the first cryptographic devices used for
military ...
3
votes
2answers
179 views
Contact form with spam-prevention - follow-up
Background
The basics of this project are already covered here.
I received the suggestions to:
not create the exercise with JavaScript.
use pictures instead of plaintext.
I tried to implement the ...
4
votes
1answer
65 views
Implementation of glass filter for images
This is exercise 3.1.39. from the book Computer Science An Interdisciplinary Approach by Sedgewick & Wayne:
Write a program that takes the name of an image file as a command-line
argument and ...
10
votes
5answers
3k views
Print a word, one character per line, backwards
I have a problem that I solved in 2 different ways and I would like to know which one is better, cleaner and easier to read.
Problem:
Write a while loop that starts at the last character in the
string ...
4
votes
2answers
138 views
Calculating the Shannon entropy of a string (e.g. E. coli genome)
This is exercise 3.1.34. from the book Computer Science An Interdisciplinary Approach by Sedgewick & Wayne:
The Shannon entropy measures the information content of an input
string and plays a ...
6
votes
0answers
50 views
Xero API Client in Django
I'm not actually that new to writing Python. But I've no formal training and have only learnt to build applications to solve problems for my job out of necessity. Starting to bring my existing skills ...
9
votes
2answers
1k views
Implementation of Kamasutra cipher
This is exercise 3.1.31. from the book Computer Science An Interdisciplinary Approach by Sedgewick & Wayne:
Write a filter KamasutraCipher that takes two strings as command-line
argument (the key ...
6
votes
4answers
554 views
Turning a grayscale image into a histogram of the intensity of the pixels of that image
This is exercise 3.1.4. from the book Computer Science An Interdisciplinary Approach by Sedgewick & Wayne:
Write a program that takes the name of a grayscale image file as a command-line argument ...
3
votes
1answer
178 views
Memory/Time usage on substring search code
I have implemented a substring search, which works as expected and provides the right output. On some edge cases tho, I get either Memory or Time limit exceeded because:
the string length is too big
...
3
votes
1answer
87 views
Display user detail utility
I currently have a utility that will display details about a list of specified users. In its current state I don't use any functions, which I've noticed make it a little more repetitive than I would ...
7
votes
3answers
479 views
Beginner's Number Guessing Game
I've started learning to program, and as the first program I wrote on my own I wanted to come up with a number guessing game - the below is what I got.
I'm mainly looking for a review of my ...
6
votes
1answer
146 views
Simulation of Conway's Game of Life with periodic boundary conditions
This is exercise 2.4.20. from the book Computer Science An Interdisciplinary Approach by Sedgewick & Wayne:
Implement a class that simulates Conway’s Game of Life.
One thing to note: I did not ...
6
votes
2answers
816 views
GUI to load/save player information in database
I've started programming using Python two months ago. My only prior programming experience was VBA. I'm completely self taught. I wrote the code below for a project I'm creating as a way to learn the ...
2
votes
2answers
133 views
Write a recursive function that takes a positive integer n and plots an N-by-N Hadamard pattern where N = 2^n
This is web exercise 2.3.20. from the book Computer Science An Interdisciplinary Approach by Sedgewick & Wayne:
Write a recursive program that takes a command-line argument n and
plots an N-by-N ...
3
votes
1answer
103 views
Contact form with spam-prevention
Idea
After a handfull of small javascript-projects, I also wanted to work a bit with php now. I decided to create a simple contact-form. Of course, I wanted it to be as spam-save as possible, so I ...
3
votes
0answers
53 views
Reorder the Columns in a CSV File in Descending Order
I wrote a script to reorder the columns in a CSV file in descending order and then write to another CSV file. My script needs to be able to handle several tens of millions of records, and I would like ...
1
vote
2answers
96 views
Ruby Hangman Game
I'm still new to coding and self-taught. If anyone could take a look at my code for my Ruby Hangman game and give any tips or advice whatsoever, it would be greatly appreciated. I'm trying to improve!
...
3
votes
1answer
271 views
Automate the Boring Stuff – Chess Dictionary Validator – Optimal Solution
Brief introduction: so the point of the question is that the author doesn't really talk about good or bad code quality and I really wanted some feedback to have a grasp of how the code for others to ...
4
votes
1answer
97 views
Printing Gray code through modifying Samuel Beckett's stage instructions
This is exercise 2.3.24. from the book Computer Science An Interdisciplinary Approach by Sedgewick & Wayne:
Modify Beckett to print the Gray code.
Beckett refers to the following program within ...
1
vote
1answer
86 views
Simple Python Login
i have made simple python login nothing impressive but i have the feeling that i could have done it differently.
I saw some people saying that i should use text files but i tried and i didn't quite ...
2
votes
1answer
58 views
Android text to speech app
Since I am trying to learn many programming languages, I created this simple Android app. What it does basically is taking a sentence phrase from an EditText ...
1
vote
0answers
46 views
LeetCode 146: LRU Cache (Go)
Posting my code for LeetCode's LRU Cache, if you'd like to review, please do so, thank you for your time!
Problem
Design and implement a data structure for Least Recently Used (LRU) cache. It should ...
7
votes
1answer
81 views
Improving a Medicare Beneficiary Identifier (MBI) generator
I am new to coding and looking for a few pointers on how I can improve my first project.
At work, I often need to create Medicare Beneficiary Identifiers (MBI) when creating test patients with ...
0
votes
0answers
23 views
Discord bot file requirement and object instantiation d20pfsrd follow-up
I have written a series of parsers for a discord bot that each reside in classes in their own files. Each parser class has 3 functions, 2 of them are for generating the response to the discord message ...
10
votes
2answers
2k views
Programmatically close optical drive tray
I really liked the close tray program that CD-ROM drivers programs used to include in MS-DOS days.
Since I live in a place where even getting an internship is impossible, I've decided to learn by ...
3
votes
0answers
95 views
Poker Game: Building a console menu
I'm working on a menu for my poker game console app. I've conceptualized the menu(s) as a class with menu items that have their own position. I would like to get pointers on how I could improve on ...
8
votes
1answer
99 views
My first game - Arkanoid
I'm new to java and I have just finished my very first game - Arkanoid. I would appreciate, if anyone could look at this and tell me some advice and tips how can I optimize my code. Thank you. :)
I ...
1
vote
0answers
26 views
Oauth2 Connector Frappe Framework
My first attempt at writing a Python application to solve a real problem is a one way connector between ERPNext and MYOB AccountRight.
This is the module I have written to connect to the API and get ...
5
votes
3answers
684 views
Finding even or odd numbers
I'm looking for critiques to see what I could have done better or different ways I could approach writing a script for finding even or odd numbers. I am new to programming with JavaScript, and ...
9
votes
2answers
1k views
C Implementation of atof
I'm a beginner at C.
I'm currently implementing atof to build a raytracer, however I'm still learning how to efficiently write programs.
Assignement
Instructions
The program takes a scene description ...
2
votes
1answer
28 views
Update UNIX-like system user profile picture with its GitHub account's one
Seeking to learning and have fun, I wrote out this script (what I expected to be) self explanatory and would appreciate some comments on that.
I published it as a gist and tried to do my best on what ...
3
votes
1answer
85 views
LeetCode 310: Minimum Height Trees
Posting my code for a LeetCode problem, if you'd like to review, please do so. Thank you for your time!
Problem
For an undirected graph with tree characteristics, we can choose any node as the root. ...
3
votes
2answers
92 views
Reverse the words, move the vowels and downcase everything
I'm brand new to Ruby.
The function takes in a string of any number of words, and reverses the order of the words. Also, for each word, it takes the vowels and moves it to the end of the word. It also ...
2
votes
2answers
82 views
Ruby Mastermind game project with AI
I'm self-learning and pretty new to coding and created a Mastermind game in Ruby.
Any general feedback or advice whatsoever would be greatly appreciated.
The game is completely functional right now, ...
2
votes
1answer
137 views
Pong and Breakout games
So I have made 2 games without any internet when on vacation. I have used turtle because I did not install pygame. I was wondering how I could improve my games. Here is the code:
Pong:
...
2
votes
1answer
99 views
Python Blackjack
A simple terminal blackjack game written in Python.
Follows basic blackjack rules: Blackjack pays 3 to 1, Hit, Stick, Double Down and Splits
Dealer hits until 17
Keeps track of some data
Wrote it for ...
8
votes
5answers
3k views
Largest odd number
Ask user to input 10 integers and then print the largest odd number that was entered. If no odd number was entered, print a message to that effect.
I've been trying to solve this problem with python ...
2
votes
0answers
51 views
Structuring Service and DAO Layers in Go
I am having a bit of difficulty in designing my Go code.
I'll try to demonstrate things with a very simple example of adding a new user to the database.
My Handler is only doing one thing: Calling a ...
2
votes
0answers
117 views
Python code for UNO Game
It's my first time here, so please accept my apologies in advance if something is wrong with my approach to asking.
I've been learning Python for a couple of months and I decided to have a go at a ...
3
votes
2answers
93 views
Binary to Decimal conversion program
I am a beginner in Python and I have written a program to convert binary numbers to decimal. It works, but are there any ways to improve the code and make it better?
...
8
votes
4answers
308 views
Coin Flip Streaks - correct streak condition
This is a practice task from Automate the Boring Stuff with Python. I imagine many others have asked for their version of the solution to be checked, so I apologise beforehand for boring you yet ...
8
votes
4answers
361 views
Calculate sum of multiple series within array
The exercise is as follows:
Player A will write list \$ a \$ consisting of \$ n \$ numbers. Player B will take a look at the paper. After that the A player will ask player B \$q\$ questions. Each ...
6
votes
2answers
84 views
My first C# project - Simple bird of prey identification console app. Does it need refactoring or complete rewriting?
this was my first thing i made on my own without any help. im sure theres a lot of improvement that could be made, i dont feel too confident about this. how can i make it shorter and more efficient? ...
4
votes
1answer
73 views
Python program for healthy schedule
Please review my program and give some tips . I am a beginner. IT is for those people who sit on computer all day and get unhealthy . This will remind them to do eye exercise , physical exercise and ...
1
vote
1answer
71 views
LeetCode 1206: Design Skiplist
I'm posting my code for a LeetCode problem. If you'd like to review, please do so. Thank you for your time!
Problem
Design a Skiplist without using any built-in libraries.
A Skiplist is a data ...
7
votes
2answers
167 views
Dijkstra's implementation in rust
I would like to get any feedback about my implementation of Dijkstra algorithm in Rust following this youtube video.
Please be aware that this my first code in Rust as well as my first Dijkstra ...
6
votes
1answer
59 views
Buffered and unbuffered cat(1) implementation
I reimplemented cat(1) for fun. I followed the Open Group Base Specifications (Issue 7, 2018 edition), not the GNU variant and its command line arguments.
Buffered ...
5
votes
3answers
1k views
User guesses the number generated by computer
This is my code, which chooses a random number from 0 to 10 for the user to guess.
...
4
votes
2answers
414 views
Simple console calculator in python
I am new to python, I made a calculator but I need to make it calculating unlimited numbers and to shorten the code more, how can I improve it?
Any help is appreciated.
...
4
votes
2answers
80 views
Tips on my LIFO java code
I've been trying to learn java recently and I finally finish my first code. Any suggestions on where I can improve? Also, is it possible to send an argument to a class using something like an init ...