theory

Dependency Injection Container

帅比萌擦擦* 提交于 2019-12-04 20:44:54
I have a Data Access Layer library that I would like to make "portable". The reason I like it to be portable is because I want to work with SQL Azure & Azure File Storage (eg, data + pdf reports) as well as Sql Server 2008R2 and File System storage on a concrete server. Based on spec the system is supposed to go live with the later implementation (sql + file system storage), while upon a meeting a certain scalability threshold we plan on moving to Azure. The data access class I use implements IDataProvider interface (which I built) and it defines the methods that any data access concrete

Kolmogorov Complexity Approximation Algorithm

為{幸葍}努か 提交于 2019-12-04 17:54:58
问题 I'm looking for a algorithm that can compute an approximation of the Kolmogorov complexity of given input string. So if K is the Kolmogorov complexity of a string S, and t represents time, then the function would behave something like this.. limit(t->inf)[K_approx(t,S)] = K. 回答1: In theory, a program could converge on the Kolmogorov complexity of its input string as the running time approaches infinity. It could work by running every possible program in parallel that is the length of the

Recursive Sets vs Recursive Functions

北慕城南 提交于 2019-12-04 17:16:05
What s the difference between a recursive set and recursive function? Josef Grahn Recursive functions and recursive sets are terms used in computability theory. Wikipedia defines them as follows: A set of natural numbers is said to be a computable set (also called a decidable, recursive, or Turing computable set) if there is a Turing machine that, given a number n, halts with output 1 if n is in the set and halts with output 0 if n is not in the set. A function f from the natural numbers to themselves is a recursive or (Turing) computable function if there is a Turing machine that, on input n,

Why do we care about data types?

别等时光非礼了梦想. 提交于 2019-12-04 16:33:55
问题 Specifically, in relational database management systems, why do we need to know the data type of a column (more likely, the attribute of an object) at creation time? To me, data types feel like an optimization, because one data point can be implemented in any number of ways. Wouldn't it be better to assign semantic roles and constraints to a data point and then have the engine internally examine and optimize which data type best serves the user? I suspect this is where the heavy lifting is

Timer Efficiency

守給你的承諾、 提交于 2019-12-04 13:53:14
问题 I am planning to develop a system with tens of thousands of objects in it, which will each have up to 42(but more likely down around 4 or 5) separate actions they will potentially be performing at regular intervals. I also plan to write code that will deactivate the timers until the object comes into use. When idle, the objects will only need 1 timer each, but when active, the other timers will all start at once. At first the number of objects will be small, maybe a few hundred, but I expect

Are tag (or “marker”) interfaces obsolete?

只谈情不闲聊 提交于 2019-12-04 08:53:23
I'm trying to help a coworker come to terms with OO, and I'm finding that for some cases, it's hard to find solid real-world examples for the concept of a tag (or marker ) interface. (An interface that contains no methods; it is used as a tag or marker or label only). While it really shouldn't matter for the sakes of our discussions, we're using PHP as the platform behind the discussions (because it's a common language between us). I'm probably not the best person to teach OO since most of my background is highly theoretical and about 15 years old, but I'm what he's got. In any case, the

Could a truly random number be generated using pings to pseudo-randomly selected IP addresses?

故事扮演 提交于 2019-12-04 07:44:56
问题 The question posed came about during a 2nd Year Comp Science lecture while discussing the impossibility of generating numbers in a deterministic computational device. This was the only suggestion which didn't depend on non-commodity-class hardware. Subsequently nobody would put their reputation on the line to argue definitively for or against it. Anyone care to make a stand for or against. If so, how about a mention as to a possible implementation? 回答1: No. A malicious machine on your network

What are the main differences between the Knuth-Morris-Pratt and Boyer-Moore search algorithms?

纵饮孤独 提交于 2019-12-04 07:27:18
问题 What are the main differences between the Knuth-Morris-Pratt search algorithm and the Boyer-Moore search algorithm? I know KMP searches for Y in X, trying to define a pattern in Y, and saves the pattern in a vector. I also know that BM works better for small words, like DNA (ACTG). What are the main differences in how they work? Which one is faster? Which one is less computer-greedy? In which cases? 回答1: Moore's UTexas webpage walks through both algorithms in a step-by-step fashion (he also

Difference between two ranges

假装没事ソ 提交于 2019-12-04 05:52:45
I can find plenty of questions and example regarding the 'Union' and 'Intersect' VBA methods but I can't find anything much regarding a 'Set Difference' method? Does this exist (other than by using combinations of union and intersect)?. I'm trying to find a simple way of getting all of range1 excluding any of range1 that overlaps range2 without knowing the size or shape of either range. Any help would be greatly appreciated. EDIT. Attempted solution where rng1 is the red section and rng2 is the blue section (have debugged to check these are correct): rng = SetDifference(rng, highlightedColumns

Names of HTML form naming conventions

梦想与她 提交于 2019-12-04 04:16:58
In Rails and CakePHP1.2, forms tend to include input elements with names like the following: <input name="comment[author]" /> Is there a formal name for the notation used in the "name" attribute? Likewise, in CakePHP1.1 I do believe that the same would have looked like this: <input name="comment/author" /> Again, is there a formal name for the notation used in the "name" attribute? in cake php, the naming scheme is in multidimensional array access format, though i'm not really sure what you'd call that. multidimensional array keying? official php docs call it "square bracket notation"