instruction stringlengths 34 19.9k |
|---|
I am doing a Windows C# application.
I asked this question and I was told that the viewer/presenter should never know anything about the model. Does this mean that I should not add a reference of my model to the GUI I am making and instead of, lets say List<Car> I should transport the information using only strings and... |
I am working on a project in which we have a desktop application that should be able to receive commands from a web application. To solve this issue, using sockets seems like a good approach (instead of long polling and various other techniques).
The desktop application also uses a web API, and this is secured with mut... |
After adopting Agile for a while now, we started to think that we can improve how we do Agile. But for starter, we need to know how well are we doing now and to identify the problems in our current processes before we can improve it.
One thing we notice is that every team do Agile a little different from another. A rit... |
Since user threads are mapped to kernel threads, why don't we create all threads as kernel threads that is a process with zero user thread. Doesn't mapping of user thread to kernel thread create overhead?
|
I am a somewhat defensive programmer and a big fan of Microsofts Code Contracts.
Now I cannot always use C# and in most languages the only tool I have is assertions. So I usually end up with code like this:
class
{
function()
{
checkInvariants();
assert(/* requirement */);
... |
Haskell has a notion of “generic functions” that has some apparent similarity with common lisp—having neither experience with Haskell nor with common lisp, I might be very approximative here. This means that one can define a generic to_string facility to define a string representation for all types. Of course, the fac... |
A Scrum team has been forced together and is feeling very uncomfortable. They are constantly saying that it is not working for them and that they are fed up with hearing the words Agile and Scrum. They are feeling that the business if simply forcing a new buzz word on them.
They don't have any Agile experiance before... |
I am thinking about using a GPL Bison grammar for my own compiler.
Will the grammar "infect" my parser such that it needs to be open source?
The grammar - in terms of - the input of bison is GPL.
|
I already searched the site, but I could only find answers relating to using GPL libraries in software that people were going to sell/distribute. In this case the answer is that they must also make the source code available.
What about SaaS? That is, I'll be building an app that clients will pay a monthly fee to use o... |
(note I'm putting the question here because it's about the conceptual mechanics of it, rather than a coding problem)
I was working on a small program, that was using a sequence of fibonacci numbers in its equasion, but I noticed that if I got over a certain number it got painfully slow, googling around a bit I stumbled... |
Is there a name for including a limitation in a loop structure to prevent it from running if its primary condition becomes unwieldy.
For example
for (var i = 0; i < len; i++){
some_function();
}
but if len is somewhere set to ten million, I don't want to run it, so I would do something like:
for (var i = 0; i < l... |
I'm trying to think of fine way to store historical data for my web application. The application has users that add photos, comment and grade them. All this is stored in relational database.
The users also have ability to delete own photos (and thus comments/grades) and own account.
I want to store those deleted entiti... |
What behaviour should be preferred for widget initialization:
1) Required HTML is generated by widget itself:
Layout:
<div id="my-widget"/>
Initialization:
$('#my-widget').myWidget(); // Creates HTML
2) Required HTML is placed to the page by user:
<div id="my-widget">
<div class="foo"/>
<div class="bar"/>
</div>
... |
I was trying to understand the difference between Open Closed Principle (OCP) and Dependency Inversion Princible (DIP).
Based on research I've made on the internet so far, I came to the conclusion that 'DIP is one option through which we can achieve OCP'.
I'm I right on this?
Can you give me an example which doesn't ... |
In other words, is DRY (don't repeat yourself) applied at a class level a subset of SRP (single responsibilty principle)?
What I mean is that while SRP states that each class should have only a single responsibility ( ie. class should only have one reason to change ), is it the application of DRY at class level that p... |
We are trying out mandatory code review on each commit -- nothing gets into master that hasn't been validated by at least 1 person not the author -- for a couple of sprints. We have buy in from both developers and management (which is an amazing situation to be in) and we want to get some of the benefits that it is kno... |
Every click event on the web works on mouse click and release. Is there a way to do a action on a click event before mouse release??
|
I'm in a situation with my company where this may be an important distinction.
Is there any distinction between "source code" and "source files" in a technical context?
Is there any distinction between "source code" and "source files" in a legal context?
Thanks.
Edit: I saw some close votes on this. I want to note that... |
I hope you bear with me here. It's difficult to explain this problem, especially so without direct reference to the specific domain.
I work on a component of a larger system which performs computationally expensive pre-processing in order that the "real-time" component can perform it's functions quickly. My product eff... |
I've noticed that even when a websites front end is coded in HTML 5 as evidenced by the <!DOCTYPE html>, people rarely seem to use the new HTML 5 <section>, <header> and <footer> tags.
Is it because people don't understand that you're supposed to use reusable classes for styling things within a <section> instead of t... |
Are there any software licenses that automate the reassignment of ownership?
For instance, in a usual circumstance, you have a license, and then you make all contributors sign off that by contributing they reassign ownership to the project owner.
In the sort of license I'm looking for, by just editing and redistributin... |
Context: I am developing a web application using webapp2 web-framework with python to be hosted on GAE.
The web application (web-app from now on), is a chess variant. Being a first timer, I have definitely made a lot of design blunders. One of them, is what this question is regarding to, I will come to it in a short w... |
Long story short, I have a social networking site I wrote a while back as a "proof of concept" to myself that I had the skills to do it. I decided to revisit it, and "improve" a lot of the bad coding practices I had when I first wrote the thing (3 years ago).
My current situation
Users can create posts. When posting... |
I have heard that my C++ programs "need to link with the C++ library/runtime". However, the C++ runtime is just the compiler inserting stack operation code in to the image, or "boilerplate" code if you will. The C++ runtime is basically intrinsic to the program itself, so "linking the runtime" is a bit illogical. Linki... |
I've written a program for another group within my company that uses scripts. These scripts are user selected by the use of two drop down lists: category and name. Currently the application uses an XML file that is on a network share to populate the drop down lists with the scripts and their associated categories and... |
A lot of languages like Java and C# have garbage collectors that free memory when that memory no longer has any reference. Yet they don't immediately free it after the reference counter hits zero but instead every once in a while they check on all the memory to see if that memory has any reference and delete it if it d... |
I do a lot of flat-file processing to extract data. The file "formats" are very unique and each file format requires a lot of format-specific code. Sometimes, the parsing code needs to maintain a lot of state while the file is being read. I've used something like this "pattern" at times:
parser = New FileTypeAParser(fi... |
I read on a similar forum https://stackoverflow.com/questions/8117530/examples-for-acceptance-criteria-for-a-user-story about putting in the acceptance criteria for product backlog item.
I am working on a Scrum based project and I need more info as my backlog item is as follows -
UserProfiles ( I am using this in the ... |
I have one idea that I want to make an app for iPhone, I have recently bought a mac for the same purpose. I want to make small app and build on it in later versions. I work in in a small company and have 1 year of experience on working of iOS platform . I am a developer and don't have any design background so I want to... |
Driving instructors (at leas in Germany) often mention 100.000 km driven as a reference point where a driver is considered experienced.
Is there a similar number for programmers?
For example, how many lines of code does the average junior/senior developer have written when starting their job?
Also: after how many lines... |
I'm an apprentice and I've been on a couple of training courses in C#, I understood the concept of c# programming and covered inheritance etc, but when I've came to code for my coursework "I've got to make a shopping basket and save the contents into a .txt" I just seems to not know what to do, as if I've got no idea h... |
I am designing an application where users message one another privately, and may send messages to any Entity in the database (an Entity may not have a user account yet, it is a professional database). I am not sure how to best design the database and the API to allow messaging unregistered users. The application should... |
var Id = from value in Enumerable.Range(0, 100)
select value;
IEnumerable<int> ids = from value in Enumerable.Range(0, 100)
select value;
foreach (var v in Id)
{
Console.WriteLine(v.ToString());
}
... |
I was going though this blog and it says
You can represent a list of distinct integers no larger than N using exactly N bits: if the integer i appears in your list, you set the i th bit to true. Bits for which there is no corresponding integers are set to false. For example, the integers 3, 4, 7 can be represented as ... |
if(condition1)
{
Statement1A;
Statement1B;
}
else if(condition2)
{
Statement2;
}
else if(condition3)
{
Statement3;
}
else
{
Statement1A;
Statement1B;
}
return;
I would like to refactor that code so that I do not duplicate Statements. I always need to check condition1 before any other condition. (S... |
The use of source control management tools is nowadays a standard
practice in the software industry. Furthermore, it seems that there
is quite a strong consensus (for deliverables) to have an instable
branch where new features arrive and one or several stable branches
where only bugfixes are added. I am interested in... |
I have made a search on a Hong Kong job seeking website. There numerous of jobs titled "Computer Analyst". These are the requirements of the job:
Over 3 year experience relevant working experience in IBM Mainframe environment.
University degree in Computer Subject.
Proficient in system analysis, design and coding for t... |
I'm currently making some improvements for a client on a backbone.js app. The app is a web store and inventory management system. One thing that bothers me about this app (and other backbone.js apps I've encountered) is that it loads the entire collection of inventory items into memory from the server on every initial ... |
I have been working with SpringMVC, Hibernate, and some databases in a java web application example.
There are a few different ones that do this, but this Spring 3 and hibernate integration tutorial with example has a model class, view (in jsp), and a service and dao classes for the controller.
My question is, don't b... |
I'm writing code that I would like to release under the MIT License. It uses the public API of a library licensed under the BSD 3-clause license. I am not redistributing the library with the source code, and I am not providing binaries, users must install the library themselves and compile from source. Do I need to inc... |
In our app we are currently saving binary data to the database (terrible, I know; but this is legacy stuff and it wasn't my decision). We're trying to migrate this data out to an external device and I'm trying to come up with a scheme to save these files.
We have multiple tenants, I'd like to have a directory per tenan... |
is there a good pattern for how to send multiple calls to a web service but without taxing it and ensuring the data is sent back? I don't know enough to correctly describe the problem to even start googling it properly - current google results compare streaming vs. non-streaming wcf answers?
Scenario: I am working on a... |
I'm still trying to understand design patterns here, after learning the Abstract factory pattern , I realised that this pattern will not scale well. Take a look at the uml diagram of the abstract factory pattern
If I have to create a new 'AbstractProductC', I will have to add an abstract method 'CreateProductC' in 'Ab... |
So, essentially the project I wish to undertake is an SVG editor. I would prefer to use WPF because then I can leverage XAML for my application layout (that designer is so nifty). Unfortunately, I have only been using the .NET framework for just a few months, and am still unfamiliar with most of the class names.
The g... |
Say I want some parts of my software to be encrypted. For example, the credentials for a database, etc. I need to store those values somewhere, but doing so in cleartext would make it easy for an attacker to gain unauthorised access.
However, if I encrypt some cleartext, then where do I store the key? Anything that sof... |
I'm using some codes that I modified, from Paradigms of Artificial Intelligence Programming to create another project, the project is released under GPL V2.
The License agreement is written here, it says: Copyright © 1998-2002 by Peter Norvig.
My question is: Were's almost in 2014, do I still have to include that licen... |
I'm having some problem developing a web application with various developers, each one has an specific configuration to work.
and i would like to use the less resource cosuming approach to avoid that any personal configuration goes to the repository.
the basic idea is: to have a config file with all the pairs of key/va... |
Up until now the styles were handled by a single CSS file (for each site).
I'm customizing it like this:
opened the site in Firefox
opened inspector/style editor
changed CSS values around until I was happy with how the site looks
copied the generated CSS code and pasted it in the .css file from the server
The design ... |
I have been working on a project and running into a very difficult problem.
The problem can be stated simply as how to unit-test numerical algorithms.
However if you just took this simple statement you would get the standard set of answer isolation of input, random processes, mocking, tolerancing, etc.
The answer (if ... |
One of my company product need to implement a license mechanism. I'm planing to generate a key base on users PC MAC address. But I'm bit scared is this method confuse with some advance hardware. configurations such as.
Multiple network cards.
Virtualization.
Mac address change possibilities(?)
Working with VPNs.
Is ... |
If the boolean operators &&, || are implemented as infix methods, then isn't short-circuit evaluation just a consequence of being implemented using call-by-name semantics, since, for example, the && method wouldn't then evaluate the second arg in any case if the first is false.
I'm just wondering because they are gener... |
I'm working on my own application and I'm stuck. I have to implement a feature but I can't find a good approach to implement this feature. I was thinking about it for a couple of days, and no good thoughts came. Searching the Internet didn't give me any inspiration.
I need to move on, but I want to know, what's the b... |
I have an abstract class abstract class MathFunc that is used to implement the mathematical functions Rastrigin, Griewangk and Rosenbrock in their specific classes final class Rastrigin extends MathFunc, final class Griewangk extends MathFunc and final class Rosenbrock extends MatjFunc.
This hierarchy of classes and h... |
In numerics, it is very important to be able to identify unstable
schemes and to improve their stability. How to identify unstable
floating point computations?
I am working on a very complex simulation where many numerical schemes work together and I am looking for a methodic to identify its weak parts. I am working ... |
I am developing an Hybrid android app using HTML5 which will work completely offline.
Today morning when I opened the app, I saw that all the data stored in localStorage was cleared.
Under what scenarios can the localStorage get cleared?
Given these scenarios, is it a good idea to use localStorage?
|
I am currently a high school student, I've been assigned to manage a group in my school to develop a mobile app and the problem is that all of us have no experience in making a project in a team and the greater problem is that we have only till the end of the month to submit the app.
Can I have some tips to overcome th... |
After googling for a couple hours, I came to a conclusion that all sorting algorithms are inherently sequential which can be data distributed but not task distributable.
Is there any algorithm which is not inherently sequential and is task distributable?
|
I was hoping for some advice:
I need to design a software solution for a medium-sized java / Swing application.
The application will have about 200 use cases requiring complex data validation and business logic.
Typically, this is my usual design:
Create a simple POJO for each use case, with a custom constructor and c... |
I seek your advice on SPA (Single-page application) architecture.
I'm building an SPA which edits a model. The models consists of objects which have a relation to one another. The objects (and relations) are stored in a single a collection on the server's database. The user must authenticate on server and sessions are ... |
I have inherited an application that stores data in multiple tables in Microsoft Access; the Access DB is only used for storage, all data processing is handled by the app (VB.net).
Is this good practice? I need to build a similar app from scratch and am unsure of what is 'normal' practice.
I have tried Googling the que... |
I am trying to apply DDD to the design of a Release Management system.
Domain Entities
Project: The project/product/system.
ProjectEnvironment: The environments (Test, Staging, Prod) that exist for this project. Each project has its own defined environments.
ProjectVersion: A specific version of the project. This w... |
When they ask you to choose the programming language you are comfortable with before an interview, is it to ask questions about the programming language or to check how well you code in it?
Like for example, if I don't know what iterators are in Python but I'm comfortable with Python because of its in-built facilities,... |
I installed xampp in my machine. I wonder what is the difference between apache and tomcat in the xampp control panel.
p/s: I started apache only and test with "localhost/index.html", it works.
I started tomcat only, but it doesn't work.
|
This is somewhat controversial topic, and I guess there is as many opinions as there are programmers. But for the sake of it, I want to know what are the common practices in business (or in your work places).
In my work place we have a strict coding guidelines. One section of that is dedicated to magic strings/number... |
The title says it all. Some employees in our company believe that automated tests are "easy" and that it "should take a day" to write suites of COM and UI tests. What can be done to counter this?
Note: I'm not asking about how to promote automation. That isn't the problem. Automated testing and processes are being pro... |
This is from the Hartl Rails tutorial. We are automatically logging in a user in the process of creating that user with a callback to #create_remember_token. It works great but there are some things, I am not clear on. Please bear with me as I'm thoroughly confused to the point that I don't even know how to ask my ques... |
I am a new software developer and I wish to sell my software. I recently realized that from C++ code we can not stop the user seeing parts of the code that are related to scripts or system commands.
Would you make some comments on how software written in C++/JAVA (distributed via CD-ROMs or available via download) is p... |
We have an application with Oracle backend. The DAO layer is written in C# and uses nHibernet to perform the data operations.
To unit test our DAO code, we use SQL Lite which creates the database based on our existing mapping in the project.
Some of our nHibernate queries that go to oracle use (+) for outer joins. Now... |
I am looking at trying to rewrite an application that is mostly procedural to an MVC/OO approach in order to teach myself a deeper understanding of both.
BUT, I am having some conceptual issues with the current group/access control that is used.
We have Groups (Businesses) that have role based users (Manager, salespers... |
I am currently working on an open source PHP script and trying to adopt an attribution license. The ones that I found are
CC 3.0: http://creativecommons.org/licenses/by/3.0/
and
CPAL 1.0: http://opensource.org/licenses/CPAL-1.0
They seems very similar to me. What's the difference, pros and cons?
What I want is:
Allow ... |
One of the things that Valve's Steam distribution platform is known for is its Custom Executable Generation system, which creates a unique copy of a program for each person that buys it.
I'm sure that Valve isn't the only company or person to have implemented or thought of implementing such a system, however. If I want... |
Example:
You have a game with different schools of magic (fire, ice, etc). Each school has a set of properties that pertain to independent features of the game, such as:
strings to be displayed on the GUI (generic data stored in memory)
graphics, sounds, and other files to be loaded as necessary
different behaviours (... |
I'm developing a small system for internal automation. I use asp.net webforms and faced with a choice:
develop a system architecture in an object-oriented style (development becomes more difficult and time-consuming)
or
just put controls on forms and write sql queries in control handlers (high speed development, the ... |
I want to become a better developer, and so have been dedicating most of my free time outside of work to learning design patterns, and when to implement them (since I feel learning general patterns is a better starting point than learning specific libraries or tools). One issue is, that the majority of highly regarded ... |
I am a beginner in Software Engineering principles. This question have only academic significance.
I read about Function Point analysis.We will be getting an integer value as output for Function Point analysis.
What all things can be inferred from that output?
I know that it is an estimation technique. But couldn't und... |
My team at work is starting a new project, using Subversion as our VCS (you may consider this set in stone for the purpose of this question). We're still in the early stages of the project and are trying to agree on a branching model. Our previous project was based on a non-standard version model that led to issues w... |
Why didn't Java designers create static versions of string manipulation methods in the java.lang.String class? The following methods are what I refer to, but the question can be extended to other non-static methods in the class as well.
concat(String) substring(int, int)
replace(char, char) ... |
I need to do the code review of fellow members.
One of the member always defined the helper functions at the bottom and use them at top e,g
class Sample {
public function SendFile(){
file = $this-convertFile($file);
}
public function convertFile(){
//bla bla
}
}
I sometimes dont know if he has custom defined this f... |
In open source projects there is typically a set of devs that have permissions to commit code - the committers -, and others that "pull request" or send patches, the "general public".
I find a annoying when
the committer signs the commit with its own name, and writes in the commit message a "Thanks to ...".
the commit... |
I'm writing a Java program that works as a presentation of a written document, which needs to be stored in a database (I'm using MySQL, but am open to suggestions of other DB types).
The Essay class is a collection of objects of the Paragraph class (more specifically Essay extends LinkedList<Paragraph>, which consists ... |
I have recently been moving away from ASP.NET Websites in favor of Web Applications. More specifically I have recently been picking up MVC as an alternative to developing ASP.NET Forms websites.
Something that I find highly frustrating is the constant build->change->re-build process when testing small changes to compil... |
I've just started freelancing and have two projects where I am splitting my week with both companies, one I'm charging hourly and everything is fine, the other one however they have said they will pay me based on a points basis using Pivotal Tracker.
For example, there's a fixed rate per point and they work on an estim... |
A new project has an amount. It is always related to a client.
One client can have many projects. And he may pay in steps for a particular project.
In order to keep track of client payments, I've created a table namely client_ledger which contains information about date, time, amount, mode of payment & related project.... |
This was posted originally at StackOverflow though suggested to post here instead.
I am looking to create an Excel VBA solution that will create a rota/schedule allocating staff to service users using an algorithm. I believe there are already existing names for this kind of problem/algorithms but not entirely sure what... |
We are dealing with a lot of CRUD operations in our application. Each database table has one or more corresponding SQLContainer instances to perform various types of operations. All of these SQLContainers are stored in one helper class, so that you could perform any type of CRUD operation anywhere from the program (onc... |
We are currently using Entity Framework as an ORM across a few web applications, and until now, it has suited us well as all our data is stored in a single database. We are using the repository pattern, and have services (the domain layer) which use these, and return the EF entities directly to the ASP.NET MVC controll... |
I'm starting to write C++ code to run a robot, and I don't know how to incorporate unit testing, if indeed I can. I have been provided with a library which allows the creation of "commands" for the robot, which are automatically scheduled and executed. The mechanism to create these commands is to subclass a command bas... |
With our public SDK, we tend to want to give very informative messages about why an exception occurs. For example:
if (interfaceInstance == null)
{
string errMsg = string.Format(
"Construction of Action Argument: {0}, via the empty constructor worked, but type: {1} could not be cast to type {2}.",
... |
I got asked to do a code review of a very simple one-route web service that when hit would simply restart an application on the system. The developer had coded this up as a POST which strikes me as odd.
Now I realize that this is not really the type of thing that HTTP is all about - you can't even query state - but is ... |
I'm working on a payment processing website that will function like PayPal does on many e-commerce websites. The idea is for the customer to fill their shopping cart and click checkout, then be directed to the payment page on a secure site. After the payment page processes the payment, it directs the customer back to t... |
How would you go about parsing a sentence like
"Bought two kilos of steak from Acme supermarket" into a data structure like the following JSON representation:
{
item: {name: "steak", tags: "meat,beef" },
quantity: { value: 2, unit: "kg"},
source: "ACME Supermarket"
}
?
I'm looking for a high-level conceptual ove... |
I'm unit testing some code that processes data from an external API. That external API serves up a large pile of JSON data.
The right thing to do here, of course, is to use fixtures in the unit tests, so that I don't do a real API call every time the test runs.
Those fixtures can be quite large though - many thousands ... |
Context
In a Cocoa application I am developing, I need to load a data model that is defined in plist files. So, I have something like:
root (Array)
---- item (Dictionary)
-------- name : "objects" (string)
-------- prefab : "object" (string)
-------- children : (Array)
...
---- item (Dictionary)
-------- name : "action... |
Disregard your usual paradigms for a mere moment here....
I've seen a few sites who have used the following logic:
a=[];
b=a["sort"];
c=(b)();
c["alert"](1); // intended output: Alert displaying "1"...
supposedly to access (I'm guessing here) the primitive of the sort function to gain access to the window object, and ... |
I created a Chrome browser extension, and I want to post the code on Github so developers can contribute to the project.
My goal is to keep this as one single project though, and I fear that a lot of nearly identical extensions would start showing up in the Chrome Web Store if I released the code without restriction.
I... |
This is a basic question. But, I think understanding this would be helpful to play with buffers in 'C'. Thanks.
Scenario
Just a sample snippet
char *test_buff = (char *) malloc(512); //allocate 512 bytes in heap memory.
bzero(test_buff, 512); //Reset buffer instead of Junk/garbage.
/* random code here to fill-in the bu... |
I've been thinking lately about how I handle config changes between multiple developers on a project.
Specifically here about a Laravel project in PHP, but I guess this applies largely to all frameworks/languages.
In general would you say it's a best practice to not commit your configuration? If so what's your practice... |
I'm developing a new application and I'm trying to come up with a convention for defining routes. Ideally, I would like it to be simple, flexible, and reversible.
Here are some from popular frameworks:
Backbone
route matches
-----------------------------------------------------
help ... |
While reading the difference between Compiler and interpreter , I found the following differences fromt he internet.
Advantages of using compiler:
Since compiler converts the program to native code of the target machine (object code), faster performance can be expected.
There is a scope for code optimisation.
Advan... |
Are all scripting languages dynamically typed?
I am using TCL. It is a scripting language and it does not enforce or allow type delaration of variables. It is instead a dynamically-typed language with ducktyping. The type of a variable is assumed by the interpreter according to the value assigned to it.
I would really ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.