instruction stringlengths 34 19.9k |
|---|
I'm developing a Javascript library, and I'm thinking about releasing it under an open source license (e.g. GPL, BSD, MIT) — but that requires that websites that use the software link back to my website.
Do you know about any such licenses? And how have they formulated the attribution part of the license text?
Do you t... |
I grasp that it can fetch internet resources, but I'm not really fully appreciating what that means. I was doing the challenges at pythonchallenge.com, and I got past the one that requires urllib to fetch the page and read the source, but I don't see how this is useful quite yet. And examples are kind of lacking in div... |
I have been interested in some of the concepts of functional programming lately. I have used OOP for some time now. I can see how I would build a fairly complex app in OOP. Each object would know how to do things that object does. Or anything it's parents class does as well. So I can simply tell Person().speak() to mak... |
Recently I have been assigned to work on a major requirement that falls between a change request and an improvement. The previous implementation was done (badly) by a senior developer that left the company and did so without leaving a trace of documentation.
Here were my initial steps to approach this problem:
Cons... |
Why it is less common to use wiki/markup in enterprise as documentation?
They use Word document instead.
Wiki/markup are in text format, which is version control friendly.
|
I am new to DDD, having worked only in Transaction-Script apps with an anemic model, or just Big Balls of Mud, so please forgive any terminology I abuse.
I am trying to understand the proper separation between the domain model and the repository. What is the proper way to construct a domain object that is coming from a... |
I need to develop an app for booking appointments. This is going to be hosted in a shared server. So performance is the most important thing. I have used symfony2. I quite liked the framework. But seems to be heavy.
Which framework would suit me considering my requirements? I have shortlisted three frameworks yii, symf... |
I often encounter the following statements / arguments:
Pure functional programming languages do not allow side effects (and are therefore of little use in practice because any useful program does have side effects, e.g. when it interacts with the external world).
Pure functional programming languages do not allow to ... |
Today, I got into an argument about the term "procedural generation".
My point was that its different from "classic" random generation in that procedural generation is based on a more mathematical, fractal-based, algorithm leading to a more "realistic" distribution and the usual randomness of most languages are based o... |
I've writing a date-time library, and need to implement the addition of a duration to a date-time.
If I add a 1 month duration: P1M to the 31st March 2012: 2012-03-31, does the standard define what the result is?
Because the resulting date (31st April) does not exist, there are at least two options:
Fall back to the l... |
Edit: Comments suggested, that DSM just faded out by being not used recently. What were the reasons for this, what are DSMs drawbacks? Literature lists many positive aspects like
easy to port programms to, no marshalling and therefore faster and so on but also negative aspects like only usable in homogenous environment... |
Possible Duplicate:
Writing Web “server less” applications
So, let's say I'm going to build a Stack Exchange clone and I decide to use something like CouchDB as my backend store. If I use their built-in authentication and database-level authorization, is there any reason not to allow the client-side Javascript to wr... |
I'm modeling a chemical system, and I'm having problems with naming my elements / items within an enum.
I'm not sure if I should use:
the atomic formula
the chemical name
an abbreviated chemical name.
For example, sulfuric acid is H2SO4 and hydrochloric acid is HCl.
With those two, I would probably just use the atomi... |
For PHP, best practices, I have read somewhere that if you assign your data to a variable it takes almost no memory or resource.
So let's say I have this function that return a count.
public function returnCount($array){
return count($array);
}
or if this is better?
public function returnCount($array){
$count ... |
A project I am working on has a bunch of legacy tests that were not properly mocked out. Because of this the only dependency it has is EasyMock, which doesn't support statics, constructors with arguments, etc. The tests instead rely on database connections and such to "run" the tests. Adding powermock to handle these c... |
I am an experienced Java programmer, and I want to create a complex web application requiring dynamic pages, drawings, etc (take SO as an example). Do I have to learn javascript/html in order to create such an application?
It is not that I don't want to learn another language (I've done this before), but technology on ... |
Problem statement:
Given:
TFS as Source Control
Heavy desktop client application with tons of legacy code with bad or
almost absent architecture design.
Clients constantly requiring new features with sound quality, fast
delivery and constantly complaining on user unfriendly UI.
Problem:
Application undoubtedly requi... |
I discovered some time ago that the GOTO control keyword was introduced in PHP 5.3.0.
http://php.net/manual/en/control-structures.goto.php
Why did it happen?
What are the language design goals behind this?
Did the PHP developers community asked for it?
|
I am developing a rather eye-candy application which is to be released on Mac App Store.
Due to its graphics intensive use, it would save a great deal of time on UI end if the app could be released with a fixed size main frame-dialog.
I did try doing a search regarding App Store policies on the matter but could not fin... |
Let's say I have ThingImpl and IThing. The former is an implementation of the latter, which is an interface.
IThing has 1 method: do(arg1)
Is it considered a hack/bad practice to add a method in addition to do()?
Example: do(arg1, arg2)
|
I would like to know, is it considered a common practice to use constructions like |=, &&, ||, != altogether in the single line of code?
E.g.
hasErrors |= vi2!=null && vi2.hasErrors() || vi.hasErrors();
What can be done to make the code more readable?
The programming language is Java, if it matters.
|
I do not fully understand what am I asking (lol!), well, in the sense of if it is even possible, that is. If it isn't, sorry.
Suppose I have a Java program. It has a Main and a JavaCalculator class. JavaCalculator has some basic functions like
public int sum(int a,int b) {
return a + b
}
Now suppose I have a ruby f... |
I am new to web crawling and I am testing my crawlers. I have been doings tests on various sites for testing. I forgot about robots.txt file during my tests.
I just want to know what will happen if I don't follow the robots.txt file and what is the safe way of doing the crawling?
|
Both Android and iOS seem to support their application having a binary delta update. But how does it work? I build a binary program, neither of the distribution sites have the source code - how does the update process know what is changed?
|
TL/DR: Any way to work out if known numbers between a known start and ending figure should be positive or negative numbers?
I am developing an application in PHP which can import and read PDFs. The PDFs are financial ones such as bank statements with records of transactions in and out of a bank account. I only have PDF... |
Is else while without intervening braces considered "safe" maintenance wise?
Writing if-else code without braces like below...
if (blah)
foo();
else
bar();
...carries a risk because the lack of braces make it very easy to change the meaning of the code inadvertently.
However, is below also risky?
if (blah)
{
... |
I've been looking into the details behind these two different categories:
Web runtime environments
Web application programming languages
I believe I have the correct information and have phrased it correctly but I am unsure. I have been searching for a while but only find snippets of information or what I can see as ... |
In this SO Question there is a comment by starblue that
A computer without loops is a calculator
Is this true?
Is that the only difference?
Is there a set of criteria to differentiate or has the line become very blurred?
|
I am not sure weather it is a proper question to ask out here but it is really bothering for a while. As the official website writes:
The Rails Rumble is a distributed programming competition where teams
of one to four people, from all over the world, have 48 hours to build
an innovative web application, with Ruby... |
I am developing an app in ddd maner. So I have a complex domain model. Suppose I have a Fare object and Airline. Each Airline should contain several or much more Fares.
My UI should represent Model (only small part of complex model) as a list of Airline, when the user select the Airline, I must show the list of Fares.... |
Assume I have a public source code repository. Am I violating copyright laws if there's any old commit where I have not yet added all copyright info for other people's open source code?
Details: Consider this theoretical scenario:
I copy-paste someone else's open source code files into a repository.
I commit.
I prefix... |
How do people define the minimum hardware requirements for software? For example: how can a software development company tell the customer that they will need 8 GB of RAM to run the program properly?
|
Background:
There are around 60 students at the boarding school I work for. The counselor asked my colleague and me to come up with a better way to come up with seating arrangements for dinner than by hand. He would like assignments for the rest of the school year. He also asked us to try to solve some of the issues he... |
I've recently started with a new firm and I'm trying to understand the mechanics behind something, so I'll anonymize the code and present but a sample:
[Test(Description = "Retreives the New view for XXXX.")]
public void New()
{
"~/XXXX/New".ShouldMapTo<XXXXController>(x => x.New());
"~/XXXX/New".WithMethod(HttpVer... |
Possible Duplicate:
I’ve inherited 200K lines of spaghetti code — what now?
I'm dealing with legacy code. It contains some BIG classes (line count 8000+) and some BIG methods (line count 3000+). For one of these methods I wrote a unit test that covers at least some code. This function has no specific structure, it i... |
I have to extend/fix a large online form written by other developer. There is a lot of code, mixing PHP and JS. It's kind of write-only style of coding and I want to redo it completely, but currently I can't.
It works like this:
It is a wizard-style form with 12 steps - let's call them phases to not confuse with steps... |
I have a class that I'm testing. The class has a function: apply(List<IRule> rules, List<ITarget> targets);
In one test I want to ensure that each target has been passed to one rule, a la:
rule1.AssertWasCalled(fnord => fnord.Test(target1));
rule1.AssertWasCalled(fnord => fnord.Test(target2));
rule1.AssertWasCalled(fno... |
I'm working on re-factoring certain aspects of an existing web service. The way the service APIs are implemented is by having a kind of "processing pipeline", where there are tasks that are performed in sequence. Unsurprisingly, later tasks may need information computed by earlier tasks, and currently the way this is d... |
I saw a conference by Herb Sutter where he encourages every C++ programmer to use auto.
I had to read C# code some time ago where var was extensively used and the code was very hard to understand—every time var was used I had to check the return type of the right side. Sometimes more than once, because I forgot the ty... |
I've recently read the article The Problem with logging and was wondering about my current logging strategy.
Usualy I use Log4J in my projects and just have to decide which line/attributes I would like to log.
This strategy worked well for me in the past for all my projects without user-interaction.
Now I want to set u... |
Can I license a program under Apache License 2.0, if it is using/including EclipseLink?
(EclipseLink under Eclipse Public License or Eclipse Distribution License)
I did not change anything in EclipseLink.
I would realy like to distribute a Version that includes the needed EclipseLink jars, so that it is working "out of... |
How would you implement / design a class which has to represent a bitmap?
I'm stuck at handling the different possible color modes and I keep thinking that this should be somehow implementable using templates / design patterns in an elegant AND efficient way:
Suppose you have a file.bmp. You then want to open that file... |
I came across this article proposing a style of coding in c++ that looks a bit weird at first. But after reading it over and pondering for a bit I'm really considering giving it a try.
The most appealing benefit is the ease of refactoring methods. I find myself constantly changing method names, parameters and so on whi... |
Quercus is an implementation of PHP written in Java, and released under the GPL.
If I use it, does my PHP code fall under the GPL?
What about my Java code?
Assuming I write new Java code, and new PHP code, and use Quercus to run my PHP code on the JVM and call into my Java code, which pieces fall under the GPL?
Also, a... |
Assume you are using APIs from a vendor, how to make sure their API is working as expected?
My main concern is sometimes the vendor pushed the changes to their code and break the API, we want to have some sort of automatic software to test them continually. How to deal with this?
|
Most security threats that I've heard of have arisen due to a bug in the software (e.g. all input is not properly sanity checked, stack overflows, etc.). So if we exclude all social hacking, are all security threats due to bugs? In other words, if there were no bugs, would there be no security threats (again, excluding... |
When subdividing intervals for arithmetic coding, the worst case scenario is that the final interval will have size 2^(1-n), where n is the number of unique symbols you are encoding. This will reach the limits of machine precision, when using regular datatypes, really quickly: For instance, I've made a JavaScript imple... |
Background
I have a requirement where I need to remove a few nodes in a network based upon a command given by the user. To keep the nodes from transmitting or receiving data I thought of changing its IP address to some other address. Before I change the address I want to save the node's IP so that I can re-assign the... |
Our Architecture team is proposing a framework that would see our SQL queries moved from coded strings within our applications, into a file based system where we would invoke them with function calls. Our application makes heavy use of SQL queries ranging from the mundane, to very complex. This is a .NET solution.
The ... |
I am taking a C++ class in my school. Since I've programmed in Ruby I know some OOP stuff.
But in C++ there are member functions, member variables, and static functions. In Ruby we have instance methods, instance variables, and class variables. And there are more...
Any reason they're different? Are they quite differen... |
If we have double numbers, let's say I want to see if some double parameter is equal to zero that is passed as double:
public bool AlmostEqual(double x, double y)
{
double epsilon = Math.Max(Math.Abs(x), Math.Abs(y)) * 1E-15;
return Math.Abs(x - y) <= epsilon;
}
considering double shows 15 accurate digits.
So ... |
We use Drupal 7 as our base CMS tool.
For one specific product, something like an ERP, we've created sort of a non-drupal layer, to keep our specific business code in.
It would be something like this:
-------------
| Business | -> This would be our business specific code layer
-------------
| Glue | -> This is wh... |
I had originally posed this on StackOverflow. The question was closed and I was asked to post this here instead. Here is the original question I had posted there:
I have been programming using procedural method for a while now. I have done some good amount of reading pertaining to OOP and I know how to use it. It's ju... |
I asked this question over at stackoverflow and it was suggested a tighter form be posted here.
Many early career numerical researchers face the prospect of having to create performance critical software from the ground up. Most are ill equipped to do so, and my lab is no different. I currently work extending a sophist... |
This is related to my recent question regarding naming awkward domain objects. A number of answers indicated I was using the wrong representation for the domain objects. To summarize, I chose to use an enum to represent some domain objects used as keys in lookups.
For this question, I want to review my decision to ... |
I'm helping to reogranize several redmine projects; although I have a lot of experience with issue tracking systems, I've never worked with redmine before.
What is the best way to organize Issues in Redmine so that they can be easily grouped by:
feature (e.g. "Upload a file", "Login to site", "Send message")
system co... |
My aim is to, via pattern analysis and statistics, (as well as piece mobility and position) build a chess position evaluation analyzer (rather than simply going brute force ply-searching).
Id like to hear some thoughts a language that will be interesting/fun/challenging to learn and reason with. Ideally the language w... |
I'm coding a server/client application pair in Java, as I learn about it. I have basic functionality of sending a message to the server and parsing it but in thinking about the big picture of their communication, I'm stumped about where to go from here.
Both the client and the server have to be able to initiate an exc... |
I've noticed that a lot of companies use "reverse domain name" namespaces and I'm curious where that practice originated and why it continues. Does it merely continue because of rote practice, or is there an outstanding architecture concept I might be missing here?
Also note questions such as: https://stackoverflow.com... |
With a YYYY-MM-DD HH:MM:SS date I always store the UTC time. When I pull to display I translate timezones with built-in PHP functions and classes.
I believe that is one correct way to do it and it makes sense to me.
May I handle YYYY-MM-DD the same way?
|
I'm pretty sure that someone has already thought about it and researched it extensively, but I'm having trouble finding any materials or even keywords to look for, for the idea that I was thinking about recently.
I thought about this concept, where in distributed systems, actual computation and processing would happen ... |
In SICP 2nd Edition section 2.2.3,
the authors have the following code:
(define (even-fibs n)
(accumulate cons
nil
(filter even?
(map fib
(enumerate-interval 0 n)))))
My question is why did they use accumulate in this case? Couldn't they ha... |
I need to write a cross-platform GUI application to process (in multiple threads) and visualize fairly large quantities of data. Ideally the application should be relatively fast and look good.
The app's interface will consist of a table widget, a tree widget, and a custom figure-drawing widget. The user will be able t... |
It seems like FILEHANDLER is more commonly used as a handler naming convention than $filehandler.
But it can give a bareword error if one forgets to use *FILEHANDLER in some constructions.
What are advantages and disadvantages of HANDLERS and $handlers?
Which naming convention is a better practise, and why?
|
I am implementing an application in Haskell and, for sorting, I use the library function Data.List.sort. However, I was wondering whether this is the fastest sort implementation in the Haskell standard library (perhaps lists are not the best choice for efficient sorting).
I have found different alternatives, e.g. heap ... |
This might sound like a naive question but when are database table indexes in mysql required? How do such indexes affect performance and why?
|
I'm trying to learn recursion. I copied this bit of code from my book and added the displays to help me trace what the method is doing and when.
public static void main(String[] args) {
System.out.println(sum(4));
}//main
public static int sum(int n) {
int sum;
System.out.println("n = " + n + "\n")... |
I have an array of dimension 5. But, I can't figure out how to visualize that array?
int[][][][][] array = new int[4][4][4][6][2].
Is there a good way to visualize arrays with dimension counts of 3 or more?
|
I am starting a software project that I want to have the option to keep it proprietary. However, since I generally use a Linux environment, I want to know: How do people write proprietary software in Linux and not violate the GPL/LGPL/etc licenses that seem to restrict uses of libraries needed to build the project?
Al... |
I have a conceptual problem with a proper implementation of code which seems require multiple inheritance, that would not be a problem in many OO languages, but as the project is for Android, there is no such thing like multiple extends.
I have a bunch of activities, derived from different base classes, such as simple... |
I am not talking about simple UI logic like clicking a button directs you to another page, but where one action may result in several different of behavior depending on current application state, and may also trigger response in other parts of the application. Currently my view publishes all UI event so the response ca... |
When manually inspecting unfamiliar code (to review or modify), I seem to have three options.
A top-down read of the code, choosing each next source file by how fundamental the filename seems. I usually end up reading nearly everything. Some files twice.
A breadth-first read, where I find and read all of the invokin... |
I've been tasked with creating a dashboard application to show real time updates for our servers. The raw data comes in from an XML file on our intranet which I need to parse and present to the user.
It is not an option to have every user of the dashboard pull this XML file at the same time for their updates. From what... |
I ran into the following issue where a keyboard shortcut I was used to was no longer working in Ubuntu. That's just an example. For programming, this kinds of thing happens a lot, but it also happens in any aspect of work and life.
I'm always tempted to fix it right away because I have an idea of what might fix it in a... |
I have trouble drawing a clear line between Presentation and Application layer in Domain Driven Design.
Where should Controllers, Views, Layouts, Javascript and CSS files go?
Is it in the Application or the Presentation layer?
And if they go all together in the same layer, what contains the other one? Is it empty?
|
Look at this:
<?php
echo "Hello World";
?>
<br />
<?php
echo "Welcome";
?>
And now look at this:
<?php
echo "Hello World";
echo "<br />";
echo "Welcome";
?>
Which one of the above examples is considered to better (at least from performance point of view)?.
I know the examples are trivial but I want to follow good pr... |
A rather simple question here, With regards to web design and the paperwork behind it (Which I am sure many people/companies don't actually do).
Would there be any reason for using a Cumulative Chart?
Specifically a Cumulative Resource chart, although I am unsure what the resources could even be!
More to the point, ... |
Design Question
Recently, I've been doing more and more FP in C++, mostly in the form of function templates and lambdas, and heavy overloading of a single function name. I really like FP for some well-defined operations, but I've also noticed that as with OOP, one could easily fall into anti-patterns of spaghetti-code... |
Problem Statement -
Given a 2xN grid of numbers, the task is to find the most profitable tiling combination (each tile covers 2x1 cells; vertically or horizontally) covering all tiles.
I thought of approaching it in the greedy way, enqueuing the max possible for any cell, but it has a fallback that a low-profit choice... |
I just read Beating the Averages, and Mr. Graham writes that they had a significant advantage over competitors because they used Lisp.
From what I understand, Viaweb was a WYSIWYG editor that ran in the browser for customers to create their own 'stores'. This is obviously inconceivable now to do without JavaScript, yet... |
Problem Statement -
The task is to find the most profitable contiguous segment of tests, given a sequence of test scores, with being allowed to drop any k tests from a chosen range.
The problem appears to be a DP problem at the outset, but complexity arises when the test drop condition comes into the picture.
What mo... |
This is a web application based on actionscript 3.
I have all of my modules enumerated in a class, but I never know which modules actually come from database.
Let's say I have 20 modules in my application, but the user only has access to 10 of them. All I get are 10 strings from database (the module names) whenever the... |
From a given tree, subsequent trees have to be generated. Nodes can be marked as "variant" in the given tree (the example uses an asterisk to mark the node). All possible combinations between the variants form the resulting trees.
From the following tree:
- Product
- Packaging *
- Small box
- Heavy ... |
Any idea why the C# version of sqrt (System.Math.Sqrt) is ~10 times slower than c++ version ? Furthermore, C# version seems to have one extra digit of precision. I have run my test under MSVC2012.
I have used double and call System.Math.Sqrt once before doing the bench in order to force Jit
|
In functional programming since almost all data structure are immutable, when the state has to change a new structure is created. Does this mean a lot more memory usage? I know the object oriented programming paradigm well, now I'm trying to learn about the functional programming paradigm. The concept of everything bei... |
I'm a beginner-level C++ programmer, but I understand the concepts of the language fairly well. When I began to learn external C++ libraries, like SDL, OpenGL (maybe something else too), to my great surprise I found out that they don't use C++ concepts at all.
For example, neither SDL, nor OpenGL use classes or except... |
I have some legacy code, which uses Lisp as it's scripting language. To broaden, ease and accelerate scripting I'd like to replace Lisp by Javascript.
In order to be able to built on all present scripting files, I first need to translate all lsp to js.
Now I found parenscript but am not yet sure what it is good for (se... |
In the context of the Ruby programming language, what is a closure and when do you use one? What are the uses for it in Rails?
|
Lets say that I have hundreds/thousands of objects(entries) in a database and each object contains 10 attributes. I have a way to quantitatively measure each attribute where a higher number implies that the object is better in that area. I also have a final price associated with that object. Is there any way to program... |
Javascript is a prototype-based object oriented language but can become class-based in a variety of ways, either by:
Writing the functions to be used as classes by yourself
Use a nifty class system in a framework (such as mootools Class.Class)
Generate it from Coffeescript
In the beginning I tended do write class bas... |
Wikipedia says that Agile is a type of "RAD" which I guess is incorrect. From what I know, Agile was developed becasue RAD itself was not that sucessfull in 90'S (too rigid for changes).
Or am I wrong?
(Remark: apparently the Wikipedia article on Agile software development was improved in between, it just lists RAD as ... |
I am creating a free nokia application for which I am about to use images from a creative common website. Now my question is if a free application come under creative commons as it is not a paid one?
Thanks in advance.
|
Imagine a small calculator GUI, with basic operations (+,-,/,*), and in the menu we can check for example scientific calculator and a small new view with the extra functions appears beside.
I was thinking that the decorator pattern is the solution but after reading some documentation on it, I am confused now. Which pat... |
Problem Statement -
The task is to find the minimum number of swaps required in the given arrangement of cartons to get the desired arrangement of cartons. Only adjacent cartons can be swapped.
I have tried an ad hoc approach, but it proved inefficient towards the upper limit of the data range. Here it is for referen... |
I do not have the access to the IEEE standard and information on the net are contradictory. Can I capture user requirements in SRS using use cases? Or I should keep use cases separate as they are more like scenarios than separate requirements?
|
I'm developing a software documentation in a project, and much of it are just CRUD or CRUD based functions. As you can imagine, a lot of the rules are constraints about fields validation, things like length, range, data type and masks of the field.
Writing all those rules would be cumbersome to write and to read, so I... |
We have developed a job-portal where users can view jobs and and also post jobs. We have used Php and MySQL. We hosted this on web faction. Now we want to develop the mobile app of the job portal for android, ios and windows. As the database should be synchronous and aligned dynamically with apps and website database. ... |
I find it that when languages are considered the same as commercial software, there is always a constant need to add new features to justify new releases.
Can there be or are there languages where version 1.0 is the final version? Of course bug fixes are exempt from this, but the feature set always remains the same?
Th... |
The definition of a Y combinator in F# is
let rec y f x = f (y f) x
f expects to have as a first argument some continuation for the recursive subproblems.
Using the y f as a continuation, we see that f will be applied to successive calls as we can develop
let y f x = f (y f) x = f (f (y f)) x = f (f (f (y f))) x etc.... |
Recently, I've been trying to implement some working version of the Glicko Rating System for fun.
However, I fail to understand how to programmatically isolate R in Step 2. As you can see R appears on both sides of the equation and for a variable number of instances. How would I programatically solve for R using pytho... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.