Questions that deal with the organization and structure of the code should be given this tag.
3
votes
4answers
93 views
What is a good way to check errors from a series of function calls?
I have to work with C style functions which return ERROR_SUCCESS when successful, otherwise return an error code. I want my code to be nice and neat and easy to ...
5
votes
1answer
47 views
App for listing places close by - building up models
I'm fairly new to Objective-C. The app I'm trying to make, is using the foursquare API to list up places that is close by. I've re-written this app more times than I care to admit, because I feel the ...
1
vote
1answer
31 views
Putting in order my two packages and possibly merging them
I am making an application which fetches tweets for a specified amount of time, then inserts those tweets in a database and when the user presses another button the top ...
2
votes
2answers
53 views
Optimizing a recursion code over lists
I'm writing three functions which iterate over lists, I want do this recursively, but I think this code is not as efficient as it could be.
...
5
votes
2answers
38 views
YAML Configuration file
I have recently started working on a server software in Java and wanted to add a configuration option to the program. I have gone through a few revisions of this class because I never liked what I ...
1
vote
1answer
46 views
Search a directory structure for tar files and report on their size
I have a complex directory structure on my web server that includes .tar files for download; I'm trying to create a report on the size distribution of these files (e.g. 10 are less than 1MB, two are ...
6
votes
2answers
174 views
Output day of the week from given date
I am posting this code up for review and debugging. This source code is for Java, and is meant to give you the exact day of the week from an entered date.
Review
This program seems to have 2 ...
20
votes
2answers
1k views
Pacman game implementation in Java
I assume you've all played Pacman, I mean, most people have.
I am a 10th grader, and I am working on building Pacman for my intro to Java class in school.
However, the project I'm working on ...
7
votes
4answers
399 views
Calculate final test score from a list of test results
Recently I have given an interview to a widely well-known technology firm. The first interview was general and it went well but they rejected based on some technical things. They did not mention it so ...
5
votes
2answers
86 views
Geometry table for use in regexes
I have been teaching myself Python 3. I watched a video on YouTube entitled "stop writing classes". The Gtable class doesn't even have an init function, so I can't help but wonder if I should have ...
4
votes
3answers
136 views
32-bit factorial calculator in x86 NASM assembly
This program calculates the factorial of a given positive number.
This is how it handles input:
if negative, terminate program
if 0-2, display input without calculating
if greater than or equal to ...
4
votes
3answers
134 views
Is my web site structured correctly?
I'm trying to get a better handle of code organization and how HTML5 (really HTML) stack works in general. I've worked mostly with ASP.NET Webforms and done some MVC as well. Let me say now, "I hate ...
5
votes
2answers
91 views
AutoComplete program using the n-gram model
For my Advanced Data Mining class (undergrad) we were to design a program that would predict the next word a user is likely to type via automatic text classification using the n-gram model.
The ...
1
vote
1answer
61 views
Dynamically loading jQuery when it's not available or version isn't high enough
I'm writing a script for others to use on their websites. I'd like to use jQuery in this script. Because I don't have control over what frameworks people use on their sites, I need to make sure jQuery ...
12
votes
3answers
647 views
C Makefile boilerplate
This is the current Makefile that I use with my C projects. Here is what I would like to be reviewed:
Reusability - is this Makefile easy to use for multiple separate projects with minimal ...
4
votes
2answers
252 views
6
votes
2answers
130 views
VB.Net Database Access Class
I've recently been asked to make some emergency changes to a legacy application written in VB.Net. I come from a C# background so am not overly familiar with this language, though there are enough ...
1
vote
2answers
66 views
Capture and assign portions of char array to a struct
I am formally a PHP/C# developer and I am new to C. I need you to help to correct my coding with C.
I have a kind of following pieces of HTTP user data string.
...
1
vote
1answer
71 views
A Ruby string analyser
I wrote this script for a code challenge on TreeHouse. I already submitted my code, but I am looking for an after the fact feedback.
The challenge was to open a file of text, remove specific words ...
9
votes
1answer
310 views
Is this the right way to implement a hashmap?
Is this the right way? Any comments on the hash functions? If asked a question like this in an interview, do I need to follow all OOP concepts(because I am using Java)? Like encapsulating the ...
3
votes
1answer
188 views
My first controller rspec test
I'm just started learning TDD with Rails and RSpec. This is my first test for controller. Just plain RESTful UserController that responds with JSON, so it has no new and edit methods. Please review it
...
4
votes
1answer
64 views
Am I organising my PHP code effectively?
I'm very new to learning PHP & MySQL (I've got past experience with Java) and I'm doubting whether my code is organised well. I've got an index page which has two forms; the first is a form to ...
6
votes
1answer
56 views
Populate errors for objects
I have a map of objects and errors associated with those objects.
I have to do the following:
populate the errors in the object
populate errors for valid objects based on the following:
check the ...
4
votes
2answers
95 views
Better PHP Ajax Request Processing Structure
I have a server side PHP file which processes Ajax requests from the client browser. Some requests are only valid if they originate from an Administrator in the application, others are only valid if ...
16
votes
6answers
614 views
Print out table with start/end temperatures and step size
I am trying to learn C++ by myself. I looked up a sample question after going through some text. Though I would like someone to review my code. I'm basically asking you to break it to show some flaws ...
2
votes
0answers
68 views
Domain modelling with Repository [closed]
I've been struggling with some architectural problems which I'm having a hard time figuring out myself.
Im trying to construct a basic structure of a project with the domain model and repository ...
10
votes
2answers
115 views
How can this Ruby format analyser be improved?
I have a requirement to validate file names related to architecture after they are uploaded. Once they have been uploaded I must warn the user if the file name is not standards compliant.
What's in a ...
6
votes
2answers
135 views
Android Thread and Runnable
This is my code for running a background thread. I believe it is very poor in naming and code structure.
...
4
votes
1answer
77 views
Resource manager implementation, with resources being organized in a scope-like hierarchy
The original question where the general concept of this implementation was discussed: Using ID's with a "scope" -like hierarchy
I have designed a resource manager as part of a game ...
6
votes
5answers
1k views
5
votes
2answers
113 views
PHP framework building: Sessions Managment Class
I am building a PHP framework and would like to get some feedback on a few different sections of the project so far. I consider myself still a neophyte in PHP so I would like to ask if I'm going about ...
3
votes
1answer
50 views
Determine local maximum from given points
How could I make this code more effective? I'm just experimenting and learning the different ways of how Python runs.
...
5
votes
2answers
77 views
Is it advisable to integrate SQL statements in the JSP pages that are not displayed to the user but handled at the back?
I have a signup form in which the user has to enter the email address and after some quick asynchronous processing at the backend I have to tell the user that whether the email address is already ...
2
votes
1answer
57 views
Prototype OO-style of my THREE.JS application
For several months I'm working with JavaScript and THREE.JS library. Firstly I dislike the prototype-based programming because I have to work a lot of with ...
1
vote
2answers
81 views
Same function but use different array data
I have these two carousels that randomly pick up pictures. [fiddle] Each of them picks up pictures and links from their own different inner array. It works fine as it is, but I was just wondering if ...
6
votes
4answers
820 views
Making a word processor
The Word Processor I had in mind would be similar to Microsoft's word and OpenOffice. I am trying to keep my logic separated from the User Interface and that separated from the controller, basically ...
7
votes
2answers
245 views
Optimization of file scanner
Program must to find duplicate files (by content) in a given directory(and subdirectories).
I collect all data in Map<Long, ArrayList<String>> map ...
1
vote
0answers
27 views
Inheritance and setting up for an API request
I am setting up a class to be used for an API request (with JavaScriptSerializer)
I am using it to send a complaint to their ticketing systems. So for example I send Title, Description, Custom_Fields
...
6
votes
1answer
109 views
Using ID's with a “scope” -like hierarchy
I currently have a ResourceManager class which is responsible for searching for resources with a given identifier, returning a reference counted pointer to the ...
4
votes
1answer
96 views
1
vote
0answers
47 views
Class factory of virtual functions and delegates [closed]
I'm planning to make a factory of virtual functions and delegates on a separate class like this:
...
4
votes
2answers
101 views
Optimising LinkedList class - Part 2
This is part 2. My problems are with too any pointers and with long body code in the following functions:
...
9
votes
1answer
68 views
Shortcuts and imports for large RPG basic code
I decided to work on putting together an Arena-style (very basic) text-based RPG as a way to help myself learn Python. Unfortunately, after about 1,000 lines of pieced-together code, I realize that ...
4
votes
1answer
92 views
Radio ListView onCheckedChangeListener?
This is my adapter class, to create a custom listView with three radiobuttons:
...
10
votes
3answers
206 views
MS Excel type of grid in jQuery
I have created a MS Excel type of grid in jQuery. I want to learn best practices and I need your comments for more optimized code.
Please review the code and offer your suggestions.
Demo
jQuery:
...
9
votes
2answers
147 views
Handling null arguments in a factory class
I have a Factory class that gives out instances of ResponseImpl class. It accepts one ...
11
votes
2answers
433 views
Knockout.js binding 2D table with rowspan
The app I'm working on should allows it's users to create tables. I have a view in which users are able to create a table. They should be able to define here the table's columns. The columns that the ...
7
votes
4answers
334 views
8
votes
1answer
76 views
Graphical game application
I'm writing my first JavaScript application (no 3rd party libraries used) and looking for some high-level guidance on how to better organize the code into separate classes & files.
Here is a ...
-1
votes
1answer
93 views
Which code looks better? [closed]
I've got a question on what code style is better.
There are two arrays containing some codes. One array consists of string elements, the other consists of integer elements. The corresponding values ...