instruction stringlengths 34 19.9k |
|---|
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... |
It's known 2-way Merge sort takes N*logN time.
I wonder, what would be the running time if we split an array of the size N into N subarrays and then do the same thing as we would do for 2-way Merge?
|
I have a web-application with an async HTTP backend, which gets called by the client by AJAX requests. The client has to start a job and then polls for the result.
I started with a simple 150ms polling interval, which was fine for small jobs, but big jobs, which could take several minutes, threw many failed requests to... |
I want to build a website that will contain a lot of images. I don't want users who visit the website to be able to save the images.
I have blocked the right click option, but is there any other way to keep users from saving the images?
|
Here's the scenario...
I have a web site that has a generic handler written in asp.net (.ashx file) that accepts http requests, gets relevant data, converts the result into xml and then passes that back via the response.
This will eventually be used so that a windows application can make data requests to this web site.... |
My web application will use AJAX calls often and so I have set up some JavaScript to handle "messages" or "responses". These responses are returned (from my ASP.NET application) as JSON objects that act as feedback once a function is complete.
Suppose my responses have three basic elements.
Type (error, warning, info,... |
I've met the criterion of good system desing as its stability relative to requirements change.
Small req. changes should raise small changes in design.
Yet I have gut feeling that almost for any somewhat complex software system it's possible to state the set of small changes in requirements which causes unacceptable am... |
Background
I have this tables
+-------------------------+ +------------------------+
|Airport | |Country |
|-------------------------| |------------------------|
|airport_code string (PK) | |country_code string (PK)|
|address string | |name string |
|name str... |
When a program doesn't compile, error messages are sometimes esoteric. Often a simple Google search leading to a site like stack exchange solves the problem. Now why can't we automate this?
How about a Siri for coding? By Siri, I mean an intelligent personal assistant. Not talking about speech recognition here.
I wond... |
I'm facing a choice of whether to start building Haskell components for a certain production app that is all done in Ruby.
I'm leaning toward Haskell for several reasons, primarily speed (compiled Haskell is like 4-8x faster), greater transparency (via Haskell type system), and safer refactorability (type system). I'v... |
I'm programming a windows phone 7 app which needs authentication for news-like read access.
I use Application.UnhandledException to handle (my) AuthFailedException, which can be thrown from any page, and navigate to a login page.
To mimic a modal dialog, I do the following:
I attach a BackKeyPress event handler to cl... |
I have a (browser based) web application. On each page, I want to have a little label and link in a corner that displays the user's username and other account information along with a logout button. The information that will be displayed is immutable.
Should I store that account information in session attributes when a... |
If you have to pay the price of performance to make code more readable would you prefer that or you would always prefer performance over it?
|
We are about 40 developers working on the same code base and we use Git for version control.
My question is: can there be problems if, for example, some developers have a much older version of Git installed on their system ? Or should we try to enforce some rule that says something like "you should upgrade Git on your ... |
Hypothetical scenario: codebase is exercised by unit tests run by a TeamCity build-bot, that also uses the built-in dotCover tool to provide coverage metrics. The build will fail if less than X% of the code is covered.
Unscrupulous developer running NCrunch (or a pre-tested commit in TC) sees that his next checkin will... |
I was asked about how to run a suite of 65.000.000.000 tests and I wonder if it is normal to have a project with such a huge amount of tests.
Have you worked in projects with this characteristic?
|
Mention the pros and cons of UIBinder in GWT.
I want to develop a big project. Is it flexible to use UIBinder for my project?
|
I am designing an application that interacts with a RESTful API.
When returning error messages like Unable to sign up user
Should the error message be generated by the app? or by the API? I am looking for best practices.
|
I have multiple functions and a lot of code inside $(document).ready(function()). I am using jasmine to test the functions inside the ready function as well as the code inside ready() but when the test cases inside describe are executed it is not able to access the code inside the ready function.
$(document).ready(func... |
Often in a table that has no natural key, it is still useful for users to be able to have a uniquely generated identifier. If the table has a surrogate primary key (and in such a case you would certainly expect it to) should that key be exposed to the user or should another field be used for that purpose?
One reason n... |
Here's a *hypothetical* issue.
There is a performance issue in the current release. Its difficult to find the cause of this issue because the performance tests haven't been run in roughly 10+ releases (with anywhere from 10 - 100 changes per release). My idea is to automate the process of running the performance te... |
I was asked this question in an interview. For eg: UITableviewDelegate protocol has CellForRowAtIndexpath. Why make it a delegate method in a protocol not a method in the UITableView class and call it directly?
|
I'm currently examining the possibilities and implications of linking against a GPL library for an application in a commercial context.
From what I've understood of the GPL, as long as the application is used internally there is no obligation to release its code (even if a copy is moved to a controlled subsidiary).
Wha... |
Someone asked me this. The answer he gave was HTML5 in UIWebView can cache the app data so it can run offline. I thought the same thing can be achieved using safari add to home screen, no?
|
Given a file > 5Gb, simply with lines like Apache's access.log.
I need to get number of lines.
Any constructions like
file(filename).read().counter('\n')
would read all of the file and it would take a very long time.
On the other hand, e.g.
os.stat(filename).st_size
works very fast.
It is possible to get at least an ... |
I am working on creating a new data processing system, where there are multiple steps each fulfilled by different services. For example, there is a scheduling service that kicks of something, an analysis service that does the processing, and a notification service that summarizes and emails out results. Data flows thro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.