theory

3D symmetry search algorithm

This may be more appropriate for math overflow, but nevertheless: Given a 3D structure (for example, a molecule), what is a good approach/algorithm to find symmetry (rotational/reflection/inversion/etc.)? I came up with brute force naïve algorithm, but it seems there should be better approach. I am not so much interested in genetic alg...

Complex behavior generated by simple computation

Stephen Wolfram gave a fascinating talk at TED about his work with Mathematica and Wolfram Alpha. Amongst other things, he pointed out how very simple computations can yield extremely complex behaviors. (He goes on to discuss his ambition for computing the entire physical universe. Say what you will, you gotta give the guy some credit fo...

cleaning up noise in an edge detection algorithm

I recently wrote an extremely basic edge detection algorithm that works on an array of chars. The program was meant to detect the edges of blobs of a single particular value on the array and worked by simply looking left, right, up and down on the array element and checking if one of those values is not the same as the value it was curre...

What is the origin of "launch the missiles"?

In the context of functional programming, a typical example of a side effect is "launch the missiles". I was just wondering where that expression comes from historically. ...

do you call them functions, procedures or methods?

consider a standard c# 'function' public void foo() { //some code } In c or c++ this is called a 'function' - even if taking no parameters and returning no value. In another language maybe it would be a 'procedure'. In object orientation speak it would be called a 'method' if a class member. What would be the correct term to use in c#?...

Why should "miter" joints be slower than others?

I'm having a graphics problem on drawing lines in Flash Player, where two lines drawn on top of each other with different thickness don't align properly if I use any other JointStyle than MITER. For pictures of the effect, and for the graphics oriented part of the question, see my post over on doctype. However, there's also a second ang...

Database Design for One to One relationships

I'm trying to finalize my design of the data model for my project, and am having difficulty figuring out which way to go with it. I have a table of users, and an undetermined number of attributes that apply to that user. The attributes are in almost every case optional, so null values are allowed. Each of these attributes are one to o...

The Cash or Credit problem

If you go to a store and ask "Cash or Credit?" they might simply say "Yes." This doesn't tell you anything as you posed an OR statement. if(cash || credit) With humans it's possible that they might respond "Both" to that question, or "Only {cash | credit}." Is there a way (or operator) to force the a statement to return the TRUE portio...

Is there a term for this concept, and does it exist in a static-typed language?

Recently I started noticing a repetition in some of my code. Of course, once you notice a repetition, it becomes grating. Which is why I'm asking this question. The idea is this: sometimes you write different versions of the same class: a raw version, a locked version, a read-only facade version, etc. These are common things to do to a ...

Nested loop with dependent bounds trip count

hello. just out of curiosity I tried to do the following, which turned out to be not so obvious to me; Suppose I have nested loops with runtime bounds, for example: t = 0 // trip count for l in 0:N for k in 0:N for j in max(l,k):N for i in k:j+1 t += 1 t is loop trip count is there a general algorithm/...

Cutting edge mobile / ubiquitous / pervasive applications?

I am interested in the state of the art with respect to mobile, ubiquitous and pervasive computing. For example, uses of ubiquitous computing in healthcare, business, logistics, context aware mobile business applications, ad-hoc peer-2-peer etc. What applications have you seen, worked on or maybe read about in research papers that you c...

Fitts Law, applying it to touch screens

Been reading a lot into UI design lately and Fitt's Law keeps popping up. Now from what I gather its basically the larger an item is, and the closer it is to your cursor, the easier it is to click on. So what about touch screen devices where the input comes from multiple touches or just single touches. What are the fundamentals to tak...

[Java] Efficiently finding the intersection of a variable number of sets of strings.

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, jus...

Gaining information from nodes of tree

I am working with the tree data structure and trying to come up with a way to calculate information I can gain from the nodes of the tree. I am wondering if there are any existing techniques which can assign higher numerical importance to a node which appears less frequently at lower level (Distance from the root of the tree) than the s...

P=NP?-Problem: What are the most promising methods?

Hello everybody, I know that P=NP has not been solved up to now, but can anybody tell me something about the following: What are currently the most promising mathematical / computer scientific methods that could be helpful to tackle this problem? Or are there even none such methods known to be potentially helpful up to now? Is there any...

How is the concept of "content negotiation" called outside the HTTP context?

Hello, everyone! What are different terms for "content negotiation" (when not talking about HTTP)? For example: some (remote or local) services, components, modules, are negotiating about which protocol to use and/or which content type to exchange. Service provider About the content: What I am very good at, is providing apples. I a...

Subgraph isomorphism on disconnected graphs with connection rules

Hello I was wondering if anyone knows about a solution to the following problem: Given a graph g as query and a set of graphs B with connection rules R. The connection rules describe how two graphs out of B can be linked together. Linking points are marked vertexes. Find all combination of graphs in B that contain g as a subgraph. Reg...

What's the term to describe this combination?

There are 4 items: 1, 2, 3, and 4. If we just allow the following combinations, what should we call them? I forgot it. Is it called nCr? 1 2 3 4 1 2 3 1 2 4 2 3 4 1 2 1 3 1 4 2 3 2 4 3 4 1 2 3 4 ...

Fast path cache generation for a connected node graph

I'm trying to get a faster pathfinding mechanism in place in a game I'm working on for a connected node graph. The nodes are classed into two types, "Networks" and "Routers." In this picture, the blue circles represent routers and the grey rectangles networks. Each network keeps a list of which routers it is connected to, and vice-ve...

What's a common practice of completing abstract class?

You have a class, that perfectly fits to be an abstract, but this class cannot work normally without data supplied from derived class. It's not convenient to pass all data to constructor because not all of it may be needed, and many of them can be dynamic (result from child function). What are the best practices to compose such structur...