<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dammit Jim! &#187; logger</title>
	<atom:link href="http://scott.sherrillmix.com/blog/tag/logger/feed/" rel="self" type="application/rss+xml" />
	<link>http://scott.sherrillmix.com/blog</link>
	<description>I'm a biologist not a...</description>
	<lastBuildDate>Tue, 12 Jan 2010 05:09:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Active Window Logger</title>
		<link>http://scott.sherrillmix.com/blog/programmer/active-window-logger/</link>
		<comments>http://scott.sherrillmix.com/blog/programmer/active-window-logger/#comments</comments>
		<pubDate>Sun, 24 Sep 2006 18:32:57 +0000</pubDate>
		<dc:creator>ScottS-M</dc:creator>
				<category><![CDATA[Programmer]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[active window]]></category>
		<category><![CDATA[attention]]></category>
		<category><![CDATA[idle]]></category>
		<category><![CDATA[idle time]]></category>
		<category><![CDATA[logger]]></category>
		<category><![CDATA[taskbar]]></category>
		<category><![CDATA[time tracker]]></category>
		<category><![CDATA[wxPython]]></category>

		<guid isPermaLink="false">http://scott.sherrillmix.com/blog/uncategorized/active-window-logger/</guid>
		<description><![CDATA[I was curious how I spend my time and wanted something simple to log which window was active on my computer. I couldn't see anything that did this easily on the internet, although there is a (more sophisticated/complicated) browsing history tracker, and I needed to relax for an hour or two so I thought I'd [...]]]></description>
			<content:encoded><![CDATA[<p>I was curious how I spend my time and wanted something simple to log which window was active on my computer. I couldn't see anything that did this easily on the internet, although there is a (more sophisticated/complicated) <a href="http://www.wynia.org/wordpress/2006/03/03/recording-your-attention-spying-on-yourself/">browsing history tracker</a>, and I needed to relax for an hour or two so I thought I'd give it a shot in Python and see what came out. After looking at the <a href="http://wiki.wxpython.org/index.cgi/FlashingTaskbarIcon">flashing taskbar icon tutorial</a>, <a href="http://mail.python.org/pipermail/python-list/2001-December/077001.html">how to get the currently active window</a>, <a href="http://www.mail-archive.com/python-win32@python.org/msg00669.html"> how to detect if Windows is idle</a> and <a href="http://scott.sherrillmix.com/blog/programmer/getting-rid-of-the-python-console-window/">how to get rid of the console window</a>, I could finally start programming. I really don't know how people programmed before Google.</p>

<p>Python really makes things easy. It took less than 90 lines of code and just a couple hours to write this. So here is the code for it if you want to build it yourself:</p>
<div class="syntax_hilite"><span class="langName">PYTHON:</span><br /><div id="python-2">
<div class="python"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ff7700;font-weight:bold;">import</span> wx</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ff7700;font-weight:bold;">from</span> win32gui <span style="color: #ff7700;font-weight:bold;">import</span> GetWindowText, GetForegroundWindow</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">time</span> <span style="color: #ff7700;font-weight:bold;">import</span> sleep, strftime, localtime</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ff7700;font-weight:bold;">from</span> ctypes <span style="color: #ff7700;font-weight:bold;">import</span> windll, Structure, c_uint, sizeof, byref</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ff7700;font-weight:bold;">class</span> TaskBarApp<span style="color: black;">&#40;</span>wx.<span style="color: black;">Frame</span><span style="color: black;">&#41;</span>:</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, parent, <span style="color: #008000;">id</span>, title<span style="color: black;">&#41;</span>:</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; wx.<span style="color: black;">Frame</span>.<span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, parent, -<span style="color: #ff4500;color:#800000;">1</span>, title, size = <span style="color: black;">&#40;</span><span style="color: #ff4500;color:#800000;">1</span>, <span style="color: #ff4500;color:#800000;">1</span><span style="color: black;">&#41;</span>, style=wx.<span style="color: black;">FRAME_NO_TASKBAR</span>|wx.<span style="color: black;">NO_FULL_REPAINT_ON_RESIZE</span><span style="color: black;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">ICON_STATE</span> = <span style="color: #ff4500;color:#800000;">1</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">ID_ICON_TIMER</span>=wx.<span style="color: black;">NewId</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">tbicon</span> = wx.<span style="color: black;">TaskBarIcon</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; icon = wx.<span style="color: black;">Icon</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'logon.ico'</span>, wx.<span style="color: black;">BITMAP_TYPE_ICO</span><span style="color: black;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">tbicon</span>.<span style="color: black;">SetIcon</span><span style="color: black;">&#40;</span>icon, <span style="color: #483d8b;">'Logging'</span><span style="color: black;">&#41;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">tbicon</span>.<span style="color: black;">Bind</span><span style="color: black;">&#40;</span>wx.<span style="color: black;">EVT_TASKBAR_LEFT_DCLICK</span>, <span style="color: #008000;">self</span>.<span style="color: black;">OnTaskBarLeftDClick</span><span style="color: black;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">tbicon</span>.<span style="color: black;">Bind</span><span style="color: black;">&#40;</span>wx.<span style="color: black;">EVT_TASKBAR_RIGHT_UP</span>, <span style="color: #008000;">self</span>.<span style="color: black;">OnTaskBarRightClick</span><span style="color: black;">&#41;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">Bind</span><span style="color: black;">&#40;</span>wx.<span style="color: black;">EVT_TIMER</span>, <span style="color: #008000;">self</span>.<span style="color: black;">Log</span>, <span style="color: #008000;">id</span>=<span style="color: #008000;">self</span>.<span style="color: black;">ID_ICON_TIMER</span><span style="color: black;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">SetIconTimer</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">Show</span><span style="color: black;">&#40;</span><span style="color: #008000;">True</span><span style="color: black;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">lastInputInfo</span> = <span style="color: #008000;">self</span>.<span style="color: black;">LASTINPUTINFO</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">lastInputInfo</span>.<span style="color: black;">cbSize</span> = sizeof<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">lastInputInfo</span><span style="color: black;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">Write</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">Now</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>+<span style="color: #483d8b;">"&lt;|&gt;__LOGGERSTART__&lt;|&gt;0<span style="color: #000099; font-weight: bold;">\n</span>"</span><span style="color: black;">&#41;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">def</span> OnTaskBarLeftDClick<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, evt<span style="color: black;">&#41;</span>:</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">self</span>.<span style="color: black;">ICON_STATE</span> == <span style="color: #ff4500;color:#800000;">0</span>:</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">Write</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">Now</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>+<span style="color: #483d8b;">"&lt;|&gt;__LOGGERUNPAUSE__&lt;|&gt;0<span style="color: #000099; font-weight: bold;">\n</span>"</span><span style="color: black;">&#41;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">StartIconTimer</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; icon = wx.<span style="color: black;">Icon</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'logon.ico'</span>, wx.<span style="color: black;">BITMAP_TYPE_ICO</span><span style="color: black;">&#41;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">tbicon</span>.<span style="color: black;">SetIcon</span><span style="color: black;">&#40;</span>icon, <span style="color: #483d8b;">'Logging'</span><span style="color: black;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">ICON_STATE</span> = <span style="color: #ff4500;color:#800000;">1</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">else</span>:</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">StopIconTimer</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">Write</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">Now</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>+<span style="color: #483d8b;">"&lt;|&gt;__LOGGERPAUSE__&lt;|&gt;0<span style="color: #000099; font-weight: bold;">\n</span>"</span><span style="color: black;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; icon = wx.<span style="color: black;">Icon</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'logoff.ico'</span>, wx.<span style="color: black;">BITMAP_TYPE_ICO</span><span style="color: black;">&#41;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">tbicon</span>.<span style="color: black;">SetIcon</span><span style="color: black;">&#40;</span>icon, <span style="color: #483d8b;">'Not Logging'</span><span style="color: black;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">ICON_STATE</span> = <span style="color: #ff4500;color:#800000;">0</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">def</span> OnTaskBarRightClick<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, evt<span style="color: black;">&#41;</span>:</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">StopIconTimer</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">Write</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">Now</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>+<span style="color: #483d8b;">"&lt;|&gt;__LOGGERSTOP__&lt;|&gt;0<span style="color: #000099; font-weight: bold;">\n</span>"</span><span style="color: black;">&#41;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">tbicon</span>.<span style="color: black;">Destroy</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">Close</span><span style="color: black;">&#40;</span><span style="color: #008000;">True</span><span style="color: black;">&#41;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; wx.<span style="color: black;">GetApp</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">ProcessIdle</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">def</span> SetIconTimer<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">icontimer</span> = wx.<span style="color: black;">Timer</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, <span style="color: #008000;">self</span>.<span style="color: black;">ID_ICON_TIMER</span><span style="color: black;">&#41;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">icontimer</span>.<span style="color: black;">Start</span><span style="color: black;">&#40;</span><span style="color: #ff4500;color:#800000;">10000</span><span style="color: black;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">def</span> StartIconTimer<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">try</span>:</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">icontimer</span>.<span style="color: black;">Start</span><span style="color: black;">&#40;</span><span style="color: #ff4500;color:#800000;">10000</span><span style="color: black;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">except</span>:</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">pass</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">def</span> StopIconTimer<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">try</span>:</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">icontimer</span>.<span style="color: black;">Stop</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">except</span>:</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">pass</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">def</span> Log<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, evt<span style="color: black;">&#41;</span>:</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; windll.<span style="color: black;">user32</span>.<span style="color: black;">GetLastInputInfo</span><span style="color: black;">&#40;</span>byref<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">lastInputInfo</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; idleDelta = <span style="color: #008000;">float</span><span style="color: black;">&#40;</span>windll.<span style="color: black;">kernel32</span>.<span style="color: black;">GetTickCount</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> - <span style="color: #008000;">self</span>.<span style="color: black;">lastInputInfo</span>.<span style="color: black;">dwTime</span><span style="color: black;">&#41;</span> / <span style="color: #ff4500;color:#800000;">1000</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">Write</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">Now</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>+<span style="color: #483d8b;">"&lt;|&gt;"</span>+GetWindowText<span style="color: black;">&#40;</span>GetForegroundWindow<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>+<span style="color: #483d8b;">"&lt;|&gt;"</span>+<span style="color: #008000;">str</span><span style="color: black;">&#40;</span>idleDelta<span style="color: black;">&#41;</span>+<span style="color: #483d8b;">"<span style="color: #000099; font-weight: bold;">\n</span>"</span><span style="color: black;">&#41;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">def</span> Write<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, text<span style="color: black;">&#41;</span>:</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; f=<span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'log.tmp'</span>, <span style="color: #483d8b;">'a'</span><span style="color: black;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; f.<span style="color: black;">write</span> <span style="color: black;">&#40;</span>text<span style="color: black;">&#41;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; f.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">def</span> Now<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">return</span> strftime<span style="color: black;">&#40;</span><span style="color: #483d8b;">"%Y-%m-%d %H:%M:%S"</span>, localtime<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">class</span> LASTINPUTINFO<span style="color: black;">&#40;</span>Structure<span style="color: black;">&#41;</span>:</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; _fields_ = <span style="color: black;">&#91;</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">"cbSize"</span>, c_uint<span style="color: black;">&#41;</span>,<span style="color: black;">&#40;</span><span style="color: #483d8b;">"dwTime"</span>, c_uint<span style="color: black;">&#41;</span><span style="color: black;">&#93;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ff7700;font-weight:bold;">class</span> MyApp<span style="color: black;">&#40;</span>wx.<span style="color: black;">App</span><span style="color: black;">&#41;</span>:</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">def</span> OnInit<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; frame = TaskBarApp<span style="color: black;">&#40;</span><span style="color: #008000;">None</span>, -<span style="color: #ff4500;color:#800000;">1</span>, <span style="color: #483d8b;">' '</span><span style="color: black;">&#41;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; frame.<span style="color: black;">Center</span><span style="color: black;">&#40;</span>wx.<span style="color: black;">BOTH</span><span style="color: black;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; frame.<span style="color: black;">Show</span><span style="color: black;">&#40;</span><span style="color: #008000;">False</span><span style="color: black;">&#41;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">True</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ff7700;font-weight:bold;">def</span> main<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; app = MyApp<span style="color: black;">&#40;</span><span style="color: #ff4500;color:#800000;">0</span><span style="color: black;">&#41;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; app.<span style="color: black;">MainLoop</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ff7700;font-weight:bold;">if</span> __name__ == <span style="color: #483d8b;">'__main__'</span>:</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; main<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> </div></li></ol></div>
</div></div><br />

<p>It's not too pretty but it seems to work. If you try it, it should begin putting an entry in <code>log.tmp</code> every ten seconds of 'datetime&lt;|&gt;program title&lt;|&gt;idle time'. Unfortunately, it takes 16 megs of RAM. I guess there's a lot going on in the background in the imported stuff. I think it would be much more efficient if programmed from scratch but I'm no programmer. Also, I would make an .exe for people without Python but the .dll files that would have to go along with it would take up more than 10 megs. Must be all the stuff going on in the background again. So it's inefficient but it would get the job done if you want something quick for a day or two or maybe it could form the base of a more optimized program. Next time I have a little free time, I might write a program to read the log and make a summary.</p>
<p>Oh you'll also need 2 32x32 .ico files called logon.ico and logoff.ico. You can use these or <a href="http://www.winterdrache.de/freeware/png2ico/">make your own icons</a>.</p>
<a href="/res/images/logon.ico"><img src="/res/images/logon.png" alt="A logon icon" /></a> <a href="/res/images/logoff.ico"><img src="/res/images/logoff.png" alt="A logoff icon" /></a>]]></content:encoded>
			<wfw:commentRss>http://scott.sherrillmix.com/blog/programmer/active-window-logger/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Locosystech NaviGPS BGT-11 Review</title>
		<link>http://scott.sherrillmix.com/blog/reviewer/locosystech-navigps-bgt-11-review/</link>
		<comments>http://scott.sherrillmix.com/blog/reviewer/locosystech-navigps-bgt-11-review/#comments</comments>
		<pubDate>Fri, 22 Sep 2006 04:43:27 +0000</pubDate>
		<dc:creator>ScottS-M</dc:creator>
				<category><![CDATA[Reviewer]]></category>
		<category><![CDATA[Amaryllo]]></category>
		<category><![CDATA[BGT-11]]></category>
		<category><![CDATA[gps]]></category>
		<category><![CDATA[gps logger]]></category>
		<category><![CDATA[GT-11]]></category>
		<category><![CDATA[Locosys]]></category>
		<category><![CDATA[logger]]></category>
		<category><![CDATA[NaviGPS]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[Tracker]]></category>
		<category><![CDATA[Trip]]></category>

		<guid isPermaLink="false">http://scott.sherrillmix.com/blog/reviewer/locosystech-navigps-bgt-11-review/</guid>
		<description><![CDATA[
This summer I needed a GPS logger for some field work. After looking through a few different possibilities, none of which were particularily satisfying, I finally found the (ununiquely named) NaviGPS GPS from GPS Central for $200 Canadian. At the time, there weren't any reviews of it online. I've come to depend on reviews whenever [...]]]></description>
			<content:encoded><![CDATA[<img class="right" src="/res/images/naviGPS_bgt-11_side.jpg" alt="Locosystech NaviGPS BGT-11" />
<p>This summer I needed a GPS logger for some field work. After looking through a few different possibilities, none of which were particularily satisfying, I finally found the (ununiquely named) <a href="http://www.locosystech.com/default_mid_PD_Handheld_gt11.htm">NaviGPS GPS</a> from <a href="http://www.gpscentral.ca/products/NaviGPS/navigps.htm">GPS Central</a> for $200 Canadian. At the time, there weren't any reviews of it online. I've come to depend on reviews whenever I buy something so I figure I'll do my part and post my review of it. While digging up the company link, I noticed on they've changed the name to a 'GT-11' and redone the layout of the website. Looks better now. I'm not sure the name is any better though. Sounds like a car. Anyway, I also noticed they have drivers for Mac, XP and Linux so that's a plus if you need that. <em>1/18/2007 Edit: It looks like the name has changed again. It appears to be called an 
<a href="http://www.amaryllo.com/almooj/en/products/index.php">Amaryllo Trip Tracker</a> now. Not sure what has changed but the picture sure looks the same as my unit except the big A logo.</em></p>

<p>So the main reasons I bought the Navilink were the:</p>
<ul>
<li>Rechargeable battery</li>
<li>USB Cable (more convenient than the more common serial cable)</li>
<li>Automatic data logging with adjustable interval</li>
<li>Accepts SD Card (also has it's own internal storage of ~2 Mb). It seems to take about 20 kb per 100 records with NMEA data (which you don't really need) and 7 kb without. I could have messed up the decimal but I think that translates into <em>100 continous months</em> of 10 second interval data on a 2 Gb card.</li>
<li>Waterproof (Almost all the handheld GPS's are though)</li>
<li>Bluetooth real-time communication (can make a PDA into a powerful GPS)</li>
<li>USB real-time communication (can make a laptop into an even more powerful GPS)</li>
<li>Screen (unlike most data loggers)</li>
<li>Car, usb, and house power charging</li>
<li>Fairly cheap</li>
</ul><img class="right" src="/res/images/naviGPS_bgt-11.jpg" alt="The connections of the Locosystech NaviGPS BGT-11" />
<p>Now so I don't sound like a total shill, I did have a few problems with it: </p>
<ul>
<li>I never tried the bluetooth so I can't vouch for that. </li>
<li>The USB connection to a laptop worked easily and well. Except for one time when the mapping software decided to plot it's location about a minute off from the true location being displayed on the GPS. I assume this was some sort of input setting in the mapping software that got messed up because it only happened once.</li> 
<li>It doesn't like fog. Any thick fog caused it to lose it's signal. I haven't tried enough GPS's to know if this is a common problem. The boat's GPS did not lose its signal.</li>
<li>It really needs to be in a window. In a boat cabin it lost signal pretty quickly if it wasn't right next to a window. Perhaps a car would have better luck though.</li> 
<li>It went crazy a couple times and decided I was moving 999 miles per hour to an incorrect location. Turning it off and on did fix this immediately and it appears that the recorded log did not show this.</li>
<li>The battery only lasted about 14 hours for me (10 second logging if it that mattered). I didn't test this rigorously though since after the first failure I kept it plugged in. It's also possible the non-Bluetooth version would last longer. This could be a problem for real wilderness applications since the battery is internal and you can't carry spares.</li>
<li>It can't display maps. I didn't buy it planning on that but I thought I better mention it.</li>
<li>A minor annoyance is that if it loses signal, it no longer displays your track or last know position. This could be bad if you were say lost in the fog.</li>
</ul>
<img class="left" src="/res/images/gpstrack.jpg" alt="A GPS track from the Locosystech NaviGPS BGT-11" />
<p>So overall I was very satisfied with it. I was just looking for a GPS logger and all the extra features were icing. After three months of almost daily logging on the ocean, it still appears to be working perfectly. I would be worried about battery life if I was going for a long outdoor adventure but it's great for boat or car trips. It also works very well as a USB plug in for a laptop with mapping software but can still function independently. And the logged track looks very good. I can see where we stopped to do some work and see the path we went through the islands. So if you're looking for a very basic handheld GPS combined with a very good logger and Bluetooth and USB connectable, this is your gadget.</p> 
<p><em>1/21/2007-Edit: There's another  <a href="http://www.splitbrain.org/blog/2007-01/17-navigps_review">NaviGPS review</a> up and if you're looking to use the <a href="http://wiki.splitbrain.org/navigps">NaviGPS with Linux</a> it looks like he's put some work into that too.]]></content:encoded>
			<wfw:commentRss>http://scott.sherrillmix.com/blog/reviewer/locosystech-navigps-bgt-11-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
