1
vote
0answers
31 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 ...
2
votes
1answer
69 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
votes
0answers
22 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, ...
1
vote
2answers
57 views

Resolve dependencies using before-after constraints

What i would like to do is the following. (Not sure if this question should go to StackOverflow, or here) Consider a datastructure like this: interface IAction { IAction[] afterActions() ...
0
votes
0answers
21 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 ...
1
vote
2answers
48 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 ...
1
vote
1answer
44 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 ...
0
votes
1answer
42 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 ...
-2
votes
2answers
91 views

which is a better practice one method that does everything or a series of different methods?

I'm working with asp.net and c# Lets say I have a bunch of drop-downs and I want to bind data from a database, is it better to make a master-bind method that loops each one and gets the parameters to ...
0
votes
1answer
62 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 ...
-2
votes
0answers
15 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 ...
-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
1answer
81 views

Proper way to refactor multiple if based conditions [duplicate]

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
0answers
16 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 ...
0
votes
1answer
88 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
vote
3answers
31 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 ...
4
votes
1answer
257 views

Small code, big test

I have this code in a controller of an MVC implementation: public void execute() { try { String path = userSelectsFile(); if ( path == null ) return; //Just returns ...
0
votes
0answers
18 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. ...
11
votes
2answers
2k views

Is this a good pattern: replacing a long function with a series of lambdas?

I recently run into the following situation. class A{ public: void calculate(T inputs); } Firstly, A represents an object in the physical world, which is a strong argument for not splitting the ...
0
votes
0answers
65 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 ...
-1
votes
1answer
63 views

How to create user defined conditional statements in c? [on hold]

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 ...
1
vote
1answer
160 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 ...
3
votes
2answers
134 views

Will destructing a large list overflow my stack?

Consider the following singly linked list implementation: struct node { std::unique_ptr<node> next; ComplicatedDestructorClass data; } Now, suppose I stop using some ...
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; ...
-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 ...
0
votes
1answer
42 views

Database properties as Interface Constants in PHP [on hold]

I bought a PHP Design Patterns book, and the author uses constants to hold connection attributes: interface IConnectInfo { const HOST = "localhost"; const UNAME = "root"; const PW = ...
-1
votes
3answers
133 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?
1
vote
1answer
64 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 ...
2
votes
1answer
170 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 ...
-2
votes
0answers
24 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
2answers
139 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 ...
1
vote
1answer
56 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. ...
1
vote
1answer
56 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 ...
1
vote
3answers
97 views

Single instance of windows service querying multiple databases

My current situation is that we have four instances of a single windows service running on the server, for production, demo, QA and dev. I am looking for a solution where I just need to run single ...
0
votes
0answers
30 views

What's the best practice for adding a lot of attributes to a Rails model?

So, I'm building an API wrapper gem that works with Spree's Product model. The API provides extensive customization of the data you send to it. I would like a user of the gem to be able to take ...
-2
votes
0answers
100 views

Has anyone ever attemteped to create a “programming” language for legal English? [on hold]

Just a thought I reckoned was worth asking about: since legal languages have to be unambiguous, maybe someone had the idea to try and make a “programming” language for it before — be it in a form of a ...
-1
votes
0answers
48 views

Is partial application of functions the corresponding technique for state saving objects?

Imagine we have Converter object which is responsible for converting Strings in different ways, e.g. with convertingMethod1 and convertingMethod2. As the Converter depends on some context, it also ...
4
votes
3answers
96 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, ...
0
votes
0answers
20 views

Unified Driver model for low speed and high speed microcontrollers with limited and good memory [on hold]

I am trying to develop an experimental RTOS. I am stuck in the driver layer design. I want to make the driver layer libraries friendly for the other layers but then again I would like to have high ...
0
votes
1answer
113 views

Is brevity in writing code beneficial when it requires using language constructs in a strange way [duplicate]

In C#, with extension methods, you can replace this line of code: TimeSpan interval = TimeSpan.FromMinutes(4); with this one: TimeSpan interval = 4.Minutes(); Extension method being: public ...
-1
votes
0answers
33 views

What do you call objects returned by an API, and what “layer” do they reside on? [on hold]

When building a class library with a public API, I often have a static interface with methods or properties that return objects, and sometimes the methods will even take objects as arguments. What is ...
2
votes
1answer
42 views

Releasing libraries used in a commercial application as GPL [duplicate]

While I was at university I developed some PHP libraries which I intended for personal use. I used them in a few personal projects. When I joined my current job we created a commercial product which ...
-1
votes
1answer
197 views

All my applications end up becoming “hacky”. Does it mean I'm not fit to be a programmer? [on hold]

Everything starts nice in the beginning. The code is simple. Beautiful. Like haiku. It follows all the coding and design patterns. But then, as the application grows, it starts filling out with ...
-2
votes
2answers
100 views

haskell - are tuples defined recursively?

Are n-tuples defined recursively in terms of 2-tuples, for example, are (a,b,c) and (a,(b,c)) the same? If not, what's the rationale behind it?
20
votes
11answers
5k views

Is the 'finally' portion of a 'try … catch … finally' construct even necessary? [duplicate]

Some languages (such as C++ and early versions of PHP) don't support the finally part of a try ... catch ... finally construct. Is finally ever necessary? Because the code in it always runs, why ...
2
votes
5answers
694 views

Is it possible to make some methods invisible/non-usable to some classes in Java?

I am developing an application in Java whereby I would like to pass an object as part of an interface into other methods of classes written by other developers in the team. The object I'm passing in ...
2
votes
3answers
49 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 ...
-1
votes
0answers
40 views

GPL software distribution [duplicate]

I am using a source code(module) which is licensed under GPL with a program that I am planning to sell. I already know that it is legal to "redistribute a GPL licensed software for a fee". But, here ...
-2
votes
3answers
102 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. ...
1
vote
1answer
68 views

Using conditional feature compilation/inclusion for release versioning

I have been playing with the following idea: commonly when different release series (1.0.x, 1.1.x, development code) of a product are maintained in parallel one uses different branches within a ...

15 30 50 per page