instruction stringlengths 34 19.9k |
|---|
FIRST, THE SCENARIO
We have an internal system that is effectively split into 2 very separate parts across 2 sub-domains, our back-end administrative system for internal access only we will call this admin.example.com and our public-facing interface for customers via our website - lets call this www.example.com/custome... |
I am considering implementing the following policy and would like to run it by the community before implementing it:
All mercurial commits must have a bug id corresponding to our bug reporting database.
All commits immediately preceding a push for a new feature must have a bug id (it's a new feature but the id is still... |
What would be an optimal way to organize arbitrary data types into a structure that allows for complex (non-index based) lookups into the data without performing full loop-through's?
For a little background, I am not looking for an answer on how to architect an Event engine, rather I am looking for methods to improve a... |
I have an embedded device running a slimmed down version of a HTTP server. Currently, it can display static HTML pages. Here is an example of how it displays a static HTML page:
char *text="HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n"
"<html><body>Hello World!</body></html>";
IPWrite(socket, (uint8*)text, (int)s... |
As I learned some basic programming languages I came across tens of IDEs, and tens of compilers. Most people you ask will tell you "Go with that IDE or go with the best" etc, however they do not provide a proper statement as to why this is important. I understand a good IDE will provide you with functionalities to save... |
On a related question, it has been clarified why C++ is not compatible with C in many aspects. However C++ is still a "hybrid"* language. And unfortunately, many programmers still consider C++ as a "C with streams and built-in strings". That results in really bad written code, that it's neither C++ nor C. IMHO, it woul... |
MyDbEntities context = new MyDbEntities();
var result = context.StoredProcedureName(userId);
In the situation above, is it considered best practice to use var or ObjectResult<ComplexType>?
|
GWT is a software stack that translates Java code and a sub-set of the Java Runtime's class library to JavaScript code.
In comparison with JavaScript toolkits, GWT can seem alienating, by nature and by usage, and overly complex to do even simple things, taking away much of the fine-grained control you'd have by using J... |
Currently our team develops Web Applications and now we are going to Windows Forms applications.
I have created the inception phase for our Windows Forms project structure.
eg:
ApplicationSolution
--> Security Project(Login Authentication)
a. Users will be registered with different applications in our appl... |
I am currently trying to write my own compiler, targeting the JVM.
I have completed the parsing step using Java classes generated by ANTLR, and have an AST of the source code to work from (An ANTLR "CommonTree", specifically). I am using ASM to simplify the generating of the bytecode.
Could anyone give a broad overvi... |
I have been part of the organization I work in for the past year and a half or so. The company basically writes Perl code and they have large amounts of legacy code which originally prevented the company from moving forward with any code changes. My first observation with the existing code was non existence of Modulari... |
So the client I am working for right now is really big on load time speed, so we try to shave every micro second possible. We found a file the other day that was pulling some word press blogs and it was adding a solid second to the load time.
Now I didn't write that particular script and perhaps I can go optimize it l... |
If we have a 4 way tree such as the one shown below, and we do an in order traversal, what would the output of the in-order traversal be for an M-way tree?
In which order would the nodes be visited? When would the value in the node be processed (upon first visit or upon second visit)?
(As a concrete example, what woul... |
I have been writing code for a few years now and I don't believe I can claim to have a complete knowledge in this job yet.
My experience primarily rolls around C# related areas with a decent knowledge on Silverlight and Asp .Net MVC as well. I tend to use Sql server and Postgres for normal RDBMS related tasks with Myb... |
Why go agile? This is the first question that comes to my mind when I think of going agile. What are the possible financial benefits one can achieve from going agile?
Most of us certainly like to think of customers and clients as someone who doesn't know what they wants. So why help them at all? Why not suck their mone... |
So we're having an internal debate on whether the time restriction that we have in place for our technical test a good thing. I thought I would open it out to the community. So what are your thoughts on this restriction, do people accept it as standard practice or is it an artificial restriction?
A little background, f... |
Just ran across this figure, and wondering if there's another well know source than would help confirm these numbers:
Based on data I analyzed on successfully finished sprints, I
determined that a team should average around 1 to 1-1/2 user stories
(product backlog items of any sort, really) per person per sprint.
SOU... |
We have "priority" and "severity" fields in our bug tracking system. We define severity as "how it impacts the user" and priority as "how it impacts the product".
My question is about how to categorize a "code improvement" task in severity and priority. Suppose the improvement does not change any behavior but makes it... |
I'm developing a small android app, which is regional independent.
I'm curious, which language should I try to support? At the moment I'm only sure to support the languages I speak fluently. This is German and English.
But what about French, Spanish or Japanese...? Are there any statistics out there to help determine w... |
Assuming a function with a signature of
boolean isTransposed(Date date1, Date date2);
Example outcomes:
date1 date2 Outcome
06/02/2000 02/06/2000 true
02/06/2000 06/02/2000 true
02/06/2000 null false
06/02/2000 02/06/1987 false
11/11/2000 11/11/2000 true
04/04/2001 04/04/2000 false
Grant... |
At my core, I'm a structural, Computer Science sort of programmer (in college I was required to do a lot of programming using C, C++ and even COBOL(!)) and I'm finding more and more conflict with the core fundamentals I developed in my CS degree as opposed to the modern web development world that I'm currently immersed... |
What is the recommended way for a lower level software component/module to communicate with the GUI? I'm using C++.
I have a service layer class that if some conditions occur needs to notify the user, but still continue processing. In the case of an unrecoverable error I understand that I can use exceptions to bubble... |
From what I understand, the ideal way to prepare builds using Visual Studio is to use a single build machine. That means, while the developers go through development process using their respective machine, the build isn't prepared from any of those machines and a build PC is used instead.
Under this condition, is it ne... |
If sprints are on average 10 days, why is it often suggested stories be sized to 2-3 days?
Related Question: How to handle backlog-items that are longer than one sprint?
|
In a stackOverflow question I have read that using a GUI designer program can generate lots of messy code and is considered to be a bad practice unless you're making smaller programs.
My question is why and how. Is it bad to use a GUI designer program? Why?
Additional details:
Programming on a Windows platform;
Only p... |
I have a MMOG server running on C++, using winsockets. My server won't support more than 200 players. I had the idea of redesigning it so it will use multiple servers instead of one, so, maybe, for example, each server could take care of a number of players, and, if it was too laggy, it could transfer the responsabilit... |
Somewhat related to this question, say that I have an object category which, depending on which type of object I have, has different restrictions on what it contains. (if you can reword the previous sentence to make more sense I'd appreciate it)
For example
var SomeSchema = new Schema({
_id: ObjectID,
[... large n... |
I really want to start working in OS development, particularly kernel development, with the Open Source Darwin Project - building my own Mac-like operating system, however I am simply not experienced enough to work in the black art of kernel development - I'm constantly deterred by comments : "your code has to be close... |
I am using the new phonegap 1.5.0 (which is confusingly renamed cordova despite no mention of the rename on the phonegap site), and I'm finding that the white-listing feature on iOS is quite restrictive. I understand that having a whitelist is more secure in that it only allows trusted domains, but what if you want to ... |
I am looking for statistics (or estimations) that backup the claim that coding standards help reduce bugs. Hard-numbers would be nice, although I haven't had much look finding any. I've even looked at bug tracking for various open-source projects, but have not been very successful finding what I need. Does anyone ou... |
I've written a java program that generates all repetitive permutations based on the characters and the length given.
When I execute my code in Eclipse, it generates a file with 1,000,000 permutations in only 15 seconds. Yet if I run the program on the same machine in the command prompt using "java permutation" It takes... |
I have code like this (pseudocode)
foreach(Box box in boxes)
{
if(boxFilter.PassesFilter(box))
{
// do something useful
}
else
{
Log.Log(format("Box %s was rejected", box.BoxId))
}
}
But now I'm thinking I'd like the log message to have more information such as "Box 1 rejected becau... |
I'm thinking of some of the array functions. "key", "each", "pos", "range". These are often very useful as local identifiers! I have also seen code that (ab)uses $return, $list, $array, $string. What are other PHP programmers views on this?
Local identifiers only! I wouldn't use them as members or method names of a cla... |
I'm currently studying engineering in Telecommunications and Electronics and we have migrated from assembler to C in microprocessor programming. I have doubts that this is a good idea. What are some advantages and disadvantages of C compared to assembly?
The advantages/disadvantages I see are:
Advantages:
I can te... |
Say you have an interface IFoo:
public interface IFoo {
void Bar(string s);
int Quux(object o);
}
In version 2 of your API, you need to add a method Glarg to this interface. How do you do so without breaking your existing API users and maintaining backwards compatibility? This is mainly aimed at .NET, but can ... |
I'm a fan of using assertions in the code to check for preconditions. The question is whether is it wise to use assertions in public methods to check the precondition?
My personal opinion is, that if my method can not handle the absence of a parameter (or some invalid value of it) and it is part of an API but does not ... |
I came across sharding in MongoDB but did not get what exactly is it. What I understood is it's better to have more small servers than a huge one for data storage and when the data exceeds the capacity of one server you can use another machine to store data. Can anyone give some more idea about sharding?
|
I am working with a web application, using TFS. Every time I build the site it takes an unproductivly long time to start up again. I would like to have a second mapping of the site on my c drive, where I would only get latest and build once a day, so this version would always be fast. This would be like a "readonly"... |
We are a small group of 5 people that is about to start a new project. This is the first project where we will go all-in on scrum.
We are struggling a bit with how we are going to establish a base for the project (frameworks and the like). Such tasks are not something the user will benifit from directly, so we are havi... |
I am trying to show some information from a [TestMethod] method.
Usually we use NUnit and a line with Console.WriteLine runs fine and we can see it in 'output' window, but on this project we must to use Testing tools embebed with VS2010 and Console.WriteLine doesn't run because we cannot see anything.
|
Given a parent entity with a collection of child entities where there must be exactly one primary child of the group?
To make the question more concrete, I've seen a number of ways that this pattern might come up -- a group of people where one person is the leader or the contact details for a person where one is primar... |
Scenario: Stationary view with sequential timestamped samples in 2D-color where the comparison is only done between one pair of neighboring samples.
Background:
Have never used OpenCV before,
Limited understanding of computer vision,
Moderate experience scripting programs.
Questions:
Given the information provided... |
I'm going to start my first real project in Ruby on Rails, and I'm forcing myself to write TDD tests. I don't see real advantages in writing tests, but since it seems very important, I'll try.
Is it necessary to test every part of my application, including static pages?
|
I need to allow the user to create an binary tree. I have a Backbone Model populating properly from the database, the problem I am stuck on is how do I setup the ui elements in a way that is fairly easy to use?
The general idea is I want to create a boolean expression that contains logic and tokens. The tokens will be ... |
A while ago I made Conway's Game of Life. I'd like to make something similar (in C++), where each cell would exhibit behaviours such as:
Movement
Reproduction
Killing of other cells (moving onto another cell, for example)
Over time, the cells would 'learn', and I'd (hopefully) end up with a set of behaviours that are... |
I try not to cross-post, but the only response I got at stack-exchange was to post here...
What's the preferred practice for a compile-run cycle in emacs?
Previously, I used alt-x compile (mapped to F12) with make as my compile command. Within the Makefile I had an entry which would run the program that was compiled. T... |
In my experience, it seems as though the Waterfall model has proven to be too inflexible and non-responsive to requirements changes to be considered a viable method in the modern world of software development. The growth and proven track record of more agile, iterative methods seems to indicate that there is no reason ... |
Ok, so I have what appears to be a complex situation, and I'm wondering how to best organize it. I have limited experience with Git so I might be missing system.
I have a framework developed internally. This framework is being used my ProjectX, ProjectY, and ProjectZ. If I update the core components of the framework (L... |
As a beginner programmer I've only worked with programming computer based applications, but a question has been coming to my head very often since I started programming and I can't get it answered properly.
Machines don't act on their own, that's the programmer's job, he tells it what to do and when to do it, but my cu... |
I am currently working with a Qt Application which tries to use multi threading to accomplish two task
To Prevent the Main Thread's Event Loop from being blocked
To increase computation efficiency
You would think it is a good idea, but it turns out that this might be inefficient. In Qt, the client is not permitted to... |
I've been warned that LGPL v3 forbids any kind of modifications that would prevent reverse-engineering, including software protection such as obfuscation.
In practice, does this license make it illegal to use something like SecureSWF, or simply a JavaScript minifier, when linking a program with a LGPL-licensed library?... |
Scrum is best for teams with generalists members, that is teams where 2 people at least can do the same tasks. My main concern is to find good solutions to adapt scrum (what to keep, what to remove, what to improve) for teams made of specialists?
Suppose you have a team of 5 developers (not real, just for the example):... |
I have written several Java utilities that I am now consolidating in a single, more organized code base. I have never distributed this code, so the only copies are currently in my possession.
While I will probably release the whole thing or most parts of it under an open source license, I'd like at the moment to keep m... |
We are working on an ASP.NET-based XML Web Service that we will be using for our own purposes as well as using it as part of a product offering for our integration partners.
Once it goes live we will be working on future phases of the project, and it occurs to me that the service's details may need to change over time... |
So I ran into a Dictionary<int, int> today at work. This just seemed weird to me because I would have probably just used a List<int> instead. Is there a difference and would there be a use case where one structure would be preferred over the other?
|
Why do programmers even like the idea of open source? I am not talking about the creators of those projects, of course they get fame, but I am talking about the industry in general, why are we so fond of the open source concept when it brings so many bad impact to the industry?
First, projects like wordpress and other... |
In this answer to a previous question of mine about scripting languages suitability as shells, DigitalRoss identifies the difference between the macro languages and the "parsed typed" languages in terms of string treatment as the main reason that scripting languages are not suitable for shell purposes. Macro languages ... |
I have started a project to write an async PostgreSQL driver on Scala and to be async, I need to accept callbacks and use futures, but then accepting a callback and a future makes the code cumbersome because you always have to send a callback even if it is useless.
Here's a test:
"insert a row in the database" in {
... |
I'm currently working on my first biggish project. It's a frontend facebook application that has, since last Tuesday, spanned some 6000-8000 LOC.
I say this because I'm using the MVC, an architecture I have never rigidly enforced in any of my hobby projects. I read part of the PureMVC book, but I didn't quite grasp th... |
I'm going to build my first real project in Rails that consist in a web app made of 3 main parts:
The static part where no database is used
The User registration part which will require a database and I can use MySQL since each user's row will have the same fields
The "App" where users will be able to create, organize... |
There's this framework that I'm helping to design. There are some common tasks that should be done using some common components : Logging, Caching and raising events in particular.
I am not sure if it's better to use dependency injection and introduce all of these components to each service (as properties for example) ... |
I am in the market for new employment, and found a position were they asked me to create a programming sample based off an assignment. I blew the sample trying to get it done quickly one night, and got declined - only to be given a second chance recently.
The concern was that I didn't really demonstrate object oriente... |
Assume that there is data that gets synchronized between several devices. The data is protected with a symmetric encryption algorithm and a key. The key is stored on each device and encrypted with a password. When a user changes the password only the key gets re-encrypted.
Under normal circumstances, when there is a go... |
Recently I've been increasingly plagued by what I would have to describe as one of my most frustrating and morale-killing experiences in this profession: Having to sit on a release that has been tested, re-tested, staged, and for all intents and purposes is ready to ship/deploy.
As an all-around solutions guy and not j... |
I have a question about "commercial" and "non-commercial" usage, also with the usage of MongoDb.
Lets imagine we got a website without a business model, the site grows in popularity but still no incomming money. Are we talking about non-commercial at this point?
And once the website starts making money, is it allowed t... |
Is there a functional language which allows to use stack semantics - automatic deterministic destruction at the end of the scope?
|
I'm excited about the possibilities for duplex communication with WebSockets between a web browser and web server. I see that WCF for .NET 4.5 supports a WebSockets binding now, and I know there's a JavaScript API for using WebSockets. However, what I don't understand is how these are supposed to interoperate. Yes, ... |
If I want to host a website from my home, I buy a domain name. Then, I get a static IP from my ISP. Next, I point it to the IP address of my home system. I can even use the SQL server installed in my system and not worry about the size. I am not talking about piles of servers here. Just one server.
I was wondering if i... |
I wish to know if there's some way to know which is the elemnet of a logic operation is false?
Example.
if( String.IsNullOrEmpty(obj1) || (String.IsNullOrEmpty(obj2) )
throw("...............");
How can I kown which one of those is the empty one?
|
I worked as a lone developer for a long time. During this time, I developed a way of formulating and ordering commit messages: Refactor first, describe exactly the reason for the commit in the message, link to the issue tracker, ... There is even a script to create several sorts of change log (public, company-internal,... |
I was wondering if there are any computers that operate exclusively on boolean operations. For example, no add, sub, mult, or div in the instruction set (although these could be emulated with the appropriate boolean code). Rather, the cpu would work by comparing 2 bits at a time, with instructions like and, or, xor. I ... |
I'm working through the book "Head First Python" (it's my language to learn this year) and I got to a section where they argue about two code techniques:
Checking First vs Exception handling.
Here is a sample of the Python code:
# Checking First
for eachLine in open("../../data/sketch.txt"):
if eachLine.find(":") !... |
I figured this was more of an architectural question, so I chose to post it here rather than Stack Overflow.
So I'm building an MVC web application and have just finished writing the code that wraps my calls into the DB (DAL) and gives me access via an interface to Create, Update, and Delete my Business Objects. Quick ... |
So, I'm in a big geographically-distributed company, we use perforce and I'm starting to make the case for a DVCS with a whitepaper I was requested to write.
I was thinking that one of the arguments I could use is the bandwidth saved using a DVCS, and technically if there were binaries to download (there are, but they'... |
I'm considering the reengineering of my web development ecosystem. We use Git very successfully to deploy new changes to our Production, Staging, and Development servers. Traditionally, I've always had a copy of Apache on my local machine - in the interest of keeping my local machine as lean as possible, I'm considerin... |
Here's a service abstraction that I am working on :
public abstract class Service
{
public ILogger Logger{get;set;}
public IQueryManager QueryManager{get;set;}
public ICommandManager CommandManager{get;set;}
}
Then I have to call them in my class as usual :
Logger.Log("Something");
QueryManager.Query(new QueryObje... |
How does Photoshop or other image editing software change an images contrast? What does contrast mean when we process an image pixel by pixel? Or what does image contrast mean at all?
Here I created a very basic image to understand image contrast. This is a 10×10 pixels image that gets a 100% non-legacy contrast adjust... |
I have read in a recent code review that both ternary operator (condition ? foo : bar) and the XOR operator ^ are rarely used in Java. Is it true?
If yes, is this because they are less readable? or some other reason.
|
I am developing an open source program which for my school project. I have done some research on it, but there are still few questions. It is a school project, it is not any advance application and I am willing to share my work.
Is that mean if I release my program with license, people will afraid to change my code b... |
We're deciding on how to store translations of some descriptions of database items.
We could go the traditional way and keep a translations table (and a language table and an object_translation linking table) OR we thought it might be better to just have a Description column that contains JSON like the following:
{
... |
Firefox/Chromium have well implemented(?) parsers. Then why are parsers like lxml and other such parsers being developed with so much effort put into it?
Aren't they re-inventing the wheel? Or are they solving a different problem? Can't parsers in browsers be made into standalone libraries?
|
Several people have forked my github repo but they have not fetched-merged from upstream. So my original repo has evolved significantly since the fork took place, and meanwhile these people are showing an old outdated version of my work, which kind of makes me look bad (e.g. what they're displaying is incomplete, conta... |
I was looking at Code Complete on the shelf, thinking, "Outside of the Mythical Man Month, this may be one of the few mass market Software Engineering books to stand the test of time." For this reason, I'm thinking of jumping in to reread it.
I'm curious - has anyone else given it a second look recently? I so, did yo... |
I work for a product development organization that is in online advertising. The assignments I receive are almost always on platforms or tools that I have never worked on before. At first it was android. Then node.js, then windows phone, then debian packaging, then python, hadoop, ganglia, reverse engineering, geo Post... |
Often times it's a good idea to have an abstract base class to isolate the interface of the object.
The problem is that copy construction, IMHO, is pretty much broken by default in C++, with copy constructors being generated by default.
So, what are the gotchas when you have an abstract base class and raw pointers in d... |
Earlier, I asked a question about how to measure the quality of a project. The outcome of that question was that the quality of the project can be divided into two parts:
Internal quality (code quality, measurable by code quality metrics)
External quality (Acceptance test, how well the software meets the requirement... |
So, I'm preparing to consider the outcome of training a lot of people (>25) to use Mercurial coming from a centralized mindset. I've done it with individuals and had success with it, although the time invested in each one has been different and most of them have been both proactive and open to trying something new.
I w... |
Can anybody explain the difference about soak and stress testing? I googled about them and found that both are about to test the software beyond its limits. Is it right for both testing strategies?
|
Are there any open-source tools to measure the standard of a web application project? I want to verify my project for:
Possible security leaks (SQL Injection etc.)
Performance
Stability (in high concurrent environment)
and other quality metrics.
|
Given that changes to the API/public method signature should be minimal to prevent breaking those client codes that use these methods, I was wondering if the Law of Demeter is less applicable to these.
A simple example:
class Account() {
double balance;
public void debit(Transaction t) {
balance -= t.getAm... |
I'm currently working on an indie project, so I don't exactly have the luxury of throughout human testing or external code review — however, I don't see any difficult bugs in my current code (I fix them as I see them, and most of the time they're just wrong field names and such, things that you fix in a minute or two),... |
I am using PetaPoco micro-ORM. It is indeed very easy and secure to work with databases using ORM tools, but the only thing I hate is extra code. I used to put most of the code in the database itself and use all the RDBMS features like Stored Procedures, Triggers etc., which it is built to handle better.
I want to kno... |
I'm working on a project solo and have to maintain my own code. Usually code review is done not by the code author, so the reviewer can look at the code with the fresh eyes — however, I don't have such luxury. What practices can I employ to more effectively review my own code?
|
I've been hiring several developers from different places around the world. It all goes well, but I see that some of them are abusing my polite overlooking too much lately.
They are all hired for a full-day. However, I see that after 5 hours in a day, not much has been done.
I am considering to develop a software that ... |
I have read many websites talking about how to avoid and how to design etc. I completely understand those strategies.
My question is based on the following preconditions:
You have a company with 1000's of developers.
There are different teams working on the same product but as modules.
New developers writing new code ... |
As per rule number 4 of Object Calisthenics by Jeff Bay (RTF) in The ThoughtWorks Anthology, it is recommended that one should "Use first-class collections".
Rule 4: First class collections
Application of this rule is simple:
any class that contains a collection should contain no other member
variables. Each collect... |
Say I have a web app that uses jQuery. Is it better practice to host the necessary javascript files on my own servers along with my website files, or to reference them on jQuery's CDN (example: http://code.jquery.com/jquery-1.7.1.min.js)?
I can see pros for both sides:
If it's on my servers, that's one less external ... |
The answer to this SO question has become stale: iOS version/device statistics - where can I find?
because time currency wasn't part of that question, and iOS version updates have been release since this question was asked.
Is there a web site or other publicly available source which keeps a current or frequently updat... |
XAML is essentially a subset of XML. One of the main benefits of basing XAML on XML is said to be that it can be parsed with existing tools. And it can, to a large degree, although the (syntactically non-trivial) attribute values will stay in text form and require further parsing.
There are two major alternatives to de... |
I have signed a Non-competitive agreement but I would like to be able to reuse some code across all projects that I work on for this company. So, which license can be used for my library code that would basically say the following:
I (the author) can use my library code in any client project.
You cannot use my code in... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.