<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><title type="text">WeirdLooking.com: Michael Barton's Blog</title><rights>Copyright 2006</rights><author><name>Michael Barton</name><email>palrich@gmail.com</email></author><updated>2010-09-10T20:36:20Z</updated><generator>WeirdLooking.com</generator><logo>http://www.weirdlooking.com/images/feed.png</logo><link rel="alternate" type="text/html" href="http://www.weirdlooking.com/" /><link rel="self" type="application/xml+atom" href="http://www.weirdlooking.com/atom/tag/favotech" /><id>http://www.weirdlooking.com/</id><entry><title type="text">some sign code</title><author><name>Michael Barton</name></author><link rel="alternate" type="text/html" href="http://www.weirdlooking.com/blog/some-sign-code" /><id>http://www.weirdlooking.com/blog/some-sign-code</id><published>2008-10-03T16:54:44Z</published><updated>2008-10-03T16:54:44Z</updated><content type="html">So, what I&amp;rsquo;ve got &lt;a href=&quot;http://www.weirdlooking.com/blog/108/protocol.py&quot; style=&quot;position: relative; padding-left: 8px; zoom: 1;&quot;&gt;&lt;span style=&quot;position: absolute; top: -5px; left: 0px; width: 16px; height: 16px; background: URL(http://www.weirdlooking.com/exticon?http%3A%2F%2Fwww.weirdlooking.com%2Fblog%2F108%2Fprotocol.py) no-repeat center center; -moz-opacity: 0.3; opacity: 0.3; filter:alpha(opacity=30);&quot;&gt;&lt;/span&gt;here&lt;/a&gt; is my implementation of the favotech sign&amp;rsquo;s protocol in python.&amp;nbsp; As I&amp;rsquo;ve mentioned, it&amp;rsquo;s horrible.&amp;nbsp; From what I can tell, the sign supports basically the same protocol over TCP, UDP, and serial.&amp;nbsp; I&amp;rsquo;ve been using UDP over a &lt;a href=&quot;http://www.flickr.com/photos/24388430@N08/2909395961/&quot; style=&quot;position: relative; padding-left: 8px; zoom: 1;&quot;&gt;&lt;span style=&quot;position: absolute; top: -5px; left: 0px; width: 16px; height: 16px; background: URL(http://www.weirdlooking.com/exticon?http%3A%2F%2Fwww.flickr.com%2Fphotos%2F24388430%40N08%2F2909395961%2F) no-repeat center center; -moz-opacity: 0.3; opacity: 0.3; filter:alpha(opacity=30);&quot;&gt;&lt;/span&gt;crossover cable&lt;/a&gt; from a whitebox with two NICs, and that&amp;rsquo;s worked fine.&lt;br /&gt;&lt;br /&gt;I&amp;rsquo;m using it inside a &lt;a href=&quot;http://twistedmatrix.com/trac/&quot; style=&quot;position: relative; padding-left: 8px; zoom: 1;&quot;&gt;&lt;span style=&quot;position: absolute; top: -5px; left: 0px; width: 16px; height: 16px; background: URL(http://www.weirdlooking.com/exticon?http%3A%2F%2Ftwistedmatrix.com%2Ftrac%2F) no-repeat center center; -moz-opacity: 0.3; opacity: 0.3; filter:alpha(opacity=30);&quot;&gt;&lt;/span&gt;twisted&lt;/a&gt; app, mostly for all the batteries it includes.&amp;nbsp; I have a UDP server class that inherits from this class, but implements its own send_to_sign method.&amp;nbsp; This layout made reusing the code for different connection media a breeze.&amp;nbsp; Basic usage then looks something like this:&lt;br /&gt;&lt;br /&gt;&lt;code style=&quot;display: block;&quot; class=&quot;blockocode&quot;&gt; &amp;nbsp; self.test_reset()&lt;br/&gt; &amp;nbsp; self.pause()&lt;br/&gt; &amp;nbsp; self.time_sync()&lt;br/&gt; &amp;nbsp; self.set_frame_count(&lt;span style=&quot;color: #FF0000&quot;&gt;3&lt;/span&gt;)&lt;br/&gt; &amp;nbsp; self.set_text(&lt;span style=&quot;color: #FF0000&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #00B000&quot;&gt;'{y}OH HAI'&lt;/span&gt;)&lt;br/&gt; &amp;nbsp; self.set_text(&lt;span style=&quot;color: #FF0000&quot;&gt;1&lt;/span&gt;, &lt;span style=&quot;color: #00B000&quot;&gt;'I AM {f}THE{/f} SIGN'&lt;/span&gt;)&lt;br/&gt; &amp;nbsp; self.set_text(&lt;span style=&quot;color: #FF0000&quot;&gt;2&lt;/span&gt;, &lt;span style=&quot;color: #00B000&quot;&gt;'{0}{ma} {dd} &amp;nbsp;{12}'&lt;/span&gt;)&lt;br/&gt; &amp;nbsp; self.resume()&lt;/code&gt;&lt;br /&gt;To dumb down the interface, a frame count of &lt;span style=&quot;font-style: italic;&quot;&gt;n&lt;/span&gt; actually creates a playlist containing &lt;span style=&quot;font-style: italic;&quot;&gt;n&lt;/span&gt; two-letter filenames, &amp;#39;AA&amp;rsquo;&amp;#8230;&amp;rsquo;ZZ&amp;rsquo;.&amp;nbsp; Calling set_text with a frame ID then sets the text of the corresponding file.&amp;nbsp; The set_text method has a dead simple markup language it can use to set text colors and stuff.&lt;br /&gt;&lt;br /&gt;More to come, probably&amp;#8230;</content><category term="favotech" /><category term="led sign" /><category term="python" /><link rel="comments" type="application/atom+xml" href="http://www.weirdlooking.com/atom/comments/108" /><wfw:commentRss>http://www.weirdlooking.com/atom/comments/108</wfw:commentRss><slash:comments>1</slash:comments></entry></feed>