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

7
votes
1answer
53 views

Calculating the checksum digit with the Luhn-algorithm

I'm doing some exercises in python and this one is about using the Luhn-algorithm to calculate the checksum digit in Swedish personal identification numbers. The description is the same as this ...
6
votes
2answers
164 views

Blackjack game with classes instead of functions

To try out the concepts and tools I've been learning, I decided to write a Blackjack game. I wrote it entirely with functions, so it hasn't helped me at all with the concept I really lack ...
7
votes
2answers
53 views

Calculating Luhn-algorithm checksum digit

Today I decided to learn some basic Haskell, and for starters I made a program for calculating the checksum of a Swedish personal identification number. It uses the Luhn-algorithm, aka. ...
15
votes
1answer
570 views

Blackjack Strategy

I am creating a Blackjack simulator in Java in order to better understand the language. I have written the basic strategy section for a player and it is terribly long. Is there a better way to do ...
9
votes
3answers
526 views

Finding largest prime factor from inputted number

This is my first C# console application. This program asks for an input of a number, and finds the highest prime factor of that number. Please review my code. Have I used things right? Is my code ...
6
votes
1answer
52 views

Chat using commands

I have been learning Python and was trying to make a chat system which can be run by commands. This is my first attempt to write the code. Does this make sense or is it wrong usage of classes? There ...
9
votes
1answer
104 views

Good performance when predicting future game states

This question is about my answer to this king-of-the-hill challenge on Code Golf. In short, the purpose of the challenge is to code a slime that, trough various possible moves gains control over an ...
7
votes
1answer
37 views

Command line flashcard game

I've built a simple command line flashcard game for learning Korean. I'm a beginner programmer, so I just wanted to make sure I'm following best practices, especially pertaining to OOP principles. ...
9
votes
5answers
615 views

Using sounds in Java

I'm trying to apply sound today, and the goal in mind was a simple violin tuner. The actionListener seems repetitive/ How might I optimize it (what I tried just ...
5
votes
2answers
30 views

Convert cardinal abbreviations into full cardinal direction

I'm still learning Ruby and I made the following function to convert "N" or "SE" into ...
6
votes
4answers
241 views

Counting the number of words in a string

I have written this program to count the number of words in a string. I have checked my program for the worst-case scenario. If any of you can find any cases for which this program doesn't work, ...
7
votes
1answer
74 views

Program to insert, search for and delete an element from an array

I'd like this code to be improved. ...
6
votes
3answers
270 views

Game inventory system

I've been trying to figure out the best way to create a inventory system in Python. I like the way this one works but what I was wondering was if there was a better way to write it. ...
6
votes
2answers
69 views

Printing inputted, largest, odd integer

The program asks the user to input 10 integers, and then prints the largest odd number that was entered. If no odd number was entered, it prints a message to that effect. ...
0
votes
1answer
23 views

Logger module with JavaScript

I'm new to JavaScript, and in Java I probably would do this as a singleton. I need something that I can call from anywhere and instantiate only once. This is what I have done, but I need some advice ...
8
votes
3answers
145 views

Output int from string input

This takes a string input like 1,2,3,4,5, splits it using , delimiter, converts each char to int and output it in a single line ...
12
votes
3answers
467 views

Calculating the circumference and area of a circle

This simple program uses Scanner to obtain a radius from the user, then calculates and outputs the circumference and area. Questions: Is it customary in Java to ...
12
votes
4answers
149 views

Tic Tac Toe game in Java OOP

I have written a simple GUI Tic Tac Toe Application and since this is my first shot, I think it can be improved a lot. Please tell me what you think about it and what you see I made wrong so I can ...
0
votes
0answers
15 views

Filesystem kernel mode driver stack overflow error [closed]

I am having an issue where my driver's stack is overflowing and causing the computer to bluescreen when I call ZwCreateFile. I am just starting to develop for the windows kernel and not really sure ...
1
vote
2answers
46 views

Menu selector code that changes the background of a selected div

i made this code to change the background color for a div in set of divs while disable the rest divs background it work fine as it look but i wanted to review the code for more improvement since I am ...
1
vote
2answers
71 views

Simple wrapper for an API

This is a wrapper for an API. For now all it does is get a certain document or search for relevant documents from a document store -- although I plan to build out more features later. I'm new to PHP ...
3
votes
3answers
75 views

Looping over files in C++ and changing their names to store data into a single file

I have a lot of data in separate files generated from a simulation program. All data is clear and formatted via a single space to read in 4 columns. I can open and store data from each file one at a ...
6
votes
2answers
181 views

Displaying content based on the current time

I'm new to PHP and just wrote a bunch of if statements to display content based on the current time. Is there a better way of writing the following block of code ...
1
vote
1answer
69 views

Simple Operations Calculator

I'm practicing Swing effects. Everything works but for some reason I get a ton of error messages in the command prompt when the fields are empty, despite my attempt to add some exception handling ...
7
votes
2answers
60 views

Program to find the element in an array

I'd like this code to be improved. ...
4
votes
1answer
44 views

FizzBuzz - officially now in CLISP

I had to jump on the bandwagon for this one. The task does a great job of helping you learn a language you're unfamiliar with. So today I present you with my version of the infamous FizzBuzz game in ...
7
votes
5answers
307 views

Fraction class implemented in Objective-C

Inspired by this question: Fraction (rational number) structure with custom operators, I have written this class for doing some simple work with fractions. ...
11
votes
2answers
113 views

Dog owner simulator

I've just started programming and read a book called Head First Java. I thought it would be fun to make a training project that I can put all the stuff I learn into. Is the code I've written here ...
7
votes
5answers
463 views

FizzBuzz in Objective-C

In my quest for learning Objective-C, I have created the common FizzBuzz code in it. This is due to a suggestion/challenge from @nhgrif to re-implement anything he does in Swift in Objective-C. ...
6
votes
3answers
84 views

Returning the lowest and highest number based on input

This simple console program prompts the users for a number and returns the lowest and highest numbers from their inputs. It is difficult to add more user inputs, though. How can I make this easier to ...
2
votes
1answer
55 views

Rooms and trapdoors - for-loop and while-loop efficiency

I'd like to know if I can make this code more efficient in terms of line saving, or any other way: ...
3
votes
0answers
43 views

Generating prime numbers using Sieve of Eratosthenes with CUDA

I'm learning CUDA and wrote a little program which generates prime numbers using the Sieve of Eratosthenes. (I know the limitations of CUDA, specially with memory sizes and limits, but this program is ...
14
votes
3answers
919 views

FizzBuzz implementation using the ternary operator

This is my first time writing JAVA, and I'm trying to start off on the right track. Using my C++ knowledge, I was able to understand the syntax for the ternary operator, but I'm not sure how it ...
5
votes
1answer
60 views

JavaScript Weather App

I am pretty new to JavaScript, and put together a weather application. I'd like to get some feedback on improvements I could make to the code itself and also possible ways to speed up weather data ...
6
votes
3answers
99 views

Text-based Blackjack game in Python

I am new to programming in Python and wrote a simple Blackjack project. I am looking for experienced peers to provide a high level code review about the overall design patterns and proper usages. The ...
3
votes
1answer
33 views

Create Dummy Files for Testing

I have two different folders. In one folder, I have files that will be exported to a remote site via FTP. In a second folder, I have .dat files that will be processed by a ftp client program that ...
6
votes
3answers
419 views

Check efficiency of PHP code that will query over 8500 orders

I am querying all orders from a WordPress database that uses the WooCommerce Bookings plugin. I want to display upcoming bookings, and there is a potential to have every hour within 2015 to be booked; ...
6
votes
1answer
104 views

Creating C++ classes and objects

I'm brand new to programming (in general) and C++ (in particular). I'm learning the basics of classes and objects. I'm trying to do the following: Create a class called ...
8
votes
1answer
76 views

Calculate torque of a bolt based on grade, size, and lubricant

To calculate torque I need to look up a value from a table which I've hardcoded based on three conditions: grade, size, and thread. Then I need to multiply it by coefficients associated with the ...
10
votes
3answers
239 views

Git pre-commit hook to check that changes to certain files only happen on the master branch

As a beginner in Ruby, I am trying to optimize this script that is a client side pre-commit hook for git. Was hoping I could get a review to ensure I am following all ruby idioms, and to ensure I ...
0
votes
1answer
33 views

Implementing a bubble sort on a linked list [closed]

I'm using the following prototype: Data* bubble_sort(Data *list); I'm trying to implement a bubble sort given a linked list of names. Note: this returns ...
10
votes
3answers
672 views

Basic timer from one minute to 0

I'm a beginner in JavaScript and I am sure that there is a better way to do it (basic one minute timer from 01:00 to 00:00 running from pageload): JSFiddle ...
5
votes
2answers
116 views

Short XML parser

This is my first code in C# ever. It compiles and works as intended (not complete), but I want to see what I'm doing right and wrong as a first-timer. ...
5
votes
1answer
127 views

Replacing occurrences in NSString and NSMutableString

I ran it and it's working, but I just want someone to double check that I followed the directions. Any suggestions or corrections will be appreciated. Assume you have a ...
3
votes
0answers
53 views

Fixed point iteration and cobweb plot

I'm using Python to find fixed points of a given function and then draw a cobweb plot to visualize it. Thanks to this question, I have the core of the code written and can accomplish the task, but I ...
4
votes
3answers
51 views

Parsing US address with Clojure

The parser below is not designed for every single US address. I am parsing through a file where each line may or may not be an address. I am more focused on speed rather than robustness. ...
-2
votes
1answer
20 views
4
votes
2answers
53 views

User Authentication Bundle

I wrote a user authentication program(s) for an MVC application. Before you ask part of the project specs are I have to store user information in company databases on servers that aren't the web ...
2
votes
1answer
31 views

Creating a New User Account

I feel like this maybe to much for one method... This method lives inside of a service class which is called by an interface. It dumps data into three different tables within a database. ...
5
votes
1answer
57 views

First text game with Python - Higher or Lower

Recently I have been learning Python programming, for about a week. I have covered all basic stuff - loops, strings, input masks - and have challenged myself by making a little game. It isn't much, ...