instruction stringlengths 34 19.9k |
|---|
There is an issue which appears while running the application. It is not an Exception, but the desired UI change is not been implemented.
While debugging to find the code which should be changed to fix this problem, the UI changes can be seen correctly, To be specific, if we put one breakpoint in the class where it is ... |
In a C++ code base I've been working on, they have a bunch of instances of the observer pattern, but it's a little different from the classical pattern. In the classic, the Observer is a specific interface with specific method(s) that are called when the Observable changes or has new data.
Observable ... |
I started my new job as a JS developer in November and starting implementing Backbone pretty soon after. This was a big enough learning curve for the team (me included), however I'm thinking about looking at CoffeeScript, which I'm guessing would require everyone on the team to know it? Is that too big of an ask, just ... |
We've started implementing some caching code in our MVC project. We've derived from .Net's ObjectCache to store it in a SQL database.
What we do right now is in each method we want to cache we have code like this:
public StatusCounts GetCounts()
{
var cache = new SqlCache<StatusCounts>("mykey");
if(cache.HasCach... |
I was recently hired by a large multi-national corporation to head up mobile development for their sales operation/support team. In a company of close to 10,000 people I am, at least in the America's, the only mobile developer. They are testing the waters and phase 1 (temp-to-hire) went well enough for them.
Now they ... |
I am interested in integrating the results of 3rd-party news API's into my for-pay application. The APIs would be a very small part of the app (e. g. the app is not just reselling the APIs). I have found that many APIs such as Yahoo have "non-commercial" conditions like the following:
YOU SHALL NOT: Sell, lease, share... |
The iterator pattern is very clearly defined. What would you call the consumer of an iterator?
|
-I'm trying to figure out how to identify Application Services in my application. I think I can identify a Domain service by 2 things:
It acts as a facade to the repository.
It holds business logic that can't be encapsulated in a single entity.
So I thought about this simple use case that I'm currently working on:
An... |
I read that Liskov's substitution principle is violated if :
Preconditions are strengthened, or
Postconditions are weakened
But I don't get fully yet how these two points would violate Liskov substitution principle. Can some one please explain with an example. Specifically, how would any one of the above conditions c... |
Recently I was looking at an open source project to contribute to however after going through the ugly code base (which seems to break quite a bit) and reading some things about the current maintainer I decided it would be a good fit for me.
Right now my thinking is to just start a new project with the same goal but us... |
I am facing a problem with changing behaviour of a library (thus cannot or don't want to change its internals because of future updates, etc.).
In this library there is an abstract class which shares few methods with all its subclasses. Now I need to change few methods in this abstract super class without changing the ... |
On the Android operating system details about the phone are available via the Android.OS.Build class. These details include things such as the phone manufacturer, model, version, etc. The customer may want us to collect this data and save it to our database for analytics and tracking. I think this raises some privacy c... |
It seems to me that the best way to manage priority for programming tasks in a backlog is to simply put them in order. Do the top task first, second one next. If priority changes, re-order the queue. I thought this was exactly how things were supposed to work in Agile.
I have yet to find an online open-source team task... |
Every example neural network for image recognition I've read about produces a simple "yes" or "no" answer. One exit node corresponds to "Yes, this is a human face," and one corresponds to "No, this is not a human face."
I understand that this is likely for simplicity of explanation, but I'm wondering how such a neural... |
I'm writing a WinForms desktop application which will be shipped out to several different clients and am wondering what the best way to implement a user configuration file is. Normally I would use the built in Settings.settings or app.config to store user settings but in this case what I want to store is unique for eve... |
I work on a open-source web application (Moodle) which connects to a number of external services such as Google Drive, Dropbox etc. to allow users to exchange files with these services.
Primarily we are using OAuth based APIs to connect with these services. One of the user interaction problems we are facing is that ou... |
I am talking about normal PC applications, memory should be sufficient.
They declare global or member variables.
In each function/method, they use the same global/member variables.
At the beginning of each method, the variables are re-initialized so the old value is never used.
Why do they keep the variables but no cha... |
I am developing a 2d game where the world is made up of tiles.
I have an overworld and a "current world":
the current world represent the current tiles on screen at any given time, currently this is in a 2d array (14x10 elements).
the overworld is the entire world, currently 28x20 elements, which means there are four ... |
I am using Codeigniter framework for PHP on Windows platform. My problem is I am trying to track progress of a controller method running in background. The controller extracts data from the database(MySQL) then does some processing and then stores the results again in the database. The complete aforesaid process can be... |
Having
a minimum
a maximum
number of ranges
a value between minimum and maximum
I'm trying to come up with a method, or two, which would calculate which range the provided value belongs to.
For min=1, max = 10, number of ranges=5 the ranges would be
[1,2],[3,4],[5,6],[7,8],[9-10]
The other method would behave like... |
Several concepts related to REST conflict in my head when I try implementing it.
I have a REST-ful back-end API system that holds the business logic, and a web application that provides the UI. From various resources about REST (particularly, REST in Practice: Hypermedia and Systems Architecture) I know that I should n... |
Is there some syntax (other than a series of if statements) that allows for the use of a switch statement in Java to check if an object is an instanceof a class? I.e., something like this:
switch (object) {
case instanceof SecondObject:
break;
case instanceof ThirdObject:
break;
}
Sidenote: ... |
We use SVN and PhpStorm at work. Recently our team has grown a bit so there are several people working on the same project at a time, sometimes on the same file. We've run into the problem where people don't update before comitting and overwrite the changes that were made by someone else. This is a hassle. I don't know... |
I'm pretty new in our develepors team.
I need some strong arguments and/or "pitfall" examples, so my boss will finally understand the advantages of Unobtrusive JavaScript, so that he, and the rest of the team, stops doing things like this:
<input type="button" class="bow-chicka-wow-wow"
onclick="send_some_ajax(... |
From https://stackoverflow.com/questions/4544588/difference-between-iphone-simulator-and-android-emulator
The difference between emulators and simulators is that emulators mimic the software and hardware environments found on actual devices. Simulators, on the other hand, only mimic the software environment; they other... |
I want to know if it is possible to write to a log/text file dynamically generated HTML in asp.net tags in an .aspx page using HTTP modules.
By dynamically generated HTML, I mean the html content that asp.net generates in response to statements between the tags <% %> or <%# %> or <%$ %>.
So when asp.net renders a page,... |
I am developing an application where I am taking dynamic gestures as input and then mapping them to keyboard controls. By dynamic gesture, I mean for example hand moving from left to right or hand moving right to left.
I have four gestures: hand moving bottom to top, top to bottom, left to right and right to left.
I am... |
Where is the best place to validate input parameters of function: in caller or in function itself?
As I would like to improve my coding style, I try to find the best practices or some rules for this issue. When and what is better.
In my previous projects, we used to check and treat every input parameter inside the func... |
I am an advocate of commenting on source code and documenting software products. It is my personal experience and observation that working on source code that is rigorously commented has helped me in different ways when I have had to grow software or maintain it.
However there's another camp that says commenting is ult... |
With regular git and GitHub, I can do a code review by simply creating a pull request of the feature branch I'm working on to the master branch. How would I do code reviews with git-flow? With a workflow step like git flow feature finish (which merges the feature branch into the develop branch), I'm confused as to wher... |
I've been focusing on multimedia applications and I've noticed that most applications don't use Java in the back end. Instead, I see solutions with PHP/ROR/Python and Flash/Silverlight without any trace of Java in the application stack.
What part of Java is either limiting or constrained - or perceived as limiting or c... |
I am working with multiple websites (freelancer) and a good amount of them I write using C# MVC4.
I created a very good boilerplace project that I plan to use on every next starting mvc4 application I build, however the namespace is named Website. I also do a lot of copy-paste from one project to another and then I alw... |
When developing an application in a team not everyone on this team will be equally good developers. Some will be skilled in some things and some in others and some not at all.
As a team working in an agile process you usually have a definition of 'done' to follow. In our DoD it says never to merge code that is not docu... |
I am coming from a .NET background and beginning my journey into the Mac OSX\Ruby\Rails environment.
A lot of the resources I have found such as this one have between 5-10 steps for setting up a Ruby\Rails environment.
My question is, what are the bare minimum requirements for setting up a working Ruby\Rails environmen... |
I'm trying to learn PHP OOP, but when I've followed tutorials, all the examples seem to involve things like:
class Human {
$_sex;
public function setSex($sex) {
$this->_sex = $sex;
}
public function getSex() {
return $this->sex;
}
}
(Pointless example, but hopefully you get what I... |
I'm wondering, what are the white box testers using to create test cases? The actual code? Some kind of diagrams?
I mean, if I am given a task to create test cases for complete branch coverage, is it possible they give me a code?
Because I saw something like that:
Reader r=null;
if(condition)
{
r=new Reader();
}
r.to... |
Overview
I considered posting this to DBA but I think the question goes beyond the database. Of all the software-related Stack Exchange sites, the Programmers FAQ seemed most in tune with what I'm asking here.
My company provides a SaaS offering. Our customers collect a lot of data using our service, and we wish to mak... |
There was a mention in the Java Posse Podcast about how teams should be divided up into pairs. However, there was a mention from the lady on the podcast that: "Pairs should be mixed up [sic]" (an encouragement for diversity)
I understand the benefits of pair programming, but what benefit is there to intentionally mix p... |
I own and read 'Java Puzzlers', 'Clean Code' and GOF's 'Design Patterns' and more specific technology books however I have not yet read 'Effective Java'. Whenever I see a list of must read books I always see a copy a 'Effective Java' but I have put off buying it seeing as a learn to write Java book rather than a writ... |
for In the project I am working on we send messages about widgets over message queues, serializing them onto the queues as XML. The XML schema contains tags for properties that are common to all types of these widget messages, such as the widget type, command name and destination. It can also contain an arbitrarily siz... |
What I know is:
A Functional test aims to test a single component (like a WebApp's Controller) from the point of view of the developer. => Did I achieve all the requirements to make it work well?
An Acceptance test aims to to test a group of components together and is focused on the Business point of view. => Does my... |
I ran into Rebol and I was wondering about it.
I ran into the following script from here:
use [feed questions answers][
feed: load-xml/dom http://stackoverflow.com/feeds/tag/rebol
questions: map-each entry feed/get-by-tag <entry> [
find/match entry/get <id> "http://stackoverflow.com/q/"
]
answ... |
Occasionally I'll run into the situation where fixing a bug requires that I delete a section of code. The TDD purist would (I assume) advocate writing a failing test, deleting the code, then watching the test pass.
Now, it seems really strange to have a test asserting that some code was removed. Sure, I suppose it woul... |
I have a question bugging me for some days. I made a webshop for a good friend of me. The problem is I have an OOP class question.
People can buy some clothing in the shop. The problem arise how to show different information for different products?
What I have now is the following:
abstract Product class
Cloth extends... |
I have a scenario similar to as depicted below,
public class Post {
private int id;
private int postType;
private int score;
private User originalPoster;
private String title;
private String body;
private String tags;
}
public class Comment {
private int id;
private int postId;
... |
Code documentation is usually related to a piece of code, be it small (method-level) or larger (class- or namespace-level). However, it is always about the inputs and the outputs of that piece of code, possibly describing its behavior and caveats.
It doesn't make much sense to document events fired by a class in the me... |
I'm currently researching the options which I have, to build an 'Online Help System'. This system should offer the user information about dialogs - which consists mainly out of forms.
So my main question is: Is there any taxonomy/language to describe user interfaces?
I have searched a lot on this subject matter, but en... |
Been writing code since about 18 years now. Lately, I've got into the habit of not indenting elses and when I look at the code it does worry me a bit mostly that someone who might look at the code might cry foul.
The snippet below explains the need for the style
if(condition) {
...
} //1
if(condition) { // Don't wa... |
From http://en.wikipedia.org/wiki/Extreme_programming
Extreme Programming is a software development methodology which is intended to improve software quality and responsiveness to changing customer requirements.
My Team Lead dislikes Extreme Programming as
May take more time to complete the project.
Increases initial... |
I'm probably missing something here, after searching I couldn't find an answer.
I've explored quite a few Python projects and one thing I keep noticing is the fact that the majority of them continue to use the % operator for formatting strings rather than the newer, recommended .format() method. Is there a reason for t... |
I'm writing a small utility in AutoIt that connects to Twitter. I would like to store the username and password in the programs setting file, but I know that it needs to be encrypted obviously. Previously when I've done this for personal use I've just adopted an iniformat - written to a temporary file and then encrypte... |
I have an algorithm with mostly invariant parts that needs to be reused within one class so as to stay DRY.
Code duplication with repeating method structure
public void save(String key, int value) {
try {
if (isValidWrite()) {
// Only variable part
editor.putInt(key, value);
... |
I have a set of classes that are all dealing with some related tasks. These tasks do have different inputs and outputs. This causes it to become impossible to have the tasks done via shared code without having this code be a pile of if-else statements handling all the different cases.
Now someone refactored this code t... |
It might be a simple question but I am looking for optimal solution. I will have numbers printed on a screen and I will be aware of coordinates. Numbers/Symbols will have 4 points(Square) to define their boundaries. Coordinates of that particular symbol will be stored in a file. Lets' say there is a number 5 and it's 4... |
Fully automated memory management increases productivity and integrity greatly, but usual implementation (GC) has a critical problem. It's non-deterministic, and not controllable. This causes many problems such as burst CPU load which is critical for realtime applications. Some kind of optimizations (incremental/concur... |
While the question itself might sounds silly, the answer is quite important to me,
as I feel that issue is negatively affecting my work performance.
A bit of the background here: I am a seasoned senior software developer in a medium size
software department of non-software company. While being above average on the tech... |
As a student in programming, I learned that encapsulation is one of the most important principles of object-oriented programming.
However, I only follow that principle when I feel like it suits my purpose. I sometimes leave internal class variables public if they are intended to be directly read at some time, and only ... |
I was wondering why the Dining philosophers problem is based on a five philosophers case. Why not four?
I guess that we can observe all unpleasant issues that can occur when discussing five philosophers example also when we are given four thinkers. Is it only for a historical reason then?
|
I read .NET Domain-Driven Design with C#: Problem - Design - Solution and I noticed that the author created a domain service for each aggregate root.
However, the domain services were only facades to the corresponding repository. For example this is a code sample from the application from his book
public static class C... |
We are currently looking at using the idquantique random number generator device to provide random numbers. There are some issues though. We would only be using one device and we have at least 5 servers that would need to use it and this number will probably increase in the future. This implies that blocks of random... |
I'm trying to learn PHP OOP "properly", and I was wondering, should the constructor grab all the information in the database and store it in the object?
To use an example I'm trying to create using PHP OOP, an internet comic website (much like XKCD's), would have two classes:
Catalogue (list and order of all the epis... |
What is this pattern called? Is this a variant of the Module pattern? I remember there's disadvantage to this pattern and it's related to memory usage.
var module = function() {
this.Alert = function() {
alert("I'm a public");
}
function iamPrivate() {
alert("not callable because I'm... |
I committed and pushed some changes to the wrong branch. I found a way to fix it, but it seems overly complicated. Is this really the easiest way?
on the branch that you made your changes, type hg parent
run hg diff -r <parent> -r <with_changes> > patch.diff
hg up <proper_branch>
hg import --no-commit patch.diff
hg ci... |
Specifying a suffix of Exception on exception classes feels like a code smell to me (Redundant information - the rest of the name implies an error state and it inherits from Exception). However, it also seems that everyone does it and it seems to be good practice.
I am looking to understand why this is good practice.
... |
I got closed on SO and told to post this here as it's about general application design as opposed to specific code.
Intro
I'm currently working on a project which involves the daily extraction of data (pharmacy records) from a VisualFox Pro database, and uploading some of it to a WordPress site, where clients of the ph... |
could some please help me understand how to find cycles in graphs in laymans terms?
I have read other questions, such as This one and also some of the wikipedia pages, but they seem to descend rather quickly into mathematical jargon.
I have a model of the graph in java, modelling nodes, and 'in' and 'out' edges - and ... |
First off, if this is in the wrong place I apologise. I wasn't too sure on which of the Stack Exchange sites to ask it.
I am studying Software Development at university, on a one year conversion course. My main programming language is Java. We have just finished studying searches and sorts. Focussing on the latter in p... |
I am trying to understand how Apache License affects patents. In regards to the Apache website http://www.apache.org/licenses/LICENSE-2.0 section 3, am I right to say for the first part that it is saying the licensee is allowed to do pretty much anything with the patent?
In the latter part, is it saying that if a lice... |
I have heard of several situations of people using say, JavaScript or Python (or something), inside a program written in C#. When would using a language like JavaScript to do something in a C# program be better then just doing it in C#?
|
I'm trying to see if these two open source licenses give protection of trademarks to the originator. I have read both licenses but they only seem to talk about their own trademark i.e. 'Apache'.
|
Imagine a hypothetical programming environment that is largely like Java or .NET, i.e. object-oriented, garbage-collected, etc., but with one small change:
Every time you call a method on an object, a lock is obtained so that no two threads can execute methods on the same object at the same time. The lock is relinquish... |
Say you have
class A {
}
class B {
}
One type dependency is "method parameter":
class A {
}
class B {
public void M(A a) {
}
}
Another is "method returns":
class A {
}
class B {
public A M() {
}
}
Then C, an adapter from A to B, could be identified by a class that exhibits both of the above dependency ch... |
I'm a front end developer...I've never done ANY backend, although I did take a course in databases once. (I have a comp sci degree; I'm a competent programmer, I just haven't done any backend web stuff before.)
So I'm trying to figure out how the framework relates to the database. Presumably they're set up separately, ... |
In my RESTful WCF web service I have something like the following response object.
public class WebResponse<T>
{
public bool Success { get; set; }
public T Data { get; set; }
public string ErrorMessage { get; set; }
}
This way I can capture any errors that occur during the request to t... |
My understanding from small MVC applications is that you have the front end, which deals with HTML, JS, jQuery, etc, and you have the back end, which consists of your controllers and models.
However, when I talk to developers from large companies, they often mention having a frontend tier and a backend tier. So someti... |
I am very interested in network programming and I want to build a VNC client for fun and for learning purposes. I have been Googling for resources about VNC client and server, but most of time, resources found were about how to use VNC not how to build or how it actually works in business layer so I can get an idea abo... |
It has been my experience, when building websites, that most of the logic of a system is executed when user input is accepted, be it via POSTs, GETs etc. I would like to know what processes or methodologies exist in Python (leaning towards using Python), PHP, and Ruby that allow web applications to perform tasks autom... |
I am using simplexml_load_string for xml string interpreting to object from results of a REST API. It's working fine in my local server, which is using PHP5. But my hosting is in Yahoo and the service provider is giving me PHP4.
For that I need to change the way of interpreting XML string to object to another method, w... |
Does anybody have an experience in combining KanBan in SCRUM, could this work, would this make sence or would it be an overdesign?
|
In every Website you read about BDD (Behaviour Driven Development) you find a very simple nice example showing you how obvious and easy is it to define your requirements. But trying to implement this process in a big product (not a calculator example) showed me that things can get (or will get) pretty complex and unrea... |
Consider a module that is responsible for parsing files of any given type. I am thinking of using the strategy pattern to tackle this problem as I have already explained over here. Please refer to the linked post before proceeding with this question.
Consider class B that needs the contents of the product.xml file. Th... |
We have someone (let's call him Ted) that is responsible for testing new features and bug fixes.
We're using Git and GitHub. master should be/is always deployable and development is where we commit/merge new features or bug fixes, but only after they have been tested by Ted.
The project is in PHP.
I'd like the testing ... |
I recently ran into a rather annoying (confirmed) bug in an open source software package that I have integrated into my application. According to the public issue tracker this bug has been resolved in the latest release of the software.
Occasionally you NEED that bug fix to avoid an expensive refactor of a particular ... |
I am wondering, What would be the correct condition coverage test cases for the following condition:
if(A && E && (B || C || D))
Considering short circuiting, what cases would I need?
EDIT: Sorry I put only a half of the expression
|
We are at a planning & redesign stage of our loyalty card application. As it is understood it will be a multi-tenant application. And I need to take your thoughts. Here are the some key points we should take in to account to redesign logical and physical data structure:
Campaigns: We may organize cross tenant campai... |
It seems like when web site lists requirements as to what characters MUST be in the password they're only providing a password map for someone who wants to hack their system.
For instance, fsd.gov requires:
The password must be 10-14 characters in length.
The password must contain two each of the following:
Upper/low... |
I'm in a team of two developers and currently we have no formal processes for software development and testing - I'd like to adopt one solo initially.
Where I need some opinions is really on the matter of where to begin? Having read various books it isn't terribly clear what the best starting point would be.
Recently I... |
I just came out of University and have been working at this company for roughly 8 months, while I was given the title of developer, most of the time I have spent on is fixing and debugging other people's codes.
I always wonder why isn't the original developer's responsibility for fixing his/her code. I understand that ... |
Suppose I have code which retrieves an object and modifies it and submits it via any ORM from a web application. Below is the pseudo code:
First request
var objCust = _dbContext.Customers.Where(c=>c.CustomerId == "ALFKI").SingleOrDefault();
objCust.Address ="test address 1";
//and add some orders
_dbContext.SubmitChang... |
I'm not a web programmer at all so I really have no idea:
You'll notice that websites like Stack Exchange have links like this:
http://programmers.stackexchange.com/questions/188078/policy-and-practice-on-code-maintenance
As you can see, the link includes the "page name" (Policy and practice on code maintenance).
We k... |
In the Noda Time User's Guide, the rationale section states:
the public API has been largely rewritten, both to provide an API which is more idiomatic for .NET, and also to rectify some of the Joda Time decisions which the Noda Time team view as "unfortunate". (Some of these are simply due to having different goals; o... |
I am dealing with some old, sloppy C++ code in which there is a structure with a lot of data members and functions. I want to test a class that I have implemented which uses the struct, but this dependency is going to make the unit tests extremely ugly. Inspired by Michael Feather's discussion of preprocessing seams in... |
I'm working on Android application development. There is a question that always comes to my mind that: How XML interacts with Java code?. I mean Button inside XML is a view, but Button inside Java is a class.
For populating and XML layout we use setContentView(R.layout.name). What I want to know is how this XML code i... |
I'm programming a decision tree in C++ using a slightly modified version of the C4.5 algorithm. Each node represents an attribute or a column of your data set and it has a children per possible value of the attribute.
My problem is how to store the training data set having in mind that I have to use a subset for each n... |
In an OS book I just read that, "Public APIs are forever: Only one chance to get it right". Is it true? Is it applicable only in APIs of Operating Systems or other APIs too? For example, will this be true for the APIs of Android Applications such as Tasker, Locale and Pushover?
|
What things need to be considered for a Website that contains International strings, for instance Simplified Chinese and English mixed.
UTF8 seems to me a natural choice, including a meta tag. Still, some users may only see white boxes. What is the best solution do deal with this?
Currently I am thinking to provide a... |
I have been studying condition coverage for last few days. In a book "The Art of Software Testing" they highlight that it does not assure decision coverage, because for example
IF(A && B)
A=True, B=false and A=False,B=True satisfies the condition coverage but the decision is always False.
I wonder, how can this satis... |
I am developing an application for Android in JAVA which calls GPLed C-code via JNI.
I have modified & capsulated a GPL-software under a JNI-interface and compile it as a shared library (.so) which I can use via JNI from my JAVA-part (the commercial part with closed source).
Because I have stripped the original GPL-sof... |
I have code using a third party library, QrCode.Net, in the form of a dll file.
The library is licensed under the MIT License.
Do I have to include the license in my project if I did not use or modify the source code?
Full license text:
The MIT License (MIT)
Copyright (c) 2011 George Mamaladze
Permission is hereby gr... |
I would like to hear other people's opinion on what to unit test in JavaScript. I've been thinking about it and experimenting and let me present what seems to me the right thing. First of all, in order to be able to unit test your production code you need to divide the productin code into three layers: (1) DOM/jQuery, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.