Finding a Partitioning Algorithm
Group-By is a beautiful Clojure function which takes a collection and groups it into a map of results based on a grouping function:
Postgres: Email Parsing using perl
This function extracts the real name from an email address. With slight variations, other components such as local part or host name can be extracted. Relying on a well-tested Perl module makes this function extremely robust, compared to say handcrafted pattern-matching approaches.
CREATE OR REPLACE FUNCTION email_name(email text) RETURNS text LANGUAGE plperlu AS $$ use Email::Address; my @addresses = Email::Address->parse($_[0]); return undef unless scalar(@addresses) > 0; return $addresses[0]->name; $$;
URI data type for PostgreSQL
This is an extension for PostgreSQL that provides a
uri
data type. Advantages over using plaintext
for storing URIs include:
- URI syntax checking
- functions for extracting URI components
- human-friendly sorting
The actual URI parsing is provided by the uriparser library, which supports URI syntax as per RFC 3986.
What are Dimensions and Measures: Education as Promotion
Businesses can fulfill an educational need, and in doing so, promote their business.
In this video, Intricity provides a nice tutorial on the role of measures and dimensions in business intelligence.