instruction stringlengths 34 19.9k |
|---|
I am seeing a lot of programmers turning away from management and administration roles. They want to build stuff. And as a result, a lot of these positions are filled by non-technical people. I fail to see how they add value. Is scheduling meetings, booking offsites and other administrative work enough to justify their... |
I have been doing a lot of code review lately, and I am unsure of the positive and negative effects and professionalism of putting positive and/or funny comments in code reviews.
We use Github as our code review platform on my team, so the comments are viewable by anyone. I generally try to use this platform so the en... |
I have a client-side Javascript framework that is publicly available and BSD licensed. Each file says it is copyright me, the date, all rights reserved, and the BSD license text.
I am making a project which uses - and adapts and makes code changes to - my BSD licensed framework. Although obviously browsers will downl... |
I have a set of classes from a 3rd party library. These classes use an inheritance structure to share logic. I would like to add a layer of abstraction in the middle of their inheritance tree to add functionality to all of the children (concrete) implementations.
Here is a simplified example of the classes in the 3rd p... |
The title pretty much says it all. I'm just having a little computer science exercise and am building a Tree. I want a node to be able to add a sibling which requires one to first get a reference to the parent, obviously. I was wondering what is the "correct" way, by definition of what a Tree is, to do such a thing?
|
I have a monitoring web application which has a .Net Backend and a Silverlight frontend. The application crunchs big chunks of data, process them and presentates to user. Then user can interact with the data to see different graphs of log. He/She can unselect dimensions, group some values, choose metrics like transacti... |
I wondered what functional languages are mainly used for? I've been reading about them and read about Haskell and others. Some seem to be just "academic" languages which makes little sense to me, so hoping to get a better idea of their uses in real world applications.
|
gtkmm provides lifetime management of widgets using
Gtk::Widget* aWidget = Gtk::manage(new Widget());
Gtk::Widget.add(*aWidget);
This delegates lifetime management of aWidget to its container widget.
We also have several types of smart pointers, particular the C++ 11 smart pointers templates, which I use everywher... |
Up until now it seems that when you register on a random web site you do so with blind trust.
You assume that the site isn't harvesting information and passwords. You assume the site is reasonably secure. And you also assume that the information you've submitted isn't used in an undesireable way.
More recently, it's b... |
Forgive the title -- it needs work. I am struggling to find better English to express my issue. Edits encouraged.
Example to describe my issue:
Checker Method
I have an argument checking method called public static void StringArgs.checkIndexAndCount(String, int, int). Given a string, an index, and a count, confirm t... |
I am not experienced in javascript. I try to use some popular javascript libraries such as jQuery, Angular.js and Meteor.js.
I wonder if understanding the logic of functional programming (in javascript of course) will help in understanding and using these libraries better?
|
I've been writing JavaScript for a bit and have now seen code using the idiom
var that = this;
and
var self = this;
Used to gain access to this through closure scope. At this point var self = this seems somewhat more common.
My question is which of these two idioms is truly the convention?
Since they do exactly the... |
I have recently taken a project with another developer, and he has a certain way of initializing his references.
class Player
{
private:
Console &console;
Armor &armor1, &armor2;
Debugger &debugger;
sf::RenderWindow &window;
sf::Event &event;
public:
Player(Console... |
On a high level, this is my understanding of the difference between a client and server:
a server listens on a host and a port, receives requests (e.g. through a socket connection), and then sends a response to the client who initiated the socket connection.
The client is what sends a request to that server socket, an... |
Is there some recommended practice regarding methods as verbs in OOP? Should the object work syntactically as subject or as object/complement?
Should object.doSomething() be normally understood as "the object iself does something" (subject) or "the caller does something with the object"?
I suspect that the first alte... |
I got mainly abstract classes in my project and there are a few other class which are using/inheriting them. When I'm writing the documentation I would like to specify that a part of it is just about the behavior of these non-abstract classes, but I found using this word silly.
I could just say it's a class, however an... |
For example, Say I make a business software product. I sell it for $100. The competitors charge thousands for their version. Does that kind of model work? Do company's ever buy software turnkey like that? No support. No nothing. They just spend $100. Sure there are continuing efforts to improve the product but ... |
All functional programming languages that I know of (e.g. Haskell, Scala, Scheme, Clojure, SML, OCaml, ...) support a notion of closures.
Also, I often read that a language X can be considered functional because it supports closures.
On the other hand there are programming languages that do have closures but are not co... |
Is there a reason, historical or otherwise, why the modulus operator is part of a small set of standard operators in what seems like many languages? (+, -, *, / and %, for Java and C, with ** in Ruby and Python).
It seems strange to include mod as a "fundamental" (not to knock it, I use it plenty, but I also use expone... |
Well, the title is not very appropriate, please read on (I couldn't get a better one).
Note: Using Python 2.7, but an algorithm will help too.
I'm making a side scroller game, in which I am generating the obstacles on the fly. The trouble I am having is figuring out how to generate the obstacles. o_O
I have a some kind... |
These days password hashing algorithms are designed to be slow. While it prevents black hats from guessing the password (at least partially), it also gives additional work for the server.
I can imagine that, if someone wanted to make server run extremely slowly, they could simply send many log-in requests which would l... |
I'm looking into building my first mobile app. One of the core features of the application is that multiple devices/users will have access to the same data -- and all of them will have CRUD rights.
I believe the architecture should involve a central server where all the data is stored. The devices will use an API to in... |
I have certain preconditions on input data and I need to design an algorithm for that data. Should I also handle invalid preconditions? Also is it normal that my algorithm will work only for a certain number of inputs, for example 4, and for any smaller number of inputs I'll have "if input.size" clause?
To clarify my ... |
When should I use one versus the other? For instance, let's say I have 20 comma delimited, denormalized text files and I want to transform the data and load it into normalized SQL Server tables.
|
I have an open source script for a specific site (I'm trying not to call anything by name here) that I and a few other developers recently moved to GitHub. We've gotten several new developers since we moved to the new system, including one very active one in particular. However, this active one has started changing a l... |
We have a Javascript codebase that we want to open-source in an incremental fashion. That is, we want to release the full code to some of our core modules first, keeping the rest of the "application" code in minified format. Eventually, we will also release the whole application code in full (although that may take a f... |
I'm designing a system which needs to report basic distance between zip codes. It will use the Google Distance Matrix API but I want to cache the results in the database so that multiple requests for the same data points don't result in duplicate API calls.
A basic Distance class might look like this:
A basic data str... |
Most "Canvas" widgets in common GUI toolkits offer low level operations like drawing basic shapes of different colors/line-width/etc, or displaying sprites and images. Some seem to have slightly more advanced features like the ability to treat primitives drawn on the canvas as "actors" so they can be moved and manipul... |
As far as I remember myself programming I was taught not to compare floating point numbers for equality. Now, while reading Programming in Lua about Lua number type, I found following:
The number type represents real (double-precision floating-point)
numbers. Lua has no integer type, as it does not need it. There is... |
I would like to know what the overall impact of resource planning on a software project is, where the requirements and design of the project are driven by automated acceptance tests and unit tests, in contrast to a more "traditional" approach to software development.
What, in your experience, is the overall effect on ... |
In each application there are concepts like users, customers, etc. and some part of the application tries to manage them. For example:
1. keeping the information of people, organizations, firms, etc.
2. managing users (people who work with the system)
3. managing customers (people who purchase goods/services)
4. distin... |
I'm working on an ordering system where we receive tab delimited files that look like this (I removed most of the columns for clarity):
OrderId OrderLineId BuyerName BuyerAdress RecipientName RecipientAdress
1 1 John 123, Street Doe 25, street
... |
I need to add a new payment type to an existing code base. That means that I'm going to have a few methods looking like this:
if (old payment type)
process old type of payment
else
process new type of payment
Now, if this could have been determined beforehand, I would have this method point to an interface imp... |
I have created a a number of non-trivial scripts in Python that do some long running reporting. At first these reports started off as scripts with a config file. Then I added in the a database component to persist data. Now I'm building a GUI to sit on top of all of them.
My question relates to design. Each time I add ... |
Everyone says that I should make my code modular, but isn't it less efficient if I use more method calls rather than fewer, but larger, methods? What is the difference in Java, C, or C++ for that matter?
I get that it is easier to edit, read and understand, especially in a group. So is the computation time loss insigni... |
I am confused about the use of register keyword in C. It is generally told that its use isn't needed like in this question on stackoverflow.
Is this keyword totally redundant in C due to modern compilers or are there situations in which it can still be useful? If yes, what are some situations in which use of register ... |
I will be moving workplace in the near future and I believe they will be very interested in my experience of Scrum and how it may relate to their business. I am trying to understand if it will work in their environment.
My current place of work we have a 2 products/2 backlogs/2 separate teams. These backlogs are obviou... |
I'm creating a menu system in PHP and MySQL. I will have several different menus and each menu will have a set of menu items connected to it.
On the site, I also have different user permissions, some users can see all menu items and some items are hidden from some users. I'm curious on how I could handle the permission... |
I have a list of objects that will need to go through an approval process.
I am curious if it would be best to simply add some properties to my object, like ApprovedBy, and ApprovedOn.
Another option is to create an ObjectApproval class that contains this information as well as other information that needs to be stored... |
I'm working on image processing and I need to use big Images in a critical system.
A good practice for critical systems is to avoid dynamic allocation of memory but what is the design/recommendations for static memory allocation?
If we do a static allocation of a big matrix we get stack overflow.
class test
{
publi... |
I've inherited a lot of poorly designed code; the code has no tests. I am putting tests in place before I attempt a major refactor, but I have run into a problem with my unit tests.
The problem is, I will unit test a function, and then later decide that function is a liability. I will either get rid of the function, o... |
I am trying to solve the following kind of problem. I do not know if there is already a name for this, or a solution; however, I'm willing to bet there is. I was hoping someone could point me in the direction of implementing a solution for it, or at least tell me the name of the problem?
Suppose a traveler has a cert... |
I'm writing a library for sparse linear algebra computations as a backend for my thesis work and I've come to a bit of a crossroads. I'm using modern Fortran (don't groan, it's had inheritance and polymorphism and all that jazz for 10 years now).
From a software design standpoint, my main issue was making iterative sol... |
I am not sure whether there is a 'right' or 'wrong' answer to this one, but I was curious about the general consensus.
I have a User model that currently performs user functions (such as retrieving user details from the database, inserting new users to the database, updating user details etc.)
This leads to a fairly l... |
I've been using PHP Frameworks for so long that I've actually forgot the "best practices" for create websites without one.
Usually I will use Symfony, or more recently I've been using Laravel. A client wants a very simple website, but with certain parts of it dynamic. Due to the nature of the site using Wordpress, or a... |
I'm a Java developer with a bit more than a year of experience which places me somewhere above a junior, but not among mid-level developers yet. Recently I was offered a long-term project which is about studying an existing banking application code for 4 months and then introducing changes when needed. As a not-so-expe... |
I am writing a piece of software and I would like to release it open source.
Should I try just getting it stable on my computer (with normal use; no "things a monkey wouldn't even do") before releasing it, or should I take a different approach?
What I am leaning towards doing right now is:
Write it myself during the... |
Firstly, I'm not new to this. I've written desktop applications for Windows going back to 1991 with Visual Basic 3.0. I've used C/C++ and Win32 API, VB3-6, C# 1.0-4.0 and currently knock out web applications in ASP.Net MVC. However I haven't touched desktop stuff since 2000 in depth bar playing around with some ClickOn... |
Do JAX WS implementation classes come as part of the Java5 package, as part of the Java6 package or only as part of an application server libraries like WAS?
I read that it comes as part of Java EE? What does that mean? Java 5?
|
Consider a table in which a column represents a monetary value in some cases and a link to the value of another record in other cases so that we have the following:
TABLE 1
Id Product Composite
1 Apple False
2 Orange False
3 Pear True
TABLE 2
Product Date Price
1 2010-01-01 0.45
2 201... |
In this thread, an Oracle Product Manager (username "Alex Keh") refused to make Oracle's EF provider to conform with .NET's PascalCase coding standard for class names and property names, saying that it is only "cosmetics" without any "functional needs".
I discussed it with my team. One of the key things we want to kn... |
At one of the DevDays conferences a presenter said that Workflow Foundation isn't just for applications that require persistence, but they can make it easier to write and maintain Async WCF code and the corresponding error handling. (try.. catch)
Assuming that is true, is Workflow Foundation able to use all the CPUs ... |
I am new to GitHub and new to the open source world (coming from .NET). I have a media wiki site and want to install a Google analytics extension: http://www.mediawiki.org/wiki/Extension:Google_Analytics_Integration
The extension's documentation says to download the code from GitHub.
In the GitHub repo, there are some... |
You can't ever have a talk about so called "NoSQL" database without bringing the CAP theorem (Consistency, Availability, Partition : pick two). If you have to pick say, between MongoDB (Partition, Consistency) and CouchDB (Availability, Partition), the first you need to think about is "Do I need correct data or do I ne... |
It was my freelancer job at oDesk. I have done several jobs earlier in given time, but is was the first time I missed the deadline. It was a very lengthy job and I tried my best but I still missed the deadline. Now, I am very scared. Because it's my fault that I missed the deadline.
My question is: Is this is a big con... |
I have the web application where i am serving file downloads in php.
All is working fine and i have the download column in file field where i increment it.
But i want to have full statictics of downloads like how many downloads on each day or in month or time of day or from which location
But i am not able o find how t... |
As a developer I should strive for low coupling between classes.
But low coupling doesn't mean "No coupling" so sometimes I have to allow some code flexibility and use "new" inside a domain model. (I'm sure everybody does this in real production code)
If I use "new" inside a method to create an object and I have to un... |
I like to create simple class diagrams for my projects. Most of the time I just use composition, inheritence and associations.
IBM's basic UML resource tells all about this.
However I'm using ruby so I got the option to define a module with some methods. I can just include this module in every class where I want to use... |
I created login form. When user clicks on login button this form shows up with some fade effect (jQuery). What I want to do is to display error message in this form when user inputs invalid data. Before showing any messages, PHP must read data from database, therefore page must be reloaded and when page is reloaded thi... |
I found an interesting article on high scalability web site where it talks about EBay scalability and especially a specific passage struck me:
"(Ebay strategies)...Move work out of the database into the
applications because the database is the bottleneck. Ebay does this in
the extreme. We see it in other architect... |
Here is, roughly, our structure of work using git, for web development. We have a master branch, and individual or groups of work are done seperately in branches, then merged in.
A ticket (or several) comes in.
We create a branch on our local development repository, and push it to origin.
We fix the tickets in code, c... |
I have a system that checks the status of a number of systems, such as, is http up, does the system respond to ping, that sort of thing.
I check all of these systems every 5 minutes. If something is broken, I send out an e-mail with a notice. If the problem is cleared I send out an "all clear, problem resolved" notice... |
I am writing a Java web application that consists mainly of a bunch of similar pages in which every page has several tables and a filter that applies to those tables. The data on these tables comes from an SQL database.
I am using myBatis as ORM, which may not be the best choice in my case, since the database is poorly... |
Since the released of Web API, I've been wondering whether it's necessary or helpful to migrate/change MVC controllers to use Web API calls. Since it's hard to describe code I'll show an example of what I mean:
Current controller, the _userService is basically the Business layer of the application that is then calling ... |
There are answers to the question on how test classes that connect to a database, e.g. "Should service test classes connect ..." and "Unit testing - Database coupled app".
So, in short let's assume you have a class A that needs to connect to a database. Instead of letting A actually connect, you provide A with an inter... |
I've written an API which can be configured to signal errors in different ways (return values, debugging messages, or exceptions). I've got a check in place when the API is first initialized to see what type of error handling the client is requesting - what should I do when they request an undefined error handling type... |
I know some people that are currently working on a project for the US military (low security level, non-combat human resources type data).
An initial state of the project code was submitted to the military for review, and they ran the program through some sort of security analyzer tool. It returned a report of known se... |
I've made a container which functions like a Binary Heap in terms of insertions and popping the root element. The key difference is that the comparison steps are all replaced with a random call for deciding when to go left/right. (The underlying data structure is a Vector, written as an expandable array, so you don't... |
A db index is analogous to a table of contents. This helps me understand db index in an easy way. My question is are tehre any real world analogies for a clustered index?
|
I am not a licenses expert so I got confused a bit... The license Apache 2.0; Does it allow to get source codes and modify them for new projects? I mean modify source codes (some its parts) and recompile them?
|
I was wondering if it's valid to initialize an instance of a class within the same class? For example:
public class Person()
{
string name;
string age;
public Person getPerson()
{
Person p1=new Person();
//some logic here
return p1
}
}
I ended up doing that for a part of my code ... |
I already had question about this but obviously it was not accepted very well, apparently too long when it's actually more information so you could have given me better answer.
Ok, I will be much clearer now. Best possible logic to develop scalable chat in terms of stability, storing/reading messages on chat, updating ... |
I am a little confused on both pointers and reference. From my understanding pointers are addresses in memory. If I pass a variable using pointers and reference to a function, any manipulations of the variable in the function will change the original variable.
I read online that passing by reference is not encourage... |
So I am creating a web api for an app I am making. The data is sanitized before it is sent to my web api and then encrypted before it is stored in my MySql server.
The phone app sanitizes then behind the scenes calls -> web php api which encrypts aes style with a hard coded salt then calls -> server
My question is if ... |
I am implementing a vector in C. I am doing this for the fun of programming, for the fun of learning, and for the use of the data structure in later projects. This is not homework. My question is regarding methodology, not necessarily implementation, therefore I am not really looking for a code review.
Now, I have read... |
I'm trying to hack on the ROS bloom build system (https://github.com/ros-infrastructure/bloom). After I've made some edits, I build it and install it to a virtualenv to test using
python setup.py build
python setup.py install --root /path/to/my/virtualenv
However, once in my virtualenv, it doesn't work since pkg_reso... |
I can not come up with a good architecture for my card game. I need help to understand how games usually are designed.
First, I will describe game rules.
Game Rules
Setup
There are four players, each two player form a team.
Each player gets 12 shuffled cards
There are 4 blinded cards on table(river)
Players order ar... |
To illustrate the question, let's say we have two programmers of comparable skill that both solve the same problem. The code they turn out has roughly the same lines of code, but one programmer uses 5 classes while another programmer uses 20.
Both sets of code get comparable wtfs per minute in code review, implying tha... |
I was just wondering why does Java compiler decide whether you can call a method based on the "reference" type and not on actual "object" type? To explain I would like to quote an example:
class A {
void methA() {
System.out.println("Method of Class A.");
}
}
class B extends A {
void methB() {
... |
I was reading Towards Architecture-based Self-Healing Systems, and came upon the term
first-class connectors. What are they?
Searching some more finds this paper Systematic Construction of Software Architecture Supported by
Enhanced First-Class Connectors, which looks like it might have an answer, and I might read it i... |
I am building an application in C# that works with a Progress database. The passwords that are stored in this database are stored using a hash algorithm that Progress has not made public. However, I would like to authenticate using these hashes. Is it feasible to reverse engineer such a hash algorithm and how would I g... |
It is an error if you do anything in a constructor before calling the superconstructor. I remember that I had problems because of that. Yet, I do not see how this saves us from errors. It could save you from using uninitialized fields. But, the Java compiler that checks for using uninitalized variables does that and th... |
I'm focusing on trying to understand UML diagrams and learning to interpret them in order to implement the designs they describe. In the following diagram, I am not clear on what the implementation for Port Operation should be.
It looks like it should be a class/entity the same as the others in the diagram. I underst... |
So i'm looking for some input/consensus on what terminology we should be using to describe something that looks like this:
class Printable
{
public:
virtual void printTo(Printer *) = 0;
virtual double getWidthInPoints() = 0;
virtual double getHeightInPoints() = 0;
};
So this is a class that only has pure... |
I've been developing a custom PHP template engine to suit just my needs and also to get a little more practice with PHP.
What I did was to create a Template class that simply receives as constructor parameter a path to a template file and a string that should be the placeholder for the contents of the pages. In that c... |
If my solution has both a "dataservice" project and a "business logic" project, where do the entity models, which represent database tables, belong?
At first i thought putting them in the dataservice layer, but then i would need duplicate models in the business logic layer, if i wanted to provide reusable logic dealin... |
I am migrating a 10-years-old big CVS repository to Git. It seemed obvious to split this multiple-projects repository into several Git ones. But the decision-makers are used to CVS, therefore their point of view is influenced by CVS philosophy.
To convince them to migrate from one CVS repo to different Git repositorie... |
EDIT
After a good amount of thinking and self-reflection on the topic, I realised that most of the issues I raised in this question was coming only from a personal, rather than a professional perspective. Hence the moderators put this question on hold because of the highly personal, subjective nature of the problem I t... |
Should tests in some project be written by the actual person that does the coding (usually senior in our team) or it can be done by junior coders with less experience?
|
When is it absolutely necessary for a controller to be async? Should all controllers be async or is it bad practice to make all of them async unless it is necessary.
Just looking for some general guidelines.
|
I have this dynamic data in PHP, but for each array record, I want to allow a downloadable option to save a zip archive of all records (each as a separate file).
These are actually DNS zone records that are housed in a database. It wouldn't make much sense if they're in a single text file, so I'm looking to somehow hav... |
I was recently refactoring a method that was both a command and a query method.
After separating it into a one command method and one query method, I found that there are now multiple places in the code where I am calling the command then getting the value from the query, which seems like a violation of the DRY princip... |
I'm using JavaFX for gui of my app. Its license is GPL+Linking Exception. GPL requires me to release my source code. But what's the linking exception?? (I'm just using it as a library. Not modifying or using its source code.)
|
I was reading about the rules for royal succession of the British monarchy and thought the easiest way I could understand it is with code (or pseudo-code). I came up with this (in a C# like pseudo-code):
EventHandler CurrentMonarch_Died {
CurrentMonarch = SuccessorRootedAt(Person.Electress_Sophia_Of_Hanover);
}
e... |
If I have a file config.php with some configurations in some variables and in some page I include this file, each time the variables will be loaded again in the memory of the server?
I think the answer is yes, but I'm not sure, I don't know to much of the PHP lifecycle. I don't know if I made myself clear, so here is a... |
I've been trying to see a way to get a measure of how much a PHP script costs of memory to the server. Well, I've found some solutions out there that requires some software to make tests and even require to install something on the server. Those solutions are not what I'm looking for, as I just want a simple measure of... |
Today I was asked this interview question and could not answer.
If you have two instances of a Person class which has a setAddress method that is synchronized. Now if it was only one object and multiple threads were accessing it, the synchronized will make sure that only one method can access it at a time.
But if there... |
I've done a spot of Googling, and all I can find is information on using code under the MPL in a larger GPL licensed project.
What I really want to know is: can I included GPL(v3) licensed code(/binaries) in a larger MPL(2.0) licensed project?
My understanding so far is that I can't, and that any project which uses GPL... |
In Java, I'm used to declaring collections using the most-abstract interface possible and then constructing them using the concrete implementation that makes sense at the time. It usually looks something like this:
public class MyStuff {
private Map<String, Address> customerAddresses;
private List<ToDoItem> tas... |
I have just started learning about recursion but I'm having a hard time understanding it. Please would you recommend any links or books that explain recursion in detail.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.