#! /usr/bin/perl
# 
# $Id$
# Resume page Perl template.
# Copyright (C) 2003 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; exactly version 2 of June 1991 is required
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA


package resume::ResumeJanKratochvil;
require 5.6.0;	# at least 'use warnings;' but we need some 5.6.0+ modules anyway
use vars qw($VERSION $CVS_ID);
$VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; };
$CVS_ID=q$Id$;
use strict;
use warnings;

BEGIN{ open F,"Makefile"; our $top_dir=pop @{[split /\s/,(grep /^top_srcdir/,<F>)[0]]}; eval "use lib '$top_dir'"; close F; }
use My::Web;
require CGI;
require Crypt::Rot13;
Wrequire 'My::Project';


my $W=My::Web->init(
		"__PACKAGE__"=>__PACKAGE__,
		"title"=>"Resume",
		"section"=>"Resume",
		"heading"=>0,
		"footer"=>0,
		"head_css"=>"
td { vertical-align: top; }
table { border-collapse: collapse; border-style: solid; border-width: 1px; margin: 8px; }
A[href] { text-decoration: inherit; /* revoke underline */ }
A[href].project { text-decoration: underline; }
.platform { font-style: italic; white-space: nowrap; }
table.referees td.com { text-align: center; }
.techs { white-space: nowrap; }
caption  { caption-side: top; }
table.jobs td { padding: 1ex; }
",
		"args_check"=>{
				"referees"=>'',	# Do not bother with '^(?:(?i)referees)?$'
				"print"=>'^(?:print)?$',
				},
		);
My::Web->heading();


my %item=( My::Project::item_hash_read() );
my @itemnames=sort {
		($item{$b}{"priority"} <=> $item{$a}{"priority"})
		or (lc($item{$a}->{"name"}) cmp lc($item{$b}->{"name"}));
		} keys(%item);

my $projectref=sub
{
my($name)=@_;

	return a_href "/project/$name/",$item{$name}{"name"},"attr"=>'class="project"';
};

my $project=sub
{
my($name,%args)=@_;

	my $r=&{$projectref}($name);
	if (!$args{"bare"}) {
		my $summary=$item{$name}{"summary"};
		$summary=~s#(?:<a\s[^>]*>|</a>)##gi;	# if $args{"unhref"};
		if (!$args{"parenthesis"}) {
			$r.=": $summary";
			}
		else {
			$r.=" ($summary)";
			}
		}
	return $r;
};

my $free_projects=sub (@)
{
my(@platforms)=@_;

	my $r="";
	$r.=join ", ",map({ my $platform=$_;
		map({ ($item{$_}{"sponsorship"} || $item{$_}{"trivia"}
				|| $item{$_}{"platform"} ne $platform ? () : (&{$projectref}($_))); } @itemnames);
		} @platforms);
	return $r;
};


my $reference=sub ($$)
{
my($mail,$fullname)=@_;

	my $r="";
	$r.='<td>';
		$r.=$fullname;
		if (lc($W->{"args"}{"referees"}) eq "referees") {
			my $rot13=Crypt::Rot13->new();
			$rot13->charge($mail);
			$mail=($rot13->rot13())[0];
			$r.=' &lt;'.a_href("mailto:$mail",$mail).'&gt;';
			}
	$r.='</td>';
	return $r;
};

sub techs ($)
{
my($arg)=@_;

	return '<span class="techs">('.$arg.')</span>';
}


my $uClinux=a_href 'http://www.uclinux.com/','uClinux';
my $mailme=(map({ a_href("mailto:$_",$_); } 'job@jankratochvil.net'))[0];
my $now=(localtime())[5]+1900;

print <<"HERE";
<table width="100%" style="border-style: none;"><tr><td align="center"><table>
<tr><td rowspan="10" style="padding: 10px; vertical-align: middle;">
				@{[ img "/resume/Resume-JanKratochvil","face" ]}</td>
		<td class="tab-head">Name    </td><td>Jan Kratochvil</td></tr>
<tr><td class="tab-head">English </td><td>technical: fluent, general: communicable</td></tr>
<tr><td class="tab-head">Born    </td><td>1979</td></tr>
<tr><td class="tab-head">Sex     </td><td>male</td></tr>
<tr><td class="tab-head">Status  </td><td>single</td></tr>
<tr><td class="tab-head">Licenses</td><td>motorcycle, car</td></tr>
<tr><td class="tab-head">eMail   </td><td>$mailme</td></tr>
<tr><td class="tab-head">WWW     </td><td>@{[ a_href('http://www.jankratochvil.net/') ]}</td></tr>
<tr><td class="tab-head">Resume  </td><td>@{[ a_href('http://www.jankratochvil.net/resume/') ]}</td></tr>
<tr><td class="tab-head">OpenPGP </td><td style="font-family: monospace;">@{[ a_href '/pgp-JanKratochvil.txt',''
		.'pub  1024D/44FC7632 2002-10-07 Jan Kratochvil &lt;pgp-44FC7632@jankratochvil.net&gt;<br />'
		.'sub  2048g/D9F5F44B 2002-10-07 [expires 2004-10-06]' ]}</span></td></tr>
</table></td></tr></table>

@{[ vskip "3ex" ]}

<p style="font-size: larger;">Looking for a fulltime job. Relocation around the world expected.</p>

@{[ vskip "3ex" ]}

<table border="1" frame="border" rules="rows" class="jobs">
<caption>Contractor Jobs</caption>
<tr><th>Date</th><th>Client</th>
		<th>Description</th></tr>
<tr><td>2002-2003</td><td class="com">- (freelance project)</td>
		<td>@{[ &$project('captive') ]} (14 months)<br />
			Project required analysing portions of 80MB+ i386 disassembly dumps of MS-Windows XP kernel and ntfs.sys
			to achieve the first binary compatible reimplementation of the required undocumented XP kernel subsystems.<br />
			Written @{[ &$project('TraceFS') ]} as native W32 kernel hooking driver for run-time analysis of the NT Cache Manager
			XP kernel subsystem.<br />
			GNU/Linux part required integration and extensions of
			@{[ a_href 'http://lufs.sourceforge.net/lufs/','LUFS' ]} (Linux Userland File System)
			to transparently connect the UNIX userland based MS-Windows kernel filesystem isolated by CORBA/ORBit interface.
		</td></tr>
<tr><td>2001-2002</td><td class="com">@{[ a_href('http://www.atspraha.cz/','Advanced Telecom Services') ]}</td>
		<td>Mobile technologies
			<ul>
				<li>MMS framework client via EuroTel GSM operator
						by technologies GSM MMS, Perl, XML, SOAP (3 months, still maintained)<br />
						Project included
						@{[ a_href "/etmms/",'pilot MMS Center debugging',"attr"=>'class="project"' ]} with
						Ethereal (@{[ a_href 'http://www.ethereal.com','external link' ]}), fixes of Ethereal
						(@{[ a_href '/project/etherealmmse/','1' ]}, @{[ a_href '/project/etherealwsp/','2' ]}).
						</li>
				<li>Multimedia EMS support implemented by @{[ &$project('gsmperl',"bare"=>1) ]}</li>
				<li>Implementation of protocol BIP (based on Nokia CIMD2 protocol) for GSM SMS Center direct communication
						by extending gnokii (@{[ a_href 'http://www.gnokii.org/','external link' ]})
						for EuroTel GSM operator (still in use)</li>
			</ul>
		</td></tr>
<tr><td>1999-2000</td><td class="com">@{[ a_href('http://www.suse.com/','SuSE') ]}</td>
		<td>@{[ &$project('surprise') ]} (15 months)<br />
			Project was completed as a team work. The code is based on Gnome technologies.
			As one of the subtasks to keep system bootability I implemented @{[ &$project('int13sniff',"bare"=>1) ]}
			to ease Microsoft boot loaders disassembly across partition modifications.
			</td></tr>
<tr><td>2001-2002</td><td class="com">@{[ a_href('http://www.readynote.com/','ReadyNote') ]}</td>
		<td>Mobile technologies for embedded devices
		<ul>
			<li>Completed debugging of gnokii (@{[ a_href 'http://www.gnokii.org/','external link' ]}) GSM software modem
					for Nokia 5190</li>
			<li>Port of gnokii and my @{[ &$project('mdsms',"parenthesis"=>1) ]} to embedded
					uClinux (@{[ a_href 'http://www.uclinux.org/','external link' ]})</li>
		</ul>
		</td></tr>
<tr><td>1999-2003</td><td class="com">@{[ a_href('http://www.jklabs.cz/','JKLabs') ]}</td>
		<td>System administration of GNU/Linux and FreeBSD, techsupport: GuestNET,
				@{[ a_href 'http://www.2m.dk/web/html_version/eclipse/eclipse.html','Eclipse' ]},
				@{[ a_href 'http://www.globaloop.com/','GlobaLoop' ]},
				@{[ a_href 'http://www.antlimited.com/products/fresco.htm','Fresco' ]}<br />
			Ad hoc technical support challenges such as i386 IRQ redirector,
			@{[ &$project('middleman',"parenthesis"=>1,"unhref"=>1) ]} or @{[ &$project('ssht',"parenthesis"=>1,"unhref"=>1) ]}.
		</td></tr>
<tr><td>2001     </td><td class="com">@{[ a_href('http://www.gtsgroup.cz/','GTS') ]}</td>
		<td>@{[ &$project('tac_plus') ]} (3 months)</td></tr>
<tr><td>1999     </td><td class="com">@{[ a_href('http://www.unicom-prague.cz/','Unicom') ]}</td>
		<td>Technical translations from English</td></tr>
<tr><td>1998-1999</td><td class="com">@{[ a_href('http://www.geoinvest.cz/','Geoinvest') ]}</td>
		<td>Mobile technologies, embedded devices
			<ul>
				<li>@{[ &$project('332') ]}</li>
				<li>Siemens M1 GSM modem daemon for GPS, client/server setup, remote GSM terminals</li>
			</ul>
		</td></tr>
<tr><td>1999     </td><td class="com">@{[ a_href('http://www.tencom.cz/','TENcom Trade') ]}</td>
		<td>Mobile technologies
			<ul>
				<li>@{[ a_href "/project/mdsms/","MobilDock SMS Tool","attr"=>'class="project"' ]}:
						SMS communication software for Digital UNIX (2 months)</li>
			</ul>
		</td></tr>
<tr><td>1998     </td><td class="com">@{[ a_href('http://www.elsa-online.org/',"European Law Students' Association") ]}</td>
		<td>@{[ &$project('step') ]}, requirement for fixes of
				@{[ a_href "/project/phphash/","PHP","attr"=>'class="project"' ]} and
				@{[ a_href "/project/pgsqlsubstr/","PostgreSQL","attr"=>'class="project"' ]}</td></tr>
<tr><td>1993-1996</td><td class="com">Profes J&amp;K</td>
		<td>PC assembly and customer service</td></tr>
<tr><td>1993     </td><td class="com">@{[ a_href('http://www.japhila.cz/index_en.htm','Japhila') ]}</td>
		<td>StampMan: Database application @{[ techs 'MS-DOS: Pascal, plainTeX' ]}</td></tr>
</table>

@{[ vskip "1ex" ]}

<table class="referees">
<caption>Contractor Jobs Referees (reversed chronological order)</caption>
<tr><td class="com">@{[ a_href('http://www.atspraha.cz/','Advanced Telecom Services') ]}</td>
		@{[ &{$reference}('zvpuny.ubenx(ng)ngfcenun.pm','Michal Horak') ]}</tr>
<tr><td class="com">@{[ a_href('http://www.readynote.com/','ReadyNote') ]}</td>
		@{[ &{$reference}('wcehrgg(ng)ernqlabgr.pbz','Jim Pruett') ]}</tr>
<tr><td class="com">@{[ a_href('http://www.jklabs.cz/','JKLabs') ]}</td>
		@{[ &{$reference}('wna.xbyne(ng)wxynof.pm','Jan Kolar') ]}</tr>
<tr><td class="com">@{[ a_href('http://www.gtsgroup.cz/','GTS') ]}</td>
		@{[ &{$reference}('Zvpunry.Znprx(ng)tgftebhc.pm','Michael Macek') ]}</tr>
<tr><td class="com">@{[ a_href('http://www.unicom-prague.cz/','Unicom') ]}</td>
		@{[ &{$reference}('erprcpr(ng)havpbz-centhr.pm','Valerie Bernardova') ]}</tr>
<tr><td class="com">@{[ a_href('http://www.geoinvest.cz/','Geoinvest') ]}</td>
		@{[ &{$reference}('ohgna(ng)trbvairfg.pm','Lubor Otta') ]}</tr>
<tr><td class="com">@{[ a_href('http://www.tencom.cz/','TENcom Trade') ]}</td>
		@{[ &{$reference}('grfne(ng)grapbz.pm','Petr Tesar') ]}</tr>
<tr><td class="com">@{[ a_href('http://www.japhila.cz/index_en.htm','Japhila') ]}</td>
		@{[ &{$reference}('wnavx(ng)wncuvyn.pbz','Bretislav Janik') ]}</tr>
HERE

if (lc($W->{"args"}{"referees"}) ne "referees") {
	print <<"HERE";
		<tr><td style="padding: 10px;" colspan="2">
			<hr />
			<form method="post" action="@{[ top_dir $W->{"resume_url"} ]}">
				<p>Enter the word '<b>referees</b>' (without quotes) to disclose e-mail addresses:</p>
				<input type="text" size="15" name="referees" value="@{[ CGI::escapeHTML($W->{"args"}{"referees"}) ]}" />
				<input type="submit" value="Submit" />
				<p>(spambot protection)</p>
			</form>
		</td></tr>
HERE
	}

print <<"HERE";
</table>

@{[ vskip "2ex" ]}

<table>
<caption>Awards</caption>
<tr><td>1997</td><td>Bronze medal in the International Olympiad in Informatics, South Africa - Cape Town</td></tr>
<tr><td>1997</td><td>2nd in an MO-P national contest - mathematics Olympiad, the programming category</td></tr>
<tr><td>1997</td><td>1st in the International Competition in Programming</td></tr>
<tr><td>1996</td><td>4th in the International Competition in Programming</td></tr>
<tr><td>1995</td><td>7th in the Central European Olympiad in Informatics</td></tr>
</table>

@{[ vskip "2ex" ]}

<table>
<caption>Experience Summary</caption>
<tr><td class="tab-head">Major Areas  </td><td>mobile technologies, filesystems, embedded devices</td></tr>
<tr><td class="tab-head">Platforms    </td><td>GNU/Linux/i386/UNIX/FreeBSD, W32 kernel, Amiga/680x0, MS-DOS,
                                               ZX Spectrum, handheld PC-E500S</td></tr>
<tr><td class="tab-head">Languages    </td><td>C (Gnome/GCC), Perl, bash/awk/sed...,
                                               Java, C++, Pascal, Basic, REXX, S-Lang, Foxplus, Prolog</td></tr>
<tr><td class="tab-head">Tools/Metalanguages</td>
                                           <td>autoconf, automake, libtool, m4, CVS, gettext, bison, flex, ld&nbsp;script,
                                               gdb&nbsp;script, Maple&nbsp;V</td></tr>
<tr><td class="tab-head">Assemblers   </td><td>i386, Motorola 680x0, Zilog&nbsp;Z80, Intel 8051, MIPS R2/3000,
                                               (Hitachi SH-8)</td></tr>
<tr><td class="tab-head">WWW-Related  </td><td>(X)HTML, CSS, PHP, SQL (PostgreSQL, MySQL), JavaScript, CGI</td></tr>
<tr><td class="tab-head">Documentation</td><td>plainTeX, LaTeX, DocBook, DocBook Lite, XML/NS/Schema,
                                               gtk-doc, nroff, pod</td></tr>
<tr><td class="tab-head">Libraries    </td><td>Gnome/GTK+/GLib, POSIX/BSD/SysV/threads/sockets, X11, OpenGL, NCurses,
                                               S-Lang, GnomeVFS, libxml, SVGALib, NIS, Qt,...</td></tr>
<tr><td class="tab-head">RPC          </td><td>CORBA/ORBit, SOAP, WSDL, Sun&nbsp;RPC</td></tr>
<tr><td class="tab-head">Protocols    </td><td>GSM SMS/PDU/Nokia&nbsp;Smart&nbsp;Messaging/EMS/MMS/SMIL/WAP/WSP/AMR/ETSI stds/3GPP stds,
                                               IPv4, HTTP, SMTP/RFC822/MIME, FTP, SSH, DHCP, POP3, NFSv2, PPP/LCP/IPCP,...</td></tr>
<tr><td class="tab-head">Filesystems  </td><td>ext2, FAT, AmigaFFS, ISO-9660</td></tr>
</table>

@{[ vskip "2ex" ]}

<table border="1" frame="border" rules="groups">
<caption>My Own Free Projects</caption>
<thead>
	<tr><td colspan="2" style="font-size: larger;" align="center">
		Detailed listing available at: @{[ a_href 'http://www.jankratochvil.net/projects/' ]}
	</td></tr>
</thead>
<tr><th>Platform</th><th>Available Free Projects</th></tr>
HERE
	my @platforms=@My::Project::platforms;
	while (@platforms) {
		my $platform_sym =shift @platforms;
		my $platform_name=shift @platforms;
		print "<tr>";
			print '<td>'.a_href('/project/#'.$platform_sym,$platform_name).'</td>';
			print '<td>'.&{$free_projects}($platform_sym).'</td>';
		print "</tr>\n";
		}
print <<"HERE";
</table>
HERE


My::Web->footer();
