instruction
stringlengths
34
19.9k
I'm in a situation where I have a list of items that need to be displayed depending on their properties. What I'm unsure of is where is the best place to put the filtering/grouping logic of the viewmodel state? Currently I have it in my view using converters, but I'm unsure whether I should have the logic in the viewmo...
Are buffer overflows acceptable from a graduate developer? Are we setting the bar too high? What are the expected capabilities of graduate/junior engineers? Context: We are currently recruiting for a Junior Developer position working mainly in C on Linux. As part of the process, we require candidates to complete a code...
I've inherited a .NET project that has close to 2 thousand clients out in the field that need to push data periodically up to a central repository. The clients wake up and attempt to push the data up via a series of WCF webservices where they are passing each entity framework entity as parameter. Once the service recei...
My problem is as follows. I have an array of n strings with m < n of them distinct. I want to create a one-to-one function which assigns each of the m distinct strings to the numbers 0 ... m-1. For example, if my strings are: Bob, Amy, Bob, Charlie, Amy then the function: Bob -> 0, Amy -> 1, Charlie -> 2 would meet ...
I've been using a single scheduler to handle all my scheduled tasks (Quartz.Net). I'm starting to rethink how this operates because if I need to update 1 task, I have to stop the entire process, release the update, and start it back up. My Question: Is it better to have many Windows Services running individual tasks (...
I was reading a book on OS and got confused between different terminologies. I hope i will get my doubt cleared here. These questions might be very basic for some experts, but i find this platform best suitable for such clarifications. Processes are run by CPU and this whole operation is managed by OS. For Single core...
What happens when one process has child threads and a child process, will child process inherit all child threads of parent process? Assume OS is Linux. Let it be Java Threading model.
Brief History I am new to Automated Unit Testing and Mocking objects world; previously we used to do Unit Testing (including Integration Testing and we mistakenly referred that as Unit Testing) manually, but now we have planned to change all of that to I am pushing our organization to do Automated Unit Testing. Problem...
I am developing an application that consumes data from an external service. The application is being implemented following a typical layered architecture with UI, Presentation, Domain and Data layers. The service client resides within the Data layer. As is typically the case, I do not want the UI to 'lock-up' while w...
A discussion has come up at work and I want to get the opinion of other programmers. During my time in college, we only used SVN for sourcecontrol. Everybody commits to the same server and all changes are pulled to all machines. In this system, it's easy when you should push your changes: when you're done with your cha...
I have a class called Timeline. I want to allow several defaults in my code, such as a Timeline with a Start event (The details are not needed. All that matters is that I have a class, and I want to be able to have a few different default setting). Here are the options I thought of: 1) Following a GUI/Swing inspired id...
I've just found something strange in a code written by company which I work for. In an embedded software where dynamic linking doesn't exists, shared library (released on a GPL licence) is copied into an object which is statically linked then. Here is a piece of a makefile: $(TARGET_DIR)/$(PHOST)_P_LIBxxxxxx.o: $(TARG...
I found one JAVA project useful to our commercial software which is developed using C#. The JAVA project is under LGPL. My understanding is (please correct me if I am wrong) if I use one compiled LGPL library (for example, .dll in Windows), I don't even need to disclaim the license information. But if I need to make so...
In the past usually I have only had to estimate web applications based on browser support. But for more recent projects device and platform support are also very important as well (screen resolution). I am having a hard time providing an estimate to account for "responsive design". How much additional time (estimate ...
How can I describe the growth function in terms of n for the following algorithm? What is the bounding function (the Big-O)? Is it O(n^3)? for(i = 0 to n - 1) { c = i + 1 for(j = c to n) { arr[j] += arr[i]; for(k = c to 0 step -1) // what does the keyword "step" mean? { ...
I have several small projects running on different embedded hardware, and about 50% of their code is identical (typically some drivers, their operating system, and some libraries). I want to merge those small projects into a single git repository so that it becomes easier to centrally maintain them, for example to upda...
Given the following code: public interface IUserDataProvider { ICollection<SomeClass> getSomeClassRecordsForUser(int idUser); } Is it possible to define (via documentation) an expectation that any implementing class returns null instead of an empty collection (or vice versa) when no records are found? I re...
I am in process of planning web application by following the best practices and approaches of software development. I am building this application using zend framework 2 and going through its documentation and best practices of building applications through zend framework 2 and MVC patterns. Right now I am confused abo...
I have been working on a framework for years. It is solid, extensive and tested. It is exactly what the employer needs for the foundation of its new project. There is no point in rewriting the whole thing from scratch or using a competing open-source alternative. My desire is to give a free, non-exclusive, non-redistr...
I wanted to get an idea of categorizing bugs based on how easy is it to solve and how much benefit it will give me. for e.g., if there is a bug which will take say an hour (double file close etc.) to solve vs another which takes a day (segmentation fault). But if solving the first bug is not very important, then I'll p...
I'm wondering how to write BDD test cases for a real system. All examples I can find are trivial and do not answer the question. Sample use case/story basically goes like that: User is on the main application page He clicks retrieve to fetch some order to work on He fills 4 textboxes and hits submit. Something happens...
Windows 8 seems to have chosen to silently shutdown applications that misbehave, there is no message informing the user something bad happened and no information on why the application closed. I heard through the grapevine that employees at Microsoft are tired of customers blaming them for crashes and that they believe...
Is there a way to prevent the editing of HTML and CSS contents in a page using Firebug-like tools? I found that some users are editing some values in hidden fields and some contents which written between a div or span tag for gaining some profits. They are doing mostly by editing with help of tools like firebug. Is the...
Our Scrum Master keeps referring to bugs as technical debt. Is he right, are bugs considered to be technical debt in the world of Agile?
I have rather specific question about licensing but first of all I would just like to state that I already read a lot of Q&A's here but I'm still not sure about the problem in that particular scope. As I've understand from other Q&A's, you are allowed to distribute your commercial application even with LGPL library as ...
Out team is at the cusp of a new project. One of the components at the boundary of the system is the component which interacts with a printer through an external COM component (referenced as a usual dll). The COM component returns integer codes if there were an error whilst command execution. Lets consider a concrete c...
Is flat addressing model generally superior to a segmented one? If so, why? If not, what instances would call for each over the other and why? My understanding of memory models surrounds the IA32/x86-64 Architecture. So if you give architecture specific examples, they will be most helpful if kept relevant to that.
Part of my job is working on line-of-business applications built around client-side databases, such as Access or FoxPro. Other times these local LOBA's have direct document access, such as an exact one-to-one mapping between a logical object an an XML node or references to bookmarks in Word Documents or ranges Excel s...
While it takes a turing complete language to create any imaginable program, is it possible to compute most "useful" programs with a non-turing complete dynamically typed language? For example, is there a non-turing complete language capable of solving the Project Euler problems?
Occasionally in code at GitHub I see tags "cc", "vv" and "^^". Do these have any special meaning? Example: // cc MaxTemperatureMapper Mapper for maximum temperature example // vv MaxTemperatureMapper import java.io.IOException; import org.apache.hadoop.io.IntWritable; import org.apache.hadoop.io.LongWritable; import ...
I'm looking at the wiki on ExtJS, the wiki on List of rich Internet application frameworks, and the wiki on Comparison of web application frameworks. I'm confused. The first line of the ExtJS wiki page says: Ext JS is a pure JavaScript application framework for building interactive web applications[1] using techniques...
I am reading the first chapter of the Gof book. Section 1.6 discusses about class vs interface inheritance: Class versus Interface Inheritance It's important to understand the difference between an object's class and its type. An object's class defines how the object is implemented.The class defines the object's i...
What is the difference between a Future and a promise? (In Akka and Gpars.) They look the same to me as both block and return the value of the future when get is called and a promise is to get the result of a future.
I am currently doing an internship in a large corporation and they are undergoing many changes in software delivery structure (moving to Agile). In the past couple of months I have noticed this religious attachment to Clean Code practices and the book being like a bible for the developers. Now, one of the most importa...
I'm reading the "Effective Java" book which suggests to favor composition over inheritance. The example it gives shows something like this: public class InstrumentedHashSet<E> extends HashSet<E> { // The number of attempted element insertions private int addCount = 0; public InstrumentedHashSet() { } ...
I develop a mobile app that displays information about the bus system in one U.S. city. The de facto official language is English, but there are many students from other countries—China and South Korea, especially—and I’d like to internationalize and localize my app, both to make it more appealing to non-native English...
Asynchronized programming seems to be natural in Javascript - it is the "first choice" to do many things. But in most other programming languages, asynchronization is more like a second choice rather than first choice. What makes asynchronizated programming so popular and natural to Javascript?
I am new to Agile and scrum and want to ask few things. Suppose I havetwo user stories 1, 2 Suppose I finished story 1 in sprint 1 but while doing sprint 2 I did something which breaks something so that my things in user story 1 broken and I need to spend more time on that again. What do I need to do for that case?
I read quite a few resources on the internet and now I am quite confused about the existence of pointers in Java. Some claim that there are pointers and some claim that there is no such concept. So what is the truth?
I have WCF webservice which serves to various mobile application. This was implemented with typical HTTPS/SSL. But there are some cases like Replay Attack needs to be considered in the security aspect. OAuth 2.0 looks like a viable solution for this problem (using nonce). And I can see some examples on web using Dotnet...
What is the real use of interfaces in Java? What is meant by programming to interfaces? I heard these things several times but I don't know what it is and why it is used.
I was wondering how we could ingest CSV files located on a Red Hat Linux server into SQL Server database tables. I know we can write a stored procedure/bulk insert to read the files that are located on the same Windows server as SQL Server and update the database, but not sure how to do it when the files are present on...
So usually when working with the MVC you have a controller that controls the input a model that process it and makes it ready for the user and a view that display the "result" to the user. Now when creating this pattern you seperate the code into their relevant place. for instance the controller code goes into the cont...
This question is intended to apply to any OO programming language that supports exception handling; I am using C# for illustrative purposes only. Exceptions are usually intended to be raised when an problem arises that the code cannot immediately handle, and then to be caught in a catch clause in a different location (...
I work for an engineering consultancy who do a combination of industrial design, mechanics, electronics and software. By their nature - or perhaps simply by history - the overall development philosophy has been waterfall. But when I joined I was surprised that Agile, which I would now say is an industry standard, had b...
I'm managing a team of like 15 developers now, and we are stuck at a point on choosing the technology, where the team is broken into two completely opposite teams, debating over usage of WCF vs. Web API. Team A which supports usage of Web API, brings forward these reasons: Web API is just the modern way of writing ser...
I am new to the construction and design of a web app so I'd like some advice please (Django is my framework). I'm trying to code up a "how-to" website instructing users the step-by-step process for doing a certain task. I'd like the navigation of the website to be something like this... http://technet.microsoft.com/...
So I am building an application with Angular and have started to get into UI testing with DalekJS (http://dalekjs.com). As I have been writing these tests I have been thinking to myself, should I even bother with writing unit test that that are UI/UX components. Now my angular services generally don't have anything to...
I do not have the book “Practical C++ Programming” by Steve Oualline but I was reading his Ten Commandments for C++ programmers at The Ten Commandments for C++ Programmers and I was wondering if the first has been correctly transcribed? For reference the transcription is: Thou shalt not rely on the compiler default m...
BACKGROUND:optional Since 2002 I've been slowly building my own Windows Native C++ library. And let's just say that I have jumped 150KLOC (reusable code) having everything I need and the kitchen sink in it (from most of the Windows API objectualized to a decent IMAP4 client implementation and the WordPress XMLRPC clien...
I am reading a book on Java Programming, and want to confirm I understand the definition of the word "vector". Wikipedia says vector is "A one-dimensional array", source http://en.wikipedia.org/wiki/Vector. Wouldnt it be simpler to call the array simply an array? Is there any reason we need to use such fancy langu...
I'm usually very careful to keep my Model, View, and Controller code separate. The thing is JavaFx properties are so convenient to bind them all together. The issue is that it makes my entire code design dependent on JavaFx, which I feel I should not being doing. I should be able to change the view without changing too...
There are a few questions around this subject: Is creating all indexes at the start (design) over engineering? In reality, I've added indexes after performance issues were found and we 'explain plan' and add indexes as needed (i.e. not for all relationships). Should I just skip creating indexes before it's needed beca...
I have a rasterized image that contains two colors: white and black. The black portion is entirely connected and looks like a big blob. Is there a good way to estimate the length of the boundary between the regions? One method I have considered is to simply count how many "edges" of the rasterized grid have a differe...
I have two classes Output and Timeline, neither of which violate SR, but the two of them are linked together. So what I'd like to do is have a class called Elco (there's a reason behind the name) that has both of them as subclasses. For various reasons (this is just a simplified version) it's important that I don't vio...
I'm working on a legacy VB.Net code base. There are very few functions that return values, most of the code is in subs/void methods. The general strategy seems to be to pass everything in by reference, mutate it, and then observe the mutated state. There are some methods that have as many as a dozen parameters that are...
'Cohesive classes reduce coupling' So, if cohesive classes or connected classes reduce coupling (union), which piece of the puzzle is missing me? BTW, I took this sentence from an article about identifying classes before any developmemt, which I'm trying to figure out the whole sense of why, when, how to use 'that' par...
This is a theory question for me just to try and write better code. I am pretty new so hopefully I am using terms like state in the correct way. How I should be thinking about this problem? I am coding something that sort of works but whatever I do it seems complicated, hard to understand and hard to modify. I'm playin...
I currently have several web applications that offer document upload and storage. I am now trying to create a central document management service that these application can leverage to store and retrieve these documents. Currently the documents are stored on disk. The file name is a Guid and its real file name and data...
I have found a website where the text is select protected. How can i make this without JavaScript. I think it is possible by using CSS. A set of paragraph is protected with non selectable contents. But i don't know how to do.
I have some code that creates objects on a webpage by using draw on HTML5 canvas. In my aspx file I have functions like: function drawLine(x, y, w, h, width) { var canvas = document.getElementById('cpMainContent_myCanvas'); var ctx = canvas.getContext('2d'); ctx.moveTo(x, y); ctx.lineTo(x + w, y + h); ctx.lin...
I have a class derived from SQLiteOpenHelper which is all about working with a database, i.e. tables creation, insertions, data selections. All methods which deal with data selection return a Cursor. What I really want is to get a list of objects rather than a cursor, at the same time I don't want my class to do a lot ...
I've been working as a software developer for about 2 years by now. It seems obvious that in a field so rapidly evolving as software development, you need to spend time on learning new technologies, frameworks, etc. I always thought I could take it for granted that if I need to learn something to solve a problem at wor...
I am doing some investigating and research into programming "big data", and am particularly interested in QuantCast (QFS) because it is written in my own favourite programming language, C++. Looking at how this may play a part in the solution to certain "big data" problems, I know this can manage implementation of peta...
Note: if you need to consider a specific OS to be able to answer, please consider Linux. Whenever I run a program, it will be given a virtual memory space to run in, with an area for its stack and one for its heap. Question 1: do the stack and the heap have a static size limit (e.g., 2 gigabytes each), or is this limi...
I would like to know your opinion about my setup right now, how I do things with SVN and if you could find some better solution for me. I'd appreciate it very much if someone could come up with some better solutions for my problems. I would like to do it the best way possible and the most efficiently. My situation is a...
I have a server application that distributes stock quotes to a number of clients on our internal network. As the number of clients has grown, unicast (TCP) connections between the server and the clients do not scale anymore. Hence, I have been looking into multicasts. Because of the inherent unreliability of IP multica...
If I have a websphere MQ topic and 3 listeners have subscribed to the Topic. One listener is down when a message comes in the Topic. Other listeners consume the message. When the listener comes back up, will the message still be there? My gut feel is no, but i cannot say for sure.
Suppose one had a relatively large program (say 900k SLOC in C#), all commented/documented thoroughly, well organized and working well. The entire code base was written by a single senior developer who no longer with the company. All the code is testable as is and IoC is used throughout--except for some strange reason ...
From what I've read, genetic algorithms are usually (always?) applied to chromosomes of bits. So if a problem involves maximizing a function that takes integer values, the integers are first encoded as bits. Is this mapping necessary? It seems that you could take chromosomes of integers and apply crossover and mutation...
I recently posted here asking about the drawbacks of having a server process bind to a dynamically assigned port. That approach came about because xinetd, which launched the server process, allocates STDIN and STDOUT as the server's communication channel to the client, and we wanted the server to use a bidirectional s...
I am writing a user story and have a simple questions. Consider, I am writing it for login module which calls internally a web service to authenticate the user and returns the data. How this can be converted into a user story. Should this be written as: As a user, I would like to login to the system and see the resul...
I am in the middle of a disagreement (cordial, of course) with my lead about proper branch naming. This applies to bug-fix and small feature branches, not long-running feature branches. For long-running feature branches, we agree that human-readable names are better. Here are the two points of view: Mine: Naming bra...
I am curious if any open source project actually tracked effort by a measure like self-reported hours put by unpaid voluntary coders. Do they? How? Why? I don't care for cost estimations functions of SLOC or any other nonsense variable. I suggest as answer an example with multiple contributors with a explanation of how...
We have several bugfix branches that are starting to pile up. They have been merged into master, and deployed to production. Is there a good benchmark for when these branches should be cleaned up? Should they ever be cleaned up, or is it good to have the historical data?
I'm little confused with the motive and need for frameworks. At what stage should I use frameworks? For example, if I want to use some CSS framework, should I learn CSS at pro or advanced level to use it?
I often have superclasses that contain a more abstracted form of a class as a member variable than my subclasses need. I find my code littered ((ClassName)variableName).methodName(). Is the best way to solve this to create a protected/private method called something like getVariableNameAsClass()? It's not much shorter ...
I was reading the Scrum documents and it says that the tasks in Sprint should be "potentially shippable". I am confused by what this means. Suppose in Sprint 1 the goal was, "user registration form". How much detail do I need to add for something to be ready to ship? For example: I can show the simple form with field...
I am thinking of using JIRA + GreenHopper for my project management. I have seen that Green Hopper is for making User stories, sprints. I am not able to find how do i need to add tasks, or how to break user stories in to sub stories. Do I first need to create project in JIRA and then use Green Hopper or I can use use ...
I would like some help/advice on a design pattern or similar I could use for my problem. I have some shared functionality in my code and I use the Strategy pattern at present. I have a base class named "ProjectSectionBase" and from here I have 2 derived classes, "ProjectSectionStandard" and "ProjectSectionSuperior". No...
Portal website usually have very large number of posts. For example I have 50,000 posts in website. I even created the google sitemap as chunks and included it in main site map file. But I have no idea how to deal with RSS feed. 50,000 posts in RSS feed file size will be very huge, how to handle the situation?
Given is an integer with the value 5. Given is a range with start and end values of 2 and 5. So is the integer 5 now between the range? What should a 'InBetween()' method return and which one is the correct representation of 'between': int val = 5 if(val >= 2 && val <= 5) // would return true if(val > 2 && val < 5)...
Quite often I find myself referring in text to objects which have strict naming conventions e.g. Java objects, processes, services. I find myself in a dilemma over how to pluralize these names. It seems wrong to pollute the meaningful name by adding an 's' - or worse, a plural that modifies the rest of the name like ...
I'm drawing a class diagram and noticed that sometimes I got a relationship (composition or aggregation) where the item uses the container, and sometimes not. What is the visual difference in a composition where the item class uses the container class vs where the item class doesn't know about the container class?
HTML 4 supports a "title" attribute that can be inserted inside any HTML tag. Inserting this attribute effectively gives the element a tooltip that pops up when the mouse moves over it. It just seems like a bad word choice.. or am I missing something?
Is there a best practice for how to document the source code you're releasing? Currently, we have a table of the versions of the software, what SVN tag it's labeled as, what SVN rev that tag was created at and the SVN URL. Then, our CM (Configuration Management) department wants us to include a file listing of all the ...
I have k csv files (5 csv files for example), each file has m fields which produce a key and n values. I need to produce a single csv file with aggregated data. I'm looking for the most efficient solution for this problem, speed mainly. I don't think by the way that we will have memory issues. Also I would like to know...
I want to create a database that tracks different projects and their finances. As finances are tracked monthly, a new column has to be created for each month. I could create all tables together at the start, yeah, but I guess it would be bad development strategy. Also I would be guessing the number of months. I will be...
I use JavaScript with JQuery for a Rails application. I have some dynamic behaviour in this one. As a Ruby developper, I like TDD/BDD, specialy with RSpec. For the moment, I test my JavaScript manualy. It's not the best way because a change, somewhere, can break the code somewhere else. The is a lot of avantages of usi...
About a third of my code is wrapped inside a Facade class. Note that this isn't a "God" class, but actually represents a single thing (called a Line). Naturally, it delegates responsibilities to the subsystem behind it. What ends up happening is that two of the subsystem classes (Output and Timeline) have all of their ...
Lets say I am writing a blog web application using MVC pattern. Typical layout for the main page of the blog application is - some kind of a post index in the main part, and aside there are some addition parts, like timeline, tag navigation panel, subscribing panel, etc. Those controls also appear on a single post view...
Let's say I have a sorted array of ints like so: int[] numbers = new[] { 10, 20, 27, 30, 55, 70 }; What is the most efficient way, given a value, to find the value in that array (or the index of it) that is closest to the value but is not greater than the value? For instance, given the value 26, it would return the 20...
I've read articles with very conflicting arguments on t-shirt estimates. Neither article seemed all that credible so I thought I would bring this up here. Are t-shirt estimates a good idea? For those who haven't heard of this: T-shirt estimates are the practice of giving very vague and high level estimates when given v...
I'm comparing floats in Java right now and the simplest formula is: Math.abs(a - b) < THRESHOLD When naming your variable for the threshold of difference, should you name it delta or epsilon? Specifically, which of the two is the correct term for the smallest value that a floating-point number can represent? Is the te...
I hear this term around the office, and know it's relevant to software development lifecycle. What does "promote" mean? Context: e.g. to promote a file.
Suppose you have an arbitrary code base, C, possibly composed of multiple programs, none of which fall under a copyleft license. Suppose this code, taken together, does the same job as a nice integrated program, A licensed under some copyleft license like the GPL, but that for whatever reason the GPL code is superior (...
The case where a source-level operator actually describes an operation to take place at some future point, thunking the real operator together with its operands. I don't know if this has any kind of general name, or perhaps it's too low-level a design element to be thought of as a "pattern" at all, but anyway it's an e...
We call static final fields as constant, rather I should say Class constant. So can we call just final fields as Object's constant? Is it right to say this? Edited :: Consider the following code : class JustFinal { final int a=20; final int b; JustFinal(int x, int y){ //a=x; b=y; } ...
I am learning how to make responsive layouts for sites and web applications. It's said we need to use media queries to find out the width(resolution) and then select the layout(wireframe) for that screen. I would like to know how many layouts(wireframe) should I make for? Please advice as per your experience. For exam...
I've heard that logic programming can serve as a general-purpose alternative to other programming paradigms such as OO or functional programming. (Since Prolog is Turing-complete, this must be so!) However, I'm having trouble seeing how one would implement an interactive program, like a simple, graphical console game ...