0
votes
1answer
60 views

Cleanly using PHP Iterator class in Loops - calling first element

I have implemented the Iterator class in PHP and built the follow mandatory methods as follows class I implements Iterator { private $a = []; function __construct(array $a) { ...
-1
votes
1answer
54 views

How to create a folder in a program's own directory, and create folders in the folders? [on hold]

I need my program to be able to create sixteen folders in its root directory where the .exe file is (Windows), and I need each folder to have preceding folders inside that contain more information, ...
-3
votes
0answers
42 views

A way to generate a text file with the name of every game installed in a computer [on hold]

I would like to make an aplication with Visual Studio that, upon start, explore every file in the user's computer looking for games and store them in a database. With that database, we create the user ...
1
vote
4answers
138 views

When to make a method part of an interface or a concrete implementation?

I create an interface for database access to a MySQL database. Currently, this is the only way to access day, but to make it easier to test and in the event that the data access might change, I used ...
-2
votes
0answers
29 views

Protecting clients interests when using offshore developers [on hold]

I'm planning to outsource some work for development using parse.com. Since I Want to protect my clients interest how can I ensure that their offshore developers don't have access to production data? ...
0
votes
0answers
4 views

Java j2ee JSTL cannot print a list of objetcs [migrated]

i'm currently working on a small Java J2E project. I want to print a list of objects in a *.jsp page, but there's an error i can't seem to get rid of. My .jsp page : <%@ page language="java" ...
2
votes
1answer
93 views

What happens when one reaches their framework's maximum requests per second?

I've been dabbling in code for many years now but it's always been personal projects. I don't have experience with much traffic. I was recently reading through a "Hello, World." tutorial for ...
1
vote
2answers
256 views

Workaround for unit testing Core Data in Swift

I am still pretty new to programming, but my first app was recently approved and is now for sale on the App Store. My app uses Core Data and is written in Swift. After some initial difficulties, I ...
1
vote
1answer
120 views

Should I modify an algorithm I coded for my employer if I remember the code perfectly and want to reuse?

My employer asked me to code a simple algorithm from a general description published by someone on the Internet (no code/pseudocode, just plain words and pictures). So to clarify, it's not my ...
1
vote
2answers
90 views

C# Subject Observer Architecture question

I'm making a C# application using the Subject Observer design pattern in a slightly different way. I am passing the Provider Class, implementing IObservable (this has the OnNext() method that ...
0
votes
1answer
45 views

Send request from a computer, wait for response from another, then trigger an action on both, with PHP [on hold]

I have a website project that is planned to work as the following: User #1, who is registered on the site, sends an invitation for some activity (whichever activity, like playing a game, etc.) to ...
0
votes
1answer
43 views

How Do I Securely Edit a Database Entry Based On ID in an Admin System?

This is more of a conceptual question because the way that I am doing it would be secure enough for my purposes (educational). I created a simple admin panel that displays a stock picks database as ...
42
votes
9answers
4k views

What are the safety benefits of a type system?

In JavaScript: The Good Parts by Douglas Crockford, he mentions in his inheritance chapter, The other benefit of classical inheritance is that it includes the specification of a system of types. ...
-3
votes
0answers
47 views

Generate random numbers in java…! [on hold]

I'm writing a code for a command line game in which I want to shuffle numbers randomly. i created 3 different functions. Each function generates a number different from other. and those 3 functions ...
-1
votes
0answers
26 views

MatLab floating point comparison [migrated]

I am trying to understand the while statement in MatLab so this is what I did: i=0; while i<=20 disp(i) i=i+1; end and as I expected, MatLab displayed numbers 0-20. However with this one: ...
1
vote
2answers
151 views

Sharing code logic between controllers, through the Model layer?

As I originally conceived my Model layer, it was only supposed to hold data and no code. I receive DTOs from web-services, they are mapped into my Model objects. Those model objects usually end up ...
-3
votes
0answers
30 views

Javacript File Inclusion Not working [on hold]

I have followed this thread: What is the best way to include JavaScript file using script tag? and used the following code in my php file. <script language="javascript" type="text/javascript" ...
-3
votes
0answers
30 views

Looking for a book about making interpreters, with lexers and parsers [on hold]

I'm looking for a short(200-300 pages) book about making a programming language interpreter with tools, for example lex and yacc. It doesn't matter what programming language is it in.
0
votes
2answers
82 views

forking but not exiting

It is normal for the child in a fork() to call exec() or _exit(). Are there any realistic scenarios where the child might return from the function that called fork() instead? void foo() { pid_t ...
-3
votes
0answers
47 views

Dropdown search function in WPF/C#? [on hold]

Is there anyway to implement dropdown (Combo box) search function in WPF/C# ? I want to implement search function similar to facebook. When I type a word or sentence similar records should appear in ...
0
votes
2answers
425 views

Is factory pattern a right pattern for the situation described here?

Is factory pattern a right pattern when we want to consolidate the related objects? Problem - In the Set-top box, I have a user-io, basically the interface to control the settop box - The user-io can ...
-2
votes
0answers
14 views

Java Robot class highlighting text help [migrated]

I'm trying to write a program that copies text from TinyChat(https://tinychat.com) and copies it to the clip board. Eventually it will take everything said in chat and paste it in Skype. Every message ...
-2
votes
0answers
67 views

JavaScript prototype chain probable infinite cycle lookup [migrated]

I have a query regarding JavaScript object prototype chains. Suppose I create an Object var first = { a: 1};var second = Object.create(first); Now I know that if I look up for the attribute a on ...
-2
votes
0answers
16 views

How to retrieve a single user data that is owned by the user who log in using session in CodeIgniter? [on hold]

I'm new to CodeIgniter. My problem with my code is that, when a user logged in to his/her account, he can't view his/her details, instead, the detail of the first row from the table where I fetched ...
-5
votes
0answers
24 views

Android project development [on hold]

I'm expected to develop an android app as my computer science project.i want to create a an app that users register then login, and receive pregnancy information for each stage of the pregnancy on the ...
0
votes
0answers
79 views

Domain Driven Design - designing Aggregate Roots

Imagine you're designing an application for organazing Workshops. Workshop itself is quite complicated - it acts as a state machine with multiple possible states and transitions between them. We're ...
0
votes
1answer
35 views

Authenticating users across multiple web services

User details (name, address, etc) are stored across multiple sites that are vendor specific. For example, vendor A holds information concerning room bookings while vendor B holds information specific ...
-4
votes
1answer
33 views

How can i clear ViewState property using jquery? [on hold]

How can i set ViewState["Drivers"] to null using jQuery in ASP.NET ? ViewState["Drivers"]= null;
1
vote
1answer
252 views

Merge two different API calls into One

I have two different apps in my django project. One is "comment" and an other one is "files". A comment might save some file attached to it. The current way of creating a comment with attachments is ...
0
votes
1answer
54 views

Vector API, naming for element-wise multiply [on hold]

I'm helping develop a 3D Vector class, which has common operations such as: v = v1.cross(v2) v = v1 * v2 - infix multiply for dot product. v = v1 + v2 - infix addition. v = v1.slerp(v2) - spherical ...
2
votes
1answer
411 views

Capturing mobile device system (output) audio

I'm trying to figure out a way to capture the system audio of an Android and/or Windows Phone. The idea is to provide a stream based on the music I'm currently playing on my phone. What I'm not sure ...
1
vote
3answers
487 views

can you have too many dto/bo - mapping method

I have a windows service, 2 web services and a web interface that need to follow the same path (data wise). So I came up with two ways of creating my solution. My concern is the fact that the ...
38
votes
3answers
28k views

What are the real life implications for an Apache 2 license?

I want to use SVG Edit for project. This software is distributed under the Apache 2 license. I've seen that: all copies, modified or unmodified, are accompanied by a copy of the licence all ...
26
votes
4answers
3k views

Dynamic Code Evaluation in Java - Clever or Sloppy?

I am trying to create a flexible ACL framework in Java for my application. Many ACL frameworks are built on a whitelist of rules, where a rule is in the form of owner:action:resource. For example, ...
1
vote
2answers
86 views

Creating entities with validated Addresses via REST API

I am building a REST service. This services enables the user to create an entity that has an Address. For simplification, let say this other entity is 'House', so 'A House has an Address'. The system ...
-4
votes
0answers
22 views

MatchString Theory [on hold]

I am comparing one companies information to another For each row of data I have a match string. The string of 11 letters can either be A, B, F, Z. example AAABAZBFAZB A= Same (Highest Weight) B= ...
0
votes
2answers
80 views

Selecting between multiple actions in PHP

I have been programming for a number of years now and in PHP for about 4 of those years. I have always wondered what is the best approach when it comes your program deciding what action to take based ...
0
votes
2answers
27 views

SQL - for some attributes specific to different clients' users, how to handle schema?

I have clients, each of whom have an app with a bunch of users. Their user data could be pretty different, but there is also a lot of overlap. Ex: all their users have "gender" and "age" and plenty ...
0
votes
3answers
133 views

How specific is too specific with css selectors?

The way that I like to write scss gives way to very specific selectors (code sample is under). Is this a bad thing? Are there any performance or reusability issues that I should consider? ...
0
votes
1answer
74 views

Setting and getting values from a x-y graph

I have a bunch of x-y graphs given to me and I need to be able to transform them into some kind of data structure from which I will be able to get Y with X value. The problem is, though that I have 4, ...
-1
votes
1answer
35 views

Should I avoid JSPs for new Spring MVC applications? [on hold]

I have seen many posts around the Web saying JSPs are deprecated, old way of doing things, etc. I have to say personally I don't care for them too much. The best setup I had using JSPs was with Apache ...
1
vote
1answer
208 views

How would a compiler turn an else-if cascade into a switch?

I don't like switch in C and its descendants. Maybe it's the need for a break or the clumsiness of the syntax requiring a shifting of mental gears, I don't know. Whatever the reason, I will almost ...
2
votes
2answers
137 views

Abstract classes and constants

I have two classes that share a lot of code and are conceptually variations on a common class. So I want an abstract class that contains all their common code and then they can each inherit from it ...
2
votes
0answers
102 views

Rails: get data about a model collection, with new model or method?

I have a model Product with attributes sales and views. I need to get sales/views count of all the products. Is more correct to implement this as a method and have a call like Product.all.sales or ...
0
votes
1answer
84 views

Should I initialize a member variable in declaration when it is initialized by a constructor parameter?

Which is recommended for initialization of class fields in C#: class Foo { public X x = new X(); // or any default value... public Foo(X _x) { x = _x; } } Or class Foo { ...
2
votes
1answer
1k views

How should I structure modules in an Angular.js application?

I am fairly new to Angular.js, and one that confuses me is how to best use modules in an application. It seems to me that modules can contain any of the other common constructs in AngularJS ...
0
votes
0answers
47 views

Does COM still have value for Windows interop nowadays? [on hold]

WCF is a great technology, but I believe it works slower than COM, since it's managed code and it uses additional intermediate layers. I didn't check performance though. DirectX interfaces are still ...
2
votes
1answer
57 views

Is it redundant and unnecessary to do file backups of a repository that has a remote repo?

Is it redundant and unnecessary to periodically backup the files in a Git repo, that also has a remote repo? My understanding is all repositories are full backups. So an individual developer with a ...
2
votes
2answers
101 views

When to use ANTLR and when to use a parsing library

I've always wanted to learn how to write a compiler - I've decided to use ANTLR, and am currently reading through the book (its very good by the way) I'm pretty new to this, so go easy, but the jist ...
3
votes
1answer
187 views

Tracing an object

Suppose I want an object with a list of strings and every method that this object gets passed to adds its name to the list of strings. Basically it's a stack trace, except unlike a stack trace it ...

15 30 50 per page