<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments for wag-net</title>
	<atom:link href="http://wag-net.ch/?feed=comments-rss2" rel="self" type="application/rss+xml" />
	<link>http://wag-net.ch</link>
	<description></description>
	<lastBuildDate>Wed, 21 Jul 2010 07:09:45 +0200</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>Comment on PyGTK: Stopwatch [update] by Joakim Gebart</title>
		<link>http://wag-net.ch/?p=275&#038;cpage=1#comment-1147</link>
		<dc:creator>Joakim Gebart</dc:creator>
		<pubDate>Wed, 21 Jul 2010 07:09:45 +0000</pubDate>
		<guid isPermaLink="false">http://wag-net.ch/?p=275#comment-1147</guid>
		<description>I improved the accuracy a bit by using time.time() instead of adding to a counter.

Full source: http://gebart.pastebin.com/AiMBafkD

A patch is included below:


--- pygtk-stopwatch.py.orig	2010-07-21 08:48:35.931061650 +0200
+++ pygtk-stopwatch.py	2010-07-21 08:50:36.522047750 +0200
@@ -24,6 +24,7 @@
  
  
 import pygtk, gtk, pango
+import time
 pygtk.require(&#039;2.0&#039;)
 import gobject
 gobject.threads_init()
@@ -39,7 +40,9 @@
     def b_start_cb(self, widget):
         # Start gobject, impossible to speed up by clicking multiple times
         if self.g_id == 0:
-            self.g_id = gobject.timeout_add(100, self.count)
+            # setting the timeout to 1 ms is too fast on my machine.
+            self.g_id = gobject.timeout_add(10, self.count)
+            self.starttime = time.time()
  
     def b_stop_cb(self, widget):
         # Kill gobject, reset g_id
@@ -49,9 +52,10 @@
  
     def b_reset_cb(self, widget):
         # Reset time
+        self.starttime = time.time()
         self.s = 0.0
         self.m = 0
-        self.l_time.set_text(&quot;00:00.0&quot;)
+        self.l_time.set_text(&quot;00:00.000&quot;)
  
     def win(self):
         win = gtk.Window(gtk.WINDOW_TOPLEVEL)
@@ -71,7 +75,7 @@
         table.attach(af_time, 0, 2, 0, 1)
  
         # Time label, into aspect frame, font size: 19
-        self.l_time = gtk.Label(&quot;00:00.0&quot;)
+        self.l_time = gtk.Label(&quot;00:00.000&quot;)
         self.l_time.modify_font(pango.FontDescription(&quot;19&quot;))
         self.l_time.set_padding(10, 5)
         af_time.add(self.l_time)
@@ -102,15 +106,12 @@
         gtk.main()
  
     def count(self):
-        # A minute yet?
-        if self.s &gt; 60:
-            self.m += 1
-            self.s = 0.0
-        else:
-            self.s += 0.1
+        # Split time into minutes and seconds
+        timediff = time.time() - self.starttime
+        (self.m, self.s) = divmod(timediff, 60.0)
  
         # Set new time to label
-        self.l_time.set_text(&quot;%02i:%04.1f&quot; % (self.m , self.s))
+        self.l_time.set_text(&quot;%02i:%06.3f&quot; % (self.m , self.s))
  
         # Play it again, Sam
         return True

-

&lt;em&gt;Hi, thanks for your contribution Joakim.
Very elegant timing mechanism.&lt;/em&gt;</description>
		<content:encoded><![CDATA[<p>I improved the accuracy a bit by using time.time() instead of adding to a counter.</p>
<p>Full source: <a href="http://gebart.pastebin.com/AiMBafkD" rel="nofollow">http://gebart.pastebin.com/AiMBafkD</a></p>
<p>A patch is included below:</p>
<p>&#8212; pygtk-stopwatch.py.orig	2010-07-21 08:48:35.931061650 +0200<br />
+++ pygtk-stopwatch.py	2010-07-21 08:50:36.522047750 +0200<br />
@@ -24,6 +24,7 @@</p>
<p> import pygtk, gtk, pango<br />
+import time<br />
 pygtk.require(&#8217;2.0&#8242;)<br />
 import gobject<br />
 gobject.threads_init()<br />
@@ -39,7 +40,9 @@<br />
     def b_start_cb(self, widget):<br />
         # Start gobject, impossible to speed up by clicking multiple times<br />
         if self.g_id == 0:<br />
-            self.g_id = gobject.timeout_add(100, self.count)<br />
+            # setting the timeout to 1 ms is too fast on my machine.<br />
+            self.g_id = gobject.timeout_add(10, self.count)<br />
+            self.starttime = time.time()</p>
<p>     def b_stop_cb(self, widget):<br />
         # Kill gobject, reset g_id<br />
@@ -49,9 +52,10 @@</p>
<p>     def b_reset_cb(self, widget):<br />
         # Reset time<br />
+        self.starttime = time.time()<br />
         self.s = 0.0<br />
         self.m = 0<br />
-        self.l_time.set_text(&#8220;00:00.0&#8243;)<br />
+        self.l_time.set_text(&#8220;00:00.000&#8243;)</p>
<p>     def win(self):<br />
         win = gtk.Window(gtk.WINDOW_TOPLEVEL)<br />
@@ -71,7 +75,7 @@<br />
         table.attach(af_time, 0, 2, 0, 1)</p>
<p>         # Time label, into aspect frame, font size: 19<br />
-        self.l_time = gtk.Label(&#8220;00:00.0&#8243;)<br />
+        self.l_time = gtk.Label(&#8220;00:00.000&#8243;)<br />
         self.l_time.modify_font(pango.FontDescription(&#8220;19&#8243;))<br />
         self.l_time.set_padding(10, 5)<br />
         af_time.add(self.l_time)<br />
@@ -102,15 +106,12 @@<br />
         gtk.main()</p>
<p>     def count(self):<br />
-        # A minute yet?<br />
-        if self.s &gt; 60:<br />
-            self.m += 1<br />
-            self.s = 0.0<br />
-        else:<br />
-            self.s += 0.1<br />
+        # Split time into minutes and seconds<br />
+        timediff = time.time() &#8211; self.starttime<br />
+        (self.m, self.s) = divmod(timediff, 60.0)</p>
<p>         # Set new time to label<br />
-        self.l_time.set_text(&#8220;%02i:%04.1f&#8221; % (self.m , self.s))<br />
+        self.l_time.set_text(&#8220;%02i:%06.3f&#8221; % (self.m , self.s))</p>
<p>         # Play it again, Sam<br />
         return True</p>
<p>-</p>
<p><em>Hi, thanks for your contribution Joakim.<br />
Very elegant timing mechanism.</em></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Create chroot jailed SSH User by rofl</title>
		<link>http://wag-net.ch/?p=359&#038;cpage=1#comment-880</link>
		<dc:creator>rofl</dc:creator>
		<pubDate>Thu, 27 May 2010 09:07:30 +0000</pubDate>
		<guid isPermaLink="false">http://wag-net.ch/?p=359#comment-880</guid>
		<description>Wow - its that easy? I always thougth that its verry difficult to setup a chroot jail... Thanks for the howto, wag!

Plus, it seems to be even more simple when you only want to use sftp:
http://www.debian-administration.org/articles/590</description>
		<content:encoded><![CDATA[<p>Wow &#8211; its that easy? I always thougth that its verry difficult to setup a chroot jail&#8230; Thanks for the howto, wag!</p>
<p>Plus, it seems to be even more simple when you only want to use sftp:<br />
<a href="http://www.debian-administration.org/articles/590" rel="nofollow">http://www.debian-administration.org/articles/590</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PyGTK: ShutdownLater [update] by jeremy</title>
		<link>http://wag-net.ch/?p=319&#038;cpage=1#comment-819</link>
		<dc:creator>jeremy</dc:creator>
		<pubDate>Mon, 10 May 2010 16:35:07 +0000</pubDate>
		<guid isPermaLink="false">http://wag-net.ch/?p=319#comment-819</guid>
		<description>Thank you sooooo much.  I&#039;ve been looking for just this functionality.  Well done !</description>
		<content:encoded><![CDATA[<p>Thank you sooooo much.  I&#8217;ve been looking for just this functionality.  Well done !</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Ubuntu 9.10: 32 and 64 Bit Benchmark by tim</title>
		<link>http://wag-net.ch/?p=187&#038;cpage=1#comment-816</link>
		<dc:creator>tim</dc:creator>
		<pubDate>Sun, 09 May 2010 13:49:07 +0000</pubDate>
		<guid isPermaLink="false">http://wag-net.ch/?p=187#comment-816</guid>
		<description>Because flash is still very buggy on 64-bit.... or how do you do that?</description>
		<content:encoded><![CDATA[<p>Because flash is still very buggy on 64-bit&#8230;. or how do you do that?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PyGTK: TemperatureWatch [update] by tim</title>
		<link>http://wag-net.ch/?p=327&#038;cpage=1#comment-815</link>
		<dc:creator>tim</dc:creator>
		<pubDate>Sun, 09 May 2010 13:45:05 +0000</pubDate>
		<guid isPermaLink="false">http://wag-net.ch/?p=327#comment-815</guid>
		<description>Works too on x200s...

little detail: add the &quot;utf-8 coding&quot; on top of the script... Without this it doesn&#039;t work on mine laptop...

the line:
# -*- coding: utf-8 -*-

but in general nice done!:-)
tim
-
&lt;em&gt;isch ja dinne :&gt;&lt;/em&gt;</description>
		<content:encoded><![CDATA[<p>Works too on x200s&#8230;</p>
<p>little detail: add the &#8220;utf-8 coding&#8221; on top of the script&#8230; Without this it doesn&#8217;t work on mine laptop&#8230;</p>
<p>the line:<br />
# -*- coding: utf-8 -*-</p>
<p>but in general nice done!:-)<br />
tim<br />
-<br />
<em>isch ja dinne :></em></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Script: Display all processes accessing a device [update] by zenity</title>
		<link>http://wag-net.ch/?p=37&#038;cpage=1#comment-621</link>
		<dc:creator>zenity</dc:creator>
		<pubDate>Wed, 31 Mar 2010 08:41:59 +0000</pubDate>
		<guid isPermaLink="false">http://wag-net.ch/?p=37#comment-621</guid>
		<description>[...] about ... You can get specific details by using the -C flag, this will list all you hard disks: ...wag-net Script: Display all processes accessing a device ...This is a Blog about GNU/Linux, Encryption, Privacy, Programming and some other IT Stuff. Mostly [...]</description>
		<content:encoded><![CDATA[<p>[...] about &#8230; You can get specific details by using the -C flag, this will list all you hard disks: &#8230;wag-net Script: Display all processes accessing a device &#8230;This is a Blog about GNU/Linux, Encryption, Privacy, Programming and some other IT Stuff. Mostly [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on 5min: Encrypt Instant Messaging with Pidgin and OTR by ch·ª•p</title>
		<link>http://wag-net.ch/?p=11&#038;cpage=1#comment-567</link>
		<dc:creator>ch·ª•p</dc:creator>
		<pubDate>Tue, 16 Mar 2010 14:56:31 +0000</pubDate>
		<guid isPermaLink="false">http://wag-net.ch/?p=11#comment-567</guid>
		<description>[...] Laax, Snowboard, ... Leave a Reply. Click here to cancel reply. Name (required) Mail (will ...wag-net 5min: Encrypt Instant Messaging with Pidgin and OTRThis is a Blog about GNU/Linux, Encryption, Privacy, Programming and some other IT Stuff. Mostly [...]</description>
		<content:encoded><![CDATA[<p>[...] Laax, Snowboard, &#8230; Leave a Reply. Click here to cancel reply. Name (required) Mail (will &#8230;wag-net 5min: Encrypt Instant Messaging with Pidgin and OTRThis is a Blog about GNU/Linux, Encryption, Privacy, Programming and some other IT Stuff. Mostly [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Howto: Hack Nokia 5800 XM (31.0.008, 31.0.101) with HelloOX2/RomPatcher+ [update] by Vikjoe</title>
		<link>http://wag-net.ch/?p=127&#038;cpage=1#comment-496</link>
		<dc:creator>Vikjoe</dc:creator>
		<pubDate>Sun, 21 Feb 2010 11:57:30 +0000</pubDate>
		<guid isPermaLink="false">http://wag-net.ch/?p=127#comment-496</guid>
		<description>The new version for the Nokia 5800 isn aviable for me, too !
But the open4all patch doesnt work on my Phone , i cant see sis/bin.
PLease Help !

-

&lt;em&gt;Hi, the normal file manager doesn&#039;t work with open4all, try &lt;a href=&quot;http://www.lonelycatgames.com/?app=xplore&quot; rel=&quot;nofollow&quot;&gt;X-plore&lt;/a&gt;.&lt;/em&gt;</description>
		<content:encoded><![CDATA[<p>The new version for the Nokia 5800 isn aviable for me, too !<br />
But the open4all patch doesnt work on my Phone , i cant see sis/bin.<br />
PLease Help !</p>
<p>-</p>
<p><em>Hi, the normal file manager doesn&#8217;t work with open4all, try <a href="http://www.lonelycatgames.com/?app=xplore" rel="nofollow">X-plore</a>.</em></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PyGTK: ShutdownLater [update] by Mark</title>
		<link>http://wag-net.ch/?p=319&#038;cpage=1#comment-472</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Mon, 25 Jan 2010 05:19:25 +0000</pubDate>
		<guid isPermaLink="false">http://wag-net.ch/?p=319#comment-472</guid>
		<description>I love it! Thanks!</description>
		<content:encoded><![CDATA[<p>I love it! Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Script: Display all processes accessing a device [update] by Adalberto from italy</title>
		<link>http://wag-net.ch/?p=37&#038;cpage=1#comment-180</link>
		<dc:creator>Adalberto from italy</dc:creator>
		<pubDate>Wed, 02 Dec 2009 03:54:17 +0000</pubDate>
		<guid isPermaLink="false">http://wag-net.ch/?p=37#comment-180</guid>
		<description>Fantastic script!.

Very Useful</description>
		<content:encoded><![CDATA[<p>Fantastic script!.</p>
<p>Very Useful</p>
]]></content:encoded>
	</item>
</channel>
</rss>
