WeinbergAlpha: DuckDuckGoes opensource with its WolframAlpha integration
weinbergalpha.com
weinbergalpha.com
my %holidays = (
'mlk day' => undef,
...
);
exists $holidays{$query}
It's better to use a set: my $holidays = Set::Object->new('mlk day', ...);
$holidays->exists($query);
This generalizes to arbitrary objects, and is faster.Also, I'm totally declaring a new holiday: "milk day".
I agree that defining the hash the "old fashion way" may be wordy but what I like about wordy things is they are usually easier to understand. Those looking at the wordy code will have one less thing to learn, which will translate into faster learning.
Another thing that I like about wordy is it tends to make porting to other languages a lot easier. For example, one of the tools that I had written in Perl was translated to Javascript with fair ease because I stucked with the basics.
I personally find that being wordy is a good thing instead of a bad thing. Obviously there is a point where not accepting change or wanting to learn a new trick is just being ignorant though.
I disagree. Using a set to represent a set is more readable than using hash keys to stand in as a set. As it stands, the hash maps values in the set to undef, and maps values outside the set to undef. This is confusing. Confusion translates to slow knowledge uptake.
Don't try to jam a square peg into a round hole when you have a round peg in your other hand.
In addition, I've noticed many people use Google for anything they want. My mom found her email by googling for "email" if the search terms ever change... she wouldn't know how to get to it. I would love to have it so if my mom already has an account on my site (which has a record of her kitchens inventory) she could search for "recipes" and in the zero click box would be a listing, but customized just for her.
So if any one has any implementation ideas, I'm ready!