instruction stringlengths 34 36.1k |
|---|
I've seen some people who make properties for every single member, private or not... does this make any sense?
private string mWhatever;
private string Whatever
{
get
{
return this.mWhatever;
}
set
{
this.mWhatever = value;
}
}
I could see it making sense in 1% of the cases a... |
My resume is no longer relevant. It can no longer contain an adequate description of my technical abilities. One can get a much better sense of what I am capable of by looking at my GitHub repositories, my Stack Exchange profiles, and the various courses that I am taking at Udacity and Coursera. The problem is that I h... |
Possible Duplicate:
How do I create my own programming language and a compiler for it
I want to create a new general purpose language that will compile to JavaScript and I'd like to be able to write it in that same JavaScript.
I wouldn't go much into detail about why, but how can I do it? Currently I have professiona... |
Every now and then I get or write some minimal code samples to achieve tasks. What's the usual practice for storing these samples (which could prove useful later on) ? Have a separate source folder or create a separate project ?
|
I come across this problem usually (especially when dealing with certain frameworks) where I would like once piece of code to execute once and only once however the provided method e.g (something like an onComplete function) that I wish to place this instruction in will in reality execute multiple times.
I am just wond... |
Consider an application where adds an email address to his profile and submits it.
We have some dispute in our team over how to validate this email address. Some developers (including me) believe that we should validate this simple string via an extension method:
bool isValid = newEmail.IsEmail();
They argue that any ... |
I would like to know if people have already asked back some technical questions to your interviewer. Saying something like "Well, you asked me a bunch of technical questions, and now, do you mind if I ask you some? If I am going to join your company, we will work closely together and I want to make sure my I respect th... |
I had this question asked on stackoverflow, but it was closed "as not a real question".
So i decided to remove all rumbling and post that question here, assuming that this stackexchange is for "conceptual questions about software development"
The main question is in the title: Why rpm and deb package formats are not un... |
I've finished a first working, releasable version of a testing framework. Prior to release, I want to apply a proper license to it. Normally I'd choose something like GPLv3 but here I am pretty unsure. If I put the testing framework under GPLv3, does that mean users won't be able to test their commercial applications w... |
I read the following in Algorithms 4th Edition by Robert Sedgewick and Kevin Wayne:
Our first qualitative observation about most programs is that there is a problem size that characterizes the difficulty of the computational task. Normaly, the problem size is either the size of the input or the value of a command-line... |
I used to heavily rely on session variables in the past, but have recently found many of them to be unnecessary, using things like query string parameters instead.
A colleague of mine refuses to use session variables. Is this a realistic goal and should session variables be avoided for any practical reasons? Can sessio... |
I learned to do Test Driven Development (TDD), Dependency Injection (DI) and Inversion of Control (IoC) all at the same time. When I write code using TDD I always end up using DI in my class's constructors. I am wondering if this is because of how I learned to do TDD, or if this is a natural side-effect of TDD.
So my q... |
I have a set of fractional coordinates.
I also have a rotation matrix that operates on cartesian coordinates.
Does anyone know how I could convert my rotation matrix so I can operate on the fractional coordinates?
The fractional coordinates are functions of the basis vectors a,b,c and the corresponding alpha, beta, gam... |
I'm starting a brand new project. The main access from the client side app will be via an API written in ASP.Net MVC3.
I'm looking for discussions on how best to handle logging information for security access as well has how to handle Phishing and Brute Force.
On the Information side of things, I'd also like some idea... |
I am a Automation Engineer. I use QTP for Automation.
I wanted to know couple of things.
In a scrum Project which has 2 weeks of work, how can complete automation be done in that time frame (talking only about the GUI Level)?
Similarly, how can API Level of automated testing be accomplished, especially inside a single... |
I have some innocent/beginner questions:
What is reverse engineering good for?
As a programmer, should I learn the art of reverse engineering?
What are the benefits to a programmer who is experienced with it?
|
Apart from the obvious reasons, like financial, employment and recognition, what are the practical/real benefits to using programming competition sites?
It seems quite algorithmic and maths heavy, but how does that map to something practical, in your everyday programming?
|
Don't know how to put it, But I'll try to be as clear as possible
I have a project in which I am creating lots of classes and those classes have some common properties and methods but those methods could have different code in them,
So I decided to make an interface so that I could inherit that in all classes and all c... |
I've been working on a software project mostly solo for over 5 years. It was a mess to begin with (I am the third or fourth developer to be working on it), and although it's less of a mess now it is still incredibly disorganized. The rate of progress in getting it under control is glacial and I'm starting to feel despo... |
Microsoft released today the final builds of Visual Studio 2012 on MSDN. I'm trying to decide from this version comparison page which edition to install (I can install any edition I want for free). I'm a solo developer who develops mostly web apps and console apps in C# and Python. Some of the features in Ultimate/Prem... |
A simple way to keep the settings of a Java application is represented by a text file with ".properties" extension containing the identifier of each setting associated with a specific value (this value may be a number, string, date, etc..). C# uses a similar approach, but the text file must be named "App.config". In bo... |
I was experimenting with new overloaded operators, I have created one void operator and another one that returns something when it's called:
#include <iostream>
struct chichachicha{
int operator()(){
return 25;
};
};
struct boomboom{
void operator()() {
std::cout << "Hi folks!" << std::end... |
As the title says, I find it useful to be able to overload operators. Is it possible to also change the way the operators are parsed by specifying the precedence and associativity of overridden operators?
|
In the early days of FORTRAN and BASIC, essentially all programs were written with GOTO statements. The result was spaghetti code and the solution was structured programming.
Similarly, pointers can have difficult to control characteristics in our programs. C++ started with plenty of pointers, but use of references a... |
I know in some areas (game industry, for example), STL is not recommended.
So my question is: is it really a good practice not to use STL in some cases? If so, what's the biggest reasons of not using the modern C++'s STL?
|
Team Foundation Server offers a version control system, but with many more side features, such as bug tracking, user stories, project planning, and it is all integrated into visual studio.
Someone put a more complete list of features over here:
Over the past year I have been working with Mercurial and from the moment ... |
I recently came across a weird piece of code
if(foo == bar){
function foo_bar(){
// Function definition
}
}
Is this a good practice of coding ?
|
I am always given the advice that developers need to stay up to date with the latest in technology - things like webrtc, updates on html5 and css3 and new js libraries, software methodologies like TDD, DDD, and BDD.
The question is why? Why do we need to constantly update ourselves? Can't we just stick with what we kno... |
I applied principles of the GRASP and ended up having a class called Environment.
This class's responsibilities are to:
Keep information about services in the environment,i.e. environment definition (Service is another class)
Start/stop services meeting some criteria
Apply configuration changes to different service an... |
How is programming a quantum algorithm different? What would a C like language look like if it was designed for qubits? Would types change?
|
Can I build a multi-threaded system that handles events from a game and sorts them, independently, into different threads based on priority, and is it a good idea?
Here's more info:
I am about to begin work on porting a mid-sized game from Flash/AS3 to Java so that I can continue development with multi-threading capabi... |
Due to not wanting to pay licenses my company is still using SQL Server 2000 for new projects.
This is very limiting for multiple reasons.
I'm wondering what are the limitations of using SQL Server Express 2008?
Is there any reason NOT to use it to power ASP.Net MVC3 websites?
|
We are continually revamping our front end developer test that we do in-house after a candidate has passed an online test. The online test has questions such as:
How does a for loop start?
What is the correct way to write a JavaScript array?
Write the css selector for the 3rd list item within an ordered list
with the ... |
Let's say you are given the following...
List<Thing> theThings = fubar.Things.All();
If there were nothing to return, what would you expect fubar.Things.All() to return?
Edit:
Thanks for the opinions. I'll wait a bit and accept the entry with the most ups.
I agree with the responses so far, particularly those suggesti... |
The codebase I'm working in now has the convention of using private fields and public properties. For example, most classes have their members defined like this:
// Fields
private double _foo;
private double _bar;
private double _baz;
// Properties
public double Foo
{
get{ return _foo; }
set{ _foo = value; }
}... |
Please do not dismiss the idea right away. I know that it is hard to compete with a mainstream approach that already works (mostly), so my question is partly "academic".
I also am aware that ClojureScript exists and is very cool, but it is a patch on an existing ugly thing, a useful abstraction.
Disclaimer: I am a prog... |
I'm using a lot of printf for tracing/logging purposes in my code, I've found that it's a source of programming error. I always found the insertion operator (<<) to be somewhat of a odd thing but I'm beginning to think that by using it instead I could avoid some of these bugs.
Anyone ever had a similar revelation or I'... |
On this wikipedia page I have found the following sentence regarding closures in C++11:
C++11 closures can capture non-local variables by copy or by reference, but without extending their lifetime.
Does this mean that an existing closure might refer to a non-local variable that has already been de-allocated? In such ... |
I work on a Windows/Mac cross platform application that is sometimes downloaded from web sites. It is sometimes re-branded by and sold by third parties.
I'm the 'windows guy', my Mac counterpart is on vacation.
I'm getting some questions from a customers about what the Mac user experience will be if we sign the Mac... |
Of course, it is very good use to use a logging framework for the error messages or warnings. But sometimes I use System.out.println() if I want to try something new in a short time.
Is it really so bad using System.out.println() for some quick test?
|
I am currently reading the Analysis of Algorithms section in Algorithms, 4th Edition and I'm trying to understand how the author calculated (N^2)/2 and (N^3)/6 frequencies of execution in the code snippet below (here is the full code):
public class ThreeSum
{
public static int count(int[] a) {
int N = a... |
This is a purely hypothetical question.
Say I create a class method that contains no references to instance variables or other resources. For example (C#):
protected string FormatColumn(string value, int width)
{
return value.Trim().PadLeft(width);
}
As far as I can see, there is absolutely no reason why this met... |
I submitted an application I wrote to some other architects for code review. One of them almost immediately wrote me back and said "Don't use static. You can't write automated tests with static classes and methods. static is to be avoided."
I checked and fully 1/4 of my classes are marked static. I use static when I am... |
Let's consider something like a GUI application where main thread is updating the UI almost instantaneously, and some other thread is polling data over the network or something that is guaranteed to take 5-10 seconds to finish the job.
I've received many different answers for this, but some people say that if it is a r... |
How does caching effect the performance of a running program? From my understanding, the assumption that each instruction always takes the same amount of time is not always correct, because of the effects of caching. How does caching affect algorithmic performance? Thanks in advance.
EDIT 1:
To further elaborate, lets ... |
I am using GDataXML library developed by Google as part of their Objective-C client library. As its Google’s XML processing library and I heard that Apple don't allow to use any third party libraries in app, will they allow this one?.
(I am using this library because many iOS geeks suggest to use this one!!).
Thanks in... |
I have a database table holding 40 million records (table A).
Each record has a string a user can search for.
I also have a table with a list of character replacements (table B) i.e. i = Y, I = 1 etc.
I need to be able to take the string a user is searching for, iterate through each letter and create an array of every ... |
I am taking a networking class(data communication) this coming semester. In many courses in my computer engineering degree, the books lack mathematical content. I am not a math wizard, but I think mathematics has the potential to give a much deeper understanding of different concepts, but it requires more work.
Is it ... |
I developed one application for iPhone and now I want it on App Store. So many my iOS geek friends told me to test it on actual device i.e. on iPhone.
So I wonder that why it is necessary to to test my iPhone app on actual iPhone device though they (Apple) have given "simulator" which is near about same as my device?
|
I often see projects (in Java projects and teams using Eclipse) that prefix function parameters with p.
For example
public void filter (Result pResult) ...
I personally don't see any benefit in this, but would like to know what the reasoning is. The best explanation I've heard yet is that it is to distinguish the nam... |
I am building a site and idealy I would like to record the users interaction via their webcam. How do I intergrate webcam recording into my site. I have seen It done with flash. But Im trying to avoid using this. My site is being built using c#, javascript and designed for IE 7 and older.
I want to record the videos f... |
In a git environment, where we have modularized most projects, we're facing the one project per repository or multiple projects per repository design issue. Let's consider a modularized project:
myProject/
+-- gui
+-- core
+-- api
+-- implA
+-- implB
Today we're having one project per repository. It gi... |
I'm using a registration function that hashes the email in PBKDF2 with a random and unique Salt each time. The hashes email and his salt are saved in the DB. No problem with that.
The problem is that now I want to make sure that users only create one single account per email. Obviously to verify that I need to check my... |
Possible Duplicate:
When are Getters and Setters Justified
Why are public and private accessors considered good practice?
In my time as developer I learned that properties can be very useful. I use properties to control read and write access or to add something like validation checks.
But assuming that I have an aut... |
I'm trying to create a JSON schema for the results of doing statistical analysis based on disparate pieces of data.
The current schema I have looks something like this:
{
// Basic key information.
video : "http://www.youtube.com/watch?v=7uwfjpfK0jo",
start : "00:00:00",
end : null,
// For results o... |
I'm requesting best practice with this question. This is only an issue if the customer company is strictly national has a native language other than English, I think.
If the customer has a lot of mainly very domain specific (say, German) expressions, mixed with some lesser domain specific namings. The language of our c... |
I have a line of text I would like to display only when a webpage is being printed. Is it possible to only display this line when printing the page or doing a print preview using PHP in some way?
Basically, I want to print a page without the print headers, but would like to include the page's URL within the page's con... |
I installed Apache2 and PHP5 last night on my fresh Linux Mint machine.
I created a folder and created a simple index.php file with a call to phpinfo() to test out the installation and every works correctly.
However when I open the file with Sublime Text 2 or any other editor, I cannot save my changes. I can use the su... |
I'm using this as part of a game, but it's not really a game development question, so I'm putting it on this more general Stack Exchange.
The goal is to generate "random" outputs for a fixed integer input, but (and this is the clincher) to generate the same random output every time the same random input is put in.
The ... |
I have the following:
html {
overflow-y: scroll;
}
body {
font-family: Georgia, "Times New Roman", serif;
font-size: 1.125em;
line-height: 1.5em;
margin: 0 auto;
max-width: 41em;
}
Which attributes should be with the HTML section, and which within the BODY section?
|
I have insert 14.485 lines on MySQL like this:
INSERT INTO `bairros` (`id`,`cidade_id`,`descricao`) VALUES (1,8891,'VILA PELICIARI');
INSERT INTO `bairros` (`id`,`cidade_id`,`descricao`) VALUES (2,8891,'VILA MARIANA');
...
It took around 5 minutes.
I had to insert in another table 16.021 lines, same database, so for t... |
We currently abuse our version control system and use it... pretty much as an FTP to store big release binaries (4+ GB).
We are seeking to move away from this horrendous practice which has and continues to devolve and take more and more of IT's resources while crippling the integration and release processes.
A solutio... |
I know Javascript for some time, although I am not a heavy user, I know it the first from the time when Netscape was my browser. I pretty much understand the main things, but since JavaScript approach to OOP is prototypical I have some problem grasping it.
One problem to add to this it seems that things can be done in ... |
I'm thinking of freelancing and building web sites in my free time.
I have experience in C#/ASP.NET, JavaScript/jQuery as well as HTML/CSS and SQL. Thus, I feel like I have sufficient web technologies knowledge to go down this path.
What I'm unsure of is if there are any tools which can be used to simplify the life of... |
In my last three jobs, I was a code maintainer. In all three cases, I was hired after the majority of the code for the project was already written.
I'm a self taught programmer. Before I ever started my first professional job, I had maybe a dozen projects under my belt that I started and shipped successfully.
Writing n... |
Possible Duplicate:
How should I test randomness?
One of the features to be developed in our application was allowing user to click a button which will choose an element at random out of (normally 5-10) values registered in the database. The randomness doesn't need to be secure or scientifically uniform, but we do n... |
I started programming with Python, and I was really confused by concepts like coroutines and closures.
Now I think I know them on some superficial level, but I've never felt that "enlightement" moment, so I choose to learn Clojure. I bought the book by Stuart Halloway and it's good, but when I looked at the index there... |
Who is responsible for bumping version number in commercial software development?
How to setup policies for that?
1) for small team
2) for medium team
It is important not to forget to change the version number that self-describes that output file.
Such as AssemblyInfo.cs / resource.rc / AndroidManifest.xml
|
What is Amortized Analysis? And how can it help me achieve worst-case performance guarantees in my programs?
I was reading that the following techniques can help the programmer achieve Worst-case performance guarantees (i.e. in my own words: guarantee that the running time of a program would not exceed the running time... |
Floating licensing is a software licensing approach in which a limited number of licenses for a software application are shared among a larger number of users over time. Nice for the corporates to reduce the costs. It has also the developer aspect.
I saw lots of pricing examples for many software. As far I understood, ... |
So when you call malloc or new [] from your C/C++ application, how does the CRT translate it into Windows API calls?
|
As a freelance developer, I sometimes have to access the administration panels of hosting providers of my customers. It is an astonishingly frightening experience. Below are some points I noticed when accessing recently a not-so-unpopular hosting provider based in UK which has the word "secure" mentioned in large on th... |
After reading about OpenMP and not finding functions to support semaphores, I did an internet search for OpenMP and the readers and writers problem, but found no suitable matches.
Is there a general method for replacing counting semaphores in OpenMP with something that it supports? Or is there just a gap in the enviro... |
How does the memory usage of an integer object written in Java compare\contrast with the memory usage of a integer object written in C++? Is the difference negligible? No difference? A big difference? I'm guessing it's the same because an int is an int regardless of the language (?)
The reason why I asked this is becau... |
I am trying to learn lua and am experimenting on my linux machine. I am not a programmer, so I am looking for your help to give me some suggestions.
What I want to accomplish is making my compile-rewrite-recompile cycle as efficient as possible.
Here is what I do.
I am using vim in one window to program. I have a shell... |
Continuing from my previous question: Javascript simple code to understand prototype-based OOP basics
Let's say we run into console this two separate objects(even if they are called child and parent there is no inheritance between them):
var parent = {
name: "parent",
print: function(){
console.log("Hell... |
I've created an application framework using the unit of work and repository patterns for it's data layer. Data consumer layers such as presentation depend on the data layer design. For example a CRUD abstract form has a dependency to a repository (IRepository).
This architecture works like a charm in client/server envi... |
While learning Haskell I have faced a lot of tutorials trying to explain what are monads and why monads are important in Haskell. Each of them used analogies so it would be easier to catch the meaning.
At the end of the day, I have end up with 3 differents view of what a monad is:
View 1: Monad as a label
Sometimes I t... |
I can find all sorts of weird information about templates in Perl, but nothing about what they actually are.
Are they generic types like in C++? Is it a class-like structure? Or maybe something else?
|
I find that oldstyle (or text) figures are much easier to read in any context outside of simple assignment. Are there any low-ambiguity fonts, monospaced or proportional, that have text figures and other programming-friendly features, such as marked zeroes; aligned braces, operations, and other symbols; and bold and it... |
I've been trying to read through the RoR API to try to learn things that the tutorial missed, and I haven't been able to follow it at all. The only time I've read documentation was when I needed to look up a Python module, and that was easy to understand, but I can't understand the docs for Rails. How do I read through... |
Azure ACS offers OAuth and OpenID providers, and now that ASP.NET 4.5 offers the same thing, without the added cost, is there any reason for a .NET developer to consider ACS?
(Disclaimer, I don't know what version of oauth each service provides)
|
Programming languages and programs (as wells as individual functions, objects, etc.) are often described as being "safe" in one way or another. For example, they could be "type safe", "memory safe", "exception safe", "thread safe" - even "reentrant". Each of these concepts is about preventing erroneous or damaging code... |
I am going to be a third year computer science student and I have read Head first Java, Head First C, and I am currently reading C++ which is the language that I like the most since it has a good teaching style for people with experience. I am planning to either learn to make software with QT, learn objective-C(for iph... |
A study shows that lines_written/time is language-independent and application-independent for most programmers. If this were true it would imply that the most terse a language is, the more productive a programmer can be on it.
Where can this study be found?
|
I was wondering if there was a valid use case for being able to properly define the specific internal properties and functions of a class in a way similar to how an interface defines the public properties and functions of a class.
Imagine the task that you have to build a class that describes a human being.
Obviously, ... |
I've been thinking about that for quite a while actually. I am not a native English speaker myself but still, I have years of programming experience and I always asked myself this. Why is it named as Exception but not Error since they are errors?
It could be PageNotFoundError instead of PageNotFoundException!
|
I am a mercurial person. I even use it as an incremental backup tool. I used to use SVN and CVS.
In a recent project, I had to to use clearcase and encountered lots of issues with it. For example, I could not figure out how to recursively include a whole tree of code without writing a script or using awk or find. Is th... |
My problem is the following; I need to get to know a totally new system, for example Wordpress, Drupal, or a framework like Symfony, or maybe a big forum system like PhpBB.
Let's suppose it has no documentation at all, but the code is good.
What I end up doing is that I start at index.php and click the first include,... |
In programming we're often faced with a choice: cover each conceivable use case individually, or solve the general problem:
Its obvious that solving the immediate problem is faster, however creating a generalized solution will save time in the future.
How do I know when it's best to try and cover a finite list of case... |
Besides logical and physical architecture diagrams, comps / mockups and tables for expected network load between components and various data schemas, what kinds of visual content, tables or diagrams might I want to include in my Project Architecture Document?
The specific project is an integration of 3rd party social n... |
We have a business logic layer (BLL) that is tightly coupled to our data access layer (DAL). We make calls like this:
using (FooData data = new FooData())
{
data.DoSomething();
}
It's important to note that all of our data classes are internal, and they're in the same assembly as the logic classes, so that only the ... |
The IO monad in Haskell is often explained as a state monad where the state is the world. So a value of type IO a monad is viewed as something like worldState -> (a, worldState).
Some time ago I read an article (or a blog/mailing list post) that criticized this view and gave several reasons why it's not correct. But I ... |
I work better when I have some firm foundations. This helps me to solve everyday problems better, because I can generalize them. The thing I find in programming is so many things are black boxes. Logic is scientific, but commands are not. A command in a language is just "something that does something". It is very hard ... |
We have list of players, which is represented in form like this:
<div class="players_list">
<div class="player" data-points="500">
<div class="name">Player1</div>
<div class="position">1</div>
</div>
<div class="player" data-points="400">
<div class="name">Player2</div>
<d... |
I've got a little bit of history with programming, having gotten my start with Visual Basic. I let it slide as a hobby from a little after VB6 up until just a year or so ago when I got on the iPhone bandwagon, when I decided to take up Objective-C programming.
I now have what I feel to be an intermediate level of knowl... |
I have a requirement to allow users to fill in journal/diary entries per day.
I want to provide a handful of known journal templates with x columns to fill in. An example might be a thought diary; a user has to record a thought in one column, describe the situation, rate how they felt etc.
The other requirement is that... |
I need to design a function to perform the basic arithmetic operations that are addition (+), subtraction (-), multiplication (x), and division (/) between 2 numbers.
That function takes 3 arguments:
-number1: composed of a value and a unit.
-number2: compoased of a value and a unit.
-operation_type: one of the 4 afore... |
QUnit advertises itself on its web page like this:
...capable of testing any generic JavaScript code, including itself!
Can you really use unit testing software to test itself? Wouldn't defects in the software mean that the results are unreliable?
|
I'm reading The Art of Unit Testing by Roy Osherove. I'm at section 7.2 Writing maintainable tests where the author has this note about code smell:
NOTE: When you refactor internal state to be visible to an outside
test, could it be considered a code smell (a sign that something might
be wrong in the code's design... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.