Ed's Big Plans

Computing for Science and Awesome

I’m bringing back my site

without comments

So much has changed in the last five years.

I’ve finished all of the requirements needed to graduate earlier this year. I’ve decided it’s time to bring my site back, and populate it with the coolest stuff I learned in the last few years.

Eddie Ma

April 8th, 2018 at 8:41 am

Posted in Life

On SSL/TLS and HTTPS — Briefings for my Computer Security class

featured post

with 2 comments

Brief: This is a technical briefing I made for fellow students in a Computer Security class (Winter 2011) about Secure Socket Layer [SSL] (now Transport Layer Security [TLS]). These briefings fit in nicely since it came after Dr. Obimbo explained the number theory behind RSA (modulus prime exponentiation). I went to the primary source on this topic to write this document: thanks to the Internet Engineering Task Force. I’ve posted this document as a consumable reference for anyone who needs it.

>>> Download: A Network Security Spotlight on SSL/TLS and HTTPS (pdf) <<<

Figure $_: A Schematic of the SSL/TLS Handshaking Procedure.

This document is licensed under Creative Commons Attribution 3.0 Unported. The enclosed figures are further released into the public domain.

Eddie Ma

February 16th, 2012 at 1:29 pm

SoCS Grads’ very first Wine & Cheese! (W2012)

featured post

without comments

Brief: Well, I’ve organized the first Wine & Cheese for the School of Computer Science graduate students slated for next week (University of Guelph). I had significant moral support from Richard Schwarting and Jason Ernst. We’re hoping for a turnout of about thirty including faculty and staff. I’m particularly proud of the logo I made.

I think we’ll have an excellent turn out — Richard and I did advertise as much as humanly possible after all 😀

Eddie Ma

February 11th, 2012 at 12:09 am

Fuzzy c-means for greylevel image segmentation

featured post

without comments

Here’s a script I threw together to do grey-level segmentation using fuzzy c-means. This appeared as a small part of a project in the image processing course I took. The algorithm deployed was really a proof of concept meant to replicate and verify the results of another author — as such, I don’t recommend ever using fuzzy c-means for this task as it’s pretty inefficient. This software will handle any number of grey-level-segments you desire, but I recommend eight as a maximum.

The code and course project paper are originally dated April 20th, 2011.

>>> Download: FCMProjectPaper.pdf | FCMProject.tgz <<<

( Requires pypng — Python PNG encoder/decoder )

Here are the examples included in the above archive. I like pictures.

Sunny in 8-bit greyscale, 3-bit greyscale, 2-bit greyscale.

Auryo in 8-bit greyscale, 3-bit greyscale, 2-bit greyscale.

Enjoy 😀

Eddie Ma

December 20th, 2011 at 11:21 pm

A Tessellation (1-, 2-, 3- unit length edges)

without comments

Here’s a neat tiling I saw on the ground recently.

A plantless pot.It's Lucky! :DThe ground.

This tiling happens to be a solution that ensures that graph nodes are regularly spaced 1-, 2-, or 3- unit lengths apart.

1-, 2-, 3- units.

If we re-orient all of the tiles in the same direction, the nodes then become two unit lengths apart — and the graph becomes homomorphic with a hexagonal tiling.

2-, 2-, 2- units.1-, 1-, 1- unit.

I’ll let you know if I find an application to the 1-, 2-, 3- hop pattern.

Eddie Ma

February 18th, 2013 at 6:56 pm

Posted in Algorithms

Tagged with , , ,

Fighting spam account registration (phpBB3)

with 3 comments

I was asked to deploy a means to fight spam account registration on a phpBB3 installation. I tried the advice posted by Nadav Samet, but the version of phpBB3 we use doesn’t seem to respond to changes made to profile_add_body.tpl. I settled on an approach that’s similar to the one posted by Steve Maury, but is slightly improved as you can request any exact string for an answer from the registrant.

This method should work with phpBB3 version 3.0.x.

This method results in a mandatory field to be completed by the registrant during registration time. You can assign it any question you like where the answer is a string of text that you decide. I’ve given a really simple question in this example. Use a more difficult question that a bot would have trouble with but that your typical registrants can answer.

We do this with a custom profile field in the registration screen as in the below screen capture.

The above is a screen capture of an example mandatory question (choose a more secure question).

There are two steps to setting this up.

First, set up a custom question that must be answered — you can find such a setting in the administrative control panel (ACP) as in the following screen capture.

Add a mandatory question in user and groupscustom profile fieldscreate new field.
Here, I’ve named mine guelph_question.

After you click Create new field, you will be presented with a screen where you can create the question of your choosing — be sure to make the field mandatory by using the radio button labelled Required field listed under Visibility options.

Second, add the following code indicated below in includes/ucp/ucp_register.php — Notice that I’ve placed my custom code after existing code to check for a valid password and e-mail. This is commented under validate custom profile fields ( — just checked — starts at line 247 in the 3.0.9 source code). Replace the simple question and answer I’ve placed there with your own question and answer. Notice that you also have full control over the error message that the registrant sees if they answer the question incorrectly.

// validate custom profile fields
$cp->submit_cp_field('register', $user->get_iso_lang_id(), $cp_data, $error);

if (!sizeof($error))
	if ($data['new_password'] != $data['password_confirm'])
		$error[] = $user->lang['NEW_PASSWORD_ERROR'];

	if ($data['email'] != $data['email_confirm'])
		$error[] = $user->lang['NEW_EMAIL_ERROR'];

// Anti-spam code below ...
if (!sizeof($error)) {
	if (!isset($_POST['pf_guelph_question']) ||
	$_POST['pf_guelph_question'] != 'Gryphon') {
		$error[] = 'Incorrect answer to Guelph question.';
// ... EOAnti-spam code

And you’re done.

I hope this works for you! Enjoy 😀

Eddie Ma

December 29th, 2011 at 4:49 pm