Ian Cordasco

What is wanted is not the will to believe, but the will to find out, which is the exact opposite.
Bertrand Russell

I am privileged to be a very active member of the Open Source Community. I contribute mostly to the Python ecosystem but love Ruby and Clojure. You can find a (probably dated) list of projects that I work on below. I have a Bachelor’s and Master’s in Pure and Applied Mathematics from Stevens Institute of Technology and I love to ride bicycles.

Colophon

I am a fairly private person living in an increasingly anti-private world. Some may contend that I have nothing to hide, but I disagree. Our private lives and personal information are some of the most valuable objects to advertisers, corporate underwriters or whatever you might prefer to call them. I’m not comfortable with websites claiming that they will anonymize my information before they sell it to advertisers. Social networking sites and non-social networking sites alike are able to discover enough information that a person may be re-identified. It concerns me that we live in a world where it seems futile to preserve our rights.

Contact

To contact me, you may use any of the following samples of code to derive my email address.

Basic C using only string manipulation:

#include <stdio.h>
#include <string.h>

int main(int argc, char **argv){
    char *url = "http://www.coglib.com/~icordasc/";
    char email[22];

    memset(email, 0, 22);

    if (!strncpy(email, url + 23, 8)) {
        puts("Cannot copy the username.\n");
        return 1;
    }

    email[8] = '@';

    if (!strncat(email, url + 11, 10)) {
        puts("Cannot copy the domain.\n");
        return 1;
    }

    email[21] = '\n';
    puts(email);
    return 0;
}

C using linux’s (gcc’s) regular expression library:

#include <sys/types.h>
#include <regex.h>
#include <string.h>
#include <stdio.h>

void die(char *prefix, char *msg){
    puts(prefix);
    puts(msg);
    puts("\n");
}

int main(int argc, char **argv){
    regex_t regex;
    regmatch_t matches[5];
    int error, len;
    char pattern[] = ".*\\.(\\w+\\.\\w+)/~(\\w+)";
    char coglib[] = "http://www.coglib.com/~icordasc/";
    char string[80];
    
    memset(string, 0, 80);

    if ((error = regcomp(&regex, pattern, REG_EXTENDED))) {
        regerror(error, &regex, string, 80);
        die("Compilation error: ", string);
        return 1;
    }

    if ((error = regexec(&regex, coglib, 5, matches, 0))) {
        regerror(error, &regex, string, 80);
        die("Execution error: ", string);
        return 1;
    }

    len = matches[2].rm_eo - matches[2].rm_so;
    if (!strncpy(string, coglib + matches[2].rm_so, len)) {
        die("Cannot copy username.", "");
        return 1;
    }

    if (!strcat(string, "@")) {
        die("Cannot append '@'.", "");
        return 1;
    }

    len = matches[1].rm_eo - matches[1].rm_so;
    if (!strncat(string, coglib + matches[1].rm_so, len)) {
        die("Cannot copy domain.", "");
        return 1;
    }

    puts(string);
    return 0;
}

Python using regular expressions:

#!/usr/bin/env python

from re import sub

print(sub('.*\.(\w+\.\w+)/~(\w+).*', '\g<2>@\g<1>',
          'http://www.coglib.com/~icordasc/'))

Simple bash script using sed:

#!/bin/bash

echo "http://www.coglib.com/~icordasc/" | \
    sed -r 's|.*\.(\w+\.\w+)/~(\w+).*|\2@\1|'

Simple bash script using the translate (tr) program:

#!/bin/bash

echo 'VPBEQNFP@PBTYVO.PBZ' | tr [A-Z] [n-za-m]

Ruby script using regular expressions:

#!/usr/bin/env ruby

puts "http://coglib.com/~icordasc".sub(%r|.*//(\w+\.\w+)/~(\w+)|,
                                       '\2@\1')

How to find my email using clojure:

(ns print-email
  (:require [clojure.string :refer [replace]]))

(def email
  (replace "http://coglib.com/~icordasc"
           #"\w+://([^/]+)/~(\w+)$"
           "$2@$1"))

(println email)