instruction stringlengths 34 19.9k |
|---|
Say we have some thread that wants to check when another thread is finished its task. I have read that we should call a wait() type function that will make this thread wait until it receives a notification that the other thread is finished. And that this is good because it means we aren't performing expensive polling.
... |
I'm writing some code that sets cookies and I'm wondering about the exact semantics of the Set-Cookie header. Imagine the following HTTP header line:
Set-Cookie: name=value; Path=/%20
For with path does this set the cookie? / or /%20(unescaped) (/%20 or /%2520 escaped)?
The reason I'm asking is that I should support n... |
Activity network diagrams are used to determine the forward and backward paths for a project, and consequently to determine the critical path or maximum time to development.
I'm already familiar with using work breakdown structures which break down functional requirements into necessary and sufficient deliverables, b... |
I'm working on a translator in C++. Basically I want to parse the file with translations and store it in my program, so I can perform search through the words and simply access the corresponding word. My file will look like that:
word|translation
second word|second translation
etc. It doesn't have to be | as delimiter... |
Recently completed a project for handling credit card processing. One of the difficulties I faced was handling the delay / possible failure of notification messages. The most complex example was:
an external system sending the request for payment
my system turning that request into a request to the payment gateway
sen... |
I've read that ios apps can communicate via unique urls. An online tutorial on tutsplus
says
Communication between apps provides your application with an opportunity to take advantage of other application’s functionality, send and receive data between apps, and provide a rich user experience that “just works”.
I have... |
To better understand my question, let me elaborate the background of the subject matter.
I work in a financial institution where the business module (credit finance) is constantly changing. In the IT world, however, the developers have a 6 week cycle taking list of projects/enhancements, put it in a timeline and busine... |
I was studying the book Structure and Interpretation of Computer Programs and in section 1.1.5 The Substitution Model for Procedure Application the author explains the concepts of normal order and applicative order, which I believe I have understood well.
Now, I am taking a course on Coursera called Function Programmin... |
I have been reading about the libraries people have written for languages like Java and C# that make use of byte code weaving to do things like intercept function calls, insert logging code, etc. I have also been reading up on Lisp/Clojure macros in an attempt to better understand how to utilize them. The more I read a... |
I'm using the BigRational class from bcl.codeplex.com. It will be opensourced when it's finished, and it's modified. However, I don't get legal jargon, so even though it's quite short, could someone explain to me what it does/doesn't allow you to do?
|
I would like to write some long text in some structure to allow a set of operations on that text. The question is which structure or format should I use, which suits best the use that I plan to do of that text?
Next I describe that use:
I would like to write text in natural language, possibly with translations to seve... |
So say you had a site like StackExchange. Now imagine you created a machine-writeable API capable of posting questions and comments and doing everything your browser can do.
Of course, about 5 minutes after launching, you'd have so much spam that you would probably have ran out of room on your database servers and wil... |
I have heard two separate uses for the term controller when speaking of the Model View Controller methodology.
An intermediary section of code that communicates between the Model and View, tying them together.
The module that deals with input, similarly to how the view deals with output.
For starters, which definitio... |
I am trying to make my way back to JavaScript (been there last time some 7 years ago) with the help of lovely "Eloquent JavaScript" book.
While I admire author's capabilities and approach, I have also began being concerned. I am from C/C++ background and there I learnt it rather hard way that funky constructs often und... |
I've heard the term pop all around. I've read various articles regarding the subject and heard two main definitions to the term "Service Location":
A glorified Registry - Bad practice, global variables, general evil.
A type of Dependency Injection Container - Can help with managing dependencies, making modular and ext... |
I'm in the process of building a new pledge management system for one of my clients, a charity foundation. I have already built one for them (it was done using Delphi), but its feature-set is a little limited.
Now, I have decided to move to PHP and use the Laravel framework to manage the database for the new system - i... |
I have a basic issue with the MVC architecture. I am aware that the View usually listens to the Model. But how are user requests propagated to the Model?
Currently I do it like this, when the user clicks e.g. the update Button in the GUI. So the ActionListener calls a method of the View. The View calls a method of the ... |
first of all I am new here and I hope that this is the right place for my question. I have a question about the recommended architecture of a project.
IDEA: Automate some calculations concerning to aerodynamics. I have some input data and I need to process this data in several sub-calculations. You can see such a calcu... |
I do not know if this would be the right stack exchange site to ask this question but I have been researching on RAD (Rapid Application Development) and Agile methodologies and was trying to find their diagrams but if I google images this, it comes up with many different diagrams. So based on the images I drew my own d... |
I started to get more and more engaged in open source development and I was wondering if there are any guidelines on how to properly document and maintain a fork?
For example, let's say you fork a project to add some specific thing to it. Maybe you do not want to send pull requests back to the original project or maybe... |
I have the following type hierarchy:
interface I:
----+class B implements I
----+class C implements I
----+class D implements I
I have another class Consumer1 that supports types C and D but not B (in its various methods) and a class Consumer2 that supports type B. I have total control over Consumer1 and C... |
Is the following guaranteed to return true for all numerical and non-zero values of x?
bool IsRoundTrip(double x)
{
double y = 1 / (1 / x);
return x == y;
}
What conditions would cause a discrepency?
|
Considering that it's April, 2013; do I still need to worry about non-JavaScript capable/enabled clients?
Note: This question excludes having helper text with: JavaScript is required to view this page, upgrade to a modern browser or modify your settings
BTW: Just to be clear, in order to cater to non-JavaScript capable... |
I am a Sr java Developer and have recently joined a new team. Here I have been asked to create a functional document looking at the code of a legacy application. This application was written about 8-10 years back, which is currently running in live environment but due to lack of documentation it is difficult to be setu... |
Main
I'm making a scripting language using C++. I plan to use it with a simple test game editor. But I have to make a support for bindings to call game engine's nodes' methods to update positions, rotations, etc.
What are the main approaches for this?
The game engine I plan to use also supports lua, so maybe I can also... |
Is it a good practice to use reflection if greatly reduces the quantity of boilerplate code?
Basically there is a trade-off between performance and maybe readability on one side and abstraction/automation/reduction of boilerplate code on the other side.
Edit: Here is an example of a recommended use of reflection.
To g... |
First of all I'm not asking for legal advice but just checking if anyone agrees with my suspicions. That might help in convincing Sencha to change their license.
Their commercial license says:
The Open Source version of the Software (“GPL Version”) is licensed under the terms of the GNU General Public License versions... |
I have some classes that are composed with ORM generated Models.
example1:
For example the Report.php (Model) is using a Document.php Model generated with ORM. Based on the document object a report is created.
I would like to know some name suggestions for the Report.php folder path.
It clearly belongs to the /Model fo... |
Hopefully, this question is not too open-ended...
I have been tasked with taking a 3 year old application (.NET 4.0, WPF, WCF, EF 4, SQL 2008) that was designed for a very specific market X and "re-purposing" it for a another very specific market Y.
To further complicate things, the company has also mentioned a third m... |
I am a software engineer for 4 years, and I just changed my company for the first time.
Company works with pair programming, and it's been 3 days, I couldn't even write a single line of code.
It's so frustrating for me because I was very productive at my previous company.
The codebase is large, they are using 5-6 langu... |
I am considering using sourceforge, bitbucket or github for managing source control for my business. I have open projects and I participate in open projects such as gcc. But I also have a business where I develop closed-source software for my living.
How trustworthy are sourceforge, github or bitbucket in terms of ke... |
I have forked a project that was released under the GPL and made substantial modifications, however there are still some parts and general ideas that are the same as upstream.
Due to user interest I am wondering how, if at all, I can relicense the project. Another developer and I have attempted to reach the upstream d... |
We are writing a system with a sort of quasi-MVC structure (it was never stated as that, but that's what it is). I'm building up a full knowledge of the system and the controller will have to make calls to me to update it; they system itself is something similar to a graph.
We need to have a sense of a path between mu... |
We have been using Hosted SVN + Fogbugz for our source control and task/issue tracking. Our developers are very comfortable with SVN and we are hesitant to switch source control (e.g. TFS) providers at this point. However, Management extensively uses Microsoft Project for project management and are considering setting ... |
Adap.TV has chosen C++ to develop their software. However, they've decided not to use the standard containers1 and boost for performance reasons, as they've blogged about it in the following article:
Why we use C++ (without using STL or boost)
It says (emphasis mine),
There are several rules that we are obeying in o... |
I recently started working for a company that has me making mockups for an app they'd like to see converted to an iPhone app. I have not been informed as to how all the boards fit together, but I do have a general idea on what they should look like. I would like to write notes or comments on each individual board about... |
I asked a question on StackOverflow in November about separating a very large application into layers and tiers: https://stackoverflow.com/questions/13342626/net-divorcing-layers. The previous developer included data logic and business logic in the business logic layer
My question is about the tiers element. I resear... |
I'm kinda having a debate here with my friend, whether it's OK to have a development language before putting the idea into C++.
When I say development language I mean a language to try ideas out before putting them into the compiled language, in this case C++.
My friend thinks it's unnecessary (and maybe a waste of tim... |
It seems to be easier to use and more feature rich than standard swing layouts. It looks like a do it all replacement for all standard layouts. If you are making simple code to just show the time in a window, then MigLayout is probably not useful. But, if you are making a flight cockpit panel, then MigLayout might be t... |
We have an MVC4 application that we would also need to distribute as a standalone (no network connectivity) desktop application. Rather than rebuild the HTML/JS front-end we would like to reuse that so in essence we're distributing a self-hosted HTML-view-based .NET MVC application. What we roughly envision is: MVC4 .N... |
My design doesn't allow me to mock the data so I am using sqlite as test database that has minimum data to run the unit tests. Below is the pseudo code
//Method to be tested
public IList<Funds> GetFunds()
{
List<Funds> objFundsList = //gets two records from sqlite db;
return objFundsList;
}
//Test Method
publ... |
I work on a C++ project that generates bajillions of warnings. Most of the warnings appeared after the code was written:
Initially the project used Visual C++ 8, soon switching to 9, but there is little difference in the generated warnings. Warnings were either fixed or silenced, so there were no warnings then.
Then a... |
I have many sublcasses of one class. I choose concrete class based on type (simple enum). I like idea of class cluster. Should i use it or just create factory class (but each class in objective-c is actually a factory)?
What is the difference between factory pattern and class cluster pattern.
When to use it in your cod... |
What are the major differences in between Java version in terms of software development? Where can one find a summary of the most important changes related to programming?
The Release Notes such as http://www.oracle.com/technetwork/java/javase/releasenotes-136954.html can be hard to read.
For example there is new code... |
Every competent Java programmer knows that you need to use String.equals() to compare a string, rather than == because == checks for reference equality.
When I'm dealing with strings, most of the time I'm checking for value equality rather than reference equality. It seems to me that it would be more intuitive if the l... |
I have a project where the customer requirement specifies a report and contains mathematical equations for the contents of some of the columns on that report. One of the columns on this report is a running total which starts at a opening value, and which 'should' remain at that opening value all the way down the report... |
In an Agile development process usually the main focus is on User stories, but sometimes a single requirement may span several user stories.
For example, the client may request a search page for all users in a forum, and there are several actions that can occur on each user such as ban user, delete user, reset Password... |
I want to use an ORM with a legacy database, but I don't want to expose some of the underlying data types. For example, some of the columns are nullable doubles or floats and I want my domain model to use non nullable decimals.
It seems to be impossible to have Entity Framework automagically cast between these types, a... |
I'm building a REST api where clients are authenticated using client certificates. A client in this case is not an individual user, but some sort of a presentation layer. Users are authenticated using a custom approach and it's the responsibility of the presentation layer to see that this is properly done (note: I know... |
I'm a freelance programmer and recently I finished a website, it all works fine but there was one user that complained to my client that he couldn't log in. This problem was clearly a cookie-restriction/old browser one (I couldn't create the problem myself and hunderds of users are working with the website just fine)
N... |
I have a web application that I have been developing for a small group within my company over the past few years, using Pipeline Pilot (plus jQuery and Python scripting) for web development and back-end computation, and Oracle 10g for my RDBMS. Users upload experimental genomic data, which is parsed into a database, an... |
I'm heading a new team of developers working on a software project that makes use of continuous integration (circleci) w/ a pretty fleshed out suite of busterjs unit/integration/acceptance tests. Our project is primarily written w/ coffeescript, and I try to make use of coffeescript-linter to ensure everyone working ou... |
I was reading this article: A Critique of Common Lisp and finding it hard to make out the precise definition of "stock-hardware machine" and its difference with "micro-coded" machines. I tried to search for a precise definition of the former to no avail.
What I currently construe stock-hardware machine to be is that, i... |
I'm having some difficulty to evaluate the revision of a software: the software was paid by customer years ago, never used, and now the customer have noticed that it doesn't work as expected.
Now this customer asked me to evaluate the project (I have the sources), and I should give an estimation of the time to fix it a... |
Reading about ARM architecture I found many similarities to PDP-11 architecture which did not exist between ARM and x86.
For example,
General-purpose registers named Rx compared to AX, BX,... for x86
Uniform registry file (all registers permit all kinds of operations)
Similar names for program counter (PC both on AR... |
A LAMP project I am currently working on is pretty well organized on the backend. However, there are a ton of pages that just have a diarrhea of javascript and html squirted all over numerous locations with little discernible architecture, rhyme, or reason. In a few cases, some kind of javascript prototype was created ... |
I am interested in hearing some guidelines as to what feedback is or is not appropriate for a code review. My team has a very unstructured review process and I am trying to suggest some ways to improve it. I am no expert so I hope to hear from you experts out there!
Should code review comments be limited to actual p... |
As the number of bugs in a codebase increases, that number not only decreases the quality of the code, it also affects the mindset of the developers. Developer self-confidence falls when things are not going well. If self-confidence is not right, things more easily become a mess. How do you guys keep your self confi... |
I have a graph with about a billion vertices, each of which is connected to about 100 other vertices at random.
I want to find the length of the shortest path between two points. I don't care about the actual path used.
Notes:
Sometimes edges will be severed or added. This happens about 500 times less often than looku... |
I am new to image processing using Python. Now I am learning OpenCV and the mahotas module in Python. Many functions in these modules are related to watershed of an image. I don't know what watershed means for an image. Here is an example from the OpenCV documentation: http://docs.opencv.org/search.html?q=watershed... |
I'm looking for a C function library, which would contain a collection of simple and plain utility functions "missing" from C or POSIX standards. I found this earlier question, but answers there list only full frameworks or libraries designed to replace/duplicate standard libraries instead of seamlessly fill the gaps.
... |
Let's say we have 4 classes A, B, C, D where: A is a superclass of both B and C and C is a superclass of D. I suppose, in a diagram, it should look like this:
A
/ \
B C
\
D
Moreover, the class A implements the interface
Comparable<A>
and also implements a method
public int compareTo(A a... |
The context
We're building a web application using Entity Framework 5.0. One of the requirements is that it should be possible for the administrators to link related products so that when someone browses to a product we can render a list "You might also like these products:".
Since a product can be linked to many produ... |
If i have two systems (A and B) running on LAN(INTRANET) which are directly connected. There are no routers in the middle. In this case, if system A sends a few UDP packets every few milliseconds to system B:
Is it possible that system B receives the packets in a different order?
Please note that I'm not asking whe... |
I am creating an advanced search page where there are about 20 search fields for a user to filter their search. My question deals with the query string, Is it standard web development practice to have say 20 parameters in a querystring?
The search results display large tables of data. Is there an alternative that stil... |
I'm working on a new common .NET software design (mainly) for WCF-based web service applications with related client frontends (all written in C#). As far I've chosen some frameworks (NUnit,Autofac/Castle Windsor) as basis for the application.
Now I'm doing some research concerning db abstraction. I'm considering NHibe... |
First of all, I'm not really a Javascript guy, but more towards PHP.
However, I want to move to the next level, that is taking load off the server and let the client do the processing. Hopefully to be a more JS guy.
My first thought is to request of data off the server, and it just returns key-values which the client w... |
I'm still restructuring the code I have been given to update on my current work project, and I've come to the point where I'm looking at how the code handles an 'exceptional' input, that doesn't conform to the business logic.
In essence, the code stitches together various different excel spreadsheets, tarts them up and... |
I'm working on a project that processes requests, and there are two components to the request: the command and the parameters. The handler for each command is very simple (< 10 lines, often < 5). There are at least 20 commands, and likely will have more than 50.
I've come up with a couple of solutions:
one big switch/... |
I am writing a node.js application which I am breaking down into modules, the issue is I am not sure how to organise my code in an idiomatic Javascript way.
Currently each of my modules exposes a set of functions that are intended to be called directly. All state is modified by the module with the gameId being the firs... |
One of my teammates is a jack of all trades in our IT shop and I respect his insight.
However, sometimes he reviews my code (he's second in command to our team leader, so that's expected) without a heads up. So sometimes he reviews my changes before they complete the end goal and makes changes right away... and has eve... |
Consider the following scenario.
You currently have a feature set A you wish to extend to include feature set B. In the near feature there's a high possibility that you wish to extend this even further to include feature set C.
Option 1) Cost to extend A -> B is minimal, but high maintenance
costs.
Option 2) Cost to r... |
We have sprints of 4 weeks duration. What I have been doing is 3 weeks dev time and 1 week of pure manual/automated testing, stabilization and shipment assurance testing.
How to manage TDD within dev time? In my previous experience writing tests and getting 80% coverage requires round about 50% of the development time... |
We have a URL in the following format
/instance/{instanceType}/{instanceId}
You can call it with the standard HTTP methods: POST, GET, DELETE, PUT. However, there are a few more actions that we take on it such as "Save as draft" or "Curate"
We thought we could just use custom HTTP methods like: DRAFT, VALIDATE, CURAT... |
Can someone please explain the best way to solve this problem.
Suppose I have three classes
Person
Venue
Vehicle
I have a DAO method that needs to return some or all of these attributes from each of the classes after doing a query.
Please note, by requirements I am using one DAO for all three classes and no framework... |
I am currently working on a project that has client applications communicating with a server process. The client applications could be local to the same machine as the server process, on the same network, or over the internet. I had written a single-threaded asynchronous RPC module for the server process using Boost AS... |
Suppose I have a form in my web application where users can upload a profile picture.
I've got few requirements about file size, dimensions etc, but when the user uploads the image, how should I name them on my system? I suppose it would need to be consistent and also unique.
Maybe a GUID?
a5c627bedc3c44b7ae7c06a44fb3f... |
I started developing websites using PHP. I have read many times that PHP is free and open source which is an advantage over ASP.net.
However, due to my current job requirements, I had to switch to ASP.net which is pretty good. Now after developing few applications, I am wondering how can I publish them for free. As P... |
Long story short, I'm working on a web-based frontend that interacts with a database, and one of the functions is that every action on a particular table gets logged to keep a full history of all changes to that table.
An earlier attempt at using triggers in postgreSQL to handle the logging automatically ran afoul of ... |
Why do books say, "the compiler allocates space for variables in memory". Isn't it the executable which does that? I mean, for example, if I write the following program,
#include <iostream>
using namespace std;
int main()
{
int foo;
return 0;
}
and compile it, and get an executable (let it be program.exe), no... |
So I develop an app that is for both Android and iOS.
From time to time changes occur when working on one version that need to implemented on the other. I find it tedious to keep track of these changes so I don't forget them later.
I'm just curious as to what other workflows you guys use when managing a single feature ... |
In most of the projects at work it will eventually show up a package, a class (or multiple packages and classes) named "Utils", where every kind of function is dumped into.
It becomes excruciating harder and harder to navigate the project without a properly named structure. I have tried to ask to stop using "Utils".
... |
I am the maintainer of a project which has a large non-technical userbase. I've been maintaining it for about 4 years now and adding new features as they've been requested.
I'd like to move on to other projects now and stop developing for this application. Because of the non-technical nature of the users, there have be... |
I spent couple of months learning Scala and got overwhelmed by number of different constructs it had,
After looking at partial functions, partially-applied functions, pattern matching, actor syntax,
I gave a thought to learning Clojure which doesn't have too much in terms of syntax but looking at the how Java inter-op... |
for ( i = 1 ; i <= N ; i++ )
{
for ( j = 0 ; j < i ; j++ )
{
if ( arr[j] > arr[i] )
{
temp = arr[j] ;
arr[j] = arr[i] ;
for ( k = i ; k > j ; k-- )
arr[k] = arr[k - 1] ;
arr[k + 1] = temp ;
}
}
}
Source: http://programminggeeks.com/c-code-for-insertion-sort/
If not, ... |
I'm currently working on a project which will have client applications (desktop & android & web) communicate with varies processes running on a server(s).
My question is how much should I be thinking about load balancing and the like?
All projects which I have worked on before consisted of creating applications for int... |
I am discovering web services to implement in my ASP.Net website. I visited many sites about Why use webservices and read many articles and found out that web services are good when you have something that is used frequently without loading your page.
I want to know some other example scenarios where web services are ... |
Being new to node js magic world, i'm wondering how does a web application's setup look like on a real production server?
So far all tutorials, create the js file that is started from a console...and that's it.
Anyone has created a real world web app that uses node js in the back end? Can you please describe how is it ... |
Are developers actually likely to receive significant help by open sourcing a work in its unfinished stages, or are open source consumers more likely to want something ready to use?
This is frequently cited as a benefit of open source, but I haven't been able to find evidence of it outside of already established produc... |
I need some clarifications on the responsibilities of the Build Script and the Build Server.
I read several articles on the Net about continuous integration and builds. Including
The F5 Key Is Not a Build Process
The Build Server: Your Project's Heart Monitor
Daily Builds Are Your Friend
And I had a conversation with... |
So we have an interface like so
/// <summary>
/// Interface for classes capable of creating foos
/// </summary>
public interface ICreatesFoo
{
/// <summary>
/// Creates foos
/// </summary>
void Create(Foo foo);
/// <summary>
/// Does Bar stuff
/// </summary>
void Bar();
}
Recently, we played a document... |
Working in immutable data with single assignments has the obvious effect of requiring more memory, one would presume, because you're constantly creating new values (though compilers under the covers do pointer tricks to make this less of an issue).
But I've heard a few times now that the losses there in performance are... |
When to use blocking sockets over non blocking sockets on UDP?
Question 1:What's is recommended for the following scenario ?
Multiple clients send data over multiple UDP sockets, i.e. say client1 sends data over sockets 100, 101, 102,..,105 . client2 on sockets 110,111,112...115 etc. Port numbers are fixed for clients... |
One of the devs that works with me is following the Open/Closed Principle to add functionality to a Model by extending from our framework ORM.
class BaseModel extends ORM {
...
}
All our models are now inheriting BaseModel, and this model works well in the context of our application.
class Product extends BaseMode... |
There's a (possibly abandoned) library I'm using in my project. Its Google Code project page mentions it's MIT licensed. Nowhere in the code itself, nor any of the included files, is there a copyright notice or license specified. The closest thing is the author's name in one of the headers.
Since the sole requiremen... |
I was running our code through JSHint, and decided to switch checks against cyclomatic complexity, and then went on long refactoring sprint. One place though baffled me, here is a code snippet:
var raf = null //raf stands for requestAnimationFrame
if (window.requestAnimationFrame) {
raf = window.requestAnimationFram... |
I'd like to implement a simple chess peer to peer network application : one instance of the program may register friends player, and when one friend is "connected" (I mean both available by another program instance and registered as friend), I can ask him to play a game.
As I know J2SE language, as well as Swing framew... |
I come from a strong OO background, and I have recently started working in an organization which, although the code is written in Java, has a lot less emphasis on good OO design than what I am used to. I have been told that I introduce "too much abstraction", and that I should instead code the way it has always been do... |
Is it a good idea to use somebody else's library as a base and build your own library over that.
I want to make a JavaScript Canvas framework for a animation player on top of KineticJS. Should I do it? Do I need permission from the author of KineticJS? Do I just say to users to donwload KineticJS before my library, or ... |
I'm implementing floating-point arithmetic, for a micro-controller which does not support floating point numbers, in either hardware or software.
(Software being "written" in a sort of electrical diagram program.)
I've finished encoding/decoding from/to integers, adding, subtracting, and multiplication.
My "floats" are... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.