instruction stringlengths 34 19.9k |
|---|
I'm working on a realtime multiplayer game using Django and gevent-socketio, I'm facing some issues:
I need to send an update of the game state to connected players every X seconds (~4 seconds), so basically I need to execute a function every x seconds which does some calculations and sends the connected players the ne... |
From the Blink Blog:
Finally we’d like to explore even larger ideas like moving the entire Document Object Model (DOM) into JavaScript.
What does this mean? Does it mean WebKit's DOM is currently not coded in JavaScript but in some other language? Does it mean that they want to expose more public accessors to the DOM... |
I've been studying http://www.vagrantup.com/ for several days and I'd like a feedback by people using it in a professional context or for personal projects. I think I get what positive things can bring Vagrant but I have questions about its drawbacks:
I'm a php developer and I work in a small company. I'm wondering if... |
I'm currently planning a new ASP.NET MVC3 project which will be quite bespoke. However, there will be a lot of common features (login, profile edit, blog etc).
Initially I was planning on building this all from scratch, however I'm tempted by CMS so that I'm not reinventing the wheel, and don't waste time building stan... |
I am working in C++ and I have this problem.
class Container {
Container(int which_type_to_use_a_b_or_c);
A & getData(A & prototype);
B & getData(B & prototype);
C & getData(C & prototype);
private:
A a;
B b;
C c;
int type_used;
}
Only one of the A,B or C datatypes is actually used in a clas... |
Somewhere I read Spring offers convenience over configuration. But Spring folks are bringing in so much changes over the configuration , that I am now really getting confused to use the xml configuration or the annotation.
I would like anyone to suggest a surefire methodology or rule of thumb in using xml and annotatio... |
I'm currently on a medium-sized team of web developers. We're using jira for bug tracking.
We're working on a product with frequent layout changes. A lot of times bugs are filed about a bug in the layout in some browser. Sometimes, by the time we get around to dealing with a low priority bug, the layout has already cha... |
I'm trying to improve my OOP code and I think my User class is becoming way too fat.
In my program a user has rights over "lists". Read, Write, Update, Delete.
So I made a User class
class User
{
protected $_id;
protected $_email;
protected $_username;
protected $_hashedPassword;
//...Various setters/getters
public f... |
In both algorithms objective functions, that will be executed with non quantum computers, are used. Both algorithms are methods for finding the global minimum of a given objective function.
From wikipedia:
Quantum annealing can be compared to simulated annealing (SA), whose "temperature" parameter plays a similar ro... |
What would be the best approach to resetting a mobile app's content/settings?
Let's say the app is cross platform: iOS/android using javascript/phonegap. The current way this is designed is to have an admin area that can see mobile devices (users which have logged in). The admin has the ability to flag a device for r... |
I've recently had doubts about some design decisions that I frequently make, so this time I decided to take some time and try to analyze it to find the best solution. I will describe a simple scenario where the design decision can be easily understood. :)
Suppose we are developing a game in Java where players can have ... |
I have an existing website theme that I have built. I've been using github to maintain this theme, let's call it dragon. We are changing the theme entirely but we're using the existing theme as a foundation. Should I create a new github repository for the new theme? Or should I just continue pushing to the dragon repo?... |
I've been doing a lot of reading online trying to figure out how to write asynchronous JavaScript code. One of the techniques that has come up a lot in my research is to use callbacks. While I understand the process of how to write and execute a callback function, I'm confused why callbacks seem to automagically make t... |
Has anyone ever come across this problem?
When you have a team of developers working on a project, how can you measure their contributions to said project? Is there a "formal" way of doing it? Number of commits? Number of bug fixes? Lines committed? Or maybe on a ticket basis?
I'm trying to think of a workflow where ... |
I want to build three sites in PHP. I'm doing this as slowly, thoughtfully and carefully as I can, to learn as much about things like OOP and software architecture as possible.
From past experience I already know there will be a time when I will be glad to have logging functionality. I probably want to have different t... |
I am about to port a game that was initially written for iOs and I am having some doubts how certain things should be done.
I have been looking many of the examples of the game loops for android, and almost everywhere the game loop is designed to run in separate thread and not in main UI thread which seems fine and log... |
We have a function that modifies a JS object, by adding some custom properties to it. The function doesn't return antyhing
addTransaction: function (obj) {
obj.transactionId = this.getTransactionId;
obj.id = this.recordId;
},
Somebody said they preferred that addTransaction return the obj.
Here's what I thou... |
I'm having some issues with my Nexus 7 drawing just 500mA from a USB port able to supply 2.1A (test with my iPad). Details in this question. However, there is a comment posted "The Nexus obviously detects the 'data' pin connected, and assumes it is not permitted to draw more than 500mA (which is the proper USB spec)."
... |
I have the following classes that I want to store.
public class StorableObject
{
public string Id { get; set; }
}
public class User : StorableObject
{
public string Name { get; set; }
}
public class Project : StorableObject
{
public string Name { get; set; }
public User Owner { get; set; }
public ... |
I am designing an open source Java library that I will likely release with an MIT license, and its sole dependency is the ASM dynamic bytecode injection library.
According to their license:
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in... |
Programmers often talk about the time complexity of an algorithm, e.g. O(log n) or O(n^2).
Time complexity classifications are made as the input size goes to infinity, but ironically infinite input size in computation is not used.
Put another way, the classification of an algorithm is based on a situation that algorith... |
I'm developing a WordPress theme and am planning to sell it myself. I was thinking of having a 14- or 30-day refund policy for customers, but my concern is that people can essentially get the theme for free, if they: 1) buy it, 2) download the files, and then 3) request a refund. Then they would have both the theme and... |
Which open source java projects do you know to be high performance or real time performance? I tried hard to find them on github or google, but couldn't find suitable.
I want to learn from this projects, so will not be as a newbie on my interviews ;)
So far I am going to stick to Play Framework project.
Are there bett... |
From that question about differences between Quantum annealing and simulated annealing, we found (in comments to answer) that physical implementation of quantum annealing exists (D-Wave quantum computers).
Can anyone explain that algorithm in terms of quantum gates and quantum algorithms, or in physical terms (a part o... |
I have branched from my develop branch bugfix/issue2 to work on a bugfix. Now that it's done I want to merge this branch bugfix/issue2 back onto develop but it's asking me if I want to merge into my current branch. And I don't know if my current branch is develop?
See attached screendumps:
|
Could someone explain the rationale, why in a bunch of most popular languages (see note below) comparison operators (==, !=, <, >, <=, >=) have higher priority than bitwise operators (&, |, ^, ~)?
I don't think I've ever encountered a use where this precedence would be natural. It's always stuff like:
if( (x & MASK) ... |
Question
What are the possible ways to solve a stack overflow caused by an recursive algorithm?
Example
I'm trying to solve Project Euler problem 14 and decided to try it with a recursive algorithm. However, the program stops with a java.lang.StackOverflowError. Understandably. The algorithm indeed overflowed the stack... |
I am confused when I read this (regarding singleton design pattern):
How do we ensure that a class has only one instance and that the instance is easily
accessible? A global variable makes an object accessible, but it doesn't keep you from
instantiating multiple objects.
So what is the use of singleton pattern ... |
We have several years of customer data that has been collected over time. I'd guess that 95% of the data (Names, Business Names & Addresses) is in all UPPERCASE format.
The data entry tool used within our organization offers an "Export as Proper Case" function. We do not have the ability to modify this data import fun... |
The Situation
I'm currently working in project that develops several RESTful services that partly interact with each other. As an example:
Service A uses Service B
Service C uses nothing
Service D uses Service C
most of the Services use a common Utillities project.
There is NO actual code sharing between the service... |
I haven't come across this issue before and can't find it in my Schaum's Outline UML book and was wondering if someone here could help.
I'm making a use case diagram for e-commerce, and in it I want to describe that in order to add a book to your shopping basket, you have to either search products (using the websites s... |
In my opinion, one of the greatest things about Scala is its interoperability with Java and its similar syntax. One thing that I found strange is the use of the _ operator for package wilcard imports instead of the * operator that is used in Java.
Is there a technical reason for using _ instead of *? If not, then why w... |
When I remote connect to my work PC, in IE10, the juniper remote client service which is basically a plugin executed in the browser does not run. I need to turn on compatibility view to see it. My question is what exactly is happening behind the scenes in compatibility view such that such a large number of compatibilit... |
I have a company intranet that utilizes a similar set of data across many different pages and many different methods.
Speaking in generalities, is it closer to "best practice" to retrieve a large dataset and filter it for each specific page or method or retrieve many smaller specific sets of data to use? I cannot real... |
I am reading Cristopher Alexander's "Notes on the Synthesis of Form", and he is describing a solution to a problem as having good fit, when there is an absence of bad fit; we can't describe all of the qualities of good fit because it's too complex, but we can identify the bad qualities that stick out.
The complexity of... |
I am designing a flexible and extensible way to store configuration settings for users.
Database Table Design:
╔═════════════════════════════╗
║ ConfigurationItemDefinition ║
╠═════════════════════════════╣
║ ID ║
║ Name ║
║ Type ║
║ Default... |
I'm currently beta-testing an iPhone app. Right now I have sent out the first beta-test for my users and I have labeled that release as 1.0 for my testers.
Now since the testers have tested the app we have discovered some bugs that I have fixed and I'm ready to send out a new beta-test for my users. Should I label the ... |
At our company we have started outsourcing some of our development.
This has worked somewhat well. However, we are having a hard time getting them to properly use version control. They are familiar with SVN and know how to use it. However, for some reason they don't commit regularly, instead they work with 16 things s... |
Why do some object oriented languages let the programmer use primitive data types?
Aren't classes like Integer, Boolean, etc. enough?
|
I recently started using the Object aid UML generator plugin for Eclipse and noticed that by default adding of dependency relationships is switched off.
This made me wonder if in most cases they should not be shown or rather that most people don't want to show them, seeming as this is the default setting.
How do I deci... |
I read some stuff like cm bell labs but i couldn't get it all. How does it work really? What is the logic in that?
|
A little background on where this question is coming from. In my current .NET application I'm working on some features related to archiving a certain type of business entity called a "Project". Depending on the situation what has to be archived, and the exact actions involved in archiving can vary wildly. My basic idea... |
I've been using Reactive Cocoa (by GitHub), a Functional Reactive Programming API for use with the Cocoa libraries for a while now, but have just read "Out of the Tar Pit", the paper that supposedly presents the concepts behind it, and I am a little confused.
The paper presents (as I understand it) Functional Relationa... |
what is LPCTSTR and LPCTSTR-like (for instance HDC) and what it does stand for?
|
I've been working in the same software development department for a few years now. In that time, the average stay of a developer has been 6-9 months. A handful have been around for over 2 years, but the majority of our 20 or-so developers come and go at a relatively high rate.
As a result, the majority of our project... |
I have worked for various organizations many of whom call their environment that comes after the test/developer environment and before the staging and/or production environment either model or QA.
They all seem to use this term interchangeably, however, is there any technical difference or should there be a difference ... |
What is the best and most efficient way to set up two versions of the same website?
I want one version that is online and open for everyone to use but I also want a developer version where I can develop and test new things instead of doing that against the ftp.
Currently I have MAMP setup on my developing machine and I... |
I had learned that following piece of code is bad because it is obstrusive javascript and mixes presentation with logic:
<a href="" onclick="archive()">archive</a>
The best practice was to add some sort of identifier to the link element and then bound an event to it on a separate file. Something among those lines
$("#... |
I recently learned that when merging two branches in git, if there are changes on two adjacent lines git declares this a conflict. For example, if file test.txt has this content:
Line 1: A
Line 2: B
Line 3: C
Line 4: D
and in branch master we change this to
Line 1: A
Line 2: B1
Line 3: C
Line 4: D
while in branch te... |
Question:
Can a mere entry level programmer become a mid or senior level programmer working in a company as the only programmer without a mentor?
Background:
I was hired as an entry level programmer for a mid size company that does not do programming except for internally. I am regarded as a genius inside the company ... |
So I have a quick question about the linear probing method of collision resolution in hash tables. So by definition a linear probing method would look like:
while (hashTable[hash] != null)
hash = (hash(key) + step) % tableSize;
But in my case I know exactly what the table size will be, I know all the keys, so I'm ... |
I am hoping this is the correct stack exchange to be asking this, here goes.
I am building a new website whereby it implements its own custom login system. You simply register your username, email password etc. Then you're free to log in with the option of clicking "remember me" to save the hassle of logging in every t... |
I need to develop an algorithm for finding all the local maxima in a two-dimensional array: how to search for local maxima in the the most efficient way? Are there algorithms about it?
Moreover, the algorithm should be able to handle even the "flat" peaks, that is it should find the central coordinates of each peak. He... |
I am looking for an explanation on just why XML needs to be validated. I have been testing DTD's and Schema's for the past month and recently tried to find out why I am doing this. I know it makes the XML better and more Semantic but what are the overall benefits of validating XML?
|
I know there are similar questions to this one, and I've read most of them. Most of the answers to these questions are talking about "cost-effectiveness" and "time-saving" aspects of the frameworks, which are huge reasons in favor of using frameworks.
I'm a pretty new .NET developer and I'm trying to learn stuff like W... |
I'd like to know if it makes sense to divide the project I'm working on in two repositories instead of one.
From what I can say:
Frontend will be written in html+js
Backend in .net
The backend doesn't depend on frontend and the frontend doesn't depend on the backend
The frontend will use a restful api implemented in ... |
I have a Person class with a one to many relationship to Employment. A Person in the CRM can have multiple Employments (historic data).
My current REST URI for this class looks like this:
http://domain/persons GET [collection]
http://domain/persons/{id} GET [resource]
http://domain/persons/{id}/employments GET [collect... |
I' creating a client server application in which I need to update a particular database. I'm using python with MySQL. There are two options:
I use a client.py and server.py, the client.py can send data packed into JSON to the server, the server.py will handle the database and send query data back in the form of JSON.
T... |
I'm working in a small team with up to 5 (web)developers. Because our team is growing frequently and we ran into problems with multiple people working on the same code we decided to set up a VCS.
Current Situation
Currently we are working with a central development server (LAMP). So every developer works on the same co... |
I am a mathematics student and am just starting to learn about programming. I am stuck on a particular program I am trying to write for fun. I want to find an algorithm to create all possible column vectors of size N containing only ones and zeroes and combine them in one large matrix by putting all the columns after e... |
I am wondering if it is reasonable to write closed source, paid web apps in Javascript (JS MVC Frameworks like AngularJS, Backbone, Knockout, ...)? I'm concerned because in this type of frameworks you use typically a REST backend for CRUD operations and the majority of business and application logic happens in Javascri... |
I'm reading 97 Things Every Programmer Should Know, now I'm positioned in "Apply Functional Programming Principles", and there is a paragraph that says:
...A leading cause of defects in imperative code is attributable to
mutable variables. Everyone reading this will have investigated why
some value is not as expec... |
I'm maintaining an open source framework (in Python on *nix platforms if that matters) for the first time in my life. It is pretty much pre-alpha, not much more then a scientific proof of concept, yet. But it is also already used in production by another department because it is the only framework globally that approac... |
What's the most secure method of performing authentication in a single paged apps? I'm not talking about any specific client-side or server-side frameworks, but just general guidelines or best practices. All the communications are transfered primarily through sockJS.
Also, OAuth is out of the question.
|
I am stuck on the following problem. I want to find an algorithm that finds all possible permutations of a certain numbers of distinct digits and then put them in a large matrix for instance. For instance for the digits 0, 1 and 2 I want to get the matrix:
2 1 2 0 1 0
1 2 0 2 0 1
0 0 1 1 2 2
Here they are in order but ... |
Pretty straightforward, was wondering what the inspiration or precedent for the CSS 'float' concept. I'm not familiar with any other graphic APIs or other layout DSLs that use this concept, but it's such a huge part of HTML layouts. I'm curious if a previous language had a similar concept, or if 'floats' originated fro... |
I plan to get a PhD in CS, concentrating in some subfield of artificial intelligence, not sure which one at the moment. I'm looking into R&D departments in industry, but there don't seem to be too many.
For example, I have literally found hundreds of labs for the basic sciences and other engineering fields, but for CS... |
Our test automation team writes tons of automation tests for our WEB application, but it seems to me that their code is becoming way too complex and warrants that someone will test it as well.
Is there a best practice for writing these automation tests?
I'll appreciate any answer with concrete inputs from someone who... |
I know the definition of an testing oracle but to me, it seems to be overrated. I have a specification, why should I bother with thinking about oracles? I just compare what the spec wants and what the program does. Or I have the use cases, whatever. When I read about oracles in books, it looks as if it a science on its... |
Let me start with a disclaimer: I'm not the best programmer out there. I do however study I.T. and learnt a bit of Java and C.
I'm getting stuck into Python and Django + Mongoengine, I'm not going to explain it into detail as it will deviate from the original question.
While trying to understand what is happening at th... |
In projects with many use cases, it's valid to create different use case diagrams, one for each screen? Or I shouldn't guide myself on the GUI of the software to make this, why?
As a clarification, the software does already exist, and I'm just documenting it for my undergraduation final project.
|
There seems to be two major ways to set up a web server backend. You can use a LAMP stack, with the server-side code in something like PHP or Python (or Ruby or JavaScript, which don't start with a P.) These scripting languages tend to be dynamically typed, with all of the disadvantages in performance, correctness an... |
I'm designing a financial system that should grant access to data based on roles and privileges. For example, a manager can see the financial transaction of users under his domain but not information regarding other transaction. Although it's possible to implement ad-hoc I was wondering if there are patterns or guideli... |
...or, in other words: When sending a mail programmatically, do I really need to go through the hassle of setting the correct MIME type or can I just use application/octet-stream?
The mail clients I tested all do "the right thing" based on the file extension, even if the MIME type is just the generic application/octet-... |
Someone has asked me this question and I couldn't answer as I am not on the web part of development so I'm asking here.
If one has just finished college and is trying to break through into web development/web-design a portfolio of already developed projects/sites seems to be essential to me for going to interviews.
Wha... |
I have an ASP.NET MVC4 application. Suppose that I wanted to execute some code (such as emailing a user) 2 days after a user has signed up.
One way is to have code executed on every request which scans the database for users and their sign-up time and execute code based on that. This seems messy and it depends on peopl... |
When using a non-MVC service-oriented/Interactor pattern approach to decoupled system architecture, how is session state implemented?
I've been thinking of building the frontend of an application using MVC (PHP/Ruby etc.), and send messages to a command-line backend which is the actual application. Since I want the off... |
We have a large team of developers and testers. The ratio is one tester for every one developer.
We have full bug tracking and reporting systems in place.
We have test plans in place.
Every change to the product, the testing team is involved in the design of the feature and are included in the development process as mu... |
I'm looking at using Go (aka golang) for a project (a SQL database, but that mostly doesn't matter here) where performance is critical, but under low load the primary bottleneck will be I/O to disk. In this case, I think Go would be great!
Under high load or while hitting cache a lot, CPU and memory utilization will in... |
Many programmers know the joy of whipping up a quick regular expression, these days often with help of some web service, or more traditionally at interactive prompt, or perhaps writing a small script which has the regular expression under development, and a collection of test cases. In either case the process is iterat... |
Which reasoning would you follow to choose one license over another? Which literature would you expect someone to read, if he wants to make a meaningful decision about licensing?
I specifically don't go too much into detail about my current project, because I am looking to learn how to make this decision correctly with... |
Is it possible to host a long-running worker inside ASP.NET application? The worker (for it's a windows service) is reading from a queue sending messages to a WCF service.
Would it be possible to run this "light long-running worker" inside an ASP.NET application? I read about setting pool start mode to "always running"... |
I'm working on an ambitious, commercially-driven open source project* (it probably falls under Wikipedia's definition of Open Core). I'm an engineer on the project, so I don't have too much sway over all of our policies.
The majority of the code is in public projects on GitHub, and we have public mailing lists, but th... |
As an educational exercise, I am looking to implement a constraint solver from scratch. However, since the field is entirely new to me, I am at a loss of where to begin with background research.
The problems I aim to address are mostly sets of inequalities, such as a < b && b < c, where a, b, c are integers. (While it ... |
I was recently asked as an exercise to design a scalable graph.
My first intuition was how to seperate the graph and distribute it (sharding,consistent hashing..etc)
Turns out my thinking was on the wrong line, I know what scalability is, but it seems it is a bit hard to think about it pragmatically.
What is the prag... |
While solving any problem, we write algorithms. Some efficient, some not, some work, some fail. But sometimes we end up writing something which is mostly a success when we do a dry test run, perhaps, the way we frame the test data is prejudiced, but the algorithm fails in some other cases.
For some algorithms , the nat... |
I like to think I write good maintainable Java code, using best practices, design patterns and try and get good test coverage with unit tests.
Recently whilst looking for a job, I came across a couple of job adverts that have references to "scalable" code.
So, my question is, what is considered to be "scalable" code?... |
I'm using Ninject, but this is not a Ninject-specific question. I'm wondering if the advanced and flexible capabilities of the IoC container are giving me enough rope to hang myself with a bad application design.
I've got a service interface:
public interface IBuilderService {
IBuilder Create(string category, strin... |
I'm creating a website that is going to aggregate women shoes from across the web into one website. Kinda like polyvore.com does with all their products but mine is only going to be shoes. Which makes my job a lot easier but I'm still lost as to how I go about getting all the data.
I have access to 3 APIs so far. Whi... |
I was writing this code:
private static Expression<Func<Binding, bool>> ToExpression(BindingCriterion criterion)
{
switch (criterion.ChangeAction)
{
case BindingType.Inherited:
var action = (byte)ChangeAction.Inherit;
return (x => x.Action == action);
case BindingType.Exp... |
To explain what I mean, let me start with an example.
Consider a deque that supports O(logn) concatenation with another deque and O(n) addition of n elements at one end. This dequeimplements a general seq interface (or type-class, or what have you) that allows iterating over a collection.
An explicit optimization appr... |
Is there a technical name for a software project where the current and prior stable releases are both maintained?
|
I saw a video about random numbers and how the programmer in that video was talking about computers generating pseudo random numbers and that they are not really random. I knew about this.
Then he showed the decay of a radioactive material to generate random numbers where he claimed to be truly random. Is there really ... |
I'm looking for a reference to clean coding styles that I can pass to a team member.
In particular, the rule that a method should not change its return type based on an input parameter. If you need different output, use a different method.
Example:
$invoice_items = getInvoiceItems();
$total = getInvoiceItems( T... |
I'd like to create something similar to what you see here...
http://www.houzz.com/ideabooks/9424693/list/8-Beautiful-Ways-to-Work-Glass-Into-Your-Kitchen-Cabinets
If you click on the second photo down, youll notice it has a bunch of tags, linking to actual products, or just descriptions of products.
Is this done using ... |
We're thinking of using some open-source MIT-licensed software in one of our web projects (a jQuery datetime plugin).
The first line of the MIT licence is:
Copyright (c) [year] [copyright holders]
If we include the plugin as-is (without making any changes), I understand we need to include the licence with only the o... |
Are there any best approaches for refactoring a programming project that has previously been written with the static reference anti-pattern (the majority of classes refer at some point to a static bean, where all of it's variables are public.
Half-way through a class, for instance you'll see something like:
EvilClas... |
There is a new hype with the long awaited lambda expressions in Java 8; every 3 day another article appears with them about how cool they are.
As far as I have understood a lambda expression is nothing more than an anonymous inner class with a single method (at least at the byte-code level). Besides this it comes with... |
We are building an accounting web application. In our database, we store basic data about our customers, like phone number, their login informations, because these things are tied into our web application. Now we need a CRM system to do things like sending marketing mails to users who signed up, but never used the serv... |
Sometimes, I notice typos in articles (blog posts) or books in source code that appears in the body of the article. It may be an indication that the code has been manually copied and pasted (e.g. missing braces ), or that something nasty happened to the text.
How may I write an article inside the source code of a proj... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.