instruction stringlengths 34 36.1k |
|---|
So I'm designing a reporting system at work it's my first project written OOP and I'm stuck on the design choice for the DB class.
Obviously I only want to create one instance of the DB class per-session/user and then pass it to each of the classes that need it. What I don't know it what's best practice for implementin... |
I developed an iOS application as a student and I am currently distributing it for free in the app store. I have received a few enquires about adding features to the app including one person who would like the app to be open source so they can add features themselves.
What concerns should I have if I open source my iOS... |
What buffer size should I choose for read/write files via POSIX fread/fwrite functions?
|
I have some context
then I can do:
with context.getError(Object): ErrorHolder
holder.addError(error)
OR
context.setError(Object, error)
setError will probably have this implementation:
context.getError(Object).addError(error)
what approach should I choose and why?
|
We have several users running on old hardware and old browsers.
What would be the best way to get them to upgrade to a newer web browser, without nagging users with a newer web browser.
|
Is there a reason why the source code of software mentioned in research papers is not released? I understand that research papers are more about the general idea of accomplishing something than implementation details, but I don't get why they don't release the code.
For example, this paper ends with:
Results
The human... |
What's the best method of sycing objects (as JSON) to a remote server, with local caching?
I have some objects that will pretty much just be plain-text with some extra meta-data. I was thinking of perhaps including a "last modified date" for both Local storage and Remote storage. This could then be used to determine wh... |
I have been evaluating architecture solutions for a mobile project that will have a web-service/app in addition to native apps and have been looking at various libraries, frameworks, and stacks like Meteor, this being a sort of "open stack package framework", is tightly bound with Node.js.
There is a lot of talk about ... |
So I think I know the main use case for F# 3.0's Type Providers, i. e. better Intellisense when working with data stores that use them. Are there other use cases for Type Providers or is that pretty much it?
|
I'd like to know people's opinions, reactions to clients and technical work arounds (if applicable), to the issue of an enterprise application where a client wishes to use duplicate e-mail addresses?
To clarify, when I say duplicate e-mail addresses I mean within the same client system, having multiple users that have ... |
Is it dangerous to substitute unit tests for user testing?
A co-worker believes we can reduce the manual user testing we need to do by adding more unit tests. Is this dangerous?
Unit tests seem to have a very different purpose than user testing. Aren't unit tests to inform design and allow breaking changes to be caug... |
I've been browsing the net and found theses two slides on site of XOM (XML object model):
slide1
slide2
Where they refer to SAX(push) and StAX(pull) parsers. So I'm wondering, what does it mean that a StAX parser isn't complete or correct in practice?
|
I am currently doing the preliminary design for a new product my company will be pushing out soon. We will start on Android, but then we will need to quickly develop the IPhone, IPad.... and then the Windows 8 ports of the application.
Basically the only code that wouldn't be reusable is the view specific code and the ... |
we have an application that is built with .Net MVC. We are now tasked with exposing API's to third parties. Members on our team want to just continue down our current path and just use more controllers so we can reuse the backend of our current application. Logic tells me we need to create a seperate service layer w... |
Just read this in the REST API Rulebook: GET and POST must not be used to tunnel other request methods.
Tunneling refers to any abuse of HTTP that masks or misrepresents a message’s intent and undermines the protocol’s transparency. A REST API must not compromise its design by misusing HTTP’s request methods in an eff... |
We currently have an application that allows users to create a Contract. A contract can have 1 or more Project. A project can have 0 or more sub-projects (which can have their own sub-projects, and so on) as well as 1 or more Line. Lines can have any number of sub-lines (which can have their own sub-lines, and so on).
... |
I am wondering why it seems to be popular to have the login page of an SPA be a separate page that is not part of the SPA (as in loaded and send data through ajax requests)?
The only thing I can think of is security, but I can't think a specific security reason. I mean the only thing that comes to mind is that if your... |
So, I'm tasked with organizing the code and building a library with all the common code among our products.
One thing that seems to happen all the time and I wanted to abstract is posted below in pseudocode, and I don't know how to call it (different products have different domain specific implementations and names fo... |
Say you have an acyclic directed graph with weighted edges and create N workers.
My goal is to calculate the optimal way those workers can traverse the entire graph in parralel.
However, edge costs may change along the way.
Example:
A -1-> B
A -2-> C
B -3-> C (if A has already been visited)
B -5-> C (if A has not alrea... |
What is the point of using DTO and is it an out dated concept? I use POJOs in the view layer to transfer and persist data. Can these POJOs be considered as an alternative to DTOs?
|
I’m having some problems debugging an encoded javacscript. This script I’m referring to given in this link over here.
The encoding here is simple and it works by shifting the unicodes values to whatever Codekey was use during encoding. The code that does the decoding is given here in plain English below:-
<script la... |
I have heard that over time, software can begin to show signs of wear and tear.
What does wear and tear of software mean?
Software itself not being a physical entity, so how can there be wear and tear?
|
This is the first time I got one customer and I am developing one application for him in c#.net and winforms. I want to distribute .net framework with my application since customer may not have it installed so I want to give it with my application so that while installing it will see if framework is installed or not an... |
My colleague recently pointed me to Ohloh, a website providing statistics on FOSS based on versioning repositories. It's quite a fun procrastination tool, e.g. to compare programming languages by active projects:
Which makes me wonder: how representative is such a comparison? Can we draw conclusions from this such as ... |
The Senario:
You have a file with a string (average sentence worth) on each line. For arguments sake lets say this file is 1Mb in size (thousands of lines).
You have a script that reads the file, changes some of the strings within the document (not just appending but also removing and modifying some lines) and then ove... |
When writing scripts using a modern scripting language, e.g. Powershell or JavaScript, where should I define constants? Should I make all constants global for readability and ease of use, or does it make sense to define constants as close to their scopes as possible (in a function, for instance, if it's not needed else... |
Let's say I have a function that does x. I pass it a variable, and if the variable is not null, it does some action. And I have an array of variables and I'm going to run this function on each one.
Inside the function, it seems like a good practice is to check if the argument is null before proceeding. A null argument ... |
I'm dealing with a modeling system (financial) that has dozens of variables. Some of the variables are independent, and function as inputs to the system; most of them are calculated from other variables (independent and calculated) in the system.
What I'm looking for is a clean, elegant way to:
define the function of... |
I've been studying about recursive functions, and apparently, they're functions that call themselves, and don't use iterations/loops (otherwise it wouldn't be a recursive function).
However, while surfing the web for examples (the 8-queens-recursive problem), I found this function:
private boolean placeQueen(int rows, ... |
Possible Duplicate:
I’m a Subversion geek, why should I consider or not consider Mercurial or Git or any other DVCS?
Every once in a while, you hear someone saying that distributed version control (Git, HG) is inherently better than centralized version control (like SVN) because merging is difficult and painful in S... |
I'm working on an application with many constants. At the last code review it came up that the constants are too scattered and should all be organized into a single "master" constants file. The disagreement is about how to organize them. The majority feel that using the constant name should be good enough, but this wil... |
I'm developing a tool that generates code from some various data. The tool itself will be licensed with the MIT license, which strikes a good balance for me in terms of allowing the freedom to use and modify it, while still holding the copyright.
OK, but what is the legal status of the code generated by the tool? Who h... |
I'm starting the parser that will handle one of the key features of my app and realizing exactly who easy it would be for me to screw up a resource file that is provided to the application. For example, a simple resource that I provide to my app is a JSON file that contains an entity layout (name, fascia, location etc.... |
The section of an executable that contains code is sometimes called the .text section. In segmented memory architectures, a segment mapped as code is sometimes called a text segment. The unix error message “text file busy” (ETXTBSY) means “this file is a program that is being executed”.
How did text come to mean execut... |
Edit: I asked this question 3 or 4 years ago when I was new to web-development, the question looks a bit stupid to me today. I wanted to create a server setup of my own without relying on other hosting providers.
I wanted to delete this question, but it have some nice answers, so I'm leaving it.
I want to deploy my web... |
In chapter 13, when talking about pointers, there is a paragraph:
Sometimes, however, you would like to have the semantics of pass by
reference—that is, that the passed object should not be altered—with
the implementation of pass by value—that is, passing the actual object
rather than a copy.
It seems like the ... |
I have started an introductory Java class and the material is absolutely horrendous and I have to get excellent grades to be accepted into the master's degree, hence my very beginner question:
In my assignment I have to write algorithms (no pseudo-code yet) to solve a board game (Sudoku). Essentially, the notes say tha... |
Given a list of circles with its coordinates (x and y) that are moving every second in different direction (South-East, South-West, North-East and North-West), and the circle will change direction if it hits the wall sort of like bouncing, so how do we detect if any of them collide or overlap with each other ? I am not... |
Tags are a vital part at Version Controlling for example SVN.
When should i write Tags at SVN?
What information should have a Tags?
|
First off, sorry if this is answered somewhere else. I did a brief search, but wasn't sure how to ask in search terms.
I'm looking at some code and came across lot's of statements like this:
if ( ($a != empty_or_null_or_notDefined && $a == 5 )
Is this the same as just saying:
if ( $a == 5 )
?
(language is PHP.)
|
I am looking for a free (as in beer) combination of services, for learning "cloud SW development" and very small scale private use (say, a private streamlined web shopping&todo list with simple auth). The combination should include the full set of needed services:
DVCS service (like github)
A cloud service to run the ... |
When creating a release with git flow like:
git flow release finish <branch_name>
I'm prompted for a release message. I grepped around to see where this go, but no succes. Any idea?
|
In refactoring code, I came across code that had comments. Looking closer at the comments, I could see that the code was clearly not doing what the comments said.
Without access to the coder nor documentation, and without clear direction regarding the code (i.e. defects as to the fact that the code is operating inco... |
Is it possible to use only C++ to create iOS apps? Is there any downside to that? I read somewhere that you have to use a mix of objective C and C++ if you want to use C++ that bad.
|
An assignment in my software engineering class is to design an application which can play different forms a particular game. The game in question is Mancala, some of these games are called Wari or Kalah. These games differ in some aspects but for my question it's only important to know that the games could differ in th... |
Doing on-demand work stresses me out and is not good for my back.
What tips could you offer if you have experience in spotting needs and writing custom software to suit ?
|
I am a trainee. According to my teacher to solve a problem we should go through following steps:
Create Algorithm (optional)
Create a Datatable: By analyzing the problem, create main concepts in those problem as columns and the related issues in the main concept as rows.
Create a Flowchart based on the Datatable. (whe... |
I'm going to teach teenagers some C++ code. I need an editor which is simple and has built in compiler. We tried CodeBlocks but when we installed it in the machines, the text got reversed, I'm not sure what the reaoson is. I would be great if the file size of the editor will not be large.
We need just simple features:... |
Is there any difference between return n (in the main function) and exit(n) in C? Is it defined by C or POSIX standards or it depends on OS or compiler?
|
Here is the classic scenario; Dev team build a prototype. Business mgmt like it and put it into production. Dev team now have to continue to deliver new features whilst at the same time pay the technical debt accrued when the code base was a prototype.
My question is this (forgive me, it's rather open ended); how can t... |
If I make a maven repository available for others to use, do I have
to get permission form the authors of those software that I host in
my repository even if they are free software?
Can I host free software libraries under any license or should they
have compatible licenses?
|
I recently found a framework named ecto.
In this framework, a basic component named "plasm", which is the ecto Directed Acyclic Graph.In ecto, plasm can be operated by ecto scheduler.
I am wondering what's the advantage of this mechanism, and in what other situations can we exploit the concept of DAG?
|
[Note: I hope I am not breaking etiquette, but I originally posted a variant on this question here, but am re-asking here because I am making this now solely a question about programming.]
I would like to program of the following simple form:
The user can produce X number of resizable frames (analogous to HTML frames)... |
I am a programmer and have just started reading Algorithms. I am not completely convinced with the notations namely Bog Oh, Big Omega and Big Theta. The reason is by definition of Big Oh, it states that there should be a function g(x) such that it is always greater than or equal to f(x). Or f(x) <= c.n for all values o... |
I have a small MVC framework I've been working on. It's code base definitely isn't big, but it's not longer just a couple of classes. I finally decided to take the plunge and start writing tests for it(yes, I know I should've been doing that all along, but it's API was super unstable up until now)
Anyway, my plan is to... |
I am trying to decode a piece of code from a book:
List<Person> people = new List<Person>()
{
new Person {FirstName="Homer",LastName="Simpson",Age=47},
new Person {FirstName="Marge",LastName="Simpson",Age=45}
};
Person is just a simple class they made, with a bunch of fields: Name, Last Name, etc...
What I don't under... |
Imagine I have a collection of object instances which represent activities for a user to undertake. Dependent on user attributes, I have to randomly select instances to present activities to the user.
For some users, I need to present more activities to them than there are available activities in which case, I want to... |
I'm trying to compare two text files. I want to compute how many lines were added and removed. Basically what git diff --stat is doing. Bonus points for not having to store the entire file contents in memory.
The approach I'm currently having in mind is:
read each line of the old file
compute a hash (probably MD5 or S... |
I was reading this blog by James Bennett regarding HTML vs XHTML . He writes :
I don’t have any need for namespaced content; I’m not displaying any
complex mathematical notation here and don’t plan to, and I don’t use
SVG for any images. So that’s one advantage of XHTML out the window. I
also don’t have any nee... |
Could someone please explain quite clearly the difference between a port and a socket. I know that a port serves as a door into the network for an application
process and that the application process uses a socket connection to the given port number to handle network communication but when you have multiple processes ... |
What would be a good alternative to inline Java documentation, i.e. can one have a separate docs file somehow mapped to a java source file?
I have never liked huge comment sections littered in code.
|
I am trying to get some advice on what order I should learn about SQL Server, LINQ, and Entity Framework to be able to better work with ASP.NET Webforms and MVC.
From what I've been able to learn so far, many recommend learning LINQ or Entity Framework before learning SQL Server. It also appears that many companies are... |
I'm working on a smallish web application that uses a little bit of static HTML and relies on JavaScript to load the application data as JSON and dynamically create the web page elements from that.
First question: Is this a fundamentally bad idea? I'm unclear on how many web sites and web applications completely disp... |
Is there a term to describe the point at which adding more developers to a software project will provide diminishing returns?
I realize that at a high level, it is more complicated that just a number of developers at which the project will be at productive capacity (ex/ state of the project, quality of the added develo... |
The "scope" of the GNU license is troubling me : I know it has been answered many times ( here, here, ... ) but shouldn't we take into consideration the complexity and originality of a code before using GPL license ?
I explain : I'm working on a pet project using the DTW algorithm that I have written in C using the pse... |
I am currently helping to design a web site and application in HTML. We would like the user to be able to search the site/app for desired content via a search bar. We would also like to include an advanced search ability to allow for different search options and more concentrated searches.
We are having trouble decidi... |
I am working with 2d correlation for image processing techniques (pattern recognition etc...). I was wondering if there is a theoretical approach on how to tell when to use multiplication in frequency space over correlation in time space. For sizes of 2x frequency space is obviously faster but how about small, prime si... |
I want to create a python panel for Linux like pypanel or tint2 just for fun and to do practice with python development.
Now the problem is:
I want to create an auto-generated menu, but I don't know where to start.
Where can I find all user's installed software in a Linux distro? I know I should look in the /usr/bin fo... |
BACKGROUND
We are building a Java (SE) trading application which will be monitoring market data and sending trade messages based on the market data, and also on user defined configuration parameters.
We are planning to provide the user with a thin client, built in .NET (WPF) for managing the parameters, controlling th... |
Paraphrasing a recent question: https://softwareengineering.stackexchange.com/questions/52608/what-is-object-oriented-programming-ill-suited-for
I would like to ask the opposite question:
What kind of programs cannot be written unless you use OOP?
What kind of programs are not recommended to be written using non-OOP te... |
An order can be in the "status" of Completed, Corrected or some other status.
I saw some code that is checking it like this, the purpose is to disable some stuff when the status is in Completed or Corrected status.
if (model.CurrentStatus != DSRHelper.OrderStatusEnum.Complete && model.CurrentStatus != DSRHelper.Orde... |
I'm not trying to say I know something everyone else doesn't but I've been solving more and more designs with the use of nested classes, so I'm curious to get a feeling for the acceptablilty of using this seemingly rarely used design mechanism.
This leads me to the question: am I going down an inherintly bad path for r... |
I've inherited a huge pile of legacy code written in PHP on top of a MySQL database. The thing I noticed is that the application uses doubles for storage and manipulation of data.
Now I came across of numerous posts mentioning how double are not suited for monetary operations because of the rounding errors. However, I ... |
Why doesn't Java's BigInteger class have a constructor capable of taking a numeric literal? Every single time I use BigIntegers, and many times I merely think about them, I wonder this.
What reason could the designers of java have had to exclude one despite the overwhelming convenience of one should it exist?
|
Does 'Me' in VB.NET refer only to an instantiation of the type? Just occurred to me that since I can reference properties in my VB.NET class without using 'Me', that I don't see a reason for using it for this purpose. Will referencing the variable either way always refer to the actual stored value for the property at... |
The standard method of implementing get and set accessors in C# and VB.NET is to use a public property to set and retrieve the value of a corresponding private variable. Am I right in saying that this has no effect of different instances of a variable? By this I mean, if there are different instantiations of an objec... |
Are elements returned by Linq-to-Entities query streamed from the database one at the time ( as they are requested ) or are they retrieved all at once:
SampleContext context = new SampleContext(); // SampleContext derives from ObjectContext
var search = context.Contacts;
foreach (var contact in search)
... |
I planning to write an application in which there will be a service (call it A) listening for particular commands. This service will then relay those commands to other services (call them B and C) which are written, respectively, in .NET and Java (service A chooses which of service B or C to which to relay depending on... |
In a situation like this:"
if ((metadata != null) && (metadata.TypeEnum != VariantInfoMetadata.CellTypeEnum.Status))
do you recommend to keep the code as it is above? Or is it better to make a nested "if" statement and breaks the condition into two sections where "outer if" makes sure metadata is not null and inner i... |
I need to add a certain feature to a module in a given project regarding time calculation. For this specific case I'm using Java and reading through the documentation of the Date class I found out the time is calculated in milliseconds starting from January 1, 1970, 00:00:00 GMT. I think it's safe to assume there is a ... |
If you are merging two or more database records from table X, that have a many-to-many relationship with table Y, how should you solve the problem of records in intermediate table Z that would violate one or more constraints as a result of the merge? Do you simply discard them or break off the transaction?
|
I have been following verification and validation questions here with my colleagues, yet we are unable to see the slight differences, probably caused by language barrier in technical English.
An example:
Requirement specification
User wants to control the lights in 4 rooms by remote command sent from the UI for each ... |
I have started my own OS application, I am hosting it on GitHub. My problem is that I push changes to the repository from more than one location so sometimes I want to work on it and sometimes I can't always finish something in time but I would still like to push it anyway so I can fetch it later from my other location... |
I have a rating engine (it is basically an algorithm) which when I started had no formal documentation. We have created a functional specification/decomposition which is our business level document but now I need something more technical (a technical specification).
What I am struggling to understand is what that docu... |
I have a real-world problem which I'll try to abstract into an illustrative example.
So imagine I have data objects in a tree, where parent objects can access children, and children can access parents:
// Interfaces
interface IParent<TChild> { List<TChild> Children; }
interface IChild<TParent> { TParent Parent; }
// C... |
I can deal with porting platform dependent functions. I have a problem that the compilers I tried on Linux (clang and g++) do not accept the following code, while the msvc++ compiler does:
template <class T>
class Base {
protected:
T Value;
};
template <class T>
class Derived : public Base<T> {
public:
void se... |
Sanboxing is listed as one of the many security features in html5 specification . Can someone explain what is meant by sandboxing? Does it relate to HTML only or to JavaScript also?
|
I have a requirement where there are 10 Rules to be applied on data in excel.
If Rule 1 and Rule 2 fails rest of the rules are not checked. But if Rule 1 and Rule 2 passes the rest of all the Rules should be verified and if any errors found- they should be logged. Is there any design pattern which I can use to keep thi... |
Where it is accepted that a language has to be Turing complete to be any good, is it actually possible to have a 'useful' programming language that isn't Turing complete?
I should clarify that this is quite specifically about 'programming' languages in the traditional sense, and not markup or query languages.
|
I am working with a company which designs and builds one-off machines. They have been 'dabbling' with hosted Dynamics CRM and Sharepoint (on different servers!) in an attempt to centralise their data and help colleagues collaborate more effectively across projects. They haven't used either system to their potential.
No... |
I am trying to help my friend by creating a part of his on-going project.
What I'm going to do is create a Java parser to break up the Java code into operators, parameters etc to build XML representation.
Next I want to create a code generator to convert the parsed java code to XML conforming to the schema I've created... |
> shutdown /?
> Usage: shutdown [/i | /l | /s | /r | /g | /a | /p | /h | /e | /o] [/hybrid] [/f]
The windows cmd.exe command shutdown only documents forward slash / switches, but it accepts dash - switches as well. For instance, both work:
shutdown /s /t 0
shutdown -s -t 0
When was this added and why?
|
Consider this bit of code:
if (x == 1)
{
throw "no good; aborting" ;
}
[... more code ...]
Now consider this code:
if (x == 1)
{
throw "no good; aborting" ;
}
else
{
[... more code ...]
}
The two cases work exactly the same way. The first case has the advantage that you don't have to "encase" the rest of the c... |
I have a site that will have lots of images of large size. What is the best format that I should choose for displaying these images?
I need the website to load fast. I am jumbled with different formats of images like jpeg, png, gif, bmp, etc. Which to use in this case and why ?
|
It seems to me that in C++11 lots of attention was made to simplify returning values from functions and methods, i.e.: with move semantics it's possible to simply return heavy-to-copy but cheap-to-move values (while in C++98/03 the general guideline was to use output parameters via non-const references or pointers), e.... |
Possible Duplicate:
What books or resources would you recommend to learn practical OO design and development concepts?
I have been mostly a C programmer so far in my career with knowledge of C++. I rely on C++ mostly for the convenience STL provides and I hardly ever focus on good design practices. As I have started... |
It seems like for years they've just been given default styling and inline display. Is there a spec somewhere that has dictated this? I've looked over the RFC's but I'm not particularly good with RFC-ese, and I didn't notice anything anywhere.
For example
<body>
Some content <mycustomtag>something else</mycustomtag>... |
My company is creating a service in an Amazon Virtual Private Cloud. Without getting too much into the details, there will be about 5 different types of servers, and each type will need to be replicated based on demand. A bit of reading gives me the impression that we're going to want to use a config management tool li... |
I started as the analyst, talking to the client and jotting down requirements and all that jazz. Ended as the sole developer of the project.
The schedule is OK, but not OK for someone that don't know nothing about how to develop a WPF application, IMHO.
What can I do about it, tell program manager that she made a huge ... |
In C#.NET language: This style of coding is recommended or the one below it?
if (sheet.Models.Data is GroupDataModel)
{
GroupDataModel gdm = (GroupDataModel)sheet.Models.Data;
Group group = gdm.GetGroup(sheet.ActiveCell.Row.Index);
if (group!=null && controller != ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.