When is a heuristic admissible but not consistent?

As Russel and Norvig point out in Artificial Intelligence: A Modern Approach (the most commonly used AI textbook) it is challenging to come up with a heuristic that is admissible but not consistent. Obviously, you can select values for nodes in a graph such that the heuristic they represent is admissible but not consistent. This … Read more

Algorithm to detect photo orientation

Many photographs from consumer digital cameras are of people, which could be used for orientation. Face detection is a well-studied research area. Basic face detection would give you a rectangle whose longer side should be the vertical dimension. Further, if you can detect the eyes/mouth, you should be able to pick the correct orientation of … Read more

Split speech audio file on words in python

An easier way to do this is using pydub module. recent addition of silent utilities does all the heavy lifting such as setting up silence threahold , setting up silence length. etc and simplifies code significantly as opposed to other methods mentioned. Here is an demo implementation , inspiration from here Setup: I had a … Read more

A* Admissible Heuristic for die rolling on grid

Well, I’ll add my comment here, since it is more optimal than the current highest-voted answer by @larsmans – but, I am convinced there must be something better (hence the bounty). If I multiply the heuristic with a constant, it’s no longer admissible The best I can come up with is (manhattenDistance/3)*6 + (manhattenDistance%3), where … Read more

Generating a tower defense maze (longest maze with limited walls) – near-optimal heuristic?

I present a greedy approach and it’s maybe close to the optimal (but I couldn’t find approximation factor). Idea is simple, we should block the cells which are in critical places of the Maze. These places can help to measure the connectivity of maze. We can consider the vertex connectivity and we find minimum vertex … Read more

Rule of thumb for choosing an implementation of a Java Collection?

I really like this cheat sheet from Sergiy Kovalchuk’s blog entry, but unfortunately it is offline. However, the Wayback Machine has a historical copy: More detailed was Alexander Zagniotov’s flowchart, also offline therefor also a historical copy of the blog: Excerpt from the blog on concerns raised in comments: “This cheat sheet doesn’t include rarely … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)