-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
17 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
90 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 ...
5
votes
2answers
307 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. ...
12
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
66 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
135 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 [closed]

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
135 views

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

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
65 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
172 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
26 views

Good tutorial for Atmosphere? [closed]

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
100 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
101 views

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

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
98 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 [closed]

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
114 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
34 views

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

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
198 views

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

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
103 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
698 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
50 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 ...
0
votes
1answer
44 views

Dealing with error in data - Idempotent approach

A prior question had an answer that interested me from a design perspective. I work in geospatial data and occasionally have to deal with voids when I read these binary files into my product. What is ...
1
vote
0answers
40 views

Java MVC: multiple use of the same event for different actions

I am working on a large Java project which employs the model-view-controller pattern. Should I use a different event for each action (to let the views communicate with their respective controllers)? ...
0
votes
0answers
33 views

Authorizing view content

Let's say I have a view which should change it's content based on the user resp. on the users permission. After some research I basically found 2 types of authorization. Role-Based and Activity-Based ...
2
votes
1answer
176 views

Test driven development workflow for two programmers

We are currently starting with TDD and we want to work in parallel in two programmers - one for writing test (Programmer A) and one for writing actual code (Programmer B). Problem is, how to ...
1
vote
1answer
110 views

Design Pattern to parse array of objects

What is considered a good practice to parse an array of objects returned by an API? I am creating a RESTfull web service and a client which is meant to work with this service. One of my REST ...
-3
votes
0answers
43 views

Stack program in c issue [closed]

Hello can anyone help me with my code? This stack program is supposed to give you the result of an input of characters (words and ? #) when it reads ? It deletes the word that goes before it, and when ...
-4
votes
0answers
11 views

Zend\Permission\Acl class not found [migrated]

im using zend acl with composer.other zend classes(such as zend config...) are working well but when i try zend acl it says fatal error: Zend\Permission\Acl not found.... code: use ...
-3
votes
0answers
49 views

Tools programmer for video games [closed]

It seems like there is a general lack of information about being a tools programmer on the internet. I'm interested in becoming a tools programmer for video game companies but I don't know where to ...
0
votes
0answers
35 views

Programming software that take over windows replace file [closed]

I'm in college and immediately doing my final project (thesis). I want to solve the problem when we were copying the same files in one folder (OS Windows). Usually files are overwritten will ...
-4
votes
0answers
41 views

“= default” about constructor in c++ [closed]

struct Sale{ Sale () = default;//I got nothing about those cod Sale(std::istream &input); Sale(const std::string &s):book(s) {} //and so on...... } What did the second code mean? Is that ...
-4
votes
0answers
52 views

Receiving udp packets from two remote machines [closed]

The setting is as follow : i am listening (as machine 1) to two remote machines ( 2 and 3) using 'recvfrom()' (C socket API), i get a message from machine 2 then i delegate to machine 3, machine 3 and ...

15 30 50 per page