instruction stringlengths 34 36.1k |
|---|
I have a standalone WPF desktop application which gathers data from Digital-to-Analog converter boards, computes, analyzes this data and then it creates binary files (proprietary format) with the result. There is a pace of one record (basically a dictionary with the resulted data) added each second in the final storage... |
When it comes to tracking packages from a multitude of carriers, is it possible to wrap a globally accepted way of pulling tacking status or must I write support for each carrier we deal with?
I have software which processes EDI documents. I've implemented a ways to automatically invoice based on the status reported ba... |
Please note: Months ago I asked this question that received a truly amazing answer and introduction to OAuthv2. I’m now knee deep in the implementation of such a system and have similar (but notably different) concerns, and so this question is not a dupe of it. It’s more like a “Part 2” that, hopefully, documents the ... |
In the OAuthv2 authorization grant, a “client app” authenticates itself against an “auth server”, and receives an “access token” for accessing resources living on a “resource server”.
My concerns:
How does the resource server know that the access token is valid (not forged or expired)? Is there some underlying backgro... |
I'm developing an app at work, this is my first big application and in my smaller projects I didn't use caching at all.
What's currently happening
When the user logs on for their very first time they have to pull in all of the news article data, their website account information and a few other things. Once I have the ... |
I am trying to create a simple 2d game to learn on my own. My current task is creating a lighting scheme.
My goal is to make the screen appear dark except where I create lights. I have a light class that only tracks the position and radius of the light. The code I feel I need help in improving is my per pixel lighting ... |
JVM developer here. Lately I've seen banter on IRC chat rooms and even in my own office about so-called "shaded" Java libraries. The context of the use will be something like:
"Such and so provides a "shaded" client for XYZ."
Perfect example is this Jira issue for HBase: "Publish a client artifact with shaded depende... |
Below is a rooted tree, where any node C except root has one parent P
Ancestors of a node C are the nodes on path from C to root, including P,P's parent,P's grandparent, .... till root.
My understanding is, Tree is just a set of nodes & edges that connect these nodes. Between any two nodes there is exactly one single ... |
I am working on an web app and I would like to keep the client data in the LOCAL
session storage.
I can't use the servers session and the app will only call some existing rest WS.I have to develop pure client side app, no server side rendering
In this case when going from one page to another I plan to read the data pr... |
I am using transactions to do bulk insert/updates. This is my little test loop:
$now = date('Y-m-d H:i:s');
for ($i=0; $i<60; $i++) {
$db->insert($cfg['ps_manufacturer'], array(
'reference' => 'MF'.$i,
'name' => 'MF NAME'.$i,
'date_add' => $now,
'date_upd' => $now,
'ac... |
I use a class that just extracts data from one known object, and distributes it to other known objects. No persistent configuration or such is needed in that class instance.
How should I decide whether to set up that class as a singleton, or just instantiate it every time I need it?
|
I'm planning to build a computer as a hobby from scratch, with the least basic hardware possible in functionality so I can learn the basics of computer architecture and assembly language.
I already have a high end PC but exploring it I find it complicated to learn basic foundational comp architecture stuff.
I wanted to... |
I am trying to learn trough example on a proper way to handle exceptions. When should I catch it, when and how should I throw it further down the line ?
In this example I have a very simple setup:
MainMethod
ExceptionHandler // Here is where I'd like to catch and resolve most exceptions
ExceptionGenerator // Error... |
Imagine this code:
using System;
public enum BaseClassType
{
DerivedA,
DerivedB
}
public abstract class BaseClass
{
public BaseClassType Type;
public BaseClass(BaseClassType type)
{
Type = type;
}
public virtual void Interact()
{
Console.WriteLine("BaseClass.Interact(... |
For a small hobby project I thought about giving users the ability to edit their submissions, but, since their submissions will be voted on by other users, restrict editing to correct (minor) spelling mistakes only, preferably natural-language-agnostic.
During a tentative investigation into the subject I thought I migh... |
I am thinking if is there some design pattern to work with objects and its states. In my REST API I have a access token objects, these objects contain information about authenticated clients:
public class AccessToken {
private final String accessToken;
private DateTime expiration;
private DateTime created;... |
A web app designed with highly modular, small components (in this case using AngularJS directives but could just as easily be WebComponents, ReactJS components, or any other technology). Components often have asynchronous REST API calls, upon initialization or upon user interaction. This design is causing many API ca... |
This is a hard enough idea to wrap my head around and I would greatly appreciate any edits/help to get it more readable for those in-the-know.
Is it theoretically possible to have a hard drive that has saved on it one copy of every possible binary permutation of one kilobyte and then have the rest of the system simply ... |
Does it make sense to say that I elicit business requirements from the end-user community, then take those business requirements to the functional team to create functional requirements, then take those functional requirements to the system engineers and architects to create the system requirements?
For example: busine... |
At least few times a week I have to track down a bug that would not occur in a production\client environment. 95% of the time I can tell that its a QA configuration\environment problem just by looking at the ticket. But, many times Im asked to track down and prove that its a QA issue and not an actual bug.
How common i... |
I'm updating an existing tomcat web application to read certain resources from a REST API. Currently the application reads them from flat files. Since the application is very critical, I added a caching layer so that the objects returned by REST API are always available.
In the service layer of API client, if the req... |
I'm working with a NoSQL DB with eventual consistency. My software is not only inserting Java Objects in JSON but also creating secondary indices for cross-referencing and similar things. Due to the fact that my software has to create all references on it's own, there is no real mechanism to ensure complete consistency... |
I need to publicly deploy web app which uses apache 2.0 libraries. The license obliges me to provide credits in case of redistribution. Do I need to do this in such a case. Is it considered redistribution? Are there any best practices in such a case?
What about javascript parts?
|
When it sees the parentheses, does it have the machine do the operations in the parentheses first, or does it distribute out the parentheses?
Like, if I have the following line of code:
int i = 2 * (a + b)
does it compile like this code:
int c = a + b
int i = 2 * c
|
If I have a story with multiple tasks for different users, is there a good process flow when a task is dependent on previous tasks to ensure subsequent assigned users are aware that they now have a task ready to be worked on?
Assume that all tasks are already assigned to appropriate users.
Basically when the developer ... |
We know that binary search takes O(log n) in Big O notation but if we need to run twice an algorithm of O(log n), would it be the same as O(n) in time complexity?
For example, if I have a method to calculate the first occurrence of a number in a sorted array with duplicates and another method to calculate the last occu... |
I have a database accessed by an several servers, let's call them workers. These workers take one item from the database, do some operations on it and then update it back into the database. The workers are also volatile, there can be any amount of them and they can die/start at any time.
My problem is coordination of r... |
So I have done a lot of reading and it appears that, since DbContext already implements a repository and unit of work pattern combination, creating more abstraction classes would be redundant. However, I would still like to be able to encapsulate commonly-used queries for code reuse. I was thinking - perhaps I may be a... |
I originally posted this to code review, not knowing incomplete code was off-topic and was pointed to post here. I don't believe this question is a good fit for stack overflow because the code I currently have works, I'm just not happy with it.
I'm creating a java class to automate simple tasks on my computer. The java... |
I work at a high needs school in which there are several classes that plan their work through Excel spread sheets grading and tracking student progress. We have come to the conclusion that this information needs to me centrally managed allowing all staff to get the data they need.
Here is a picture of the data we are t... |
The specific use case I'm interested in here is authenticating REST clients against publicly-available server endpoints (such as a public REST API).
The simplest solution here is Basic Auth. But I often hear OAuth2 touted as a superior auth solution in almost all circumstances.
The thing is, the only OAuth2 grant type ... |
I'm looking for some direction on building an algorithm that will maximize the number of pairwise comparisons of objects in a set using transitivity.
To explain in detail:
Suppose there are x number of objects to be compared. Then there are x[(x-1)/2] possible comparisons of these objects. A constraint is that only ... |
For a class project in Introduction to Object Orientated Programming, we are creating a simple game.
This game has two main menus. I was just wondering what the best practice for organizing these are. Should I have these functions in a separate object or should I keep these as separate methods?
To me it makes more sen... |
I've been reading Robert Martin's book "Clean Code". One of his core tenants is to remove unnecessary comments and strive to create meaningful variable/method names that are self documenting.
Some of my colleagues disagree with this approach arguing that it is impractical for large software projects. They cite the exam... |
Consider an Organization which provides technicians for different types of jobs.
Each job type varies in completion time and technician count. For e.g., Job type 1 requires 2 technicians and 1 hour to complete and job type 2 requires 1 technician and 30 minutes to complete. All technicians are available all the time (O... |
This might be not technical but rather process driven query. Help me redirect to right forum if this is not the place to ask such question.
Typically in a project, we have a deployment environment where development team deploy the code for testing purpose. Testing team executes test cases on the environment.
But I have... |
I would like to ask for feedback for some programming logic concept & ideas. I am building a site where i would like to keep track on how many pageviews a page has daily. I have thought of 2 ways to do it, would like to get feedback from fellow experts on which approach you would recommend.
Approach 1
Keep a field in t... |
I want to question the usefulness of the CanExecute functionality in WPF (defined in the ICommand interface). As I think that you can achieve the same functionality thing without this feature I ask myself why it is there in the first place.
My question is: If I build a new UI framework like WPF from scratch and I have ... |
I have looked at some answers and searched on Google, but I could not find anything helpful (i.e., that wouldn't have awkward side effects).
My problem, in abstract, is that I have an object and need to perform a long sequence of operations on it; I think of it as a sort of assembly line, like building a car.
I believe... |
I just read this article that is a few years old but describes a clever way of securing your REST APIs. Essentially:
Each client has a unique public/private key pair
Only the client and the server know the private key; it is never sent over the wire
With each request, the client takes several inputs (the entire reques... |
So, I am now dealing with this relatively new codebase which uses, and sometimes feels like it abuses traits. Since I have been exposed to trait usage in a rather limited fashion, I was wondering whether the way they are using them makes sense. I believe they are preferring to use traits when good old inheritance would... |
In this article you can see that View has (uses or aggregates ) controller and ConcreteView has Concrete model.
public abstract class View
{
public abstract void Update();
private readonly Controller Controller;
protected View()
{
}
protected View(Controller controller)
{
... |
So, you can build Qt apps and deploy them to android.
Taking a look at this post, I was wondering if making a game using Qt would be fine with LGPL legal terms given the following facts:
The app would be at GooglePlay so, using third party libraries is a concern
Source code for the app would be public
Possible in-game... |
An Activity or a Fragment is where you handle the logic of updating views with model data. However, they are tighly coupled with the Android's framework.
Are these classes already presenters?
Bonus: Is it overengineering to design exclusive presenter classes that are not coupled with the framework?
Consider scenarios ... |
I am working on a .NET project (happens to be an MVC website) that is being deployed in 5 languages. We have several hundred text strings in various .resx files, which is working great.
However, the process for adding or changing strings is slow, as the translation is being done by another department and we don't have ... |
Coming from a SVN background, one of the hardest things to get used to when working with DVCS systems is the way they all seem to regard any uncommitted change whatsoever like a ticking time bomb.
In Mercurial, if you try to fetch changes and you have any uncommitted changes in your working copy, you have to jump throu... |
I have a need to implement a number of microservices that will provide validation and lookup services. Each will hold independent and (essentially) read-only reference data. In each case, the data would easily fit in a relational db. Given the size of the data, SQL Server would probably end up caching the blocks in mem... |
I'm working in the development of an old project written in Java. We have more than 10 million LOC and, even worse, more than 4000 functional tests.
The tests, scheduled by Hudson, are failing like mad with every bigger code change. Verification of the test failure - if it's a problem in the product or in the test, ta... |
As part of the dependencies that the project I'm working on has, we use several core services. These services, to which we can't make big changes, are a big mess. Depending on the method we invoke, we need to convert our parameters (and return values) to different encodings, locales and time zones.
Since we generate th... |
I want to write a program in Python that illustrates the tree-like nature of recursion. Given a recursive function (for instance fibonacci(n)) there should be a way to print the tree-like call trace of the recursive function. With the following function:
def fibonacci(n):
if n == 1 or n == 2:
return 1
else... |
We have like 20 - 30 independent modules/solutions. Each of these has about 7 - 10 projects with different classes, components, etc. These are all used internal to our company.
Our problem is when we make a change in one module, we then need to make sure to update all other modules which are accessing this code. This ... |
I'm exploring AngularJS and ran into an interesting question. If I develop an API to power my AngularJS website it would include public facing items such as a Contact Form. Assume an API method exists /api/contact and a POST request will create a new contact form entry.
How can we prevent a spammer from using an automa... |
I was thinking about encapsulation in Java and then I thought how getters/setters break encapsulation. After I went through this , I saw many recommendations like to avoid getters/setters on fields not necessary, or some policies on how to implement them.
What I failed to understand is in-case of a MVC model, how do g... |
I'm going to be rewriting a project from Node.js into C++11. The device the Node.js scripts are being run on are ARM based, and Node.js is slow to start up on the device.
In the Node.js program, I have a class for everything to separate code. I also have singleton classes for things that only need to be run once like t... |
Suppose I need to convert an STA COM object into an MTA object. Single threaded apartments guarantee not just that only one thread will call the object at a time, but that it's always the same thread (thread affinity).
I think I understand the first requirement: the object and its shared data needs to be read and writ... |
I have a cross-platform application written in a compiled language.
For Linux it is customary to have both amd64 and i386 builds available to user, so user can choose version, suitable for its current environment.
In Mac it is customary to make Universal Binary, so it could support multiple versions of Apple compute... |
After having read Eric Elliott's Fluent JavaScript article, I was and still am toughtful about the way to play with instance prototypes.
On one side, you have the extending inheritance...
var B = function() {} ;
B.prototype = new A() ;
Or the new way of doing it...
B.prototype = Object.create(A.prototype) ;
And on th... |
Protobuf is a good thing, it allows c++ devs to not bother with class serialization/deserialization, is fast and .proto format is very nice. It also allows automatic data validation. But the messages are not human readable, and most importantly not human craftable. Which is a problem when you need to quickly test the r... |
Consider the following:
if (x == 5 || x == 10 || x == 12) {
if (x == 5) {
doSomething()
} else if (x == 10) {
doSomethingElse()
} else {
doSomeOtherThing()
}
doMoreThings()
}
doThingsAfterThat()
The second set of conditions feel repetitive, as I have specified them in the ... |
Actually, in this question I do not ask about particular language or architecture, however I understand there might be some differences.
In physics / engineering it is usually better to handle greater numbers than smaller ones, because of better absolute accuracy. For example when I need to calculate the area of a circ... |
I have automated a few test cases and pushed them for review. However I need to continue developing other testcases in the same code. I cannot create a new sandbox everytime as my changes are not really in the stream and hence I dont get them in my newly created local. Is branching really the way to work? If so how do ... |
In the code below there will be several instances of MainClass.
class MainClass(object):
def f(self, x):
# expensive operations.
# ...
return 'something'
Each instance calls f(x) several times and x has a specific value that doesn't change during those calls.
Since f() is somewhat expensi... |
I am creating an App where users can search items from an external API. If the users likes an item they can store them into their personal "favourites item list".
My question is, is it a good practice to save this data as part of core data or NSUserDefault. Currently the data is stored within my database. Every time t... |
In functional programming, it is considered bad practice (at least from my observations) to use state changes. Since computers operate in an imperative-language-like matter (performing one operation at a time, changing states of RAM), isn't functional programming contradictory to the way a computer operates?
Note: I'm ... |
I'm taking an introduction Networking course and one of the first assignments is to make a simple file transfer application using socket API and TCP or UDP. There is a server and a client. The client can connect to the server and request to get files from the server and store them locally. The client can also send loc... |
I have a similar problem as Criteria for selecting timeout value?. But my question is slight different.
Process A dependes on process B and has a timeout value of 5 seconds, sometimes process B might take longer to respond(e.g. slow machines), in this case process A will think process B is gone and will terminate.
We h... |
If I have two CPU cores, one is writing a particular cache line and the other core wishes to
Read
Write
the same cache line, what are the costs (in cycles) for doing so?
I am a little unsure whether the Read-For-Ownership request has to propagate through the L1 and L2 caches on its way to the CPU-which-already-owns-... |
Let's say we have this interface:
public interface OutputChannel extends Closeable {
public void writeOutput(String output);
}
Then there are several classes which implement this interface and generally it is the case that writeOutput() cannot be used after they have been closed.
However, among them there are clas... |
I was researching proper commenting practices for JavaScript and highly upvoted answer (+100) cites JSDoc-like commenting. JSDoc promotes comments like this:
/**
* Represents a book.
* @constructor
* @param {string} title - The title of the book.
* @param {string} author - The author of the book.
*/
function Book(... |
Consistency is something I value (at an OCD perfectionist level to be honest). I can live with not writing any comments and focus on producing good, refactored, readable code -- or, if I must comment, I would prefer to decide on a very specific comment pattern and comment in that way throughout the entire code consiste... |
For most of my career, I've been working with strong static typed languaged such as Java. For this reason, probably I've mixed up these two typing dimension (strongness and staticness). I came upon this link, which says that they are actually orthogonal dimension. I read it, but still can't understand this distinction.... |
What are the reasons, technical or otherwise, that pure functions (functions which do not rely on external state and have no side effects) should not always be public and static?
When a static and pure function is very general, such as Math.floor() or something, then it makes total sense to have it be public and stati... |
Scoped languages tend to store the local variables of a given scope or function together in a data structure known as an activation record. Stack frames are examples of instances of activation records. Not all activation records are part of a stack; for example, in ECMAScript/JavaScript they are garbage collected and y... |
I would like to use Roboto font in my libGDX game, but it's licensed under Apache license 2.0. Do I have to include the font license file in my game if I want to use it? I am using internal storage (assets folder), so the file probably would not be visible anyways without reverse-engineering the game.
|
While reading about this topic online I have found out that, in general, RDBMS are good for read heavy loads and NoSQL databases are good for write heavy workloads. This statement also seemed true when I was comparing MySQL with HBase. MySQL used B+ trees which are optimized for reads whereas HBase used LSM trees which... |
I'm using PHP and PHPUnit. Something bothers me: the fact that the assertions are in another class (too easy to forget or to ignore, for any new programmer in the project).
If the test assertions can be written just above the code, it will be easier to maintain, or difficult to ignore, I guess.
How useful can it be?... |
Let's say I've got a generic java class Filter<InputType, OutputType> which receives an input object and transforms it to an output object.
Now I've got two other classes (NoInputFilter<OutputType>, NoOutputFilter<InputType>) which should do the same except they haven't an InputType respectively an OutputType.
Now the ... |
I was brainstorming and I found quite an interesting topic I couldn't come up with a solution for myself.
How does storing excessively large amounts of data work? I mean physically, no matter how big the drive is, there will always be more data than there is space on a single disk. And I'm guessing this is more of a fu... |
I want to know the most robust way of checking for PHP error messages when running automated tests that interact with a PHP application via a browser emulator.
The reason is: I use Behat, Mink and Selenium/Webkit/etc to test my PHP applications in the following ways:
as acceptance tests, to make sure expected function... |
The general question: how can I write a flexible, but not property heavy, messaging structure for sending TCP messages to clients and server?
Example:
I have a TCP Server for a game that sends some messages through TCP sockets to clients:
Chat messages, including chat text, chat room, and speaker.
Game messages, inclu... |
I am trying to figure the best way (or just the pros and cons of various options) for delivering a service via a script which runs on the customer's site (think Google Analytics).
Unlike Google Analytics, the script needs to be deployed from the customer's domain so I cannot just ask customers to insert a link to get... |
In tutorials I've seen, when data changes on the client (maybe a TODO is added to the TODOs list) the client side model (and often UI) is updated first, then the server is called to persist that change. This puzzles me as there's the potential for error and failure (in which case you would have to notify the client and... |
I'm having a difficult time understanding how web applications work. Please help me understand without giving me google definitions. Baby steps/words would be appreciated =) From what I understand so far:
Okay so say we use Flask or Django ( python frameworks) for the backend.- This would be used as a base for our web ... |
Adding a vertex in a graph that is represented using an adjacency matrix takes O(|v|^2) time complexity according to http://bigocheatsheet.com/ (graph operation > adjacency matrix > add vertex).
But I couldn't find a reason why? Since all we need is to add a row and a column, which of course takes O(|v|), what is the r... |
Adding a vertex in a graph that is represented using an adjacency list takes O(1) time complexity according to http://bigocheatsheet.com/ (graph operation > adjacency list > add vertex).
It is said that adjacency list holds all the vertex in an array, and maintains a linked list of adjacent vertex, if we are to add a v... |
EDIT: You were right, the problem is not checking if a file with the same name exists but the connection. I made a mistake measuring the time with StopWatch and included a part which used the network connection.
Original Question:
I am writing a software which analysis data from a database. In the database are many te... |
I am trying to use RAD for our school project and i was searching for a model diagram to follow but i found 2
1st is the ladder type found here:
2nd is this one found here:
so i'm really confuse as to which one i should follow here, also how will i assign my task in accordance to RAD model.
if i follow the 1st one 3 ... |
If I have a
public class SomeClass {
public static final HashMap hashmap = new HashMap();
}
and then I have five different classes with main(String[] args) methods, that I will run.
when they access SomeClass.hashmap, would they be accessing the same HashMap or will they each have their own hashmap created in the ... |
Summary
I am developing a WAV file format reader under WinRT, and for this I need to read random amounts of structs consisting of fundamental types such as int, uint, float and so on.
Back in desktop development one would rely on BinaryReader, now in WinRT it has been replaced by DataReader which works asynchronously.
... |
TL;DR Below
I'm working on a game server (in Java, but that part is less important), and have decided to split up the server logic from the engine logic; in part because they're in two different logical domains. The server will interact directly with the client, and handle the networking aspect of things, while the eng... |
(Java Version 8 Update 60)
Hello. I am currently writing a program for my first Java assignment in college.
My question is, in what operating systems will
System.out.println("Hello,\n World");
result in
Hello,
World
to be written in the console?
I am writing a program that extensively uses \n to format my strings and... |
I often write comments like this
<div id="wrapper">
...
</div> <!-- id="wrapper" -->
But what if I wrote them like this?
<div id="wrapper">
...
</div id="wrapper">
At first it seems dangerous to put an id attribute that has the same value on another tag, but then, doesn't the browser throw out that information? As f... |
On many static websites the total size of the actual text content of the most popular 20 pages would come in at under 100kb.
I would imagine that it would be possible to leverage HTML5 local storage to download content via AJAX from the server in a single file, save it to local storage and use it with a data driven JS ... |
I'm staring new project, cross-platform. I want to use onion architecture there. It will be a simple game (tic tac toe), just for education purposes. This app will be client-server type.
Now, I read a lot about onion architecture, but I'm still not exactly sure how to deal with it in client-server.
Should I create two... |
Like other agile models, that is a close loop where changes after the system development can still be implemented without the need to redo the whole system, is this possible for the RAD model as well?
Since I was told that in the Waterfall model, if there are changes after the development, it can only be implemented by... |
Background
I've always disliked the idea of using the CSS property of display:table. Using it feels like an ugly hack and I always prefer to use a direct <table> tag instead. Of course, I use it only when necessary and always prefer a non-<table> based layout when possible. But for those occasions when a table is the o... |
I've been in the professional software development world for over 5 years now. An intense frustration that I've had over the years is when a software product that I'm working on turns out unstable, fragile, and compromised. Of course this always seems to happen when I'm rushing to develop several new features and meet ... |
I have been studying this subject quite a bit, and I am unsure of what's the best way. I still have a lot to go trough (books, blogs, stack exchange, etc), but I simply can't find a consensus.
Basically here is the situation: You have a function that is expected to return a result, but the function fails (parameter is ... |
A colleague and I are working together on a Meteor app.
One of us thinks that the following code in two places should be wrapped in a function to avoid duplication -- the other thinks that it leads to needless indirection/complexity.
I won't tell you which is me, because I would like the answers to be unbiased :).
We d... |
Rebol has no keywords. It's a concept that forms a part of what makes the language so versatile—any word can be reassigned, any word can be assigned the value of a 'built-in' function—and one that in the general flow of the language holds true*. However there are notable exceptions within two of Rebol's basic structura... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.