instruction stringlengths 34 19.9k |
|---|
Problem domain
Functional requirements defines what a system does.
Non-Functional requirements defines quality attributes of what the system does as a whole.(performance, security, reliability, volume, useability, etc.)
Constraints limits the design space, they restrict designers to certain types of solutions.
Sol... |
I'm currently working on a project where I'm receiving an object via web service (WSDL).
The overall process is the following:
Receive object -> add/delete/update parts (or all) of it -> and return the object with the changes made.
The thing is that sometimes these changes are complicated and there is some logic invol... |
I have been on many development teams and as the team matures decisions about direction are made. These decisions often come back up over and over. Like why don't we fill in this field why didn't we use memcache over a custom solutions. These decisions add up over time and become a significant part of style guides c... |
I have read somewhere that ROA (Resource Oriented Architecture) is SOA (Service Oriented Architecture) with specific constraints added. SOA is the abstract concept of combining discrete pieces of software and ROA is an implementation of SOA with all of the constraints of RESTful services applied to it:
SOA = the conce... |
I want to create a web/browser-based GUI for a command-line python application. The goal is to make use of HTML/JS technologies to create this GUI. As the application itself, it needs to run on Linux and Windows, and the interface will be accessible only from localhost (not exposed to internet). The GUI will contain 5 ... |
I'm working on a project where we will implement a kind of world simulation where there is a square 2D world. Agents live on this world and make decisions like moving or replicating themselves based on their neighbor cells(world=grid) and some extra parameters(which are not based on the state of the world). I'm looking... |
I'm preparing for a test and doing practice questions, this one in particular I am unsure I did correctly:
We are given a very simple UML diagram to demonstrate inheritance: I hope this is clear, it shows that W inherits from V and so on:
|-----Y
V <|----- W<|-----|
|-----X<|----Z
... |
To keep it simple, let's suppose an application which has Accounts and Users. Each account may have any number of users. There's also 3 consumers of UserRepository:
An admin interface which may list all users
Public front-end which may list all users
An account authenticated API which should only list it's own users
... |
I started reading Tanenbaum's Distributed Systems book a while ago. I read about two phase locking and timestamp reordering in transactions chapter. While having a deeper look from google I heard of lightweight transactions/lightweight transactional memory. But I couldn't find any good explanation and implementation. S... |
I have a SPA site that I'm working on, I have a requirement that you can have subroutes for a page view model. Im currently using this 'pattern' for the site
MyApp.FooViewModel = MyApp.define({
meta: {
query: MyApp.Core.Contracts.Queries.FooQuery,
title: "Foo"
},
init: function (queryResult)... |
I have this project which stores product details from amazon into the database.
Just to give you an idea on how big it is:
[
{
"title": "Genetic Engineering (Opposing Viewpoints)",
"short_title": "Genetic Engineering ...",
"brand": "",
"condition": "",
"sales_rank": "7171426",
"binding": "Book... |
If some developers still use a 32 bit 'Windows XP' and others use a '64 bit Windows 7', would it be advisable for the entire team to work with 32 bit development tools even if their OS is 64 bit? Are there any problems that could happen if uniformity is not followed?
|
Something I really have not thought about before (AS3 syntax):
private var m_obj:Object;
protected function get obj():Object
{
return m_obj;
}
private var m_str:String;
protected function get str():String
{
return m_str;
}
At least subclasses won't be able to set m_obj or m_str (though they could still modify... |
I'm working on a huge CMS system, and I asked myself what configuration format I should use.
There are two common formats for configuration files. The first one is an INI file, containg all the configuration properties. Then you can simply parse this INI file using build in PHP functions. A second option is to use a PH... |
I'm working on some code to sync the state of models between client (being a javascript application) and server. Often I end up writing redundant code to track the client and server objects so I can map the client supplied data to the server models.
Below is some code I am thinking about implementing to help. What I d... |
Let's say I have an OrderController which handles orders. The user adds products to it through the view, and then the final price gets calculated through an AJAX call to a controller action.
The price calculation logic is implemented in a seperate class and used in a controller action. What happens is that I have many ... |
I am in the final stages of development for my Revit plugin. This plugin is programmed in C#, and distributed via a DLL. One of the DLLs is an encrypted SQLite database (with proprietary data) that is in the form of a DLL. Currently, in development stages, the decryption key for the SQLite database is hardcoded in my m... |
What are the various tools that are required to build a compiler for a particular programming language, say C?
I want to know how each part of the compiler works. So, I am trying to use all the existing tools like loader, linker, etc, and combine them together to build one compiler (or can just say "compiling a compile... |
I have html stored in database received from text editors and because of some mistakes in the code the html is not valid, it is missing some closing tags. and due to this I am not able to process this html for some other operations like generating pdfs. So I need to write some code in c# that can check for tags that ar... |
In JavaScript: The Good Parts by Douglas Crockford, he mentions in his inheritance chapter,
The other benefit of classical inheritance is that it includes the specification of a system of types. This mostly frees the programmer from having to write explicit casting operations, which is a very good thing because when c... |
In a learning problem I've been messing around with, I realised I needed a typeclass for functions with operations for applying, composing etc. Reasons...
It can be convenient to treat a representation of a function as if it were the function itself, so that applying the function implicitly uses an interpreter, and co... |
I am working with a multithreaded homegrown multi-module app in my new job. We use the the Thrift protocol to communicate RPC calls between different stand-alone applications in a distributed system. One of them listens on multiple ports and I just noticed that it actually makes an RPC call to itself from one thread ... |
I've been a freelancer and a coder by night for a while, and recently, I've been hired after several levels of interviews in a nice NY company, even though I've some lacks in specific fields. Is this common for companies to hire seniors with less experience? Will they wait some weeks to respect a certain learning curve... |
We are a small, very specialized, benefits administration firm with an extremely useful, robust collection of software, some written in COBOL but most in BASIC. Two full-time consultants have ably maintained and improved this system over more than 30 years. Needless to say they will soon retire. (One of them has been d... |
I have a query regarding big endian and little endian.
Basically the conversion is used to reverse the byte order in memory .
When we need to do the conversion, do we need convert each and every data types?
|
I've been asked to build an online calculator in PHP (and the Laravel framework). It will take the answers to a series of questions to estimate the cost of a home extension.
For example, a couple of questions may be:
What is the lie of your property? Flat, slightly inclined, heavily inclined. (these suggestive values ... |
Fake Scenario
There is a software that was released 1 year ago. The software is to map and register all kind of animals on our planet. When the software was released, the client only needed to know the scientific name of the animal, a flag if it is in risk of extinction and a scale of dangerous(that is a fake software ... |
I am writing an Android app, finally (yay me) and for this app I need persistant, but user closeable, network sockets (yes, more than one). I decided to try my hand at writing my own version of an IRC Client.
My design issue however, is I'm not sure how to run the Socket connectivity itself. If I put the sockets at t... |
The scenario: Having a Controller that controls a view composed of complex subviews.
Each one of those subviews is a separated class in a separate file. For example, one of those subviews is called ButtonsView, and has a bunch of buttons.
The Controller has to access those buttons.
Would accessing those buttons like ... |
Our development shop would really like to do more agile projects but we have a problem getting clients on board. Many clients want a budget and a deadline. It's hard to sell a client on an agile project when our competitors do come up with waterfall-based fixed deadlines and fixed prices. We know their fixed numbers ar... |
I work for a gym. I am the programmer, its just me, nobody else! Gets really frustrating when there's nobody to bounce conceptual ideas off of.
I'm getting rid of our archaic paper binder systems for tracking appointments and what not.
I've made a lot of things successfully already, now I'm trying to tackle the persona... |
In my web app framework, each page can have a precondition that needs to be satisfied before it can be displayed to the user. For example, if user 1 and user 2 are playing a back-and-forth role-playing game, user 2 needs to wait for user 1 to finish his turn before he can take his turn. Otherwise, the user is displayed... |
Say I have a class ImportantInfo with a public writable property Data. Many classes will read this property but only a few will ever set it. Basically, if you want to update Data you should really know what you're doing.
Is there a pattern I could use to make this explicit other than by documenting it? For example, som... |
I am primarily a Java programmer. Because of its OO principles and the general paradigm of Java programming, like wrapping things in static variables, and having things return specific types, heavily aids me in "visualizing" a program. Instead of thinking of a big program, I can, instead, focus on smaller organized par... |
In C++, features like exceptions impact your whole program: you can either disable them in your whole program, or you need to deal with them throughout your code. As a famous article on C++ Report puts it:
Counter-intuitively, the hard part of coding exceptions is not the explicit throws and catches. The really hard p... |
I was looking through CodePen's "popular pens" and I noticed this cool little spiral animation somebody made with a seemingly ridiculously small amount of code.
This is quite impressive until you click the headings for HTML and CSS to show the "compiled" versions of the same code. Suddenly the 3 lines of HAML and ~40 ... |
I have developed a Swing application that controls execution of several scripts like jobs. I need to display the interim output of the jobs concurrently. I have followed MVC while writing the application. The application is working as expected. But off late I have the following requirements in hand:
A few of the scrip... |
My goal is to keep track of the popular posts on different blog sites based on social network activity at any given time. The goal is not to simply get the most popular now, but instead find posts that are popular compared to other posts on the same blog.
For example, I follow a tech blog, a sports blog, and a gossip b... |
I am new to java and want to learn best coding practices and understand why one method is better than another, in terms of efficiency and as the coding becomes more complicated. This is just an example, but I can take the principles from here to apply elsewhere.
I have need an option to display stuff, and have put the ... |
When creating constructors with multiple arguments, is ok to use the generic String[] args or is it better to list the arguments? Does it really make any significant difference as the coding becomes more complicated?
public static void Something (String[] args)
{
}
or
public static void Something (String lots, ... in... |
An operation in an interface is obsolete so I decided to delete it.
It seems that there is no automatic support for such a "refactoring" in Eclipse.
For me is a refactoring operation since the behavior of the code will be preserved since nobody (tests, client apis) will notice that the operation was removed.
In Eclipse... |
I'm the only software developer at the company where I work. I was hired straight out of college, and I've been working here for several years. When I started, eveeryone was managing their own data as they saw fit (lots of filing cabinets).
Until recently, I've only been tasked with small standalone projects to help wi... |
I'm writing an application in which -
Many users can subsribe to posts made by another users.
So for a single publisher there can be many subscribers.
When a message is posted by an user X, all users who have subscribed to messages of User X will be sent an email.
How to achieve this ? I'm thinking of using publish-s... |
I have a main activity that contains many buttons. I don't want to have a list of buttons like this. I know this looks bad, only cause I threw this together to show you what I have. As you can see, I really don't even have enough room. I don't want a scrollView in my main Activity. Does anyone have suggestions on buil... |
Forgive me if this question has already been answered but I couldn't quite find the answer I was looking for. What I wanted to know was, is there any significant advantage to using a native language when developing and deploying apps to a mobile environment?
The reason I ask is for a long while now I've been using Obj... |
I am working on my first public-facing web application and I’m using MVC 4 for the presentation layer and EF 5 for the DAL. The database structure is locked, and there are moderate differences between how the user inputs data and how the database itself gets populated. I have done a ton of reading on the repository p... |
I know the basics but do not how to model this (it is an exercise with no solution provided):
An order can contain 1 or more cartons of beer. Each carton contains 6
beers of the same kind but there are some consisting of 3 different
beer types (still 6 in total)
Also having a "Carton" class, how can I make it the... |
I was reading "Software Security: Building Security In" and in the first chapter I faced with 3 terms: bug, defect and flaw. The author gave a definition for each of them but I couldn't completely understand these.
Can someone give me some examples for each term?
What is a defect and what is a flaw? I think I know what... |
Need to access HTTP session for fetching as well storing some information.I am using Spring-MVC for my application and i have 2 options here.
User Request/ Session in my Controller method and do my work
Use RequestContextHolde to access Session information.
I am separating some calculation logic from Controller and w... |
I am a developer who has windows 7 installed as the host operating system with vmware. I have linux installed using vmware. Therefore I am able to test java and c++ apps on windows 7 and Linux.
I also want to test them on windows 8 and I want to familiarise myself with windows 8.
I am debating whether to upgrade my h... |
What is the best approach for the following scenario:
1) A publicly available app (available in app stores) which is used by end users to make use of services offered by multiple companies.
2) These companies maintain their services also using a mobile app.
I'm not sure on how to solve the second part. Having one app f... |
I haven't worked with Pascal so far, and my problem is understanding the recursive aspects that prm assignment operators and how the final (correct) value is derived. Would someone please explain that line for me.
Program test(output);
FUNCTION prm(az:integer) : real;
begin
if az = 1 then
prm := sqrt(12)
... |
I just learned about the Joel Test. I have been computer programmer for 22 years, but somehow I never heard about it before. I consider my best job so far to be this small investment managing company with 30 employees and only three people in the IT department.
I am no longer with them, but I had being working there f... |
Working on a statically typed language with type inference and streamlined syntax, and need to make final decision about syntax for variable declaration versus assignment. Specifically I'm trying to choose between:
// Option 1. Create new local variable with :=, assign with =
foo := 1
foo = 2
// Option 2. Create new l... |
When explaining the Y combinator in the context of Haskell, it's usually noted that the straight-forward implementation won't type-check in Haskell because of its recursive type.
For example, from Rosettacode:
The obvious definition of the Y combinator in Haskell canot be used
because it contains an infinite recursive... |
So we implemented the builder pattern for most of our domain to help in understandability of what actually being passed to a constructor, and for the normal advantages that a builder gives. The one twist was that we exposed the builder through interfaces so we could chain required functions and unrequired functions to ... |
When I tried searching this I would just get things on equality.
When I was reading through some documentation for navigation in Android I had come across something I had never seen before. I came across this:
mTitle = mDrawerTitle = getTitle();
It almost looks like something you can do in JavaScript where you can ta... |
Whenever I see programs or scripts that convert between high-level programming languages they are always labelled as converters.
"VB.NET to C# converter" on Google results in expected, useful hits.
However "VB.NET to C# compiler" on Google results in things like comparisons between the C# and VB.NET compilers and other... |
How shuffle from random works in Python?
I ask because it works very fast. When I try to write shuffle it works 1 minute for 10^6 element, but Python shuffle does that in 8 sec?
|
I'm currently working in a very small team of programmers (2-3) and I'm looking for advices/best practices on how to organise our work. We're all working on the same application using PHP. Today we're kind of all working on our way.
Today situation:
List item that have to be worked on by each dev 1/week. What has to
b... |
English is not my first language, but since the keywords in programming languages are English words, I usually find it easy to read source code as English sentences:
if (x > 10) f(); => "If variable x is greater than 10, then call function f."
while (i < 10) ++i; => "While variable i is less than 10, increase i by 1."... |
In a web services, how does the server know which request belongs to which session?
I know that for a web application, the web server inspects the cookie (or the sessonId query parameter in case cookies are disabled) so it knows which session the request is associated with. But for a request that comes from a rest clie... |
I have levels of tables (Level1, Level2, Level3, ...) For simplicity, we'll say I have 3 levels.
The rows in the higher level tables are parents of lower level table rows. The relationship does not skip levels however. E.g. Row1Level1 is parent of Row3Level2, Row2Level2 is parent of Row4Level3. Level(n-1)'s parent is... |
Scenario
Currently, I am apart of a health care project whose main requirement is to capture data with unknown attributes using user generated forms by health care providers. The second requirement is that data integrity is key and that the application will be used for 40+ years. We are currently migrating the client's... |
This is the question from compiler internals perspective.
I am interested in generics, not templates (C++), so I marked the question with C#. Not Java, because AFAIK the generics in both languages differ in implementations.
When I look at languages w/o generics it is pretty straightforward, you can validate the class d... |
I'm just learning to use MongoDB, and when discussing with other programmers would like a quick example of why NoSQL can be a good choice compared to a traditional RDBMS - however the scenarios I come up with and can find online seem pretty contrived.
E.g. a blog with lots of traffic could be represented relationally, ... |
I need to quickly implement a RESTful authentication system for my JavaScript application to use. I think I understand how it should work, but I just want to double check. Here's what I'm thinking -- what do you guys think?
Database schema
users
id : integer
first_name : varchar(50)
last_name : varchar(50)
password : ... |
In theory, if you were to open two computers that were perfectly synced together on a website that has a form. This form has fields where say for example the username has to be unique. Assuming both computers have the same information on the form, and in theory let's say that the submit button was pressed at the same t... |
I recently hired a programming team to do a port of my iPad app to the iPhone and Android platforms.
Now, in a separate contract, I am asking them to implement a bunch of tips on how to play the app, similar like you would find in Candy Crush or Cut the Rope. They want to charge 12 hours @ $35/hr for the "Testing al... |
Whenever I read something or hear someone talking about HTML5, CSS and JavaScript support, they always refer to Internet Explorer with the version number such as Internet Explorer 6, and Internet Explorer 9. But they only refer to Google Chrome, Firefox, Safari and others without version numbers.
Shouldn't they also sp... |
I have a web scraper for scraping news from different sources in wp7. My current appraoch for doing this is:
load newspapers information from xml file.
go to the specified sections and fetch the urls of the news items.
go to each url and fetch headline, image, publisher.
display using a MVVM architecture of windows ... |
As we do design & analysis before development, wouldn't be convenient to be able to generate Java classes from a class diagram?
This would promote more exhaustive design and better codes, right?
It's strange that why Google returns tons of tools to generate class diagram from Java classes but not the other way around... |
Recently I started programming in Groovy for a integration testing framework, for a Java project. I use Intellij IDEA with Groovy plug-in and I am surprised to see as a warning for all the methods that are non-static and do not depend on any instance fields. In Java, however, this is not an issue (at least from IDE's p... |
This situation is prone to deadlock of processes in an operating system and I'd like to solve it with the minimum of semaphores. Basically there are three cooperating processes that all read data from the same input device. Each process, when it gets the input device, must read two consecutive data. I want to use mutu... |
When should code that looks like:
DoThing(string foo, string bar);
DoThing(string foo, string bar, int baz, bool qux);
...
DoThing(string foo, string bar, int baz, bool qux, string more, string andMore);
Be refactored into something that can be called like so:
var doThing = new DoThing(foo, bar);
doThing.more = va... |
My company is having a reshuffle and I'm applying for my boss' job as he's moved up the ladder. The new role would give me a chance to move our development team into the 21st century and I'd like to make sure that:
I can provide sensible suggestions in the interview to get the job so I can fix the team
If I get the jo... |
I am validating data, in this case I want one of three ints. I am asking this question, as it is the fundamental principle I'm interested in. This is a basic example, but I am developing best practices now, so when things become more complicated later, I am better equipped to manage them.
Is it preferable to have the t... |
Suppose that I have project backlog item with effort of 40 hours. My sprint is 40 hours (1 week) and I have one developer in team.
So developer creates child task to pending backlog and estimates work to 40 hours. At the end of the sprint developer didn't succeed in resolving his task. Suppose that developer works only... |
Well, I have some problems with procrastination and whatnot, but those get infinitely worse, when I cannot remember what I should be doing.
I mean, I know my project, I wrote 100% of the code so far, and I knew more or less what I was doing, but I don't remember exactly what, I don't remember what file I was editing an... |
If I write something like this:
var things = mythings
.Where(x => x.IsSomeValue)
.Where(y => y.IsSomeOtherValue)
Is this the same as:
var results1 = new List<Thing>();
foreach(var t in mythings)
if(t.IsSomeValue)
results1.Add(t);
var results2 = new List<Thing>();
foreach(var t in results1)
if(... |
Basically I'm new to network programming in Python, so I went on a tutorial online to find out about it. Using what was taught in the tutorial (creating a socket, connecting to ports, etc), I modified the code so that I made a program where two computers can send messages to one another.
If I were to apply for a job a... |
github encourages 1 fork per user, so that that user can work independently on a feature and then request that feature to be accepted into the main repository via pull request.
However, what if 2 developers need to collaborate on that feature? What is the ideal workflow for this? I could see a number of options:
Both ... |
I have very little experience working with classes and object. I work in a loosely typed language, PHP.
I was working with a SimpleXML object and ran into a problem where I was trying to do math with an element of that object like $results->ProductDetail->{'Net'.$i};
If I echoed that value, I'd get 0.53 but when I trie... |
For example:
I have an ACL (access control list) with keys in the database like create_user and allow_booking_for_past_dates. Each ACL entry has a corresponding method or function name in the application.
I have several 'controller' classes for a web application each of which may have one or more references in a 'page... |
Let's say you have a resource that you can do normal PUT/POST/GET operations on. It represents a BLOB of data and the methods retrieve representations of the data, be they metadata about the BLOB or the BLOB itself.
The resource is something that can be processed by the server on request. In this instance a file th... |
I'm not familiar with Drupal, really. I can dig around the admin interface and navigate the directories and find the files that I need to just fine as well.
What I'm really not familiar with is adding modules or extending modules. The site currently takes an order and sets up recurring payments through Ubercart and u... |
A company produces software (and hardware) that is used to both perform automatic adjustments on electronic test equipment as well as perform calibrations of the same equipment. The results of the calibrations are put onto a certificate of calibration that is sent to the customer along with the equipment.
This calibrat... |
I have a doubt about budgeting when working with agile iterative approach. If I understood well, in agile at the end of each iteration we have usable product, so we have some of the requirements met and then some part of the software will be already working.
How do we charge for our work in this methodology? Do we cha... |
So we run a site where there are elements of the interface that could potentially be changed at any moment in the backend. Specifically we run a web service where certain functions are loaded dynamically. However, there are times where we remove certian functions and we want the experience to be as seamless for the use... |
We maintain a web application for a client who demands that new features be added at a breakneck pace. We've done our best to keep up with their demands, and as a result the code base has grown exponentially. There are now so many modules, subsystems, controllers, class libraries, unit tests, APIs, etc. that it's sta... |
Who should be the participants in retrospective? Will it be only the team members OR should the Product manager, all the stakeholders and dependent teams also participate.
I am of the opinion that only the team should meet to discuss in retrospectives, else all team members will not open up. But one of the managers ins... |
So I have been searching everywhere and havn't been able to find anything with the sufficient information I need.. so Im a bit stumped on this one at the moment
What I am trying to do is create a public/private key pair (like PGP) upon a users account creation, based on their passphrase and a random seed. The public ke... |
Our team heavily discuss the issues how to handle code list in a web service definition. The design goal is to describe a provider API to query a system using various values. Some of them are catalogs resp. code lists. A catalog or code list is a set of key value pairs. There are different systems (at least 3) maintain... |
My name is Sael and I'm 14 years old. Since I was 12 and I got my first computer I instantly go interested in making games. So of course like any other I googled it, got discouraged and forgot about it for a few months. When I was 13 I decided to continue programming, and decided that java would best suit me. Now after... |
I have a database table that contains id, filename, userId
id is unique identifier
filename should also be unique
table may contain >10000 records
When a user uploads a file it should be entered in database with given
rules:
If there is no record with same filename, it should be added as it is (Ex. foobar.pdf)
I... |
I am working on a system to configure hardware. Unfortunately, there is tons of variety in the hardware, which means there's a wide variety of capabilities and configurations depending on what specific hardware the software connects to.
To deal with this, we're using a Component Based Entity design where the "hardware"... |
I have been taught to access databases through abstraction layers. I was wondering why it is not also standard practice to access the file system through an abstraction layer? It seems to me unit testing would become much simpler, since mocking the filesystem is often a pain and poorly supported by some languages.
|
This code is based on the idea of a Form Object
http://blog.codeclimate.com/blog/2012/10/17/7-ways-to-decompose-fat-activerecord-models/
(see #3 if unfamiliar with the concept).
My actual code in question may be found here: https://gist.github.com/frankjmattia/82a9945f30bde29eba88
The code takes a hash of objects/attri... |
In the university that I am working they have decided to participate in the ACM regionals for the first time, they would like to appoint me like a coach. I have never been into that situation before and have not found so much information about it, so what is the real work of a coach in those contests?
Sometimes I have ... |
Is there a representation for modern programming constructs that are becoming common in modern OOP/hybrid languages like mixins/traits/categories/partial classes ?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.