instruction stringlengths 34 19.9k |
|---|
Recently domain driven design got my attention, and while thinking about how this approach could help us I came across the following problem.
In DDD the common approach is to retrieve entities (or better, aggregate roots) from a repository which acts as a in-memory collection of these entities. After these entities hav... |
I'm trying to build up some test cases, and have read that you should try and limit the number of assertions per test case.
So my question is, what is the best way to go about testing a function w/ multiple inputs. For example, I have a function that parses a string from the user and returns the number of minutes. Th... |
One of my major complaints about C++ is how hard in practice it is to pass std library objects outside of dynamic library (ie dll/so) boundaries.
The std library is often header-only. Which is great for doing some awesome optimizations. However, for dll's, they are often built with different compiler settings that may... |
After 10+ years of java/c# programming, I find myself creating either:
abstract classes: contract not meant to be instantiated as-is.
final/sealed classes: implementation not meant to serve as base class to something else.
I can't think of any situation where a simple "class" (i.e. neither abstract nor final/sealed) ... |
Based on the discussion around this question. I'd like to know how .so files/the ELF format/the gcc toolchain avoid problems passing classes defined purely in header files (like the std library). According to Jan in that answer, the dynamic linker/loader only picks one version of such a class to load if its defined in ... |
I am having algorithm mental block in designing a way to transition from Green to Red, as smoothly as possible with a, potentially, unknown length of time to transition.
For testing purposes, I will be using 300 as my model timespan but the methodology algorithm design needs to be flexible enough to account for larger ... |
Are there patterns or libraries or any official Microsoft SDK for using Visual Studio as a specifically Task-Focused UI?
For example, both Revolution R (IDE for the R language) and SQL 2012 (and I think SQL 2008 and possibly 2005) use Visual Studio as the underlying IDE framework.
Is there an officially supported SDK... |
How do you learn a new platform/toolkit while producing working code and keeping your codebase clean?
When I know what I can do with the underlying platform and toolkit, I usually do this:
I create a new branch (with GIT, in my case)
I write a few unit tests (with JUnit, for example)
I write my code until it passes my... |
I'll be the first to say that this question is a bit... out there. But here are a couple questions I bear in mind :
Is abstraction continuous or discrete?
Is there a single unit of abstraction?
But I'm not sure those questions are truly answerable or even really makes sence. My naive answer would be something along t... |
I've recently written a piece of software (without any other contributors) for a company which I part own. I was wondering if I could distribute it with the following permission notice, which is a modified version of the MIT License. Are there any obvious risks if I do distribute with this licence and does it give me t... |
I'm working on an array structure that will be used as the data source for a report template in a web app.
The data comes from relatively complex SQL queries that return one or many rows as one dimensional associative arrays. In the case of many, they are turned into two dimensional indexed array.
The data is complex a... |
I have to make a rather complex system for my diploma work. Logically it will consist of the following components:
Database
Web-service
Management with web interface
Client iOS application that will consume web-service
I decided to implement all the first three components under .NET.
Firstly I will create a database ... |
So lets say we have a clustered environment setup. We have a cluster SQL Server (I don't know exactly how its done but lets just say its been done for the sake of argument). Now if a website or application is trying to access that database for read/write (say an ASP.NET app or a C# Winforms app) and during that time SQ... |
I'm writing an app that does something like a custom number (license) plate generator tool where if I ask for the plate "robin" it will suggest I try:
r0bin
rob1n
r0b1n
Are there any published algorithms which can do this? It has to be able to handle replacing single letters with multiples, e.g. m with rn and vise-ve... |
As per Wikipedia:
In computer programming, a function may be described as pure if both these statements about the function hold:
The function always evaluates the same result value given the same argument value(s). The function result value cannot depend on any hidden information or state that may change as program ... |
Is there a single scenario (other than compatibility with ancient JVMs) where using synchronized is preferable to using a Lock? Can anyone justify using wait or notify over the newer systems?
Is there any algorithm that must use one of them in its implementation?
I see a previous questions that touched on this matter b... |
So for a clustered environment - how would this work with your apps?
What about your own custom .NET apps? Would there be a special way to develop them? I know that you could create a simple Hello world app, and cluster that, but that wouldn't be something you could see in terms of the UI or anything. So they would eff... |
On my great quest for compressing/decompressing files with a Java implementation of Huffman coding (http://en.wikipedia.org/wiki/Huffman_coding) for a school assignment, I am now at the point of building a list of prefix codes. Such codes are used when decompressing a file. Basically, the code is made of zeroes and one... |
I know that this will be a difficult question to answer without context, but hopefully there are at least some good guidelines to share on this. The questions are at the bottom if you want to skip the details. Most are about OOP in general.
Begin context. I am a jr dev on a PHP application, and in general the devs I wo... |
I have a situation where my parent knows about it's child (duh) but I want the child to be able to reference the parent. The reason for this is that I want the child to have the ability to designate itself as most important or least important when it feels like it. When the child does this, it moves it to the top or bo... |
Doing some reading on Stack Overflow, I've found a lot of information suggesting that proper organization of a file system is crucial to a well-written web app. One of the key pieces of evidence is high-frequency references to "separation of concerns" in questions related to keeping programs organized.
Now, I've found... |
Also according to Software Testing By Srinisvasan Desikan, Gopalaswamy Ramesh or ISTQB text books. Quality assurance is e.g. reviewing products, inspections, walkthroughs to see if all standards are being followed. This is preventive activity. I cannot see how this can be preventive?
For the references:
defect preven... |
Imagine you have such routines
/*just do X. Fail if any precondition is not met*/
doX()
/*take care of preconditions and then do X*/
takeCareOfPreconditionsCheckIfNeededAtAllAndThenDoX()
A little bit more concrete example:
/*create directory. Most probably fail with error if any precondition is not met (folder alrea... |
I have a Kendo UI Grid that I am currently allowing filtering on multiple columns. I am wondering if there is a an alternative approach removing the outer switch statement?
Basically I want to able to create an extension method so I can filter on a IQueryable<T> and I want to drop the outer case statement so I don't ... |
Is it possible to achieve Continuous Delivery using TFS e.g. Windows Service? There are > 1000 posts on how to use msdeploy with TFS for WEB projects.
I am trying to understand why there are no resources such as blogs, articles, msdn or best practises for Continuous Delivery for Windows service using TFS.
I am not sur... |
I'm never sure when a project is far enough along to first commit to source control. I tend to put off committing until the project is 'framework-complete,' and I primarily commit features from then on. (I haven't done any personal projects large enough to have a core framework too big for this.) I have a feeling this ... |
I would like some pointers to information which would help me understand how to go about providing the ability to filter a list of entities by their attributes as well as by attributes of related entities.
As an example, imagine a web app which provides order management of some kind. Orders and related entities are sto... |
2¹⁶-1 & 2⁵ = 2⁵ (or? obviously ?)
A developer asked me today what is bitwise 65535 & 32 i.e. 2¹⁶-1 & 2⁵ = ?
I thought at first spontaneously 32 but it seemed to easy whereupon I thought for several minutes and then answered 32. 32 seems to have been the correct answer but how? 65535=2¹⁶-1=1111111111111111 (but it doesn... |
It is a bit ironic, yesterday I answered a question related to this topic that was marked to be good and today I'm the one who asks. These are my thoughts and a question:
Also let's agree on the terms: QA is a set of activities that defines and implements processes during SW development. The common tool is the process ... |
First of all let me explain who I am: I am a PHP Developer working for a company developing their CMS which handles online stores, data feeds and other content like blogs. I have been programming for 6 years and 4 of those have been in PHP. (I used to be a C# developer).
My question is regarding PHP frameworks. I see... |
For the past 2-3 weeks I've been searching for different ways to implement custom video streaming and in more general video capturing and manipulating, going through DVR-cards, Video Capture Cards and stuff like that.
Somehow JMF was able to stay out of my sight for all this time, but since I find out about it I'm mor... |
In school, I've been told many times to stop using public for my variables. I haven't asked why yet.
This question: Are Java's public fields just a tragic historical design flaw at this point? seems kinda related to this. However, they don't seem to discuss why is it "wrong", but instead focus on how can they use them ... |
I understand the Heap memory divisions such as Young, tenured and Perm Gen.
But I'm just curious from where is the memory used for performing the Garbage Collector itself? Is it from any of these memory spaces or in the thread stacks ?
|
I have made a POS System for a client of mine using MS Access Server-Client approach.
He asked me to brand his software to allow only a certain "number" of users (cashiers) to access the POS System, and must be determined to the license his client will buy.
EX: 10 User License = 10 Cashiers ( not necessarily 10 users, ... |
Say, that you are handling a multi-step process (like a complex registration form, with a number of steps the user has go through in order). You need to be able to save the current state of the process (e.g. so the user can come back to that registration form later and continue form the step where they were left off).
... |
Say I've to develop an app that runs on iOS, Android and Windows 8 Mobile. Now all three platforms are technically in different program languages. The only 'reuse' that I can see is that of the boxes-and-lines drawings (UML :) charts and nothing else.
So how do companies/programmers manage the variation of the same pro... |
It is said that the Kanban methodology is suited for software maintenance and support areas, whereas Scrum is more suited for new product development. No process or methods are complete. Using the right one will help you succeed, but they will not guarantee success.
Is there a study showing which agile approach is best... |
First of all I'm developing a parser for an XML-based format for 3D graphics called XGL.
But this question can be applied to any situation when you have fields in your class that are optional i.e. the value of this field can be missing.
As I was taking a Scala course on coursera there was an interesting pattern when yo... |
I'm working on a Java project and I would like to add a plug-in system. More precisely, I would like to let the user design his own module, pack it into a jar, leave it in a "plugins/" subfolder of my application and be done with it. I've managed to get a child classloader to instantiate objects of classes located in e... |
I've been working with MVVM for a while, but I've recently started using MVPVM and I want to know how to create hierarchial View/ViewModel/Presenter app using this pattern.
In MVVM I would typically build my application using a hierarchy of Views and corresponding ViewModels e.g. I might define 3 views as follows:
The... |
We have a large project that has nearly 20 modules on it. We want to use WCF for the business layer.
We have thought of three ways to implement WCF our project:
Use only one datacontract and one operation contract. Send
ClassName, MethodName to operation and create class by reflection
then invoke the method in WCF sid... |
I am making program in Java in which I am making Dialog box, button, checkbox, etc. SWT widgets.
Now my problem is, I want like if in one execution button is made and in second execution checkbox is made then they both should display in one box.
So I need to store that box object.
How can I do that?
|
I have a query on whether the following requirements would need to be designed via Business Rules - this is for a JEE based application where currently this is coded as part of the Business logic.
System will create a tax account for every city, county and district
combination that imposes tax for only certain citie... |
Assume I have 4 points (they are 2-dimension), which are different from each other, and I want to know whether they form a square. How to do it? (let the process be as simple as possible.)
|
I'm trying to use a '~classic' layered arch using .NET and Entity Framework. We are starting from a legacy database which is a little bit crappy:
Inconsistent naming
Unneeded views (view referencing other views, select * views etc...)
Aggregated columns
Potatoes and Carrots in the same table
etc...
So I ended with fu... |
I am in the planning process for a new application, the application will be written in PHP (using the Symfony 2 framework) but I'm not sure how relevant that is. The application will be browser based, although there will eventually be API access for other systems to interact with the data stored within the application... |
I believe that agile works if everything is agile.
In software development area, in my opinion, if team members' code is integrated early, code will be more in sync and this has a lot of pros:
Early integration helps team members to avoid painful merges.
Encourages better coding habits, because everyone makes sure tha... |
We have very recently started a new project (MVC 3.0) and some of our early discussion has been around how the work and development will be split amongst the team members to ensure we get the least amount of overlap of work and so help make it a bit easier for each developer to
get on and do their work. The project is... |
I have to develop a real estate marketing CRM software for my client - where the application is installed on desktop but can also be accessed from web.
2 reasons why they want the application to run from desktop :
So that it can work with/without internet connection
They don't want their complete data to be online
... |
I currently use Resharper with VS 2008 Pro. I find it almost a necessity to be as productive as I can be due to lack of some of the basic refactors/shortcuts in VS.
However I was wondering if since VS 2008 improvements have been made that make it almost as good as Resharper?
|
I wrote a function and I'd like to find out if it is an implementation of some functional programming pattern or construct. I'd like to find out the name of this pattern or construct (if it exists)?
I have a function which takes a list of functions and does this to them:
wrap(fn1, fn2, fn3, fn4)
# returns
... |
So, my father is currently in the process of "hacking" together a database using FileMaker Pro, a GUI based databasing tool for his small (4 doctor) practice. The database will be used to help ease the burden on reporting from medical machines, streamlining quite a clumsy process.
He's got no programming background, an... |
I'm finding lots of 2-3k line files, and it doesn't really feel like they should be that big.
What is a good criteria to objectively call a source code file "too big"?, is there such thing as a maximum amount of lines a source code file should have?
|
I'm coming from a python CGI background and was wanting to move into something more contemporary and think I have decided upon web.py as the framework I would like to use. In regards to templating, previously I used formatted strings and the string.Template module to effect most of my templating needs. After reading th... |
I was wondering if I can use the aac codec in my commercial app for free (through lgpl ffmpeg). It says on the wiki:
No licenses or payments are required to be able to stream or distribute content in AAC format.[36] This reason alone makes AAC a much more attractive format to distribute content than MP3, particularly ... |
I'm developing a big community/forum website and I'd like to upload my code to GitHub to have at least some sort of version control over it (because I have nothing other than a .rar file as a backup, not even SVN), to let others contribute to the project, and also perhaps using it to let my potential future employers s... |
I'm just starting out on the implementation of a large enterprise-wide system, which has complex requirements and many stakeholders.
The company has been through high-level evaluation and tender process and determined to purchase a highly configurable "off-the-shelf" product rather than building an entirely bespoke sy... |
In the paper “An Extended Comparative Study of Language Support for Generic Programming” by Garcia et al. an interesting comparison of programming languages features for generic programming is given:
with the brief explanation of terminology:
Can anyone test Scala support for generic programming inside this framework... |
From brain driven development
It turns out, that every Function you’ll ever define in Scala, will
become an instance of an Implementation which will feature a certain
Function Trait.
There is a whole bunch of that Function Traits, ranging from Function1 up to
Function22.
Since Functions are Objects in Scala and... |
I'd like to create a web wizard or a wizard on/within a website.
I know there are several java frameworks for wizards but there is none for the web in particular.
If I search for a framework, I always get wizards to create a website, applet, servlet and what not. But never how to create such a wizard itself.
So the que... |
For a non-OOP language like google Go, is it idiomatic to go about implementing new container types using datatypes like arrays or lists so as to implement convenient functionality like contains method which is absent from all in built container types?
|
Possible Duplicate:
I’ve inherited 200K lines of spaghetti code — what now?
Recently I got hired to work on existing web application because of NDA I'm not at liberty to disclose any details but this application is working online in sort of a beta testing stage before official launch. We have a few hundred users rig... |
I am a sole developer and I have a web application template that I have created in Visual Studio. I am using GIT for source control, but only on my development machine. Presently I have a master and I create branches for new features, merging them back in to the master as I complete the features.
I am at a point now wh... |
I've got an implementation of the merge sort in C++ using a custom doubly linked list. I'm coming up with a big O complexity of n^2, based on the merge_sort() > slice operation. But, from what I've read, this algorithm should be n*log(n), where the log has a base of two.
Can someone help me determine if I'm just de... |
I am trying to find max value of an array, firstly i am shorting my array min to max after that i am using array[array.length-1] Is this logic efficient in large arrays?
public static int findMax(int[] array){
Arrays.sort(array);
int max = array[array.length-1];
return max;
}//end method
|
I am working on an HTTP Server in Delphi which simply sends back a custom XML dataset. I am not following any type of standard formatting, such as SOAP. I have the system working seamlessly, except one small flaw: When I have a very large dataset to send back to the client, it might take up to 2 minutes for all the dat... |
Some might argue this question is too general, but because keeping up seems especially relevant to programming, is anyone's experience that:
do employers expect you to stay current? what is the "industry standard" of expected time a programmer should spend keeping up-to-date?
is it generally acceptable that a progra... |
I mean, say you were writing professional grade software that would involve sensitive client information. (Take this in the context of me being an amateur programmer.)
Would you use hlib and hmac? Are they good enough to secure data? Or would you write something fancier by hand?
Edit: In context of those libraries cont... |
I'm attempting to design a single sign on system for use in a distributed architecture. Specifically, I must provide a way for a client website (that is, a website on a different domain/server/network) to allow users to register accounts on my central system.
So, when the user takes an action on a client website, and t... |
I've been writing a website in PHP. As the code becomes more complex, I keep finding problems that can be solved using the factory design pattern. For example: I've a got a class Page which has subclasses HTMLPage, XMLPage, etc. Depending on some input I need to return an object of either one of these classes. I use th... |
I'm new to OOP and design pattern.
I've a simple app that handles the generation of Tables, Columns (that belong to Table), Rows (that belong to Table and have Columns) and Values (that belong to Rows). Each of these object can have a collection of Property, which is in turn defined as an enum.
They are all interfaces:... |
I'm working on an application. I'm using a mixture of TDD and DDD. I'm working hard to separate the layers of my application and that is where my question comes in.
My solution is laid out as follows
Solution
MyApp.Domain (WinRT class library)
Entity (Folder)
Interfaces(Folder)
... |
I failed an interview question in C years ago about converting hex to decimal by not exploiting the ASCII table if (inputDigitByte > 9) hex = inputDigitByte - 'a'. The rise of Unicode has made this question pretty silly, but the point was that the interviewer valued raw execution speed above readability and error hand... |
I want to have fully cacheable pages in my websites, but one cannot do that if they contain user-specific data, like the userbar or things in the UI that can change depending on the permissions the user has.
So I was thinking whether it was possible to pull everything that is user-specific via ajax, and update the UI a... |
I got into an interesting internet argument about getter and setter methods and encapsulation. Someone said that all they should do is an assignment (setters) or a variable access (getters) to keep them "pure" and ensure encapsulation.
Am I right that this would completely defeat the purpose of having getters and sett... |
I'm drawing a flow diagram which should visualize the communication between 4 services I created.
Now I've got a question I'm not quite sure about. There are two ways the services could be started. Is it allowed to have multiple starting-points in a flow chart?
And: do I have to visualize error handling, like a service... |
Where does the term "front-end" come from? Is there a particular presentation/talk/job-posting which is regarded as the first use of the term? Is someone credited with coining the term?
The Merriam-Webster entry for "front-end" claims the first known use of the term was 1973 but it doesn't seem to provide details about... |
I am currently working on a WP8 application. My current design is to have each view bind against a specific view model directly.
Looking through the samples though, it seems that another way is to have all the view models accessed through the Main View Model and then have all the views to their view models through the ... |
What are the best methods of knowledge transfer?
What kinds of documentation should be expected?
What activities should take place before and after handover, both by the external party and ourselves?
|
Let's say I have a big corpus (for example in english or an arbitrary language), and I want to perform some semantic search on it. For example I have the query:
"Be careful: [art] armada of [sg] is coming to [do sg]!"
And the corpus contains the following sentence:
"Be careful: an armada of alien ships is coming to des... |
I'm doing a code-review on someone's code for class.
The class is about 800 lines long, contains a good dozen of functions but the description is like 1 line long.
I'm wondering, generally speaking, how long should the description of a class be? (in Java)?
|
I am a team lead with 5+ developers. I have a developer (let's call him A) who is a good programmer, who writes good clean, easy to understand code. However he is somewhat difficult to manage, and sometimes I wonder whether he is really under-performing or not.
Our company requires the developers to indicate the work ... |
We're evaluating a set of requirements for a customer who wants Liferay which mainly has AAA and Web CMS requirements, and allowing user to upload their own content. Also all inetgration is via web services.
However there is no need for other features such as actual "portlets", i18n, mashups, skins, themes, tagging, so... |
I have two classes Class A and Class B
In Class A, I have three methods that perform the save, delete and select operation based upon the object I pass them. In Class B I perform the logic operations, such as modification to the property of the object before being passed to the methods of Class A.
My problem is in Cla... |
I saw lot of code (for example some Android source code) where fields name start with a m while static fields start with s
Example (taken from Android View class source):
private SparseArray<Object> mKeyedTags;
private static int sNextAccessibilityViewId;
I was wondering what m and s stand for... maybe is m mutable an... |
My company has several versions of its core software in use by our customers at any one time. My job is to write bespoke Java software for the customers based on the version of core software they happen to be running.
I've created a common Java library that performs many of the tasks I regularly require in a normal pro... |
I'm an iOS dev, working for a small agency. I'm currently on a few smaller projects where I'm the only developer. We recently acquired a Jenkins server, but each project is left to fend for themselves as for how to use it.
I'd like to use it for making and distributing builds. My ideal would be:
Every commit is built ... |
Pushing new Sparkle releases of our internal apps is a pain. I have to make the build, make the release notes file, sign the .zip with the private key, and add a new entry to the appcast file tying everything together.
I'd love it if Jenkins could help: use the commit messages for the release notes, and automatically d... |
Most websites set max-age=31536000 (1 year) on the Cache-control headers of static assets such as logo images. Examples:
YouTube
Yahoo
Twitter
BBC
But there is a notable exception: Google's logo has max-age=691200 (8 days).
I've checked the headers on the Google logo in the past, and it definitely used to be 1 year. ... |
I'm new to Java and Eclipse. One of my most recent discoveries was how Eclipse comes shipped with its own java compiler (ejc) for doing incremental builds. Eclipse seems to by default output incrementally built class files to the projRoot/bin folder.
I've noticed too that many projects come with ant files to build the ... |
So we have a team with 2 developers one manager. The dev server sits in a home office and the live server sits in a rack somewhere handled by the larger part of my company. We have freedom to do as we please but I want to incorporate Kiln DSVC and FogBugz for us with some standard procedures to make sense of our decisi... |
I have read these related questions:
I'm a Subversion geek, why should I consider or not consider Mercurial or Git or any other DVCS?
git for personal (one-man) projects. Overkill?
...and I understand why git is useful. What I don't understand is why tools like git-svn that allow git to integrate with svn are useful... |
I just developed my first non-trivial android app. It was a complete nightmare. I came up with an idea, build the app, changed my idea, and implemented a lot of input from others on new features. All in all my app took 10 times longer than I think that it should have, it is almost impossible to look the source code and... |
I work in IT at a university and I'm working with about 5 different departments to develop a new process for students to apply to a specific school within the university (not the university as a whole). We're using a web-based college application vendor and adding the applicant questions for the school itself to the ... |
This may be a very simple question. I'm curious how blocking calls are implemented. Specifically, how do they block? Is this just thread.sleep?
|
In my project, I have a collection of classes. These classes for the most part contain data which is updated infrequently or not at all - that is they don't really do much - their purpose is to be passed around consumer objects that do do things, seperating data from functionality.
I would like to continue this model, ... |
I've spent the past few years working on iOS apps, and I'm now giving some serious consideration to creating an Android port of one of my apps.
I'm sure that complaints about fragmentation are a frustrating cliche to experienced Android programmers, but as an iOS programmer, I'm quite honestly overwhelmed by the number... |
I'm curious if anyone here has any idea how the images were generated as shown in this response: Which hashing algorithm is best for uniqueness and speed?
Ian posted a very well-received response but I can't seem to understand how he went about making the images. I hate to make a new question dedicated to this, but I c... |
I'm attempting to create a dashboard so that people not intimately involved with the project can get an indication of project's health. I'm struggling with determining what to put on said dashboard. I think it needs to be brief to be useful, yet complete. The project I'm working on depends on both 3rd party contractors... |
I watched a bunch of lectures on Clojure and functional programming by Rich Hickey as well as some of the SICP lectures, and I am sold on many concepts of functional programming. I incorporated some of them into my C# code at a previous job, and luckily it was easy to write C# code in a more functional style.
At my new... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.