Given the list of categories and sub-categories:

CatA    SubCatA
CatA    SubCatA
CatB    SubCatB
CatB    SubCatB
CatC    SubCatC
CatC    SubCatC

I'd like to return all unique main categories based on the secondary category.

I don't want to use:


as it's returning the list with duplicates (returning first element won't help either).

What I'm trying is:


but it gives me the error: CANNOT_GROUP_WITHOUT_AGG, therefore I'm trying to find something equivalent to either DISTINCT(A) or UNIQUE(A), but these functions doesn't exist.

Is there any function in Google Visualization API Query Language equivalent to DISTINCT/UNIQUE to return list of unique values?

If I have the following in play:

  • Urborg, Tomb of Yawgmoth

    Each land is a Swamp in addition to its other land types.

  • Kormus Bell

    All Swamps are 1/1 black creatures that are still lands.

  • Torpor Orb

    Creatures entering the battlefield don't cause abilities to trigger.

And I play Dark Depths:

Dark Depths enters the battlefield with ten ice counters on it.

{3}: Remove an ice counter from Dark Depths.

When Dark Depths has no ice counters on it, sacrifice it. If you do, put a legendary 20/20 black Avatar creature token with flying and indestructible named Marit Lage onto the battlefield.

What I am hoping happens is: The Urborg makes my Dark Depths also a swamp, so Kormus Bell makes it a creature, so then Torpor Orb makes its comes into play ability not trigger, so the Dark Depths will not enter play with any counters, allowing me to immediately sacrifice for 20/20 Marit Lage. Any reason that would not work?

I have found this sentence in a text book so I suppose it's correct, but I'm a bit confused. I thought that when the verb "need" is used as a modal verb it must be followed by a verb in base form.

Why are people more likely to buy articles with a price of \$199, rather than the same (or let's say a slightly better) article for \$200?

On which human brain centre is this advertising focused? Is this some kind of manipulation?

The Man From Earth (2007) was really a good movie but what I quite didn't understand the end, why does Dr. Gruber die at the end and did it prove that John was God?

The task is simple: your program reads an integer as an input, and prints whether it is a prime or not. You can print "yes/no", "true/false" or anything what unambiguously identifies the result.

The challenge is, the code has to work with its rows and columns transposed.

To exclude the obvious solution (shortest "simple" solution repeated vertically char-by-char with the use of comments), the metric is a little bit different from the usual code-golf:

Because formatting is very important in this challenge, the code size is measured in the area of the smallest rectangle the code fits in. In other words, whitespace does count, and the lines should be filled to be of equal length (you don't have to actually do it when you post the solution, for simplicity's sake). For example

int main()   
    return 0;

would have a size of 4*13 = 52, (and obviously it does not fit either of the two criteria: prime detection and transposable.)

Smallest size wins.

You can use any language, and any library function except if the sole purpose of that function is to find, generate, or detect primes.


While the winner would probably be the Golfscript solution, I'll award a 50 point bounty for the best C or C++ solution!

I'm experimenting a little with Automator at the moment and often get stuck with some pre-recorded automation running very slowly while the whole Mac (an 2010 iMac in my case) doesn't respond to any input - either by keyboard or mouse.

For now I connect via SSH from another machine and issue a killall Automator to get controls back.

Is there any solution available which enables me to halt / freeze a Mac and issue commands using a terminal? seems to be the largest and most reliable source of unprocessed field recordings (with a good share of pitch-shifted monster sounds too). I struggle to find alternatives of comparable size and quality.

What other databases exist? (I am especially interested in free/open databases with CC licenses, that may be used for R&D, rather than commercial ends)

Looking at the MBtiles spec, the tile_data field of the tiles table is just a blob of a tile image.

With this information, I expected to be able to take a data URI, string it of everything except the base64 encoded string, and decode it for storage in the tile_data field.

For instance:

var dataURI = "data:image/jpeg;base64,[some_encoded_data]";
var unencodedBytes;
if (dataURI.split(',')[0].indexOf('base64') >= 0) {
    unencodedBytes = atob(image.split(',')[1]);
} else {
    unencodedBytes = unescape(dataURI.split(',')[1]);

At this point, my unencodedBytes variable should have raw jpeg image data, and as such, I should be able to insert it into a tile_data field, correct? Is there an additional step I need to take? The data looks like belongs there, based off my observations of other valid mbtiles files, however all the mbtiles viewers I try to view this either do not show the data, or say they cannot figure out what type of data it is (jpeg or png).

What am I doing wrong? This is all being run in javascript in a browser, and I am using WebSQL to create the mbtiles file, since it is (supposedly) compatible.

Thanks in advance

It seems like no matter how carefully I wind up my mic cables, the next time I get them out I'm fighting tangles and knots. And untangling mic cables is not one of my favorite things to do in front of a client.

How should I wind (or perhaps unwind) mic cables to prevent this?