instruction stringlengths 34 19.9k |
|---|
Consider the following generic class:
public class EntityChangeInfo<EntityType,TEntityKey>
{
ChangeTypeEnum ChangeType {get;}
TEntityKeyType EntityKey {get;}
}
Here EntityType unambiguously defines TEntityKeyType.
So it would be nice to have some kind of types' map:
public class EntityChangeInfo<EntityType,TE... |
I am having trouble understanding the OOP Polymorphic principl of Dynamic Binding ( Late Binding ) in Java. I looked for question pertaining to java, and wasn't sure if a overall answer to how dynamic binding works would pertain to Java Dynamic Binding, I wrote this question.
Given:
class Person
{
private String n... |
I'm considering developing a real-time multi-user game, and I want to gather some information about possibilities before I do some real development. I've thought about how best to ask the question, and for simplicity, the best way that occurred to me was to make an analogy to the field (or playground) game darebase.
In... |
I was referred here from stackoverflow as my question was apparently too broad.
I'm working on a template, and I know using CSS is preferred over HTML tables for positioning... But, is it acceptable to get the best of both worlds and use table-like styles on my divs? For example:
display: table;
This not only helps so... |
Are Scrum and XP comparable things or are they used for different things? what is the main features of each of them? how do they overlap?
I've been reading about both XP and Scrum over the past weeks and something is vague about them for me. Scrum does have a definitive official rulebook but for XP I'm not sure where t... |
I have gone through lots of theories about what is encapsulation and the three techniques of implementing it, which are Association, Aggregation and Composition.
What I found is:
Encapsulation
Encapsulation is the technique of making the fields in a class private and providing access to the fields via public methods. I... |
I am developing a web application and have the app deployed into Tomcat server. Tested on IE and Firefox and are working fine. Meaning when I close the browser and reopen the app, the data will be reset. When deploy to Websphere, the data is reset only in IE but Firefox don't. Meaning Firefox will cache the old data. I... |
Today we tried to introduce BDD in our software development process by having a specification workshop.
For this workshop we had 2 developers, 1 tester and 1 business analyst. The workshop lasted 1h30 and by the end of it we managed to figure out some BDD scenarios for our new feature.
We tried to focus on finding the ... |
I was wondering if anybody can point to a post, pdf, or excerpt of a book containing the rules for C++ variable life-times and best practices for passing and returning function parameters. Things like when to pass by value and by reference, how to share ownership, avoid unnecessary copies, etc. This is not for a partic... |
I'm building online examination system. I have designed to table, Question and GeneralExam. The table GeneralExam contains info about the exam like name, description, duration,...
Now I would like to design table GeneralQuestion, it will contain the ids of questions belongs to a general exam.
Currently, I have two idea... |
As my current Java projects grow bigger and bigger, I feel a likewise growing need to insert debug output in several points of my code.
To enable or disable this feature appropriately, depending on the opening or closure of the test sessions, I usually put a private static final boolean DEBUG = false at the beginning o... |
My question, at the bottom line, is what is the appropriate(best) way to manage our connection towards MySQL db with C#.
Well, currently I'm working on some C# (WinForms type) <-> MySQL application and I've been looking at Server Connections in MySQL Administrator, been witness of execution of my MySQL queries, connec... |
We are starting an Agile project, and the product owner has made a start adding user stories to the product backlog (mostly epics at this stage).
Who would be responsible for breaking down epics into smaller user stories - is it left to the product owner, or would you expect the rest of the team to be involved (bearing... |
I'm having some trouble finding a proper solution to the following architecture problem.
In our setting (sketched below) we have 2 data sources, where data source A is the primary source for items of type Foo. A secondary data source exists which can be used to retrieve additional information on a Foo; however this in... |
I am currently using the Google-Gson library to convert Java objects into JSON inside a web service.
Once the object has been converted to JSON, it is returned to the client to be converted into a JSON object using the JavaScript eval() function. Is the character escaping provided by the Gson library enough to ensure t... |
We're currently reconsidering technologies and frameworks to get more agile with "simple" RMS CRUD-based projects. In short, short-living things like this
Right now we have a custom extension on top of SmartGWT but after some time it has proven not to be flexible enough.
I also personally dislike the java-js compilatio... |
I'm a programmer but also have worked as an archivist. As archivist it's a lot about keeping data.
I often get into arguments with colleagues when it comes to operations on data. I don't like the U and the D in CRUD too much. Rather then update a record I prefer to add a new one and have a reference to the old record. ... |
I want to write a test for a method that accesses a database such as following.
public class MyClass{
public String getAddress(Int id){
String query = "Select * from Address where id="+id;
//some additional statements
resultSet = statement.executeQuery();
return result.ge... |
I work at a large company where technical people fall roughly in one of these categories:
A developer on a scrum team who develops for a single product and maybe works with other teams that are closely related to the product.
An architect who is more of a consultant on multiple teams (5-6) and tries to recognize com... |
I'm tasked with developing an SSO system, and was guided towards using the SAML spec. After some research I think understand the interaction between a Service Provider and an ID Provider and how a user's identity is confirmed. But what happens when I redirect the user to another Service Provider? How do I ascertain the... |
Assume that I planned to write a class that worked something like this:
public class GameCharacter {
private Collection<CharacterEffect> _collection;
public void Add(CharacterEffect e) { ... }
public void Remove(CharacterEffect e) { ... }
public void Contains(CharacterEffect e) { ... }
}
When added an... |
I am bit frustrated at the lack of information about this online. Here is the issue:
I am in charge of creating a iOS application which sends sound data back and forth between the server and the app. The Audio is in small files and thus does not need to be streamed over, but rather it can be sent. Right now, I am using... |
I am confused about it.
I can use lucene to create index and run query against file system.
I can find any particular file very fast, if I can provide a primary key, in this case, directory path and filename act as primary key.
It looks very much like a NoSQL.
|
I am a good programmer, or so I thought before. I always love to program. And I want to learn many things about programming to make me a better programmer. I studied programming for 1 year and now I am working as a programmer for almost 2 years. So in short, I have almost 3 years programming experience.
Our team is com... |
Assume these threads run in single core cpu. As a cpu only run one instruction in one cycle. That is said, even thought they share the cpu resource. but the computer ensure that one time one instruction. So is the lock un-necessary for multiplethreading?
|
Based on answers I have received here and then confirmed in some authoritative sources (not ISTQB which seems to be too vague), there are 3 activities:
Static analysis
Dynamic analysis
Testing
But is there any reason why we cannot combine all of that as "testing"? I mean, even a dynamic analysis review of a pro... |
I'm creating a demo web app in html in order for people to physically see and comment on the app prior to committing to a proper build.
Whilst the proper app will be database driven, my demo is just standard html with some JavaScript effects.
What I do want to demonstrate is that different user group will see different... |
I'm writing a c10k-style service and am trying to evaluate Clojure's performance. Can Clojure agents handle this scale of concurrency with its thread-based agents? Other high performance systems seem to be moving towards async-IO/events/greenlets, albeit at a seemingly higher complexity cost.
Suppose there are 10,00... |
To integrate with other executables, a executable may launch another executable and capture its output from stdout.
But most programs writes the output message to stdout in custom format and usually in human readable format.
So it requires the system integrator to write a function to parse the output, which is consider... |
Looking at this page that aggregates the current NoSQL landscape, one can see that the majority of these projects are written in Java.
Databases are complex systems software dealing with the file system, and so C/C++ would be a better choice than Java for this. (that's my thinking which might be flawed)
Secondly, datab... |
Given a web application running across 10+ servers, what techniques have you put in place for doing things like altering the state of your website so that you can implement certain features.
For instance, you might want to:
Restrict Logins/Disable Certain Features
Turn Site to "Read Only"
Turn Site to Single "Mainte... |
Why don't we have a lot of good web-based IDEs? Which aspects of the system make it difficult for IDE to be implemented as a web application?
|
I read on various sites about licenses.
I did just put the license type in the header file (in my case a javascript file, open-source):
/*
* "codeName" "version"
* http://officialsite.com/
*
* Copyright 2012 "codeName"
* Released under the "LICENSE NAME" license
* http://officialsite.com/LICENSE NAME
*/
javasc... |
I was wondering if ffmpeg supported gpu acceleration. I was reading on their websites and came across contradicting information.
http://www.ffmpeg.org/general.html#Video-Codecs
-H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (VDPAU acceleration)
http://ffmpeg.org/trac/ffmpeg/wiki/x264EncodingGuide
-Will a graphics card mak... |
As the jdk doc said, ConcurrentHashMap is thread safe and it doesn't block multiple thread read. It is not necessary to doubt that since it was under many and restricted test. But I just curious how to tell and write code to verify that.
Edited: to be more precisely
how to keep read consitent without read block
does ... |
I have been learning Objective-C, noting that different books and examples use differing conventions for the location of the star (*) when naming reference variables:
MyType* x;
MyType *y;
MyType*z; // this also works
I see the first two used interchangeably, and sometimes in the same code I've seen differing uses of ... |
I am learning OpenGL API bit by bit and also develop my own C++ framework library for effectively using them. Recently came across Blender software which is used for graphics creation and is in turn written in OpenGL itself.
For my part time hobby of graphics learning, I want to just create small-small movie or video s... |
i'm looking for a framework to build a webserver. This server will be used to manage webservices. huge amount of client may be able to connect to principally set data which will populate a noSQL DB. we work with python and naturally we would like a python framework. i looked at bottle, gevent, twisted and tornado but i... |
In particular, this is about game extensions written in lua (luajit-2.0). I was contemplating whether I should restrict what these scripts can do, and arrived at the conclusion that I probably shouldn't:
It's hard to get right. Sounds silly, but chances are my sandbox is gonna end up leaky anyways.
The only benefit I ... |
I'm currently working on a project where I'm writing the firmware for an electronic system in C, and have been asked to produce documentation on the development/evolution of the software for the embedded devices. Having developed software in the object oriented paradigm I know to use UML to document the software such a... |
I am a learning algorithm analysis and came across a analysis tool for understanding the running time of an algorithm with widely varying performance which is called as amortization.
The autor quotes
An array with upper bound of n elements, with a fixed bound N, on it size. Operation clear takes O(n) time, since we s... |
I am a bit confusing and I need your help to undertand my problem.
I have developed a web application (PHP, JQuery) for one of my customer.
Recently, my customer ask me to add a new feature permitting PDF to JPG conversion.
After web browsing, I have discovered that iMagick (Apache licence) PHP extension with GhostSc... |
I am a very mathematically oriented programmer, and I happen to be doing a lot of java script these days. I am really disappointed in the math aspects of javascript:
the Math object is almost a joke because it has so few methods
you can't use ^ for exponentiation
the + operator is very limited, you cant add array's o... |
I write a lot of (primarily c++ and javascript) code that touches upon computational geometry and graphics and those kinds of topics, so I have found that visual diagrams have been an indispensable part of the process of solving problems.
I have determined just now that "oh, wouldn't it just be fantastic if I could so... |
How is the Morse Code representation of a letter determined?
"E" = "."
"T" = "-"
Why is it not alphabetic? As in let "A" = ".", "B" = "-", "C" =".-", etc.
I'm trying to develop an algorithm for a traversing Binary Tree filled with these letter.
My main aim is to search for a letter, like "A", but I don't know what cond... |
I'm wanting to share an authentication implementation across a web application, and web API. The web application will be ASP.NET (mostly MVC 4), the API will be mostly ASP.NET WEB API, though I anticipate it will also have a few custom modules or handlers.
I want to:
Share as much authentication implementation between... |
I am making a card game for Android where a player can choose from a selection of cards to build a deck that would contain around 60 cards. Currently, I have the entire database of cards created that the user can browse.
The next step is allowing the user to select cards and create a deck with whatever cards they would... |
I'm working on a browser based open source monitoring project that I want to be free to the community.
What I'm worried about is someone taking the project, renaming it, deploying it in the cloud and start charging people who don't even know my project exists. I know I maybe shouldn't mind, but it just sticks in my thr... |
I'm trying to find out your decision rationale of when to do what. I'm happy to provide more context, but I want to make it general for now.
|
Suppose that I have a class that implements some logic:
public MyLogicImpl implements MyLogic {
public void myLogicMethod() {
//my logic here
}
}
and somewhere else a test class:
public MyLogicImplTest {
@Test
public void testMyLogicMethod() {
/test my logic
}
}
I also have:
@WebSe... |
I'm sixteen, I'm overly interested in programming, and I'm currently taking IT classes during my mornings in high school. Last year, I tried teaching myself to code. It was quite exciting, but all I did was watch TheNewBoston's videos on YouTube for Python.
After his tutorials, I just did research, made some CMD progr... |
I am currently trying to improve my use of exceptions, and found the important distinction between exceptions that signify programming errors (e.g. someone passed null as argument, or called a method on an object after it was disposed) and those that signify a failure in the operation that is not the caller's fault (e.... |
So, I used to think that it would be a good idea to give the customer access to the issue tracking system, but now I've seen that it creates less than ideal situations, like:
Customer judging progress solely on ticket count
Developers denied to add issues to avoid customer thinking that there is less progress
Customer... |
I'm developing a commercial application that largely depends on the functionality of a library that will be developed with it. I'd like to open-source this library, because it offers functionality that is not found elsewhere and can be useful in other applications.
However, I will also use it in my own commercial appli... |
I've just read an excerpt of "Growing Object-Oriented Software" book which explains some reasons why mocking concrete class is not recommended.
Here some sample code of a unit-test for the MusicCentre class:
public class MusicCentreTest {
@Test public void startsCdPlayerAtTimeRequested() {
final MutableTime sched... |
I have a service endpoint initialized using DI. It is of the following style. This end point is used across the app.
public class CustomerService : ICustomerService
{
private IValidationService ValidationService { get; set; }
private ICustomerRepository Repository { get; set; }
public CustomerService(IVa... |
I have just started a C programming course and so far have only done the basics like printf, read a little on variables etc on the course book. The teacher has tasked us with writing a program that will take a value entered by the user, this will be the number of students in the class (25 at the moment but can be vari... |
While writing some predicates for collection filtering I have stumbled over the choice of the right words for the relation of the subject and the predicate (English is a foreign language for me). What I ended up writing was "Subjects matching this predicate..."
This seems to be incorrect, since predicates are functions... |
It is often necessary to spend time designing a solution, breaking down the design into tasks and sub tasks and estimating the time it will take to complete each task in order to produce a reasonable estimate or quote for a programming task. This process can be a serious investment of time, often without any guarantee... |
I have server with some resources; until now all these resources were requested through a browser by a human user, and the authentication was made with an username/password method, that generates a cookie with a token (to have the session open for some time).
Right now the system requires that other servers make GET re... |
I want to create a two dimensional layout of rectangular shapes, a grid made up of random sized cubes. The cubed should fit together and have equal padding or margin (space between). Kind of like a comic book layout, or more like the image attached.
How could I do this procedurally?
Practically, I would probably be us... |
Steve Yegge's The Pinoccio Problem describes a very special type of program: one that not only fulfills the original purpose of its creators, but also is capable of performing arbitrary, user-defined computations.
They typically also host a console, by which one can reprogram the software on runtime, maybe persisting t... |
I read that Facebook started out in PHP, and then to gain speed, they now compile PHP as C++ code. If that's the case why don't they:
Just program in c++? Surely there must be SOME errors/bugs when hitting a magic compiler button that ports PHP to c++ code , right?
If this impressive converter works so nicely, why sti... |
On a page twelve of "Java concurrency in practice" there is a phrase
"A good specification defines invariants constraining an object's
state and post - conditions describing the effect of its operation."
More or less I undersand the phrase untill the word "post", then it becomes a garbage.
Can you help please?
|
I'm a student working an internship at a larger company, writing small business apps in C#. I've noticed that I don't comment my code as I write it. Rather, I comment my code when I'm in the debugging stage of development. As I'm tracking down bugs, I'll run across a block that makes me think "hmm...that might confu... |
I'm wondering whether there is a performance difference between using different CSS properties to translate an element. Some properties fit different situations differently.
You can translate an element with following properties: transform, top/left/right/bottom and margin-top/left/right/bottom
In the case where you do... |
Still on my quest to compress/decompress files with a Java implementation of Huffman's coding (http://en.wikipedia.org/wiki/Huffman_coding) for a school assignment.
From the Wikipedia page, I quote:
Create a leaf node for each symbol and add it to the priority queue.
While there is more than one node in the queue:
... |
Our company's main application is a desktop program that is used at warehouses and written in C# and Windows Presentation Forms.
The next thing we want to be able to do is track when customers open up the application and when it is being used. The reason for this is so we can charge them per month, based on if they ar... |
If I take a program, and basically translate its source from some language to python, with some small changes, can I do a entirely my new lib or I have to make a "version" of the old one?
would this be a copy of the first or a new lib based in the ideas of the first?
OBS: Consider the original lib is using Apache Licen... |
We have three sets of test suites:
A "small" suite, taking only a couple of hours to run
A "medium" suite that takes multiple hours, usually ran every night (nightly)
A "large" suite that takes a week+ to run
We also have a bunch of shorter test suites, but I'm not focusing on them here.
The current methodology is to... |
We have a new developer on our team. He seems to be a smart guy (he just came in so I cannot really judge). He started with implementing some small enhancements on the project (MVC3 web application using Javascript with jQuery and Knockout).
Let's say we have two values:
A - quite complex calculation
C - constant ... |
Not sure whether this is the right place to ask this question, but here goes..
Currently I have requirement to add support for consignment transaction in our inventory module. I have a very limited understanding of what consignment means in inventory, i.e.
Customer get stocks/products from Seller without actually buy... |
I often hear the term that language A is written in language B. For example, PHP has been written C, C# is written in C++.
Can someone please explain what does that mean and if it is even correct? Does that have anything to do with the compiler of interpreter used by the language?
In addition what are the factors on wh... |
What is the most concise (yet descriptive) way of naming a subclass that only add a specific minor thing to the parent? I encountered this case a lot in WPF, where sometime I have to add a small functionality to an out-of-the-box control for specific cases.
Example: TreeView doesn't change the SelectedItem on right-cli... |
I'm trying to look up info about reading JPEG's color profile info and to my surprise there's very little open specific how-to information on that regard, but rather lots of general explanation on what it is.
Does anyone know how to find and read the color profile information from JPEG?
|
This question is inspired by the debate in the comments on this Stack Overflow question. The Google Closure Compiler documentation states the following (emphasis added):
The Closure Compiler is a tool for making JavaScript download and run faster. It is a true compiler for JavaScript. Instead of compiling from a sourc... |
I've struggled quite a bit with Eclipse and progress-monitors to try to have good progressbars which report useful progress information to the user. Inevitably the code gets cluttered with lots of things like
if (monitor.isCancelled())
return;
...
lengthyMethodCall(monitor.newChild(10));
and all over the place I... |
I want to use the .NET TPL to asynchronously do a DIR /S and search each subdirectory on a hard drive, and want to search for a word in each file... what should my API look like?
In this scenario I know that each sub directory will have 0..10000 files or 0...10000 directories. I know the tree is unbalanced and want ... |
While the core of requirements development and acceptance criteria would ideally take place during the planning meeting in order to create a better estimate, Scrum encourages continuous interaction with the product owner throughout the sprint to validate and refine user stories.
What kind of criteria is used to judge ... |
I've been a bit weary about approaching learning databases. I've dabbled into them before, and "DATA" in itself appeals to me a lot. Maintaining/searching/moving, everything about it in the abstract sense I love. (This isn't a career question, this is a learning question.)
But as RDBMS's begin to be easier to maintain,... |
I've got an web app that needs to store some non-sensitive preferences for the user. Right now I'm storing their language preference and what mode they want a window opened in by default in two cookies:
"lang" can be "en" or "de"
"mode" can be "design" or "view"
I might add a few more in the future. I'm not sure how ... |
I'm new to Haskell and I'm not really sold on the Nothing constructor. It sounds like just another silent fail that's going to create headaches down the line. It seems much more useful to throw an error so I'll have a clue what's happening.
Why am I wrong here?
|
If I have a view called, for example, ViewDetails that displays user information in labels and has a Model called ViewDetailsModel and if I want to allow the user to click a button to edit some of these details, is it considered bad practice is I pass the entire Model in the markup to a controller method which then ass... |
This has become a large frustration with the codebase I'm currently working in; many of our variable names are short and undescriptive. I'm the only developer left on the project, and there isn't documentation as to what most of them do, so I have to spend extra time tracking down what they represent.
For example, I wa... |
Let me support my question with a quick scenario.
We're writing an app for family meal planning. We'll produce daily plans with a target calorie goal and meals to achieve it for our nuclear family. Our calorie goal will be calculated for each person from their attributes (gender, age, weight, activity level).
The wei... |
Suppose I have a dictionary of ASCII words stored in uppercase. I also want to save those words into separate files so that the total word count of each file is approximately the same. By simply looking at the word I need to know which file it should be in (if it's there at all). Duplicate words should go into the... |
I've been building an android game in my spare time. It's using the libgdx library so quite a bit of the heavy lifting is done for me.
While developing, I carelessly selected datatypes for some procedures. I used a hashtable because I wanted something close to an associative array. Human readable key values. In other p... |
I am expecting a job interview for a C++, what kind of questions should I expect?
I have been programming with C for 5 years. I know what OOP is and I have been reading about it for some time. But it is most likely I can miss important details because I do not do anything real on C++.
Best Regards,
|
Does the "magic" of the JVM hinder the influence a programmer has over micro-optimisations in Java? I recently read in C++ sometimes the ordering of the data members can provide optimizations (granted, in the microsecond environment) and I presumed a programmer's hands are tied when it comes to squeezing performance fr... |
Out of curiosity, are there languages that allow you to do set arithmetic on types to create new types? Something like:
interface A {
void a();
void b();
}
interface B {
void b();
void c();
}
interface C = A & B; // has b()
interface D = A | B; // has a(), b() and c()
interface E = (A & B) ^ B; // has c()
... |
Can someone recommend a good robust "Free" testing framework for Qt?
Our requirements:
Should be able to test basic mouse click / mouse move events
Should be able to handle non-widget view components
Should have "record" capability to generate test scripts.
Should be automatable for running it daily.
We looked at:
S... |
Are there standard approaches to persisting data for every hit that a web app receives? This would be for analytics purposes (as a better alternative to log mining down the road).
Seems like Redis would be a must. Is it advisable to also use a different DB server for that table, or would Redis be enough to mitigate the... |
Do you know any programming language features that help to detect bugs early in the software development process - ideally at compile-time or else as early as possible at run-time?
Examples of well-known and effective bug-reducing features are:
Static typing and generic types: type incompatibility errors are detected ... |
I am building a moderation panel from scratch in a MVC approach and a lot of questions cropped up during development. I would like to hear from others how they handle these situations.
Error handling
Should you handle an error inside the class method or should the method return something anyway and you handle the erro... |
I always thought that the business logic has to be in the controller and that the controller, since it is the 'middle' part, stays static and that the model/view have to be capsuled via interfaces. That way you could change the business logic without affecting anything else, program multiple Models (one for each databa... |
Here's the deal: I'm looking at designing my own scripting/interpreted language for fun. I'm only in the planning stages right now; I want to make sure I have a very strong hold on exactly how I will implement everything before I start coding.
What I'm currently struggling with is concurrency. It seems to me like an ea... |
Studying this subject extensively, the most books state the following:
Quality Assurance: prevention activity. Act of inspection, reviewing..
Quality Control: testing
While there are some exceptions that mention that QA deals with just processes (planning, strategy, standard application etc.) which is IMHO much cl... |
I have developed an Android application where, typically, each view (layout.xml) displayed on the screen has it's own corresponding fragment (for the purpose of this question I may refer to this as a ViewController).
These views and Fragments/ViewControllers are appropriately named to reflect what they display. So this... |
Why do generics in Scala have erased types, and are not reifiable?
Is it due to lack of support from the JVM or for compatibility with Java libraries?
What are the advantages in general of having generics as reifiable?
|
Generics in Java are implemented using type erasure. The JLS says that the inspiration was backward compatibility. Where as on the other hand C# generics are reifiable.
Theoretically what are the advantages and disadvantages by having Generics as "erasure" or "reifiable"?
Is Java missing onto something?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.