theory

Using IS NULL or IS NOT NULL on join conditions - Theory question

狂风中的少年 提交于 2019-11-27 00:11:17
问题 Theory question here: Why does specifying table.field IS NULL or table.field IS NOT NULL not work on a join condition (left or right join for instance) but only in the where condition? Non working Example: -this should return all shipments with any returns (non null values) filtered out. However, this returns all shipments regardless if anything meets the [r.id is null] statement. SELECT * FROM shipments s LEFT OUTER JOIN returns r ON s.id = r.id AND r.id is null WHERE s.day >= CURDATE() -

Does Presenter in Model-View-Presenter create views?

China☆狼群 提交于 2019-11-27 00:10:06
问题 How are Views created in MVP? Does the Presenter always create them (in addition to View in case of subviews)? Or is it a separate third-party component or App or something that creates them? Let's also add that I'm probably going to do this on Dojo Toolkit/ExtJS (JavaScript that is). So, I have these code lines: var v = new MyApp.view.User(); var p = new MyApp.presenter.User(); where should both lines go exactly? Does the presenter instantiate the view, or vice-versa? And what instantiates

How do you set strings to uppercase / lowercase in Unicode?

柔情痞子 提交于 2019-11-26 23:08:08
问题 This is mostly a theoretical question I'm just very curious about. (I'm not trying to do this by coding it myself or anything, I'm not reinventing wheels.) My question is how the uppercase/lowercase table of equivalence works for Unicode. For example, if I had to do this in ASCII, I'd take a character, and if it falls withing the [a-z] range, I'd sum the difference between A and a. If it doesn't fall on that range, I'd have a small equivalence table for the 10 or so accented characters plus ñ

Legitimate uses of Object(o)

∥☆過路亽.° 提交于 2019-11-26 21:56:18
问题 When an object value is provided to the Object constructor, that value will be returned unchanged. So, given an object obj : obj === new Object( obj ) and obj === Object( obj ) Then, what's the point of doing Object( obj ) in the first place? I can understand doing Object( 'foo' ) , or Object( 123 ) - it creates a wrapper object for the primitive value, but if we already have an object obj , why would we do Object( obj ) ? Is this pattern useless? 回答1: The comparison will check whether obj is

Is the C99 preprocessor Turing complete?

有些话、适合烂在心里 提交于 2019-11-26 21:35:23
After discovering the Boost preprocessor's capabilities I found myself wondering: Is the C99 preprocessor Turing complete? If not, what does it lack to not qualify? Here is an example of abusing the preprocessor to implement a Turing machine. Note that an external build script is needed to feed the preprocessor's output back into its input, so the preprocessor in and of itself isn't Turing complete. Still, it's an interesting project. From the description of the afore-linked project: the preprocessor is not Turing complete, at least not if the program is preprocessed only once. This is true

Efficiently finding the intersection of a variable number of sets of strings

不羁的心 提交于 2019-11-26 20:46:15
I have a variable number of ArrayList's that I need to find the intersection of. A realistic cap on the number of sets of strings is probably around 35 but could be more. I don't want any code, just ideas on what could be efficient. I have an implementation that I'm about to start coding but want to hear some other ideas. Currently, just thinking about my solution, it looks like I should have an asymptotic run-time of Θ(n 2 ). Thanks for any help! tshred Edit: To clarify, I really just want to know is there a faster way to do it. Faster than Θ(n 2 ). Set.retainAll() is how you find the

“const correctness” in C#

大兔子大兔子 提交于 2019-11-26 19:48:16
The point of const-correctness is to be able to provide a view of an instance that can't be altered or deleted by the user. The compiler supports this by pointing out when you break constness from within a const function, or try to use a non-const function of a const object. So without copying the const approach, is there a methodology I can use in C# that has the same ends? I'm aware of immutability, but that doesn't really carry over to container objects to name but one example. Trap I've come across this issue a lot of times too and ended up using interfaces. I think it's important to drop

What good are SQL Server schemas?

拥有回忆 提交于 2019-11-26 19:27:54
I'm no beginner to using SQL databases, and in particular SQL Server. However, I've been primarily a SQL 2000 guy and I've always been confused by schemas in 2005+. Yes, I know the basic definition of a schema, but what are they really used for in a typical SQL Server deployment? I've always just used the default schema. Why would I want to create specialized schemas? Why would I assign any of the built-in schemas? EDIT: To clarify, I guess I'm looking for the benefits of schemas. If you're only going to use it as a security scheme, it seems like database roles already filled that.. er.. um..

What is referential transparency?

给你一囗甜甜゛ 提交于 2019-11-26 19:10:50
What does the term referential transparency mean? I've heard it described as "it means you can replace equals with equals" but this seems like an inadequate explanation. Uday Reddy The term "referential transparency" comes from analytical philosophy , the branch of philosophy that analyzes natural language constructs, statements and arguments based on the methods of logic and mathematics. In other words, it is the closest subject outside computer science to what we call programming language semantics . The philosopher Willard Quine was responsible for initiating the concept of referential

Learning garbage collection theory [closed]

半世苍凉 提交于 2019-11-26 18:49:15
问题 I want to learn the theory behind garbage collection. How do i go about it? The obvious answer is - a compiler textbook... The question is, is it necessary to learn lexical analysis, parsing and other stuff that usually precedes garbage collection in a text? In short, what are the prerequisites to learning about Garbage collection theory? P.S - I do know what is the purpose of parsing, lexical analysis etc. Just not how they are implemented. 回答1: Read these papers in order. They are in