The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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.

Filter by
Sorted by
Tagged with
1
vote
1answer
210 views

Feedback on a small PHP function that generates JSON data

I wrote a PHP function that generates JSON data to populate a line graph. Through jQuery, my code uses a GET request to the PHP script to fetch the JSON data. An example of the JSON data is as follows:...
2
votes
2answers
1k views

How to make this random number game better?

I'm a newbie trying to teach myself Python. Could somebody tell me if there is a better way to write this? I am also curious as to whether or not there is anything I should not do. This code does ...
4
votes
2answers
8k views

Implementation of OOP for retrieving list of objects from database

If I have a Person class that outlines the properties of a person and one of People that just contains a ...
6
votes
4answers
6k views

Reviewing my implementation of a stack using linked list

I have been studying data structures, and I'm new to this. Here is my code for the push and pop operations. I considered using a node=top, so that I can avoid O(n) operations for the push (i.e. ...
3
votes
1answer
198 views

Simple decorator for creating and managing a database cursor

I'm working on a simple decorator that creates and manages a database cursor. The goal is to 'inject' the cursor as the first argument of the function, but not expose it to the caller. Usage: ...
4
votes
1answer
7k views

Subclassing AFNetworking to handle POST / GET requests

I am pretty new to iOS development - I'm writing an app the uses web services, pretty extensively. With that in mind, I decided to use AFNetworking 2.0 and subclass ...
2
votes
2answers
3k views

Building a Red Black tree using a structure as a node

I have the following structure: ...
0
votes
1answer
196 views

Review my prime factorization function. Is it complete?

This is a function designed to return all the prime factors of a given number, in sorted order from least to greatest, in a list. It relies on another function that checks if a given number is prime. ...
2
votes
1answer
1k views

Determining whether one vector is a prefix of the other

I am learning from C++ Primer 5th edition. This is exercise 5.17: Given two vectors of ints, write a program to determine whether one vector is a prefix of the other. For vectors of unequal length, ...
7
votes
1answer
13k views

Manchester encoder/decoder

I have written a Manchester Encoding encoder / decoder based on my misconception of how it works (whoops). My encoder accepts an array of ones and zeroes, and returns the 'manchester encoded' data (...
3
votes
1answer
78 views

Any problems with this prime checker script?

I have just made what seems to me to be the first reliable prime-checking program that works. However, I am not sure if it is completely reliable, or if there are problems. It relies on list-making ...
2
votes
3answers
172 views

Shortening my questions code

Is there any other way to shorten this code without sacrificing readability? I am fairly new to C#, let alone programming, and I wanted to know if this is as short as this code can possibly become. ...
3
votes
2answers
138 views

A good management of Java code

I'm a beginner in JEE development. I have just finished a web application that I'm going to deploy in a server. It's a new level for me; it's not just a simple application that I can run for 10 min, ...
1
vote
1answer
123 views

Dynamically loaded slider

Problem: Make a slider, located at the bottom of the page. The slider should be dynamically loaded only when a div (#slider) becomes visible on the screen. Images ...
3
votes
1answer
1k views

JavaScript and jQuery check for image file and assign CSS

This is my first attempt at JavaScript, so I am looking to learn. I have a website that has jQuery built in and I wanted to leverage that in the following way: I want to get a number variable that ...
5
votes
1answer
1k views

Review Simple Logparser

This is my first try with Python. I wanted to parse some Log4J so I thought it a good opportunity to write my first Python program. The format of the logs I deal ...
3
votes
1answer
3k views

Getting list from an Oracle database and storing it in an object

I have two admin groups - VCS, and VPN. For each group, I need to get the list of all the people in that group, along with their IDs. What is the best way to do this? Could you please suggest if it ...
0
votes
1answer
265 views

A linked-list implementation

I am new to C, and this is my first attempt at creating a linked list. If anyone has a minute and could point out any errors or bad practices in this small linked list program, it would be really ...
5
votes
1answer
10k views

eBay scraper with BeautifulSoup

A friend of mine needs a scraper that reads product titles, prices and pictures from eBay and saves them to an Excel-ready .csv file. The program reads product pages into a list and then loops through ...
3
votes
4answers
519 views

Dental office program

Here is the code I wrote for my mother's dental office. It fulfills these tasks: determines whether a tooth is anterior or posterior determines if the patient needs a filling sets up a later ...
1
vote
2answers
247 views

How's my and my father's java ODE Solving and Graphing Program?

At the request of my father, I've adapted some C# code he wrote which uses a timer to display the true and approximate solutions of the ODE y' = -lambda*y in real time to do the same in java and then ...
2
votes
4answers
6k views

Password expiry notification script

I've just solve one problem that notifies users if their password is going to expire in 14 days. The script is working fine. I just want to improve my code and desire some suggestions. ...
2
votes
2answers
500 views

Parsing argv with while-switch construct

I've been thinking about how to create a robust function that parses the command line arguments for valid filenames. I came up with a while-switch construct because that allows me to reduce redundancy ...
1
vote
2answers
3k views

How can I store the fibonacci sequence in a vector during each recursive call? [closed]

...
3
votes
1answer
76 views
5
votes
3answers
4k views

Organization of measurements converter

I am pretty new to Python but I'm learning from classes. I am working on a project for class and this is my code. Anyone got a better idea of a way to organize the code or put it differently so there ...
3
votes
1answer
84 views

Better way to write list of places program

I wrote some code using meteor, which is working, but I don't know if I did it the best way. I'm asking for opinions on other ways to perform this task. It's just a list of places. You can fill the ...
3
votes
1answer
87 views

zsh system status script

The following script is being used to generate the status line in wmii. I'm curious if there are faster/more efficient ways to find the various info I'm grabbing. I'm also a relative newbie when it ...
11
votes
5answers
30k views

Simple Dice Roll game

Is there a more efficient algorithm to generate random numbers in C++? (This code is working on Dev-C++, but I'm not sure if it works on a Borland compiler.) ...
6
votes
2answers
885 views

Simple mathematical console application

I am new to C++ and with my basic knowledge of the language, I have attempted to create a simple console application filled with lots of useful functions involving math related stuff. The following ...
2
votes
3answers
9k views

Using the wildcard when importing packages [closed]

I am learning java and browsing posts on CodeReview and StackOverflow. In my text Introduction to Java Programming- Y Daniel Liang it states: The wildcard import imports all classes in a ...
7
votes
4answers
2k views

Tic-Tac-Toe design

Kindly look at this code and point out design flaws or areas for improvement. I think I've done the last part right (the enum). I think the rest of the design is flawed but I am very new to object-...
5
votes
1answer
249 views

Hangman - my first Clojure code

This is my first attempt at Clojure! Apart from all game related issues, how is my code? Is there anything I can do to make it more idiomatic? ...
7
votes
2answers
1k views

Console based Hangman in Java

I just created a Hangman app (same game mechanics mostly) using Java. I did this mainly to test my knowledge in OOP design/coding. I'd like to know your thoughts on my code The whole project is on ...
4
votes
2answers
541 views

K&R 1-20 Converting tabs to spaces using idiomatic C

I'm learning C with K&R 2nd Ed. I just completed exercise 1-20 (which is the detab program). I was hoping to get some feedback on my work. I want to make ...
3
votes
3answers
1k views

Prompting for values to plug into a formula — how to do it elegantly

This is my first program in java. I am wondering if there would be a better way to tackle this. I am only allowed to use one class. It's not quite finished, but I am thinking it doesn't look very ...
9
votes
4answers
19k views

Simple zodiac sign program

This is a simple program that can tell you your zodiac sign (Chinese or Western) and the year in which you were born. I made this using very basic beginning knowledge with C++ as practice. I'm ...
3
votes
1answer
616 views

Palindrome Checker

I've just started learning Java and went to compare my finished product to some others on Stack Overflow. Is there a reason why mine is "simple" and the others seem ridiculously hard to even ...
3
votes
2answers
3k views

Improve pandigital algorithm

First of all, I am a beginner in Python trying to learn optimizations and proper coding standards. Here is a snippet of code that checks if a number follows the rule: first AND last ...
8
votes
1answer
384 views

Does this unusual data access pattern create any problems?

The background Two beginners without access to an experienced mentor write an ASP .NET MVC application, mostly simple CRUD, using Linq to SQL for the data access layer. Beginner number 1 writes the ...
5
votes
2answers
278 views

jQuery toggle script

I have been working on a toggle script, but I find myself repeating my code. Is there a way of combining it all? ...
3
votes
2answers
954 views

Print largest two integers from a stream

I'm writing a program for my intro to comp sci course where I'm supposed to prompt the user to enter a stream of integers, and then return the largest two. We were given the hint to use a scanner and ...
2
votes
3answers
5k views

Beginner Java Counter code

My professor wants me to do this: Write a number of interchangeable counters using the Counter interface below: ...
5
votes
2answers
9k views

Simple age converter

I want you to pick my code apart and give me some feedback on how I could make it better or more simple. In my opinion this is the best code I have written, being that I'm new to programming. The ...
4
votes
2answers
4k views

Review Request - Android CountDownTimer activity

I'm new to Java and Android. While I've created a project that seems to work, I'd like some opinions on how to make it better. The app is going to be used as an interval workout timer/music player ...
8
votes
2answers
2k views

Graham Scan convex hull algorithm

I'm beginning to learn Haskell. I've implemented the Graham Scan algorithm for detection of convex hull following the Real World Haskell book. I'm looking for general advice regarding the style and ...
2
votes
1answer
11k views

Super simple spam program

x = int(input("Choose the number of times you want to spam. ")) y = input("What message do you want to spam? ") w = x + 1 for i in range(1,w): print(y) Any ...
3
votes
1answer
255 views

getopt ordering function in C

I was writing a program and I needed a function that could ordinate the argv according to my preferences. That way, getopt ...
4
votes
1answer
5k views

Singly linked list in C

Here's my version of singly linked list. Any constructive criticism is highly appreciated. First header file "sll.h": ...
4
votes
2answers
27k views

Reading unlimited input strings in C

The idea is to write a function that reads string of unknown size from stdin, keep it in dynamically allocated array of unknown size and return a copy of that array....