instruction stringlengths 34 19.9k |
|---|
Suppose one had a relatively large program (say 900k SLOC in C#), all commented/documented thoroughly, well organized and working well. The entire code base was written by a single senior developer who no longer with the company. All the code is testable as is and IoC is used throughout--except for some strange reason ... |
From what I've read, genetic algorithms are usually (always?) applied to chromosomes of bits. So if a problem involves maximizing a function that takes integer values, the integers are first encoded as bits.
Is this mapping necessary? It seems that you could take chromosomes of integers and apply crossover and mutation... |
I recently posted here asking about the drawbacks of having a server process bind to a dynamically assigned port. That approach came about because xinetd, which launched the server process, allocates STDIN and STDOUT as the server's communication channel to the client, and we wanted the server to use a bidirectional s... |
I am writing a user story and have a simple questions.
Consider, I am writing it for login module which calls internally a web service to authenticate the user and returns the data. How this can be converted into a user story.
Should this be written as:
As a user,
I would like to login to the system and see the resul... |
I am in the middle of a disagreement (cordial, of course) with my lead about proper branch naming. This applies to bug-fix and small feature branches, not long-running feature branches. For long-running feature branches, we agree that human-readable names are better. Here are the two points of view:
Mine:
Naming bra... |
I am curious if any open source project actually tracked effort by a measure like self-reported hours put by unpaid voluntary coders. Do they? How? Why?
I don't care for cost estimations functions of SLOC or any other nonsense variable.
I suggest as answer an example with multiple contributors with a explanation of how... |
We have several bugfix branches that are starting to pile up. They have been merged into master, and deployed to production.
Is there a good benchmark for when these branches should be cleaned up?
Should they ever be cleaned up, or is it good to have the historical data?
|
I'm little confused with the motive and need for frameworks. At what stage should I use frameworks? For example, if I want to use some CSS framework, should I learn CSS at pro or advanced level to use it?
|
I often have superclasses that contain a more abstracted form of a class as a member variable than my subclasses need. I find my code littered ((ClassName)variableName).methodName(). Is the best way to solve this to create a protected/private method called something like getVariableNameAsClass()? It's not much shorter ... |
I was reading the Scrum documents and it says that the tasks in Sprint should be "potentially shippable".
I am confused by what this means. Suppose in Sprint 1 the goal was, "user registration form".
How much detail do I need to add for something to be ready to ship? For example:
I can show the simple form with field... |
I am thinking of using JIRA + GreenHopper for my project management.
I have seen that Green Hopper is for making User stories, sprints.
I am not able to find how do i need to add tasks, or how to break user stories in to sub stories.
Do I first need to create project in JIRA and then use Green Hopper or I can use use ... |
I would like some help/advice on a design pattern or similar I could use for my problem.
I have some shared functionality in my code and I use the Strategy pattern at present. I have a base class
named "ProjectSectionBase" and from here I have 2 derived classes, "ProjectSectionStandard" and "ProjectSectionSuperior".
No... |
Portal website usually have very large number of posts. For example I have 50,000 posts in website. I even created the google sitemap as chunks and included it in main site map file. But I have no idea how to deal with RSS feed.
50,000 posts in RSS feed file size will be very huge, how to handle the situation?
|
Given is an integer with the value 5. Given is a range with start and end values of 2 and 5. So is the integer 5 now between the range? What should a 'InBetween()' method return and which one is the correct representation of 'between':
int val = 5
if(val >= 2 && val <= 5) // would return true
if(val > 2 && val < 5)... |
Quite often I find myself referring in text to objects which have strict naming conventions e.g. Java objects, processes, services. I find myself in a dilemma over how to pluralize these names.
It seems wrong to pollute the meaningful name by adding an 's' - or worse, a plural that modifies the rest of the name like ... |
I'm drawing a class diagram and noticed that sometimes I got a relationship (composition or aggregation) where the item uses the container, and sometimes not.
What is the visual difference in a composition where the item class uses the container class vs where the item class doesn't know about the container class?
|
HTML 4 supports a "title" attribute that can be inserted inside any HTML tag. Inserting this attribute effectively gives the element a tooltip that pops up when the mouse moves over it.
It just seems like a bad word choice.. or am I missing something?
|
Is there a best practice for how to document the source code you're releasing?
Currently, we have a table of the versions of the software, what SVN tag it's labeled as, what SVN rev that tag was created at and the SVN URL.
Then, our CM (Configuration Management) department wants us to include a file listing of all the ... |
I have k csv files (5 csv files for example), each file has m fields which produce a key and n values. I need to produce a single csv file with aggregated data.
I'm looking for the most efficient solution for this problem, speed mainly. I don't think by the way that we will have memory issues. Also I would like to know... |
I want to create a database that tracks different projects and their finances. As finances are tracked monthly, a new column has to be created for each month. I could create all tables together at the start, yeah, but I guess it would be bad development strategy. Also I would be guessing the number of months. I will be... |
I use JavaScript with JQuery for a Rails application. I have some dynamic behaviour in this one. As a Ruby developper, I like TDD/BDD, specialy with RSpec. For the moment, I test my JavaScript manualy. It's not the best way because a change, somewhere, can break the code somewhere else. The is a lot of avantages of usi... |
About a third of my code is wrapped inside a Facade class. Note that this isn't a "God" class, but actually represents a single thing (called a Line). Naturally, it delegates responsibilities to the subsystem behind it.
What ends up happening is that two of the subsystem classes (Output and Timeline) have all of their ... |
Lets say I am writing a blog web application using MVC pattern. Typical layout for the main page of the blog application is - some kind of a post index in the main part, and aside there are some addition parts, like timeline, tag navigation panel, subscribing panel, etc. Those controls also appear on a single post view... |
Let's say I have a sorted array of ints like so:
int[] numbers = new[] { 10, 20, 27, 30, 55, 70 };
What is the most efficient way, given a value, to find the value in that array (or the index of it) that is closest to the value but is not greater than the value?
For instance, given the value 26, it would return the 20... |
I've read articles with very conflicting arguments on t-shirt estimates. Neither article seemed all that credible so I thought I would bring this up here.
Are t-shirt estimates a good idea?
For those who haven't heard of this: T-shirt estimates are the practice of giving very vague and high level estimates when given v... |
I'm comparing floats in Java right now and the simplest formula is:
Math.abs(a - b) < THRESHOLD
When naming your variable for the threshold of difference, should you name it delta or epsilon? Specifically, which of the two is the correct term for the smallest value that a floating-point number can represent?
Is the te... |
I hear this term around the office, and know it's relevant to software development lifecycle. What does "promote" mean? Context: e.g. to promote a file.
|
Suppose you have an arbitrary code base, C, possibly composed of multiple programs, none of which fall under a copyleft license.
Suppose this code, taken together, does the same job as a nice integrated program, A licensed under some copyleft license like the GPL, but that for whatever reason the GPL code is superior (... |
The case where a source-level operator actually describes an operation to take place at some future point, thunking the real operator together with its operands.
I don't know if this has any kind of general name, or perhaps it's too low-level a design element to be thought of as a "pattern" at all, but anyway it's an e... |
We call static final fields as constant, rather I should say Class constant.
So can we call just final fields as Object's constant? Is it right to say this?
Edited ::
Consider the following code :
class JustFinal
{
final int a=20;
final int b;
JustFinal(int x, int y){
//a=x;
b=y;
}
... |
I am learning how to make responsive layouts for sites and web applications. It's said we need to use media queries to find out the width(resolution) and then select the layout(wireframe) for that screen.
I would like to know how many layouts(wireframe) should I make for?
Please advice as per your experience.
For exam... |
I've heard that logic programming can serve as a general-purpose alternative to other programming paradigms such as OO or functional programming. (Since Prolog is Turing-complete, this must be so!)
However, I'm having trouble seeing how one would implement an interactive program, like a simple, graphical console game ... |
Background
I recently developed, for two different projects, two web applications.
The two followed quite different approaches. The first one was a classic inventory application (lists of stuff to view, select, edit.. very CRUD) and was developed with Razor and ASP.NET MVC: controller accepting requests, getting a mod... |
I am writing some code in Python which checks for the validity of a license key after polling a server. If it is valid then the Python program in turn runs some bash scripts.
How to create a combined binary of the python script (to check the license) and the bash script (which performs the task)?
Here are what I thin... |
I've been using MVC/MV* since I started actually organizing my code years ago. I've been using it so long that I can't even think of any other way to structure my code and every job I've had after being an intern was MVC based.
My question is, what are the downfalls of MVC? In what cases would MVC be a bad choice for a... |
In my job I deal with several projects at the same time (and who doesn't?). Sometimes I have to make changes to a project which I dealt with half a year ago or even longer. And it's hard to recollect the details about the project. I usually look for the modification dates of the files, then I start digging into my emai... |
I am trying to write a program which make the following:
?- g([2,3, [22,[3],9] ,4,[5],99],X).
X= [2,3,22,[3],9 ,4,5,99]
so it searches for lists in the given list and replace it by their elements without brackets [].
so I wrote this program:
The first block just searches for the first element in the list which is lis... |
I'm exploring options for running a small cloud Windows Server (either AWS EC2 Micro or Azure Extra Small).
The server won't be hit very hard, but I need to run a simple relational database, which I'm expecting to be moderately sized - probably a few tables with a few hundred thousand records, and running a few thousan... |
I'm working on my first ASP.NET project and I'm torn between using asp tags (<asp:SomeElement) everywhere or use some regular HTML for simple things that need no code behind, like fixed divs, static text, etc.
I think it would be best to use ASP tags only for code behind and other dynamic stuff, whereas static elements... |
There are so many Java technologies that it is difficult for me to know where to start. I understand JSP and Servlets. I know what http servers to use. Real basic stuff. What I don't understand is what I do after that?
I don't want to create a bunch of jsp and servlets. That's not very different than what I have.
... |
I have designed a simple website on paper. Now I want to produce a professional-looking document for my customer to approve.
How can I do this?
I've tried Visio, but it seems horribly overcomplicated and unsuitable for my purpose.
I could describe what I've written in words in a Word document but that'd be much harder ... |
We are implementing a matrix compression library based on a modified two dimensional grammar syntax. Now we have two approaches for our data types -which one will be better in case of memory usage? (we want to compress something ;)).
The grammars contain NonTerminals with exactly 4 Productions or a Terminal on the righ... |
We have what can be called a distributed application: One full-blown web app and a small REST service. Both must be separately deployable. Both access the same database schema (they actually share only two tables). The common functionality is encapsulated in a common artifact (a JAR file here, since it’s all Java). So ... |
I'm new to developing software and have been handling feature requests for an internal web-app I built.
Sometimes the feature requests are straight-forward and require minimal business logic for me to implement, so I talk to the person for a bit, write their requirements down, and get to work.
However, I'm starting to... |
I am beginner to Python and I really like it so far.
One question that comes to my mind very often is if I need to understand and therefore learn the Internals of a programming language (as in my case Python). As you might know, Python itself is written in C.
So my question is: How deep do have to dive into a programmi... |
I'm developing desktop application in java/swing.
I have a component that is registered as a subscriber to many panels and gets messages (my custom event) from them. That component is something like message tray. When there is a validation error or some kind of info message it's delivered from panel to that tray by my ... |
While writing an EJB (deployed on WAS) that connects to a db, i have never needed to use JCA. But apparently JCA is the standard for connection to thrid party EIS (which includes database).
So does the WAS implement JCA internally? Under what situation would the app develoepr need to use JCA related classes?
|
When we add .edmx files to a DLL, the physical size of the DLL increases. DLL's are loaded into memory. However, the .NET infrastructure with functionality such as JIT compilation and the GAC complicates things. Is it true that having a larger DLL automatically increase the memory requirements of an application?
In... |
This is the first time I will be delivering code for a freelance project (web-app), and, since I don't have much experience shipping code, I am having a hard time deciding whether my program is ready for deployment or not.
My understanding is that a production-level code must have the following characteristics:
Fault ... |
When a dynamically linked library includes a global mutable variable, such as a container for state initialised when loading the library, how do references to that variable behave when running an application that links against it?
Obviously the application cannot alter memory allocated to the dynamically-linked library... |
First of all, in this question I'd like to stay away from the polemic on whether source code commenting is good or bad. I'm just trying to understand more clearly what people mean when they talk about comments that tell you WHY, WHAT or HOW.
We often see guidelines like "Comments should tell you WHY; code itself should... |
Using pointer, I am able to modify the private value of the class in the code below.
Does it violate the C++ concept that private member can only be modified by member or friend functions?
#include<iostream>
using namespace std;
class demo
{
private: int info;
public:
demo()
... |
I am writing my first application for Android and will use the SQLite database so will be trying to limit the size as much as possible, but I think the question applies in general to database design.
I am planning to store records that will have text and the date of creation. The app is a stand-alone app, i.e. it will ... |
I am wondering why there is no markdown syntax for underline? I know that basic html tags can be embedded to achieve this but I am trying to understand why underline got omitted when bold and italics exists
|
I'm using python to do some research tasks. I have a class hierarchy for "tools", where each object is an instance of a particular tool. They all share some functionality and have many similarities in their states.
Some of these tools can use one of several methods based on the tool object's current state. The specific... |
Why is the Scala Option type not called Maybe, just as in Haskell?
Maybe makes a lot more "semantic sense" to me, but maybe Option has different behaviour I am not aware of.
Is there any particular reason why Option in Scala was not called Maybe?
|
At work, we develop a lot of our applications in SAS, from start to finish. One of the problems with this approach is that SAS is a very verbose language with very few language constructs; there is limited support for variables, very limited support for basic functions, and no such thing as classes. They have a concept... |
I am handling a team of a few guys working on a software module in a large project. As per our estimates our module is getting delayed by a week. Since we can not have this delay, our client and our manager arrive at a decision that we need to work on few weekends (3-4) to try to finish the work.
All members of the te... |
I am really struggling with a problem where I need to "prune" down available scenarios to those that a user has defined as valid. Below is a small example of the problem I am trying to solve in .Net (C#). Given the levels / values shown below, the user could pick that there are only a few valid combinations, but if you... |
I've posted questions pertaining to this issue before, but they've all tackled different aspects of the problem (Just so you know that I'm not reposting the same question to get more answers).
So, in a nutshell, here is my problem: I have a Timeline class, which has-a Content interface member variable. The Timeline man... |
I thought Doctrine 2 DBAL prepared statements were safe from SQLi. But I found this confusing bit in the docs:
By default the Doctrine DBAL does no escaping. Escaping is a very
tricky business to do automatically, therefore there is none by
default. When you use the Doctrine DBAL as standalone, you have to
take ... |
I am looking all over internet to find a logic to convert an Algebraic Expression into a Binary Tree.
I could only find ones where you first convert the algebra expression to postfix or prefix and then convert it to Binary Tree.
I am just curious to know , if its possible.
Any pointers to external links or logical answ... |
Background:
I was writing some code. It looked something like this:
class X
{
private List<int> _myList = new List<int>();
public void MyMethod(int x)
{
_myList.Add(x);
}
}
R# suggested that I make _myList readonly. I wasn't so sure, as though I technically could make it readonly, I think it wo... |
This is not meant to start a religio-technical browser war - I still prefer Chrome, at least for now, but:
Because of a perhaps Chrome-related problem with my web page (see also), I temporarily switched to IE (10) to see if it would also view the time value as invalid.
However, I didn't even get to that point - IE stop... |
I like IE's persnicketiness (the debugging tools that take you right to your code is even more user-friendly than what I've found in F12 Chrome Dev Tools), but why does it say, "'console' is undefined" re: this line of jQjuery:
console.log("entered submit button click");
How could console be undefined? Neither Chrome ... |
One programmer is testing and comparing the same application which uses the same database structure, and the same data, only in two separate databases, one with Oracle 8 and one with Oracle 9.
The app runs a query with no ORDER BY clause.
He claims that the ORDER-BY-less query should return the rows in the same order i... |
I asked about Compiler interpretation of overriding vs overloading on StackOverflow, and got good answers, but this led me to another question that I'm not sure is appropriate for SO, but I think is for here.
One should read the original question and accepted answer, but perhaps it's understandable just by looking at t... |
Non-turing complete languages can solve every practical problem that a turing-complete language can. Also, they are much more analyzable than turing complete languages. The compiler can comprehend the program as a whole, predict/compute/cache every possible computation in advance, optimize it the most mathematically po... |
I would like to be able to see what code in thousands of lines of source code is run most often and takes the longest. The purpose of this would be for optimization.
Being able to see what parts of the code are run most often is important for optimization, because those parts are where I should focus to speed up. At th... |
I have an object that I am downloading over HTTP, that has approximately 50 attributes. What is the proper way to store this information in Objective-C? Should I have an NSObject with a property for each attribute (if so, what would be a good way to initialize this object?)? Should I use an NSDictionary with 50 key-val... |
Let's say you develop a software program for Windows in C#, then Joe Blow develops the same software program for Windows but instead codes it using C++.
If Joe Blow were to sell that software program, what would determine who would get more money for it given the different languages?
Assuming, both used the same licen... |
On my current project I am responsible for the implementation of a service which involves the consumption of newly created RESTful APIs, documented as solely supporting JSON.
The client consistently makes requests with the accept header of 'application/json' and content-type of 'application/json'. However some endpoin... |
Have you had this problem?
You are building a complex web application for a target market, and after a while you reach a point in complexity where you can't decide if you are building more than one product.
A decision has to be made. Do you add features to turn it into a framework for multiple domains or do you resist ... |
I've studied design pattern and oop principles, still feel that there is something missing in most design theories. Maybe the fact is that there is not a 'theory' as it is in database design.
Let me explain with an example.
Suppose that i want to model different ways to produce orange juice.
Let say that i start by a ... |
During the meeting, each team member answers three questions:
What have you done since yesterday?
What are you planning to do today?
Any impediments/stumbling blocks? Any impediment/stumbling block identified in this meeting is documented by the Scrum Master and worked towards resolution outside of this meeting. No de... |
I am making a .NET desktop application (WinForms+Local PostgreSQL Server) for managing sales in a small store.
I wish to integrate Lucene search facilities into the 'Product Search' module of my software. Are there any good patterns for integrating such Information Retrieval Libraries into existing applications?
Note :... |
My friend gave me a problem that he says is easy, but I can't figure out a good algorithm to use to do it.
You are given an input of 100 random English words. You have to find the longest string of words where the last letter in one word matches the first letter in the next word. You can only use each word once.
For ... |
I am using EF Code First and I had a model like below.
public class Account
{
[Required]
public string AccountNo { get; set; }
[Required]
public decimal Balance { get; set; }
}
I used a Service class to withdraw and deposit amount to Account. Then I came across this and realised that Account is Anemic.... |
I am currently working on a project of my own for a little over 2 months (not much time on my hands). The purpose of this project is to be able to remotely update all of my Linux systems from one graphical application.
The problem I am having is I am building two applications: the client and the server. As the size of... |
I'm using bits of javascript on my website for an image gallery, smooth scrolling, etc. These scripts are not used on every page (not every page has an image gallery for example). However, the scripts aren't very big and most users will have to download them eventually (the image gallery is very central to the website)... |
I am currently writing a C code for a doubly linked list(dll) around which I want to write wrapers for implementing stack, queues etc. instead of writing separate codes for all of them.
I'll be using void * for making it possible for the doubly linked list to work with any data type. The idea is basically the same as ... |
I have an array of points. Each point has two members - x and y.
I want to get any 3 points and check, are they located in single line in 2D coordinate system.
For example - 1x2, 2x3, 5x6:
If yes, I want to search for another point in my array which is located in that line (line has no start and no end). And so on, wh... |
I am new to sql. I have added 2 new tables in database. The primary key of first is a foreign key in the other. The type of the keys is integer. Now I want to generate the keys in the code and assign it to new data so that the association between different rows of the tables is right. How do I ensure uniqueness of keys... |
I am starting out with C++ and almost everywhere I see there is these 2 sentences at the top.
#include <iostream>
using namespace std;
As I understand namespaces are something to keep names separate and have same identifiers in different namespaces. So isn't including std in the beginning undoing all the hard work of ... |
My idea is, to create an abstract class / interface which can be extended into a user, and into a usergroup.
There actually is a good reason for there being this interface connecting the groups with the users as the only differences between a user and a group is that you can login as a user and you can't as a group, a... |
Imagine a application similar to Facebook, where you have status updates and a news feed. The names and profile pictures can be changed. There are also several different types of updates requiring a different layout template for each type.
I hate my implementation and would like some feedback on how to improve it. ... |
I have a web application that is accessed by multiple users from different locations worldwide. Let's say I have an "edit" form for a specific document and two (or more) users are editing the document at the same time. I know that both of the users can edit the document and submit it, but user1 will not see that user2 ... |
Problem Description
I am wanting to use voice recognition as part of a hardware project, which I would like to be completely self containing (I'm using small low power, low speed devices such as Arduino's and Raspberry Pi's, Kinects etc, no running traditional computer with an OS is involved. So a closed / self contain... |
I am practicing using of immutable object in C++. My personal goal is representing generic object graph (in heap) with sequence of immutable graphs.
Building the multi-version graph itself isn't that much hard. The problem is performance. Brute-force versioning needs full copy of graph, and this was not acceptable.
I t... |
I often read that developers must write beautiful code, but for a beginner as I am it remains obscure of what is beautiful code and how do you recognize it?
The corollary question is: How to write beautiful code and what are some practical habits to improve your code's quality?, what should I care about to make the cod... |
I need to execute just few lines of PHP code on every single page of my website. This PHP code does not require more than 4MB memory. That is why i want to allocate just 4MB memory to all pages by using following code :
ini_set('memory_limit','4M');
Does it give any benfits in any of the following areas :
1. Website s... |
I'm a new guy in this company and I've been tasked to research on possible workarounds with the browser behaviors to cater to the demands of our client.
A little background; what they want is to display a 'custom' dialog whenever a user would like to navigate away from a page (not the browser default) that has a form, ... |
I am creating a module for a CMS. I found a PHP code in github that does some work for me. The author has not clearly stated the license for the code. Since it is in github and is publicly available, can I use the code in my module or should I get the author's written permission? I am planning to sell my module for a s... |
Up until around January 2013, the minor updates of major Java versions were always consecutive: 6u30, 6u31, 6u32, 6u33 and so on. The same is true for Java 7 updates.
But, starting around January or February 2013, some minor version numberings were skipped. Take a look here: http://en.wikipedia.org/wiki/Java_version_hi... |
I've heard a lot about apple's famous dispatch queues and the GCD but today was the first time I decided to understand exactly what is going on, so I started reading Concurrency Programming Guide and this paragraph caught my eye.
If you have two tasks that access the same shared resource but run on different threads,... |
I've made a little library called SignalR.EventAggregatorProxy
Before I push it into 1.0 state I need to fix so it works safely with concurrent operations. Easiest way is lock all operations but thats a huge performance impact.
The library queues event subscriptions and when a event comes in it checks the subscriptions... |
One of the Dart criticized features are named and factory constructors.
There are opinions (from dependency injection people), that constructors should be simple and just assign some fields and the object graph creation is a responsibility of factories.
There are also some argues against the static methods.
It seems, ... |
I'm not against agile/TDD and use it under most circumstances. However, in some circumstances I feel it doesn't work well.
For example, the other day I was building a fairly complex data processing app. In an ideal world I'd layout the foundation, design the components, write unit tests and demo on each sprints as I ... |
How would you organise a backlog item that is planned to change in future releases?
I've got a requirement that states that:
In release 1 users can open content from local machines.
In future releases users can open content from remote servers, FTP and web streams.
Is it typical to just create 2 backlog items to descri... |
A one possible structure for an application is to have it broken down into modules such as Data Access, Core, Services, UI. Now depending on what type of ORM you are using Data Access layer will have a set of entities that represent the tables in the database. The core layer will have a set of entities that represent t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.