-1
votes
2answers
15 views

Finding the sum of columns in a Two Dimensional Array with rows of different lengths

So i'm having a bit of trouble with my code in returning the sum of the columns in a two dimensional array with rows of different lengths. For example a 2X2 array works perfectly to calculate the sum ...
-3
votes
0answers
8 views

Including trail period and paid version in the software

I am have few questions about the software launch I have built my software using Java, and Converted it to .exe setup using Excelsior. I want to include trail period/paid version in my software, ...
-4
votes
0answers
34 views

Mermaid problem (OOP) [on hold]

A Mermaid is half fish and half human. It has upper human body and lower fish body. When under water its upper part swims like a human while its lower part swims like a fish. Please explain how can it ...
2
votes
1answer
53 views

Should I consider uncertain future requirement while development?

I have one text box across multiple pages which is used to enter multiple customerids (as comma separated) . But in current page due to some subsequent implementation difficulties we make it as ...
0
votes
0answers
20 views

Lag problem for a simple game in Java on Linux [on hold]

I am using Ubuntu 14.04 and openjdk-7.I am working with Eclipse. I made a snake game in java on Ubuntu but there is a lag problem with the game.The lag is happening in openjdk-7 on Ubuntu 14.04 and ...
0
votes
0answers
20 views

How can I avoid an SDK requirement for an end-user unless he uses a specific function? C#

One of the modes of my program uses Microsoft Kinect but the user may never decide use that mode. I want to make it so the libraries for that functionality are only looked for and loaded if he uses ...
1
vote
3answers
205 views

Object creation: when should I expose a factory vs wrapping class?

I am having some problems trying to figure out when to use a factory or to wrapper class. This question is slightly geared towards C# I guess, so I'm not sure if this is the correct place to ask. Say ...
38
votes
3answers
3k views

When should I use event-based programming?

I have been passing callbacks or just triggering the functions from other function in my programs to make things happen once tasks complete. When something finishes, I trigger the function directly: ...
1
vote
1answer
25 views

In C++, should I ever declare a local variable in the corresponding header?

So for example, I create a class with two functions: foo.h class foo { public: foo(); void bar(); void ey(); bool m_memberBool; bool localBool; // ??? Should I put this here? }; ...
-4
votes
0answers
20 views

please Correct For Loop Design [migrated]

class aaaaa { public static void main(String[] args) { for (int i = 0; i <= 10; i++) { for (int k = 10; k < i; k++) { System.out.print(" "); } for (int j = 100; ...
1
vote
1answer
128 views

Generics in C# Test Class

I'm learning about unit testing in C#. Languages_Service and PlaceOfWork_Service are classes for SOAP services which Microsoft Navision generated for me. There are several methods that are very ...
32
votes
6answers
12k views

Why is there no 'finally' construct in C++?

Exception handling in C++ is limited to try/throw/catch. Unlike Object Pascal, Java, C# and Python, even in C++ 11, the finally construct has not been implemented. I have seen an awful lot of C++ ...
-1
votes
1answer
30 views

One symbol - one meaning?

It's well known recomendations that: 1) class or function should have one responsibility 2) variable should not be reused in different contexts We can generalize this recomendations to general ...
-1
votes
0answers
9 views

Best way to populate Entity from posted ViewModel in ASPNET MVC?

In form post, I am used to accept a viewmodel in post action method. One way or another, I have to go through each property to assign it to the entity object that the repository module is expecting. ...
0
votes
1answer
126 views

Laravel relationships and database schema

I am playing around with Laravel and came across something in the documentation for defining 1 to 1 relationships between tables that I would like to get feedback on. The example in the docs is ...
-3
votes
0answers
17 views

Web Services Android [on hold]

Android Web Service 1.I want to write a program that data is stored on the server and other users can read the data. I have to write server database with php ,so that I save multiple fields or from ...
5
votes
7answers
2k views

Why have many programmers moved to using exception handling for input or output? [on hold]

Why have many programmers moved to using exception handling for input or output? For these programmers, what is the motivation behind this decision?
0
votes
0answers
25 views

“Python interpreter vs Javascript engine” memory model

I learnt that memory model of python interpreter is dictionaries of dictionaries, where each module is a dictionary. Let me elaborate more on this with an example, After i run >>> python ...
6
votes
7answers
467 views

provability of while loop vs for loop

I have this teacher, he's quite smart (sometimes, haha) he said good programmers try to use while loops instead of for loops. the reason he gave for this is because while loops can be proven, as in, ...
1
vote
1answer
42 views

Why go uses Marshal and Unmarshal for the json encode/decode functions? [on hold]

Go uses Marshal and Unmarshal to encode/decode json. Any idea why encode/decode is not used? It seems more common to me.
-2
votes
0answers
10 views

Matlab, not enought input arguments

I have a matrix ab = [12 10] This my code, I want to make a pythagoras but it fail even to define the ab(1,1). function [x] = phyt(ab) x = ab(1,1) end It show error message like this : Error ...
0
votes
2answers
61 views

Average number of comparison for sort algorithms

I need to write different sort algorithms such as bubbleSort insertionSort selectionSort quickSort mergeSort And measure how many average comparison does each one for N number (averaging between ...
4
votes
6answers
293 views

Structuring Procedural vs OO code

I have spent the vast majority of my programming career using Java and very OO based C++. I am really interested in learning to think more procedurally, so I have been starting to do some practice ...
0
votes
1answer
22 views

Would Docker be the right answer for deployment on AWS?

I'm about to start a new large project (both frontend and backend software) with the standard dev -> staging -> production setup. I'm always having some trouble choosing the right setup when it comes ...
-1
votes
0answers
27 views

Graduated with an EE degree, would love some advice from the programming crowd [on hold]

I graduated in May with a BSEE. While completing my degree, I realized I found software applications much more interesting than the hardware counterpart. I decided after graduation that trying to ...
1
vote
1answer
24 views

Keeping lists of Objects, some with, some without inheritance

Let's say I have two classes, Foo and ExtendedFoo where ExtendedFoo inherits from Foo. Foo has a method .getValue() which returns a number, ExtendedFoo also has .increaseValue() which adds to the ...
-1
votes
0answers
11 views

Collision detection in JS html5 canvas

i'm trying to develop a game using HTML5 canvas with javascript and I am having problems detecting collisions without hard coding it using the (x,y) coordinates of the two objects. In my code based ...
-3
votes
0answers
35 views

Should I write the Server side program while creating a website? [on hold]

I want to create a website. I know html5 and css. I am still learning JavaScript. I found that these are used for client side, and now I have found that there is also server side which also needs ...
0
votes
0answers
40 views

what are the most important coding standards in c# [on hold]

I am a college student creating a C# program for the 3rd year project. In my project coding standard is a main concern. But I do not have a better understanding about C# coding standards to follow ...
6
votes
2answers
136 views

Role-based REST API?

I'm building a REST API for which several users with different roles will have access to the resources it contains. To keep the scope simple let's take the "student/teacher/class" domain: GET ...
1
vote
1answer
70 views

What is a simple, correct and secure way of executing code stored in database?, that is also sandboxed

Webhooks can be a very powerful thing when you try to automate or integrate software, however, handling their deployment in a controlled environment can suck in terms of security and deployment alone. ...
1
vote
2answers
100 views

Explanation of two of Lehman's Laws of Software Evolution

I have a hard time understanding #3 and #8 of Lehman's Laws of Software Evolution. The laws are: (1974) "Self Regulation" — E-type system evolution processes are self-regulating with the ...
0
votes
0answers
19 views

Software or method for tracing variable use in code with graphical documentation?

So I'm reverse engineering some contractor C++ code that was not documented. It was written by engineers/scientists, and I'm not a full time programmer myself either. I have already "started from ...
0
votes
1answer
27 views

Securing service calls

I have a ServiceCallContext object that must be passed in as the first parameter of any service call. I would like to put a User object on the context object but I know I can't force the caller to ...
0
votes
0answers
13 views

I have data how do I choose which files go within my test, cross validation and training sets?

I have data stored in a file structure as replicated below. I am using the data for a text classification system for each general category, and within each category I have different sources for my ...
0
votes
1answer
23 views

What is calendar time and execution time in terms of reliability testing?

What is calendar time and execution time in terms of reliability testing? My book is talking about the Musa Okumoto model and says that it uses calendar time and execution time. However googling and ...
0
votes
1answer
63 views

What is the better way of getting different outputs for two very simmilar related workflows

I have a very concrete scenario but I think it would be quite frequent. I'm trying to come up with a solution that it's "better" by better meaning more scalable, reusable and not smelly. I'm working ...
-3
votes
0answers
33 views

Where to create objects and how to make them communicate with each other

I'm pretty new to OOP and need some help. I read quite a lot tutorials and watched some youtube videos but most stuff is about a small problem and quite out of the context. My problem is the ...
6
votes
1answer
62 views

named arguments replaces the builder pattern

When using a language that supports named and optional arguments, does the builder pattern no longer have a practical use? Builder: new Builder(requiredA, ...
2
votes
0answers
24 views

When to use def in Groovy?

I have been developing in Groovy for a little while now and I'm wondering how often I should be using the dynamic casting def? A co-worker of mine believes we should use it always as it helps Groovy ...
2
votes
1answer
402 views

How many Angular Controllers and/or Directives is too many?

I'm building a large, editable data table with angular, and I'm trying to figure out what the best practice is. The table will be a couple of hundred rows, with a couple of dozen columns, so upwards ...
2
votes
3answers
871 views

Algorithmic problem: Picking Cards

The problem below appeared on the last Code Sprint 2 programming competition (it's over already). The base cases are clear, but developing an algorithm that solves all possible cases has been a ...
0
votes
2answers
307 views

Just in time prize winning algorithm [closed]

I'm building a contest where you can win prizes by opening boxes. Whatever the box is open, i just send a request to the server to test if the user won something. Since this contest is not a "Register ...
-1
votes
1answer
103 views

How to selecting Teams with Minimum Difference between Knowledge Levels

For the below challenge from a programming site, I am bit confused. Problem Statement: A Professor of Physics gave projects to the students of his class. The students have to form a team of two for ...
3
votes
1answer
28 views

Should I omit database and server communication (after initial response)?

I have a project that I'm working on where a user uploads a big file which gets parsed by the backend, and then returns the data back in a friendlier format. Now I'm wondering whether I actually need ...
0
votes
1answer
137 views

Estimed number of tries

Problem: The Oscar Committee wants to decide which person should get the best actor award among the given N actors.For that they decided to use a random function random_bit() which returns either 0 ...
0
votes
1answer
93 views

Calculating disk capacity and max data transfer rate of a hard drive?

I am learning about hard drive concepts and I came across this question: Suppose we have a 10000 RPM disk has 8 heads and 480 cylinders. It is divided into 120- cylinder zones with the cylinders in ...
-1
votes
1answer
189 views

Optimal movie schedule

Let's say Mr. A goes to cinema and he gets a movie schedule. There are N movies on the program today (1 < N < 50) and for every movie the time of the start and the time of the end are given in ...
7
votes
4answers
761 views

Apple eating problem

Player A and Player B play a game. On the middle of the table there is a pot full of N apples of different weights. Player A starts first and choose an apple and start eating it. Losing no time player ...
0
votes
6answers
394 views

Is String processing more complex than number processing in programming languages?

I feel that string processing is always more complex than Numbers or mathematical processing. Are our programming languages are designed this way that mathematical operations are pretty much straight ...

15 30 50 per page