Monday, April 25, 2016

All About Density Maps

Want to know what a density map looks like before AQ makes
it all nice and pretty for you? This is it! =) Each state (and DC) has a different
palette index so AQ only needs to change one color for each state 
rather than dealing with the complex boundaries of the state. (I gave each
state a different color to make it easier for ME to see the boundaries,
but all of the colors are replace dynamically while generating the map
so it doesn't matter what the colors are at this point. Canada, Mexico,
Caribbean islands and the ocean are the only colors that don't get changed..
Then an outline of the states with the AQ logo is applied on top
to give it a polished look. Then AQ prints what map you're viewing--
who the map is for and the "action" (see below) at the top.
And presto! This ugly thing turns into a beautiful density map! =)
I teased in my last post that I had a lot more to write about those new density maps on the profile page, and here's my follow-up! For those who've been sleeping the last few days, I added a new premium member perk which allows premium members to see density maps of their plants and finds (in the United States) on their profile page. Very cool stuff! =)

But it's so much more! You can actually include them pretty much on any website you want. It's just an image, after all. You can post them to Facebook, or blogs, or... well, anywhere you can normally upload images. The URL, at it's most basic, is:

http://www.atlasquest.com/syndicate/us-box-map.png

This displays a density map of all boxes listed in the United States on Atlas Quest. You can customize the map with a few parameters. It helps if you have at least a little technical background because to change it requires some URL manipulations. There's no page to set the parameters automatically. (Perhaps someday, but it's not a high priority for me.) But URL manipulation is easy and opens up a whole lot of new options...
  • memberId: Specifies the member ID of the person whose plants and finds you want to create a density map for. You can find your member ID at the top-right corner of your profile page. And since this is a premium member only perk, it only works for members who are premium members. (You'll just see an error message saying that density maps are a premium member perk if you try to point to a non-premium member.)
  • color: A 6-digit hexadecimal number for the color to use on the map in the form rrggbb. All of the shades of color are based off this color and become progressively darker the larger percentage of plants/finds are in the state. Generally speaking, using bright, light colors works best since shades only get darker. If you use a dark color (like black), you just get... black. For everything. 50 Shades of Black. (Ha!) =)
  • action: Can be set to plants, finds, attempts, owns or carves. If none is specified, it default to plants. So yes, this means you can display density maps of your attempts, boxes where you're the officially listed owner, or boxes with stamps that you've carved. I don't display them on the profile page because I don't think they're as interesting and I don't think most of you are as interested in them, but the option is available!
  • width: The maximum width (in pixels) that the map should be. It defaults to 600 when none is provided.
  • height: The maximum height (in pixels) that the map should be. It defaults to 600 when none is provided.
So! Here are a few more examples of maps that you can generate with a little URL manipulation:

My carves, with a reddish color (ff8888), set to a width of 300 pixels.
http://www.atlasquest.com/syndicate/us-box-map.png?memberId=1;color=ff8888;action=carves;width=300

 

My attempts, with a purplish color (ff88ff), set to a width of 400 pixels.
http://www.atlasquest.com/syndicate/us-box-map.png?memberId=1;color=ff88ff;action=attempts;width=400


Boxes I own, with a greenish color (ff88ff), set to a width of 500 pixels.
http://www.atlasquest.com/syndicate/us-box-map.png?memberId=1;color=88ff88;action=owns;width=500

BUT! That's not all.... Those are all parameters this feature was specifically designed to handle. These parameters are unique to this feature and this URL. There's a heck of a lot more parameters it supports, however, because these maps are really just an advanced search that spits out its output in a very unique manner. Almost all of the parameters you can use for advanced searches also applies to these maps as well! You can create maps of your active plants. Or all of your finds that you've tagged yellow. Or all boxes you've found that have the word "flower" in it. Or all boxes you've found that are a mental puzzle. Or whatever!

Like I said... these maps.... they're nothing more than an advanced search with a very special output!  (However, the mapping code isn't smart enough to label your map with all of your search options--just who the map is for and what action is being used.)

So, let's take a look at a map of my active plants still in existence:

To display only my active plants, I add status=1 to the URL
http://www.atlasquest.com/syndicate/us-box-map.png?memberId=1;status=1;color=88ff88;action=plants


This map is a more interesting one.... compared to the map of all of my plants, this one has a lot more holes in it. Particularly in those states where I only had one or two plants to my name to start with. Those go missing, and poof--I lose the state!

Or maybe look at my plants that have the mental puzzle icon involved. Which means setting the attribs tag to 128. (You'll probably want to run an advances search and just use the same parameters it sends you to. That's how I got these numbers!)

http://www.atlasquest.com/syndicate/us-box-map.png?memberId=1;attribs=128;color=ffff88;action=plants

So there you go.... all sorts of map options you probably didn't even realize you had! The only advanced search options that don't work is the location (it'll ignore whatever you specify and change the location to "all boxes in the United States") and anything in the "participants" section (the owner, carver, finders, etc.) which is overwritten by the memberId and action parameters. All other advanced search options work! =)

And you might be thinking... but Ryan! I want to add a map of my active plants to my profile too! How do I do that?!

And... well, you'll have to fall back on the old hack of including the URL in the free-flowing thoughts section of your profile. I've gone ahead and done that to my profile so you can see an example of it in action. It's separated from the other maps, which isn't ideal, but I didn't have the time or inclination to set up a whole range of all possible map options that I figured most people wouldn't be interested in. I picked the two that I felt most people would be interested in and everything is an advanced feature. =)

Technical note: It's entirely okay to use & between parameters rather than the semicolon that I used in my examples. Semicolons cause me less trouble than the special character & (where I often need to convert it into "&" in HTML), so I generally make a habit of using semicolons on AQ even though it's not normal on other websites and, in fact, wouldn't work at all on most other websites. =)

Thursday, April 21, 2016

Major Profile Update!

Density map of my finds.
So... any of you trying to get onto AQ this evening might have seen it was down for maintenance for about a half hour. As per usual, there were a number of minor tweaks here and there, but the main thrust of this particular update and where you'll see the most changes was the profile page. It's the 13th most-visited page on AQ, you know, and hasn't really undergone any major renovations since Atlas Quest launched in 2004!

The primary reason for the renovation was to make it smartphone friendly. If you check out that page on your smartphone, it's a heck of an improvement! Much neater and requires no zooming in and out to navigate.

I remembered more than once people wanting to know how to update the profile of a sub-account. The answer previously had been: Log into the account! There was no way to edit the profile of a sub-account from your primary account, and creating such a feature was never a high priority for me because it was so easy just to log into the sub-account directly. I didn't add the feature when I first created profiles because sub-accounts didn't even exist, and adding such a feature retroactively would have taken quite a bit of time and effort, and I judged it to be not worth the effort for the few people who, on rare occasions, might use the feature.

But this time, I was already neck-deep in pretty much rewriting all of the code running this subsystem from scratch, and adding the feature at the same time was relatively quick and easy. So presto! You can now edit sub-accounts directly from the primary account! (As an extra perk for admins--we also have the power to edit anyone's profile without having to log into their accounts. It doesn't happen often, but it has happened when people have posted inappropriate material in it.)

Anyhow, for those of you who use sub-accounts a lot, you're gonna love that change! =)

And for premium members... there's an entirely new section on your profile for density maps of your plants and finds. This feature was actually a lot of fun for me to build because I found it rather challenging and pushing my abilities. =) It also took me more time to build that new feature than the complete rewrite of the rest of the profile subsystem!

A density map of my plants over the years! Just 11 more states to go!
People have been adding maps to the free-flowing thoughts section of their profile for years of a picture of the United States with the states filled in for places they've boxed. I figured a "native" map linked directly to the AQ database would be quite a bit simpler to use and maintain. AQ could even go one better than just filling in states where you've boxed, but even use different shades of a color to show how many letterboxes you've planted/found in a given state. The darker the color, the more boxes you've found and planted.

I will point out a couple of caveats to be aware of, however. First, AQ only knows the located of listed finds--and even then only if it's not a mystery box. If your only finds in a state are of the unlisted variety, it's going to show as empty. Likewise, the density maps are only the densities based on your finds of listed boxes.

Second, it's not unusual for boxes planted at an event to later move out of state for replanting. Ideally, people would just retire the original listing and relist it fresh, but that doesn't always happen so you may end up with states that you've "letterboxed" in but have never actually been to. It is possible to fix this discrepancy by adding a custom location to the boxes of where you originally found the boxes. AQ counts states based on your custom locations first, then falls back to the location "officially" listed on the box.

On a related note, it's also possible to get mystery boxes you've found counted towards the correct state by adding a custom location for where you found the box.

And, not really a feature per se, but I also added a Google/Amazon ad at the bottom of the profile for non-premium members. I know nobody likes ads, but I did add them to the bottom of the page where I hope they won't be too obtrusive. It's not like you wouldn't notice it on your own and it doesn't really need any explanation--I just wanted to acknowledge it was there. Whether you can't afford a premium membership or just don't want one, I figure anyone using AQ regularly probably wants to support the website in some manner, and that's another way of doing so.

Which pretty much sums up the major changes to the profile page. There are a few minor things as well (you can rotate your signature stamp image if your smartphone uploads it in an incorrect orientation!), some minor formatting changes (which you might not see until your browser re-caches the CSS file), and such.

I'll post more about the density maps later, though, because there's a lot more to write about those outside of the profile page. But I'll save that for another day....

Completely off topic... there's also a new event icon to represent events at "places of learning" (schools, libraries, museums, etc.)


Saturday, April 02, 2016

Merger is OFF! Off, I say!

There's a vicious rumor that AQ and LbNA are merging. Normally I don't comment on such obviously ridiculous rumors, but I keep being asked about it so I'm making it official--there is no merger! I don't even know how these crazy ideas even get started.

It does appear, however, that a hacker gained access to the Wassa Widget and changed it to only show the most interesting posts rather than the funniest posts of each day. This, of course, is unacceptable--AQ is nothing if not a ball of non-stop laughs--and the situation will be fixed as quickly as possible.

Speaking of which, Wassa has not lost his admin and moderator privileges. Obviously, the hacker was impersonating me when they contacted Wassa about his demotion.

Thanks for understanding in these dark and difficult times.....

But in all seriousness.... I'd also like to thank Choi for playing along with our little April Fools joke. I had the idea of "switching websites" for the day and tossed the idea to Choi, who was game for it. We didn't run with my original idea--mostly because neither of us are particularly experienced in the mysterious ways of DNS entries and can really screw things up badly if we didn't get it just right. Not to mention that it would have required a few minor (albeit "invasive") changes to the AQ code and probably some ugly security errors with a no longer properly functioning SSL certification. Perhaps LbNA had similar issues as well (I'm not familiar with the code or server to know what sort of changes might be required on that end of things). I still like the idea of seeing AQ show up in the address bar when someone types in "letterboxing.org" and have LbNA show up when someone types in "atlasquest.com", but it's probably a bad idea from a technical level....

Instead of that, we just redirected the first page hits to each other's website. Much much less technical and less risky thing to do. Although not easy enough, as it seems, since we'd been trying to fix problems with the prank pretty much the entire first half of the day. Stupid incorrect redirects and unexpected side-effects.... It didn't help that were in different time zones either. But hey, at least we got it right eventually. =)

I'd also like to thank Wassa for my favorite new phrase whenever I make a change or update to Atlas Quest--regardless of how stupid or ill-thought out the update might be: This is implemented for the good of the hobby.

And thanks to everyone who uses either (or both!) of these websites and was willing to put up with our shenanigans for the day! =)