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

learn more… | top users | synonyms

1
vote
1answer
42 views

Generating tables of numbers in PHP

I have this code and this works fine but I think it's too lengthy. I want to know if there can be a less lengthy code. I've heard from people that lengthy code is often not considered good. ...
5
votes
5answers
619 views

Menu to save and load football team information

I am a newb, and whilst I'm sure my formatting can be improved, I really want to know, how I can re-use my code for this simple program. The objective is simple, football game with a menu, that allows ...
10
votes
3answers
74 views

Producing and comparing maximum sub array sum algorithms

This is an exercise in implementing the maximum sub-array sum problem. It asks for several solutions of complexity: \$O(n)\$ \$O(n \log n)\$ \$O(n^2)\$ \$O(n^3)\$ For an additional challenge I ...
2
votes
2answers
20 views

SQLite DB Check and Update Script

My script looks for handshake files in an input folder to determine whether certain processes have completed. If it finds them, it will update the database with the current time stamp. Things I am ...
-3
votes
0answers
16 views

Pong Code Java Applet [on hold]

I wrote a very simple pong applet game. Right now, the ball basically is just bouncing off the sides, but I want the platform to move by using keylisetner, but it ...
2
votes
1answer
32 views

PHP class to represent types of refrigerants

I'm relatively experienced with Java and C++ so picking up PHP wasn't too difficult. I wanted to get some feedback on my first PHP class. There's nothing extremely complicated as of now, but its nice ...
2
votes
3answers
36 views

Fairly Simple Hangman in Python

This is my take on a simple hangman game, which is played from command prompt. ...
5
votes
3answers
53 views

Python OOP shopping cart

I am a new Pythoner, and don't have good knowledge of OOP. I completed the following task, but I feel the code is not good. I welcome recommendations to improve the code. You need to create the ...
5
votes
2answers
46 views

Process text file of fulltext articles from news publications

I'm relatively new to programming and have started writing some code for work. This script is something I wrote that I'd like to have someone comment on. Am I doing anything silly, stupid or totally ...
6
votes
3answers
128 views

Revealing store sales based on time

I am delving into trying to write some JavaScript code. I understand the basics, (the very basics...) enough that I have been able to write the following and it works. However, my knowledge doesn't ...
4
votes
2answers
81 views

Finding all legal bishop moves

I am trying to create a two player Chess game. To do this I want to generate a list of legal moves. I am having trouble with the brevity of the code to generate the moves for the rooks and bishops. ...
5
votes
5answers
648 views

Car Savings Calculator

I've created a second 'calculator-like' program, this time using the JOptionPane rather than typing in the console. At the moment the code looks to have a lot of repetition so I'm looking to simplify ...
7
votes
3answers
328 views

Simple implementation of a generic stack

I'm fairly new to C++ programming. To help I've been writing my own data structures for practice. I'd liked this to be judged as if it was written by a professional, and receive honest feedback. I ...
6
votes
2answers
593 views

Decorator for cars

Is this a good use of the decorator pattern? If not, why not? Is this a good idea to use for example when we have objects communicating with MVC through PHP or via ASP? To send data through the model ...
1
vote
2answers
49 views

Project Euler #12 in Racket

Problem here. It's not exactly the brute force approach but I'm not using any sort of pre-calculated primes table, and I'm definitely not using the coprimality trick shown in the PE pdf. I'm finding ...
3
votes
2answers
192 views

“Guess number” game in Python

What could I improve on this code? ...
2
votes
1answer
63 views

Precision sum of doubles

Summing doubles can cause a loss of precision. Summing integers, however, doesn't. (Assuming no overflow.) Here's a high precision sum function I wrote: ...
5
votes
1answer
69 views

Palindrome using stack

I recently started learning Java, algorithms, and data structures. I am trying to check if a string is palindrome. I would like a review to see where and how I could improve. ...
3
votes
1answer
42 views

Multiplying over a matrix

The below code is a solution I put together for the Project Euler #11 question which asked to find the largest product of 4 numbers of any direction in a matrix (horiz, vertic, and diag all ...
5
votes
0answers
48 views

Typing exercise app

I've been writing a program to improve my Javascript skills. It's a very simple app for typing practicing. ...
2
votes
1answer
42 views

Insert and attach tag to the post in same time

I created a form with title, body and tag input and there are 3 tables: posts, tags and post_tag. Now I use this function to add new tags and attach them to the post postcontroller.php ...
2
votes
2answers
39 views

K&R atoi() variation

I'm currently learning C with The C Programming Language by K&R and this is my current exercise: Rewrite appropriate programs from earlier chapters and exercises with pointers instead of array ...
7
votes
2answers
395 views

Countdown clock in Python

This project is from the subreddit for beginner Python projects: The goal of the project is to create a program that allows the user to choose a time and date, and then prints out a message at ...
-2
votes
0answers
30 views

Bjarne Stroustrup Chapter 4 Drill C++ [closed]

This is my first time posting here. I just started learning c++ by myself through Bjarne Stroustrup's Principle and Practice using c++. I've read up to chapter 4 and I'm working on the drill. This is ...
7
votes
5answers
640 views

Creating a numeric phone keypad

I'm writing a Telephone class and it has a method called getDigits which takes in a String parameter and returns the number that would appear on your phone if you ...
5
votes
3answers
307 views

Little text game in Java

I'm a beginner in the coding world, and I've been learning Java recently. I tried to make a small text game with the limited knowledge that I currently have of Java. I would like you to tell me ways ...
2
votes
1answer
32 views

Monoalphabetic Cipher in Java With GUI

An easy, terribly written but working, Caeasar (Monoalphabetic) cipher implementation, with a GUI (Graphical User Interface). Cipher.java ...
5
votes
3answers
98 views

Poker game implementation

I have included almost all features that real poker game contains, but even tho I tried to make it as clean as possible, I think it can be done much better. I used inheritance to somewhat distinct ...
7
votes
1answer
56 views

War Games whOOP

I am a beginner level programmer and recently I started learning OOP, so I made a simple war game ...
4
votes
2answers
168 views

Simple Tax Calculator

I've been learning Java for a very short period of time but with a couple of pointers, I've been able to put this simple VAT calculator together. If anyone could offer any ideas for improvement ...
4
votes
1answer
88 views

Finding palindromes in C#

This is my first foray into OOP, so I'd appreciate any kind of advice! Here is the problem description: On the first line of the input, you will receive a number specifying how many lines of ...
3
votes
2answers
46 views

C - K&R getint() variation

I'm currently learning C with "The C Programming Language" by K&R. At the moment I'm at the chapter about pointers (since I come from Java, they are new to me). In the book is an example code for ...
5
votes
2answers
375 views

Program that tells if a date is valid in C

I'm reading a book about C programming, at the end of each chapter it has some training exercise and one of them was to make a program that tells if a date is valid or not, the code below is what I ...
8
votes
1answer
121 views

Assembler for the HACK assembly language

Here's my assembler for the HACK assembly language, part of the Nand2Tetris course. I'd really appreciate any comments/criticism/help! If you want to know what input and output files should look ...
16
votes
4answers
2k views

My first calculator

I've just wrote my first code, which is basically a calculator. Please rate it and suggest improvements (keeping in mind that I'm a beginner). ...
14
votes
2answers
328 views

Simple game of Hangman in Python

I'm starting out with learning how to program in Python and created a Hangman game. I think there is a lot of unnecessary code but I am not sure how to improve it. I wanted to avoid using global ...
5
votes
1answer
56 views

Task Reminder - Repeatedly notify every 6 hours

So I'm very much a beginner to Java and Android programming. I've worked a lot more with Python so I might have some quirks from there bleeding into my code here. I'd like a particular focus on ...
2
votes
1answer
63 views

Who wants a FizzBuzz?

I have been playing around with the Io language, and this is my second toy, after the yes program that is just ...
4
votes
1answer
82 views

Simple calculation in Java

I am kind of new to Java and I have tried making a simple calculator. This lets you do different calculations in a row until you type done then you get the answer. It works as I expected but I was ...
11
votes
1answer
92 views

2D Gravity Simulator-like game

This project is pretty much like a 2D gravity simulator. You click and it creates a circle that attracts other circles. The result of a collision is a bigger circle that is a sum of the masses. If you ...
5
votes
1answer
66 views

PDO Insert function using PHP

This code inserts data into the database successfully. I was concerned about whether it is a considered good practise to go about inserting data into the database in this way. Is there something I am ...
1
vote
3answers
181 views

Finding the relationship between two values

My code was made as an practice for CodeChef. Here's the brief from that page: Relational Operators are operators which check the relationship between two values. Given two numerical values A ...
3
votes
2answers
93 views

Stamp PDF file with name and company

I wrote some code to put stamps on all pages of a PDF file with the name and company passed as parameters. It works as intended, but as I am a beginner in Java, I am sure there are some best practices ...
7
votes
1answer
60 views

Read and replace URL from PDF file

This is a code I wrote to find all URL within a PDF file and replace the one that matches the ID that I passed as a parameter. It works as intended, but as I am a beginner on Java, I am sure there ...
3
votes
1answer
56 views

Angular todo list

I'm not sure whether my code looks good or not: ...
7
votes
4answers
708 views

Shift positive integers to the left

I would like to write a function in C that turns all negative values into zeros then shifts the positive numbers to the beginning of the array, maintaining the order of the positive integers in the ...
9
votes
1answer
124 views

Early Access: Dynamically expanding input element table

This code is in a really early state in the lifecycle. I'm still in the process of implementing some core features, but nevertheless the code up to here works and accomplishes its task. I have no ...
2
votes
0answers
30 views

Dynamically create a table of input fields

I'm trying to dynamically create a table of input fields (two per field) that I will then send off to a Python script. Here's the expected behaviour: User chooses "manual entry," specifies rows, ...
-1
votes
0answers
39 views

Input handling for Android calculator

I am learning Android and this is my first effort at writing an Android application. Please review it and point out some mistake or improvements. Some part of it: ...
5
votes
2answers
175 views

Prompting for five test scores and printing the average

I am not sure how to properly make this readable. I have been trying to find examples online but I cannot find any that are specific to this simple program. ...