Anyone have a good rule of thumb for choosing between different implementations of Java Collection interfaces like List, Map, or Set?
For example, generally why or in what cases would I prefer to use a Vector or an ArrayList, a Hashtable or a HashMap?
...
Is there an algorithm or some heuristic to decide whether digital audio data is clipping?
...
I'm teaching a kid programming, and am introducing some basic artificial intelligence concepts at the moment. To begin with we're going to implement a tic-tac-toe game that searches the entire game tree and as such plays perfectly. Once we finish that I want to apply the same concepts to a game that has too many positions to evaluate eve...
I have a value and I known that it's units is
meters^(mn/md) * kg^(kn/kd) * s^(sn/sd) * K^(Kn/Kd) * A^(An/Ad)
Note: the exponents are rational, units of m^0.5 are valid
The question is how to pick how to break down the units into something more compact
for instance if
md=kd=sd=Kd=Ad=1
mn=Kn=An=0
kn=1
sn=-1
I can use N/m
I suspec...
The idea is to move all of the right elements into the left and the left into the right with an empty space in the middle. The elements can either jump over one or two pieces into an empty space.
LLL[ ]RRR
I'm trying to think of a heuristic for this task. Is the heuristic meant to aid in finding a possible solution, or actually retur...
I have a huge list of person's full names that I must search in a huge text.
Only part of the name may appear in the text. And it is possible to be misspelled, misstyped or abreviated. The text has no tokens, so I don't know where a person name starts in the text. And I don't if know if the name will appear or not in the text.
Example:...
I need to store large amounts of data on-disk in approximately 1k blocks. I will be accessing these objects in a way that is hard to predict, but where patterns probably exist.
Is there an algorithm or heuristic I can use that will rearrange the objects on disk based on my access patterns to try to maximize sequential access, and thus ...
Over the last few days I have noted a few web sites that demonstrated TS solution using genetic algorithms.
I am looking for your opinion which is better for this particular problem.
Heuristics vs Genetic.
By better, I mean will yield a shorter/lower cost path.
Explain why you feel the way that you do.
Examples, and off-site links a...
In light of the recent vote fraud incident here, I was wondering if anyone out there is familiar with building systems for preventing or detecting undesirable voting behavior. I imagine the technology is widely used in search engines, online advertising (e.g. click fraud), and community sites (e.g. Digg, reddit), but surprisingly little ...
Given the various methodical approaches to development, can we get some heuristics together on which ones are appropriate in what circumstances, e.g.
case-driven development
model-driven development
behavior-driven development
test-driven development
Rational Unified Process
Jackson Structured Design
et al
No method is too old, speci...
I'm not interested in tiny optimizations giving few percents of the speed.
I'm interested in the most important heuristics for alpha-beta search. And most important components for evaluation function.
I'm particularly interested in algorithms that have greatest (improvement/code_size) ratio.
(NOT (improvement/complexity)).
Thanks.
PS
...
I have a question that really applies to any MVC framework, I'm using the Zend Framework MVC.
When exactly should you create a new controller? What exactly should the Controller layer define?
I've created several apps with the MVC, progressively becoming more reusable, but I've always struggled with naming Controller classes. For t...
The EICAR test virus is used to test the functionality of the anti virus programs. In order to detect it as a virus,
Should the antivirus program have the virus definition for the test virus
OR
The heuristics detect it as a suspicious pattern and detect it as a virus.
(I have seen an occasion that an AV program deletes the file whil...
The ways I can think of are:
Measure the time between actions.
Compare the posts' content (if they're too similar to each other) or, better yet, only the posted links.
Checking the distribution over a period of time the user is active (if the user is active, say posting once every hour, for a week, then either we have a superman ...
Hi all,
given a somewhat complex file of unknown specification that among other things contains an uncompressed bitmap file (.BMP), how would you extract it in Python?
Scan for the "BM" tag and see if the following bytes "resemble" a BMP header?
...
I would like to rotate photos automatically, even when EXIF metadata about the image orientation is not available.
Are there any good algorithms for detecting the orientation of a photo? The images are photographs from a digital camera. The algorithm doesn't have to work perfectly, but any reduction in the amount of human interaction r...
What is a useful heuristic to consider when deciding between a 'Loop with a String Regex' and a 'Regex' module?
...
This is not really a programming question, more of an algorithmic one.
The problem: Finding the "content" section of an HTML page.
By "content" I mean the dom that contains the page content as seen by humans, without the noise, simply the "page actual content".
I know the problem is not well defined, but let's continue...
For example ...
I have written an implementation of the A* search algorithm. The problem is that the heuristic I'm currently using only works accurately on square grids. As my map is isometric, the heuristic doesn't take into account actual the layout of the map and thus, the distance between cells.
Update: After extensive logging and analysis (read as...
I've tried various methods to strip the license from Project Gutenberg texts, for use as a corpus for a language learning project, but I can't seem to come up with an unsupervised, reliable approach. The best heuristic I've come up with so far is stripping the first twenty eight lines and the last 398, which worked for a large number of...