instruction stringlengths 34 19.9k |
|---|
For a previous project, I was using Backbonejs alongside Django, but I found out that I didn't use many features from Django. So, I am looking for a lighter framework to use underneath a Backbonejs web app.
I never used Django built in templates. When I did, it was to set up the initial index page, but that's all.
I di... |
I have a function which needs to output a string containing a list of file paths. I can choose the separation character but I cannot change the data type (e.g. I cannot return a List<string> or something like that).
Wanting to use some well-established convention, my first intuition was to use the semicolon, similar to... |
According to this article, in object-oriented programming / design dependency injection involves
a dependent consumer,
a declaration of a component's dependencies, defined as interface contracts,
an injector that creates instances of classes that implement a given dependency interface on request.
Let us now consider ... |
Take the following pseudocode:
CreateInvoiceAndCalculate(ItemsAndQuantities, DispatchAddress, User);
And say CreateInvoice does the following:
Create a new entry in an Invoices table belonging to the specified User to be sent to the given DispatchAddress.
Create a new entry in an InvoiceItems table for each of the it... |
I want to port an existing app from Java to Node.js - would like to seek your advise.
The java app is a multithreaded socket server where arbitrary number of clients can connect. The app runs on java executors. Each client is given a socket to connect to the app.
The client will connect to the socket server and there ... |
I am working on an application to create invoices. There are some features that are required based on the type of the application and are common to all invoice applications. However, we still need to determine what unique needs the user base might have. We do not have direct access to the users to obtain requirements o... |
As an experienced web-developer, but a novice "low level" programmer, this stuff is sort of voodoo to me still.
I'm curious about how one would even begin to go about finding a memory block, and then reading it (for example, reading the timer in a game of mines)? Is this different by OS / OS version?
|
Composition and aggregation both are confusion to me. Does my code sample below indicate composition or aggregation?
class A {
public static function getData($id) {
//something
}
public static function checkUrl($url) {
// something
}
class B {
public function executePatch() ... |
The standard JavaDoc template(Doclet) didn't change much until the recent JDK7. In my opinion, JDK7 template only made it even more difficult to browse. I looked at several third-party doclets, but none is what I want. So I started to design a new open source JavaDoc template from scratch to improve the usability. Here... |
I'm about to start writing a process for saving some data structure from code in to a file of some proprietary, as-yet-undefined type. However, I've never designed a file type or structure before.
Are there any things, generally speaking, that I should consider before starting my design?
Are there any accepted good pr... |
I've seen questions (mainly on Stack Overflow), which lack this basic
knowledge. The point of this question is to provide good information
for those seeking it, and those referencing to it.
In the context of web programming, what are the differences between Server-side programming and Client-side programming? Whi... |
I need to create a web service that executes every hour. It will be used to review data in a database and add alerts to a table in the same database if certain conditions are met/not met. What we currently have is:
We have end devices that use Python to report to an Amazon Web Services (AWS) virtual server. The AW... |
In java (and many other programming language), there are often structure to deal with graphic element : Colour, Shape, etc. Those are most often in a UI toolkit and thus have a relatively strong coupling with UI element.
Now, in the domain of my application, we often deal with colour, shape, etc, to display statistic ... |
I have been wondering if, rather than a more traditional layout like this:
api/Products
GET // gets product(s) by id
PUT // updates product(s) by id
DELETE // deletes (product(s) by id
POST // creates product(s)
Would it be more useful to have a singular and a plural, for example:
api/Product
GET // gets a product by ... |
There's an entity that gets updated from external sources. Update events are at random intervals. And the entity has to be processed once updated. Multiple updates may be multiplexed. In other words there's a need for the most current state of entity to be processed.
There's a point of no-return during processing where... |
Part 1
Clearly Immutability minimizes the need for locks in multi-processor programming, but does it eliminate that need, or are there instances where immutability alone is not enough? It seems to me that you can only defer processing and encapsulate state so long before most programs have to actually DO something (up... |
Given the following code:
class ClientClass{
public function print(){
//some code to calculate $inputString
$parser= new Parser($inputString);
$result= $parser->parse();
}
}
class Parser{
private $inputString;
public __construct($inputString){
$this->inputString=$i... |
I have seen numerous licenses for any kind of software such as the GNU GPL, BSD License, MIT License, and LGPL. What is the process for creating a new software license, such as "John Doe's generic license"?
|
I'm an independent software developer that's spent the last few months creating software for viewing and searching map data. The software has some navigation functionality as well (mapping, directions,etc). The eventual goal is to sell it in mobile app markets. I use OpenStreetMap as my data source.
I'm concerned abou... |
A lot of the times during the bidding phase of a project I receive a software system's requirements from our potential customers in a very unstructured format from various sources [email, word documents, excel]. It is usually a bunch of "product development" guys from the customer's side who come up with these "propose... |
This is not about @staticmethod and @classmethod! I know how staticmethod works. What I want to know is the proper use cases for @staticmethod vs. a module-level function.
I've googled this question, and it seems there's some general agreement that module-level functions are preferred over static methods because it's... |
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.