theory

What is fuzzy logic?

I'm working with a couple of AI algorithms at school and I find people use the words Fuzzy Logic to explain any situation that they can solve with a couple of cases. When I go back to the books I just read about how instead of a state going from On to Off it's a diagonal line and something can be in both states but in different "levels"....

How does merging a branch actually work (under the hood)?

Hi, this may be a naive question, but, as asked in the object, what is the actual way used by versioning softwares to merge a branch back into the main trunk without generating broken code? Here's a quick example: I make a branch out of the main trunk for the program "Hello World Power edition". I add support for Klingon. This is a radi...

How to program a fractal?

I'm do not have any experience with programming fractals. Offcours i've seen the famous Mandelbrot images and such. Can you provide me with simple algorithms for fractals. The language doesn't matter really, but I'm most familiar with actionscript, c#, java. I know that if i google fractals, i get a lot of (complicated) information. ...

The "Waiting lists problem"

A number of students want to get into sections for a class, some are already signed up for one section but want to change section, so they all get on the wait lists. A student can get into a new section only if someone drops from that section. No students are willing to drop a section they are already in unless that can be sure to get...

Where do I start learning about image processing and object recognition?

Hey everyone, I'm interested in writing some basic computerized object recognition application, so I figure I need some theoretical background in image processing algorithms, along with some AI for decision making capabilities. I'm a computer science graduate, and one day I plan to get my Master's degree, hopefully in one of these fiel...

Are there canonical-forms for database queries?

Say I want to make an "Optimized query generator". Basically a SQL query optimizer that is a lot better than what can be put in an SQL server based on time/space limitations. It would take a query and DB stats as input and generate an SQL query tailored for the target system that will quickly optimize to a nearly ideal plan. How much of...

Chomsky Hierarchy and LL(*) parsers

Hey out there, I want to parse a programming language. I read a lot about formal languages and the Chomsky hierarchy and ANTLR. But I could not find information on how to relate the languages ANTLR v3 as an LL(*) recursive descent parser accepts to the chomsky hierarchy. How do the Chomsky types mix with LL(*)? Any information (online,...

Network theory and MVC

I've designed an MVC that doesn't allow communication between Views (forms). If a form needs to communicate with another form, it raise an event on the controller, which other forms can subscribe to. The general idea is to keep paths of communication to a minimum, helping keep complexity down. Each View communicates with the RootContr...

Do theoretical computer science topics, such as regular vs non-regular languages, the pumping lemma, and grammars have "real world" development applications?

I'm familiar with the real world applications of finite automata and regular expressions, but topics such as these other ones are giving me more problems as I'm not seeing any real world applications. ...

In Laymen's terms, what is the pumping lemma

So I saw this question and was curious as to what the Pumping Lemma was (Wikipedia wasn't much help). I understand that its basically a theoretical proof that must be true in order for a language to be in a certain class, but beyond that I don't really get it. Anyone care to try to explain it at a fairly granular level in a way underst...

Should I avoid Alternative Control Syntax?

As a mostly self-taught programmer, I have never really had anyone explain why certain things should or should not be used. One example (which I picked up years ago and use quite often) is the alternative control structure syntax: x = (y == true) ? "foo" : "bar"; I personally find this syntax easy to follow, especially for short, conc...

Can the halting problem be solved for any non-turing languages?

The halting problem cannot be solved for turing complete languages and it can be solved trivially for some non TC languages like regexes where it always halts. I was wondering if there are any languages where it has both the ability to halt and not halt and there is also an algorithm that can determine whether it halts. ...

What is the minimum number of transistors required to build a CPU?

From a purely theoretical level, how few transistors do you need to build a working CPU? ...

How to determine whether a grammar is LL(1) LR(0) SLR(1)

Is there a simple way to determine wether a grammar is LL1, LR0, SLR1... just from looking on the grammar without doing any complex analysis? For instance: To decide wether a BNF Grammar is LL1 you have to calculate First and Follow sets first - which can be very time consuming in some cases. Has anybody got an idea how to do this fast...

Why can't programs be proven?

Why can't a computer program be proven just as a mathematical statement can? A mathematical proof is built up on other proofs, which are built up from yet more proofs and on down to axioms - those truths truths we hold as self evident. Computer programs don't seem to have such a structure. If you write a computer program, how is it th...

Requirements for Compiler Design

The student adviser we were working with is suddenly on leave. The plan was to design a compiler for a program which is similar to C (the basic structure of C still exists but keywords have been changed for example : for(i=0;i<10;i++) would now look like : loop i from 0 to 9 up 1 . And things such as #include have been omitted entirely...

Why do people use Velocity and/or NVelocity?

Over the past year I have heard alot about Velocity and NVelocity. Reading their documentation and doing searches on the net hasn't given me the answers I was looking for. In what situation would I use this library in my development? What problem does it solve that didn't already have a solution? ...

What would you include in a 10 min Grok talk on Unit Testing

Hi, I'm soon to do a 10min Grok talk on Unit Testing at my company. I've been trying it myself, and feel that it can certainly bring benefits to the company. We already do WebInject testing in our dedicated QA team, But I want to try and sell unit testing to the devs. So with only 10mins what would you cover and why? we're a Microsof...

Encapsulating common logic (domain driven design, best practices)

Updated: 09/02/2009 - Revised question, provided better examples, added bounty. Hi, I'm building a PHP application using the data mapper pattern between the database and the entities (domain objects). My question is: What is the best way to encapsulate a commonly performed task? For example, one common task is retrieving one or mor...

Why/how does this ambiguous UPDATE statement work?

Let's say you're running an UPDATE statement on a table, but the information you're putting into this base table is from some other auxiliary table. Normally, you would JOIN the data and not expect the rows in the UPDATE statement's FROM clause to multiply, maintaining that one new row maps to one old row in the base table. But I was wo...