6

Start with deciding how to represent the state. A simple approach is to say that the state at a location is a string of length 4 in which each character is one of FGBX_. There are three locations, so your starting position is ['FGBX', '____', '____'] and your desired ending location is ['____', '____', 'FGBX']. And now you can simply have logic that looks ...


4

function g(args) { return f(args); } If f is off in some other language, then you get to do a foreign function call. If it is some exe, then you exec it (though good luck serializing the i/o). If it is some service, just call the service (though good luck serializing the i/o). If it is some hidden library, then your function gets to disassemble it and ...


2

This reminds me a lot of programming by example. Sumit Gulwani from Microsoft has some very interesting talks with papers cited. Basically, the possible language is simplified a lot, so the number of possibilities are limited. In his talk it is limited to relatively basic data transformations of the sort you do in typical data cleaning. Next, possible ...


2

Nope. Here's why. A derivative of O(n2) and O(n3) will tell you that the difference of these upper bounds is 1. The problem is I don't care about that difference. I care about the differences between O(n2) and O(n!). Neither of which I like (I like O(n*log n)) but O(n!) is nasty when n is significant (sometimes n isn't and then no one cares about any of ...


1

Any algorithm that requires you to compare each set to every other set is doomed to failure. It's an O(n2) problem. The classic way around this is either minhash + LSH, or, if you only wish to detect near-identical sets of titles, simhash. Both approaches reduce it down to an O(n.log(n)) problem. Both are statistically based: they are not guaranteed to ...


1

Thanks everyone for replying! After researching, I found a better solution for G1, and so an answer to Q1. Now I use Lucas-Kanade method (optical flow estimation method) for object tracking. I just need to mention a point inside the object (for example one can draw a very small circle), and it sticks to that object, that is the circle moves with the object....


Only top voted, non community-wiki answers of a minimum length are eligible