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.
3
votes
1answer
18 views
11
votes
4answers
603 views
“Two-pass algorithm” implementation in Java
I'm rather new to Java and to algorithms in general. I implemented the so called Two-pass algorithm, and want to know if there are improvements to my way of implementing it. What it does is it takes a ...
4
votes
3answers
155 views
Storing words from an input stream into a vector
I'm extremely new to C++ and am doing the exercises on the book Accelerated C++. Here is one of the exercises:
4-5. Write a function that reads words from an input stream and stores
them in a ...
1
vote
1answer
19 views
Vectorize Matlab sum
I have the following Matlab function:
function [res] = a3_funct(x)
res = 0;
for i = 1:size(x,1)
res = res + abs(x(i))^i;
end
end
It's ...
3
votes
0answers
83 views
Genetic Algorithm in Python
I'm a new programmer, so any help is advised. Preferably to make it faster, avoid heavy memory usage and so on.
EDIT:
Updated the code, now including a functional test program.
Fixed the PEP-8 ...
3
votes
3answers
843 views
4
votes
2answers
214 views
Creating a cache manager
I am purely new to C++ memory management. Am I on the right path, or should I employ a different design strategy or a different memory manager policy (such as ...
9
votes
1answer
278 views
x64 Assembly - checking for largest prime factor
Using x64 assembly, I solved the Largest Prime Factor problem on Project Euler.
The problem is as follows:
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of ...
5
votes
3answers
90 views
Difference in days between two dates
I've been trying to write a really basic function to determine the difference (in days) between two dates. I am very new to C++ so as you can imagine I am very happy with my work.
This function is ...
3
votes
1answer
23 views
Script for saving top wallpapers from wallbase.cc into a directory
I am newish to Python and I am looking for some extra eyes on a script I wrote. I wrote this script to learn more about web-scraping and using requests and Beautiful Soup. I use it to connect to the ...
1
vote
0answers
10 views
TypeScript definitions for Server-Sent Events
I could not find any definitions of the EventSource object that belongs to Server-Sent Events, so I create the definitions. That's how they look like:
...
5
votes
0answers
50 views
Controller for handling user registration
I spent a lot of time doing Go Horse Extreme programming, but now I want to be a better person.
How can I make this method smaller, better, more OOP?
...
2
votes
0answers
33 views
Implementation of merge sort and bubble sort
I'm new to Go and looking for a review of my merge sort and bubble sort implementations. What can be done better? Can my code be cleaner/clearer?
...
11
votes
3answers
456 views
Bank card validation module
I hope that someone could review a module I wrote for bank card validation. I included a class that tests some of the methods, this is purely to show the methods work, rather than unit testing. I ...
20
votes
4answers
2k views
Everyone loves Fibonacci
I was bored and burnt out on more serious projects.... until I saw this Computerphile video on YouTube. Now I'm inspired again. Now I feel like spending some time implementing that recursive algorithm ...
2
votes
1answer
54 views
Cleaning User Input
I am not sure if I am approaching this task the correct way. I have a view model with multiple string properties. I pass the model through an interface to a service class that contains a void to ...
6
votes
1answer
69 views
Linear algebra, reduced row echelon form - function 1
This is a derivative post from here.
This is just a general review, so the question is the same:
Is there something...
That you would consider as a bad practice and why?
That is just bad in some ...
3
votes
1answer
40 views
Adding reversed numbers
This is my solution to the competitive coding question on SPOJ here. It gives a runtime of 0.24 but the best solutions posted have a 0.0 runtime. How could I possibly achieve better results than ...
3
votes
1answer
45 views
Base class for subclasses that can track their own instances
I'm new to Python, with some background in Java and C# from a while ago, and more recently in scripting worlds like Bash and AppleScript.
I wanted to be able to create classes that could
report ...
7
votes
1answer
88 views
PHP isset over use? Good or bad?
First, I'm in no way an experienced PHP coder. This is my 5th time working with PHP, so if you see anything that can bee improve, please point them out for me.
I have the code checking for the ...
2
votes
2answers
78 views
User Login Logic
I want to see if this is as streamlined as possible. Most of the logic is accomplished through methods in the model. The controller does one of four things:
redirects new users to registration
...
7
votes
2answers
87 views
Output in one window
Can anyone give me feedback please? I used what I have learnt so far, mainly methods, loops and arrays. I would like you view based on these topics, however, comments on how to improve are welcome.
...
5
votes
1answer
78 views
Linear algebra, reduced row echelon form
The code that I am sharing here for you to review today, is a segment of a JavaScript library that I am going to write as time goes by for fun. It is only the two functions in the following code:
...
0
votes
1answer
38 views
Getting data from the server via JSON callback and parsing the data to HTML
I'm pretty new to web development with JS and was wondering if anyone can tell me how I can improve my code. I just feel like when it comes to maintainability my code would be very difficult to ...
2
votes
2answers
55 views
String sanitisation function
I have a search function on my website. In addition, elsewhere I have a place where users can submit categories for their posts. I want the categories to have an uppercase first letter and the rest ...
5
votes
2answers
61 views
Taking wind data and simulating future wind profiles
I am new to programming, and am using Python to take wind data and simulate future wind profiles. The code as written takes a while to execute and I was hoping someone could suggest ways to make my ...
8
votes
3answers
912 views
Would this macro to call printf() be considered bad coding style in the corporate world?
I wrote this program:
...
2
votes
2answers
72 views
Word counter script
I made a word counter. It works as long as there aren't any lone punctuation marks. How could it be improved? (Could it be made simpler? Are the comments detailed/clear enough? etc.) I know it's ...
3
votes
1answer
86 views
Parsing version number from a Java source file
I'm extracting the version number from a file like this one. It works, but I find it clumsy and longer than probably needed.
I'd also appreciate some sanity checks as long as they don't make the code ...
6
votes
1answer
70 views
Method to determine redirect after login
I have a method that returns a URL to send a user should they pass a login. My problem is two of these links are hard coded one of which is attempting to pass a variable to the model of that ...
1
vote
0answers
29 views
Unit of Work + Repository Pattern + Stored Procedures
I'm a beginner with ASP.NET Web API and the Unit of work + Repository design patterns. I've been reading a lot about ASP.NET Web API and I'm learning as much as I can so I can create a good web API.
...
5
votes
3answers
181 views
Manipulating Common Fractions
I'm a beginner Java student currently learning from Absolute Java 5th edition. I think I understand the content well but I am never sure of my style. This code is for a question after the second ...
10
votes
3answers
554 views
Counting DNA nucleotides in C
I have written code to solve the following Rosalind problem. This is my first time writing in C and I would like a review of my code, particularly in regard to correctness and performance.
...
4
votes
0answers
44 views
Scala heap implementation
I'm Scala beginner, so if anyone would be so kind and give some feedback.
...
6
votes
2answers
67 views
Splitting a list into overlapping sub-lists
I'm very new to Haskell. I did try it for a few days, a few years ago... but other than that, this is my second day. I'm equally unused to functional programming, by the way.
After much trial and ...
10
votes
0answers
73 views
Simplifying Python Pandas code for selecting co-occurrences in a window of time
I am a beginner at programming. I was able to build the thing below, which achieves what I want with a small dataset. With larger datasets, my RAM gets swamped bringing the computer to a halt (2014 ...
5
votes
1answer
33 views
Microcontroller ringbuffer
I'm pretty new to microcontrollers and C in general, so I thought asking here would be a good way not to get started with bad habits.
...
1
vote
0answers
39 views
Writing an MVC project for the first time - how close am I?
I've recently started programming (learning Ruby) and wrote a small game. Now I've started reading about MVC and am trying to refracture my code to follow that architecture. The only classes with big ...
2
votes
1answer
49 views
0
votes
1answer
39 views
How can I refactor to avoid problems with function expressions (hoisting)?
The folllowing is a series of functions to ensure that various elements on a page line up no matter what window size or when the window is resized. However I'm not sure my code is very concise as I am ...
14
votes
2answers
226 views
Is my code nice and neat for a Tic-Tac-Toe board times 4?
I am trying to learn kTurtle (slightly different from Logo) so that I can help my daughter learn to write code. I have decided that I would write a program that would play Tic-Tac-Toe with a user. ...
2
votes
1answer
36 views
Basic binary Tree in JavaScript
I wrote a basic binary tree in JS. Can anyone give me some feedback about my code?
I just want to know if this is the right approach, and how I can improve the tree. I am new to JavaScript and data ...
5
votes
2answers
84 views
Unit Testing an AppInfo class
I have never written a unit test and I am really new to C#. I am attempting to test a method, am I testing for the right things here?
The Method
...
21
votes
4answers
2k views
Snowfall in HTML
I am a beginner and I have made Snowfall in HTML for my mom. I'm pretty sure it will not look that awesome to any developer out there, but hey, that's why I've posted it.
I'd like a general review of ...
1
vote
0answers
45 views
Cleaning if / else mess in Node.js poker game
This is the third rewrite of the poker bot I am writing. The first one was such a mess of if / elses that I could not deal with ...
3
votes
3answers
421 views
Beautifying Dates
There has got to be a better way to do this. I have a method which returns either your standard "01/01/2014" Date or "January 1st, 2014" Date of the assembly file write time. Any suggestions on ...
2
votes
2answers
50 views
Return custom assembly attribute variables
I have a custom attribute in my assembly called SemverAttribute, and I have a helper class called AppInfo that has a function to return a number called the Semver number. It accepts an id of null-6. ...
5
votes
2answers
75 views
Beginner Project: Bunny City
I am a Java programmer, and I just recently started learning Scala for fun. I found a group of projects here, and I tried to do the graduation excercise. The problem is, my code looks a lot like java, ...
5
votes
2answers
85 views
Adding object to database, using linq or sql connection
I have a table called tblDelegates in my database which I need to populate with some data. I have created a class called Delegates which has various properties to ...
9
votes
3answers
286 views
Pizza form project
I've just recently started C# and I was wondering if there's anything I can improve on.
My project is a pizza form, where people can order pizza and the price gets updated, depending on whether they ...