instruction stringlengths 34 19.9k |
|---|
I am building a web application and RESTful web service.
I have been reading various articles about the best way to authenticate the requests to the web service.
The best option for me seems to be to use HTTP basic authentication. Pretty much every article ive read says that authentication should be encrypted over SSL ... |
Let's say I'm trying to find a number from 1 .. 100. All numbers in this range are "valid", in that they could be interpreted as potential solutions.
Let's say the ideal number is 50. And all numbers >= 50 are "feasible" in that they actually solve the problem. And all numbers < 50 are "not feasible" (but still valid).... |
Hypothetical scenario: Let's say we are downloading JSON from Facebook with details of a user's friend's checkins, posts, etc... These come in as one document per friend per activity, so with 8 activities a user with 300 friends will cause our system to make 2400 requests to Facebook, downloading 2400 JSON documents.
... |
I'm using .Net technologies and because ASP.Net "instant translation" is not really easy to do with ResX, since it has to be compiled after every change, there are a few hacks available (http://www.onpreinit.com/2009/06/updatable-aspnet-resx-resource-provider.html), but as it is, they're hacks... and they seem to have... |
Here's the scenario: Say you have millions of JSON documents stored as text files. Each JSON document is an array of "activity" objects, each of which contain a "created_datetime" attribute. What is the best way to merge/sort/filter/page through these activities via a web UI? For example, say we want to take a few thou... |
I am trying to design an application where users can make posts with Django on the backend. Right now I have to refresh the page with JavaScript every 20 or 30 seconds to check for new posts that might be available for that page. I was wondering if there are more effective ways to do this? Maybe with a JSON response? ... |
Possible Duplicate:
I’ve inherited 200K lines of spaghetti code — what now?
For my next project, I've been tasked with "overhauling" a large legacy web application with many parts. It is a JSP application written in 2004 and it is used heavily by my company.
This application was designed badly in that there is no... |
I'm developing software for about 10 years. I began on QBasic and now I'm developing .NET using C# language. I'm always trying to follow the best design patterns and principals like SOLID. In short I'm very happy with my work while as a tiny ISV I'm free to choose between technologies. Of course we almost develop mid-s... |
I've come to understand that long before Haskell, O'Caml or LISP, higher order functions were an academic research subject and in mathematics, Schönfinkel (in 1967) and Haskell Curry (in 1968) already applied techniques such as currying, but that was before it was available in any programming language.
Scheme, accordin... |
Summary:
Should a function in C always check to make sure it is not dereferencing a NULL pointer? If not when is it appropriate to skip these checks?
Details:
I've been reading some books about programming interviews and I'm wondering what the appropriate degree of input validation for function arguments in C is? Ob... |
I find my self in a situation, where I need to program a service, that can determine if two object in a huge database are the same. For simplicity, let's say it's used cars, and I want to determine if they are the exact same, based on various attributes e.g. brand, model name, year, milage, price, color etc. The proble... |
I am working on open source project, that uses the source code from FlatAssembler project, which uses following license, based on BSD 2-clause with one additional clause added at the end of the text.
So, the questions are:
What this additional clause changes?
Is it legal to use this code and to license my project unde... |
In one of my interviews I was asked a vague question, I'm still not sure of the answer. We have a client and a server they are placed apart. The network that connects them has high latency, which is dominating the performance. How can we improve the performance. Note that we can't change the network's topology. I was t... |
I am developing an application for my universities student research symposium around the idea of polyglot persistence. I have read Martin Fowlers book and done some other research online about the verious different types of NoSQL db's. I am curious as to what the different use cases are for the different NoSQL database... |
I've had an internal promotion interview for gain a higher level programmer title, something like Senior plus.
And I've been interviewed by around 7 people using different technology, and people using the same technology with me(.Net) tend to ask very technique detailed question which can actually easily been found vi... |
I am a Java (Web) Developer. Having knowledge about c#, PHP and Ruby. I am getting confused how to keep myself updated with very fast changing the programming language and their implementation.
Like, in the mobile, you can see around 7-8 OS. There are very much finer example of event-driven programming to make scalable... |
So I'm doing a fairly involved javascript/html client with lots of ajax calls and other involvements of callback-ism. I'm entertaining the thought of using Fay for this purpose. I'm aware of Elm. Tried it and liked the FRP elements. Now I'm looking to know if similar structure is possible in Fay.
Are there any concrete... |
I am working on a product for a client that must be valid and fit for purpose.
It's built on a LAMP stack (PHP/Cake), so there's GPL, MIT, PHP, APACHE licenses:
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, ... |
I'm an electrical engineer that was kind of thrust into the digital world and learning as I go. I'm programming a TI processor to do a PID (proportional-integral-derivative) loop, illustrated by this diagram:
I'll also describe it:
Negative feedback op-amp, with non-inverting terminal grounded. Input through negative ... |
I am aware of some of the problems of the concept of "releasing a work to the public domain" (as mentioned here and here; I haven't listened to this specific discussion yet). IANAL, but the main problems seem to be as follows:
Releasing to the public domain doesn't exist in many jurisdictions; rather, a work becomes p... |
Somebody explained to me that since in agile development, policy and the application logic should be more important than details such as persistence method, persistence decision should be taken at the end. So it might be a good idea to start with simpler persistence such as flat files, until we reach the point the weak... |
One of my company's applications still requires a hardware key to run, but we're currently in the process of removing that requirement and replacing it with an online check. The issue we are having is that we allow our customers to set up test systems with copies of their live databases. With the hardware keys, that ... |
One interesting issue appeared for me today. In a distributed SCRUM team when do you start enforcing an unitary work environment in terms of code format, IDE plugins (checkstyle & co), VCS, CI? The team is in an exploratory phase and thegoal is not production quality code but rather proof-of-concept. Isn't it an overhe... |
Background / The Problem
I need to make a (large) application with a certain set of core functionality, and certain functionality for multiple clients within it. Each client has different requirements and while they may share some functionality, I need to separate the code for each client, so a change to one won't affe... |
Following a standard framework of project management, for a software development project we will provide deliverables (documents and software) at the end of each month :
My question is:
From May to June, while software is in development, what would be the deliverable for each month?
Each document starts as version 1.... |
I'm classically trained psychologist, not a programmer, so sometimes the more advanced aspects of programming escape me, in particular regarding program efficiency and/or certain best practices, in this case with regard to the use of variables.
Here is some pseudo-code:
var a;
var b;
var c;
function GetSomeInformation(... |
I come with a clear agenda on how to code correctly. I used to be a team leader, and I managed using significant amount of mentoring to create a team that creates high quality code.
Now I have 3 teams under me, each one has its own team leader. My time is mostly spent on strategic meetings and I can't devote enough of ... |
I am currently doing a project (in PHP) that has the following requirements:
There is a list of people, sorted in a certain priority. Work should be allocated to them by this priority. e.g. If the list is T1, T2, T3, T1 should be allocated work, before T2. And T2 is allocated work before T3. In the event that are only... |
In an answer to another question, I suggested creating a randomized value for input to a specific method. In my experience this has been useful for making tests more readable and it lets you skip the "trivial phase" where you hardcode specific results in a method.
Here's the unit test code pasted from the other answer... |
This question & its answers are useful but not sufficient for my problem.
My Question is if I want to add a javadoc as @Deprecated As of version x.y, replaced by {@link SomeClass} in my current file's javadoc then what should be the version no. in place of x.y ??
Let my current version is 1.2 & after CVS checkin it wil... |
In Java,C++,Objective C, C#, and all other similar OOP languages,
Why don't we use a class with static methods and vars instead of going through a singleton syntax having to deal with various scenarios ?
|
I've seen a lot of advice for freelance programmers which advocates quoting your rates in periods of a minimum of one day. That means that when someone asks your rate, you would say "$500 per day" rather than giving the equivalent hourly rate.
If I agree to do 10 days of programming work for a client at a particular da... |
Every year in january we process a big task with our system. While the performance during the task was above average the maintaince follow up is currently having a lot of trouble with jobs running too long and out of their respective time schedule. Therefore I am tasked with the optimization of those maintaince jobs an... |
I am creating an application which will be testable(unit + integration). In this application I have a FileHelper static class,
public static class FileHelper
{
public static void ExtractZipFile(Stream zipStream, string location)
{
..................................
}
public static void CreatePa... |
I recently asked this question on SO, which quickly became downvoted and closed. Clearly I lack a deeper understanding of JS, which I'm hoping you'll help me fill here.
I'm a perfectly capable web developer and have built plenty of visually and functionally pleasing websites but am struggling to get to grips with how I... |
When applying the State Pattern illegal transitions should result in an exception being thrown (or at least that's what I understood from the pattern)
I know exceptions are for "unexpected behavior" where an action isn't supposed to happen. Errors would be more appropriate if the required action is common (ex: user ent... |
I am going to start a new project using Scrum and Jira and I have some questions regarding how to write proper tasks in Jira.
From what I understand user stories are small non-technical descriptions written by the stakeholders (ideally) that can have the form: As a user I want to order monkies so I can earn money.
Howe... |
I'm writing a few libraries that I want to release as open source projects, but I want to find a licence that means I'll receive the credit when it is used in a project. Im not fussed about anything else, if people want to profit off of it then thats fine. So what licence is most appropriate? The only factor for me is ... |
I'd like to read the documentation of Azure Active Directory on my kindle (or similar device), but don't want to use "Print to Kindle" for each and every page.
Is the Microsoft documentation for this technology available in other formats? (.chm, PDF, etc).
If an alternative format is available, then I can adapt that t... |
I found this:
http://msgpack.org/
But.. I've never used it, so I don't know what whether it is much good. Anybody has proposals?
Basic requirements:
serialize as many data structures used typically in both languages as possible, have no problem with nesting
as reliable/unbuggy as possible
high performance is nice to h... |
I have filled that standard form where you list your previous inventions before starting your new job so the employer is legally aware you have the copyright over them. But if I want to use this invention (software code / framework) in my new job, would they have any copyright claims on it if for example I change / imp... |
I'm just starting out with python and since I'm coming from a PHP background (thus have to adjust my mind to wrap around new concepts) one major question still stands without answer - why does Flask need a template engine?
The way I was used to go about things, was to have a template.html that contained valid html with... |
Should a programmer be able to perform all operations programmatically on a object that a user could do?
By way of example, I'm working with a list selection object. To populate the list List.AddItem(itemData) is repeatedly called until it is built. A user can then:
View the entire list
Select a single item from the l... |
Reading about various techie sites, there is often a feeling that Microsoft Languages / Oracle etc. are considered "enterprise ready", while there seems to be more doubt about languages such as Python or Ruby.
Why is this?
Do Microsoft languages actually have less security holes or not?
|
To write Unit Tests we have to write extra bits of code.
For several projects we do Unit Tests and for several projects we do not.
As a Team Leader I face trouble to make the right decision.
Is there any or list of terms by which I can take the right decision whether we will do Unit tests or not?
EDIT: Please provide ... |
Disclaimer: Opinions expressed are solely my own and do not express the views or opinions of my employer.
I work for a small company, in which few people are developers, others are QA/Test and 1 is a Manager. I joined this company 1.5 years ago. 3 senior developers have 8+ years of experience.
These are the observati... |
This is a bit pedantic, but I've seen some people use Id as in:
private int userId;
public int getUserId();
and others use:
private int userID;
public int getUserID();
Is one of these a better name than the other? Why? I've seen this done very inconsistently in large projects. If I were to set a standard which would ... |
I have a class in which I want to disallow other programmers from overriding one of it's methods, since it requires special knowledge of the inner workings of the class. Since I personally know how the class works, I would like to be able to make an exception and actually DO override the function in one derived class. ... |
I read few articles about composite pattern and I want to know whether its applicable in following situation,
I found that "A Composite Entity object can represent a coarse-grained
object and all its related dependent objects"
public class PatientRegistrationDTO
{
public string RegistrationNo;
public string ID;... |
Where does the word "argument" (in the programming sense) come from?
i.e. Why are actual parameters called "arguments"?
The meanings don't seem related, and I haven't found any explanation of it anywhere.
Note on the terminology:
"Formal" parameters (also known simply as "parameters") are the "placeholder" names ... |
I would like to sell a software that has some open source competitors. Therefore I would like to include the source code with the binaries so that the company buying it can modify it as it wishes. The only catch is that the source code will NOT belong to the company, in other words, I would like to maintain the copyrig... |
I've implemented an application using MVP with GWT, which is working out very nicely for views that have a single purpose. Now, it has evolved into views that are achieving multiple purposes in a single window. So now I have a view of views with each view having its own presenter. I used this example as my model for... |
We've built a single-tenant webapp in PHP and as it stands each hosted 'site' has its own database.
However we need to be able to run a script to create their database, assign a mysql user, and insert the default sql.
Now, we've got the database and user stuff working fine, its just the importing of the SQL. From what... |
As I find that UpperCase are really readable for first letter word separation in long complex names, I tend to give some of my Linux files names with some UpperCase. Mostly executables, some directories too.
But it's been a few weeks I have remarked that the huge majority off all file names in my linux distrib are lowe... |
I am writing an application to report to the user(devs) when their website fails. And what I mean by fails which is unfunctional or needs to report the problem to devs. I do understand that status code 2XX means 'Success' according to wiki. But does that really do? I have access my website once and returned 204 'No-Con... |
Let's say we have a method setFoo that sets a flag in a Bar object e.g.
class Baz {
public void setFoo(String foo)(
...
}
}
inside setFoo, the method is doing some expensive load of the Bar object from the database.
class Baz {
public void setFoo(String foo)(
Bar bar = expensiveGetBar();
... |
I get stuck each time I need to write a constructor for any class I design. The reason is that I am not sure what should go into a constructor and what should not.
On googling for this, I got the answer that the constructor need to do only as much as to make sure that the opbect created is valid. But my query is
How ... |
Considering how software is developed during a release cycle (implementation, testing, bug fixing, release) I was thinking that one should be able to see some pattern in the lines of code that are changed in the code base; e.g. towards the end of a project, if the code becomes more stable, one should see that fewer lin... |
When having a continuous integration executing the tests at each commit, a common best practice is to have all the tests passing at all times (aka "do not break the build").
I find some problems with that:
For example one cannot help an open source project by creating tests corresponding to tickets. I know if I propose... |
my question is going to be somewhat philosophical and "architectural oriented" so bear with me.
Right now we have existing Java web application built on top of Spring and JSF(facelets) with maven. These are basically our tools that limit our scope of possible solutions.
Now to the point. We need to implement a fork of ... |
Are there any practical references (with actual examples) for getting started implementing a small, lazy functional programming language with graph reduction? A reference that included the lexing and parsing steps would be especially helpful.
So far I've read most of the Implementation of Functional Programming Languag... |
When using a MVC pattern for server side code (in my case django), the model definition is defined once in the model component. When using a client side MVC based library(in my case backbone) the model definition or some subset is redefined. If I were to make a change to my server side model definition, let's say add a... |
I am developing a Mojo(think it as just a usual class) for my custom Maven Plugin. There is an Abstract Mojo at top. I have some other custom Mojos in example which makes server side includes. I have some static variables and some util methods in example get operating system name, fix file separator in order to used op... |
I've been researching puppet lately, and I think it could be useful to integrate into my deployment pipeline.
Currently, I deploy my apps by manually adding users, creating vhosts, setting directories, and then git cloning my repo from GitHub. I deploy changes with a simple Git pull (Git hooks take care of database mig... |
I am about to participate in a discussion with management regarding measuring our testing efficiency as a QA organization. The main reason behind this is that half of our team is contracted out and our business would like to provide some metrics of how effective/efficient we are, so that we have basis data on which to ... |
My Project:
I have employees who are required to go through a checklist when they encounter a duck, a cat, and a human. In our business, we have a set number of ducks, cats, and humans that come in and out of our doors. When they come in, we have to check that all of these features are present.
The features:
Here is o... |
It seems like most of the Scrum articles and books that I've read as well as the lectures I've heard have very little to say about the process of creating the items on the backlog. How should a team on a medium or large project (i.e. more than a few team members) go about creating and detailing the items on the backlog... |
I'm wondering what's the reasoning behind Bootstrap's decision to change all camel case names into hyphenated names in v3.0. I searched on Google, and looked in a few books, but I can only find opinions one way or the other - no hard data.
Are there any studies that suggest camel case variable names are more readable t... |
I've noticed that a coworker and I have opposite practices regarding the ordering of methods in our Java classes. One of us begins a class with its major public methods, and then put all of the private helpers afterwards. The other one of us makes sure that public methods are at the very end.
Clearly, this is just a st... |
I know this has a great chance of being marked as duplicate, but couldn't find exactly what I'm looking for
This is a common problem and I'm sure it has some well defined best practice solution
Background
A single page SaaS app, has lot's of drag and drop, user can
interact with it without much server communication fo... |
I am currently working on a project that makes use of the OpenSSL library for secure communications. Since this library is a requirement for building the project, I am considering including it in the project's repository. Here are the pros and cons as I see them:
Pros:
Self-contained build - with one exception, everyt... |
I have read at many places including this - http://msdn.microsoft.com/en-us/library/seyhszts.aspx - that you should use exception handling when something is truly exceptional.
The .Net File.Open function throws FileNotFoundException, etc. instead of returning error codes. Now it can frequently happen that the filename ... |
Consider the following code, in which the setter is deliberately broken due to a mundane programming error that I have made for real a few times in the past:
<?php
class TestClass {
private $testField;
function setField($newVal) {
$testField = $newVal;
// deliberately brok... |
Let me preface this with saying I am not a Business Intelligence (BI) developer. I'm a .NET developer, and I have only a vague notion of what BI is, and encompasses.
I've been an evangelist for a secure development lifecycle in our company, and recently convinced the rest of the development team that we should be doin... |
C is the best language (or maybe the single language) suitable for operating systems, drivers, embedded systems etc. For more complex domains like computer graphics C++ is a better choice. But these applications have thorough performance requirements and they are only feasible to be built in C/C++.
Now the question is,... |
I wrote this class that does a few things (perhaps this is a violation of the Single Responsibility Principle). I realize now that some other part of the project needs a piece of that logic and the way I'm going to expose it is to extract a class out of my original System Under Test.
I anticipate being able to do this... |
I wrote a sync tool to synchronize folders/files from Alfresco to Windows.
PROBLEM:
In Alfresco, /files/can/have/very/very/very/long/filepaths/like/this.txt
The Windows API prevents me from creating a path with more than 260 characters.
In addition to telling the user there is a problem, what is the best practice in ... |
Just moved this question from Stack Overflow. Since, adding my code snippets itself would make this question really long. Instead, I am pretty interested in knowing a better ways for data retrieval on application that needs to handle limited amount of data which isn't updated regularly. Let's take this example:
I am wr... |
I'm building a web-app where users can keep track of who owes whom money.
I have users and debts.
Given a user I want to be able to find out all the debts to other users, and all the loans to other users.
Given a debt I want to be able to find out who the debtor and lender are.
The asker of this question ran into a sim... |
I have across a thread mentioning that Erlang would not be suited for a web application serving files.
I was curious whether anyone had any experience building such webservice with erlang? Would Haskell be more suited for this, if so how ?
|
I have a site where a regular user can delete records, where what happens is that an IsDeleted flag gets set. On administrative pages, a privileged user can delete records where an actual SQL DELETE permanently discards such records. The difference is important for obvious reasons, and I want to use a consistent term t... |
I have started a project where I need to design an application that will work as a code-block editor, much like lego mindstorms and this google project. http://code.google.com/p/blockly/
What are the possible approaches for designing such an application in Java?
More specifically, assuming I have one block A, how can I... |
I would like to study the source code of the standard command line functions in Linux such as ls, echo, cat, etc. But I have been unable to find the source code (a Google search was useless).
Does someone know where it's available? I know it's a naive question but I really can't find this source code.
|
I am a young engineer recently employed at a small company that sells products to the general public. We use Ruby On Rails and MySQL. Our database has a lot of customer data, but a great deal more of "static" persistent data. This data is so rarely changed that some of the more senior engineers have begun to talk about... |
I've always been taught that having side-effects in an if condition are bad. What I mean is;
if (conditionThenHandle()) {
// do effectively nothing
}
... as opposed to;
if (condition()) {
handle();
}
... and I understand that, and my collegues are happy because I don't do it, and we all go home at 17:00 on a ... |
In C# it is legal to write
Animal[] a = new Giraffe[4]; //with obvious relationships
Because arrays are covariant. However, this is a breaking relationship. It's a runtime exception to then apply a different type of Animal to this array because the backing store is a Giraffe.
a[0] = new Cat(); //KABOOM
Why doesn'... |
Say I have:
interface Thing
{
GetThing();
}
class FastThing : Thing
{
public int GetThing()
{
return 1;
}
}
class SlowThing : Thing
{
public int GetThing()
{
return GetThingFromDatabase();
}
}
Is this a violation of the Liskov Substitution Principle?
|
On a number line of length M, where 0 < M <= 1,000,000,000, you given N (1 < N <= 100,000) integer pairs of points. In each pair, the first point represents where an object is currently located, and the second point represents where an object should be moved. (Keep in mind the second point may be smaller than the first... |
I am deeply confused the difference. I've read so many definitions and they always explain functional test as testing the requirement is satisfied. Well, that's just rephrasing the name functional test. That doesn't clarify the difference.
I am interested in some real code to demonstrate the difference.
Suppose we have... |
Erlang, Go, and Rust all claim in one way or another that they support concurrent programming with cheap "threads"/coroutines. The Go FAQ states:
It is practical to create hundreds of thousands of goroutines in the same address space.
The Rust Tutorial says:
Because tasks are significantly cheaper to create than t... |
If a server certificate is published to Github, a la:
-----BEGIN CERTIFICATE-----
is that necessarily a bad thing? Is there ever a legitimate reason to do this?
I ask because of a recent wave of attention Github has gotten since allowing users to search for certain things as .ssh/id.rsa and the like in public reposito... |
I have a Silverlight application that uses Entity Framework.
The application are protected with a login made in ASP, so only valid users get the xap file.
Have do I secure the WCF calls to the Entity Framework? I have to make the calls over https, but have can i make sure that only valid users can get data from the WC... |
I'm starting a game project in C++ using the SFML.
It provides various classes for handling graphics, input, etc, but I would like to wrap it all up in a single Media class.
I believe that by doing so, I could simplify my effort and have the class take care of the details, limiting the amount of code I have to write an... |
I'm doing a full-time job (developer) and at the end of the day, I work on my part-time job (developer).
How do you work, with different projects, without loosing focus? Often, my focus on the full-time job still remains at my head when working on my part-time job or the other way around.
|
I've read plenty of articles around different patterns in use with WPF and this is something I've yet to understand: should a code-behind file be considered part of the view? As a consequence, should code-behind files be allowed utilise knowledge of specific elements in the markup?
I have a number of scenarios where th... |
I'm rewriting somebody else's code at the minute, and I came across two classes which reference each other directly and call methods on each other. Like so (example in C#):
class A {
B otherClass;
public A() {
this.otherClass = new B(this);
}
// Other methods here call methods on B
}
class B {
A otherCla... |
I've been programming in various languages for about 10 years now. And I still haven't figured out when it is a good idea to import something into the global namespace (using x::y in C++, from x import y in Python etc.), so I hardly ever do it.
It almost always seems like a bad idea to me, if only because it limits the... |
I want to know the differences between normative and informative annexes in Ada 95.
I am just able to find a list of each of them but not the differences. What are the differences?
|
I have a problem with Visual Studio 2012 and Environment Variables under Windows 7.
I added a variable called {LIBS} with the value C:/libs/.
In C:/libs/ are folders containing C++ libraries.
So far, so good. I added the paths to the project's settings (linker etc.), like {$LIBS}boost to include the boost libraries.
I ... |
In the long debate of using arrays vs lists in the public API of Java classes, I tend to prefer lists in most situations.
However, I also found convenient to use var arguments in many constructors and methods, which require declaring an argument of the method (the last one) as an array (implicitly adding "..." before t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.