instruction stringlengths 34 19.9k |
|---|
I am building a web app in PHP and Symfony.
Basically if we search there are plugins / extensions / bundles for almost 60% of stuff.
The advantage of using them is that you can easily get your functionality and it will be maintained by the author
and we don't need to worry about compatibility.
But their downside is
S... |
We want to export some data from our data base as XML. For example, a Person can have age, name and some other properties.
We have two choices to define the XML format.
Choice #1:
<Persons>
<Person>
<Age>16</Age>
<Name>Richard</Name>
</Person>
<Person>
<Age>34</Age>
<Name>Eric</Nam... |
I am an ASP.NET developer. I want to learn ASP.NET MVC. In fact I am learning it. But Now I am confused at a point. How can I connect my database to my application. Using entity framework or linq or ado.net. I have good knowledge about ado.net. But about entity framework I cant say anything. Now my problem is this whic... |
I have two tables, project and photo. photo has ID,projectID,path : each project has multiple photos.
Now one of these photos is the one that has to be displayed. The question is how to represent this in the database.
Earlier, I used descending order of ID numbers and chose the latest one, but that failed and caused pr... |
I tested two approaches to store session data:
The classic: 1 key, 1 object (And every key as static final String in a class)
"user" --> UserObject
"preferences" --> List
...
An approach with only 1 object
"sessionObject" --> SessionObject
And my SessionObject contains UserObject and the list of preferences as ... |
Is there any situation in industrial object-oriented programming when the dependency inversion principle should not be used?
|
Memoization is definitely a powerful technique.
But Dynamic Programming is slightly better IMO, since it does not involve the memory strain (in a recursive program, the parameters occupy memory and this memory increases as we go deeper into the recursion). But speed-wise, both are pretty equal.
But definitely memoizati... |
I'm developing an Android application which is responsible for showing multimedia such as videos and photos to user.
I have a certain activity for a gallery of photos. In my phone where I'm developing the application everything works correctly. Currently I'm testing it in an emulator with a small screen for checking f... |
With the advent of "the web is the platform", JavaScript is fast becoming the most widely used programming language in the world.
However, many tasks that are easy to accomplish in other modern languages are difficult or puzzling in JavaScript, because the language design is so "unique":
JavaScript has a prototype-bas... |
I was reading about CMS and ERP. And got confused at this point that whether a system can both be an ERP and a CMS? is it possible?
|
The quality of the code in our software is indeed lacking. When you change a line of code in one component it usually breaks code in other components.
Our software architect blames this on collective code ownership. He believes that if every developer was responsible for his own piece of code then he would tidy it up a... |
I am trying to design an algorithm for optimal sensor placement in a given area.
After doing some research I found the Art Gallery Problem. However, this problem assumes that the guards can see all the way to the perimeter from their positions, which is not the case with sensors (sensors have a range). Is it possible t... |
Why in some frameworks the logic layer is called "Model" whereas in some it is called "Service". Are they different from each other or just different by naming conventions?
UPDATE 1
The reason I'm asking is because in Zend Framework, a classical MVC framework, everybody uses the concept of Model. Now I'm learning Angu... |
I am designing the back-end to a SOAP web-service and have a question about how I am thinking of doing it.
I am going to go with a simple layered design which consists of 3 separate layers.
Layer 1 -> Layer 2 -> Layer 3
Layer 1 : Will implement the SOAP skeleton interface, so this will be the main entry point of my ap... |
TD;DR:
There was some confusion as to what I was asking, so here is the driving idea behind the question:
I always intended the question to be what it is. I may not have articulated it well originally. But intent have always been "is modular, separated, loose coupled, decoupled, refactored code" markedly slower by its... |
If the plagiarized code is commented out because I found another way to solve the problem, but I forgot to remove the comments, is that considered plagiarism?
I used the copied code to help me debug and compare the output between my own code and the copied code. In the final code, I commented out the copied code. Sinc... |
I'm a C# developer who hasn't had the privilege of learning WPF yet. However, I recently initiated the architecture phase of a new project which I expect will eventually employ WPF (probably; although ASP.Net is still an option) -- but the GUI development won't begin for several months. (We need to get buy-in on a WinF... |
Suppose I'm making an algorithm that identifies the subject of a picture. It could be anything that a computer doesn't do that well, but I'm not expecting to get the right answer every time - 80% is fine. Suppose further, that the accuracy of the intermediate steps was also somewhat fuzzy. Is there a way to incorporate... |
Or to put it another way how to ensure that architecture or quality doesn't suffer, doing agile.
Some of the understandings in handling architecture in agile are below(generally applies to testing as well)
* Do architecture until risks fall off your radar
* minimal design up front, so that you will not pay a horrible p... |
I had a discussion with some peers and even some technical leads in the team around this and Im all for the purist MVC approach. Especially when the project is in its infant stages (its easy to implement a pattern going forward). Im a firm believer that anything to do with the back end should be kept separate from the ... |
A question that has been vexing me lately has been about how to effectively test (end-to-end) features in a distributed system. Particuarly, how to effectively manage (through time) test data for feature testing.
The system in question is a typical SOA setup. The composition is done in JavaScript when call to several... |
I have a control where the user can select a value for the x and y axis from 2 dropdowns, and then there is a 4 by 4 grid (an image) which will show what their selections correspond to (updating dynamically).
So, if the grid is:
a b c d
e f g h
i j k l
m n o p
If the user picks 2 for row (column is null for now), e f ... |
Both these trees try to keep the most frequently accessed element at the top. Is there any difference between these two trees?
|
Often boolean setters are pretty self-explanatory, like setLogErrors($bool). I do see some benefit of providing some additional information in the documentation, in this instance maybe where these errors are logged. But how much documentation is too much, especially when it comes to documenting the value that is passed... |
I am trying to understand the definition of 'abstraction' in OOP.
I have come across a few main definitions. Are they all valid? Is one of them wrong? I'm confused. (I re-wrote the definition with my own words).
Definition 1:
Abstraction is the concept of taking some object from the real world, and converting it to pro... |
What T4MVC does makes complete sense to us.
It converts the simple string input into strongly typed input, which eases things for the developer.
Like this -
return View("foo");
to
return View(Views.foo); // better (T4MVC)
What could be a reason as to why the MS people are NOT doing it this way?
|
There is a debate between my team members about the declaration of a Constants class. We are moving the constant variables into a separate class like below.
public class Constants
{
public const string StateId = "ST";
public const string CountryId = "CI";
}
A few of my team members suggested that we declar... |
I have decided to work as a freelancer. I have developed a software and have successfully given the presentation demo. The client liked it and has agreed to implement the project in his organisation.
But the client has asked me make it sure that I wont run away with the money without completing the project. The cost o... |
I'm currently writing a Sprite Sheet Unpacker such as Alferds Spritesheet Unpacker. Now, before this is sent to gamedev, this isn't necessarily about games. I would like to know how to detect a sprite within a spriitesheet, or more abstactly, a shape inside of an image.
Given this sprite sheet:
I want to detect and ex... |
From what I've learned last term on SWE courses, a big part of it is writing documents, so it seems that a software requirements specification (SRS) should earn points for my end-of-course project.
However, I will be more comfortable if I use prototyping, i.e., I make a small thing that works for the most trivial of si... |
We've been working with Scrum for a while now, generally successfully. However of late, as the pressure has started to mount up we've encountered several situations where items came through planning meetings but when it actually came time to code, it became apparent they were woefully under-specified.
This is an annoyi... |
I have a project with a git branching model that roughly follows that of nvie's git-flow.
Our release branches are named in a SemVer format, e.g. v1.5.2
Once a release branch is given the green light for production, we close the branch, by merging it into master, applying a tag, and then deleting the branch.
As we imme... |
In some ruby on rails projects, I have seen instances where strings are used instead of a foreign key reference to a lookup table.
I usually code in C#/SQL Server and use lookup tables, but am not particularly experienced in ruby on rails.
So my question is, should I be using strings instead of lookup tables in my ru... |
Why is ~0 a sequence of 1 bits and not just a single bit? Where do the extra 1 bits come from? Does this mean ~1 a sequence of 0 bits or just a single 0 bit?
My understanding was that the ~ operator is applied on the specific bits mentioned.
|
I recently tend to design my methods in the following way:
if ( 'A' === $a ) {
if ( 'B' === $b ) {
return 'some thing';
} else if ( 'C' === $c ) {
return 'some other things';
}
}
/* If you made it up to here, then something has gone wrong */
return false;
So basically the idea is to check ... |
For brevity's sake, consider the following scenario:
Part of my application is a wizard for bringing on new clients and it's a dynamic page. One step contains billing information, another step is setup information, etc. Because it's one page, in my mind I have one controller for the entire wizard, but that also means I... |
I'm the technical founder of a startup and I'm currently looking to hire a second developer for our product.
Since I've been the sole developer, there is no formal organization for the project and I wanted to know what would be the minimum organization required to incorporate this second developer.
Right now the code o... |
Consider an application that displays only Foobars belonging to themselves to normal users, and all Foobars to admins:
-- Normal users:
SELECT * FROM Foobar WHERE user_id=:user_id;
-- Admins:
SELECT * FROM Foobar;
Currently, this how the queries are represented in the codebase:
$sql = "SELECT * FROM Foobar";
if ( $u... |
So I have to write a filtering system, which may apply preprocessed ruleset to data - and trigger some actions defined in the ruleset while continuing its evaluation.
<ruleset name="1">
<rule>
<conditions>
<and>
<or>
<match image="aceofspades" level="70" />
<match image="aceofdiamonds" level="66" />... |
I'm currently writing my own PHP Framework (yes, another one) for studying purposes. I'll actually try to use it as my graduation dissertation.
After two failed attempts, I've finally found a way to develop it in a modular architecture, like Zend and Symfony.
I have some loosely coupled modules that can work apart from... |
I'm developing a system to manage "cases". There will eventually be many different "kinds" of cases, so I've started with a "CaseTemplate" table that can be used to define what a case looks like and, via satellite tables, define the specific characteristics for a particluar kind of case.
One such characteristic is phas... |
I'm creating interfaces for a number of our existing classes for mocking reasons. Many of these classes also have package scope methods as an attempt to give some level of encapsulation by ensuring only the controller can modify some of their state. I had thought I could use this change to try to get cleaner encapsul... |
Currently we use Scrum with the exception that our Scrum Masters sometimes act as project managers rather than facilitators of the Scrum process. About half of the time team members pull tasks on their own, but half of the time the Scrum Master assigns the tasks to team members.
I would like us to fully adopt self-orga... |
My GIT repo is stored on a remote Linux server that I'm accessing from my Windows PC through Netbeans.
Once my changes are done I would like to review them quickly before committing.
The server has no graphical components so I can't launch "gitk" from there.
I'm not very comfortable with a text diff on the server with... |
I need to reference the latest version of Bouncy Castle in a project I intend to publish to Github.
In my first posting of the code to Github, someone complained that I downloaded the entire Bouncy Castle library, added it as a project, and uploaded it.
What is the correct way to link to the latest version of this Bo... |
I'm making a web form for editing some objects. I'll call these objects Foos.
I have a Backbone model that represents Foos. I have a Backbone view that renders an editor form, filling in fields based on the state of the Foo model it is given.
My goal is to keep the Foo model in sync with the form fields.
Idea 1: I c... |
I am currently trying to understand more deeply the 4 principles of OOP: Abstraction, Encapsulation, Inheritance, and Polymorphism.
After studying the four principles, I don't fully understand why Encapsulation is considered one of the four primary principles of OOP.
Encapsulation is extremely common and useful in OOP,... |
This is a frequently asked topic... And I have read through many posts, articles and am about to read the book Working Effectively with Legacy Code, but before that and mainly because it will take more than a couple days for book to arrive, and I would like to keep my sanity in check, here's the question:
I am looking ... |
All apologies -- I'm still very much on the outside of Haskell looking in.
Why does the bind for a monad have this signature:
M a -> (a -> M b) -> M b
and not
M a -> (M a -> M b) -> M b
i.e. a function that takes M a instead of just a
a is available to the function in both, but the context that M provides is not av... |
Do software developers write SQL or database developers provide the SQL and the software developers use it? I am a novice to software development. I am just trying to understand the software development process because I have to do an internship this summer. I apologize in advance if this is a basic question.
|
I had my first programming exam recently...and well I pretty much flopped it. Did not do great at all. I have only myself to blame as outside of college time, I pretty much did nothing.
Now I have another coming up near summer time and I'm not allowing this to happen again. For a couple of weeks now I've been reading, ... |
Why does java print the value of the variable that is assigned it in the code below? I want understand what is happening here.
My thought is that the expression inside println() method is evaluated first. For the first example, 5 is assigned to int x. At that point, does x become available for the println() method to ... |
I have a general idea of how the processor handles instructions but spend my time working in mostly high level languages. Maybe somebody who works closer to the iron can provide some valuable insight.
Assuming that programming languages are basically very high level abstractions of a processor's instruction set, what i... |
I've been trying to figure out a way of calculating the estimated time remaining for an item in a queue when there are multiple workers processing items from the single queue.
A client submits a job to the queue, but since processing can take some time I wanted to give an estimate of feedback.
I know
Number of items i... |
I have content that is CC BY-NC-SA 3.0 (see http://creativecommons.org/licenses/by-nc-sa/3.0/), can software that uses it still be produced commercially and just let the user download the content separately?
In other words, if I have commercial software that uses the content with CC license, can the software still be d... |
Is there any particular reason why people use the A tag to mimic a BUTTON in HTML and JavaScript?
|
Most probably my boss didn't write a single word on a keyboard in his entire life.
He saw computers and he has a cell phone. He is a smart man.
How can I explain to him what a 'virtual machine' is?
(VM as in VMWare + virtual Box, not the VM as in Java, LLVM, .NET)
One of the reasons for asking this is that I want to ... |
Not so long ago I was told by a senior academic that, these days, VM-based code could run nearly as fast as compiled code, but my own experience is that compiled code runs several orders of time faster.
This is based on code attempting to do the same thing (processing a very large XML file) - in the case of the VM-base... |
I am programming in Java in a very object-oriented (OO) style. OOP comes very intuitively to me, but I have very little knowledge about other kinds of programming.
What exactly is procedural programming? How exactly is it different from OOP? Is it the same thing as functional programming?
I used to think that all progr... |
On it's latest technology radar, the guys at ThoughtWorks recommended avoiding JSF because it's attempt to create statefulness over HTTP ends up "causing a whole host of problems involving shared server-side state".
I've been using JSF 2.x for almost a couple years now, I like it and I can't say I've encountered any pr... |
I was naughty... Too much "cowboy coding," not enough committing. Now, here I am with an enormous commit. Yes, I should have been committing all along, but it's too late now.
What is better?
Do one very large commit listing all the things I changed
Try to break it into smaller commits that likely won't compile, as fil... |
I have a model Product with attributes sales and views. I need to get sales/views count of all the products. Is more correct to implement this as a method and have a call like Product.all.sales or create a new model Stats and implement as Stat.products.sales?
|
I have started to learn to program. I am interested in it and dont mind how long it takes to learn. But I am using books to start out and I find that there are some things I get and some things I have no idea.
I can understand the code when I see an example but I feel completely lost if I were to go out and do somethin... |
I am building an architecture like this:
These are my SW layers
______________
| |
| Views |
|______________|
______________
| |
|Business Logic|
|______________|
______________
| |
| Repository |
|______________|
My views are going to generate my HTML to be sent to... |
I want to modify one list (actually info stored in a database). A person doesn't have access to update every part of the list, but can update and delete parts they do have access to and add whatever they want to the list.
Here's my pseudocode:
ModifiedList
OriginalList
OriginalListWithUserRights
for each Thing in M... |
I am looking at developing a complete HTML5/JS mobile app that can be deployed to Android, iOS and Windows platforms. I am using DevExtreme tools to help me do that.
I already have a WCF service that serves me with everything I would need for this app. I want to reuse the same and found out how I could use JSONP (since... |
Assume you have a project that (in your opinion) is mostly decently well written, modularized, etc. and you want to keep much of it's functionality. However, an essential portion of this project is not well designed, and it can't easily be fixed with minor changes. The only way to fix it is to rip out a lot of the code... |
In terms of operating system architecture, what does a memory-clean software to get rid of all data that fill the virtual memory? I assume that it simply saves all RAM data into a file, but how does it exactly do this? What happens if you delete a file while a process that has resources on that file is executing?
Hope ... |
You see this phrase or similar kicked around from time to time, generally referring to a program that claims they were not designed to take full advantage of multi-core processors. This is common especially with video game programming. (of course a lot of programs have no concurrency and do not need it, such as basic s... |
Let us assume I have a basic object with a handful of self-relevant points of data.
class A(object):
def __init__(self, x, y, width, length):
self.x = x
self.y = x
self.width = x
self.length = x
And so we go on to instantiate several A objects and shove them into a list, as programm... |
I am currently developing a math-physics program and I need to calculate if two vectors overlap one another, the one is vertical and the other is horizontral. Is there any fast algorithm to do this because what I came up so far, has a lot of repeats. Eg lets say we have vector V1((0,1),(2,1)) and a V2((1,0),(1,2)) wher... |
To estimate PBIs you need to choose an average story and assign it a number of points (for example 5). Then you compare all other stories to that story and assign points accordingly. My question is, are you really supposed to compare every single story to that original story from the beginning of the project? If not, t... |
I have the following sort of directory structure:
part1
build
src
part2
build
src
Now I have a header file that I would like to include in both parts of these projects, it will contain constants and some macro definitions as well as some utility functions, and I want these to be synchronized between th... |
So I have talked my employer into finally jumping on version control...up until now my experience with git has been for personal projects and freelance work where everything is on one server, or small scripts...so, this is a bit above my knowledge.
We are going to have 3 web-servers… test, staging, production. We are g... |
I'm currently facing a issue on a project.
I'm resolving URL's on multiple DNS servers using a node.js server.
Until here, everything is fine.
But some ISP restrict the incoming requests from IPs outside their IP range.
So how could I modify my request to those specific DNS servers to make it look like I'm one of their... |
Let me preface this question by saying that I get the need for unit testing. I painfully get it. You have to do it to ensure that future modifications don't adversely affect the application in ways you did not expect. It's also good practice to utilize a test driven methodology to ensure your current modifications work... |
I have multiple tables in my database. Some tables have relationship to others and some don't have. My friend told me that it is not advisable to have a table that is not related to others. Is it substandard if I have multiple tables in my database yet there's no relationship at all? Are there guidelines concerning to ... |
I find myself reworking my code quite a bit, especially when learning to write algorithms that involve keeping track of multiple attributes and labels.
I feel that having the pseudo-code written up, having a small numerical example worked out, and a few test cases is usually a good approach. Yet, I find myself making m... |
I am about to start building a mobile (iOS/Android) app that uses a local database (probably SQLite). Since this is my first "real" mobile app, I am wondering what the standard approaches are to version management of the DB.
My thinking is I would do this:
include a base creation SQL script in the resources of the app... |
When developing a new RESTful application, I generally:
Define tests
Define routes [ e.g.: RESTful CRUD; namespaced on /api/users ]
Define models [ e.g.: "Users" ]
Define forms [ e.g.: in JavaScript (AngularJS), HTML5 and CSS ]
Currently thinking about throwing an API explorer into the mix… which would be another b... |
I came across a snippet like this, and find it's over engineering. Is it a good practice?
public class SchoolList extends ArrayList<School> {
}
public class School extends ArrayList<StudentList> {
}
public class StudentList extends ArrayList<Student> {
}
public class Student {
}
Actually I prefer a straightforward ... |
In the basic COCOMO Model which is used to estimate the development time of software
Effort : a * KLOC^b = X person months
Development time : c * Effort^d = Y months
where a , b , c , d are constants derived from the table below depending on the type of your software project
Question 1
Assuming X = 10 , Effort wi... |
I know of Interfaces, Abstract classes that serve as Base class, I've been reading up on loose coupling, ... But I can't come up with a decent solution when a property of a class changes, and the new type needs to be implemented in other classes using this updated class.
Example
Below is a simplified representation of ... |
Say I have a class with a single constructor that accepts 2 parameters and initialises itself using those parameters. I have written tests for this and they are all passing.
I later realise I need to make an addition to the constructor to accept three parameters. Should I
a) Add in the new parameter, watch my tests bre... |
I'm a fan of Dependency Injection, however I don't know how much both public and private methods inside a class should be loosely-coupled.
Just to picture it better, when I have both projectId and userId as private properties in my class, and both of them have their own decent setter methods which will do the input val... |
I know what node.js is & what it does.
What I really want to know is how does it work as an http server?
A server like apache gets a request, fork a process, allocate memory to process, handle the request & release the process after it is completed. If we get thousands of http requests at a time, then apache waits for ... |
Whenever I'm doing web development, and a page takes longer than half a second to be generated, I know that somewhere my code is hitting the DB too many times. The normal way to fix this situation is to ask the DB for all the information all at once instead, by doing JOINs and the like.
My question is: Why do many data... |
I am going to develop a simple Point of Sales system. Mainly all the data will be stored in a central db (mysql server). All the application are going to be winforms. Together each local client will have its db copy stored locally and all the operation will be based on the local db except for one operation that the tra... |
What kind of data cannot be compressed by using the huffman codes and why?
I tried looking for the answer, but I only came across loss-less and lossy compression. I don't really understand what types of data cannot be compressed by huffman and why they can't be compressed using it.
|
In a hypothetical economy there are currency units that can represent thousands of different values. So, for example there might be coins worth 1c, 3c, 5c, 7c, 7.5c, 80c, 8001.5c etc.
Given a list of all of the possible denominations and an arbitrary value how would one return a list of coins representing the smallest ... |
We need to support 5 languages for our product. This means that in order to have a potentially shippable product we need to translate all text new to the Sprint to all these languages. It doesn't make sense to me because the text might change after a few Sprints during which the users will use the application and give... |
When I run ffmpeg on an mp4 file, it says the duration is:
00:03:57.54
What is the unit that 54 represents ? I am interpreting it as 0.0054 seconds (54 milliseconds).
|
Based on this book , refering to pages 156 to 159 , it talks about the two different types of software architecture model : MVC & Layered .
There are distributed system architecture patterns such as : Master-Slave , 2 tier client-server , multi-tier client server , P2P
These are my questions :
1) In MVC , there is th... |
I would like to hear advice from the more experienced developers. The project is now in the design stage. It's mobile application and a simple web application. Content is pictures, comments, personal correspondence.
Pictures can be quite personal. Need a very serious attitude to security.
The question is simple: wh... |
I have recently switched to TSimpleRWSync from TRTLCriticalSection. The methods BeginRead and BeginWrite confuse me as wherever I read help, they seemingly do the same thing i.e. acquire the critical section whenever it gets relinquished. As the TSimpleRWSync doesn't allow multiple read threads, there is seemingly no p... |
I think I generally know what the Garbage Collector in Java does, but It's praised a lot, so I thought maybe I'm missing something about it's functionality.
What I know is, that the GC takes care of erasing from the memory objects that have no reference to them, and thus are unreachable by the programmer.
For example, ... |
I'm in the early design phase of a project to provide an e-commerce platform that will require several entities to be modelled, products, customers, orders, CMS pages, etc. They will all have a few things in common (ID, creation timestamp, last modified timestamp, etc).
My first thought was the usual one of giving t... |
How does the pattern of using command handlers to deal with persistence fit into a purely functional language, where we want to make IO-related code as thin as possible?
When implementing Domain-Driven Design in an object-oriented language, it's common to use the Command/Handler pattern to execute state changes. In th... |
I'm in the early stages of my programming career and I've been working with MVC for just about a year now. I've spent much time learning about the pattern and the concepts behind it, but as the projects I'm working with get larger I'm starting to think that maybe I don't have the best understanding of how the model lay... |
Consider what it takes to completely finish a story in our organization.
Demo requirements were met
UI design finalized (layout, styles, fonts, controls, colors, etc...)
User text finalized and mistake-proofed
All text translated to Spanish, Germal, Italian and French.
User manual updated
All bugs deemed by PO as need... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.