All Questions

Filter by
Sorted by
Tagged with
3 votes
1 answer
2k views

What is the most efficient way to discover devices on a network?

I've been programming a C web server from scratch as an interface for controlling ESP8266 WiFi modules that I plan to use to control appliances & lighting with relays. In an attempt to make a user-...
17 votes
1 answer
3k views

In what programming language did the use of the percent sign (%) to mean modulo/remainder originate?

In what programming language did the use of the percent sign (%) to mean modulo/remainder originate? This previous post1 explains that the symbol % was likely chosen because it includes a slash, ...
1 vote
4 answers
204 views

Moving Old Projects To Newer IDE's and Libraries [closed]

At work we have a few older projects that are stuck on .NET 1.1 and VS 2003. While these are probably to much work now to move forward I'm wondering if the effort to keep our newer projects up to date ...
9 votes
2 answers
709 views

Computer vision algorithms (how is this possible?)

I recently stumbled across a company that has created what appears to be a computer vision technology that is capable of detecting shoplifting automatically and alert its users. LINK Watching some ...
4 votes
1 answer
3k views

Android Pass Data between fragments

I have a question about passing data using bundle between fragments. I need to pass the URL from a Product object to the next fragment, so I don't know which is the best approach: to pass only the URL ...
1 vote
1 answer
9k views

When to use absolute path? [closed]

I had given an answer on SO, the question was concerning a problem with a relative path. My answer was to use an absolute path, which I thought seemed simpler. The asker claimed to need a relative ...
92 votes
28 answers
14k views

How important is graceful degradation of JavaScript?

Should web developers continue to spend effort progressively enhancing our web applications with JavaScript, ensuring that features gracefully degrade, thereby ensuring accessibility? Or should we ...
11 votes
4 answers
9k views

Semantic versioning in Agile

Let's say I have 14 days sprint iterations where I have several stories for new features, few improvements and some bugs to fix. I also deploy those changes when they are ready, I'm not waiting for ...
0 votes
1 answer
93 views

How should I structure my web app for browser compatibility?

We want to be able to implement cross-browser compatibility by overriding markup, scripts and styles only where necessary. We want to avoid forking everything sent to the browser, as has been done in ...
97 votes
53 answers
10k views

Harmful temptations in programming

Just curious, what kinds of temptations in programming turned out to be really harmful in your projects? Like when you really feel the urge to do something and you believe it's going to benefit the ...
2 votes
1 answer
472 views

Can I use the Simple and Fast Multimedia Library (SFML) in a proprietary piece of software?

I have been asked to develop a small game for a conference. The game isn't anything big and since I have had previous experience with SFML, I figured it would be the easiest to use. The SFML ...
1 vote
0 answers
80 views

Metrics for when to use a hash value?

I am working on a project that requires a series of flat files. I will be doing some data checking against simple date like: ID;StatusCode So a typical file might be like: 13993;R 38293;A 19349;I ...
7 votes
10 answers
750 views

In what situations would it be technically 'impossible' to release a system as open source?

While there are certainly many economic, social and practical decisions to be made when deciding whether a system should be open source, are there any situations in which it is impossible, purely from ...
0 votes
1 answer
912 views

How to design resilient web service clients?

I am writing an app that is supposed to talk to a web service. Let's say it's a chat app. It would need to receive a stream of new messages (so that they are pushed to the interface as quickly as ...
6 votes
2 answers
2k views

Automated builds, build tools and Embedded systems

I come from an embedded world where we use C/C++ for programming, and use an IDE to generate a binary file, which is then programmed into a Hardware Board, which can then be tested. With this ...
19 votes
7 answers
858 views

Does using new techniques hurt productivity? [closed]

It seems that as experience with the specific set of tools you have to work with grows, the incentive to try out new things weakens. When I was new at this programming job, trying out new things, ...
1 vote
1 answer
1k views

What is the difference between embedding and composing?

What is the difference between go's type embedding and object composition? My understanding is that type embedding is object composition except the methods of the embedded type are automatically ...
5 votes
1 answer
972 views

Should a web service return an error message if it receives unknown parameters?

I have a web service which allows to retrieve users: http://example.com/users. It returns a list of users. That service accepts a number of parameters (age, gender) to select which users to retrieve. ...
1 vote
2 answers
120 views

Could we set priorities only relative to each other instead of fixed numbers?

AFAIK the lowest priority has the highest number in scheduling and in my system all priorities must be different. But isn't other policies thinkable? For instance, how about a policy where priorities ...
10 votes
3 answers
2k views

Is macros support in a programming language considered harmful?

The first abuse that comes to my mind in C is: #define if while But at the same time it is extremely handy and powerful when used correctly. Something similar happens with Common Lisp macros. ...
79 votes
17 answers
11k views

How to train yourself to avoid writing “clever” code? [closed]

Do you know that feeling when you just need to show off that new trick with Expressions or generalize three different procedures? This does not have to be on Architecture Astronaut scale and in fact ...
-2 votes
1 answer
641 views

Question about switch-case statement [closed]

What happens, and does code work properly if we write switch-case structure like this, why its not good to write code like this? I'm porting some firmware and have switch-case statement interrupted ...
3 votes
3 answers
1k views

How to maintain modularity in C?

I am writing C code with multiple modules like LCD display, flash memory, and GSM module etc. The project consists of thousands of lines of code, in different files. The behavior of the system can be ...
1 vote
1 answer
233 views

Collections.sort question

My question maybe related to this question - Encapsulating Internal Data Structure I have a class LCTile.java which contains a Coordinate.java class. Coordinate.java that contains latitude and ...
1 vote
1 answer
127 views

When's a resource a resource?

So I have a rendering engine, and I have a resource manager that adds classes that derive from type 'Resource'. It's a very flexible and generic resource manager, of which only one can exist (it is a ...
4 votes
1 answer
145 views

Should domain model be intelligent or there must be services, which operate it?

I'm building a web-app for a licensing service. My domain models are Licenses, and they can be of two types at the moment: server and client license. They are almost same, except server license has ...
1 vote
0 answers
47 views

Meteor allow users to extend application

I'm trying to make a meteor app which every user can extend. Meteor uses hot code swapping which I would like to use, so I'd probably need to save scripts on file system of the server. Have You got ...
20 votes
7 answers
7k views

Is there a more intelligent way to do this besides a long chain of if statements or switch?

I'm implementing an IRC bot that receives a message and I'm checking that message to determine which functions to call. Is there a more clever way of doing this? It seems like it'd quickly get out of ...
0 votes
1 answer
677 views

Deciding on a software license for a C++ API [closed]

I have designed and developed a C++ API. Its dependencies are: BLAS - custom license - http://www.netlib.org/blas/#_licensing LAPACK - modified BSD - http://www.netlib.org/lapack/LICENSE.txt GLPK - ...
7 votes
6 answers
8k views

Finding most Important Node(s) in a Directed Graph

I have a large (≈ 20 million nodes) directed Graph with in-edges & out-edges. I want to figure out which parts of of the graph deserve the most attention. Often most of the graph is boring, or at ...
-1 votes
2 answers
362 views

how to modularize wcf services?

I am working on a WCF application that supports 4 different applications. lets call those 4 application: App1, App2, App3, and App4. this WCF Application has 4 services. one for each application. 4 ...
2 votes
1 answer
650 views

Refactoring a god Manager class

I am running in the exact problem Robert Martin mentioned when having a class named Manager, mine has too much (redudant) code. I am writing a system doing computations on many buffers containing ...
1 vote
3 answers
2k views

Is it ok if a method returns a new instance of the class it's in?

I have a class called MyClass and a method called Get that looks something like this: public class MyClass{ string ClassVariable1 {get; set;} string ClassVariable2 {get; set;} string ...
1 vote
2 answers
1k views

WCF an Entity Framework connection

I have a 100+ users on a Silverlight application that uses WCF and entity framework. Everyone has their own database and here comes my problem. How do I make sure that only the user gets access to ...
3 votes
2 answers
232 views

Refactoring wordy conditional tests [duplicate]

My first attempt at this question was too theoretical, so I've rewritten it with actual code. See the edit history if you care. Supposing this logic, "suffering" from the arrow anti-pattern: /** * ...
106 votes
4 answers
72k views

How is a Java reference different from a C pointer?

C has pointers and Java has what is called references. They have some things in common in the sense that they all point to something. I know that pointers in C store the addresses they point to. Do ...
1 vote
2 answers
137 views

Is it considered good practice to use mutables this way? [closed]

Lately I came across a way of using mutables which I had not thought of before. Let's say you have a list comprehension which calls a method, and you put the result in a list like the following (...
3 votes
1 answer
2k views

How to deal with relative paths in out of source build?

An out of source build is a build which can be in any directory other than the source directory I have a project which contains relative paths to some resource files, needed at runtime, which are ...
9 votes
2 answers
16k views

Write a directory structure (pseudo code) [closed]

I am writing a wiki article and wondering what is the proper way to write a directory scheme? I am doing something like main folder - sub folder - sub folder ... But I'm stuck after that. Any help?...
22 votes
4 answers
4k views

Why not just make non-parameterized queries return an error?

SQL injection is a very serious security issue, in large part because it's so easy to get it wrong: the obvious, intuitive way to build a query incorporating user input leaves you vulnerable, and the ...
2 votes
4 answers
401 views

Clean Abstract Syntax Tree

I'm writing a toy compiler for fun. Basically, my problem is that I don't want to clutter the AST with stuff like debug information (symbol tokens, locations of tokens, etc) as well as data that the ...
0 votes
1 answer
101 views

Where should I put my key? [duplicate]

I have a Private Key that is regularly used to decode incoming files during off-business hours as part of an automated process. Currently, it is stored in the application code itself, and only ever ...
3 votes
2 answers
5k views

Converting static utility class into singleton

In company where I work we have lots of "utility" classes, each has lots of code inside (thousands of lines), and they are all static. And one static methods call anothers. The problem here is that ...
56 votes
11 answers
151k views

How would you refactor nested IF Statements? [duplicate]

I was cruising around the programming blogosphere when I happened upon this post about GOTO's: http://giuliozambon.blogspot.com/2010/12/programmers-tabu.html Here the writer talks about how "one ...
7 votes
1 answer
382 views

What to look for in a training course [closed]

My development team is looking to expand into some new areas that we don't currently have direct skills for. We're trying to evaluate the available training courses, but there's not much depth of ...
3 votes
3 answers
170 views

How to understand if a property is a member of a class or I have to create a different class that holds it?

Sometimes when you create a class you can add there several properties (new data members) that you are not certain if you want to do or not. For example, I have a casino slots game. I have tiles and ...
3 votes
3 answers
2k views

Lisp/Clojure: Removing unnecessary parentheses through conventions

I am fascinated to Lisp as it is simple yet powerful. I am just a beginner and I know there have been lots of discussions on removing parentheses from Lisp and its dialects. Yet I request Lisp ninja's ...
0 votes
1 answer
388 views

Configuration file for a generic log file parser

Our company uses multiple log file formats. We would like to develop a series of tools to parse them, often the same core functionality for multiple log file formats. A classical example is ...
1 vote
4 answers
4k views

How to represent an algorithm as a class?

I am trying to understand how to design classes which take an input, do some processing, and return a result. More specifically, should the object store the intermediate results between function calls ...
5 votes
1 answer
2k views

Declarative Transactions in Node.js

Back in the day, it was common to manage database transactions in Java by writing code that did it. Something like this: Transaction tx = session.startTransaction(); ... try { tx.commit(); } catch ...

15 30 50 per page
1
730 731
732
733 734
1269