instruction stringlengths 34 19.9k |
|---|
A project I work on uses source code that's been purchased from a third party. The source code is delivered to us in a zip file. We store this source code in version control (TFS 2010) and routinely make modifications to it.
When the third party releases a new version of the product we've purchased, I need to merge t... |
I was shocked today to discover that this code compiles cleanly in Java:
public class A {
public static class B {
private static void x() {}
}
private static class C {
private /* So, private to what exactly? */ static void x() {}
}
public static void main(String[] args) {
B.x(); C.x();
}
}
It... |
Question
Given two cloud services, Sender A & Receiver B, communicating over HTTPS, what options do I have to ensure that Receiver B only response to Sender A? For the purposes of
Background
The receiver is generating activation keys for some hardware from a serial number. Our support team is using Salesforce and we... |
I'm a developer and I have had several experiences in web application deployment which are the following:
Deploy all files then apply configuration values as appropriate to the environment. We've used this style of deployment for larger softwares with long development cycles and quick releases aren't needed or allowed... |
I've been doing TDD for a while now, I feel pretty good about it, I love my test suites and all. However I've noticed that lately I've been doing a lot of mock call verification. For example I'd have a Service that will have a Repository injected - in my unit test I'd pass a mock of the Repository and verify that it wa... |
Suppose that I have the following logical information:
(tag_name, id). For example: (food, 1),(food, 2),(food, 3),(drink, 1),(drink, 2)
I'm trying to decide what is the best way to store it in a database. I can simply use a (STRING, INTEGER) table like in the example, or a more compact (STRING, INTEGER_LIST), like so: ... |
In languages where cons lists are a major datatype, it is very easy to create a list from last to first by prepending items. When doing processing from some input file, however, one is most likely to encounter items in first to last order.
Do languages like these typically recurse?
(define (parse file)
...
(cons da... |
On software company websites I visit the first time, I often open the "Contact us" page and try to submit the contact form with all fields empty. I am just curios if they validate the user input.
If it is just submitted or only validated poorly (e.g. only Javascript validation), I often hear myself thinking
Oh, look h... |
If I abandon creating model objects which I only use to pass information and use NSDictionaries instead and have constant for keys in the same place where I am using the model, then does it have any impact on performance ?
For example: If I start passing NSDictionaries to custom cell's instead of creating Model classes... |
Our team is learning to work with MongoDB. We have to model the user among other things for an OAuth-based application. We know how to model in the relational world, but are unsure about how to do it in NoSQL.
In our application we identify the user uniquely by her email address. Email addresses are naturally unique an... |
I recently got interested in Artificial Intelligence. In my daily life I am a software engineer at a company that develops mobile apps. I am wondering what is the best way to read up on AI? What are 'must-read' books for information about AI?
|
So I've done a lot of research and found that Codecademy has been mentioned several times on other forums. I got stuck in and chose JavaScript through Codecademy most probably thinking it was 'Java' and I'm now slightly concerned that I have made a bad choice.. due to the fact that I see posts mentioning JavaScript tea... |
Which of these programming styles is better?
var result = methodOne(methodTwo(a, methodThree(b)), c, d);
or
var result3 = methodThree(b);
var result2 = methodTwo(a, result3);
var result = methodOne(result2, c, d);
|
I'm writing a web app that requires the usage of drag and drop as well as other jQuery/HTML5 features.
There are two options for saving a user's changes to a database
Implicit: database save on the end of an event, such as drop, hover, ect.
Explicit: save changes to local array and submit on submit button click even... |
I'm working in a REST JavaScript client, and I'm trying to follow the MVC pattern, but a very basic question came to my mind: who should make the http request and load the data into the model?
My intuition tells me that the controller should do it, but in lots of examples (the ember.js documentation, by example) it's d... |
I have a quite specific question regarding Subversion structure, different permission levels and Visual Studio projects and solutions: We develop a framework with external partners with functionality the partner is not allowed to see.
Consider following structure of a VS solution:
example.sln
|_ /unit1/unit1.csproj (in... |
I'm new to TFS branches, and have opted to set up a \Dev and \Main branch (ultimately there will be release branches too). I'm using TFS2012. My understanding is that I will work on the \Dev branch on a day to day basis. When a bug is fixed or a user story is completed, I will merge \Dev to \Main, build, and give that ... |
When building a REST service with the HATEOAS constraint, it's very easy to advertise the existence of resources through linking. You make a GET to the root of my site and I respond with the root document listing all the first-tier resources:
{
users: { href: "/users" }
questions { href: "/questions" }
}
Clien... |
Let's say that we have some values, represented by power of 2:
TYPE_1 = 1
TYPE_2 = 2
TYPE_3 = 4
TYPE_4 = 8
...
I need to store some of these types in one value.
Example:
To represent TYPE_1 with TYPE_3, the value is 5.
What operation is used to identify that value 5 represent TYPE_1 with TYPE_3?
|
I'm working on a .net web app project where we develop on our personal machines, but our testing and production environments are in a corporate intranet. The problem is I run into bugs that only present in the testing/production environment, but not in dev. I find this makes it really difficult to track down the cause ... |
We are porting our Java API library to C++. (Our target platforms are Linux and Windows.) Since we have minimal C++ experience, the learning curve has been pretty steep, but overall we have been able to make a clean port so far.
In Java we use log4j, and are looking at to use log4cxx in the C++ version. It took us ... |
I've read in many places (heck, I've even written so myself) that garbage collection could (theoretically) be faster than manual memory management.
However, showing is a lot harder to come by than telling.
I have never actually seen any piece of code that demonstrates this effect in action.
Does anyone have (or know wh... |
The Evercookie project has several contributors and there is no explicit license for the code. There is currently discussion on the dev mailing list trying to figure out what the licensing options are.
Is there any tool or process that can be used to find consensus among the various licenses?
What can be done if some... |
I'm reading through Mark Seeman's Dependency Injection in .NET (excellent read so far) and something is escaping me.
If the application's architecture is like [DAL] => [BLL] <= [UI], with the Business Logic Layer free of dependencies upon Data Access and UI layers (and both dependent upon the BLL), and if the compositi... |
I'm working on a new point of sale for a company that products for different prices depending on the product mix.
All products have a base price.
To explain my problem, I will use the following info:
Product Category Price
A 1 45
B 1 70
Q ... |
I'm on my first real software project following the whole SDLC and am a bit confused. We have a requirement that states something like "The battery will be monitored each second" which needs to be verified. This is something that can't really be checked in the system since it happens "inside", i.e. there's no output th... |
From what I've gathered, big O notation is used to describe the length of an operation. However, that's as far as I've gotten. What exactly is big O notation and how do the most common ones (O(n), O(2n), O(n^2), O(log n), etc)?
|
We've just finishing up the first release of a database driven web application, which is now in regression testing. The application has an advanced search with many different filtering criteria. When the search is first used with only the 3(of 28) minimum required search criteria it takes like 15-20 secs to calculate a... |
I prefer Single Page Application to server side generated HTML.
I am sensible to the pitch of "high productivity" delivered by Play.
Now if I don't use the HTML generation part, is it still valuable? Is it worthwile to learn it? For the controller (REST or other), business logic, persistence.
Does it help generating u... |
Using macros readers, it's possible to interpret JavaScript, and have it compiled just like normal Common Lisp code. Hence getting the benefits of Lisp implementations, notably their performance. Which would mean having native performance in the browser, without cheating.
Would it be technically possible to build this ... |
I'm working on an automated update system for a legacy server/client software package written in Delphi. The way I'm designing it is so the client's (customer's) server machine runs a service which...
periodically checks online for new versions
automatically downloads files
hosts latest version information for all cli... |
I need to design a DB for storing key-value data. List of Key names isn't fixed and should expand at later point.
I don't want to create a table with a column for each key, because I'll need to add columns frequently and it might grow too big, and I understood that the Entity-Attribute-Value design isn't efficient.
I t... |
I am building a GUI to interface an embedded device to a PC host. The GUI provides control over the device parameters and displays some feedback from it. The GUI also has to emulate some of the device functionality and present it to the user.
I have been advised to use a Model-View-Controller pattern, so that if the de... |
I'm working on development of SMS parking software, and I'm stuck at one point for a month... I need to implement periods of payment (or work time, of a work day, if you will). Here's the problem:
For an example, traffic wardens work from Monday to Saturday. From Monday to Friday, the work times are from 07:00 to 21:00... |
Does anyone have a diagram showing all significant programming paradigms. Something like this but with paradigms as titles would be ideal:
|
I don't know whether this is even possible or I imagine (according to my habit of over thinking) will bring through numerous issues but let me give it a go.
I have an idea where I would like a single web service which a user will send a request to, for example logging in. The response back dictates a URL where they get... |
So I'm in a little bit of a pickle. I suppose some people have gotten in my situation at some point, I know but at least as many have kept going for various reasons. To put the problem shortly; I am stuck in a project which I have after several attempts of "new fresh attitude" ended up drained out of energy and creativ... |
We have a point-of-sale system that was developed using ado.net, our current concern is to make the application real fast in creating transactions (sales). Usually there are no performance concerns with high end PCs but with with low end PCs, the transactions take really slow.
The main concern is on saving transactions... |
I had an interview few weeks back, and I was asked to write a code with Setters and Getters. I had written the following code;
// Just an example
Class ABC{
private int num;
public void setNum(int givenNum){
this.num = givenNum;
}
public int getNum(){
return num;
}
public ABC... |
So I am working on creating a Google App Engine Application, and I've come across the term "expose" a number of times, e.g. "your first app can expose objects using an HTTP based API" and "expose this datamodel class through a REST API". What does "expose" mean? Is there a particular action associated it, or is it an a... |
Would love to know your thoughts on a curriculum that will be developed for people that want to get started in the programming field. The goal of the course is to help it's students to ensure that students have an understanding of the theory and skills required to be a programmer, and have enough skills to get entry-le... |
I have a problem I was hoping I could get some advice on!
I have a LOT of text as input (about 20GB worth, not MASSIVE but big enough). This is just free text, unstructured.
I have a 'category list'. I want to process the text, and cross-reference the items in the category list, and output the categories for each mat... |
I am designing an API and am having a couple of problems with certain parts of the resource modelling.
I have the notion of a SurveyItem which as a collective form a Survey:
Survey Resource Endpoint:
http://api.somewhere.com/survey
Accessing Survey Items
http://api.somewhere.com/survey/1/surveyitems
Pretty basic and ... |
So I am still fairly new to ruby, though I have noticed that it is very hard to create 2d-array and that hashes seem to be more of the go to data structure than arrays.
I was wondering why the Ruby community is so focused on Hashes and maybe if there is something more ruby-idiomatic than a 2d-array when trying to creat... |
I want to create my own website that would allow me to acess a database in the server and do inserts and lookups in a user friendly way. I am a seasoned user of linux and C/C++, and also have experience with Python and sqlite3, but i don't have any experience in Web development, so i have no idea where to start.
I have... |
We have a 3-tier application with a C# client that connects to a C# web service via WCF and requests data from a SQL Server database.
One feature in our application is a user-created form app in which our customers setup forms that have fields. The fields refer to values that can be imported, entered by the user, or c... |
I'm trying to wrap my head around models, views, and controllers, but I feel as though the more I read, the more conflicting information I seem to encounter. I guess the general goal is--as far as I've seen--to shoot for fat models and thin controllers, but I'm still a bit baffled by where to put what. Can I give an ex... |
I have always avoided duplicating code regardless of the circumstance. For example, if I have a working piece of functionality that needs to be re-used by different entities, I always refactor to make this functionality available. Under no circumstance would I duplicate code. I am probably a little rigid when it com... |
Let's say I have
procedure1() {
--body of first procedure--
}
Then I rename it into procedure2 and create a procedure1 above it:
procedure1() {
--body of second procedure--
}
procedure2() {
--body of first procedure--
}
Not once a line-based diff tool has highlighted the code from --body of second proced... |
I'm having a funny but also terrible problem. I'm about to launch a new (iPhone) app. It's a turn-based multiplayer game running on my own custom backend. But I'm afraid to launch.
For some reason, I think it might become something big and that its popularity will kill my poor lonely single server + MySQL database.
On ... |
I've been working in the software industry for a few years now. I've seen Waterfall in practice, and I've seen several projects attempt Agile with varying degrees of success... which got me thinking.
What are the bare-minimum requirements for an Agile startup to be successful? I'm thinking in terms of tools, practice... |
I'm creating an open source PHP project that reuses other open source code instead of reinventing the wheel. I'm using composer to pull these projects into my vendor folder. What happens if these vendors delete their repository & all traces of their code from the internet? Now composer can't download the project. Shoul... |
I have VB.Net project, with a class with a couple of abstract (mustoverride) properties, that I am thinking about moving into an interface.
My question, is structurally how do I do this? Currently all of the classes that would be implementing this are derived from this base class, so it might make sense to put it in t... |
On hackernews and /r/programming I've heard several reports of how the games industry is incredibly harsh on programmers. Someone on this site also linked this blog post in an answer I read recently. According to various reports, programmers in the games industry are severely overworked. Perhaps not when working for... |
How do interpreted languages typically go about representing floating-point numbers in their bytecode? For example, suppose I've got a Java program with the line
double a = 3.0;
What does 3.0 look like in the program's bytecode? I see two possibilities:
1) Writing the bit-level representation of the in-memory number ... |
I'm not talking about countryside colleges/unis.
Are there any thought-out procedures in top-ranking institutions based on formal criteria, actual statistics or demand from the industry?
If so, what are the criteria used?
Are the decisions to drop certain languages and introduce others made systematically or in a haph... |
I see that Java has Boolean (class) vs boolean (primitive). Likewise, there's an Integer (class) vs int (primitive). What's the best practice on when to use the primitive version vs the class? Should I basically always be using the class version unless I have a specific (performance?) reason not to? What's the most... |
We make iOS apps where we often get data in a list from an API, then we select the data and go to the next ViewController.
Often it happens that the server is down or some API is not ready.
What is a good development practice where we can continue our regular work flow without depending on the webservice and then when ... |
It is popular to write documentation in the same file as the code and extract that using software to generate documents. In order to not affect performance, the documentation is written within commented lines, in a DSL designed just for the purpose of that. And that often results in cumbersome source file.
Nowadays, te... |
For the last 3 sprints or so, I've observed our Product Owner suddenly shoving new stories -- stories not previously in the Product Backlog -- at the top of the Product Backlog.
Because of this, the existing items in the backlog never get worked on. New stories continuously take over the helm and make into our Sprint ... |
I am not sure if this is the place to ask the following conceptual question (Stackoverflow is definitely not).
I saw this question in a multiple choice exam (single answer), similar to the ISTQB exams:
Why it is not recommended to report several defects in the same issue
/ ticket ?
a. In order to keep the report con... |
I was trying to find the sum of divisors of numbers upto 106. The test cases are like of the order of 105. I have done some pre processing like
int divisors(int num)
{
int sum=0;
for(int i=1; i*i<=num; i++)
sum += (num%i)? 0 : ((i*i==num)? i : i+num/i);
return sum;
}
Is there any better method to ... |
I am developing an application which must run on up to thousands of client systems that I control (Linux) which are connected behind common NAT devices to public Internet. Each of these client devices must receive infrequent messages from a cloud service (1 or 2 per day) and on average, must receive these messages in ... |
It is easy to find questions asking if one should start with python 2 or python 3, and it is a consensus that python 2 is the way to go as it is has more libraries and thus better supported.
Python 3 was launched back on 2008 and this question already addressed a migration. As it was too soon, the solution was to wait.... |
For example I've got following code:
auto z = [](int x) -> int {
if (x > 0) {
switch (x) {
case 2: return 5;
case 3: return 6;
default: return 1;
}
}
return 0;
};
And later I call this several times. In asm code I see external calls with lambd... |
While examining alternatives to Exim/Dovecot for a dedicated mail server, I came across the lamson project, a python-based MTA. I also found the following fork of the project:
https://github.com/moggers87/salmon
Quoting from the docs at the fork:
Salmon is a fork of Lamson. In the summer of 2012 (2012-07-13 to be
e... |
Let's say I have a company that ranks the cutest cats on the internet.
I offer a resource at /cats/ which provides users with the latest, cutest adorable cats.
Users can either get just the top 3 cats if they haven't paid at all or registered. The top 10 cats if they paid 337 dollars and are logged in, and the top 100 ... |
Most modern languages make a heavy use of pointers / references: a typical OOP language uses VMT lookups, a typical functional language builds key data structures out of pointers, etc. Even typical C code often sports things like foo->bar->baz.
It is well-known that dereferencing a pointer is cache-unfriendly, unless t... |
I have been trying to get some architecture documentation passed at work. I've spoken to my CIO and he has said to me that if I prove to him that if we stay within MOF then we can implement it. I am not an architect, I am a software developer trying to become an architect.
I downloaded the MOF documentation and did so... |
If a compiler's work is essentially translating source code into machine level code, can there be any glitch in a compiler, i.e. a faulty "translation?"
The same goes for an interpreter: can it fail to output the required content sometimes?
I have not heard of any bugs in compilers/interpreters, but do they exist?
|
I currently have a number of classes (~20) that all do the same thing (abstractly), namely, generate an instance of a particular class from an xml file.
The way that they use the content of the xml file varies quite a bit, and the data gets stored into different substructures (fields, groups, etc) that are shared acros... |
Say your users can create their own web-based forms (textboxes, selects, etc) and publish them on the web for their users to fill out.
Does anyone have a resource or any advice on how to architect the database to tie into the dynamic forms?
For example, would you create a child table for each form, or different ver... |
I am under the impression that an encrypted string cannot be decrypted so the original value is lost forever.
However, if the following string always equals "dominic" (my name), then can't there be some logical way to reverse it; being as it's not random nor is it based on the date/time, but there is a logical method... |
Suppose you have a NodeJS application.
A release could consists of multiple steps:
Automated and/or manual tests
Deployment
(if something goes wrong) Rollback to the last stable version
There are some desirable requirements regarding the application's dependencies:
When you have done your testing, you want to deplo... |
I am a Product Manager, under me I have about 10 developers, UX designers and marketers. Marketers research about the demands of features, UX designers providing UI mockups, and develkopers write code.
Now, we want to do our feature development monthly meeting (sprint) in a more structured manner ( previously, feature ... |
What should we do if a item in scrum takes longer then expected? i am asking this because i have been noticing items that developers is struggling to complete as it is much tougher then initially thought.
In such situation should we
remove the item from sprint back to product catalog so that we can
meet the sprint ti... |
Should I add an external id for every table?
For example if I have these tables :
Customer
=======================================
Id Name Gender
---------------------------------------
1 John M
2 Doe M
---------------------------------------
CustomerPurchase
======================... |
I am building an MVC application in PHP, using Zend Framework.
My model includes Domain Model and Mapper layers. I am trying to keep the domain model in pristine condition and have managed to keep it free from persistence-related code. Now I am trying to find a solution for ACL.
I have 'general' ACL rules that can be... |
When creating a new file format for an application, you can write the code or the documentation first.
When writing the documentation first, you have a better idea of what you should implement.
However, you might need to change a lot of the documentation you have written afterwards when writing the code, because you ma... |
I have a unique problem which I'm hoping someone can assist with.
I have One big text file, our Production file. The data in the file is delimited in the following format
Reference|Cost Centre|Analytics Base Value|....
UMBY_2288|023437|2883484|...
NOT_REAL|1343534|283434|...
The average size of this file is about 30... |
I'm wondering what you call an applications that are not hard coded around any database structure?
Let me give a small example:
I have one application where the views, the controllers and the model are tailored to the information and fields in the model, and thus the database.
I have a second (theoretical) applicatio... |
Bit of a rant, but bear with me.
People call me purist. I do not code in any way other than TDD. When I try to push TDD as a company policy, the following conversation:
company owner: "we'll do TDD when the project warrants it"
me: "if you can't do TDD on even small/simple projects, you won't suddenly know how to do it... |
I have seen on a number of resumes the term "virtualization." While every resume is unique, what does the broader term or skill of "virtualization" mean or imply?
I feel that the ability to install virtual machines is not the only thing that this means. I have installed VMs and in my experience it was mostly followi... |
Question: Is there value in denoting a key as "Primary"?
This question is not about the definition of a primary key. It is not about the fact primary's aren't nullable. It is not about implementations such as MySQL which automatically perform clustered index voodoo behind the scenes on primary keys.
NOTE: The question ... |
To test a method that returns a clone of the object it is called on, i need to re-run the test suite on the newly created object if i am to ensure that full functionality is retained, i found my instinct was to clone the object then call all other test methods in sequence i order to reduce code duplication. However tha... |
I ask this question out of curiosity.
Lets say the class Foo is a singleton and I want to call Foo instead of Foo.Instance to access the static object.
Would it be possible to encapsulate the object itself within a dynamic property?
Would C# allow me to create a dynamic property that refers to anything but a property... |
For this case let's assume something like... "removedNonPriceChangingConfermations" that is in no way relating to things that happened in the past tense, nor does it return a list of removed items (which you would never need in this context).
If you can't spot the other thing wrong with it, I challenge you to a high-st... |
I know the concept of register variable and it's use cases but there are few questions in my mind based on what I have tried.
I cannot access the address of a register variable in C though I can do it C++! Why? Is there any issue in accessing the addressing of a register variable?
Suppose if I declare a string variab... |
I have an embedded Linux C application that runs with a simple CLI. I am now tasked with creating a GUI that accomplishes the same functionality as the command line program. I am not an accomplished GUI designer and the majority if my experience is in deeply embedded C coding.
My initial thought is to use qtcreator to... |
I have method like this:
methodA(someParams)
{
do some initializations,etc;
call methodB(someParams);
}
methodB(someParams)
{
do work;
if blah then raise exception::FileNotFound
if blahblah then raise exception::ResourceNotFound
}
When I am adding documentation for methodB, I am also documenting the excepti... |
Assume that we are developing a web application, and Hudson does typical jobs such as compile, unit test and static code analysis.
But the tricky part is: Hudson deploys and starts up application server to do integration tests, once the previous jobs done.
That means some difficult things, such as database connection,... |
As a C++ developer from the 90s during the great OOP wars, I put high value to OOP as a basis for hiring new C# developers into the company.
However, there are plenty of frameworks today like ASP.NET MVC that handles most of the OOP heavy lifting. Programmers without deep knowledge of OOP can just as easily follow the ... |
Say I got a minimal use case such as "view home page" or "view banner ad". Should it be included or exluded in the use case actually following the link? What I mean is that whether it belongs to the use case "view page 1" if a report is that "The link from page 1 to page 2 is not working" in the common case of a "link ... |
I have made a program in Javascript and HTML5 canvas and I am wondering what happens when you draw a shape on a certain location of canvas then draw another shape on top of that same object. Does it consume more memory because I am drawing new object on top of each others? (Currently, rendering process of my program is... |
I have always heard that linear search is a naive approach and binary search is better than it in performance due to better asymptotic complexity. But I never understood why is it better than linear search when sorting is required before binary search?
Linear search is O(n) and binary search is O(log n). That seems to ... |
class myClass
{
int age;
public int Age
{
get{return age;}
set{age = value;}
}
Versus
class myClass
{
public int Age{get; set;}
}
What's the difference between these two? Are they both the same?
|
I'm used to delimit statements by a semicolon from Java, so naturally I do it in Scala code too. I also feel that the code is easier to read, because it's evident where one statement ends and another begins. But many times when I post a piece of Scala code on SO, the code gets edited just to get semicolons removed.
Sh... |
I suspect I've made a schoolboy error here, and am looking for clarification. A lot of the classes in my solution (C#) - dare I say the majority - I've ended up writing a corresponding interface for. E.g. an "ICalculator" interface and a "Calculator" class that implements it, even though I'm never likely to replace tha... |
I have my first programming job interview today (in a few hours!) and would like some advice.
The job title is Trainee Programmer and it is for a secure printing company.
I have found a lot on the internet about programming interviews, but since this is a Trainee role I have no idea what to expect.
I know that the com... |
If I have a variable containing a List it could contain objects of a lot of different types e.g. ArrayList or LinkedList. The difference between a LinkedList and an ArrayList is pretty big. The big O behavior of the methods differs greatly. For example sorting the List and then using it to do binary searches is perfect... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.