instruction
stringlengths
34
19.9k
The scope: it is part of a big ERP system which provides specific calculations. One can think of it as a salary calculation module in a CRM. Yet this is way beyond that in both complexity and integration points. Thus, there are a lot of technological debt, but not unmaintanable one. There some some unit/integration tes...
I have a generic design question that relates to enterprise applications but I think that software developers from other types of projects may have experience with this as well. The scenario is following - you have a database and you are about to write an application that provides access to its data. The database also ...
A question has been bothering me for a while: when developing international projects, it is common sense to use English as the reference language since it is the language that the most people understand. However, how can one choose to name a function when it could have different valid English spellings. For example, wo...
I am new to unit testing, I've one REST web method that just calls DB and populates a DTO. Pseudo code is public object GetCustomer(int id) { CustomerDTO objCust = //get from DB return objCust; } My doubt is how to write tests for these methods and type of tests (Integration/Unit) to be included. And for unit test...
I am just a graduate from India and I have knowledge of Java, JSP and Servlets, Android application development and some iOS development. I do not have a background in C or C++ and a little weak background in Data Structures and Algorithms. I want to know whether I can make a successful career in the IT industry withou...
I am working on one of my first projects in C (microcontroller code) which is split up into multiple C files. I noticed some inconsistency in my coding where I had some variables declared as extern global variables and would just access them directly (ISR and some other places), and others declared static global variab...
A typical MVP application might have a View method such as: void setDisplayItems(List<DisplayItem> items); Should the Presenter sort the list of items or is that a task for the view? I feel this might be a task for the View, for two reasons: If it were a task for the Presenter, then methods such as: void addDisplayIt...
I have a question regarding ASP sections and partial views. What ser the benefit of using one over another? Because if I have a menu, i guest that it could be both as a section, but also as a partial view. So what is the difference?
I would like some input on how to handle clients and third party vendors that ask me about the deficiencies in my design. For example. It turns out I need a data field in a webservices response. This response has been signed off on weeks ago and I get questions like "Why haven't you identified this field X weeks ago?"....
New to C++! So I was reading this: http://www.learncpp.com/cpp-tutorial/110-a-first-look-at-the-preprocessor/ Header guards Because header files can include other header files, it is possible to end up in the situation where a header file gets included multiple times. So we make preprocessor directives to avoid t...
I am creating the model part of an MVC architecture. My one class will provide all the accesses to allow one to fetch system state. I want most of this state to be immutable as it shouldn't be changed and I don't want anyone accessing my model to be able to break the state by making a foolish change. However, The obj...
It is said, by Mike P. Wittie, in the course curriculum of computer architecture that, Students need to understand computer architecture in order to structure a program so that it runs more efficiently on a real machine I'm asking to more experienced programmers or professionals that have a background in this topi...
In a single directory with a Git root folder, I have a bunch of files. I am working on one of those files, X.py, with my friend Alice. The other files I am working on with other people. I want Alice (and everyone else) to have access to X.py. I want Alice to only have access to X.py though. How can I achieve this with ...
I have been seeing a lot of projects that have repositories that return instances of IQueryable. This allows additional filters and sorting can be performed on the IQueryable by other code, which translates to different SQL being generated. I am curious where this pattern came from and whether it is a good idea. My big...
The few LAMP web applications I have installed require me to create the necessary database tables myself, with a schema file, instead of doing it automatically with a script or setup page. Is this a normal and accepted practice? In my own hobby projects I find it much easier and hassle free to just create the tables in...
I have developed a Java program for academic purposes (non-profit, non-open-source). In the process, I made extensive use of many apache common libraries. The program is now to be set free on the net, so I was wondering what my precautions should be. My program will (preferably) consist of a single .jar file, having a...
So my CS professor gave the whole class a simple assignment. "Write a recursive function that will swap the order of a section in an array of chars." I thought to myself, "Easy. I'll finish this up in about 5 minutes and I'll get to work on my Trig homework before I leave." This is not what happened. An hour later, the...
Ok, so I'm at a point where I think I have my basics down. I'd like to think I'm just starting to become an intermediate dev. So, how do I level up here? It feels like I have reached my threshold, but I really want to break it, and move ahead, do more crazy stuff (for context, I'm talking about programming). So, what w...
I know a lot of programming languages ​​that can be used to web development like PHP, ASP, etc. but why many web developers use java programming language for web development?
I am trying to find a efficient algorithm in Java to find the repeating decimal part of two integers a and b where a/b. eg. 5/7 = 0.714258 714258.... I currently only know of the long division method.
I was recently asked this from my friend after explaining how µTorrent worked, he then went to ask me, "Could this be used for browsing the web?", (not a direct quote) but I found my self thinking about this for a while there after. Could someone be credited with making the first Peer-2-Peer browser? How could it sen...
I have a question, to explain that, what better than an entirely fictional example? Let's say you are a young developer just being employed in a firm. All data is stored in a huge database (let's say 500+ tables with billion rows). Your boss ask you to make some consolidation queries stuff. So, you start making your qu...
I have data available in the form of Structs and Arrays. I need some design pattern advice, which I can use to model this situation into corresponding Coldfusion Components. Here is the data definition I have objects like Hotel Apartment Bus Each object has it's attributes and images. Images have also different types...
A WebApp writes a stream of data coming over a network to disk as key/value pair and then reads & send it over network again after few milliseconds in 99% of case. In 1% of cases write/read can be few hours to days apart (really don't know). Latency is strict "no" in the app and we have to serve 100% of customers there...
I want to build a command line interface with menus and sub-menus and eventually the leafs of the tree should be operations like.. bank management -> account management -> add acount (insert account info) And I'm looking for a good way which works with the OO principles... Thanks for any piece of advice!
What are the general strategies to employ when attempting to ensure that a module of code will function correctly on the live system? A common problem we have at our software house is that we typically deploy solutions to a remote client's server, which hasn't got any software-development-related software installed on ...
I'm developing a .Net application that uses google protocol buffers. Historically the application used the approach, advocated by the protobuf-net team, of decorating the classes with attributes instead of using .proto files. I am now in the process of migrating part of the application's client to another technology an...
This isn't career advice, this is more of a question of logistics. When looking at job market and such there is a lower than what I think would be out there of database admins but I'm curious if database admins actually include strictly database developers, or of database developers are more under a blanket term "Prog...
I've been reading various techniques for splitting large user stories in helpful ways, such as by user workflow through the system etc. What I'm struggling with is how to word these smaller stories if all they achieve is facilitating the next step in the process and not delivering the application's main benefit to the ...
Recently we have had some turnaround in the shop I work in, because of this comments in our source code were made hastily and explained very little. We have started working on the departments first draft of coding standards and one of the bigger questions is: Should we implement this standard across the existing sourc...
I work for a large financial company that manages money for thousands of clients. This company has very complex business processes and they operate in a very dynamic environment. This is a fairly old company and over the years they have implemented many heterogeneous systems to automate processes within the company. ...
I am trying to build a project which uses an unmodified copy of libconfig (http://www.hyperrealm.com/libconfig/). libconfig is LGPL, but I don't want to open source any of my code. By my understanding, LGPL means I need to provide the source for the library (easy), and a means for them to use their own modified version...
I am developing a PHP Application that needs to display and accept content written in tamil. For example "login" should be written in tamil on the form. How can I achieve this ?
Reusing large amount of helpful codes made by other programmers is very tempting for me. I specifically refer to codes that can perform generic tasks, such as Data Access Layer (DAL) codes. I am just beginning a project using a newly familiar language, and I don't think programming from scratch is feasible. I can unde...
I'm starting to hear rumblings about this project called ASM.js. Currently their web site is terrible and confusing. Here's what I know from my research on the web. It is a subset of JavaScript that can be highly optimized. I'm guessing because it avoids the more dynamic parts of the language. Performance of code comp...
When and why would you generally sacrifice typesafety for a nicer programming interface? Let me give you an example: if you had the choice between two event aggregators, which one would you prefer and why? Reflective Version: SomeEvent.subscribe(instance, "nameOfAMethod"); //method called via reflection SomeEvent.fire(...
How can I handle timeouts in a network application. I'm implementing a provisioning system on a Linux server, the code is huge so I'm going to put the algorithm, it works as like this Read provisioning commands from file Send it to another server using TCP Save the request in hash. Receive the response then if suc...
I have built a JavaScript library that I'd like to release for free within my user community. However I want to keep it under control, and not allow my users to pass it on to others without my permission. As far as I can tell, a MIT or GPL license won't work for that scenario. What licensing options do I have? Backgrou...
I'm the lead programmer at a small software firm (currently 4 developers including myself), we develop bespoke ASP.NET WebForms applications for businesses. I joined there in 2010 just after graduation, so it was my first real job. After more senior programmers left, I was promoted to lead and we hired a bunch of junio...
During a recent project I've been working on, I've had to use a lot of functions that kind of look like this: static bool getGPS(double plane_latitude, double plane_longitude, double plane_altitude, double plane_roll, double plane_pitch, double plane_heading, double gimbal_...
According to Gregory Baker & Erik Arvidsson (Google), creating a named function and then passing that to setTimeout is actually faster than creating an anonymous function (reference: Optimizing JavaScript code -> Avoiding pitfalls with closures): Creating a closure is significantly slower then creating an inner functi...
I have a database table that stores uploaded files (excel files) in a blob field. Each record contains the uploader, upload-time, the upload ID (primary key) and of-course, the blob itself. At some point, I need to get that data from the database do something with it. Currently, I have a POJO which just mirrors the tab...
I am implementing a C preprocessor in C... I have the three functions: trigraph replacing function Line splicing function comment removing function However these functions work separately on files i.e. First function will take a file and replace the trigraphs producing a temp-file1 as output Second function will take...
I was wondering what is the best way to organize my source code. I was researching on SO and found https://stackoverflow.com/a/1398594/137261 but this source code layout is library specific and doesn't cover my situation. My situation: 10 own modules (100k lines of code) 15 external libraries (e.g. boost, sqlite, zlib...
I am looking for a recommendation of a best practice for XML comments in C#. When you create a property, it seems like that the expected XML documentation has the following form: /// <summary> /// Gets or sets the ID the uniquely identifies this <see cref="User" /> instance. /// </summary> public int ID { get; ...
I have a web app I would like to gradually refactor by adding structure to it. I have narrowed down the options to Backbone (with some plugins), Ember.js and AngularJS My goal is to refactor that app, which has the usual jQuery spaghetti and gradually add some structure to it. Requirements not a "all or nothing" fram...
I happened to create a mutable class like this: class Mutable<T> { private T value; public Mutable() { this.value = null; } public Mutable(T value) { this.value = value; } T get() { return this.value; } void set(T value) { this.value = value; } } And then it's often used in a method like this: bool...
For commercial and licensing purposes, what is the correct wording for differentiating JavaScript source code (written by the programmer and including comments) from the minified version used in production?
I have a class which represents an entity object in our system (for sake of argument, a Customer object) public class Customer() { private int id; private String name; ... // 30+ fields public Customer() { // empty constructor! } // getters and setters } I'm trying to refactor this so that the fiel...
My team is trying to find out the best way to test one of our components; the main scope is to check if the user/actor has the right to complete the operation requested. The component is formed by many functions that usually have the following structure (simplified): Example language: PHP public function addGroup($idEn...
Say some 20 people go to a shop and everyone buys something. When it comes to paying, 5 of them pay the complete amount of 10,000$ split unequally between them. Since everyone bought different things they all owe different amounts to the payers. Now there are multiple ways the payers can clear the balances with the pa...
I'm in the middle of designing an API for a very basic flashcard application for learning purposes and I'm wondering if you all think there can be any improvements. In the app, a Folder contains Folders and Sets. A Set contains Cards. The Homepage lists any top-level Sets and Folders that the I've created (but neve...
The upper management at our company has laid out a goal for our software team to be “15% more productive” over the next year. Measuring productivity in a software development environment is very subjective, but we are still required to come up with a set of metrics. What sorts of data can we capture that would measure ...
Say I have a class that implements multiple interfaces. I pass the same instance around using a different interface, depending on what the consumer is interested in. I am trying to remember what this is called. I know there is a fancy name for it - I thought it was "interface partitioning", but I'm not finding any hits...
Is there a way to make sure that modifications to free software are released even when no binaries of modified code are conveyed? Though it may sound odd and from what I understand, e.g., GPL requires to distribute source only if binary is conveyed to other parties thus making it possible for unlimited private use as i...
I'm writing a middle layer between vendor code and company business logic. Part of the exercise is to insulate our business logic from vendor's types to make swapping out vendor code easier. As such, I'm writing a lot of extension methods that do translation to and from. I'm placing these extensions in public static p...
Within the world of developers/firms specializing in building/deploying solutions built around software built/sold by Oracle (aka "Oracle houses"), what ORM middleware is considered as the "industry standard" (if any), based on your experience? We have limited experience on Oracle's stack, so would appreciate insights...
I've used git for my personal projects for years, but that's always working alone, not needing to branch much, etc. Our development team at work has decided we are definitely switching to git, and as one of the most experienced git user on the team I have the task of figuring out our project structure. Our current st...
Background I hate the way .Net/IEEE-754 handles equality of floating-point numbers (FPNs) (i.e. double, float). It requires the programmer to be prescient with respect to the yet-to-be-determined history of the number, as the programmer must choose a 'reasonable' value of epsilon where frequently no such value can be d...
Is it okay to have a strategy implemented as a non-static inner class or is it considered a bad practice? public class SomeClass{ private final Strategy strategy; public void someMethod(){ this.strategy = new Strategy(); //call some strategy method to run an algorithm strategy.doSomeWork(); } priva...
Say I have a method called 'functionA' that is called by a service and carries out a single piece of functionality, it is easy to unit test as it is does one thing only. If a few months later an new requirement comes in that requires another method 'functionB' to be called directly after 'functionA' has executed. What...
Some programming languages like e.g. Scala have the concept of Option types (also called Maybe), which can either contain a value or not. From what I've read about them they are considered widely to be a superior way of dealing with this issue than null, because they explicitly force the programmer to consider the cas...
For the sake of an exercise, say you have an input file with a series of lines of text with the objective of reversing their respective character sequences. Now introduce 5 threads that will each do the reversing, thread 1 taking care of line 1, thread 2 taking care of line 2 and so on. If the aim is to save these reve...
I noticed some duplicate code in a codebase I am working on that appended a filename to a directory path, so I decided to refactor it into its own method. The application I am working on is not well tested, however; I just set up the first unit tests on it two days ago, so I am very concerned to get as much code under ...
I work for an organization that does a lot of work with government data. We have a couple of different projects where we've abstracted out common text search/manipulation operations into reusable libraries, for things like standardizing the way politicians' names are displayed (e.g., transforming "MCDONALD, BOB (R-VA)...
Distributed issue tracking seems like a belting idea to me, but it has never really taken off in a big way. Is there a good reason for that? I am aware of: bugz everywhere too complex to set up too many requirements reasonably successful, used by some large projects fossil tries to integrate too many things, and en...
I was watching one of Uncle Bob's videos and he brought up the Database Interface Layer. He had this diagram showing it: These arrows show that the DB Interface Layer is aware of and calls the Application and Database layer, but not vice versa. The DB Interface Layer has "data records" in it. These are "classes" t...
How are effort estimations and duration estimations distinct? At present my understanding is that effort is related to the amount of work required for one person to complete a task, and duration is the total amount of time required to complete the task, irrespective of resources. Is this the commonly accepted definitio...
In a lecture, the lecturer described the following model : E - entry (the preconditions to a task). T - task - doing the task V - verifying the tasks quality D - Delivering the tasks X - Exit. or ETVDX If anyone is familiar with this 'generic compliance model', how does it fit into software development exactly? I...
I've got a simple authentication solution, where a user can log in with either email or username. Since I want to show the little feature in the acceptance tests but don't want to pollute them, I thought I'll introduce some randomness. Do you think this is bad or good? step "Fill in my credentials" do fill_in :user...
I am looking to write a Bayes filter that will act as an indicator of topic for a number of topics with a variable number of sources. Given a really big number of RSS feeds and here really big might only be a few hundred only few percent (let's say 2%) are interesting to a given group. What I want to write (in PHP) is ...
From time to time I find there is a need to build a service class. Something I can't really attach inside a model in order to respected GRASP and SOLID. So I created a class called AccountTransferService. Are service classes good design practice ? Do they represent a Model ? If a Service is not a Model what are they...
From time to time I implement functionality which requires asking user questions sequentially. Questions are conditional, that is the answer defines the set of the following questtiongs. Sure it is Wizzard UI design pattern, but for now I have no clear understanding how it is implemented from the point of view of softw...
I always try to follow the DRY principle strictly at work; every time I've repeated code out of laziness it bites back later when I need to maintain that code in two places. But often I write small methods (maybe 10 - 15 lines of code) that need to be reused across two projects that can't reference each other. The meth...
I think i've understood more or less what a parsed Scheme program looks like (a binary tree with atomic values on the leaves, if i have understood correctly). Can anybody please define to me, or give a reference, what a state (or a computation) of a Scheme program is? Is it just the current binding plus a position, o...
Say we have some thread that wants to check when another thread is finished its task. I have read that we should call a wait() type function that will make this thread wait until it receives a notification that the other thread is finished. And that this is good because it means we aren't performing expensive polling. ...
I'm writing some code that sets cookies and I'm wondering about the exact semantics of the Set-Cookie header. Imagine the following HTTP header line: Set-Cookie: name=value; Path=/%20 For with path does this set the cookie? / or /%20(unescaped) (/%20 or /%2520 escaped)? The reason I'm asking is that I should support n...
Activity network diagrams are used to determine the forward and backward paths for a project, and consequently to determine the critical path or maximum time to development. I'm already familiar with using work breakdown structures which break down functional requirements into necessary and sufficient deliverables, b...
I'm working on a translator in C++. Basically I want to parse the file with translations and store it in my program, so I can perform search through the words and simply access the corresponding word. My file will look like that: word|translation second word|second translation etc. It doesn't have to be | as delimiter...
Recently completed a project for handling credit card processing. One of the difficulties I faced was handling the delay / possible failure of notification messages. The most complex example was: an external system sending the request for payment my system turning that request into a request to the payment gateway sen...
I've read that ios apps can communicate via unique urls. An online tutorial on tutsplus says Communication between apps provides your application with an opportunity to take advantage of other application’s functionality, send and receive data between apps, and provide a rich user experience that “just works”. I have...
To better understand my question, let me elaborate the background of the subject matter. I work in a financial institution where the business module (credit finance) is constantly changing. In the IT world, however, the developers have a 6 week cycle taking list of projects/enhancements, put it in a timeline and busine...
I was studying the book Structure and Interpretation of Computer Programs and in section 1.1.5 The Substitution Model for Procedure Application the author explains the concepts of normal order and applicative order, which I believe I have understood well. Now, I am taking a course on Coursera called Function Programmin...
I have been reading about the libraries people have written for languages like Java and C# that make use of byte code weaving to do things like intercept function calls, insert logging code, etc. I have also been reading up on Lisp/Clojure macros in an attempt to better understand how to utilize them. The more I read a...
I'm using the BigRational class from bcl.codeplex.com. It will be opensourced when it's finished, and it's modified. However, I don't get legal jargon, so even though it's quite short, could someone explain to me what it does/doesn't allow you to do?
I would like to write some long text in some structure to allow a set of operations on that text. The question is which structure or format should I use, which suits best the use that I plan to do of that text? Next I describe that use: I would like to write text in natural language, possibly with translations to seve...
So say you had a site like StackExchange. Now imagine you created a machine-writeable API capable of posting questions and comments and doing everything your browser can do. Of course, about 5 minutes after launching, you'd have so much spam that you would probably have ran out of room on your database servers and wil...
I have heard two separate uses for the term controller when speaking of the Model View Controller methodology. An intermediary section of code that communicates between the Model and View, tying them together. The module that deals with input, similarly to how the view deals with output. For starters, which definitio...
I am trying to make my way back to JavaScript (been there last time some 7 years ago) with the help of lovely "Eloquent JavaScript" book. While I admire author's capabilities and approach, I have also began being concerned. I am from C/C++ background and there I learnt it rather hard way that funky constructs often und...
I've heard the term pop all around. I've read various articles regarding the subject and heard two main definitions to the term "Service Location": A glorified Registry - Bad practice, global variables, general evil. A type of Dependency Injection Container - Can help with managing dependencies, making modular and ext...
I'm in the process of building a new pledge management system for one of my clients, a charity foundation. I have already built one for them (it was done using Delphi), but its feature-set is a little limited. Now, I have decided to move to PHP and use the Laravel framework to manage the database for the new system - i...
I have a basic issue with the MVC architecture. I am aware that the View usually listens to the Model. But how are user requests propagated to the Model? Currently I do it like this, when the user clicks e.g. the update Button in the GUI. So the ActionListener calls a method of the View. The View calls a method of the ...
first of all I am new here and I hope that this is the right place for my question. I have a question about the recommended architecture of a project. IDEA: Automate some calculations concerning to aerodynamics. I have some input data and I need to process this data in several sub-calculations. You can see such a calcu...
I do not know if this would be the right stack exchange site to ask this question but I have been researching on RAD (Rapid Application Development) and Agile methodologies and was trying to find their diagrams but if I google images this, it comes up with many different diagrams. So based on the images I drew my own d...
I started to get more and more engaged in open source development and I was wondering if there are any guidelines on how to properly document and maintain a fork? For example, let's say you fork a project to add some specific thing to it. Maybe you do not want to send pull requests back to the original project or maybe...
I have the following type hierarchy: interface I: ----+class B implements I ----+class C implements I ----+class D implements I I have another class Consumer1 that supports types C and D but not B (in its various methods) and a class Consumer2 that supports type B. I have total control over Consumer1 and C...
Is the following guaranteed to return true for all numerical and non-zero values of x? bool IsRoundTrip(double x) { double y = 1 / (1 / x); return x == y; } What conditions would cause a discrepency?
Considering that it's April, 2013; do I still need to worry about non-JavaScript capable/enabled clients? Note: This question excludes having helper text with: JavaScript is required to view this page, upgrade to a modern browser or modify your settings BTW: Just to be clear, in order to cater to non-JavaScript capable...
I am a Sr java Developer and have recently joined a new team. Here I have been asked to create a functional document looking at the code of a legacy application. This application was written about 8-10 years back, which is currently running in live environment but due to lack of documentation it is difficult to be setu...
Main I'm making a scripting language using C++. I plan to use it with a simple test game editor. But I have to make a support for bindings to call game engine's nodes' methods to update positions, rotations, etc. What are the main approaches for this? The game engine I plan to use also supports lua, so maybe I can also...