Return to Project-GC

Welcome to Project-GC Q&A. Ask questions and get answers from other Project-GC users.

If you get a good answer, click the checkbox on the left to select it as the best answer.

Upvote answers or questions that have helped you.

If you don't get clear answers, edit your question to make it clearer.

+3 votes
4.1k views

I would like to see checkers for every challenge in the Challenge Bikeway trail in California, USA. The challenges can easily be found on the challenge map.

I have looked through many of them, and they all seem to be very easy to write checkers for. It would be enjoyable to see a whole challenge trail covered with checkers. Might be the first?

And since I am the owner of Project-GC, I will even add two rewards on this task. When every challenge in the trail has a checker, excluding those where it's technically not possible, I will send 1 year of membership to Project-GC to these persons:

  • The one who created the most tags for the trail.
  • The one who created the last tag for the trail.

(it can be the same person, and he/she will then receive 2*1 year)

Answer in this thread when you want to claim your rewards!

PS! It's appreciated if you also post an answer for every checker you have created, so that I/we can feel the progress.

UPDATE:

These are not included in the contest, since we see them as technically impossible.

  • Challenge Bikeway: Top 20 Favorites
  • Challenge Bikeway: 100 Trackables Logged Challenge
  • Challenge Bikeway: The Blue Ribbon Challenge
  • Challenge Bikeway: Geo-Art Challeng

These are the only 3 missing now, and they should be possible: GC4FF33, GC5E2QP, GC44TT7

COMPLETED, rewards on their way

in Miscellaneous by magma1447 (Admin) (241k points)
edited by magma1447 (Admin)
12 of 25 tagged
Most of the untagged one have a popular requirement but demand a number of different types and the existing scripts cant check for that. At least the scripts I have looked at

Impossible today
Challenge Bikeway: Top 20 Favorites   Not possible with current API
Challenge Bikeway: 100 Trackables Logged Challenge   Not possible with current API
Challenge Bikeway: The Blue Ribbon Challenge   Not possible with current API
Challenge Bikeway: The Year Challenge no way to autodetect if the numer in the name i a year: checking for 4 numbers with non numbers on the side are possible

"Possible" but need a lot of of manual work and updateing
Challenge Bikeway: Geo-Art Challenge No automatic check for Geo-Art can be done without manula make a list of all possible caches


Maby ok and created
Challenge Bikeway: 100+ Challenges Challenge:
http://project-gc.com/Challenges/GC44V4R/1948
All Unknown with the word "CHALLENGE" in the name are considered a challenge. Gives false possitive. A blacklist is possible for bad caches


Unclear definition
Welcome to Challenge Bikeway are the cases on "Welcome to" important?
the taged on check for case but can easy be changed
Just to be clear, as I wrote, "When every challenge in the trail has a checker". Therefore no memberships has been handed out yet. This was with the exception for those where it isn't possible due to different reasons, and I do agree with Target on those 6 he has listed. About 50% of the caches are still missing checkers. :)

I would suggest, that there are 4 missing :-)

Challenge Bikeway: The Year Challenge

"[...] find 15 caches that have a YEAR listed in the title. [...] It has to be in the range of 2000 to 2014 (updated 11/22/14) and cannot be the part of a larger number but can be part of a date. [...]"

I think, "can be part of a date" can be interperted as "standalone number with 4 digits ranging from 2000 to 2014".

I could - heretically - even count +1 for "GC5HZY4 Two thousand words" :-)

my-point-of-view-regex: ^[0-9]20[00|01|02|03|04|05|06|07|08|09|10|11|12|13|14]^[0-9]

Maybe someone could ask the owner?

Weird, I just replied, but it didn't work.

Anyway. I haven't really read about this one before, I just trusted Target. :)

I would say that it should work fine just as you say, at least with the regexp. Using "Two thousand" might be to push it, I can't find any logs with that either.

I will remove this cache from the exception list.
Maybe the reply didn't work because I moved my "answer" to "comments" ;-)
Ah, most likely why. I got very confused at least.

10 Answers

0 votes
 
Best answer
And this should have been the last checker/tag for the trail (*hint*)
by hampf (4.3k points)
selected by magma1447 (Admin)
+1 vote
by GentlePurpleRain (1.4k points)
+1 vote
by GentlePurpleRain (1.4k points)
+1 vote
by GentlePurpleRain (1.4k points)
+1 vote
by GentlePurpleRain (1.4k points)
+1 vote
Checker created for Challenge Bikeway: The 4444 Challenge
http://project-gc.com/Challenges/GC4E2AR/4279
by Target. (Expert) (104k points)
+1 vote
Checker created for Challenge Bikeway: The Year Challenge

http://project-gc.com/Challenges/GC4G27B/6926
by hampf (4.3k points)
+1 vote
Checker created for Challenge Bikeway: Lone Letters & Numbers

http://project-gc.com/Challenges/GC4FF33/7351
by hampf (4.3k points)
Looks like the script is disabled?
Yes, I worked on it to be more universally usable :-)
Should be enabled now.
"Verify tag" on "Challenge Bikeway: Lone Letters & Numbers" shows "Not ok" for cacher leelelee. leelelee is the owner of the mentioned cache GC51V22 with the lone letter Z and has not logged a find on this one. So the checker is right, phew, slightly sweating now...
+1 vote

Checker created for Challenge Bikeway: Non-Traditional Alpha-Numeric

http://project-gc.com/Challenges/GC44TT7/7295

by hampf (4.3k points)
0 votes
Checker created for Challenge Bikeway: Alpha Counties

http://project-gc.com/Challenges/GC5E2QP/6869
by hampf (4.3k points)
I have to comment on this myself for reporting some strange behaviour on this site with the script:

Testing for user Alamogul just shows up with a very short example log:

I have used [url=http://project-gc.com/Challenges/GC5E2QP/6869]Project-GC[/url] to see if I qualify for this challenge and I do.

I suppose there is a problem with large lines in the LUA Sandbox. Same happens for user mado-germany.

Other users show a correct example log with all qualifying finds listed.
I honestly doubt very much that it's the sandbox fault, but it's a bit too much code for me to read through now. Some debug-prints to see whats (not) happening would be interesting.

Most users I try only has the short log entry, including users with less than 3000 finds.

I can see in my webbrowser that the ajax request returns log: null (where the log text should be).
Ok, maybe the sandbox anyway, or at least, it breaks because of broken data. I will try to see where it comes from.
Bug in the script.
key=StringUpper(StringSub(f['county'],1,1))
most likely breaks whenever the first character is UTF8. Solution usually is to use some regexp, or as an alternative, you could probably borrow the utf8.sub() from https://github.com/Pogs/lua-utf8-simple/blob/master/utf8_simple.lua

Or, the easy solution, use what we export in the sandbox, though I would love for them to be removed in the future since it can be handled inside LUA.
http://project-gc.com/doxygen/lua-sandbox/classPGC__LUA__Sandbox.html#a59f3e23c97f044f5e73c19e3c26c913b
http://project-gc.com/doxygen/lua-sandbox/classPGC__LUA__Sandbox.html#adbc8a499e0a119c9a0b4aaf4c4334b80

I actually think this would be best for getting the first character: http://stackoverflow.com/questions/13235091/extract-the-first-letter-of-a-utf-8-string-with-lua
I copied your script and added
function firstLetter(str)
  return str:match("[%z\1-\127\194-\244][\128-\191]*")
end

and changed around line 80 to this (checking for empty county as well):  
if (f['county']~=nil and f.county ~= '') then
    key=StringUpper(firstLetter(f.county))

After that it seems to work just fine.
Just looking trough the code i have a supervision that it is a UTF problem with the county name. If you test with med you get no output and i have logged caches in for example Överkalix.
the line key=StringUpper(StringSub(f['county'],1,1)) is not UTF8 compatible and you will get a the first half of the multibyte character. It might become a control charater and disrupt the output but i might be totaly incorrect

If you find a user that get an output like camper248 there is no easy way to see that the requirement are met. You should only print the caches that are used in the spelling. One cache per county and a total of 10 different types
Do you have any link explaining the cartesic product method you use to solve the cache selection problem. There exist a lot of other challenges with requirement like that I would like to use that code for.  The code is not obvious and some more explanation would be appriciates
Sorry, I have been editing around the last cache checker for the trail using the other cartesic product checker I implemented ;-)

I have implemented the list of qualifying caches exactly this way, showing all types per line that could be used to qualify because there is no means to backcompute THE qualifying type and cache for that line.

You can see from the mathematical background that there is no way to resolve them after the algorithm found a possible solution:

First of all, a cartesic product uses a lot of space and time if you implement the mathematical theory in a straightforward manner.

I'll use the following shorthand: 1x3 -> 13
so that {1,2} X {3, 4} = {13, 14, 23, 24}

I tried at first attempt, to just do this and check time and space consumption for very small matrices. No way to even get close to finishing before the sandbox limits were reached. On the other hand the approach with fixed nested for loops did not even have the minimum of the needed flexibility.

I made the assumption that {1,2} X {3, 4} X {3, 2} can be iterated by multiplying the first two matrices and then use the result to multiply with the next. This way the number of matrices needn't be fixed to be traversed by an algorithm. After having multiplied the last result with the last remaining matrix you have all possible combinations of (in this case) cache types.

This means that {1,2} X {3, 4} X {3, 2} = {13, 14, 23, 24} X {3, 2} = {133, 132, 143, 142, 233, 232, 243, 242}

For any cartesic product with  this would normally result in a very large matrix in the end.

Another thing to do the trick (reducing memory fooprint) is to translate cachetypes to single letters (not necessarily related to the cache type name at all). "Event Cache" will become "A", "Traditional Cache" will become "B" and so on. Maybe some other letters and not necessarily the same every time a tag is created. It depends on the position in the array "Configuration.cachetypes".

The next optimization is to treat the resulting matrix after the multiplication so that only relevant entries are kept. Others will be regarded "the same". Look at the combination {"Earthcache", "Traditional", "Traditional"} and {"Traditional", Earthcache", "Traditional"}

Both matrices are equal according to number of different cache types. With what I have said earlier and for example by translating "Earthcache" to "1" and "Traditional Cache" to "2" plus the assumption that the position of the letter in the "word" does not matter, following will be calculated (I also sort the letters ascending for better readability):

This means that {1,2} X {3, 4} X {3, 2} = {13, 14, 23, 24} X {3, 2} = simplify({133, 132, 143, 142, 233, 232, 243, 242}) = {13, 123, 134, 124, 23, 234, 24}

At last I only multiply until I find an N letter word in the resulting matrix, where N is "minimum different cache types". The mathematical probability is very high therefore that I do not have to multiply until the bitter end and chances are high to rate the challenge qualified before checking all combinations.

Having said that, you can see that I cannot  produce a list with minimum GC Codes but can tell if the challenge was fulfilled or not. The list can be used to verify that the algorithm worked correct if any doubts arise. The positive checker itself should be proof enough that the challenge may be logged found.

Oooops, I hope I haven't bored the hell out of you, then ;-)

Greetings
Hampf
I have added the following suggestion to my script. It worked well.

function firstLetter(str)
  return str:match("[%z\1-\127\194-\244][\128-\191]*")
end
...
if (f['county']~=nil and f.county ~= '') then
    key=StringUpper(firstLetter(f.county))
...

Thanks a lot for your work.
Yes now i understand the algorithm.
The checker should relay display a correct solution else you really cant use it because of the requirement of the challenge

With some small modification and a bit more memory usage you could store the path for the correct solution. Store the path of the product along its value, any path leading to that product will do.
I suspect the memory usage will not be that great but i might be complexly wrong.

I would guess that i you sort the data before you do the cartesian product in order of types you will find a ok value faster. The backtrack data will be smaller

The checker will probably the fail for Alamogul. He kills almost all checkers if you fetch all caches. Even the example code in a new script will run out of memory on him. The problem only exist on the top 10 cachers with more then 50000 finds


Another way to get the first letter it to use StringMatch(f.county,"^%a")
will return the first letter if it is a-z else nil. It is likly more usefull in a spell with cache name checker when you can assume other one byte cheracters than the alphabetic
Example output for power cachers - here: Alamogul:

"Script executed in 2.3 seconds. Peak memory usage: 243,200 kB"

This is not what I call "probably fail" in time and with the actual memory limit of 512MB. This was only achieved by reducing memory footprint with the aforementioned algorithms. Sorry, I don't want to offend anybody, but I think the cache owner should trust the checker on more or less heavily COMPLEX challenge requirements. If I were a challenge cache owner (yes, I am, actually) and one of the loggers stated having achieved the task by using a PGC checker, I'd only have a glance at the list of caches. If it is huge then I'd believe that the challenge is fulfilled. If it is smaller AND I don't trust the checker UNTIL THEN, I'd use my human intelligence to quick check for myself (I made up the challenge, so I should be able to understand what I want from others to achieve AND should be able to collect the neccessary information from a rather elementary list containing only GC-Codes and cache types, if I WANT).

I for myself would definitely be very pleased that someone has worked out some strange mechanism to remove error prone checking by the logger himself - who, in the end, wants to meet the logging requirements, without imputing anything to anybody... :-)

The bigger the list gets the more of a chance, that the requirements are met. If I need just one more type or need just one more county then there is another output. Here is mine:

-------------
Not qualified

You could use the following actual finds table to go for missing caches:

A: Webcam / Traditional
B: Letterbox / Virtual / Earthcache / Unknown / Multi / Event / Traditional
C: Virtual / Traditional
E: Letterbox / Virtual / Earthcache / Multi / Unknown / Event / Traditional
F: Unknown / Traditional
G: Unknown / Traditional
H: Unknown / Traditional / Earthcache
K: Event / Letterbox / Multi / Earthcache / Virtual / Unknown / Webcam / Traditional
L: Letterbox / Earthcache / Wherigo / Multi / Event / Mega-Event / Webcam / Cache In Trash Out Event / Unknown / Lost and Found Event / Traditional
M: Virtual / Earthcache / Traditional
N: Unknown / Traditional
O: Earthcache / Multi / Unknown / Traditional
P: Earthcache / Virtual / Unknown / Multi / Traditional
R: Multi / Virtual / Unknown / Traditional
S: Earthcache / Unknown / Virtual / Multi / Traditional
T: Unknown / Multi / Earthcache / Traditional
V: Letterbox / Earthcache / Multi / Unknown / Traditional
W: Traditional

18/20 counties found.
Counties to look for: D / I / J / Q / U / Y / X / Z
-------------

This looks readable for me and I could figure out what to do next (18 counties found, 2 more to go of D / I / J / Q / U / Y / X / Z, no message about missing cache types, meaning I have found at least 10 different cache types, looks like they are evenly distributed to meet the requirements, so I'm sure that none is missing in the path)

The next is the output for someone having not that many finds:

--------------------
Not qualified

You could use the following actual finds table to go for missing caches:

E: Multi / Traditional
K: Unknown / Event / Traditional
L: Unknown / Event / Traditional
O: Traditional
R: Traditional
V: Multi / Unknown / Traditional

6/20 counties found.
Counties to look for: A / C / B / D / G / F / I / H / J / M / N / Q / P / S / U / T / W / Y / X / Z

4/10 different cache types found.
Cache types to look for: Cache In Trash Out Event / Earthcache / Giga-Event / GPS Adventures Exhibit / Groundspeak Block Party / Groundspeak HQ / Groundspeak Lost and Found Celebration / Letterbox / Lost and Found Event / Mega-Event / Project APE / Virtual / Webcam / Wherigo
--------------------

As I can quickly see, this buddy (yes, I know her) has a lot more work to do :-(

Maybe this list should have more information, but when I go for a challenge I know already, what I have to do: find 20 counties, found 18, find at least 10 cache types, found 4). What could a dull (and even more so in case of a generic) algorithm tell the geocacher what he cannot read for himself?

If a challenge cache owner really don't trust anybody, he could use "Verify tag" to check the last 10 loggers. BTW: Is this easily possible for cache owners to find and use this button? I know I could, but how about other challenge cache owners?

At last: I didn't intend to shout, UPPERCASE was used for emphasizing.
I have missed that the memory requirement has been increased from 256MB and Alamogul will probably  work in most cases
If it is impossible because of memory demand or complexity/time to implement a checker that says that it correct is ok.
I don't think the data used in the algorithm is really that much memory
If you use the same datafields in getfinds in the example script with only getfinds uncommented for Alamogul

Your script:  Script executed in 2.3 seconds. Peak memory usage: 243,200 kB"
Empty script:Script executed in 1.9 seconds. Peak memory usage: 241,920 kB

I just realized that your algorithm i a Breadth-first search with a clever way to reduce memory usage and detect a ok solution without checking the whole graph.
 
I have to try to implement it with a memory of the path and check if the  memory requirements myself
Hi Target.
I hope you can reuse a good portion of my code, then.
I wish you all the best.
Hi Target.
I have finally managed to write a script that tracks back the found cache types per county. Have a look at http://project-gc.com/Challenges/GC5E2QP/7660

I tested the performance with cacher mado-germany

a) no traceback
b) nice log with minimal "counties / cache types" requirement shown

a) Script executed in 0.66 seconds. Peak memory usage: 32,512 kB
b) Script executed in 12 seconds. Peak memory usage: 404,480 kB

In the end, the log looks like that:
------------------------------
I have used [url=http://project-gc.com/Challenges/GC5E2QP/7660]Project-GC[/url] to see if I qualify for this challenge and I do.

Qualified with following finds:

24/26 (20 needed) different counties found.
16/18 (10 needed) different cache types found.
A: <strong>[url=http://coord.info/GC453V1]GC453V1[/url] (Mega) / Augsburg / 2013-05-04 </strong>
B: <strong>[url=http://coord.info/GC54FZC]GC54FZC[/url] (Letterbox) / Bergstraße / 2014-06-07 </strong>
C: <strong>[url=http://coord.info/GC363BX]GC363BX[/url] (Traditional) / Côte-d'Or / 2013-06-19 </strong>
D: <strong>[url=http://coord.info/GCN4EP]GCN4EP[/url] (Webcam) / Darmstadt-Dieburg / 2009-08-08 </strong>
E: <strong>[url=http://coord.info/GC194B]GC194B[/url] (Virtual) / Effingham County (IL) / 2008-01-02 </strong>
F: <strong>[url=http://coord.info/GC3KE70]GC3KE70[/url] (Multi) / Fulda / 2012-07-18 </strong>
G: <strong>[url=http://coord.info/GC5GB69]GC5GB69[/url] (Event) / Germersheim / 2014-12-04 </strong>
H: <strong>[url=http://coord.info/GC2NFX8]GC2NFX8[/url] (Unknown) / Heidelberg / 2014-07-01 </strong>
I: <strong>[url=http://coord.info/GC26NWN]GC26NWN[/url] (Earth) / Illes Balears / 2013-03-24 </strong>
J: GC21RQZ (Traditional)
K: <strong>[url=http://coord.info/GC4B061]GC4B061[/url] (Wherigo) / Koblenz / 2013-06-29 </strong>
L: GC4W7V2 (Letterbox)
M: GC1ZRBC (Letterbox)
N: GC1RADR (Letterbox)
O: GC28WR5 (Earth)
P: GC1Q1MM (Earth)
R: GC2NFRP (Letterbox)
S: GC1JQ5P (Letterbox)
T: GC1A39N (Earth)
U: GC22Z9B (Earth)
Looks interesting. I like to look at it if you would enable it
Done :-)
Didn't know, that a script is not visible until enabled enabled.
The tags are not visible if disables either. Could nice to have a working tag to look at.
The config is the same, but I enabled the tag just for the sake of nicer output for users with not as many finds as a bit more than 10000.
I have set a limit to 30000 finds. This should be enough to get a succesful check. Alamogul runs well, as you can see.

Profile name     Log date     Result     Log entry
CarlottaP    2014-12-12    OK    Link
oaknest    2014-12-12    OK    Link
Team Psychopuppy    2014-11-02    OK    Link
J5 Crew    2014-11-02    OK    Link
bthomas    2014-10-25    OK    Link
camper248    2014-10-12    OK    Link
JoyfulNomad    2014-10-09    OK    Link
BerkeleyBoomers    2014-10-05    OK    Link
Alamogul    2014-10-03    OK    Link

All other top 10 profiles run in less than 10 secs with memory less than 100MB. mado-germany must have a bad cache type distribution among the counties they found caches.
After i fixing a bug where the code did not remove used types and sorting the types array i got the memory usage and speed down to the levels before backtrack was inplimented
The result can be found here. The changes in in the lines 225-240.

http://project-gc.com/Challenges/GC5E2QP/7748
Thanks a lot for your improvements.
Now it looks like a really good algorighm for cartesian product challenges. This would have been a long walk without your encouragement and input.
...