instruction
stringlengths
34
19.9k
As a follow up to Does a BSD-licensed project need a signed statement from each contributor?: There are several reasons why an open source project might want to get copyright assignments from its contributors. For example: To allow the project author to sue for infringement (as only the copyright holder can do so). Th...
My team of about 70 programmers is developing C and C++ code for embedded, multiprocessor, image-processing project. We have a coding standard, and hold design and code reviews. The problem is that we don't have solid design review checklist. Currently we have scattered design checklists, but most of them are vague. Fo...
I am currently working on a web app and want to design the interface between nodejs / mongoose and the backbone app. A short description of the app: A user signs up to the application and gets a user account where he can create an organization (e.g. footballclub). Within these organizations you can set up projects. Wi...
Our team redesigns the legacy software and there are a lot of design meetings going on. Many of them are not very effective and lack good analysis of the proposed design. Is there any formal way to approach this kind of discussions to make them more effective? I heard about SWOT for example, but afaik it is used more f...
I have a list of english words. I'm trying to come up with a data structure that allows me to do fast StartsWith filtering, like: var words = dictionary.StartsWith("foo"); I was thinking of creating a data structure like this: But I wanted to ask first: a) Does the above data structure already have a name? b) Is this...
When you are working with a multi-tier application very often you run into task of converting objects in one layer to objects in another layer. This could be converting database objects into domain objects, service objects into domain objects, domain object into view models, etc. I've seen it being done in multiple way...
There are essentially two camps of library designers concerning the design of the final header file inclusion: Provide a single header file that includes every other header file that makes up the public API. For example, GTK+ dictates that only gtk.h shall be included. This does not mean that everything is explicitly...
We have to develop our own file management system in Java web application. We need to sync files between our main server and client severs and find out whether all the client server has all the latest version of files. Our files are in pdf, doc and xls format they changes every now and then as and when it is required. ...
I just started learning Haskell and it seems like you can't get too far in the language without being comfortable ( or at least exposed ) to certain branches of mathematics. Unfortunately I have major holes in such areas and am wondering what is a good introductory textbook that covers all the concepts Haskell uses? Fo...
until now I was using dropbox as my main vcs (it is not, but for a single dev does the job pretty decent). However I decided to give git a go and see if it fits my needs. Today I was reading this tutorial and at some point it says: One of the things you should get used to is doing development in a separate area, no...
When I first started to learn programming I remember having an argument with my teacher about If Else statements. I was arguing that: if { ... } else if { ... } ... is basically the same as: if { ... else { if { ... } else { if { ... }...
We have tried to introduce developer automated testing several times at my company. Our QA team uses Selenium to automate UI tests, but I always wanted to introduce unit tests and integration tests. In the past, each time we tried it, everyone got excited for the first month or two. Then, several months in, people simp...
I have created a very tiny framework to be able to get away from all the clutter while developing. The point of the framework is not to replace any library of choice but simply segregate the code to it's correct logic. You can see the source on github along with a few code examples: https://github.com/erik-landvall/sh...
My programming professor has told me that it is a good programming practice (at least in C/C++) to declare a function with the inner loop when nesting loops (not for loops, since when, i.e. looping through a multidimensional array this is very intuitive). For example, if I write int main() { while (cond1) { ...
I have to create a validation system(I don't want to use Data Annotation or any other system) for my C# application using .Net Compact Framework, where I have an object which contains many other objects. Many of the properties are dependent on each other means they have some sort of dependencies. I can write a simple v...
So I have a program I'm worked on back in 2011 and all through 2012, but the last release was in December of 2011. I've been actively working on it, but feature creep lured its ugly head and now it is filled with tons on unfinished features. The bad part is that as I implement a feature, a new one creeps in. What can I...
I sent out an email earlier reminding our developers that the use of the word "shall" in your derived requirements should not follow over to your functional requirements. When writing functional requirements the word "must" is used to describe the function a derived requirement must do. Derived = System Shall be req...
I have encountered (even in literature) two contradicting opinions related to path vs condition coverage (not branch or edge!). Some say Path coverage is stronger than the condition coverage, some say the opposite. Having code like this: If(X<0 OR X>100) DoStuff(); Path coverage - 1 test case is needed to cover the...
In TDD, is it good practice to keep the tests in the same directory as the code its testing or is it better separate the tests in either a different directory or a separate project. Would it be the same for a web site where you have the aspx/c# pages in one directory?
Basically, we have three main projects, two of them are web services, and the other is a web application. While I'm satisfied with covering as much as we can of our web services with functional tests (all three projects have their proper unit tests), functional tests for the web application are taking a lot of develope...
Recently my company was asked by a customer to develop a control board that includes firmware and PCB layout development. After finishing development the customer will buy the control boards at certain quantity every year. We are now at making contract stage, the customer is wanting my company to handover both the firm...
I like that SourceForge can also let people browse your code using Git. But, before I even set up the project on SourceForge, I had a GitHub repository for it. Now that I have created my SourceForge project, I had the option to use the Git tool. The problem is when I did that it made a new repository from scratch. I wo...
scenario: I have an entity called Member. Members fall into multiple types. Some types are below. Supporter Volunteer Sponsor Player I can create class for each type and inherit from the base Member entity. But when a Member has more than 1 type in a given time, it is not the right way. can I use decorator pattern t...
One of my team members consistently avoids making comments in his code. His code is not self-documenting, and other programmers have a difficult time understanding his code. I have asked him several times to comment his code, however he just gives excuses or claims that he will do it later. His concern is that adding ...
I am a Software developer who works on J2SE (core java). Often during our code reviews we are asked to reduce the number of lines in our code. It's not about removing redundant code, it's about following a style that focuses on doing the same things with fewer lines in the code, while I believe in having clarity in cod...
Now and then I use the Python lambda. Is it so formal that it is safe to say that you can do formal lambda calculus with it? I just used it but I didn't fully understand whether the python lambda and the lambda calculus like I read was done by Alonzo Church. I also used it in Javascript, I think. Isn't this more common...
Before I start this question I know the java 'goto' is a big no go. So I've been writing a program and I have some indented Loops and statements and I need to BREAK multiple on command. Rather than having a load of boolean variables and if(!<booleanName>) BREAK; statements throughout these loops and statements what is ...
This is a problem me and my team faces in almost all of the projects. Testing certain parts of the application with JUnit is not easy and you need to start early and to stick to it, but that's not the question I'm asking. The actual problem is that with n-Threads, locking, possible exceptions within the threads and sha...
I have been doubting for a long time whether or not to have a logger in methods (usually helper methods) like the one below. Whether we can print it in the method or print the response where the method is called. public String getAddNewUserUrl() { String url = null; String mode = null; try ...
I've had some discussion with colleagues who chose to go with JRuby along the following line of argumentation: JRuby can make use of anything that is available in Java, ergo such programs are more portable bc Java is more portable. Arguably, the breadth, capability and speed of C/C++ libraries that have been wrapped fo...
Each time I see a question posted on Stack Overflow on C#, I see at least one or two answers posted that solve a problem with LINQ. Usually people with very high reputation seem to use LINQ like pros. So my question is, what problem domain is LINQ supposed to be used for? Also on side notes: Are there any purposes in w...
A friend and I have started a project using code from another project, that is covered licensed under GPL. We have distributed it freely on our website, and under its download button, we've added a direct download link to the modified source code also for free. At the about section of the application, we have credited ...
I am building a web application and RESTful web service. I have been reading various articles about the best way to authenticate the requests to the web service. The best option for me seems to be to use HTTP basic authentication. Pretty much every article ive read says that authentication should be encrypted over SSL ...
Let's say I'm trying to find a number from 1 .. 100. All numbers in this range are "valid", in that they could be interpreted as potential solutions. Let's say the ideal number is 50. And all numbers >= 50 are "feasible" in that they actually solve the problem. And all numbers < 50 are "not feasible" (but still valid)....
Hypothetical scenario: Let's say we are downloading JSON from Facebook with details of a user's friend's checkins, posts, etc... These come in as one document per friend per activity, so with 8 activities a user with 300 friends will cause our system to make 2400 requests to Facebook, downloading 2400 JSON documents. ...
I'm using .Net technologies and because ASP.Net "instant translation" is not really easy to do with ResX, since it has to be compiled after every change, there are a few hacks available (http://www.onpreinit.com/2009/06/updatable-aspnet-resx-resource-provider.html), but as it is, they're hacks... and they seem to have...
Here's the scenario: Say you have millions of JSON documents stored as text files. Each JSON document is an array of "activity" objects, each of which contain a "created_datetime" attribute. What is the best way to merge/sort/filter/page through these activities via a web UI? For example, say we want to take a few thou...
I am trying to design an application where users can make posts with Django on the backend. Right now I have to refresh the page with JavaScript every 20 or 30 seconds to check for new posts that might be available for that page. I was wondering if there are more effective ways to do this? Maybe with a JSON response? ...
Possible Duplicate: I’ve inherited 200K lines of spaghetti code — what now? For my next project, I've been tasked with "overhauling" a large legacy web application with many parts. It is a JSP application written in 2004 and it is used heavily by my company. This application was designed badly in that there is no...
I'm developing software for about 10 years. I began on QBasic and now I'm developing .NET using C# language. I'm always trying to follow the best design patterns and principals like SOLID. In short I'm very happy with my work while as a tiny ISV I'm free to choose between technologies. Of course we almost develop mid-s...
I've come to understand that long before Haskell, O'Caml or LISP, higher order functions were an academic research subject and in mathematics, Schönfinkel (in 1967) and Haskell Curry (in 1968) already applied techniques such as currying, but that was before it was available in any programming language. Scheme, accordin...
Summary: Should a function in C always check to make sure it is not dereferencing a NULL pointer? If not when is it appropriate to skip these checks? Details: I've been reading some books about programming interviews and I'm wondering what the appropriate degree of input validation for function arguments in C is? Ob...
I find my self in a situation, where I need to program a service, that can determine if two object in a huge database are the same. For simplicity, let's say it's used cars, and I want to determine if they are the exact same, based on various attributes e.g. brand, model name, year, milage, price, color etc. The proble...
I am working on open source project, that uses the source code from FlatAssembler project, which uses following license, based on BSD 2-clause with one additional clause added at the end of the text. So, the questions are: What this additional clause changes? Is it legal to use this code and to license my project unde...
In one of my interviews I was asked a vague question, I'm still not sure of the answer. We have a client and a server they are placed apart. The network that connects them has high latency, which is dominating the performance. How can we improve the performance. Note that we can't change the network's topology. I was t...
I am developing an application for my universities student research symposium around the idea of polyglot persistence. I have read Martin Fowlers book and done some other research online about the verious different types of NoSQL db's. I am curious as to what the different use cases are for the different NoSQL database...
I've had an internal promotion interview for gain a higher level programmer title, something like Senior plus. And I've been interviewed by around 7 people using different technology, and people using the same technology with me(.Net) tend to ask very technique detailed question which can actually easily been found vi...
I am a Java (Web) Developer. Having knowledge about c#, PHP and Ruby. I am getting confused how to keep myself updated with very fast changing the programming language and their implementation. Like, in the mobile, you can see around 7-8 OS. There are very much finer example of event-driven programming to make scalable...
So I'm doing a fairly involved javascript/html client with lots of ajax calls and other involvements of callback-ism. I'm entertaining the thought of using Fay for this purpose. I'm aware of Elm. Tried it and liked the FRP elements. Now I'm looking to know if similar structure is possible in Fay. Are there any concrete...
I am working on a product for a client that must be valid and fit for purpose. It's built on a LAMP stack (PHP/Cake), so there's GPL, MIT, PHP, APACHE licenses: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, ...
I'm an electrical engineer that was kind of thrust into the digital world and learning as I go. I'm programming a TI processor to do a PID (proportional-integral-derivative) loop, illustrated by this diagram: I'll also describe it: Negative feedback op-amp, with non-inverting terminal grounded. Input through negative ...
I am aware of some of the problems of the concept of "releasing a work to the public domain" (as mentioned here and here; I haven't listened to this specific discussion yet). IANAL, but the main problems seem to be as follows: Releasing to the public domain doesn't exist in many jurisdictions; rather, a work becomes p...
Somebody explained to me that since in agile development, policy and the application logic should be more important than details such as persistence method, persistence decision should be taken at the end. So it might be a good idea to start with simpler persistence such as flat files, until we reach the point the weak...
One of my company's applications still requires a hardware key to run, but we're currently in the process of removing that requirement and replacing it with an online check. The issue we are having is that we allow our customers to set up test systems with copies of their live databases. With the hardware keys, that ...
One interesting issue appeared for me today. In a distributed SCRUM team when do you start enforcing an unitary work environment in terms of code format, IDE plugins (checkstyle & co), VCS, CI? The team is in an exploratory phase and thegoal is not production quality code but rather proof-of-concept. Isn't it an overhe...
Background / The Problem I need to make a (large) application with a certain set of core functionality, and certain functionality for multiple clients within it. Each client has different requirements and while they may share some functionality, I need to separate the code for each client, so a change to one won't affe...
Following a standard framework of project management, for a software development project we will provide deliverables (documents and software) at the end of each month : My question is: From May to June, while software is in development, what would be the deliverable for each month? Each document starts as version 1....
I'm classically trained psychologist, not a programmer, so sometimes the more advanced aspects of programming escape me, in particular regarding program efficiency and/or certain best practices, in this case with regard to the use of variables. Here is some pseudo-code: var a; var b; var c; function GetSomeInformation(...
I come with a clear agenda on how to code correctly. I used to be a team leader, and I managed using significant amount of mentoring to create a team that creates high quality code. Now I have 3 teams under me, each one has its own team leader. My time is mostly spent on strategic meetings and I can't devote enough of ...
I am currently doing a project (in PHP) that has the following requirements: There is a list of people, sorted in a certain priority. Work should be allocated to them by this priority. e.g. If the list is T1, T2, T3, T1 should be allocated work, before T2. And T2 is allocated work before T3. In the event that are only...
In an answer to another question, I suggested creating a randomized value for input to a specific method. In my experience this has been useful for making tests more readable and it lets you skip the "trivial phase" where you hardcode specific results in a method. Here's the unit test code pasted from the other answer...
This question & its answers are useful but not sufficient for my problem. My Question is if I want to add a javadoc as @Deprecated As of version x.y, replaced by {@link SomeClass} in my current file's javadoc then what should be the version no. in place of x.y ?? Let my current version is 1.2 & after CVS checkin it wil...
In Java,C++,Objective C, C#, and all other similar OOP languages, Why don't we use a class with static methods and vars instead of going through a singleton syntax having to deal with various scenarios ?
I've seen a lot of advice for freelance programmers which advocates quoting your rates in periods of a minimum of one day. That means that when someone asks your rate, you would say "$500 per day" rather than giving the equivalent hourly rate. If I agree to do 10 days of programming work for a client at a particular da...
Every year in january we process a big task with our system. While the performance during the task was above average the maintaince follow up is currently having a lot of trouble with jobs running too long and out of their respective time schedule. Therefore I am tasked with the optimization of those maintaince jobs an...
I am creating an application which will be testable(unit + integration). In this application I have a FileHelper static class, public static class FileHelper { public static void ExtractZipFile(Stream zipStream, string location) { .................................. } public static void CreatePa...
I recently asked this question on SO, which quickly became downvoted and closed. Clearly I lack a deeper understanding of JS, which I'm hoping you'll help me fill here. I'm a perfectly capable web developer and have built plenty of visually and functionally pleasing websites but am struggling to get to grips with how I...
When applying the State Pattern illegal transitions should result in an exception being thrown (or at least that's what I understood from the pattern) I know exceptions are for "unexpected behavior" where an action isn't supposed to happen. Errors would be more appropriate if the required action is common (ex: user ent...
I am going to start a new project using Scrum and Jira and I have some questions regarding how to write proper tasks in Jira. From what I understand user stories are small non-technical descriptions written by the stakeholders (ideally) that can have the form: As a user I want to order monkies so I can earn money. Howe...
I'm writing a few libraries that I want to release as open source projects, but I want to find a licence that means I'll receive the credit when it is used in a project. Im not fussed about anything else, if people want to profit off of it then thats fine. So what licence is most appropriate? The only factor for me is ...
I'd like to read the documentation of Azure Active Directory on my kindle (or similar device), but don't want to use "Print to Kindle" for each and every page. Is the Microsoft documentation for this technology available in other formats? (.chm, PDF, etc). If an alternative format is available, then I can adapt that t...
I found this: http://msgpack.org/ But.. I've never used it, so I don't know what whether it is much good. Anybody has proposals? Basic requirements: serialize as many data structures used typically in both languages as possible, have no problem with nesting as reliable/unbuggy as possible high performance is nice to h...
I have filled that standard form where you list your previous inventions before starting your new job so the employer is legally aware you have the copyright over them. But if I want to use this invention (software code / framework) in my new job, would they have any copyright claims on it if for example I change / imp...
I'm just starting out with python and since I'm coming from a PHP background (thus have to adjust my mind to wrap around new concepts) one major question still stands without answer - why does Flask need a template engine? The way I was used to go about things, was to have a template.html that contained valid html with...
Should a programmer be able to perform all operations programmatically on a object that a user could do? By way of example, I'm working with a list selection object. To populate the list List.AddItem(itemData) is repeatedly called until it is built. A user can then: View the entire list Select a single item from the l...
Reading about various techie sites, there is often a feeling that Microsoft Languages / Oracle etc. are considered "enterprise ready", while there seems to be more doubt about languages such as Python or Ruby. Why is this? Do Microsoft languages actually have less security holes or not?
To write Unit Tests we have to write extra bits of code. For several projects we do Unit Tests and for several projects we do not. As a Team Leader I face trouble to make the right decision. Is there any or list of terms by which I can take the right decision whether we will do Unit tests or not? EDIT: Please provide ...
Disclaimer: Opinions expressed are solely my own and do not express the views or opinions of my employer. I work for a small company, in which few people are developers, others are QA/Test and 1 is a Manager. I joined this company 1.5 years ago. 3 senior developers have 8+ years of experience. These are the observati...
This is a bit pedantic, but I've seen some people use Id as in: private int userId; public int getUserId(); and others use: private int userID; public int getUserID(); Is one of these a better name than the other? Why? I've seen this done very inconsistently in large projects. If I were to set a standard which would ...
I have a class in which I want to disallow other programmers from overriding one of it's methods, since it requires special knowledge of the inner workings of the class. Since I personally know how the class works, I would like to be able to make an exception and actually DO override the function in one derived class. ...
I read few articles about composite pattern and I want to know whether its applicable in following situation, I found that "A Composite Entity object can represent a coarse-grained object and all its related dependent objects" public class PatientRegistrationDTO { public string RegistrationNo; public string ID;...
Where does the word "argument" (in the programming sense) come from? i.e. Why are actual parameters called "arguments"? The meanings don't seem related, and I haven't found any explanation of it anywhere. Note on the terminology: "Formal" parameters (also known simply as "parameters") are the "placeholder" names ...
I would like to sell a software that has some open source competitors. Therefore I would like to include the source code with the binaries so that the company buying it can modify it as it wishes. The only catch is that the source code will NOT belong to the company, in other words, I would like to maintain the copyrig...
I've implemented an application using MVP with GWT, which is working out very nicely for views that have a single purpose. Now, it has evolved into views that are achieving multiple purposes in a single window. So now I have a view of views with each view having its own presenter. I used this example as my model for...
We've built a single-tenant webapp in PHP and as it stands each hosted 'site' has its own database. However we need to be able to run a script to create their database, assign a mysql user, and insert the default sql. Now, we've got the database and user stuff working fine, its just the importing of the SQL. From what...
As I find that UpperCase are really readable for first letter word separation in long complex names, I tend to give some of my Linux files names with some UpperCase. Mostly executables, some directories too. But it's been a few weeks I have remarked that the huge majority off all file names in my linux distrib are lowe...
I am writing an application to report to the user(devs) when their website fails. And what I mean by fails which is unfunctional or needs to report the problem to devs. I do understand that status code 2XX means 'Success' according to wiki. But does that really do? I have access my website once and returned 204 'No-Con...
Let's say we have a method setFoo that sets a flag in a Bar object e.g. class Baz { public void setFoo(String foo)( ... } } inside setFoo, the method is doing some expensive load of the Bar object from the database. class Baz { public void setFoo(String foo)( Bar bar = expensiveGetBar(); ...
I get stuck each time I need to write a constructor for any class I design. The reason is that I am not sure what should go into a constructor and what should not. On googling for this, I got the answer that the constructor need to do only as much as to make sure that the opbect created is valid. But my query is How ...
Considering how software is developed during a release cycle (implementation, testing, bug fixing, release) I was thinking that one should be able to see some pattern in the lines of code that are changed in the code base; e.g. towards the end of a project, if the code becomes more stable, one should see that fewer lin...
When having a continuous integration executing the tests at each commit, a common best practice is to have all the tests passing at all times (aka "do not break the build"). I find some problems with that: For example one cannot help an open source project by creating tests corresponding to tickets. I know if I propose...
my question is going to be somewhat philosophical and "architectural oriented" so bear with me. Right now we have existing Java web application built on top of Spring and JSF(facelets) with maven. These are basically our tools that limit our scope of possible solutions. Now to the point. We need to implement a fork of ...
Are there any practical references (with actual examples) for getting started implementing a small, lazy functional programming language with graph reduction? A reference that included the lexing and parsing steps would be especially helpful. So far I've read most of the Implementation of Functional Programming Languag...
When using a MVC pattern for server side code (in my case django), the model definition is defined once in the model component. When using a client side MVC based library(in my case backbone) the model definition or some subset is redefined. If I were to make a change to my server side model definition, let's say add a...
I am developing a Mojo(think it as just a usual class) for my custom Maven Plugin. There is an Abstract Mojo at top. I have some other custom Mojos in example which makes server side includes. I have some static variables and some util methods in example get operating system name, fix file separator in order to used op...
I've been researching puppet lately, and I think it could be useful to integrate into my deployment pipeline. Currently, I deploy my apps by manually adding users, creating vhosts, setting directories, and then git cloning my repo from GitHub. I deploy changes with a simple Git pull (Git hooks take care of database mig...
I am about to participate in a discussion with management regarding measuring our testing efficiency as a QA organization. The main reason behind this is that half of our team is contracted out and our business would like to provide some metrics of how effective/efficient we are, so that we have basis data on which to ...
My Project: I have employees who are required to go through a checklist when they encounter a duck, a cat, and a human. In our business, we have a set number of ducks, cats, and humans that come in and out of our doors. When they come in, we have to check that all of these features are present. The features: Here is o...
It seems like most of the Scrum articles and books that I've read as well as the lectures I've heard have very little to say about the process of creating the items on the backlog. How should a team on a medium or large project (i.e. more than a few team members) go about creating and detailing the items on the backlog...
I'm wondering what's the reasoning behind Bootstrap's decision to change all camel case names into hyphenated names in v3.0. I searched on Google, and looked in a few books, but I can only find opinions one way or the other - no hard data. Are there any studies that suggest camel case variable names are more readable t...