0
votes
0answers
24 views

How to convert multiple query to use parameters to avoid SQL injection

I have some dropdownlist in my aspx page and I am using the choices from them in my SQL query: ...
0
votes
0answers
2 views

Simple class container for hdf5 files

I implemented a simple class container for hdf5 files in matlab. The situation is as follows. Measurement data is safed in hdf5 ...
0
votes
1answer
10 views

How do i optimize my program?

The problem is : http://opc.iarcs.org.in/index.php/problems/ENDCORR Here is the code that I wrote for it: ...
3
votes
2answers
34 views

Australian income tax calculator

I'm looking for some feedback on my first Javascript app. I've build an app that calculates tax for Australian tax payers. Would be great if someone could have a look over the code that I have ...
0
votes
0answers
6 views

Techniques to optimize this stored proc to generate a sales report?

I need to optimize the following stored proc. Please let me know of any techniques or modifications that I can make to optimize this piece of code. The procedure is for a report that needs to run ...
3
votes
1answer
87 views

How to simplify this if else statement?

Question How would you simplify/improve the readability of this code? Because even after my attempt to improve the readability I think it still looks messy. ...
1
vote
1answer
13 views

Service class that handles form validations

I've made a (service) class to handle all form validation of my application. It contains a set of frequently used validation callables extracted into private methods that I use to build each ...
2
votes
1answer
18 views

Keeping UI code DRY in iOS projects

I've subclassed UI button and used it in my View Controller's viewDidLoad method, like so: ...
0
votes
0answers
13 views

Possible cross site scripting vulnerability caused by url_with_protocol

I used pullreview to review my project. It came back with a security concern ( Possible cross site scripting vulnerability) on this line: ...
0
votes
0answers
10 views

Refactoring a multi-thread asynchronous application [on hold]

I'm trying to refactoring a multi-thread asynchronous application. I have a class the every time that the application launch particular event(they are generate from external devices) it launch a new ...
4
votes
1answer
97 views

Cast a raw map to a generic map using a method, cleanly and safely in a fail early manner

Casting, instanceof, and @SuppressWarnings("unchecked") are noisy. It would be nice to stuff them down into a method where they won't need to be looked at. ...
0
votes
0answers
4 views

a view returns system.data.entity.dynamicproxies [on hold]

i beginn in asp.net Mvc. I want to return view of question with the answer. this is the answer table and question table I make a third class to join class with a exam. Now i want to return a view ...
0
votes
1answer
17 views

Possible memory issue in linked list program [on hold]

I am trying to write a program which will count the occurrence of words in a paragraph. The logic I am following : I am using a linked list for the purpose. And I am searching sequentially - if new ...
1
vote
1answer
65 views

Slow Python text-processing script

This script of mine merges columns 1 and 2 from one input file and sees if these merged combinations exist in the other infile (and vice versa). I know I get stuck in appending. It did not get past ...
3
votes
0answers
23 views

.htaccess index.php removal, static content serving

I am writing a CMS type application and I am trying to restrict how the server gets accessed. Any content (in js/, css/ or images/ directories) should be served as is, as long as there is an ...
2
votes
0answers
23 views

Knowing who is the user in every request (in every action and every view)

First: I have many model classes that are mapped from/to tables using EF. Two of them are User and UserCookie, which are stored ...
6
votes
1answer
23 views

Homebrew std::string for use with kernel

I've ported some standard library facilities like vector, algorithm, etc. to my kernel so I can code in C++ instead of C. This is one of them. I'm looking for concerns regarding: Performance Safety ...
7
votes
3answers
302 views

Checking for palindromes using dynamic memory allocation

This is a homework assignment, but it's already done and it's not for a grade; it's meant as a refresher for the rest of the course. I've never done anything with dynamic memory allocation in C ...
3
votes
3answers
64 views

Merge Sort Implementation in Java (that seems slow…)

I decided to write my own implementation of merge sort. Here is the code: ...
4
votes
2answers
325 views

Shutdown Delay Program

I wrote this program a while back that would allow me to set a delay, say 3 hours, and when the delay had expired, my PC would turn off. The purpose of it was so I didn't have to leave my PC on all ...
3
votes
1answer
21 views

Iterative Flood Fill implementation in C [on hold]

I am trying to implement an iterative version of flood fill in C: ...
5
votes
3answers
165 views

Classes for acquiring employee information

I'm looking for a review on the following classes and the comments I applied (class assignment): ...
8
votes
1answer
97 views
9
votes
2answers
739 views

Using large amounts of if-else statements for playing card numbers

I have a method that uses a bunch of if-else statements, and I am thinking how I could simplify it. ...
0
votes
0answers
24 views

Simple side menu with infinite sublevels

The following works almost as intended, I still haven't figured out a couple things: How to keep the active state (i.e. class="active" ) of all parents if ...
4
votes
1answer
45 views

A tiny switcher for arbitrary types in C++11

I was about to use the awful enum+map trick to switch on std::strings when I thought to see if I could let some variadic templates do the job for me and I started ...
5
votes
0answers
76 views

RAII Pattern for Downgradable ReadWriteLock

The example for downgrading ReentrantReadWriteLock in the Java documentation seems really unsafe when handling exceptions. I tried to write a simple class to simplify it. Do you see any cases where it ...
-4
votes
0answers
23 views

Connecting together multiple classes [on hold]

In my previous question I learned to divide one class into multiple classes. I divided them into a couple of classes, but it is not working! It just shows blank screen. Main : ...
-4
votes
0answers
33 views

Multiple yield returns in method [on hold]

I have this code : ...
1
vote
1answer
21 views

Refactor Coffee Script to fire on page load instead of change

I have a Rails app where I'm trying to select a list of facilities based on what region is selected in a form. So far, I've implemented group_collection_select to do this as well as a bit of ...
4
votes
0answers
10 views

Normalize Sparse Matrix along rows in C++ Eigen

I wrote a function to normalize sparse matrix along rows using C++ Eigen; however, I feel that it can be improved, and that I am not using some built in functions of Eigen. ...
5
votes
1answer
36 views

'Countdown' Numbers round - combine numbers arithmetically to reach a target

Countdown is a British gameshow where contestants compete in word and number challenges. During the numbers round, six numbers are chosen semi-randomly and the task is to combine them using addition, ...
8
votes
1answer
128 views

Multiple MySQL select statements

I'm making a web application for a restaurant kind of type. The idea is to administrate the orders and customers. For selecting one of the orders and showing more specific data about it, i've got ...
2
votes
0answers
30 views

How to get functional common lisp code for handling state in a sdl animation?

The following code draws a red rectangle going up and down on a white display. I'm not particularly happy about the (setf speed (if (or.. part: ...
-3
votes
0answers
21 views

Find difference between to window forms [on hold]

I have this two xml files which are identical in structure and the code for parsing one is here: ...
3
votes
1answer
53 views

TaggedLogger - Log wrapper

I wrote this class in order to not having to write tag every time (because of code duplication and risk of typos). ...
4
votes
3answers
522 views

Most basic HTML website - naming and CSS rules

I'm trying to accomplish something very simple as seen here. HTML ...
6
votes
2answers
281 views

MD5 shuffling with a defined pattern of numbers

I've created a MD5 shuffler with a defined number pattern. Does this make sense? Will this make storing passwords more secure? Is it efficient? ...
2
votes
0answers
19 views

Detecting connected acyclic through Tarjan strongly connected components variant

I want to verify that a given directed graph is connected and acyclic (DAG). I have implemented a modification of the Tarjan's strongly connected components algorithm in imperative style (as the ...
3
votes
1answer
39 views

Database and file backup script

I created a Backup class because I couldn't find one that worked well on Windows and remotely, to do this I have combined a lot of questions on stackoverflow with a lot of trial and error to get it to ...
8
votes
1answer
47 views

Labor percentage and wages from clock in/out and sales records

I'm developing a PHP function for calculating labor percentage (labor cost/sales) accounting for daily and weekly overtime rules, if applicable, based on the payroll period; the wages for each ...
6
votes
4answers
395 views

Binary Search Tree C++ Implementation

I've implemented a simple binary search tree for practice purposes: ...
3
votes
2answers
47 views

Hamiltonian Monte Carlo in Scala

I'm writing a program in Scala to perform Hamiltonian Monte Carlo (HMC), coupled with Gibbs sampling of some variables. The algorithm, with the modifications such as perturbing epsilon and l and ...
-5
votes
0answers
20 views

OutOfMemory error even though Large bitmaps are handled efficiently [on hold]

I'm developing a tour guide application. I'm using a flipper view for images. I have decoded bitmaps. But it still gives the outofmemoryError. Please help me with this. Thanks in advance 09-01 ...
0
votes
0answers
6 views

Redundancy caused by polymorphism [migrated]

I have two chat rooms, one has administration behaviour, and one doesn't. I have factored out all of the common code into a base chat room, but the ...
4
votes
1answer
118 views

Detecting properly nested parenthesis using functional programming

So I have this code that is my attempt at a coding test from Codility. While my code produces correct results according to the requirements, (which unfortunately are copyrighted so I don't think I can ...
3
votes
0answers
18 views

RESTful API for Todos using Hapi

My goal is to create a simple restful api that will be accessed by an AngularJS front end. Even though it's fairly simple, I'd like understand how to make it more reliable, secure, and best-practices ...
3
votes
2answers
57 views

Cycling time trials

It would be helpful to know where I could improve the style of it, so it follows the style guide better, and also any ways I could compact it - especially at the end, where I have added items to a ...
2
votes
2answers
75 views

Are my one-method (and a couple attribute) classes overkill?

I saw a talk by Jack Diederich a few weeks ago titled "Stop Writing Classes" and noticed that some of my code perhaps echoes what he argues against (to the effect of "classes with two methods, one of ...

15 30 50 per page