instruction stringlengths 34 19.9k |
|---|
I have been reading about traits in Scala. They are pretty amazing. I am curious how they extend a class without actually resulting in multiple inheritance. I know that the JVM doesn't support multiple inheritance, so I am wondering how these extensions work. Is the language just providing syntactic sugar for compositi... |
At work we have a legacy system written in Visual FoxPRO.
Everything in foxpro is a table, even forms, so basically if you open a form file with a text editor you don't learn much.
Does anyone know about a tool for source control, that support merging and managing binary files? For now I'm converting what I can convert... |
I've written a patch for a GPL'ed JavaScript library. To check how the patch works one needs sample CGI (or PHP) backend.
I want to write a demo PHP to show that my JS works and put the open code on my site.
The question: What it the best way to have PHP on server both executed and viewed as the source?
Note that recen... |
OTServs are open source MMORPGs with a huge community. Mostly all of them have a serious problem: if the server crashes, people can clone items. This is a dirty trick that can be executed because the state of a player is saved to the SQL database when the player logs out. This means the the database is not always in va... |
I'm still trying to wrap my head around OOP. All of the following examples work, of course, but is there one (or possibly another) that best exemplifies OOP concepts?
/**
* For the following examples the Image class queries an image
* and associated info from a database, which is passed on
* instantiation via depend... |
Recently I had a discussion with a colleague regarding code style. He was arguing that your usage of APIs and the general patterns you are using should be as similar as possible with the surrounding code, if not with the the codebase as a whole, just as you would with code appearance (brace positioning, capitalisation ... |
What is a :
Key-Event Dispatcher ?
in keyboard-interactive apps.
What does it really do ?
|
I'm writing a C++ wrapper for my C library (my C++ skills are a bit rusty) and I'm wondering what's preferable: allowing user to construct objects themselves or give them objects via getters?
What would be idiomatic C++ equivalent of that C function?
result* process_foo(library_handle*, foo*);
a constructor like this:... |
I'm a programmer currently working in rounds of meetings along with BAs and PM to gather/describe modules and functionality of our case management system; after a few meetings I saw that using 'use cases' would be a very very good fit to document many of the things and functions discuessed and/or proposed for the new s... |
I recently read http://simpleprogrammer.com/2013/02/17/principles-are-timeless-best-practices-are-fads/ and it resonated with me. I find the more experienced programmers/architects go against current best practices and their excuse is some best practices don't work with their problem domain. For example, I have just st... |
The string type is immutable.
We can use the const keyword with strings in high level language like .NET. My understanding of 'const' means constant (it remains the same, we can't change the value).
Are strings not always constant (IMO the term constant should not be applicable in the same context if the type has to b... |
I have a WCF web service hosted in a load balanced environment. I do not need any WCF session related functionality in the service.
QUESTION
What are the scenarios in which performances will be best if
keepAliveEnabled = false
keepAliveEnabled = true
Reference
From Load Balancing
By default, the BasicHttpBinding s... |
In Java, the String object is both immutable and also a pointee (aka reference type). I'm sure there are other types/objects which are both immutable and a pointee as well and that this extends further than just Java.
I can not think where this would be desirable possibly due to my own experience I've only used either... |
In Java: I have a class Students. I would like to read a list of students from a file. Which one is more elegant:
Reading and constructing the list in main(), and creating a Student object with the new list passed to the constructor
Passing a FileReader to the constructor, who does the reading?
Something else?
|
C++ has a feature (I cannot figure out the proper name of it), that automatically calls matching constructors of parameter types if the argument types are not the expected ones.
A very basic example of this is calling a function that expects a std::string with a const char* argument. The compiler will automatically gen... |
I hope this question gives some interesting answers because it's one that's bugged me for a while.
Is there any real value in unit testing a controller in ASP.NET MVC?
What I mean by that is, most of the time, (and I'm no genius), my controller methods are, even at their most complex something like this:
public Action... |
What is the difference between the terms concurrent and parallel execution? I've never quite been able to grasp the distinction.
The tag defines concurrency as a manner of running two processes simultaneously, but I thought parallelism was exactly the same thing, i.e.: separate threads or processes which can potentia... |
I have a Java Web application backed by a database. Both are hosted in Amazon EC2. If the Internet is down, I need to allow internal users to be able to continue to work and somehow update the hosted service when the Internet is available again. Is this possible? How would I design such a solution.
|
I'm trying to understand more about shells. I'm looking to implement one and want to look at what's been done in the past.
In a regular shell, you have features like aliases and relative paths, and strong syntactic conventions, like --flag and so on. The IPython community have added loads of nice features to their shel... |
I find myself writing (hopefully) helpful comments in code (C++) documentation of the type:
The reason we are doing this is...
The reason I use "we" instead of "I" is because I do a lot of academic writing where "we" is often preferred.
So here's the question. Is there a good reason to prefer one over the other in do... |
At work we have a lot of code like this (pseudocode):
response form_submit(string username, string password) {
if ( username == ""
|| username.contains(invalid_chars)
|| password.length < 5
|| ...
) {
return "errors: blah blah";
} else {
try {
db("insert into users(username, pass... |
Say we want to enforce that a table represents a tree. I have found this method for doing so:
create table tree (
id integer[] primary key,
parent integer[] references tree (id),
item text not null,
constraint tree_parent check (
(id = array[]::integer[] and parent is null)
or parent = id[1:array_len... |
I have my own little project I am creating using RoR, I plan it to have small-medium load.
With no doubt I started with BDD and TDD (Cucumber and RSpec to be exact, but I am also experienced with TestUnit), I like it but since it's my own project and it's a somewhat startup - I am changing many things in it, many requi... |
I am most of the way through my games programming degree. This is not a computer science degree, so a lot of the theory is eschewed in favour of practical portfolio building and what I see as JIT learning, which is apparently more important in the games industry. The first subject was "Introduction to Object-Oriented... |
I am using PHP Codeigniter MVC design pattern
and I had this project with some sort of specific business processes
In my application I will be dealing with 2 existing REST APIs:
Google
Trello
I came up with idea to create REST API to act as Business Logic Layer (BBL)
that in turns access my models directly to fetc... |
I admit that I am a junior developer, and so far I've only built simple web applications in ASP.NET MVC. But I've never had to use the inheritance aspect of Object Oriented Programming in my own classes! It is true that in using ASP.NET MVC I inadvertently use inheritance (any controller I create will inherit from the ... |
I've worked for a number of companies that have, over time, branched out their core service to provide additional services and/or revenue streams. My question is when is the proper time to separate these concerns into multiple applications, even when they're operating on the same/extensions-of-some data?
For example, s... |
I own a VPS with Windows Server 2012 on it. I can install whatever I want on it.
In the past when deploying an ASP.Net MVC project, I would right click the project in the solution and Publish it.
I would then copy over the files to the IIS folder and that would be a deployment for me. But this is no longer something I ... |
I've been programming for a little under a year and have some experience writing systems applications, web apps, and scripts for businesses/organizations. However, one thing I've never really done is working with a framework like Django, Rails or Zend.
Looking over the Django framework, I'm a little frustrated with how... |
Was reading an interesting blog post on Singleton design pattern which is so widely used.
If it's stupid or as in some quora posts, its an anti-pattern why is it so widely used even in frameworks.
For e.g., Spring framework (java) makes all the classes available through dependency injection as Singleton classes and a... |
Existing architecture: nodejs server with mongodb backend.
I have strings coming in describing images that can have #hashtags in them.
I wish to extract the hashtags from the strings, store the hashtags and associate the image with that hashtag.
So e.g. an image is uploaded with 'having fun at #bandcamp #nyc'
#bandcamp... |
I'm building a rather large and extensive wrapper in Delphi for an email system called Mandrill. There are wrappers for this API in many other languages, but not for Delphi. So, I'm hoping to produce the first full wrapper. The problem is, I'm utilizing a third-party JSON parser called superobject. I'm afraid that if I... |
I am developing an application where I draw large number of lines (color is given as black) and update them where I need to remove them from screen.
I thought of making their color to match with the background so that I can make them hide. It seems to be simple and works but in the practical sense I have 10000 points a... |
I have started using OOP in PHP recently. For every model, I create two classes. One class for read operations and another Manager class for all the create / update / delete operations. For example,
<?php
// This is a sample class, just to convey the idea
class Image {
public static function loadById() {}
publi... |
I wanted to perform some actions in my Java program whenever a particular interface comes up (network interface ppp0 e.g.). However I figured out it was way too clumsy to keep polling the interface to verify its status.
After finding out if-up.local file in Linux, now I can run a bash script whenever the interface co... |
Sorry for the long question, but I want to be sure to define my problem clearly.
For my thesis (in aerospace engineering, so not much programming experience) I want to develop a (prototype) mobile application which will facilitate the reporting of safety related events in African aviation. Although the content of my t... |
Let's say I have an object like this:
function Foo() {
this.parser = new DataParser();
};
Within Foo I have a method that does something like this:
Foo.prototype.getResponse = function(message, callback) {
var payload = {data: message, type: 'normal'};
var response = this.parser.parse(payload, function(data){
... |
Back in college I've been told that using break; and continue; outside switch statements (e.g. to escape for or while loops) is wrong, bad practice and bad habits at the same time because it only means that you cannot write loops properly. Is it really?
A friend of mine also told me that using conditional ?: is bad pra... |
Sometimes interview questions are hard, whether the interviewer intends them to be, or not. It can come down to a choice of whether to use the limited interview time to code up an ugly, inefficient, brute-force solution, or spend the time understanding every aspect of the problem with the interviewer.
For example, Pro... |
I'm new to dependency injection and I have a few questions about which style I should use in my applications. I have just read Inversion of Control
Containers and the Dependency Injection pattern by Martin Fowler, but I
can't get the practical difference between constructor, setter and interface
injection.
It seems to... |
In class I am learning about value iteration and markov decision problems, we are doing through the UC Berkley pac-man project, so I am trying to write the value iterator for it and as I understand it, value iteration is that for each iteration you are visiting every state, and then tracking to a terminal state to get ... |
Say you have a situation where you divide and then multiply a float, and you need to guarantee that it survives macheps (ie multiplication output equals division input). What are known strategies for guaranteeing this? Rounding would work, but anything else?
|
According to this blog post: Kiln now supports repositories accessible from both Git and Mercurial
We decided that the awesome way would be to make Kiln fully bilingual.
It stores every repo in both formats. It automatically converts
everything back and forth, always. The translation is 1:1, reversible,
and roun... |
I was lately doing some research about different programming languages. I was interested particularly to learn unique features of popular programming languages and situations where these assets shine. I believe this can help me to decide what language to use depending upon the problem to solve.
I found that many langua... |
Although Joda is feature rich and more sophisticated than standard Java time, it may not always be the best thing to use. How do I decide if I should use Joda Time or Java Time in any Java code?
Is there some kind of guideline which tells us how to pick the right one depending on our requirements?
|
I've came across a question transform this text with sed [sed only]
and it got me wondering what class of problems is solvable by stream editors or programs/computational models with similar constraints.
For E.g Regular expressions can solve problems that require fixed/const amount of memory (Can solve all problems tha... |
I've been asked to look at converting our traditional client-server software into a web-based version (using PHP).
One of the first questions from management was how we'd limit the number of concurrent users, currently handled by our licence manager that every client connects to when running our apps.
My initials thoug... |
I'm writing my CV, and having trouble explaining about the software for enterprise I developed in my previous job. Now I'm thinking of writing following 4 things for each software.
Abstract explanation about what the software is used for
How much was the software sold
About how many data does the software usually hand... |
While inheriting a class in C++, user can specify the access specifier like,
class Base
{
public int mem1;
protected in mem2;
};
class Derived1 : **private** Base
{
// mem1 will be private here.
// mem2 will be private here.
};
class Derived2 : **protected** Base
{
// mem1 will be protected here.
... |
The A* Algorithm is the optimal (provided the heuristic function is underestimated), complete & admissible (provided some conditions). I know the proofs of admissibility & optimality.
But how do you prove that the A* Algorithm is complete?
|
I'm trying to figure out what are currently the two most efficent algorithms that permit, starting from a L/R pair of stereo images created using a traditional camera (so affected by some epipolar lines misalignment), to produce a pair of adjusted images plus their depth information by looking at their disparity.
Actua... |
This question is similar to the question posted on Does groovy call partial application 'currying'?, but not completely the same, and the answers given there do not really satisfy me.
I would like to state right at this point, before I go any further, that currying is one of the concepts that have been hard to fully un... |
I usually do database and web development but at the moment I'm learning desktop development with Mono and Gtk# using using the MonoDevelop IDE. I'm also using the Stetic GUI Designer inside MonoDevelop to create the GUI.
What are the best practices when using a GUI designer to encapsulate extra logic that is related t... |
I was thinking about it. You may have access to endless memory (one computer with lot of RAM) so that you can keep on adding more and more elements to your ArrayList.
But, I think that you can only access elements BY INDEX up to a certain value of index. The maximum size of this index could be = maximum number your co... |
I see most immutable POJOs written like this:
public class MyObject {
private final String foo;
private final int bar;
public MyObject(String foo, int bar) {
this.foo = foo;
this.bar = bar;
}
public String getFoo() {
return foo;
}
public int getBar() {
retu... |
I'm planning to write a single API that is syntactically valid in most major programming languages (to the greatest extent possible, so that only minimal amounts of code will need to be re-written when moving from one language to another). I think the simplest way to do this would be to write a group of functions that ... |
I'm managing a small team of developers. Every so often we decide we're going to spend a day or two to clean up our code.
Would it be a good idea to schedule regular time, say 1 week every 2 months, to just cleaning up our codebase?
|
I'm interested in how operating systems work. I've been reading some articles about Linux and seem to understand how it all generally comes together, but I feel like there's a chicken and egg dilemma when it comes to constructing an operating system.
Since Linux is written in C (and Assembly), which needs a compiler to... |
This is a rather vague question, but it's something I've never felt has been answered in a satisfactory way when reading about proper design.
Generally, when learning about Object Oriented programming, abstraction, factoring out, etc, the holy grail of design - and the reason they always claim you're using the developm... |
I am relatively new to programming (1yr field experience now) and I think that I am overusing the singleton pattern and I need some input on how to do it in a better way. Right now I am using singletons as an excuse for static global data. I use singleton for Application Status, Application Settings and also a lot for ... |
I'm thinking about open sourcing a project of mine. I'd accept contributions under a CLA that grants me a copyright license (I'll explain what I mean at the end of this question). — Now, if someone submits a contribution, is it then okay that I write Copyright (c) 2013 My-Name at the top of each file? And mention any ... |
What has changed with regards to the design patterns? Do both use the same development techniques? If I'm faced with the option of learning Windows Phone 7 vs Windows Phone 8 will learning windows phone 7 will qualify me for directly start development for windows phone 8?
|
I am using a shared host that which doesn't support CRON/TaskScheduler (it is a windows Godaddy server).
I need to search on email server for new emails on each 1 hour, I have the script on PHP.
Can I use PERL to emulate a task on certain times, or is there any other alternatives?
|
The following is a programming interview question: Given 3 sorted arrays. Find(x,y,z), (where x is from 1st array, y is from 2nd array, and z is from 3rd array), such that Max(x,y,z) - Min(x,y,z) is minimum. This question is discussed here: http://www.careercup.com/question?id=14805690
One possible solution discussed i... |
I'm creating a piece of software, that will run on windows and will act like launcher for the game, to serve as an auto-updater and file verifier in client side PC.
One thing I don't understand, why my antivirus software (Avast) is considering my exe file as dangerous and won't start it without asking to put it into sa... |
I write open source .NET class libraries as a hobby and thought about signing them. I can get Visual Studio to generate me a password protected public/private key pair and save it as a .pfx file, but I don't think I should do this for each and every project. One key pair should be enough, right?
Obviously I'm not going... |
I do not consider myself a DDD expert but, as a solution architect, do try to apply best practices whenever possible. I know there is a lot of discussion around the pro's and con's of the no (public) setter "style" in DDD and I can see both sides of the argument. My problem is that I work on a team with a wide divers... |
What is a good strategy to label software requirements in an SRS?
Typically outline numbering is employed on headers - but these will renumber if a new heading is inserted in the document. To me it seems like a good idea to aim for a more stable designation for each software requirement. This should make it easier to r... |
From WCF standpoint, just wondering whether I can leverage anything after upgrade from Silverlight 4 to Silverlight 5? I did some research regarding new features of SL5 and cannot find anything about changes to System.ServiceModel and System.ServiceModel.Web namespaces, is it rigth that nothing were added or am I missi... |
I have a question regarding Machine Learning in general. Consider the following scenario:
Given a piece of text, we want a program to know whether the text is 'abusive' or not.
To do this we can give the program 1000 text samples and manually mark which ones are positive and which ones are negative. The program studies... |
I cannot find any naming standards/conventions in MSDN for naming ASP.NET controls.
One of the following standards tends to be used by programmers:
lblAddress
AddressLabel
Address
According to MSDN's Name of Type Members, should we be treating ASP.NET controls as fields, hence using Pascal Case (e.g. AddressLabel)?
|
This is a question about logistics, not a technical question.
My company has outsourced some embedded software work. Specifically, we have payed a contractor to develop an embedded system for us since we do not have adequate in-house knowledge to do it ourselves (we only have desktop application developers).
So, the c... |
Over the course of some months I've created a little framework for game development that I currently include in all of my projects.
The framework depends on SFML, LUA, JSONcpp, and other libraries. It deals with audio, graphics, networking, threading; it has some useful file system utilities and LUA wrapping capabilit... |
I'm building an API and want to count hits for each user. It's a HTTP API implemented in Python. I could keep the count in a database (using PostGreSQL) but it'll be a very busy API, so I don't want the overhead in the DB. I'm looking at Redis or just writing plain text logs. But is there a better approach?
It's a map ... |
I work in Java so basically I use OOP paradigm during coding.
I am about to start working in Perl and I was wondering what is the paradigm that Perl developers follow.
In wiki it mentions that it supports many paradigms but I am not sure I understand this since it is a scripting language.
So my question is:
Are the obj... |
It's difficult to understand the meaning of the question from the topic's name.
Here is what I mean.
I'm watching Uncle Bob's Clean Code Episodes. In many episodes where he is talking about SOLID principles he mentions the problem of rebuild and redeployment caused by code changing. He says that bad architecture causes... |
My company's team lead\architect argues that a large-scale project is easier to understand if "entities connected by logic" are placed in one .cs file.
I quote:
"The whole structure of the logic and the interface and the class can be seen in one place, this is an argument which can't be refute. To see the same thing b... |
Let's say I have an animal class...with fields of name, height and weight.
I want to create a bird class which is an animal, but it has also, say, wing size.
How can I do that?
My general idea is creating the animal class, and the bird class which inherits animal, and has additional field ...but then different kinds of... |
I'm working on web application design that includes Knockout.js and have an overall MVVM question: Does it make sense for the ViewModel to automatically inject a default HTML template (pulled from separate file)?
More detail: suppose I have a site like this...
header...
widget 1
widget 2
widget 3
footer
..... |
I plan to import works from a Java GPL2 project into a GPL3 one.
How must I "head" all my project derivating sources files : must I put the GPL2 license of the original project (saying that "This file is part of PROJECT_NAME ...") above my project one ?
How should be the LICENSING file of the whole projet : must I put... |
I'm working on an application that uses Inversion of Control to achieve loose coupling between the Data Access and Business Layers.
Having an ILoanApplicationRepository and a LoanApplicationRepository, where should I store the XML Comments that document the class members? on the interface or on the concrete class? shou... |
I'm a bit confused about the OwnCloud licensing model. OwnCloud is an AGPL licensed product (at least the open source version is). Does that mean that the only license I can use for an OwnCloud app I write using the API would be AGPL as well?
The way I understand it, the AGPL license is so restrictive that no app can b... |
I'm inching my way up the TDD ladder and I've got to a point where I'd like to get advice on the "next move". I realize there might not be a single answer here, so any logical suggestion would be great.
The thing I think I'm stuck on is knowing weather I should force duplication or proceed with primary functionality im... |
I am creating an application with a friend, which we are planning on writing the back end partially in PHP and partially in Javascript with Node.js. Javascripts front-end involvement with PHP makes this a tough question to Google.
We are also using ejs templates, MySql database and it will be run on a Fedora server if ... |
I've been a full stack .net developer for several years now using C#/MVC4/SQL Server and have never taken on a freelance project. This is because up until now I have worked only as a full-time consultant by hour or on start-ups for equity. Also, I have only worked on very large complex projects that needed to be built ... |
I'm working on a project where I'm developing an interface that learns how you typically use a space, and tries to create the most appropriate control strategy for heating/lighting. I've done some research into the area of machine learning techniques, but I was wondering if there were any recommendations on which learn... |
I am currently a professional programmer. I want to expand my skillset, but I also want to make the career jump to being a dev lead as part of a team. I know there's got to be a lot to learn (and this won't be an instant thing) but I think I'm smart enough to do it and I'm up to the challenge.
I'm sure that many of the... |
In planning poker/scrum poker, when an estimate is made, should the estimate be made based on the assumption that only a single developer is assigned to that task, or a group of developers? If the latter, how large is that group? The reason this is relevant is that the time estimates would probably be different if a si... |
I'm planning on releasing a program I made, but I'm not sure exactly how to ensure people don't just steal it. The price point is $1, but I'm not selling it through an "app store" or anything so I have to handle the legal stuff myself as well as building a website. How do I make it illegal (is it by default?) for peopl... |
I am interested in modifying the SQLite source code and making it available as an experimental public fork (GitHub, Google Code, etc.)
However, the SQLite source code is currently in the public domain. If I fork, am I allowed to relicense using GNU GPL 3+? I would like my changes to the original source to be licensed... |
According to this GNU Project page, regarding Microsoft Public License (Ms-PL):
This is a free software license; it has a copyleft that is not strong, but incompatible with the GNU GPL.
They do not explain why it is incompatible. I cannot find any satisfactory answers nor explanations via Google.
|
The Falcon programming language advertises itself as supporting tabular programming:
Falcon provides six integrated programming paradigms: procedural, object oriented, prototype oriented, functional, tabular and message oriented. And you don't have to master all of them; you just need to pick the ingredients you pref... |
Let's say I want to develop an image editing program similar to Photoshop. Is it likely that certain interface patterns and approaches are patented and I can get sued if I use them in my program as well?
Do I need to take active care to avoid doing things the same way as competing software? How will I manage to make fe... |
I am Database Administrator, but now I need to know something about android applications.
I need to run an existing .Net application in Android Operating System, while surfing on the internet I came to know that, I can use MonoDroid to build and run my application on Androids Operating System.
I am new to this Android ... |
I am designing a web application and I am wondering how to design the architecture to manage sending automated emails.
Currently I have this feature build into my web app and the emails are sent based on user input / interactions (like creating a new user). The problem is that connecting directly to a mail server takes... |
I've developed a Socket Application on top of TCP in .NET C#, which allows many clients to send files from one another via a VPS I'm using. Most file transfers will occur between people in the same region, say, even in the same neighborhood.
So, If 300 clients are connected, some of them will be connected from say Euro... |
I'm currently developing a web that is all made from images (an HTML version of a Flash web).
The client provided me with a big PSD which I had to export each layer as a PNG to keep transparencies. There are some layers that are heavy in detail, and of course, in size, like 5MB each (mainly the background, it's like 6 ... |
what are best practices, to model and query spatial responsibilities of company local branches?
My company has many local branches which are all in general responsible for 1 city. This is the easiest case. However, there are some exceptional cases. Here's a list of all possible cases:
branch a is responsible for city ... |
I had legacy code that was originally build for some quite old version of compiler. We are talking about native code, not managed. Now it is ported to almost newest version of the compiler. Every compile error was fixed and now the product is properly compiling and running.
But:
although it compiles and even runs... h... |
I'm doing some investigation into the role of maintenance in software development and the use of metrics within the development cycle.
What I am asking is for a point in the right direction or possibly a direct example in which there has been software failures due to the oversight of maintenance costs.
More specifical... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.