instruction stringlengths 34 19.9k |
|---|
I have the following project structure I would like to implement. I would like to know if there are any pitfalls to structuring my code this way. It is going to be using Microsoft's WebAPI, an MVC 4 project, and Plain Old C# Objects (POCO). The explanation follows.
First off there is going to be a class library project... |
I'm working on a project which runs as a process, on a regular basis. The results of the projects daily run are used by other projects. This brings me to question how our team writes stories.
The normal format, As a [role] I want [goal/desire] so that [reason] does not seem to apply, but at the same time I'm doubting t... |
I'm developing a series of repository classes and a UnitOfWork class (plus its IUnitOfWork interface of course). I'm using Castle Windsor, which injects dependencies via constructors.
My business tier has classes such as "CustomerBusinessLogic", with methods like RetrieveCustomer, SaveCustomer, etc. These in turn use t... |
I am working on a project with legacy code where it does not have much code coverage. One of the idea to improve that is to enforce a rule that each code check-in must have test, not only test but functional test as well, so that we can verify that the existing code did not break.
I would like to get some ideas, both p... |
I am designing a simple GUI that will allow a user to create a GPX route by clicking repeatedly on a map panel. I am faced with a design dilemma for how to represent the nodes and route. This construct can be abstracted as follows:
the user clicks n times on the screen in sequence to create a chain of n nodes
after ... |
I understand that two of the many more options for inter process communication can be :
Shared memory
Sockets
Actually I saw these two options being exposed by Intellij Idea for debugging a Java application . I want to know what are the pros and cons of each approach .
|
It's more of a scenario, but it isn't far fetched at all. Let's say I have an Aggregate Root (AR) Warehouse which it's used to manage product stock. The Product itself is an AR in a different bounded context (BC) but in this BC is represented only by an id. In the Warehouse I can add a new product (must be unique), Ica... |
I'd like to know what would be a better approach to invalidate/update cache objects.
Prerequisites
Having remote memcached server (serving as cache for multiple applications)
All servers are hosted by azure (affinity regions, same data centers)
Cache object size ranges from 200 bytes up to a 50 kilobytes
Approach 1... |
In what all aspects, calling a function with and without new keyword differ in javascript?
I mean what all things are differing between?
testFn() vs new testFn()
|
A bit of background (in case I'm mistaken)...
I think I understand that (it's an oversimplification):
manually entering codes into memory (or on a punchcard) is "first generation language"
using mnemonics corresponding to CPU instructions would be a 2GL (like assembly language)
C/C#/Java/Objective-C are all 3GLs
SQL i... |
I've been attending quite a few interviews recently and have been asked by companies to answer "design a [insert model]" questions more than a few times.
Is this normal in the industry nowadays? I've been in the software world for more than two decades and have attended my share of interviews, but I am seeing this pa... |
I'll be quite to the point, is there any way to make Javascript a bit more concealed than it usually is or is Javascript always out and open if you look in the source code ?
This is about hiding proprietary algorithms that would dispense a service that does not exist yet (to my knowledge) on the market and is not reall... |
Currently, I'm a long Eclipse user because my past and current companies always deal with eclipse. Recently I met some example java codes created using netbeans. I downloaded and tried Netbeans 7.x and 6.9.x, but they're more heavier and eating memory resources than Eclipse Indigo.
So anyone know which past version of ... |
This might be one of those "not answerable" or "just opinions"-questions but I thought I'd give it a shot.
I'm developing an app with health care information with a friend who's a doctor. The basics of app are done and the information in the database is shaping up so now I've come to the question of wether, and if so h... |
I am newbie to TDD (writing first project following TDD practices).
I have fairly basic interface IProfiler and an implementation Profiler.
interface IProfiler
{
bool IsBusy {get;}
long Elapsed {get;}
}
A Simple Test
IProfiler profiler = default(Profiler);
[TestInitialize]
public void Initialize()
... |
I'd like to ask how to protect my code that is running on a client server from being altered and/or copied.
It's running on Ubuntu Server with the standard Apache Php Mysql stack.
Any software needed would preferably be open-source.
I'd also like to terminate the application when there is a license problem.
Doing thi... |
I would like to use a timer in my C# program with millisecond accuracy to keep a camera in sync with some events and keep shooting a picture every 250ms (or 1/4 sec, or I might adjust it to even shorter times like 200ms or 100ms). The normal timer event can be used for this.
But I wonder what would be the best way to d... |
I don't know what best to give as title to this so pardon me if it sounds weird.
I saw this question asked on IT Security and another site asking people to disable Java from their system or browser because it's vulnerable.
As a lover of Java, though currently doing C#, I would love to still do more Java in future, but ... |
As I have been learning to program, be it in my intern-ship or school, I have often come across situations where an extra piece of software is needed (from fairly basic to quite complex) and I am almost always told that I shouldn't waste my time developing a solution and use something someone else has already done.
Doe... |
I've heard people saying usage of JDBC (Java Database Connectivity) isn't recommended in Java applets. All I they say is: 'because of the security reasons'. What 'security reasons' do they mean? What would a potentially 'bad person' do when he/she found out about JDBC used in an applet, placed somewhere on a website? ... |
I have a software patterns exam this week and one of the topics we are to study is Efferent and Afferent coupling.
I understand a package has a high Ce (efferent coupling) if it depends on a number of other types.
For example:
class Car{
Engine engine;
Wheel wheel;
Body body;
}
This class would have a hig... |
I'm resistant to calling the "main" class the same as the namespace, but I sometimes find myself needing it. Considering I'm using the Vendor.Namespace.[Subnamespace].Class formula, imagine this scenario:
[MyFramework]
[Database]
Database
Sql
Schema
DriverAbstract
DriverInter... |
In the C++ STL, priority_queue (heap) can be used with any underlying container, such as a deque. How does the implementation stay O(log n) if deques don't swap an item in index a with index b in constant time?
|
I want to understand how web accessibility experts deals with websites if they want to confirm that those sites are compatible with accessibility guidelines. Do they have to understand any server-side language? or just HTML and CSS?
For example, if there is a company website which provides services for other sites to e... |
Lets say I'm displaying a bunch of data (model) using a View class for rendering. However, a lot of the data has sub-data (models) complicated enough to require separate rendering classes.
In my design, a View class has a model which it is rendering, and has many children Views which display the sub-data. In some cases... |
In our company, we need to build a web interface onto an embedded Linux platform. I kind of see 2 options: You use a technology where the HTML and JavaScript is generated on the server side (Think JSP, Grails, but is is something that is using C++ and generates HTML/JavaScript) or you create a HTML5 'client' applicatio... |
Stumbled upon this post that talks about making async web requests.
Now simplicity aside, if in real world, all you do is make an async request and wait for it in the very next line, isn't that the same as making a sync call in the first place?
|
I'm rewriting a set of file readers that a former-colleague of mine created that read raw-point data of XYZ (Cartesian) coordinates or RTZ (Polar) coordinates. Currently the data is stored directly in the reader, making everything rely on the state of those objects. I'd like to separate the reader from the collected da... |
I am implementing inheritance of something called Contexts. Each Context holds a link to its parent context. If that Context is the root Context, its parent is null.
In order to walk up the inheritance tree and get the data from each Context, I want to do this (in pseudocode)
private Hashtable getDataAsMap() {
Hash... |
So far all my development in C++ has been targeted to Windows, however I have always had it in the back of my mind that I will someday be targeting Linux. I am aware therefore of the need to select cross-platform libraries, and to keep my code as portable as possible (or provide alternative implementations for code whi... |
Django creates a table name by joining the app label with the model name. A project can have many apps. If two have the same label, how can both be used in the same database?
I'm currently using very long app names to minimize that risk (such as foo_bar_baz instead of nesting modules like foo.bar.baz - app label baz). ... |
I want to make Python script that will accept input from Vim and send it to my web-site. So basically I want to make Vim my text-editor for blog articles.
Of course, I need to authenticate and authorizate. I wanted to simply ask username and password. My college asked me why not to take login data from file. I answered... |
I am new to web development and just started exploring the things. I read about how web page is processed and sent to client by a web server but I got confused with application server. what is the difference between them ? why app. server is needed ? and few examples of both of them .
|
I have been in various Agile projects and seen many release burndown chart styles. Most of them were handled manually since somehow all the tools that I have run across don't produce really useful burndown charts.
In reality, we may not be dealing with all stories estimated and we just keep burning down. Many times, th... |
I know pair programming is an agile software development technique in which two programmers work together at one workstation. One, the driver, writes code while the other, the observer, reviews each line of code as it is typed in.
But I just wonder the strategy still work in the case. For example
if they have a very ... |
I have some experience in Java programming and enterprise application development. I have done OOP, data structures in C++ for my undergraduate studies. But I couldn't touch C++ for years. Now I am interested in C++ again and I would like to polish my C++ knowledge and become an expert in C++ . How do I start my journe... |
We develop social-based applications for mobile. Every application consumes RESTful API web-services. When I implement login I usually store the username and password somewhere on device. Then I send them and as a response I get access to my profile. But I also know there's another way to do this.
One somehow generates... |
This isn't a rare case and occurs with me often and I spent countless time trying to debug the code.
Latest example, this PHP code where I used $email for the parameter and for object as well.
private function _mail( $email )
{
if( filter_var( $email, FILTER_VALIDATE_EMAIL ) ):
$email = new Zend_Mail();
... |
I am in the process of a creating a small web portal for the department I'm working in. For this is need to present some data, and have found the following: http://www.pchart.net/, which could seem to be of great help to me.
The above is licensed under GNU GPLv3, and my question is whether it would be allowed for me t... |
Context
I'm currently working on a personal project involving functional reactive JavaScript, and I've come up with an odd question. Note that this question is not JavaScript specific, but that is the context in which I am asking it.
Scenario
When filtering a collection of data, you end up with a smaller set of data. T... |
I have a function that accepts either a string or a dictionary as an argument. That is, it can be called as either:
lookup_person({name: "John Smith", age: 57})
or
lookup_person("John Smith")
My first inclination is to use type or isinstance to distinguish the type of the argument, but I've seen a lot of ink spilled ... |
Background
Software engineering is the application of a systematic, disciplined, quantifiable approach to the design, development, operation, and maintenance of software, and the study of these approaches; that is, the application of engineering to software.
My instructor, when explaining this definition has told me th... |
This is what I guess would happen:
If two cores tried to access the same address in RAM, one would have to wait for the other to access the RAM. The second time that each core would try to access the same address, they may still have that RAM cached, so they could access their respective caches simultaneously.
If two... |
Often what's displayed to a user (e.g. on a web page) will be based partly on security checks. I usually consider user-level / ACL security to be part of the business logic of a system. If a view explicitly checks security to conditionally display UI elements, is it violating MVC by containing business logic?
|
I have a function containing other functions. These function are called based on value of variable action.
These sub functions are logically grouped - i.e., they all deal with file manipulation.
Each function has 2 to 5 lines.
I would like to improve the style.
Is there a more concise way of achieving this end than wh... |
Objective-C lacks private methods or java-esque final methods. This means that it is possible for a subclass to (accidentally) override some of the internals of a superclass.
How does one prevent overriding methods in Objective-C?
|
I've got some code that I want to run when certain HTML elements are added to the page.
To do this, I have a "runOnRender" function:
runOnRender: function (func, args, interval) {
var that = this;
var guid = hb.getGuid().substr(0,7);
var checkFunc = function () {
i... |
Most low latency/high frequency programming jobs (based on job specs) appear to be implemented on unix platforms. In a lot of the specs they make particular request for people with "low latency linux" type of experience.
Assuming this does not mean a real-time linux OS, could people give me help with what this could be... |
I have been stuck for some time on which is the fastest string search algorithm, heard many opinions, but in the end I'm not sure.
I have heard some people saying that the fastest algorithm is Boyer-Moore and some saying that Knuth-Morris-Pratt is actually faster.
I have looked up for the complexity on both of them b... |
This question could go here or on S.O. perhaps...
Suppose that your training dataset contains both categorical and continuous data such as this setup:
Animal, breed, sex, age, weight, blood_pressure, annual_cost
cat, calico, M, 10, 15 , 100 , 100
cat, tabby, F, 5, 10 , 80 ... |
I have the following sample question for a compilers exam and wanted to check my solution.
Convert the following grammar into an LL(1) grammar which recognises the same
language:
E -> E + T
E -> T
T -> id
T -> id()
T -> id(L)
L -> E;L
L -> E
For my answer I have
E -> T E'
E' -> + T | ε
T -> id
T -> i... |
We recently had a consultant tell us that if a feature can only be tested via automated UI tests (e.g. Selenium, Coded UI), then there is an underlying architectural issue. While this statement might be a bit extreme, it is along the same lines of the testing pyramid in that UI tests should make up a small portion of ... |
In my company, we successfully working with agile practices - but without using iterations. The main reason is that we can't find a clean way to fit in QA in an iteration cycle.
We understand QA as an extra bit of verification to a certain build (release candidate) before this build gets deployed to the customer. The p... |
I'm making mandelbrot fractals in C using Xcode and I want to use parallel computing but everything I've tried so far doesn't work. Such as This Question and other how to guides. Whats the easiest way to use frameworks such as mpi.h to run my program in parallel?
|
I've been reading Martin Fowler's Refactoring. It is generally excellent but one of Fowler's recommendations seems to be causing a little trouble.
Fowler recommends that you replace temporary variables with a query, so instead of this:
double getPrice() {
final int basePrice = _quantity * _itemPrice;
final doub... |
Disclaimer: Not as exaggerated as the title suggests, but it still makes me uncomfortable. I'm just going to express honestly, so take it with a grain of salt. Just pretend that I'm talking about that coding standard that you don't like working with.
Edit: The fact that I don't like it, doesn't mean I don't use it or e... |
I have been developing an Immutable queue in java, but the version I have developed is supposedly slow and I have been suggested to create a faster version of the same and I have no idea as to how to accomplish that.
import java.util.ArrayList;
import java.util.List;
import java.util.NoSuchElementException;
public clas... |
In ASP.Net MVC, in the razor view, you can type this kind of code:
@Html.EditorFor(model => model.Name)
(in this case, it creates a textbox for the field Name of the object which is defined as the type of the model)
Now when i see the definition of the EditorFor method, it is this:
EditorFor<TModel, TValue>(this HtmlH... |
I'm looking at implementing a PHP based application, where by you have a certain route for example London to Edinburgh. Along this route, I want to calculate say a 10mi Radius or Polygon around the whole route/driving directions, check whether certain defined points/lat-lon's are within this radius. If so - Add them to... |
I realise this might be offtopic here - but I couldn't find a better place in the stackexchange family. And this question has simply been bugging me for years..
What I wonder is: can an eula define WHAT you use an application for? IE: if I write a text editor, can I say "You can't write fantasy novels with it".
I'm wo... |
The company I used to work for before we had automated unit tests to test our work. However the coding standards and architecture was not very important for tests. Of course you had to indent code correctly and put your braces where you are supposed to put your braces, but no one would go nit picking through your tests... |
Or more generally: to trigger compiler errors in test projects if something that can be checked at compile time is wrong?
|
I've written a recursive search algorithm to find the boundaries of a voxel data structure in order to render it more efficiently. I've looked around, and either it's such a simple and obvious technique that nobody's bothered to patent it, or it's novel and nobody's done it this way before.
It's openly "published" on G... |
I have a bit of experience with loop invariants but I'm not really clear on them. I'm trying to learn them through an example in Python. Can someone point one out or help me understand?
I've searched both on programmers.SX and on the web but the only things I could find were invariants and design by contract -- nothin... |
Possible Duplicate:
To branch or not to branch?
A co-worker is against branching. I use branching all the time. I put the team onto a basic 3 branch system. I create my own feature branches. Said co-worker tends to have good ideas, follow best practices and I tend to agree with him on many such things. Except ... |
Given a mutable property, it generally makes sense to only hold/store that property in a single place. When the data needs to change you only need to update a single field, and you can completely avoid bugs where the different fields get out of sync.
An extremely simple example could be:
The 'right' approach:
class Own... |
Although it is a commonly held opinion that planning poker improves the accuracy of project estimations (a small sample of which demonstrated on this question), has any defined research been done on the subject?
More specifically, I am looking for non-circumstantial information showing that planning poker would be an i... |
I have built a QlikView script generator (QVS), that can be used to generate large script files for data imports from SQL Server to QlikView.
QlikView does not like 'fully' normalised database structures (loops between several tables): for example, three tables A, B, C in SQL Server could have three PK/FK links; in Qli... |
Possible Duplicate:
When should the VCS history of a project be deleted?
I am experienced using svn and recently started learning git. I was quite shocked to learn that git has features that allow you to "rewrite history".
Coming from svn, I had accepted as sacrosanct the source control principle that once a change ... |
I'm working a small-to-medium legacy codebase and when working on a ticket I will come across code that should be cleaned-up or that I need to clean-up just to be able to understand the follow of the application.
A real example is:
if( !a && b ){
doSomething1();
doSomething2();
doSomething3();
doSom... |
I was reading a thread titled "strlen vs sizeof" on CodeGuru, and one of the replies states that "it's anyways [sic] bad practice to initialie [sic] a char array with a string literal."
Is this true, or is that just his (albeit an "elite member") opinion?
Here is the original question:
#include <stdio.h>
#include<str... |
I want to write a multithreaded server application which is able to process requests in a multithreaded fashion while keeping up execution order of incoming requests of the same client.
For example if client A sends a message M1 and then a message M2 the muiltithreaded server must process these requests in exactly the ... |
I did a look around and couldn't find a question that addresses my case, so I figured I would post.
I have a situation where as a new team, we ran into 2 unforseen spikes (is there a better term?) during a sprint. We 'thought' we knew, but then we had to research mid way, so this introduced a spike.
My questions are:
... |
I'm trying to come up with a name for a class that can represent both files and folders. Anyone know a word for this?
|
Here is a C++ class that gets constructed with three values.
class Foo{
//Constructor
Foo(std::string, int, char);
private:
std::string foo;
char bar;
int baz;
};
All of the parameter types are different.
I could overload the constructor so that order doesn't matter.
class Foo{
//Constr... |
I've read a bit on denotational semantics (DS) and I'm very intrigued about the process of designing computer programs where types and functions have strong and clear mappings to mathematics.
Are there any resources that discuss designing programs based on DS in detail? I've seen a few superficial treatments of the su... |
I'm trying to educate myself on potential web attacks. I just found a site (which will rename anonymous) where it shows me what looks to be like the php session id inside the cookies section of the request header.
My immediate reaction was "wow, that's bad"... but then i couldn't really come up with a scenario as to ... |
Every time I look for an IDE (currently i'm tinkering with Go), I find a thread full of people recommending Vi, Emacs, Notepad++ etc.
I've never done any development outside of an IDE; I guess I've been spoiled. How do you debug without an IDE? Are you limited to just logging?
|
I will explain the context of the problem first. For a University project I'm going to implement an Android application. The Android application (and others) will be able to send data to a remote source, that remote source will also be able to send messages to the Android applications. For example the messages may be "... |
I am designing an API which mostly involves refactoring the original code.
So Right now I have a method which has two big chunks which are seperated by an If-else condition, which in my opinion is not exactly the best idea.
The code looks like
do_something():
if (isTrue):
#Large block of statements.
... |
We have a branching structure of:
multiple dev branches for each major new feature
Main branch, merged into from a dev branch once a feature is ready for testing
Release branch, merged into from Main once a feature is ready for production
We often have new features completed at around the same time that end up in Mai... |
I don't want to know which IDE is best, because that's subjective. I'd like to know how to evaluate an IDE. I'm primarily a vim user, and realistically happy there, but occasionally look at languages that have powerful IDE's and I consider using them.
The problem I run into is that they mostly seem the same to me. Cert... |
I'm working with an embedded device with a unique protocol that sends messages to other devices and I'm making an application that parses the sent packets. Each packet carries 8 bytes. The protocol is defined as where first byte is header and remaining 7 bytes is the data.
They are trying to pass a particular ID string... |
I'm designing and prototyping a server that has the following characteristics:
during the daemon's initialization it spawns nine "manager" servers, each of which solves one part of the overall problem.
after initialization, the daemon accepts connections from clients, forking a "slave" server for each which connects t... |
Is there a rigorous way to classify programming languages ?
If so, can the various "dimensions" be quantified ? (degree of purity)
For instance, I just went on the Shade language website (I am not affiliated with it in any way) and saw :
"semi-functional" -> But how much is that language semi-functional ? -> quantific... |
I am writing an enterprise web-forms-frontend application for in-house use. It has Direct access control (DAC) masquerading as Role-based access control (RBAC).
For anonymization purposes, let's call the main unit of information stored in my application a Document, and the roles in the company a Boss, a Grunt and a C-... |
If I wanted to make a suggestion to a change to how the UPDATE statement works in SQL, how would I go about it?
Is there a website for the next standard?
I googled, but just kept getting the Wikipedia page.
|
Although there are many similar questions here regarding using GIT for maintaining different versions, none seem to answer my specific case.
I'm OK with how to use GIT to do my development, using different branches to do hot fixes, versioning etc.
However, I am making a commercial application that needs to track variou... |
I am studying Visual Studio 2010's architectural tools for application lifecycle management.
After we have sketched some modeling diagrams, we wonder now how should be the natural workflow to convert that to architecture-compliant code.
We noticed that UML Explorer tab keeps track of entities created in class diagrams,... |
I have read an article with following example:
void func()
{
if (condition1)
a = a + 1;
if (condition2)
a = a - 1;
}
It says the CC is 3 as there are three possible paths. How come? Why not 4? I Would expect TRUE,TRUE; FALSE,FALSE; TRUE, FALSE and FALSE, TRUE.
Does not matter what the statements are. CC=Ifs-EndPoints+... |
I'm working on a simple UI system for a game. The building blocks are Widget objects, which can contain each other. There are several sub classes of Widget, e.g. LabelWidget, ImageWidgetand ButtonWidget.
Since nesting is possible, a ButtonWidgetis really nothing but a container for a LabelWidget and an ImageWidget. I'm... |
Some people run the bleeding edge of technologies - updating the day that something is updated. In production, this isn't as appropriate.
Researching about if the current (Java 7) version is ready for production produces a significant amount of old material that might not be correct anymore (at the time of this writin... |
I'm currently writing a library of helper functions to produce some repetitive markup. I have a reference to the markup the functions should produce, but I'm curious about how I should go about unit testing this?
There are a lot of unit tests needed to get full coverage of the number of different variations of output f... |
I'm looking at doing my first mobile development using Mono Touch and Mono for Android. I'd like them to communicate with an ASP.NET MVC 4 site I'm designing. I've worked with WCF and WebAPI in the past but I'm wondering if there are any quantifiable advantages to using one over the other in this context?
|
There is a decent Wikipedia article on the "Feature Creep", but it doesn't state an origin. A Google search only leads to some vague article claiming "Earl Rich" coined the term, but there isn't much backup for that claim. There is a Dilbert comic from 2001 on the subject, but the tone seems to imply that the term pre-... |
Googling around I found a particular page:
PCB Via Calculator
Looking the page code I found in the JavaScript code:
//copyright circuitcalculator.com
//please do not copy without permission
Taking in account the simplicity of this code, can I write my own JavaScript function for this? I think some related links can b... |
I am looking to quantify the cost or problems of bad software development practices. Specifically can software that has been developed resulting in an anemic domain model be quantifiable in terms of business cost or risk?
My initial thoughts (which are all nearly impossible to generically quantify) are: -
Reduced flex... |
I have recently began studying Makefiles in Linux. I have ample experience developing applications with advanced IDEs, such as Visual Studio.
My first impression and query after reading a few tutorials: is there any need to study Makefiles? Perhaps the IDEs are using it internally, but is this something everyone should... |
I frequently hear these two valuable programming practices: (1) lines of code should be 80 characters or less and (2) use descriptive names for variables, methods, classes, etc. I understand the reasoning for both of these words of advice, however, they seem to often be tradeoffs of each other. If I keep my code below ... |
This is a question I originally asked on Stack Overflow, but as a conceptual design question as opposed to a technical issue, I believe it may be more appropriate, or possibly have alternate parallel value, on this board.
The structure of a FiM++ program requires that it end with the closing of a letter and the code au... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.