7 Oct 2011

GEMP (Medicine) at Wits - How to not get accepted

 June 2017 Update: "Based on general comments I have received over the years I would like to explicitly state the point of this article up front: Don't let anyone tell you that you can just keep going through the motions, ticking boxes and that you will eventually get into medicine by trying for long enough (or for having enough passion) - There is a high chance that things will not work out and you will probably be left at least a little bitter about the outcome. In addition to this, I would like to draw specific attention to the fact that I do not make any reference to race in this post or any of my comments related to this post."

Johannesburg, South Africa 

First attempt
  • Start by nurturing a passion to become a doctor for as long as you can remember
  • Add a natural aptitude for science and technology
  • Participate (and perform well) in sport (first team rugby), cultural activities (play the piano from age 7) and academics at school (and be a prefect)
  • Get a basic first aid certificate
  • Donate spare time to volunteer work in hospitals and clinics
  • Complete an IEB matric at a Jo'burg private school with results that are good enough to be offered a place in electrical engineering (where the academic entry requirements are higher than for medicine)
  • Apply for entry into first year medicine at Wits Medical School (2001)
Second attempt
  • Complete a Bachelor of Science degree in human anatomy and physiology at the University of the Witwatersrand
  • Make special arrangements to complete a basic life support (BLS) training course from the American Heart Association (this course is run for qualified healthcare professionals) - Get higher test results than qualified healthcare professionals who are on the course with you
  • Continue volunteer work at a christian primary healthcare clinic
  • Make rural hospital visits with an old (practicing) professor of surgery
  • Apply for entry into the Graduate Entry Medical Programme (GEMP) at Wits Medical School with a respected surgeon as your referee (2004)
Third attempt
  • Accept an offer to join the experimental physiology honours class at Wits Medical School
  • Contribute to the medical research community by collecting cardiovascular data that is published in the American Journal of Physiology
  • Help second year medical students in physiology lab tutorials (one of  whom didn't know what diarrhoea is and another who was repeating second year medicine for the 3rd time - painful, but true stories)
  • Apply for entry into GEMP at Wits Medical School again, this time with an A rated physiology Professor as your referee (2005)
  • Get excited when you are short listed for an interview
  • Mention that you want to "help people" during the interview
  • Have the dean of student affairs warp your answers and talk over you for the remainder of the 'interview'
Move on
  • Reinvent yourself
  • Get on with life in a completely different field, continue to "help people" in other ways and don't feel too bad that the only thing you've really sucked at so far (in spite of a rather wasted medical background), is getting in to study medicine at Wits Medical School...

31 Jul 2011

Jebo R338 Tank with Comet Goldfish

So I've decided to try something different and swop out my usual tropical fish for a few goldfish - 3 comet goldfish to be precise. I'm using my current Jebo R338 setup, minus the heater and I've added an air pump with an airstone for a nice bubble effect. I haven't needed to modify anything else and the new goldfish seem to manage just fine with the current created by the powerhead.

The Jebo R338 actually makes for a superb, low maintenance goldfish setup. I'm really enjoying the brilliant (goldy) red of the comet goldfish and they have more presence than tropical fish I have had in this tank before. They are also very active little chaps, so a lot of fun to watch!

26 Jul 2011

Latest blog post title in email signatures

I put a PHP image script together that reads the latest title from any RSS feed and creates a .gif image that contains this title. So the image can be placed anywhere once off and it will automatically update with the latest RSS feed title as new content is published. The image could be embedded in an html email signature for instance and the title of your most recent blog post will automatically be appended to all your outgoing email. I'm sure there are other uses for this code as well - It requires PHP and cURL and can be tweaked to accommodate different requirements, just be sure to go through the code and update your RSS feed URL (line 18), copy the font(s) you would like to use (lines 39,40) to the same directory as the script and perhaps change the text colours ~line 90 and anything else as you need to.

Embed the image with this image tag:

<img src="http://yoursite.com/latest-blog-post-rss-image.php" alt="http://yoursite.com/blog" border="0" />

Include a link to the front page of your blog to make the title clickable:

<a href="http://yoursite.com/blog"><img src="http://yoursite.com/latest-blog-post-rss-image.php" alt="http://yoursite.com/blog" border="0" /></a>

Here is the code for latest-blog-post-rss-image.php

<?php

//Parse text block for value near search defined by offset and length / end tag
function parse($block,$search,$offset,$length,$endtag="") {
$start = strpos($block,$search) + $offset;
$end = $start + $length;
$value = substr($block, $start, $end - $start );
if ($endtag != "") {
$value = substr($value,0,strpos($value,$endtag)-(strlen($endtag)));
}
if ($start == 0) {
$value = "";
}
return $value;
}

//RSS feed to get title from
$rss = "http://yoursite.com/rss.xml";

//read the RSS feed using cURL
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $rss);
$result = curl_exec ($ch);
curl_close($ch);

//extract the first (and latest blog title)
$title = parse($result,"<item>",0,300,"<link>");

//trim the title and extract html tags
$title = strip_tags($title);
$title = trim($title);

//set image fonts and positioning
$size = 7.5;
$labelsize = 7.5;
$font = 'arialbd.ttf';
$labelfont = 'arial.ttf';
$x = -1;
$y = 10;
$angle = 0;
$label = "Latest blog post: ";

//Get an array of rss title words to facilitate word wrap
$words = explode(" ",$title);

//Force the image to word wrap around this approximate length (pixels)
$labellength = imagettfbbox($labelsize, 0, $labelfont, $label);
$maxlength = 350 - $labellength[4];
$line1length = $labellength;
$line1 = "";
$line2 = "";

foreach ($words as $word) {
if ($line1length[4] < $maxlength) {
$line1 .= $word . " ";
$nextword = $line1 . $word;
$line1length = imagettfbbox($size, 0,$font, $nextword);
} else {$line2 .= $word . " ";}
}
$line1 = trim($line1);
$line2 = trim($line2);

//determine image dimensions based on rss title length and including the label text
$line1length = imagettfbbox($size, 0, $font, $line1);
$line2length = imagettfbbox($size, 0, $font, $line2);

$totallength = $labellength[4] + $line1length[4];

//Set the image height for 1 line or 2 lines
if ($line2 == "") {
$height = 12;
} else $height = 24;

//set canvas dimensions (based on blog post length) and height
$gif = imagecreatetruecolor($totallength+1, $height);

//set background colour to white
$white = imagecolorallocate($gif, 255, 255, 255);

//fill image with white background and set as transparent
imagefill($gif, 0,0, $white);
imagecolortransparent($gif, $white);

//Print rss title onto image if it's not blank for some reason...
if ($title != "") {

//set text colors R,G,B
$text_color = imagecolorallocate($gif, 255, 149, 6);
$label_color = imagecolorallocate($gif, 0, 5, 85);

//Print blog post label into image
ImageTTFText($gif, $labelsize, $angle, $x, $y, $label_color, $labelfont, $label);

//Print blog post line 1 title into image
ImageTTFText($gif, $size, $angle, $x+$labellength[4], $y, $text_color, $font, $line1);

//print link underline
ImageLine($gif, $totallength, $y+1,$labellength[4]-1,$y+1, $text_color );

if ($line2 != "") {

//Print blog post line 2 title into image
ImageTTFText($gif, $size, $angle, $x+1, $y+12, $text_color, $font, $line2);

//print link underline
ImageLine($gif, 0, $y+13,$line2length[4],$y+13, $text_color );


}
}

//output blog post title image
header("Content-type: image/gif");
imagegif($gif);
imagedestroy($gif);
?>

14 Apr 2011

Send HTML email with an attachment from PHP

It took me a painfully long time to find a PHP script that could send multi-part email (with plain text / fancy HTML body content) and an attachment that actually worked! But I have adapted this excellent script to suit my needs (excluding output buffering). So reposting it mostly for my own reference... hopefully it can help some other poor sods out too.


<?php

$htmlbody = "This is an <b>html</b> message";
$textmessage = "This is a plain text message";

//Set Recipient Address
$to = "recipient@domain.com";

//Set Email Subject
$subject = "HTML email with attachment";

//define the from \ reply to headers
$headers = "From: yourname@domain.com\r\nReply-To: yourname@domain.com";

//create a unique boundary string to delimit different parts of the email (plain text, html, file attachment)
$random_hash = md5(date('r', time()));

//add boundary string and mime type specification
$headers .= "\r\nContent-Type: multipart/mixed; boundary=\"PHP-mixed-".$random_hash."\"";

//read the atachment file contents into a string,
//encode it with MIME base64,
//and split it into smaller chunks for sending
$attachment = chunk_split(base64_encode(file_get_contents('attachment.zip')));

//define the body of the message.
$message = "--PHP-mixed-$random_hash\r\n"
."Content-Type: multipart/alternative; boundary=\"PHP-alt-$random_hash\"\r\n\r\n";
$message .= "--PHP-alt-$random_hash\r\n"
."Content-Type: text/plain; charset=\"iso-8859-1\"\r\n"
."Content-Transfer-Encoding: 7bit\r\n\r\n";

//Insert the plain text message.
$message .= strip_tags($textmessage);
$message .= "\r\n\r\n--PHP-alt-$random_hash\r\n"
."Content-Type: text/html; charset=\"iso-8859-1\r\n"
."Content-Transfer-Encoding: 7bit\r\n\r\n";

//Insert the html message.
$message .= $htmlbody;
$message .="\r\n\r\n--PHP-alt-$random_hash--\r\n\r\n";

//include attachment
$message .= "--PHP-mixed-$random_hash\r\n"
."Content-Type: application/zip; name=\"attachment.zip\"\r\n"
."Content-Transfer-Encoding: base64\r\n"
."Content-Disposition: attachment\r\n\r\n";
$message .= $attachment;
$message .= "/r/n--PHP-mixed-$random_hash--";

//send the email
$mail = mail( $to, $subject , $message, $headers );

if ($mail) {
echo "Mail sent!";
} else "Mail not sent!";

?>

22 Mar 2011

Home made mouse trap for a live catch

We had a little guest move into the kitchen the other night. A house mouse was living up in the base of the fridge and my first thought was poison, but after chatting with my wife, I decided to try something more humane.

This home made setup requires:
  • A plastic bucket or bin that is about 50cm deep
  • kebab stick (or similar)
  • Paper
  • and peanuts (the bait)

Set the trap for a live catch:
Suspend the paper over the bin using the kebab stick as precariously as possible. Then place a few peanuts on the paper at the side furthest from approach. Make sure there is no other food around to cause distraction and then vacate the area.

We decided to use peanuts and raisins since the little chap had already exposed his desires by chewing at the bag while it was on the counter the night before. I set the trap at the edge of a stool in the kitchen so that the mouse would have access to the top of the bin. He must have been hungry because I saw him scouting the kitchen while we were still up and the light was even on. But it didn't take long before we heard a small crash and the mouse was caught!

I relocated the little fella to the back garden where he dashed into the safety of the bushes. I know there's a chance he'll be back for more peanuts but we'll see I guess...