instruction stringlengths 34 36.1k |
|---|
In a debate regarding return variables, some members of the team prefer a method to return the result directly to the caller, whereas others prefer to declare a return variable that is then returned to the caller (see code examples below)
The argument for the latter is that it allows a developer that is debugging the c... |
I am learning DBMS in my college. Recently I was given an assignment to draw a E-R Model of a Bus Reservation system which handles Reservations, Ticketing and cancellations.
I understand the theory about E-R model when I study from a book, but it gets confusing when I try to draw one from scratch.
How should one procee... |
C# and Java has code attribute and code annotation. I don't know about other languages, but I know the code annotation feature is used to expand language itself.
I knew what it is, but I want to know how it developed over time. I want to know its history. How it demanded and how it implemented. Is this possible to impl... |
My company has recently began using Apache Solr to search its data. As we learn how to use it we have gone down the path of indexing multiple fields to get the results we need. Most of these are either N-Grammed or Edge-N-Grammed (N-grammed, but only from the edge; for starts-with searching).
Gramming by nature takes u... |
I've got an assessment to give to my students.
It's about C++ and function pointers.
Their skill is middle: it the first year of a programming school after bachelor.
To give you something precise, here's a sample of a solution of one of 3 exercices they had to do in 30 minutes (the question was: "here's a version of a ... |
I run a site which has a couple of million photos and gets over 1000 photos uploaded each day. Up to now, we haven't kept the original file that was uploaded to conserve on space. However, we are getting to a point that we are starting to see a need to have high-res original versions. I was wondering if its better to s... |
I'm reading about actor based concurrency and I appreciate the simplicity of actors sequentially processing messages on a single thread. However there is one scenario that doesn't seen possible.
Suppose that actor A sends a message to actor B, who then performs some long running task and returns a completion message to... |
I am writing unit tests for a fairly simple function that depends on a fairly complicated set of data. Essentially, the object I am manipulating represents a graph and this function determines whether to chart a line, bar, or pie chart based on the data that came back from the server.
This is a simplified version, usin... |
While maintaining the sites our development team has created, we have come across include files and plugins that have proven to be very useful to more then one part of our applications. Most of these modules have come with two different files, a normal source file and a min file. Seeing that the performance and speed... |
I maintain a software, a small PHP library, that is released under the LGPL version 3 license (LGPLv3). Someone wants to use the library in their software which has the GPL version 2 license. This license compatibility matrix suggests this is not possible without changing the licensing terms of one of the software. I h... |
I've seen multiple posts about rewrites of applications being bad, people's experiences about it here on Programmers, and an article I've ready by Joel Spolsky on the subject, but no hard evidence or case studies. Other than the two examples Joel gave and some other posts here, what do you do with a bad codebase and h... |
Currently in a debate at work and I cannot fathom why someone would intentionally avoid Inheritance with Master Pages.
For reference here is the project setup:
BaseProject
MainMasterPage
SomeEvent
SiteProject
SiteMasterPage
nested MainMasterPage
OtherSiteProject
MainMasterPage (from BaseProject)
T... |
The title says it all: Are halting and terminating synonyms in the context of computability theory?
|
I'm on a project team of 4 devs, myself included. We've been having a long discussion on how to handle extra work that comes up in the course of a single work item.
This extra work is usually things that are slightly related to the task, but not always necessary to accomplish the goal of the item (that may be an opinio... |
First of all please be aware this post contains some abusive language but I hope it will not bother anyone. I apologize for the bad language but that's what the name is.
As I've been doing documentation on existing programming languages attempting to make a complete list of them I stumbled across terrible programming l... |
Working with libraries like Seam, Guice and Spring I have become accustomed to dealing with variables within a scope. These libraries give you a handful of scopes and allow you to define your own. This is a very handy pattern for dealing with variable lifecycles and dependency injection.
I have been trying to identif... |
I understand the role of the model and view in the Model-View-Controller pattern, but I have a hard time understanding why a controller is necessary.
Let's assume we're creating a chess program using an MVC approach; the game state should be the model, and the GUI should be the view. What exactly is the controller in t... |
I am a freelancer and work as a single developer. In all cases, I am the person wearing different hats. I am the Scrum Master and I am the only person in the development. What I am not is the Product Owner?
Are there any Agile Methods and free tools that a freelancer can make use of?
|
For educational purposes, I'd like to write an application on a Linux environment that can process keyboard events and draw graphics without huge dependencies like X or SDL. I presume that this must be possible, because X and SDL are just programs themselves, so they must rely on other methods inherent to the environme... |
What are some recommendations for a build tool that would allow me to upload changes to a web server or a repository and minify the js and css automatically, and possibly even run Closure compiler on the JavaScript?
I'm not worried about doing anything with the php code other than update with most recent changes althou... |
C has pointers and Java has what is called references. They have some things in common in the sense that they all point to something. I know that pointers in C store the addresses they point to. Do reference also store the address? How they are different except that pointer is more flexible and error-prone?
|
I have two related questions:
Are there any good books for multithreading in C++, especially now that C++11 contains multithreading in the standard library?
I have the Wrox Programming on Unix book (1000 pages fat red one) and within it, it uses the Unix Thread class.
How does this code relate to boost and the C++1... |
I've seen a lot of stuff that describes how it's done, but not a lot that tells WHY it's done. Is it just a way to keep the code readable, or is there a better reason?
|
I am developing an open source ruby application under the MIT license. I am using this license because I don't want to place any restrictions on the users of the application. Also I can actually read and understand this license.
I recently started using another ruby gem in my project (require "somegem"). This ruby g... |
Being an IT student, I was recently given some overview about design patterns by one of our teachers. I understood what they are for, but some aspects still keep bugging me.
Are they really used by the majority of programmers?
Speaking of experience, I've had some troubles while programming, things I could not solve fo... |
I heard the phrase classic object oriented programming. Is it different from present object oriented programming, like classic ASP and ASP.net?
|
My question may seem silly, but, I've read in many Android books that the better part of Android is Android is open, and iOS is closed.
But, from a programmer viewpoint, who cares about this point? Programmers just care about the platform: is it easy to program in, easy to have help in the network, etc. They don't care... |
Possible Duplicate:
Google is good or bad for programmer?
I'm currently in college to be a software engineer, and one of the main principles taught to us is how to learn for ourselves, and how to search the web when we have a doubt.
This leads to a proactive attitude - when I need something, I go get it.
Recently,... |
To me, the use of the keyword static in C and languages like C# and Java are "false friends" like "to become" in English and "bekommen" in German (= "to get" in English), because they mean different things.
In C static means, that the function or variable is only accessible via functions inside the same source file, co... |
Most Scrum teams lean toward 7-15 people ******, though it's not clear how to scale Scrum among 100s of people, or how the effectiveness of a given team might be compared to another team within the group; meaning beyond just breaking the group into Scrum teams of 7-15 people, it's unclear how efforts between the teams ... |
Which elements must a requirement contain that it can be considered complete? Or if this works better - which questions should I ask about a requirement to find out if it is complete. I am not talking about the implementation of the requirement but the requirement itself.
I am asking this from the perspective of an ana... |
Can I distribute the MS SQL 2005 Express edition along with my application to the customer?
|
A workforce management software has complex GUI (for example values in a page depends on the status (closed or open) of other pages). Only latest and near past development has test coverage. During our last release, we received lots of bugs from customer in-spite of 2 weeks of testing Sprint. We don't have dedicated te... |
A bug was opened, fixed, verified and closed. A month later, it showed up again in a subsequent version after several iterations without any regression.
Provided the bug characteristics are the same, would you reopen the existing bug ID or open a new one with a link to the closed bug?
|
Why does IIS default to recycle the app pool after a given time? Is there some specific reason other than perhaps most web apps are not managing the memory prudently? Given that you are managing your application's memory properly, is is safe to go ahead and turn this off? What are some potential down sides, up benefits... |
A colleague is pushing clearing the client browser's history (i.e. back-button) when they logout of our web application. Is this considered a good practice? It strikes me as a really intrusive. If only conditionally, what conditions need to be in place for this practice to be useful?
|
I have been tasked with redesigning, or at worst optimising the structure of a database for a data warehouse.
Currently, the database has 4 other source databases (which is due to expand to X number of others), all of which have their own data structures, naming conventions etc. At the moment an overnight SSIS packa... |
In a HATEOAS API links are returned which represent possible state transitions. A conforming client should just be retrieving and following those links, but if a non-conforming client is constructing URIs rather than following the supplied links what would be the most appropriate status code/response to return?
400 wo... |
Problem
I’m working on a Python project whose main class is a bit “God Object”. There are so friggin’ many attributes and methods!
I want to refactor the class.
So Far…
For the first step, I want to do something relatively simple; but when I tried the most straightforward approach, it broke some tests and existing exa... |
Possible Duplicate:
How do you dive into large code bases?
When you join a pre-existing project that has a large code base, what are some of the things you do to get acclimatized quickly towards being able to code soundly in it? How much time do you spend reading, making diagrams etc as opposed to diving right in an... |
My organization is considering moving from SVN to Git. One argument against moving is as follows:
How do we do versioning?
We have an SDK distribution based on the NetBeans Platform. As the SVN revisions are simple numbers we can use them to extend the version numbers of our plugins and SDK builds. How do we handle thi... |
Question: what are the practical considerations for the syntax in class and id values?
Note that I'm not asking about the semantics, i.e. the actual words that are being used, as for example described in this blogpost. There are a lot of resources on that side of naming conventions already, in fact obscuring my search ... |
I am developing a web site and a web service for a small on-line game. Technically, I'll be using Express (node.js) and MongoDB+Redis for the databases. This the structure I came up with:
One Express server that will server as the Web Service. This will connect to the databases.
One Express server that will provide ... |
I try to generate as little HTML from JavaScript as possible. Instead, I prefer to manipulate existing markup whenever I can and only generate HTML when I need to dynamically insert an element that isn't a good candidate for using Ajax. This, I believe, makes it far easier to maintain the code and quickly make changes ... |
I'm confused when looking into graphics - specifically with operating systems.
I mean, how can a computer render a CLI/console along with a GUI?
GUI's are completely different from text. And how can we have GUI windows that display text interfaces, ie how can we have CLI in modern Graphics Operating system - that's wha... |
I am building an iOS application, and I am planning to incorporate an AGPL 3.0-licensed library to it to provide some extra (non-essential) functionality. I’ve got a couple of questions regarding this:
Do I understand it right that this still obliges me to publish the source of my app open? If yes, does it have to be ... |
I get confused between these terms. For example, should unit testing be listed as a software testing process or technique? I think unit testing is a software testing technique. And how about Test driven development? Can you give me some examples for software testing processes and techniques?
In my opinion, software tes... |
In .net, the value types are stored on stack where as reference types are stored on managed heap. What is the reason for this one? Is it not possible to exchange their storage locations?
|
Today I got into a heated debate with another developer at my organization about where and how to add methods to database mapped classes. We use sqlalchemy, and a major part of the existing code base in our database models is little more than a bag of mapped properties with a class name, a nearly mechanical translatio... |
This has been a big question lurking at the back of my head. From what I see, GnuSTEP nowadays is primarily a "hobby" project of a small but tightly-knit group of people. However I haven't seen a large commercial (off-the-shelf) application that uses it, apart from the small applications that comes with the GnuSTEP dis... |
In the past few years, the languages I like to use are becoming more and more "functional". I now use languages that are a sort of "hybrid": C#, F#, Scala. I like to design my application using classes that correspond to the domain objects, and use functional features where this makes coding easier, more coincise and s... |
Is there a Java DI container that works in a similar way to the most excellent Castle.Windsor container on the .NET side?
The Java containers I've had a look at all seem to rely on annotations (Guice) within my services, which I don't dig all that much - I'd like to go POJO all the way if possible. Spring on the other... |
Sometimes I find myself in situations when the part of code that I am writing is (or seems to be) so self-evident that its name would be basically repeated as a comment:
class Example
{
/// <summary>
/// The location of the update.
/// </summary>
public Uri UpdateLocation { get; set; };
}
(C# example, ... |
At the moment I create a database connection when my web page is first loaded. I then process the page and run any queries against that conection. Is this the best way to do it or should I be creating a database connection each time I run a query?
p.s It makes more sense to me to create 1 connection and use it but I do... |
I am having a discussion with a colleague about using macro as a thin (extremely) layer of abstraction vs using a function wrapper. The example that I used is
Macro way.
#define StartOSTimer(period) (microTimerStart(period))
Function wrapper method
void StartOSTimer(period)
{
microTimerStart(period);
}
Personall... |
Which is a better option?
It's not always that when you have something creative your code is going to look ugly.
But at times it does go a bit ugly.
e.g.
if ( (object1(0)==object2(0) &&
(object1(1)==object2(1) &&
(object1(2)==object2(2) &&
(object1(3)==object2(3) )
retval = true;
else
retval = fa... |
In line with this post here I am going to change my website to create a connection per query to take advantage of .NET's connection pooling. With this in mind, I don't know how I should deal with transactions. At the moment I do something like (psuedo code):
GlobalTransaction = GlobalDBConnection.BeginTransaction();
tr... |
It seems to be fashionable recently to omit semicolons from Javascript. There was a blog post a few years ago emphasising that in Javascript, semicolons are optional and the gist of the post seemed to be that you shouldn't bother with them because they're unnecessary. The post, widely cited, doesn't give any compelling... |
Most of configuration files in ruby such as Gemfile, gemspec, are just ruby code itself. Why database configuration file in rails is the exception?
|
When I think about software analysis the first thing which comes to mind is SSADM and the UML.
But, what I want is a high level view of the system before I commit to a programming paradigm.
Where am I going wrong?
How do I approach a problem in a high level and generic way before I commit to a paradigm?
What are the d... |
In responsive design, elements are hidden in the page with @media queries and display: none in CSS.
Ok.
In my design however browsers that have less than 800px in width should avoid loading some content at all.
When accessed with on a device with more than 800px of screen, the page loads fully. In mobile devices or ev... |
I have a windows forms project using the Model View Presenter pattern and would like to build a web forms project on top of the same MVP structure.
The windows forms project knows nothing of ASP.Net Membership and just communicates via the presenter to the model and then to the business layer to do user log on/validati... |
Are there any techniques other than velocity? What are pros and cons of using those from your experience?
|
I have a question concerning the life cycle management of a/multiple project(s), more specific to the advantages/disadvantages of using technologies such as Maven.
Currently we work in a continuous-integration environment but lots of things still need to be manually performed (dependency management, deploying, setting ... |
My team just started using crucible/fisheye for initiating code reviews whenever one of us checks something in. There are only 3 of us, and we're each encouraged to review the code and leave comments where we see fit.
My question is, how do I best leave a comment on a line of code I see a problem with? I want to get my... |
This syntax will be used inside HTML attributes. Here are a few examples of what I have so far:
<input name="a" conditions="!b, c" />
<input name="b" />
<input name="c" />
This will make input "a" do something if b is not checked and c is checked (b and c are assumed to be checkboxes if they don't have a :value defin... |
I have looked through some questions, technologies for building a good service layer but I have some questions regarding this that I need help with.
First some information of what I have for requirements. We currently have a number of web applications that talk to each other in a spiderweb looking way (all talking to e... |
I want to set up an SVN repository on my computer without any network access. I am working on a code without any collaborator, so I don't want it to be publicly available.
I read this post, but it suggests using online SVN repository services that give free repositories. In that case, my code will be publicly available... |
What is the preferred way to do the following with git, maven and jenkins:
I am developping an application, which I would like to maintain "dev" and "release" branches. I would like jenkins to build both. It could be so that the release-artifacts would have versions like 1.5.2 and the dev-builds would just be 0.0.1-SNA... |
Consider the following code:
public void doSomething(int input)
{
while(true)
{
TransformInSomeWay(input);
if(ProcessingComplete(input))
break;
DoSomethingElseTo(input);
}
}
Assume that this process involves a finite but input-dependent number of steps; the loop is designed to ter... |
What is the "Find-Fix-Verify" pattern, as related to the process of doing editing/spellchecking/debugging, etc.?
Where is this pattern best described?
What are some advantages and disadvantages of this pattern?
|
I have read a lot of computer architecture textbooks, and I wonder why most of them (if not all) used MIPS as the architecture to teach. Why MIPS and not Intel or AMD or something else? What makes the architecture suitable for teaching?
|
This question has been going through my mind quite a lot lately and since I haven't found a convincing answer to it I would like to know if other users
of this site have thought about it as well.
In the recent years, even though OOP is still the most popular programming paradigm, functional programming is getting a lot... |
I just read about Caja, which is a "sanitized" version of JavaScript. But I'm wondering - what is the big problem with JavaScript(it seems so widely used )? Just how dangerous is it?
|
I was wondering how does tineye carry a search. Does it store all the images and then extracts exif data? Which in turn must be stored in a database and queried against. So probably it is using some sort of keyword/pattern matching algorithm...
|
I have wrote a small method in a program to do one thing my method looks like this:
public static void removeExpiredAssignments(Module module){
module.removeExpiredAssignments();
}
So the method is called like:
removeExpiredAssignments(module);
When the desired operation could be done by saying:
module.remove... |
The bridge design pattern separates implementation from the interface of a program.
Why is this advantageous?
|
Myeclipse's java code templates like sysout make coding easier, and they can also be customized. But seems it's jsp editor has no such capability.
Is it possible to create and customize some templates like sysout in myeclipse jsp editor, and if yes, how?
|
I am highly interested in learning how to program but I am unsure whether I want to lean towards web developing or software programming. Or does computer programming cover both in a nut shell? Where should or how should I start?
|
Let's say that I have a Web Application where I'm going to have 300 users and each one have to see data on real-time, imagine that each client make an ajax call to the server to see in real time what's happens with the changes of the data, this calls are made each 300 ms per user. I know that I can run a simulation to ... |
Can you explain these two lines of code in
applications/config/routes.php file in the CodeIgniter framework?
$route['default_controller'] = 'pages/view';
$route['(:any)'] = 'pages/view/$1';
|
I hear about WPF, Silverlight but then there is also windows RT, metro stuff, windows 8 and so on at the moment - I'm having a hard time nailing what to bet on.
How do I, at a given point in time, find the best platform for doing somewhat future-proof GUI?
|
I am working on a project where a website needs to exchange complex and confidential (and thus encrypted) data with other systems. The data includes personal information, technical drawings, public documents etc.
We would prefer to avoid the Request-Reply pattern to the dependent systems (and there are a LOT of them), ... |
I need to refer to a number of things that have both an identifier value (used in code and configuration), and a human-readable label. These things include:
database columns
dropdown items
subapplications
objects stored in a dictionary
I want two unambiguous terms. One to refer to the identifier/value/key. One to ref... |
I am having a difficulty in deciding the database & its structure.
Let us say the problem is like this.
For my product I have various customers( each is an educational institute)
Each customer have their own sub-clients ( Institution have students)
Each student record will have some basic information like "name" & "Num... |
I just got an copyright infringement notice that says my app infringes on the usage policies of the services my app uses.
However, this mail does not come directly from the company that runs the website I pull information from.
The mail comes from a company that has some paid apps in the same category on the app store... |
Who decides the API deprecations the JEE specification or the vendor of JDK like Sun, IBM?
|
What is the best approach for Single Sign On Application Development that is lightweight?
By lightweight I mean not too much javascript. I know stackexchange does use single sign-on. Basically is the login credential stored as cookie? Or combination of IP-Address and other specific information about the logged in user?... |
Which one of these is of more importance? Skilled team or good process practice?
When I say skilled, I mean logical, creative members with good coding and testing skills. Good process would be the development methodology, like agile, scrum, etc
|
How do software applications keep track of whether the user already installed the application before in it's Windows system?
Say you install app X, trial version, remove it, then re install it, and when you run it again it detects you had already installed it before. If you uninstall and clean all registry information ... |
Based on a comment and subsequent upvotes from Bug reopen vs. new:
Citing bug IDs in patch notes is just.. very unfriendly. – Krelp
It appears at least some people feel that referencing bug IDs in patch notes is not a good idea. I'm a fairly inexperienced developer, so I'm wondering why that's the case.
|
I have been having a little bit of a debate with a coworker lately. We are specifically using C#, but this could apply to any language with nullable types. Say for example you have a value that represents a maximum. However, this maximum value is optional. I argue that a nullable number would be preferable. My cow... |
I know that the default advice for open source projects, and getting started, is to start fixing bugs. But I have a feeling that its the path that one would want to take if they wanted to be a tester/fixer of bugs in the project. How does one become an active contributor of an opensource project? [I.e. on the level of ... |
How are authors able to write a book on a framework that is just released? A framework like spring is updated, and a book is released in the next day. Is this typically by people who are direct contributors? Are they basing it off of beta/alpha versions?
I find this rather difficult to understand as that documentation... |
I know there is a big push for code reviews in commercial development. However, are code reviews used in open source software or is based on trust? If so, then how are they performed? [Is it a delayed commit, "a pre commit environment", is there a tool that allows for the patch to be sent to another dev]?
Are there an... |
I have a small JavaScript library that I've written that depends on prototype.js.
I'm considering creating a new version that would use jQuery instead.
The goal is to make it easier for users to install (choose which framework you use!) while not making it harder for me to maintain.
The main issue I see is that I would... |
For a simple phone screen question we generally always ask about scoping rules. It's clearly one of the biggest gotchas of JavaScript. Out of everyone we ask almost everyone insists that in an if or for loop a variable is scoped to that block as opposed to the function.
Is this an unreasonable question?
|
Python uses duck-typing, rather than static type checking. But many of the same concerns ultimately apply: does an object have the desired methods and attributes? Do those attributes have valid, in-range values?
Whether you're writing constraints in code, or writing test cases, or validating user input, or just deb... |
I'm working on Language level interfaces to web API's. These libraries are of course built around existing HTTP Request/Reply interfaces. I see myself as having a few options
submit method on the request object e.g
my $req = Request->new( ... );
my $response = $req->submit; # returns response
my $res2 = $req->sub... |
Alan Kay claims that "I made up the term "object-oriented", and I can tell you I did not have C++ in mind." What he had in mind, of course, was Smalltalk. But he did not make up object-oriented programming itself; he got the basic ideas from Simula. So if the term hadn't been invented yet, what did they originally c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.