2024 π Daylatest newsbuy art
In your hiding, you're alone. Kept your treasures with my bones.Coeur de Piratecrawl somewhere bettermore quotes
very clickable

fun + amusement

Email, link and text protector

proven to lower incidence of spam

The Email, Link and Text Protector encodes any text into entity syntax. The output is meant to be used in a web page, in order to make it more difficult for spam-harvesting spiders to extract the original content. The encoder was originally designed to be used on email addresses. It is not impossible to harvest emails encoded with this method - just slightly more difficult.

The principle is simple. Characters are encoded using the entity syntax &#xxx; where xxx is the numeric ASCII value for a character. For example abc would encode to a b c. You can find more information about character encoding at w3.org.

This script will do the same thing as the email encoder (which I discovered through Jim Kent's wife's, Heidi, web site). The email protector here has these additional enhancements.

  • we (umm, I mean I) will never share, give out, or sell your email address to anyone,
  • you can adjust the hide ratio - the fraction of characters in your text that are encoded,
  • the base used for encoding is can be randomly varied, switching between decimal and hexadecimal encoding (e.g. "a" can be a or a),
  • the padding length of the encoding can be randomized for each character (e.g. A, A, A), and finally

By using a hide ratio less than 1, some characters are left unencoded. This results in a partially encoded text which may foil harvesting spiders which look for text which is fully encoded. By switching the encoding between hex and dec for each token it is possible to make parsing more difficult.

Encode Text

encoded text

text to encode

hide ratio (fraction of characters to be encoded)
randomize between dec and hex encoding
randomize encoding padding length

Encoding Results

original string
http://www.bcgsc.ca

encoded text (seen by browser)
http://www.bcgsc.ca

encoded text (used in a link)
http://www.bcgsc.ca

encoded text (raw)
http://www.bcg sc.ca

Code

Perl subroutine to encode a single character.

sub encode {
    my $token = shift;
    my $randompad = shift;
    my $randombase = shift;
    my $MAXPAD = 3;
    my $ord = ord($token);
    my $format;
    my $format_prefix = "&#";
    my $format_digit  = "%d";
    my $format_suffix = ";";
    # random padding
    if ($randompad) {
	my $thispad = int(rand($MAXPAD));
	$format_digit = sprintf("%%0%dd",3+$thispad) if $thispad;
    }
    # switch base
    if ($randombase && rand() < 0.5) {
	# we want hex encoding now
	$format_digit =~ s/d/x/;
	$format_prefix = "&#X";
    }
    $format = sprintf("%s%s%s",$format_prefix,$format_digit,$format_suffix);
    return sprintf($format,$ord);
}
news + thoughts

Nasa to send our human genome discs to the Moon

Sat 23-03-2024

We'd like to say a ‘cosmic hello’: mathematics, culture, palaeontology, art and science, and ... human genomes.

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
SANCTUARY PROJECT | A cosmic hello of art, science, and genomes. (details)
Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
SANCTUARY PROJECT | Benoit Faiveley, founder of the Sanctuary project gives the Sanctuary disc a visual check at CEA LeQ Grenoble (image: Vincent Thomas). (details)
Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
SANCTUARY PROJECT | Sanctuary team examines the Life disc at INRIA Paris Saclay (image: Benedict Redgrove) (details)

Comparing classifier performance with baselines

Sat 23-03-2024

All animals are equal, but some animals are more equal than others. —George Orwell

This month, we will illustrate the importance of establishing a baseline performance level.

Baselines are typically generated independently for each dataset using very simple models. Their role is to set the minimum level of acceptable performance and help with comparing relative improvements in performance of other models.

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
Nature Methods Points of Significance column: Comparing classifier performance with baselines. (read)

Unfortunately, baselines are often overlooked and, in the presence of a class imbalance5, must be established with care.

Megahed, F.M, Chen, Y-J., Jones-Farmer, A., Rigdon, S.E., Krzywinski, M. & Altman, N. (2024) Points of significance: Comparing classifier performance with baselines. Nat. Methods 20.

Happy 2024 π Day—
sunflowers ho!

Sat 09-03-2024

Celebrate π Day (March 14th) and dig into the digit garden. Let's grow something.

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
2024 π DAY | A garden of 1,000 digits of π. (details)

How Analyzing Cosmic Nothing Might Explain Everything

Thu 18-01-2024

Huge empty areas of the universe called voids could help solve the greatest mysteries in the cosmos.

My graphic accompanying How Analyzing Cosmic Nothing Might Explain Everything in the January 2024 issue of Scientific American depicts the entire Universe in a two-page spread — full of nothing.

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
How Analyzing Cosmic Nothing Might Explain Everything. Text by Michael Lemonick (editor), art direction by Jen Christiansen (Senior Graphics Editor), source: SDSS

The graphic uses the latest data from SDSS 12 and is an update to my Superclusters and Voids poster.

Michael Lemonick (editor) explains on the graphic:

“Regions of relatively empty space called cosmic voids are everywhere in the universe, and scientists believe studying their size, shape and spread across the cosmos could help them understand dark matter, dark energy and other big mysteries.

To use voids in this way, astronomers must map these regions in detail—a project that is just beginning.

Shown here are voids discovered by the Sloan Digital Sky Survey (SDSS), along with a selection of 16 previously named voids. Scientists expect voids to be evenly distributed throughout space—the lack of voids in some regions on the globe simply reflects SDSS’s sky coverage.”

voids

Sofia Contarini, Alice Pisani, Nico Hamaus, Federico Marulli Lauro Moscardini & Marco Baldi (2023) Cosmological Constraints from the BOSS DR12 Void Size Function Astrophysical Journal 953:46.

Nico Hamaus, Alice Pisani, Jin-Ah Choi, Guilhem Lavaux, Benjamin D. Wandelt & Jochen Weller (2020) Journal of Cosmology and Astroparticle Physics 2020:023.

Sloan Digital Sky Survey Data Release 12

constellation figures

Alan MacRobert (Sky & Telescope), Paulina Rowicka/Martin Krzywinski (revisions & Microscopium)

stars

Hoffleit & Warren Jr. (1991) The Bright Star Catalog, 5th Revised Edition (Preliminary Version).

cosmology

H0 = 67.4 km/(Mpc·s), Ωm = 0.315, Ωv = 0.685. Planck collaboration Planck 2018 results. VI. Cosmological parameters (2018).

Martin Krzywinski | contact | Canada's Michael Smith Genome Sciences CentreBC Cancer Research CenterBC CancerPHSA
Google whack “vicissitudinal corporealization”
{ 10.9.234.151 }