0
votes
0answers
4 views

The right place to place angular modal

In my app I have a BaseCtrl, which is attached to the body element and is available everywhere. In the mentioned controller I ...
0
votes
0answers
6 views

Validation in Node.js

I'm building a NodeJS application, but I'm not sure what will be the best way to structure my code. I have the following model: ...
2
votes
1answer
19 views

TopCoder problem “Lottery” - SRM 144 (Division I Level Two)

The problem statement Here's summary: The rules of a lottery are defined by two integers (choices and blanks) and two boolean variables (sorted and unique). choices represents the highest valid ...
0
votes
0answers
5 views

Read a Tab Separated File and Assign Each Column to a Separate Variable [on hold]

The following python code reads a tab separated file which contains multiple columns. I have store each column in a separate variable then tried to store the column into a dictionary and print out the ...
3
votes
1answer
10 views

Leap year calculator

I'm creating a program to determine whether or not a given year is a leap year. I just wanted to get anyone's feedback on it. I am aware of the calendar module in Python. I just wanted to try it from ...
0
votes
0answers
7 views

A circular buffer of size N [on hold]

My task: Implement a circular buffer of size N. Allow the caller to append, remove and list the contents of the buffer. Implement the buffer to achieve maximum performance for each of the ...
-1
votes
0answers
12 views

Factory for making buttons and other HTML tags

There is a lot of explanation on Factory Design Pattern in Code Review. However, I cannot find an example in python, so here is sample code which I want to use in my project (names of class is ...
2
votes
1answer
17 views

C++ Prime Factorization

I just picked up C++ today and I wonder if this is c++-like. I have a bit of experience with Java. This is a program that takes a number as input and outputs its prime factorization in no particular ...
4
votes
0answers
13 views

Snippets Manager

This basically manages a set of snippets, saving and loading it. snippets.cpp ...
2
votes
1answer
17 views

Parse a csv file and create a dictionary of partial results

I have a bunch of .csv files which I have to read and look for data. The .csv file is of the format: ...
0
votes
0answers
8 views
0
votes
0answers
11 views

Create array from SQL queries

I have been working on this for a while and have finally made things work how I want them to work. I realise that my code is super inefficient and this is showing by the really long time it takes to ...
1
vote
0answers
15 views

Customer contact unit-testing

I'm dealing with a damn scary function which I would wish to refactor so I could unit test it properly and improve the design. I will try to explain what it does and how it works in detail (with ...
2
votes
0answers
11 views

Binary Search Tree in C++

I'm writing C++ for the first time and wanted to implement a BST. I come from writing C, so I tend to write code in that way. I'm trying to wrap my head around smart pointers, but can't seem to get ...
3
votes
2answers
91 views

Game of Life Neighbour count optimization

This is a working Neighbours method. Is there any way to make this simpler and concise? ...
2
votes
0answers
10 views

Is my controller for editing information about videos doing too much?

My project uses Zend Framework 2. I'm trying to determine if I am doing too much in my controller as a rule for my development. I have built my controllers like this for a while and haven't run into ...
0
votes
0answers
15 views

Best practice for looping on a collection using linq [on hold]

suppose i have the following collection IEnumerable<car> cars = new IEnumerable<car>(); now I need to loop on this collection. I need to do some ...
1
vote
0answers
11 views

Automapper - Mapping a nested collection to a list

I'm using Automapper to do some mapping from XSD-generated serialization object to more sane POCO's. I'm having an issue with a particular type of mapping. ...
0
votes
0answers
14 views

Signature verifier for a javascript/node.js function

I wrote a function that verifies the arguments against an expected set of arguments. test('hello', 'world'); ...
2
votes
1answer
17 views

Basic myVector class raw vs smart pointer

I'm writing a myVector class for a class I'm taking. I don't believe I'm "strong" with smart pointers right now, so that's my question. This is just an excerpt ...
1
vote
0answers
9 views

Django Model field naming convention for lookup tables

I'm currently in the process of refactoring a Django app to use Django REST Framework. Within the existing code there are 15 models for lookup tables. The structure of each model is as follows (using ...
-2
votes
0answers
10 views

output of puppet facts are not displaying when concatenating the facts [on hold]

I have puppet facts and those facts are displaying individually. But when i am concatenating the facts, the output is not displaying Here is my code: l ...
3
votes
0answers
17 views

Security of login and register system

I need some help with my register/login functions. I'm not sure if I understood bcrypt correctly either. Is this good or do I have to do any changes? Did I miss ...
5
votes
6answers
255 views

Displaying a letter grade based on a percentage

Here is a class I made that is able to ask a teacher what percentage their student has in a class and gives them back a grade. The code is very repetitive and I am wondering what I can do to simplify ...
2
votes
2answers
33 views

First time making an AVL Tree

I have made an AVL Tree. It works and does what it needs to do. I only need it to insert and search. I am comparing how long it takes to load and search a dictionary file in relation to other various ...
2
votes
1answer
49 views

Game of Life with exceptional Neighbours

As it currently stands the code works fine. Is there a way to optimize the code in the class Neighbours? What I have done was to copy the code for each of the ...
0
votes
1answer
17 views

Screen timeout/lock script

This is a script I made while having trouble with xautolock and dimming of the screen right before locking it. I would like some tips for making it a bit more robust and to know of any disadvantages ...
2
votes
2answers
149 views
1
vote
0answers
14 views

Asynchronously wait for a task to complete and do some async action while waiting

I have a long-running task. My goal is to create a method that will allow me to: Asynchronously wait for this task to complete While waiting on a task, do some async action once in a while. This ...
4
votes
0answers
16 views

Access function to return “number of working days until date” for form

I need a function I can put on a form which does: Calculates number of working days until a given date Excludes weekends Excludes any dates in a "holiday" table This is replacing something which ...
4
votes
3answers
80 views

Append a string to each line in a file

I wrote (several months ago) a program that will take an input file, with a provided std::string, and append that to each individual line in the file. Looking at ...
0
votes
0answers
21 views

Managing content in a database/file structure [on hold]

Right now I'm writing a program that helps manage content in a database/file structure. I have extended the Treeview control to allow it to do specific things I want to do in the program. At this ...
0
votes
0answers
11 views

Live update calendar

I've made a calendar using a Firebase database so that it live updates. I'm pretty happy with it but I feel like restructuring it to fit the MVC design pattern, however, I've never done anything in ...
1
vote
1answer
27 views

Best practice of HTML DOM template in javascript

Of course the when this select is comes with less options it will be better to leave it like this, and when it comes more then this it better to make it via loop. The question is that if I should make ...
2
votes
0answers
28 views

“Table Data Gateway” pattern

Using the table data gateway (TDG) pattern, I created a class QuestionGateway for retrieving, adding, updating, deleting, and sorting multiple-choice questions. ...
2
votes
1answer
32 views

Prints out to stdout all possible combination of printable ASCII 7-bit characters

This takes over 60 minutes to execute. The program is small in size, about 16kb. I am thinking that the repeated calls to printf slows it down significantly, rather ...
1
vote
2answers
41 views

Vector/matrix class

Some definitions: ...
0
votes
0answers
6 views

Simplify XML parsing using HXT

Here is code that will output maven coordinates from given pom.xml file. How can I remove boilerplate (possibly convert it to xml picklers)? ...
3
votes
1answer
22 views

Responsive Navigation

The following responsive navigation on JSfiddle works well, however I am just wondering whether there is any way to improve what I have done. I am new at JQuery so all help appreciated: JSFiddle here ...
2
votes
1answer
18 views

Subclass SKSpriteNode

I decided to subclass SKSpriteNode for a game test in Swift today and soon realised that it was not as simple as my Objective-C background suggested. After a little ...
1
vote
0answers
23 views

Breaking up a PHP class between a master class and subclasses

I have a huge class taking care of companies informations in my app. Arrived at 4000 lines of code (!), I finally decided to break it up. However I am not too sure if the way I am doing this is the ...
1
vote
0answers
15 views

Camel Case strings in XSLT

I have a situation where I am receiving data from a web service and the data is in all caps. I have to convert to HTML and format for display. In this case, we need the string to be normalized. The ...
0
votes
0answers
32 views

Reading, processing, writing a text file in C

The processing is the following: The program first will open a text file caled xxx_big.txt (see The text file) The program will create an array with the size of N and will put all the values from ...
3
votes
1answer
19 views

Speed up script that calculates distribution of every character from user input

I have a data set with close to 6 million rows of user input. Specifically, users were supposed to type in their email addresses, but because there was not pattern validation put in place we have a ...
0
votes
1answer
38 views

Class for finding the median of a two-dimensional space

I have a simple static class that it's purpose is given an RDD of Point to find the median of each dimension and return that as a new ...
0
votes
1answer
24 views

Form submit using POST handled in PHP

I have this code working for submitting a form using PHP and HTML (Bootstrap). I did not post the CSS, so I hope this is not an issue. I am interested if this code is clean, following good practices, ...
2
votes
0answers
18 views

Ruby object oriented Snakes and Ladders implementation

I'm not a beginner to programming, but I am to programming in OOP (effectively at least). So to learn better I wrote an object oriented game of Snakes and Ladders. For background, see this question. ...
-1
votes
0answers
20 views

Linked List in Python [on hold]

I currently have a functioning piece of coding that correctly works using a linked list in Python. I am currently trying to error proof the code so that if the user selects number 3 on the menu the ...
5
votes
1answer
41 views

Simplifications to Miller Columns

Background Unsatisfied with existing implementations of Miller Columns (used to edit hierarchical data), I decided to re-invent the wheel. Problem Most of the existing implementations are too ...
1
vote
1answer
27 views

Batch file to copy specific folders

This is the batch file i have created which copy the specific folders which I want. I use the specific server folder name of which I want to copy. Please suggest any improvements. ...

15 30 50 per page