2
votes
1answer
66 views

How to design database tables for a Factory class?

How can I design database table structure for a class that varies in its core parameters, when it is created by a factory method? I have a Factory like this: class ProductFactory { public ...
1
vote
2answers
46 views

GPLv3 + commercial license on the same project? [duplicate]

I'm trying to find a solution to publish my source as open source just for personal and no-profit use, and sell licenses for commercial use. I see Packery which uses GPLv3 for non commercial, and a ...
51
votes
7answers
33k views

Why use try … finally without a catch clause?

The classical way to program is with try ... catch. When is it appropriate to use try without catch? In Python the following appears legal and can make sense: try: #do work finally: #do ...
1
vote
1answer
40 views

PHP MVC Display many records - model logic

I bet this question has been asked already but I can't form my thought as you can see from the title, so I couldn't find anything. I am working with MVC for quite some time now and I'm pretty happy to ...
1
vote
0answers
21 views

Is there some structured format for drawing source control branching diagrams?

Everyone on my team draws branch diagrams differently, including how branches exit or reintegrate to the parent, how cherry-pick merges are shown, and a host of other aesthetic choices. Is there some ...
17
votes
7answers
2k views

What can one do to improve readability of math-oriented code in C#, Java, and similar? [closed]

As both a C programmer and a C# programmer, one of the things I don't like about C# is how verbose math functions are. Every time you would have to use a Sin, cosine, or power function for example, ...
0
votes
1answer
61 views

Is having a bi directional message queue a design smell?

I have an architecture with 1 backend server and multiple frontend servers. The frontend servers are connected in a bi-directional (web sockets) connection to clients so they can send messages to ...
1
vote
2answers
3k views

What is a best practice tier structure of a Java EE 6/7 application?

I was attempting to find a best practice for modeling the tiers in a Java EE application yesterday and couldn't come up with anything current. In the past, say java 1.4, it was four tiers: ...
-1
votes
0answers
18 views

PHP in_array or array_unique? [on hold]

What would be the best solution here? If there are less then a 100 items in $list? And what if there are more then a million? Example 1: <?php foreach($list as $item) { if(!in_array($item, ...
0
votes
3answers
27 views

Is using data generated using AGPL-v3 licensed code considered distribution?

I'm considering using parts of a GNU Affero General Public License v3 (GNU AGPL v3) licensed library in a commercial context, but we obviously can't afford to release our whole code-base. We would ...
0
votes
0answers
15 views

How Generate sequence diagram from xmi file

I know we can generate an xmi file from a sequence diagram, but for inverse, I want to know if we can generate a sequence diagram from a xmi file with any tool(ie write my own code as xmi file which ...
0
votes
1answer
37 views

WCF Project Structure & Maintainability

We are working on a medium scale WCF project configured to use per call instancing and wondering weather it's a good practice to create classes per service method to hold the business logic since each ...
28
votes
16answers
5k views

How to reduce the number of bugs when coding?

No one's perfect, and no matter what we do, we are going to produce code that has bugs in it from time to time. What are some methods/techniques for reducing the number of bugs you produce, both when ...
2
votes
1answer
81 views

Proper way to refactor multiple if based conditions

I took over a large legacy code base. It has a code like this: if ($route == 'login' || $route == 'logout' || $route == 'forgot-password') { return; } if ($loggedInUser == false && ...
0
votes
1answer
76 views

How shall I handle event loop exceptions?

What is the best practice for handling exceptions thrown from event handlers/listeners in a event loop? For example: class EventLoop { public: void start(); //create a thread which calls run(); ...
-1
votes
0answers
35 views

how to use MessageBox in C# , i tried to used its button parameter [migrated]

I try to write like this : MessageBox.Show("Request is Online process!", "callback ,tips",MessageBoxButton.OKCancel) .but it said there is no MessageBoxButton exist in the context .how can i solve ...
-2
votes
0answers
14 views

Build an updatable agent for inventory tool [on hold]

I've been looking for some pointers in how to build an agent that can be updated that would be used for an inventory tool. The fact is that we would like to create a custom tool to inventory our ...
0
votes
0answers
15 views

URI naming scheme for assets shared between Android app users

A feature of my Android application is to allow users to choose graphical assets from a gallery view. Each asset is physically defined by an individual JSON file on the file system. The application ...
21
votes
4answers
23k views

Is Python Interpreted or Compiled?

This is just a wondering I had while reading about interpreted and compiled languages. Ruby is no doubt an interpreted language, since source code is compiled by an interpreter at the point of ...
1
vote
2answers
133 views

Why does this implementation of Dijkstra's algorithm work in O(n^2)?

Here is the code I use for implementing Dijkstra's algorithm. Consider a graph with n vertices and m edges. Shouldn't it run in O(n^2 m) ? Someone may say that there are n vertices and each edge gets ...
0
votes
0answers
58 views

Best practices for programmatic describing of behavior of complex input forms

We have a complex web form (we use GWT/GXT stack) with lots of input elements of different types (text fields, selects, checkboxes, buttons), and behavior of these elements depends on each other. Now ...
0
votes
0answers
10 views

How to consume inconsistent REST API with Mongo DB backend?

We are using a third party REST API and we are building one of the pages on our ASP.NET site around the data it delivers. We get results in JSON, and interact with it mostly using .NET MongoDB Driver. ...
1
vote
1answer
152 views

Why does this algorithm work in O(n m)?

This is from a blog post on Codeforces. I couldn't really understand why the editorialist goes on to claim that this code works in O(n m) This is a graph problem, where we are supposed to find the ...
-1
votes
1answer
60 views

How to create user defined conditional statements in c?

I have two stacks s1 and s2 with numbers stored in them. I have a function(say comp) which compares the numerical values of s1 and s2. I want to know if it is possible to modify the function so that ...
0
votes
2answers
297 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 ...
1
vote
1answer
74 views

Data structure for traversing hierarchical hostnames

So, quite often I'll come across a situation where I'd like to process hostnames in a hierarchical manner. For example, given a hostname "foo.bar.baz.example.com", I might want to compare it against ...
12
votes
2answers
880 views

Are there well-known PowerShell coding conventions?

Are there any well-defined conventions when programming in PowerShell? For example, in scripts which are to be maintained long-term, do we need to: Use the real cmdlet name or alias? Specify the ...
-1
votes
0answers
55 views

Setting Default Parameters in C++ [migrated]

I have a little question about how default values are given to function parameters in C++. The problem I faced is probably due to my lack of understanding as to where the parameters are supposed to be ...
1
vote
1answer
232 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 ...
1
vote
1answer
61 views

Would one use a 2D Gaming Engine for a desktop application?

I am thinking about a library that I could use for a program to create presentations but I am not sure what one could/should use for a task like that. What first came to my mind are 2D Gaming Engines ...
28
votes
6answers
10k views

What causes floating point rounding errors?

I am aware that floating point arithmetic has precision problems. I usually overcome them by switching to a fixed decimal representation of the number, or simply by neglecting the error. However, I ...
-1
votes
3answers
123 views

Have you ever purposely memorized code, and was it useful? [on hold]

In school, we memorize the basics - the ABC's , the times-table, the capitals of states. Is there a place for memorization in Computer Science? Or is memorization just a waste of time?
2
votes
1answer
328 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 ...
0
votes
0answers
3 views

Initializing a pointer in struct in at minimum lines [migrated]

I'm currently new to C programming, and appreciate for any tip. Is there a shorter way to initialize struct pointers in C without removing the pointer tags? Thanks~ typedef struct { int x, y, z; ...
0
votes
2answers
430 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 ...
4
votes
3answers
93 views

Pattern for checking online service availability

I'm not sure that this is entirely on-topic, but I'll try to make it so. I have an online service (API) and an Android application that uses it for all actions in the app. At the current moment, ...
2
votes
1answer
155 views

Any reasons NOT to write self testing Python code?

Whilst writing tests I was giving considerable thought to the question of how to ensure I have tests for every class in my application. It occurred to me that maybe I should just put the test code ...
1
vote
2answers
67 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 ...
-2
votes
3answers
100 views

How to manage a large list of distinct numbers

I have a list of around 2 billion distinct numbers stored in memory for some computation. Currently, every time I need to add a new entry I have to search the entire list for a potential duplicate. ...
144
votes
3answers
40k views

Pros and Cons of Facebook's React vs. Web Components (Polymer)

What are the main benefits of Facebook's React over the upcoming Web Components spec and vice versa (or perhaps a more apples-to-apples comparison would be to Google's Polymer library)? According to ...
2
votes
3answers
48 views

Displaying copyright notice for OSS in closed source Android app

I am considering the usage of various open source libraries in a closed source Android app. The libraries are released under various licenses (MIT, BSD modern, Apache 2.0) which allow this kind of ...
5
votes
2answers
2k views

Visitor stability vs instanceof flexibility

I am working on a GUI application which generates a configuration file. I have a class hierarchy for the configuration model and I use an object tree of that hierarchy in several different contexts. ...
0
votes
0answers
17 views

Delphi XE with Firebird Database, Datasnap Driver, DataSnap Service vs other schemas when working with mobile apps [on hold]

I`ve found out that most of the time it is recommended to use this schema when connecting to a localhost server. Not necessarily Firebird as Database, but the Driver and the Service are always ...
2
votes
3answers
559 views

Why is it a good practice to keep Javascript code in separate files?

In web development we are commonly used to keep Javascript code in separate files, but sometimes we need this Javascript code to manipulate server side data locally. For example, making an Ajax Call ...
-1
votes
1answer
238 views

Best way to implement database design for a set of entities [on hold]

Lets say I have a scenario like so: I have many claims to get money from another entity and this claim has to go through two gateways. This claim is sent from an origin system and can possibly be ...
5
votes
3answers
840 views

Is it safe to install TortoiseSVN on production servers?

Small shop, few production servers, no test or development servers, all Win2k3 WEB based. There is a need to keep versioned files on one of the machines. Is TortoiseSVN safe against exploitability, ...
-2
votes
0answers
22 views

Good tutorial for Atmosphere? [on hold]

What is your favorite tutorial for Atmosphere framework (async-io.org)? It's not much fun (for me, at least) trying to glue together atmosphere-examples and bits of info scattered through atmosphere ...
1
vote
1answer
54 views

Allow user to enter DSL, rules or code?

I have a python library that allows me to define rules by chaining inputs and outputs of functions ( producer(grep(count( [print(),log() ] ))) This functions define a pipeline from left to right. ...
2
votes
3answers
5k views

What is the definition of user classes, with respect to software use?

I'm writing the Software Requirement Specification document for a piece of software that I am developing. A part of the SRS is the identification of the user class. Can somebody please give or refer ...
1
vote
1answer
55 views

Garbage collection & memory leaks on hash tables

I was reading R. Read's How to be a programmer, and I came accross something I didn't understand: ...even with garbage collection, you can fill up all memory with garbage. A classic mistake is ...

15 30 50 per page