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.
-1
votes
0answers
8 views
List of structs iterator error C++ [on hold]
i am still kind of new to C++, i have been trying to make a basic Blackjack game using a struct for the cards and a list for each players hand. After a lot of reasearch on std::list and it's functions ...
-2
votes
0answers
15 views
A problem with Tic-Tac-Toe in python [on hold]
I created a Tic-Tac-Toe in python, that have to game options - Player VS player and player VS computer.
The player VS player option works perfectly, but something in my player VS computer option ...
-2
votes
0answers
29 views
Positioning for browser size [on hold]
I'm creating my first webpage (GitHub link) which is a copy of Google's homepage.
So far, so good. Things are looking pretty decent...and then I resized my browser window and I have things flying ...
6
votes
3answers
66 views
Copying data from closed workbooks
I'm an intern in an industrial company in Brazil and it happens that I'm using excel a lot. I just started playing with VBA couple of days ago, and I'm amused of how many things it can do for me!
I ...
4
votes
2answers
52 views
Find all integers between m and n whose sum of squared divisors is itself a square
Divisors of 42 are : 1, 2, 3, 6, 7, 14, 21, 42. These divisors squared
are: 1, 4, 9, 36, 49, 196, 441, 1764. The sum of the squared divisors
is 2500 which is 50 * 50, a square!
Given two ...
2
votes
2answers
55 views
Recreating Google homepage for learning purposes
Like other posters, I'm currently working on recreating Google's Homepage for The Odin Project.
I'm new to HTML and CSS but I'm eager to learn and have been looking around for an answer, testing ...
5
votes
2answers
190 views
Efficiently return a ChatColor
I am working on a plugin for a Minecraft server. In it, I have a function that returns a ChatColor depending on what permission level you are.
Whenever I need ...
-4
votes
0answers
10 views
Illegal Start of Expression, not sure what the cause is [on hold]
I keep getting an illegal start of expression on public int makeThrow. I have checked many other posts and most of them are due to a bracket error or defining a method within main. However, I ...
0
votes
0answers
26 views
CMS with MVC structure [on hold]
First I have a base controller that instantiate the view class, set some useful methods and call the render method of view object. A base model that just instantiate and store a db instance.
UPDATE: ...
1
vote
1answer
50 views
PHP/MySQL - OOP database class
I use this database class in a CMS, just a project to learn OOP. Would like to have some review on how to improve it, what should I change, add, remove?
...
3
votes
1answer
66 views
Calculator in HTML, CSS, JS
I am new to Javascript and HTML. I have written code for a calculator, so review my code and points out pros and cons in it.
...
5
votes
1answer
45 views
Read through a log file to find “Fail” lines
Please bear with me, I'm only about a week into Python.
This code is something that I wanted to do once I completed the chapters dealing with opening and reading files, and RegEx. I always feel like ...
5
votes
1answer
54 views
Javascript Breakout Game
I'm a novice programmer who is very new to Javascript, and animation/graphics, and I have this breakout game on my flask website.
I tried to do as much as I could from scratch, and I'm unsure if my ...
2
votes
2answers
48 views
18 Motor, 6 Leg robot Walking code - Python / ROS - follow-up
I have re-designed my robot walking code from feedback I received on previous question and would love to hear some feedback and pointers.
Main.py:
...
1
vote
1answer
24 views
Extracting original values from cumulative sum values
I was writing a function in python to extract original values given a list containing cumulative sum values. For eg -
...
-3
votes
0answers
54 views
Classes representing a developer–manager relationship
I am fairly new to C++ and here is a piece of code I wrote while I was looking into the copy constructor working. The code compiles perfectly on MSVC. I am using VS2005 as IDE and using C++03.
My ...
0
votes
1answer
50 views
Program for helping people practice their maths [on hold]
Please mention anything that could help me.
...
1
vote
1answer
30 views
RLE-like string compression in clojure
There have been already many similar questions to this one (e.g. this and this, just to point two), but I did not find any for clojure.
The goal is to compress a string in a RLE-like way: i.e. each ...
2
votes
1answer
93 views
Student Management
You are a computer science professor at South Harmon Institute of
Technology, and are in dire need of automatic grading! The good news
is you have all of your student's assignments in an ...
4
votes
2answers
70 views
18 Motor, 6 Legged robot walking using Python / ROS
I have been using ROS alongside Python to enable my built robot to walk. I am aware that my code needs some improvement such as classes etc. This is my first Python / ROS program so any help and ...
3
votes
2answers
53 views
The Grid Search
Given a 2D array of digits, try to find the location of a given 2D
pattern of digits.
Input Format
The first line contains an integer, T, which is ...
-3
votes
0answers
8 views
How do I add JSON data to my table, without refreshing the page? [on hold]
It correctly saves the data to the string, but how do I show the data in my table? Why isn't this code working?
Javascript code:
...
1
vote
0answers
24 views
Calculation of duration between two timestamps in different rows
In my sample data table below, all datatypes are varchar(255).
...
8
votes
2answers
59 views
Simple command-line password generator
I'm very new to Haskell, I've read most of learnyouahaskell.com and played around with some simple things, but this is probably the most 'complicated' bit of Haskell I've written so far. I have an ...
10
votes
5answers
1k views
“Of three points supplied, is one a midpoint of the other two?”
Write a method named hasMidpoint that accepts three integers as parameters and returns true if one of the integers is the midpoint between the other two ...
4
votes
3answers
68 views
Efficient dictionary printing
Here's what my task is:
Dependant on the "Logged In" user, they'll have different access rights and will see different menus.
I have tried using the .get() ...
2
votes
1answer
24 views
Stewardesses serving passengers
I did an exercise (open-ended - without an answer) from a JavaScript book (chapter about functions).
Given array of passengers of a flight with their names and ticket types and one need to emulate ...
3
votes
3answers
71 views
Interplanetary weight calculator
I have been using this site for a couple of years for great answers and a ton of help. I wrote this program for my class project due 1/23. I am just wondering what you would recommend me changing or ...
1
vote
1answer
46 views
Collating creature descriptors spread across multiple stanzas
I have been using Python for only a few days, so I am trying to learn about some best practices. An explanation of what this code is supposed to do is at the bottom of this post. It is an exercise to ...
5
votes
4answers
526 views
Beginner - Guessing Game
In the past few days i have started to learn python 3 in my spare time and i am really enjoying it so far.
I have attempted many simple programs such as a palindrome checker and reverse a string in ...
0
votes
0answers
61 views
Npm-module: socket-event
I've written a small npm module. It is my first module. I'm asking you to review several things:
The code. I am rather starter, so any wise critic will be super.
Any suggestions or ideas on the ...
3
votes
2answers
44 views
Extracting RAR files in a directory
I just started programming, and something is telling me that this working function looks to big for what it does. Can you give a better version of the code so I can understand how to code faster, ...
4
votes
2answers
69 views
Determine cheating in reverse “Guess My Number” game
I'm just starting to learn C++ (not my first language), and started with working on a program to simulate the classic "Guess My Number" game, and am mostly looking for feedback on optimization and/or ...
2
votes
1answer
49 views
Build SQL query criteria from form input
Very new to php. Using XAMPP, netbeans.
I am using a <form> to send various input parameters as a GET to retrieve data from a very simple two table MySQL db.
...
3
votes
1answer
67 views
To-do app, as one monster function and as several smaller functions
I am learning to code by making a todo app in pure javascript. My first attempt can be seen here.
It's all cosmetic, meaning it stores no information, generates no objects or arrays, though it was ...
10
votes
4answers
817 views
Generate set of random numbers and remove lowest
I'm learning some Python with my kids, and we're making a program to generate D & D characters from user input.
One portion of the code is to generate stats, which are a set of six numbers where ...
6
votes
1answer
63 views
Associating degrees with notes of scales
I have a JS file that creates an object with notes from a music scale when given a key (aka tonic/ note). The code works and does what I want it to do. I need a critique on the way it's written, what ...
1
vote
1answer
55 views
Using nested if statements to select textfield for update of associated label
So I have written a very simple program using a cocoa pods library to calculate the distance between different cities. Here is what the UI looks like:
So I have a textfield on top for entry of ...
3
votes
1answer
49 views
SICP exercise 2.28 - counting leaves in a tree (recursive process)
From SICP
Exercise 2.28: Write a procedure fringe that takes as argument a tree
(represented as a list) and returns a list whose elements are all the
leaves of the tree arranged in ...
1
vote
2answers
93 views
Array class to replace all iterator needs
Following dreams, I have started learning Java for Game Programing purposes and, during code I figured out that Iterators such as Queue, Lists, Arraylists and what not are very common. I have written ...
4
votes
1answer
78 views
Solution to Project Euler problem 5 (LCM of 1 to 20)
I'm an experienced C# developer trying to teach myself F#. I spent a day or 3 reading throught the F# wikibook trying to get to know the syntax and F# fundamentals.
As an exercise I'm trying to go ...
1
vote
2answers
122 views
Fighting game in Java
I want a better way to do the if statements, and if there is a better way to do it. How is it more efficient? Is there something like a ...
4
votes
3answers
79 views
Implementation of mergesort in C
I have implemented mergesort in C. Any advice on making it more compact? My merge function seems less than fully optimal.
...
14
votes
6answers
3k views
Elementary, Dr. Watson; it's a console adventure
How can I make this code shorter? The code I am using is so long. Just making one simple level is taking about 100 lines of code.
...
8
votes
2answers
369 views
Resistance is futile, Resistors have been dispatched to model your Resistance
Since it was getting boring to always do OOP Languages I decided to dabble in the functional realm of programming.
For that I chose the narrowly missed community-challenge by Edward: Resistor Mania, ...
2
votes
2answers
47 views
Returning the number of records per day
I'm writing a query to get the number of sessions created each day for the past 90 days. I'm currently using a prepared statement to do this - looks something like this:
...
2
votes
2answers
47 views
SICP - exercise 2.27 - reversing elements of a list and sublists
From SICP
Exercise 2.27: Modify your deep-reverse procedure of Exercise 2.18 to produce a deep-deep-reverse procedure that takes a list as argument and returns as its value the list with its ...
2
votes
1answer
34 views
Velocity verlet implementation
My code is meant to update the positions and velocities of planets. There are a few methods in this class, but updatePosition and ...
5
votes
1answer
179 views
Algorithm to categorize episode-file names efficiently
I'm trying to categorize file names of anime episodes (for now) into appropriate title based categories. The Show-titles are parsed from an XML file (I got from Anime News Network).
EDIT: The passed ...
11
votes
6answers
2k views
Converting a string to an Integer in C
I'm learning C and one of the questions I've been asked is converting a string to an integer. The code I've written supports converting from a string in any base up to 16/hex to an integer. There is ...