theory

Why is <br> a tag rather than an HTML entity?

Why indeed? Wouldn't be something like &br; more appropriate? ...

Is it irresponsible to generate new Guids "willy nilly", and if so, or not, why?

in c#, at least, generating a new guid is a one line one call process. A guid is easy to use and format, and it "guarantees" uniqueness. However, is it irresponsible to just go off and generate new guids for every little thing. Could we be significantly increasing the chances of a "ta tan tan" guid collision?! thoughts...? ...

Is there terminology for flat dictionary, tree dictionary, etc. compression schemes?

I'm trying to learn more about compression. Suppose we have the following string: double, double toil and trouble; fire burn, and caldron bubble. The notation I use below is similar to that used for formal grammars. Capital letters are nonterminals, lowercase letters are terminals, and S is the start symbol. Example of encoding wi...

Kolmogorov Complexity Approximation Algorithim

Hi, I'm looking for a algorithim 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. ...

Is MS Access a Relational Database?

The database which follows 12Rules of codd is a perfect relational database, I have read some where that No Database is Pure RDBMS... SQL Server is RDBMS.. however MS Access is not RDBMS, I am confused.. why so as we can created relations. links. in Access as well.. then what are the main criteria that defined a Database DBMS or RDBMS ?...

Selecting the same item with jQuery multiple times vs using a variable.

Which of the following would theoretically be better with performance and / or memory? In other words, does jQuery have to do work to select the same item multiple times or does it know what items it has selected in the past? I've intentionally left animate with no arguments, this is a purely theoretical question. $("#someelement").ani...

What are the pros and cons of specifying a Controller class via URL vs. having a script for each Controller?

I have setup two different PHP systems this summer. Each uses two different methods: Method #1: One PHP File Per Task This method requires that a PHP file be created for each major task. For example, my upload script would be access via http://www.domain.com/upload.php. On upload.php, a "controller" and a "view" class are instantiated ...

Looking for a model to represent this problem, which I suspect may be NP-complete.

(I've changed the details of this question to avoid NDA issues. I'm aware that if taken literally, there are better ways to run this theoretical company.) There is a group of warehouses, each of which are capable of storing and distributing 200 different products, out of a possible 1000 total products that Company A manufactures. Each w...

Implementing security on the chip level

With Intel's recent purchase of a well known security company, I'm starting to think about what software w/could be more secure on a chip level. Examples I've come up with are: Random number generation Encryption Memory protection But is hardware level security any more secure than software based security? ( I would assume garbage i...

A developer's rules to live by

I was inspired by Gichin Funakoshi's Twenty Principles, and decided that we software developers ought to have some too, and I couldn't think of a better place to put this than Stack Overflow community wiki. It is not about hardware or software, it is about people Technologies and tools come and go, patterns and algorithms stay the same...

Database Theory: Transaction serializability

Hy, I'm learning for my exams and came over the following question: Take the History (or Schedule) H = w1[x] w2[x] w2[y] c2 w1[y] w3[x] w3[y] c3 w1[z] c1 where w1[x] means: Transaction 1 writes to Data-Object X (r1[x] means read) and c1 means: Transaction 1 commits. Why is this transaction view serializable? For view Serializabilit...

Best approach for running an "endless" process monitoring MySQL?

I have a process that has to be ran against certain things and it isn't suitable to be ran at the users end (15+ seconds to process) so I considered using a cron job but again, this is also unsuitable because it will create a back log. I have narrowed my options down to either running an endless process that monitors for mysql changes, o...

What's the relationship between Calculus and programming syntaxes?

I'm starting Calculus this semester and I've been using programming (or scripting) languages before—mostly PHP and C# (not much low-level work). The only relationships I've made between the syntaxes are Anonymous functions with Y-Combinators and Arrays with Set-notation (I'm not even sure if these are correct). I always see similaritie...

How a RegEx engine works

In learning Regular Expressions it had me wondering how the underlying engine works. Probably more specifically, I'd like to know more about how it evalutates, prioritizies and parses the expression. I feel the RegEx engine is a blackbox to me, and I would really enjoy deciphering it. So I'd like to ask if there are some great resourc...

Does an algorithm exist which can determine whether one regular language matches any input another regular language matches?

Let's say we have regular expressions: Hello W.*rld Hello World .* World .* W.* I would like to minimize the number of regexes required to match arbitrary input. To do that, I need to find if one regular expression matches any input matched by another expression. Is that possible? Billy3 ...

How high user-specified SQL LIMITs should I allow?

Hi, I have a software that LIMITs queries based on user input. I'm aware of SQL injections and DOS possibilities here so I'm not interested in hearing about those. What I wonder is that how high limit should I put for common requests like getting the latest X items? Currently I allow the client to specify the value, and I make sure the ...

sequence comparison with moved blocks detection

I need to compare 2 sequences and find an edit distance. Edits can include deletion and insertion operations (with modification weight 1 per symbol), and block move operations (with weight 0.1 per symbol) For example: A B C D E F G H F G H A B C Y D X E Block FGH was moved here. Is there any existing algorithm to solve this task efficien...

efficient way to find matches against two strings

I need to find all equal substrings against two strings. I've tried to use suffix tree to lookup substrings and it works fast, but too memory consuming (inappropriate for my task). Any other ideas? ...

Is there any object-oriented static typed language with variables with few types?

I like reading about programming theories, so could you tell me if there is any object-oriented static typed language that allow variables to have a few types? Example in pesudocode: var value: BigInteger | Double | Nil I think about way of calling methods on this object. If object value have type BigInteger | Double language could al...

How does Big O relate to N+1?

Big 0 attempts to answer the question of inefficiency in algorithmic complexity. N+1 describes inefficiency as it relates to database queries in terms of separate queries to populate each item in a collection. I'm currently trying to get my head around each of these concepts in different contexts at work, and I'm wondering now if somebo...