instruction stringlengths 34 19.9k |
|---|
I'm starting to delve into JavaFX and have heard that one of the cons of java fx is that there isn't a mature rich client platform or application framework ala eclipse rcp or netbeats platform for it.
Why does JavaFX need a rich client platform? Do these things offer something that pure java fx does not offer on it's o... |
I'm really new to TDD, so I guess this question is pretty basic.
We're building a website, and part of the functionality is generating some files (binary files: Excel, PDF, whatever). How should I test this feature?
I've think about creating some static files and compare those with the generated ones, but a binary comp... |
I'm integrating with a shipping API built in php.
They have a strange coding standard where the comments are between the function name and the first curly bracket.. which - subjectively - makes the code really hard to read.
Is this a particular, albeit non-standard, commenting standard?
Here's an example of a such a f... |
We have a site which is hugely complex in its implementation. Conceptually, it is simple - a web-based catalog. But the implementation has become a multi-layered nightmare.
Can anyone indicate a "rule of thumb" for measuring when something has become too complex for the job it is doing?
|
I have learnt so far that abstract classes can't be instantiated because they are only there for other classes to inherit from. But i cant get my head around this code i came across in the msdn library:
WebRequest myRequest = WebRequest.Create("http://www.contoso.com");
in the documentation it says the above code ret... |
EDIT: Thanks for all the great answers! In reading these responses I realized that I'm approaching this from the wrong angle so I wrote a new question here.
I had this discussion with my superior about whether validation rules should be in the domain model or not (specifically, in the property accessors) and I tend to ... |
I'm interested in hearing out what's out there in terms of tips and tricks on deploying and maintaining a Java web application whilst keeping agile. I'm running solo on a startup project I'd like to maintain.
My tech stack is fairly simple:
Spring MVC
Spring Core for IOC (Inversion of Control)
JPA/Hibernate for transc... |
How to store configs for project in Java. In normally case i stored it in 'src/main/resources/' with *.properties. How best approach for storing projects config for development, local, production environments?
I tried use *.prop with follow structure
resources
|_ config
|_local
|_development
|_production
|_... |
I have problem to understand the extension relation in the use case diagrams, sometimes some relations seem extension.
For example in the library system, what is the relation between borrowing a book use case and reservation a book use case?
Could the reservation be the extend of borrow?
Scenario of Reserve a book:
... |
I have two classes
class A{
int id;
String name;
public boolean equals(Object o)
{
if(o instanceof A) {
A a=(A)o;
if(a.getId().equals(this.getId()))
return true;
}
return false;
}
public int hashCode() { return id;}
//setter& getter
}
clas... |
In my understanding, git as version control system should track all resources or files that are necessary to build a software version.
If a private key file is needed for a server to function correctly (say to communicate with client that has the public key we distribute), then, should this private key file be tracked... |
If we have TDD and BDD why do we need QA for? Isn't the job of the developer to write bugs or failing tests? If this is true how a QA fit in? Thanks.
|
I'm speaking specifically about a C# .NET 4 program running on Windows XP or higher, but general answers are also acceptable.
Assume an already optimized and efficient program. The problem here is entirely down to effects of high CPU usage on hardware, and whether a high-usage program should be throttled to reduce wear... |
I am trying to understand the JVM memory model. In particular, I would like to understand whether it would be feasible to have zero-copy (de)serialization libraries, such as Cap'n Proto or FlatBuffers. In particular, these two libraries do have partial support for Java, but it is not entirely clear to me whether the im... |
We are trying to implement a branch model in Mercurial.
We have read the "Successful GIT branching model" and I proposed another, based on branched version numbers.
Then I ended accepting the model with 2 long lived branches, development and releases.
One thing I like about it is the possibility to do "nightly builds",... |
In the past year, most of the rest of my group (of engineers that I work with), has ended up deciding that merge bubbles really aren't that bad.
At the very least, I'm seeing that other developers do not consider rebasing worth the effort needed to avoid merge bubbles when merging (sometimes very badly structured) pul... |
I have a Hibernate entity object MyObject with several attributes and a service MyObjectService containing business logic dealing with MyObject. I also have a view model dealing with user input/output which uses MyOjectService. This service contains method updateMyObject(MyObject o) which is called by the view model wh... |
So I'm a terrible person and I want to name a variable in my mathy-python3 code s′ (that's U+2032 PRIME).
I was under the impression Unicode literals work as identifiers in Python 3, which is why my ɣ, α, and ε's are working fine.
Is the prime symbol specifically forbidden because of how terrible it would be to use?
|
I asked a question about whether validation behavior should be treated the same as other types of behavior in regard to the concept of OOP being "data + behavior". I got some good answers back that addressed the question from the philosophical point of view and confirmed that the answer to that question seems to be yes... |
This is my first time using Unity so bear with me for a moment. I have a sample Visual Studio 2012 project with 4 projects (but only two of these projects will be used with Unity). This is the following setup of the projects:
Database - WinForm project that displays a Master Detail Form
DatabaseUtilities - A class l... |
I was recently changing a method to add in an additional parameter, and I couldn't help but wonder if there were "best practices" or "generally accepted rules" in deciding what order parameters of a method should go in? Obviously, you could put it in any order you like... I'm more wondering if there are any official (o... |
What would be the big o for the algo:
for (i=0; i < n*n; i++)
for(j=0; j<i*i; j++)
As per my understanding
1st loop will loop upto n2 times.
2nd loop will go around n2 times.
Am I right or is it a O(n6) representation?
Also is there a easy way to say when to use log. I have assumed that whenever the loop variable is... |
I want to implement the A* algorithm. I have a network with Nodes and Edges, both are classes.
Now, I am unsure how to approach the connectivity information. Should a node know which edges depart from it? Should an edge know which two nodes it connects?
I thought both answers were true, but then there are circular depe... |
The general approach to DI that I see in answers like
So Singletons are bad, then what? encourages
business objects that collaborate with other objects to (a) not
directly create those instances and (b) have them passed in at
construction. I can understand (a), but not (b). This seems to occur
most often in response to... |
I would like to be able to copy an object and only change a few values. I have come up with two different ways to do this.
// OPTION A - create a copy constructor and use property
// initialization to change values
class SomeObject {
public string PropertyA { get;set; }
public string PropertyB { ge... |
Currently reading Clean Code, and the authors seem to imply that any function with an arity greater than 3 should be avoided at all costs.
I am unfortunately running into an issue where I am faced with a class method with an arity of 4 (5 if you count self)
def start_job(self, operation, name, external_id, format):
... |
We would want to send timely emails to subscribers about updates/changes to the database.
What would be an optimum approach to this.
Is considering SignalR a good path?
Example:
Let us say we have a list of phones with specific features in the database. User wants to get notified whenever a new phone with front camera ... |
I have a REST API. The fundamentals of the API takes care of two things.
Authentication
Routes
Let's say I was about to do a small service (microservice whatever...) next to the API and have it defined in it's own scope which could be a DLL or another service endpoint perhaps.
Then I would go back to the REST API and... |
I have developed two web services. The main service is a RESTful service (using DB), and another UI service that uses the RESTful service.
Say I want to test the UI for now (integration tests), every test will makes changes in the prod DB. More then that, if in the RESTful service, there are one-way functions for secur... |
We want to setup proper development workflow.
We have two main branches: master(release branch) and develop(working branch).
We want to use pull requests properly.
We see two ways how to do this:
The first one:
Create new branch for feature.
Implement feature.
Merge to develop branch.
Test develop branch.
Confirm tha... |
What does exactly make reading from the process memory a pure operation? Suppose I created an array of 100 integers in the global memory and then took the 42th element of this array. It is not a side effect, right? So why is reading the same array of 100 integers from a file a side-effect?
|
I'm currently writing a email synchronizer application that synchronizes email to a sql server database.
One direction is not a problem: Fetching folders from the server (with its messages) and writing them into my database.
What I'm missing, though, is the "reverse" ability: How can I detect which folders or messages ... |
I need to create a WPF app that users will use on one machine and the manager wishes to use at home in the evenings. I have already suggested a web app which they don't want to do so suggested hosting the data in the cloud.
I haven't used this scenario before so I wanted to take the time to see what other people would ... |
In Short:
Should I deploy each fix/feature as I make it, or schedule releases for an internal application?
Some Background:
A few months ago I was hired as our IT's first dedicated developer with the ultimate goal of developing an application to replace a 10 year old internal tool that is used multiple times a day by ... |
AFAIK we must install the client-certificate into the users browser to connect with https-sites using server-certificates to have a mutual authentication.
What about AJAX and JSON, can we connect to the server without installing the client-certificate into the browser?
In example the .cer file will be available from th... |
I teach OOD&A course to some students. When I want to draw a use case diagram or write the scenario of them for a system, I don't know should I include everything (behavior) which is done in the system by human or computer or just focus on those which is done by computer.
I think Use case diagram is a tool to analyze t... |
Let's say I have a project that has multiple components: a server component, a web app component, an iOS component, an Android component, etc. These components are all separate codebases, but are also loosely coupled (eg. a change to the server code could require a change to all other components too)
What is the most ... |
After reading various MSDN articles, tutorials, and posts on here I came up with a design for a windows service that I wanted to make sure my threading strategy is proper and won't lead to memory, cpu, database issues.
Here is the basic flow.
MAIN THREAD
Collect list of service to be loaded.
Loads each service.
SERVI... |
We are planning to use Git pull requests for code review in our company. Before we start I have a basic question: How often should I open a pull request? Is it best to open one for every little commit I create? Or should I open a single pull request for a larger quantum of work, such as all the commits in, say, a user ... |
I am looking for a methodology for choosing a language. I am not asking for opinions about languages. I have been tasked with the process of comparing our shop's current language with others that are available. We are a web development shop btw.
Our CEO would like a full white paper about all web based languages that ... |
A long-standing question for me has been: when do I store data (actual values) in a database table, and when do I store them right in the code?
The untold consensus has typically been as such(*):
If it is a single variable or a simple structure, or an array of a few values, put data right in the code.
[* consensus has ... |
I started to evaluate mongoDB for a product catalogue.
Regarding user management and access control: When to use the mongoDB's built in user management and when build one on the application layer?
Let us say I have a product catalogue organised as a Tree. I want to define access rights on the nodes of the tree.
Access ... |
How would one name a function type called by a certain event? Instances of this function type would get called when a certain key is pressed. It isn't strictly an event handler type, because it doesn't have to handle the event. It might simply just want to be aware of the event. There can be multiple functions with thi... |
I am making an android app which will talk to a web service to get data. The web service has a rate limit of 100 calls per minute. Is there a way, recommended method to ensure that the app across various devices dont make the call to the server at the same time. Some way to stagger the requests across devices?
|
I had a question regarding compression and calculation of checksum/hash of data.
I would like to know if checksum has to be calculated before or after the compression of data before transmission. Could someone please explain this so that I can get a better understanding of it?
|
I have the follow algorithm which finds duplicates and removes them:
public static int numDuplicatesB(int[] arr) {
Sort.mergesort(arr);
int numDups = 0;
for (int i = 1; i < arr.length; i++) {
if (arr[i] == arr[i - 1]) {
numDups++;
} }
return numDups;
}
I am trying to find the worst ... |
I'm basically building a reseller website, in which people can buy (users) from a predefined product list and sell them at a higher price (clients).
I will show you some images to explain better myself.
The following image represents a table with several fields, in which I have included only 2 columns.
The point of ... |
Looking into DDD and something I noticed is that business logic should be in the model, otherwise you just have property bags. That said how do you handle pieces of validation that require a trip to the database?
For example, you have an domain object that represent categories for a blogging engine.
public class Categ... |
As a hobby experiment I am creating a on-line tool for creating web sites with the ability to create custom HTML and CSS using a template engine for safe-use of functionality.
Now I am in the dilemma if I should save the template files in a "customers" folder, and create a tree view of this file structure - or if I sh... |
I have an Android Library Project which I intensively used in a few projects. I started a new project in which I am also using this library. I want to improve some things in library (method signatures\names, interfaces, etc.). But if I change method signatures\names, interfaces, I should update old projects that use th... |
For the development of a next generation of a medical monitoring device consisting of several dedicated hardware systems with embedded software, I am looking at the requirements for the current generation of the device to see what can be re-used. During this process, I cam across some requirements that explicitly speci... |
I have a grayscale matrix (implemented as a simple array) to be shown on a display:
line 1: | a | b | c |
line 2: | d | e | f |
a-f are grayscale values. This pattern has to be shifted by a variable percentage to the left or to the right.
What I currently do is an easy approach:
For example, shift 20% to left, so:
a_n... |
I have been reading through the apple documentation for creating frameworks for OSX and iOS.
Reading about the structure of frameworks, I began to wonder if there is really any need to create the symlinked folder structure described if you are targeting iOS only.
The structure supports multiple internal major versions... |
version in field:
@Column(name = "SAMPLE_STRING")
private String sampleString;
public String getSampleString(){
return sampleString;
}
version in getter:
private String sampleString;
@Column(name = "SAMPLE_STRING")
public String getSampleString(){
return sampleString;
}
It seems both are working... |
I'm a beginning C++ programmer coming from Java.
It feels to me that C++ templates and Java generics are actually pretty similar. You use them in pretty much the same occasions and in the same way. And they 'feel' the same. However I can think of two differences between the systems:
In Java you can only use class-type... |
I like PHP. It's not overly complex to achieve what you want, you can write straight up HTML inside it, and I suppose I'm just used to it. I also like Go, having just discovered it while looking for something to write the back-end of a web app in that wasn't Node.js (can't abide callbacks everywhere).
I would like to b... |
in java we have ivy, maven and others for handling library dependencies. For example I tell ivy that my program uses a framework-jar version 1.0 and ivy makes sure, that my program gets this jar when being compiled. When there comes an update and the framework-jar is now available in version 1.1, then my program still ... |
I do have an implementation issue that I condensed to the following code snippet, because the real code is much more complicated. The core problem is that I do have a container object that has a mixed list of persons, for example Managers and Engineers:
interface Person {
}
class Manager implements Person {
}
class... |
In our codebase, I encountered the following construct: There is a base class B, and then there is a class D which derives from B, but does not override or add any members. In fact, D is completely empty - except for a constructor that initializes some (inherited) properties in a special way.
Consider this contrived C#... |
For those unfamiliar with the SOLID principles you can start reading here: Wikipedia article. However, most of my understanding comes from: http://www.objectmentor.com/resources/publishedArticles.html
Regardless, it seems that every GUI interface I run into in Java (even the one in Adobe Flex honestly) is filled with d... |
Using domain driven design and event sourcing ...
Given I have a table of 3 columns: (A, B, C) with an existing row of data: (1, 2, 3), when I update the row to contain values (1000, 2, 3) and I run a tool designed to capture data changes and emit associated events, which of these should I expect as the emitted event's... |
Currently working on a server-side front-end Scala Play app that does a lot of grabbing of HTML snippets and JSON from many other web apps before piecing everything together and sending it in a response to the browser.
Since a lot of these other web apps are legacy, they don't expose nice REST APIs and need to be call... |
I've a web service SOAP developed with WCF, there is a best practise to versioning it? when I change the contract I don't want to update all the client's referiments but I want simply publish a new version that coexists with the old.
STUDY-CASE:
I've a web service with one endpoint, all clients point to it,
soon I wi... |
I'm trying to understand what is the best way of migrating a website that works in a single layer and gets all the data via an ORM, to one that uses multiple layers, using an API backend to get the information needed to display a page.
In the project I'm working on, we have code like this, where data is retrieved via a... |
We are using two table to manage user data. A user table that has a username, email, password. Then a user profile that has first name, last name, bio, etc. Due to some other requirements it has been made clear it would be so much easier to combine the tables.
What is the thinking generally with separating these tables... |
After writing some classes where class initialization requires multiple options, instead of writing several parameters into constructors or setters, I started passing an associative array of parameters, which I called $options, where, for example:
$options = {'productLine' = $productLine, 'modelNumber' => $modelNumber,... |
Let me illustrate using the PHP language. The discussion here is, how should I do exactly to solve this problem in a clear and unambiguous mode.
Imagine that I have a class called Path. This class is responsible for defining an object that refers to a path of a file, for example. This class helps me with some tasks, fo... |
i want to know whether there is anything called logical schema and the conceptual schema of database table. if so what is it.i searched lot of places for this specific two words, but did not find anything helpful.i would be grateful to anyone who provide me definition with an example.Thank you :)
|
Consider the following C++ function:
void doStuff() {
Thing thingA;
Thing thingB;
thingA.doSomething();
// .. etc
}
During the execution of this function, variables thingA and thingB are allocated on the stack. That means that the variable thingA represents some address on the stack, and it's value is ... |
I have been wondering for quite some time on some issues while using dependency injection:
In a layered application, I normally inject repositories into the application service using constructor injection:
public class SomeService
{
private IRepositoryA _repoA;
private IRepositoryB _repoB;
private IReposito... |
I am developing a framework and it can generate various types of exceptions. Initially I'm working with a single exception class that indicates that something went wrong inside the framework. However, I was thinking, maybe it would not be correct to create a specific class for each specific type of exception?
Currently... |
In Android I can put only ArrayList of Parcelable objects in Intent:
Intent putParcelableArrayListExtra(String name, ArrayList<? extends Parcelable> value);
I can't put in there a List<? extends Parcelable>.
I have private method that get list of Parcelable objects from Intent (i.e. the method is used in its own class... |
I have a custom configuration reader which performs various functions on top of .NET's CloudConfigurationManager and ConfigurationManager implementations, such as caching, type conversion, etc.
The following method is used to retrieve a configuration item:
public T GetSetting<T>(string key)
{
string value = GetSett... |
I have several classes Parent and Child1 ... Child9 implemented in Java. Parent is an abstract class, containing all the common variables of the child classes (a lot, which is the main reason why I made Parent an abstract class and not an interface), some abstract and some implemented methods.
Some of the child classes... |
Whenever I read about Haskell, I find that IO can cause side effects.
But I do not understand how it would do it?
Do we mean that we are writing to a file from one lazy sequence and another lazy sequence is reading from same file?
Is that the only possibility or is there something fundamentally deep?
|
I have a telephony application, there is a windows service(third party product) running on a remote server. The application runs against the server. To connect the server, we have the code.
public static TelephonyServer ts;
ts = new TelephonyServer(sIpaddress, "username", "password");
TelephonyServer is very complicat... |
Here is the situation:
I have a Document(d) and a set of keywords (Set<String> keywords). I like to check the density of each words from set keywords with d.
I have few solution but not really good. for example:
(NOTE the implementation is in java.)
Map<String,Integer> map
for each word in keywords do :
d1 = d;
int c... |
I need to write a class in C++ that acquires a hardware resource and releases it again when it is destroyed. Basically that can be done in the constructor and destructor of the class. The difficulty I'm having is that I want this class to be usable as a local object only.
So basically:
struct Magic
{
Magic(const Sett... |
I have just started developing a small web app for Arabic speakers, and I will need to ask a co-worker (not a programmer) to help me translate all of the labels and documentation into Arabic at some point. Ideally, labels would allow arbitrary punctuation and line breaks, but we can set some rules to keep things practi... |
Projects A and B both use library project L:
Judging by what people have written about it on the web, managing this situation appears to be a headache:
http://codingkilledthecat.wordpress.com/2012/04/28/why-your-company-shouldnt-use-git-submodules/
why you shouldn't use Mercurial subrepos
Are there any solutions out t... |
In most programming languages (C#, JavaScript, Java) the order of operations precedence has that equality comparison come BEFORE bitwise comparisons.
This means that if you have a bit operation and an equality comparison on the same line (as in this javascript code):
if(2 & 15 === 2){
//do something
}
You will ge... |
Background
In a language like F#, direct interoperability with most other .NET languages is possible. For example, it is possible to use classes written in C# directly in F#, and it is possible to call F# code directly from C#.
In F#, modules are compiled to CIL instructions corresponding to static classes, ADTs to a c... |
So I recently made some major refactorings to my code. One of the main things I tried to do was split out my classes into data objects and worker objects. This was inspired, among other things, by this section of Clean Code:
Hybrids
This confusion sometimes leads to unfortunate hybrid data structures that are half obj... |
Im working on a small program and I thought i would use it as a chance to get a better understanding of things I haven't really used before, mainly Interfaces and Inheritance from base classes.
Basically it is a facility use request program and after a request is made it needs to email the requester all the information... |
As I did understand, and as it's described here, ad-hoc polymorphism is limited to compile-time dispatch. That is, if we have a function that expects an argument that belongs to a typeclass, we must know the concrete type of the argument at compile time to be able to use this function.
So the following (in Haskell-like... |
I created a table in a Postgres database. I would like to create a form in a Java application to insert rows into that table. Certain fields have default values. What is the best way for the database and UI to agree on what the default values are? Also, what is the best way for the form to communicate the user's intent... |
To clarify on the title a bit more, this is for a plugin for my forum.
I'm doing this:
div.html( parser( div.html() ) )
When sending the html string to the parser, of course I get something like:
"[BBC][/BBC]\n<code>[BBC][/BBC]</code>"
What's the best method I could use to prevent the parsing of the BBC tag inside th... |
We are currently developing an app for Android and iOS which requires the user to perform a registration. However we don't want the user to go through all this e-mail and password activation link stuff as we aim to let him use the app almost instantly.
The basic idea is that the user enters some mandatory data, clicks ... |
We currently have 1 giant EDMX for our corporate database. It, along with all of the generated POCOs, are in a separate project (we'll call it the EDMX project) which we pull in to any solution that uses the main database. In other words, any new application we develop uses this same EDMX project. Naturally, the EDMX p... |
In the pseudo code below, the variable key must be declared and initialized outside of the context which it is used/relevant because there are two disparate if-blocks with the exact same condition.
I was thinking it might be cool if a language could consider two if blocks like that to have the same scope. What are the... |
Problem:
I am working on a service which will do some automated processing at a configurable time each night. It does some communication over the internet, formats some information, and creates a file. This file will be used by another program. I don't want to specify what program it is, because I've signed NDAs and I ... |
I am attempting to implement an algorithm that takes in a massive array of data, and iterates through each element in this array. For each element, it will either create an new array and put the element inside it or insert it in some existing array based on qualities of the element.
How to decide which language is the... |
I started working as a Web developer few months back. Previously, I had no prior professional experience in programming besides school classes and fun-side projects I did on my own.
I am the only person there that really know how to code. I'm a fast learner and I know I can make a lot of stuff from PHP and JavaScript/j... |
How can I put in the design constraint into a user story?
The system to be developed will generate a invoice when a payment is made, and will send the invoice to xMail (an emailing tool) which will then email the invoice to the customer.
How should I put the information where the system will send the invoice to xMail?
... |
I'm developing open source software for about ten years. Now I rebuild my main product into a professional version. I think for it as a successor of the freeware version which is more or less legacy now.
I want to implement the following licensing model:
After downloading the software to work in Trial Mode with full f... |
Not always but most of the time, you will find iOS or Mac OS X open-source projects with names starting with the initial letters of the author first and last names. If a project were to be authored by Nick Leblanc, the project would be read as NLMyProject.
Examples:
RMSwipeTableViewCell by Rune Madsen,
EBCardCollectio... |
The GPL is described as a 'highly viral' license (if an application contains code which is licensed under GPL, distribution requires open sourcing of the whole application).
Do I understand correctly that linking GPL code with closed source run-time libraries provided by many commercial integrated software development ... |
I am very new to the concept of testing and I had not yet have any experience with this.
At my company, no one does write tests as of now, neither is any test framework set up or anything. Also, we don't have testers. You bet how testing works: send new version to one customer, then wait for his call... if he hasn't ca... |
I am learning about Linked List and Arrays in my data structures class. We are make them in Java. Are actual data structures designed in Java/C? Or are they made in lower level languages like assembly? The linked list we made in class just seems to simple, it makes me wonder how real data structures differ from what I ... |
I'm interacting with a large code base (in a single assembly) written by another department (let's call it BusinessAssembly). Precious few of the objects we need to use in that assembly use interfaces. As a result, LOTS of our projects need to reference that assembly because there is no abstraction available and tests ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.