theory

I'd like to get back to the basics of CS. Any suggestions for tutorials or application-minded reference material?

I've been programming as a consultant for years, and I adore my work, which involves a lot of object-oriented analysis and design of software systems using managed languages (ie. software engineering). But I'd like to get a doctorate eventually, and it bothers me that I never really "got" Computer Science theory. In university I only did...

Examples of relations between philosophical concepts and development paradigms

During your development experiences have you found any relation between philosophical concepts and development paradigms? Although, there is no hard reciprocity, I think that learning about those relations gives clarity on methodologies/paradigms/process understanding. Or at least should be inspirational. I've found some examples: He...

Reusing MySQL results

Hi there, I'm having somewhat theoretical question: I'm designing my own CMS/app-framework (as many PHP programmers on various levels did before... and always will) to either make production-ready solution or develop various modules/plugins that I'll use later. Anyway, I'm thinking on gathering SQL connections from whole app and then ...

Static methods and instance methods in memory

How are those different Method types handled in memory. I found two different explanations to this: Static methods are only once in memory, whereas instance methods are in memory multiple times, one for each instance to handle the references to membervariables correctly in each instance. All methods are only once in memory and instanc...

Determining if a sphere intersects an object or not

Hello everyone, I have a closed object described by a surface representation of triangles (described by three vertices which forms a right hand rule with a normal pointing to the "outside" of the object). I place a sphere of some radius in 3D space somewhere close to the surface of the object. I want to determine if the sphere intersec...

Trees: Linked Lists vs Arrays (Efficiency)

This is an assignment question that I am having trouble wording an answer to. "Suppose a tree may have up to k children per node. Let v be the average number of children per node. For what value(s) of v is it more efficient (in terms of space used) to store the child nodes in a linked list versus storage in an array? Why?" I believe I ...

Java Defensive Copies

I've seen defensive copies coded like this void someMethod(Date d) { myDate = new Date( d.getTime() ); } But that doesn't make sense to me, isn't there a way in Java to create an Identical copy in memory of that object? I've read the clone() will not work in all instances, but I don't understand why ...

Theory: Sampling Theorem & Nyquist Frequency

i've got a problem with the sampling theorem Sampling theorem states that a signal can be reconstructed exactly from it's samples if the original signal has no frequencies above half the sampling frequency. But what about frequencies exactly half the sampling frequency?? let's say i sample a sine (with an arbitrary phase and amplitude)...

input type=submit not following box-model

Hello, I have more of theoretic question: do you know why in the world, input type=submit acts on different box-model even if I tell it do display:block? (just a note: nothing I couldn't go around... It just surprised me, that this time, every browser seems to work the same way padding and border included in total width second note: i...

The method used in 3rd-party garbage collector

I am writing to clarify some comments on this website. 1) I know that C++ has no garbage collector. One said that C++ was invented before the idea of garbage collector, so that's the reason. Is that true? I think it makes sense. 2) Whenever garbage collector was discussed, smart point(such as boost::share_ptr) was brought out to be a ...

Determine how fine-grained an interface should be?

The more detail I put in an interface, the less reusable it is. On the other hand the less detail the more ethereal and useless it seems to become. Is there a standard set of recommendations about how to weigh this for various situations? ...

Important topics in the theory of computation

During my studies at university I had to learn a lot about the theory of computation. I studied the subject for three terms. I had a hard time and I have to admit that I forgot a lot. I am wondering whether this is a personal problem, or if we just had to learn a lot of (more or less) useless stuff. So my question is: What topics in th...

Are there any concurrent algorithms that in use work correctly without any synchronization?

All of the concurrent programs I've seen or heard details of (admittedly a small set) at some point use hardware synchronization features, generally some form of compare-and-swap. The question is: any there any concurrent programs in the wild where the thread interact throughout there life get away without any synchronization? Example o...

Exhaustive testing and the cost of "Bug Free"

When I was learning software development, we were taught that actual "bug free" software was mathematically impossible for anything but the most trivial programs. For a mathematical mind, it's very simple to see how basic thingslike the number of possible inputs and the variability of platforms makes bug free not only impossible (in rea...

Why does NUnit ignore datapoints when using generics in a theory

I'm trying to make use of the TheoryAttribute, introduced in NUnit 2.5. Everything works fine as long as the arguments are of a defined type: [Datapoint] public double[,] Array2X2 = new double[,] { { 1, 0 }, { 0, 1 } }; [Theory] public void TestForArbitraryArray(double[,] array) { // ... } It does not work, when I use generics: [D...

crossing edges in the travelling salesman problem

Does there exist a travelling salesman problem where the optimal solution has edges that cross? The nodes are in an x-y plane, so crossing in this case means if you were to draw the graph, two line segments connecting four separate nodes would intersect. ...

How are hash functions like MD5 unique?

Im aware that MD5 has had some collisions but this is more of a high level question about hashing functions. If MD5 hashes any arbitrary string into a 32-digit hex value, then according to the Pigeonhole Principle surely this can not be unique as there are more unique arbitrary strings than there are unique 32-digit hex values ...

Big O complexity of simple for not always linear?

I'm sure most of you know that a nested loop has O(n^2) complexity if the function input size is n for(int i = 0; i < n; i++){ for(int j = 0; j < n; j++){ ... } } I think that this is similar, by a analogous argument, but i'm not sure can anyone confirm? for(int i = 0, max = n*n; i < max; i++{ ... } If so i guess that there is some...

Git directed acyclic graph - children know their parents but not the other way around

Git is implemented as a directed acyclic graph. Children know their parents but not the other way round. This makes sense because i can reach every commit only through a branch or a tag ( generally speaking through a reference). That's how i traverse the tree. What other reasons had the developers of Git to make "the children know their ...

Boosting my GA with Neural Networks and/or Reinforcement Learning

As I have mentioned in previous questions I am writing a maze solving application to help me learn about more theoretical CS subjects, after some trouble I've got a Genetic Algorithm working that can evolve a set of rules (handled by boolean values) in order to find a good solution through a maze. That being said, the GA alone is okay, ...