instruction stringlengths 34 19.9k |
|---|
This is my understanding of the Application Layer:
• It implements Application logic
• this layer contains Application Services, which are used by external consumers to talk to your application
• Application Services are coarse-grained and orchestrate operations which map directly to use cases ( hence also the term ... |
I'm working on a pretty standard LAMP based web application. The server itself has a standard MySQL database and the application is written in PHP. The kicker is, we also use SQL Server databases with this application.
The current data setup is this:
MySQL stores the user account information (Username, password,
pri... |
When browsing open-source projects that are primarily developed for Linux systems and downloading the latest packages, the source code is always stored in a .tar.gz or .tar.bz2 file.
Is there any reason for using .tar.gz or .tar.bz2 rather than something like .zip or .rar or some other compression algorithm (or even le... |
Say I'm developing a bug tracker, where a ticket belongs to at most one milestone, and a milestone can have many tickets. When a milestone is deleted (from the database), all tickets associated with that milestone must have their relationship unset (i.e. set to null). This is a simple relationship.
The classes are fair... |
When writing page generation in PHP, I often find myself writing a set of files littered with database queries. For example, I might have a query to fetch some data about a post directly from the database to display on a page, like this:
$statement = $db->prepare('SELECT * FROM posts WHERE id=:id');
$statement->bindVal... |
We have an application that we need to ensure that our APPLICATION DATA should not be used (or opened) in different computers with same users. For that we thought about getting harddisk GUID as a part of data encryption private key. In this case raid disks, virtual PCs would fail and wouldn't be able to open the data. ... |
Do NSURLConnection service objects and XML/JSON parser objects fall within the controller layer or the model layer? Why?
Is it OK to have business logic in the controller? Or should it be in the model layer only?
Can the model layer be represented by NSArray/NSDictionary objects or should it be strictly structured with... |
I was recently wondering why the keyword auto was chosen in C++11 to mark a variable whose type must be inferred by the compiler, like in
auto x = 1;
Since
var seems more common in other programming languages (e.g. C#, Scala, JavaScript), and
As far as I understand the new semantics of auto breaks backward compatibil... |
Word processors (e.g. Microsoft Word) display documents to the user as styled text. The user can select a part of this text and apply styles to it, and edit the text.
The word processor must (I guess) have an internal representation of the document that indicates which bits of the text displayed to the user should be s... |
E.g.
- $stream1 is the STDOUT of a child process and $stream2 is the STDERR of the same child process
- $stream1 is one child process and $stream2 is another child process
Is there a possiblility in perl to monitor two or more streams at the same time?
So we loop as long as anything pops-up in any of the streams and we... |
I'm developing a tool that handles (electrical) parts. The parts can be created, viewed, modified, deleted, grouped and so on...
In order to make this question useful for future visitors I like to keep this question universal since managing parts in a DB is very common no matter what parts are in the DB (CDs, cars, foo... |
One of things that annoys me about SQL is that it can't think in terms of objects and it's lack of encapsulation makes me constantly have to escape commands to prevent injections.
I want a database language that can be polymorphic and secure. I have searched online for non-procedural database programming languages and ... |
I work on a rather large code base. Hundreds of classes, tons of different files, lots of functionality, takes more than 15 minutes to pull down a fresh copy, etc.
A big problem with such a large code base is that it has quite a few utility methods and such that do the same thing, or has code that doesn't use these ut... |
Just wondering if text such as the following, which appears inside the source files of a free, open source API, means anything in a court of law
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
//... |
For example, if I have a Customer Transactions Table and I create a REST for it. The fields are: date, description, and total_amount.
I am trying to figure out which one is much more efficient when you get the sum and the count of the transactions:
You create a REST for /transactons URI and it lists down all the tran... |
Note: after writing this I realize that this question is perhaps philosophical, but I'm interested in how the industry handles this scenario regardless.
I have recently been working with a code base that is not yet as testable as it should be. I've seen some junior developers check in code that breaks use cases, whic... |
I want to uderstand why there is a method in C# that could reurn a value, for example:
public int Accelerate()
{
Speed++;
return Speed;
}
and a method that does not reurn a value (void)?
What is the difference in the following example of the above one:
public void Accelerate()
{
Speed++;
Console.WriteLine(Sp... |
I'm in the early stages of designing a client/server application. The clients will be batch programs that read a file of customer contact data (name, address, email address, phone no's) and pass these components to the server, which will add them (if not already present) to corresponding mySQL tables and return id's ... |
Say we have a view page where users perform actions in multiple steps, some of these actions would involve DB operations with transactions (the snippets are in pseudo-code like from):
View 1:
Step 1:
...
Step 2:
...
Call ActionX
Step 3:
...
ActionX: # can be called fro... |
My programming friends are always telling me that HTML is a markup language and C++ is a programming language. When I ask them what's the difference, they never give me a reasonable answer.
What could make one call C++ a programming language, and HTML not?
|
I am trying to figure out a better way to decide table storage configurations whether it will use static configurations using tables or dynamic configurations using EAV (entity-attribute-value)
When creating database tables, forms, and reports, when do you decide that a program should use a normal database (wherein eve... |
I was using this feature in earlier Windows release like XP and NT. I was able to run a GUI from a Windows service. But it is not possible in the later versions.
What is the reason behind the removal of this feature? Why can't Windows services have a GUI?
|
During a job interview, I was asked to explain why the repository pattern isn't a good pattern to work with ORMs like Entity Framework. Why is this the case?
|
I have a program I'm working on that my company uses internally, but is also sent to vendors. The vendor version will be identical, except that it will be missing some features, and use an installer. I only have to remove 2 lines from an XML file, and it's good for external use.
Is there some "typical" method to creat... |
I'm about to leave a project, and before I go my boss has asked for me to document code (I've not documented very well). It's not a big deal, the project is not terribly complex. But I'm finding places in my documentation where I would like to say, "Notice on line XYZ that such-and-such happens."
In this case, it doe... |
When learning about these tools, I (naively) thought that mapping about the business space could be front loaded by doing it only once and refering to those diagrams for each project within a single business unit. However, I am finding that each situation is calling for it's own set of diagrams to properly communicate... |
I'm not sure if what I'm after even exists or if it doe's im looking for the wrong thing.
I'm after a framework/application/SDK that allows me to build a desktop application with a HTML/CSS/JavaScript based interface yet still allow for more complex OS interaction with a programming language such as Python (im also fa... |
I'm looking into delving into a bit of custom OS work (and yes I understand that doing any development at the DE level or lower on an OS is extremely complex and not a light thing to undertake, curiosity is driving this though), I'm in the research phase right now, digging around and learning by example from the source... |
I am working in a Python project that I want to release under the GPL3 license. This project has one file that uses the BSD lxml library .
I really need to put reference of the BSD license in the file where I use the library? Or just the GPLv3 of my project covers the licenses restrictions.
Library:
http://lxml.de
Lic... |
I find header files to be useful when browsing C++ source files, because they give a "summary" of all the functions and data members in a class. Why do so many other languages (like Ruby, Python, Java, etc.) not have a feature like this? Is this an area where C++'s verbosity comes in handy?
|
I've been reading about software licensing as I feel that I'm at a stage now, where I should probably have some sort of a license associated with my code.
What I am looking for is a copyleft (weak or strong) license that basically is very liberal. So I'd like the license to allow anybody to do anything with the code/pr... |
I asked this question on Stack Overflow and it was closed as off-topic. I'll ask it here hoping it will do better.
This might sound silly, but bear with me. I've been working a lot with intervals and dates lately. One question that bothers me: is a day really 24 hours long? I'm interested by the answer both from a theo... |
I'm finding it hard to solve the problem and was hoping that someone could help me with the solution or at least give me a search term to use for problems like this one.
The generalized problem: I have a set of numbers (e.g. [1,2,3]) and a an array of sets (e.g. [1,4,5],[4,2,3],[6,7,8],[2],[1,3]). What I need to do is ... |
One feature I miss in from functional languages is the idea that operators are just functions, so adding a custom operator is often as simple as adding a function. Many procedural languages allow operator overloads, so in some sense operators are still functions (this is very true in D where the operator is passed as a... |
I've written several unit tests for an already existing DatabaseOpenHelper class. I covered the creation scenario and migration from old schema to new one. Unfortunately, I don't feel that my tests are good. For example, for DB creation I check that SQLiteDatabase. execSQL() was called three times (we have three tables... |
I have an open source project for mydomain.com which requires connections to a database (...as is tradition). What is the standard practice for allowing others to work on the site, without giving them full access to the database's credentials?
For example: If I have a connect.php page that connects to the database. I d... |
I'm new to GitHub and VCS in general. I've been programming in various languages for years, but I've always worked solo on custom projects (no public releases). I recently started using a jQuery UI widget I downloaded from GitHub in a project I am working on. The repo is no longer maintained by the original author. Ano... |
Although this is a gamedev project, the question is about general OOP practices, so I believe it goes here. Here's the problem:
(note: I will call any equivalent of real-world physical objects "entities" from now on; e.g. a rock in the game is an entity)
A specific class:
class Character
{
public/private CharacterInven... |
Recently I have been reading online about eXtreme programming and agile practices. I wish to adapt them. However most of my code is all in PHP which is the normal CRUD type web applications. Moreover I user web framework like CodeIgniter, which also abstracts a lot of the core features.
To sum up, how can I implement t... |
I have written an open source and cross-platform C++ File Library which have exception and error codes. Exceptions can be disabled when the program is running. In that case, the user have to check the error codes. Of course, when exception throwing is enabled, error code won't be returned because exception is thrown be... |
I looked at it in my field of work, which is film and pretty much every software we use comes with python as a scripting language: http://en.wikipedia.org/wiki/List_of_Python_software That made me assume it's the most popular.
How did Python become popular as a scripting language? Especially as an embedded language int... |
I’m trying to “conceive” the business logic of this website that has many activities, that the users can build their “combo” and get discounts depending on their choices and how long they are willing to pay for their plan (1, 3, 6 and 12 month plans).
I’m having a hard time trying to come up with a solution, while keep... |
Suppose there are two threads, which communicate by asynchronously sending data messages to each other. Each thread has some kind of message queue.
My question is very low level: What can be expected to be the most efficient way to manage the memory? I can think of several solutions:
Sender creates the object via new.... |
I have an open source project that uploads files to DropBox among several file hosts. Right now I am screen scraping for DropBox. To use their API, I have to hardcode a SECRET KEY provided by them to me for OAuth authentication. But I'm afraid that the key won't be secret if it is visible plainly for anyone to see.
It ... |
I have a set of loadable data decoders for a specific type of data and a stream to read containing data. Now I want the program to select the correct decoder in a reliable way so I want to use a trial-and-error algorithm. It seems resonable to create a decoder and connect it to the stream using a constructor:
// C++ co... |
In your opinion, do you think it is a waste of time to make checks that you know there is no possible way of it being there/not being there, or would you just put it there just in case there is a bug or something? For example, below checks to see if a button is visible, then music is playing, but there is no way for t... |
If a project is dual-licensed GPL & BSD, should there be one LICENSE file with the text of both licenses? Or two separate files, one for each license?
And I think I should put a copyright/license comment at the top of each source file. How should that comment indicate the dual-licensed status of the project?
|
On the internet, I've come across this question:
Classify the Hashing Functions based on the various methods by which the key value is found.
with answers like
Direct method
Subtraction method
Modulo-Division method
Digit-Extraction method
Mid-Square method
Folding method
Pseudo-random method
which I find strange. ... |
Possible Duplicate:
I’ve inherited 200K lines of spaghetti code — what now?
Not long ago my company placed me in a team that deals with some of the most complex bugs that are in production. The thing is that almost all of these bugs are in legacy applications I am having a really difficult time understanding and deb... |
First, does anyone know a specific advantage of Google App Engine for Python Apps?
Is there some advantage over Heruko or Appfog?
And about the database API?
Now, what about the limitations?
Are there any factors that make you think twice about using GAE?
|
Michael Perry states in his Pluralsight course on Provable Code (transcript subscription only) that:
[T]he burden of proof rests with the caller
In a code contract, why must the burden of proof rest with the caller and not the method of the class that is being called? Is this a preferred convention or does it have a ... |
I'm looking at plupload for some upload features on a website I'm developing. Now plupload is GNU GPLv2 licensed and that implies that all derivative software should also be GPL licensed (right?). Therefore I run the plupload through my minifier, the single minified js file will violate the license, and upon request, I... |
I mean something along the lines of:
public interface Dimensioned {
int getWidth();
int getHeight();
}
and
public interface Positioned {
int getX();
int getY();
}
There are a lot of standard java classes that have exactly those methods-- notably Component and all of its subclasses as well as Dimensio... |
The name mangling schemes of C++ compilers vary, but they are documented publicly. Why aren't linkers made to decode a mangled symbol from an object file and attempt to find a mangled version via any of the mangling conventions across the other object files/static libraries? If linkers could do this, wouldn't it help... |
Is there some standardized or widely accepted algorithm for picking up operators in shift/reduce conflicts in LALR parser? The question is naive, my problem is not with implementing my solution, but implementing the solution is already widely used.
For shift the operator is the next input token, for reduce, it depends ... |
I'm trying to figure out the best way to handle custom errors in my application.
Option 1:
if(expr) {
} else {
$_SESSION['error'] = "Some message describing the error";
}
Option 2:
if(expr) {
} else {
$_SESSION['error'] = 2;
}
In option 1, the same error might be recycled in multiple situations. If I ever dec... |
I was using a popular music package (Ableton Live) when I opened the legal section of the helpfile and saw that the program contained code licenses that appeared to be both free as in freedom and free as in beer. I cannot find an online copy, alas, but if necessary I can list the licensed packages.
As far as I can see ... |
I'm having a hard time understanding the difference between an emulation virtual machine and a language vm. I started with the research and implementation of an emulation virtual machine. Primarily emulating quite old 16-bit architectures.
I want to get the basics down for a language virtual machine. Are both systems ... |
I'm a bit confused about the difference between nominal and structural type systems. Can someone please explain how they differ?
From what I understand:
Nominal: Type compatibility is based on type name.
Structural: Type compatibility is based on the type structure, e.g. in C if 2 variables are struct types with diffe... |
I would like to experiment with threads on a multi-core processor, e.g. to create a program that uses two different threads that are executed by two different processor cores.
However, it is not clear to me at which level the threads get allocated to the different cores. I can imagine the following scenarios (depending... |
Should every piece of code put online have a licence with it, or should it explicitly mentioned that it is in the public domain?
I'm writing a simple python script that will take a project euler problem number and save a file with the question text as comment. As I was creating the directory and initializing git I adde... |
I've read a couple of articles (example) that consider the classic
for (int ...... size() .... i++) loop bad practice when iterating through for example vectors in stl. Instead the recommended why is to use vector iterators, i.e. begin, end, etc.
Why is that?
|
After watching this talk on REST, Reuse and Serendipity by Steve Vinoski, I wonder if there are business cases in greenfield projects for (XML-)RPC-ish setups, that REST could not solve in a better way.
A few RPC-Problems he mentions:
Focus on language (fit the distributed system to the language, not the other way aro... |
Despite increases in screen size and resolution, many sources still suggest that code be limited to 80 characters per line. I realize than there are many different opinions on this subject, but I wonder whether there are any standards bodies or influential firms that use other limits (120 characters is a common alterna... |
I have a couple of exam questions for my compilers class and wanted to check if my solutions are correct.
The first question is:
Consider a language in which numbers start with an optional minus
sign, followed by one or more decimal digits, followed by an optional
decimal point. If the number contains a decimal po... |
I have the following question taken from a compilers course exam:
Show that the following grammar is ambiguous.
S = XcY
X = a
Y = b | Z
Z = bW
W = d | ϵ
I drew the following tree:
Am I correct in thinking it is ambiguous because acY can end up at acb (one of which is followed by an epslion) following different paths... |
I've just had to switch out an ORM and it was a relatively daunting task, because the query logic was leaking everywhere. If i'd ever had to develop a new application, my personal preference would be to encapsulate all query logic (using an ORM) to futureproof it for change. Repository pattern is quite troublesome to c... |
How do you evaluate arbitrary math expressions using temporary variables instead of a stack? What I'm talking about is translating an expression into an array of simple operations- each that change one variable based on the second argument.
An example list of operations might be:
=
+=
-=
*=
/=
Notice how each operati... |
Consider an existing project that is dual-licensed GPL + either MIT or BSD.
Since it's dual-licensed, when I fork, can I pick one license in the fork? Or do my forked files need to continue to be dual-licensed?
It sure would be simpler to track only one license.
|
I read the hardware requirements of WCF in a book and two of them are the following ones:
A DVD-ROM drive
A 1024 × 768 or higher resolution display with 256 colors or more
Why is there a requirement for the screen resolution, or to have a DVD drive?
Perhaps, this requirement is necessary for Visual Studio to work. A... |
I find that the encapsulation required by OO has me frequently passing paramenters down the line from parent to child to great grandchild to second grand nephew once removed (not actually that bad). But inevitably in the process, and especially if graphics are involved there will be garbling the by the third iteration ... |
I've read about Template Method Pattern but I'm not sure about one thing.
The steps (methods) of an algorithm are supposed to be in the template method. In the case my template method's algorithm is about 2 completely different tasks that I would like all my objects to perform, let's say the one is drawing and the othe... |
Why does the compiler store constant values in the assembly metadata?
Are they directly embedded to Intermediate Language code from the assembly metadata?
|
I need something that represents a queue in F#.
The queue will be filled with items once, and (as the application progresses) items will be taken from this queue and moved to other lists.
Should I use the Queue class in .NET, or should I avoid it, and use the native lists in F# instead? Is there a better solution?
Why ... |
In my team we have been working on a firmware for a product. The product was released some years ago but we still implement new features in the firmware and regularly provide a new firmware for our customers. Recently we have developed a new product which use the same firmware as the first one. Of course, we had to cha... |
Imagine a scenario as follows: Lets say you have a central computer which generates a lot of data. This data must go through some processing, which unfortunately takes longer than to generate. In order for the processing to catch up with real time, we plug in more slave computers.
Further, we must take into account the... |
CodeIgniter has a very nice feature called a Profiler, which displays information at the foot of a page, information such as GET, Memory, POST data. It also shows database queries and how long they took to run which I find very useful.
I have recently taken over a legacy PHP application and it would help a lot to see w... |
I had recently read a paper 'Aspect-Oriented Programming' by Gregor Kiczales and others, and found there the loop fusion example.
Here is a definition of the loop fusion from the paper
…the loop fusion composes by fusing the loops of those primitive
filters that have the same loop structure and that are direct
neighbo... |
The problem occurs while doing TDD. After a couple of test pass, the return types of some class/module change. In a statically typed programming language, if a previous mocked object was used in the tests of some other class and was not modified to reflect the type change, then compilation errors will occur.
For dynami... |
I have a product with two separate applications. The core of the product lives in the database (oracle) and runs according to a schedule. The other is a client application (currently ASP.NET MVC3) used to manage the database application. There are three levels of validation going on; client, server-side, and database... |
I have an MIT-licensed project that used to include a GPL JavaScript library which has since been removed.
Is there any legal necessity to rewrite the revision history to completely remove this code?
|
I need to find the time complexity in terms of Big Oh notation for the following program which computes the factorial of a given number: The program goes like this:
public int fact(int n){
if (n <=1)
return 1;
else
return n * fact (n-1);
}
I know that the above program uses recursion but how to derive the t... |
In designing an API that provides an event listening interface, it seems there are two conflicting ways of treating calls to add/remove listeners:
Multiple calls to addListener will only add a single listener (like adding it to a set); can be removed with a single call to removeListener.
Multiple calls to addListene... |
I am working on debugging my mobile application. There is a specific requirement/issue that I am having related to a drag and drop touch interface on an iPad. I am at the trial and error phase of trying to figure out how to fix this (meaning I have no idea how to fix the issue I'm seeing).
The only way I have been ... |
I am building a tutoring application that can be used to draw objects and then one is able to drag them around. I would like to know what is the best thing to do when someone clicks on an object and starts to drag it.
I was told I should "lock" it - prevent it from being grabbed by someone else at the same time and bei... |
So I have a javascript program that currently gets random points, it generates a random x,y,z value around the center point, within the radius r
var maxArms = 3;
var i = 0;
var color = [];
for(var arm = 0; arm <= maxArms; arm++) {
var perArm = (numStars/maxArms);
var perPoint = Math.ceil((r/10)/5);
... |
I am eager to know what information is checked by the online companies to confirm that the card is yours?
If a programmer has to implement this functionality, how can he access information like address of the client which is not written on the debit card? Thanks
|
I've recently been hired for a project that involves working with and around several third-party "enterprise" systems. Due to what I imagine would be the astronomical cost and effort required to build a sufficiently faithful replica of the production environment, the prospect of having a real development environment se... |
Recently I've found myself chafing at the limitations of document indexing engines. I was developing a small website that needed some fairly robust searching capabilities but due to their hardware constraints I couldn't deploy a Lucene-ish solution (such as Solr or ElasticSearch, like I normally would) to handle this n... |
This subject is long time in the making for me and it particularly took off when I was researching bootloaders for computers and consumer electronics, which, I will note, differ drastically. I've learned how ancient and inflexible x86 hardware is and just how much the structure of software is constrained by it. Example... |
If an OSS project is not backed (for example, by the Apache Foundation), how is the OSS license upheld?
My specific scenario is this: if I create an GPLd mobile application with a non-commercial transformations clause, what's to actually stop someone from re-releasing it as "Pro" and charging for it?
I assume the owner... |
So my question is this:
Is there any easy way for a single developer to release an app on iOS and Android?
I am a web developer that primarily plays in PHP, Node, Ruby, AS, and JS. I have dabbled a tiny, tiny bit in Objective-C and Java. Basically I am looking for a good way to release a fairly simple app on both Andro... |
Is there a more common name for a "Blittable" data type? In my software there is a distinction between a variable sized structure and a fixed size structure that has a similar behavior to "blittable" but I have only seen the name used in Microsoft software.
|
I'm trying to lead a charge for re factoring our rather bloated controllers.
We currently have a BaseModel from which all our other models inherit. The BaseModel contains things common to all pages, such as the page title, css files needed, current user.
Each constructor has a private method to construct a particular V... |
I have been programming for about a year and I am really interested in data analysis and machine learning. I am taking part in a couple of online courses and am reading a couple of books.
Everything I am doing uses either R or Python and I am looking for suggestions on whether or not I should concentrate on one langua... |
I've been reading about Developer (or Programmer) Anarchy, which seems to be billed as a post-Agile development methodology. I found a few resources on it (1, 2) but it doesn't seem to be a lot out there.
I was wondering if anyone had any good resources where I could find out more about it _ how to implement it, pros... |
A colleague and I have run a Kanban board at 2 places of work now, introducing a kind of scrum-ban agile/lean process into the team. Helping us move towards more flow orientated work and continuous releases.
I just wanted to ask your advice, that when a task is peer tested or tested by the test team further down the bo... |
Assume we have a method that validates an object before saving it to a DB. It returns back KVP something like:
public KeyValuePair<bool, List<FooErrorReason>> ValidateABar(Bar b)
{
var reasons = new List<FooErrorReason>();
if (string.IsNullOrEmpty(bar.Name))
{
reasons.Add(new FooErrorReason { PropN... |
I have an exam question that I am unsure of the answer. The question is:
In organisation X valid user names have the following structure. The
user name can be either the employee’s name followed by a colon and
then the department name or a string of one or more alphanumeric
letters consisting of lower case, uppe... |
I'm very new to python and (coming from Java) am trying to think in a "pythonic" way. I'm having trouble understanding how Django turns a function (or variable) name given in string to the actual function.
Example from Django tutorial: If we give:
list_display = ('question', 'pub_date', 'was_published_recently')
Dja... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.