<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-36064380</id><updated>2011-05-21T12:17:45.329+02:00</updated><category term='SNMP'/><category term='charts'/><category term='Python colors palette generator'/><category term='clustered'/><category term='java'/><category term='tool'/><category term='JGroups'/><category term='VLAN'/><category term='JBoss Cache'/><category term='Spring Framework'/><category term='EMF'/><category term='MIB'/><category term='synchronization'/><category term='Cisco'/><category term='vlans'/><category term='regex IP IPv4 regexp pattern'/><category term='Beryl'/><category term='Catalyst'/><category term='multicasting'/><category term='Xgl'/><category term='rrdtool'/><category term='diagram'/><category term='python'/><category term='Linux'/><category term='Eclipse'/><category term='GMF'/><category term='MUD'/><category term='ENTITY-MIB'/><title type='text'>Happy Software Engineer</title><subtitle type='html'>About me versus resistance of some cutting edge software development technologies (usually open-source Java and Python frameworks, libraries and tools)</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://hse-at-work.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://hse-at-work.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Seweryn Niemiec</name><uri>http://www.blogger.com/profile/04092697334685699065</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>16</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-36064380.post-2588728908940104804</id><published>2007-04-13T09:34:00.001+02:00</published><updated>2007-04-13T10:24:56.666+02:00</updated><title type='text'></title><content type='html'>&lt;img style="float:right" src="http://download.freshmeat.net/screenshots/29568_thumb.png" alt="The old C++/Gnome version" /&gt;I have decided to reactivate &lt;a href="http://xeland.sourceforge.net/"&gt;XEland&lt;/a&gt; project. XELand is a small program, which generates night landscapes as stereo pairs for cross-eye viewing. Original version was written in C++/Gnome and had continually problems with compilation (due to lots of dependencies). &lt;img style="float:left" src="http://download.freshmeat.net/screenshots/29568_69228_thumb.png" alt="The Java version" /&gt; Java version is of course free of such problems. Currently it uses two map generation methods (plus some variations). Generated height maps are seamless and can be saved as PNG images. The program requires only JDK 1.5 or above, and is very easy to use. To take full advantage of XEland you should learn cross-eye viewing. Support for anaglyph is expected soon.
&lt;div style="padding-top: 30px; text-align:center"&gt;&lt;a href="http://serdom.szn.pl/XEland-1.0RC3.jnlp" rel="nofollow"&gt;&lt;img src="http://gstpw.googlecode.com/files/webstart_small.gif"&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36064380-2588728908940104804?l=hse-at-work.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hse-at-work.blogspot.com/feeds/2588728908940104804/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36064380&amp;postID=2588728908940104804&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/2588728908940104804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/2588728908940104804'/><link rel='alternate' type='text/html' href='http://hse-at-work.blogspot.com/2007/04/i-have-decided-to-reactivate-xeland.html' title=''/><author><name>Seweryn Niemiec</name><uri>http://www.blogger.com/profile/04092697334685699065</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36064380.post-1659064138332291397</id><published>2007-03-25T22:53:00.000+02:00</published><updated>2007-03-25T22:55:43.754+02:00</updated><title type='text'>Java Generics: Instantiating Objects Of Type Parameter Without Passing Class Literal To Instance</title><content type='html'>Cause generics in Java 1.5 and 1.6 are implemented using erasure, in most cases you can not get class object for type parameter, which means that in your generic classes you can not instantiate objects of type parameters. Usually this is solved by special setup of generic class instance (by passing class literals to methods which instantiate objects of type parameter class) but it does not look too god. Fortunately, you can avoid such ugly code in some situations and make generic class smart enough to handle it by itself. &lt;a href="http://serdom.szn.pl/ser/index.php/2007/03/25/java-generics-instantiating-objects-of-type-parameter-without-using-class-literal/"&gt;More...&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36064380-1659064138332291397?l=hse-at-work.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hse-at-work.blogspot.com/feeds/1659064138332291397/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36064380&amp;postID=1659064138332291397&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/1659064138332291397'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/1659064138332291397'/><link rel='alternate' type='text/html' href='http://hse-at-work.blogspot.com/2007/03/java-generics-instantiating-objects-of.html' title='Java Generics: Instantiating Objects Of Type Parameter Without Passing Class Literal To Instance'/><author><name>Seweryn Niemiec</name><uri>http://www.blogger.com/profile/04092697334685699065</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36064380.post-1006704552862323671</id><published>2007-03-23T08:58:00.000+01:00</published><updated>2007-03-23T09:13:04.643+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='tool'/><title type='text'>C/GTK or Java/Swing Stopwatch</title><content type='html'>&lt;img style="float:right; margin-right: 1em" src="http://gstpw.googlecode.com/files/jstpw-1.0.png" alt="jstpw" /&gt; Maybe it's hard to believe but there is not too much stopwatch programs for Linux. So I have written one by myself. First was the C/GTK version. Coding it was rather painful for Java programmer accustomed to comfortable Eclipse IDE. So next day I decided to implement same functionality in Java/Swing. The Java version supports simple task tracking and can be started from the command line, via WebStart, or used as applet. Check &lt;a href="http://code.google.com/p/gstpw/"&gt;project's page&lt;/a&gt; for downloads section.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36064380-1006704552862323671?l=hse-at-work.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hse-at-work.blogspot.com/feeds/1006704552862323671/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36064380&amp;postID=1006704552862323671&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/1006704552862323671'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/1006704552862323671'/><link rel='alternate' type='text/html' href='http://hse-at-work.blogspot.com/2007/03/cgtk-or-javaswing-stopwatch.html' title='C/GTK or Java/Swing Stopwatch'/><author><name>Seweryn Niemiec</name><uri>http://www.blogger.com/profile/04092697334685699065</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36064380.post-1768457283370426877</id><published>2007-03-10T16:44:00.000+01:00</published><updated>2007-03-10T16:46:44.478+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GMF'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='diagram'/><title type='text'>How To Enable UUID In EMF Generated Model To Get Copy&amp;Paste Working</title><content type='html'>If you get very strange results using Copy&amp;Paste in GMF diagram editor then in all likelihood your EMF model doesn’t use Universally Unique Identifiers. EMF’s XMIResourceImpl supports generation of UUID transparently but it’s disabled by default. Read more &lt;a href="http://serdom.szn.pl/ser/?p=6"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36064380-1768457283370426877?l=hse-at-work.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hse-at-work.blogspot.com/feeds/1768457283370426877/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36064380&amp;postID=1768457283370426877&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/1768457283370426877'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/1768457283370426877'/><link rel='alternate' type='text/html' href='http://hse-at-work.blogspot.com/2007/03/how-to-enable-uuid-in-emf-generated.html' title='How To Enable UUID In EMF Generated Model To Get Copy&amp;Paste Working'/><author><name>Seweryn Niemiec</name><uri>http://www.blogger.com/profile/04092697334685699065</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36064380.post-265432453215966529</id><published>2007-03-05T16:49:00.000+01:00</published><updated>2007-03-05T17:03:42.273+01:00</updated><title type='text'>The Blog Has Been Moved</title><content type='html'>All old and new stuff can be found at new place.&lt;br&gt;
Click &lt;b&gt;&lt;a href="http://serdom.szn.pl/ser/"&gt;here&lt;/a&gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36064380-265432453215966529?l=hse-at-work.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hse-at-work.blogspot.com/feeds/265432453215966529/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36064380&amp;postID=265432453215966529&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/265432453215966529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/265432453215966529'/><link rel='alternate' type='text/html' href='http://hse-at-work.blogspot.com/2007/03/blog-has-been-moved.html' title='The Blog Has Been Moved'/><author><name>Seweryn Niemiec</name><uri>http://www.blogger.com/profile/04092697334685699065</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36064380.post-2376703634134315116</id><published>2006-11-26T18:23:00.000+01:00</published><updated>2007-02-05T21:26:57.343+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python colors palette generator'/><title type='text'>Color Scheme Generator for Charts</title><content type='html'>Sometimes one needs to show many data series on one chart. In such cases, usually distinction between those data series is achieved by using different colors for each data set. Most charting libraries leave colors selection to developer. This can be problem when there is need to choose more than six colors which can be easily distinguished by most people.  Below you can find Python program which can be helpful.&lt;br&gt;&lt;br&gt;

Program generates palette of colors where each color can be easily distinguished from other colors in its neighborhood. Difference between colors is computed using W3C's &lt;a href="http://www.w3.org/TR/AERT#color-contrast"&gt;formula&lt;/a&gt; for color contrast. Minimum contrast (brightness and color), palette size, neighborhood diameter and maximum number of iterations can be easily set in first few lines of program code.&lt;br&gt;&lt;br&gt;

New colors are created using pseudo-random generators and tested for minimum contrast. If contrast test fails, the color is dropped and new one is created. Besides of minimum required contrast, the size of neighborhood has great impact on probability that test will fail. Too big neighborhood diameter could make it impossible to create complete neighborhood and lock the program. To prevent this, there is limit for number of iterations.
&lt;pre class="hl"&gt;&lt;span class="slc"&gt;#!/usr/bin/python&lt;/span&gt;

&lt;span class="kwa"&gt;from&lt;/span&gt; random &lt;span class="kwa"&gt;import&lt;/span&gt; randint

&lt;span class="kwa"&gt;class&lt;/span&gt; Color&lt;span class="sym"&gt;:&lt;/span&gt;
   __c &lt;span class="sym"&gt;= [&lt;/span&gt;&lt;span class="num"&gt;0&lt;/span&gt;&lt;span class="sym"&gt;,&lt;/span&gt; &lt;span class="num"&gt;0&lt;/span&gt;&lt;span class="sym"&gt;,&lt;/span&gt; &lt;span class="num"&gt;0&lt;/span&gt;&lt;span class="sym"&gt;]&lt;/span&gt;
   __cB &lt;span class="sym"&gt;=&lt;/span&gt; &lt;span class="kwa"&gt;None&lt;/span&gt;
   &lt;span class="kwa"&gt;def&lt;/span&gt; &lt;span class="kwd"&gt;__init__&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;self&lt;span class="sym"&gt;,&lt;/span&gt; r&lt;span class="sym"&gt;=-&lt;/span&gt;&lt;span class="num"&gt;1&lt;/span&gt;&lt;span class="sym"&gt;,&lt;/span&gt; g&lt;span class="sym"&gt;=-&lt;/span&gt;&lt;span class="num"&gt;1&lt;/span&gt;&lt;span class="sym"&gt;,&lt;/span&gt; b&lt;span class="sym"&gt;=-&lt;/span&gt;&lt;span class="num"&gt;1&lt;/span&gt;&lt;span class="sym"&gt;):&lt;/span&gt;
       &lt;span class="kwa"&gt;if&lt;/span&gt; r &lt;span class="sym"&gt;== -&lt;/span&gt;&lt;span class="num"&gt;1&lt;/span&gt;&lt;span class="sym"&gt;:&lt;/span&gt;
           r &lt;span class="sym"&gt;=&lt;/span&gt; &lt;span class="kwd"&gt;randint&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;&lt;span class="num"&gt;1&lt;/span&gt;&lt;span class="sym"&gt;,&lt;/span&gt;&lt;span class="num"&gt;255&lt;/span&gt;&lt;span class="sym"&gt;)&lt;/span&gt;
       &lt;span class="kwa"&gt;if&lt;/span&gt; g &lt;span class="sym"&gt;== -&lt;/span&gt;&lt;span class="num"&gt;1&lt;/span&gt;&lt;span class="sym"&gt;:&lt;/span&gt;
           g &lt;span class="sym"&gt;=&lt;/span&gt; &lt;span class="kwd"&gt;randint&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;&lt;span class="num"&gt;1&lt;/span&gt;&lt;span class="sym"&gt;,&lt;/span&gt;&lt;span class="num"&gt;255&lt;/span&gt;&lt;span class="sym"&gt;)&lt;/span&gt;
       &lt;span class="kwa"&gt;if&lt;/span&gt; b &lt;span class="sym"&gt;== -&lt;/span&gt;&lt;span class="num"&gt;1&lt;/span&gt;&lt;span class="sym"&gt;:&lt;/span&gt;
           b &lt;span class="sym"&gt;=&lt;/span&gt; &lt;span class="kwd"&gt;randint&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;&lt;span class="num"&gt;1&lt;/span&gt;&lt;span class="sym"&gt;,&lt;/span&gt;&lt;span class="num"&gt;255&lt;/span&gt;&lt;span class="sym"&gt;)&lt;/span&gt;
       self&lt;span class="sym"&gt;.&lt;/span&gt;__c &lt;span class="sym"&gt;= [&lt;/span&gt;r&lt;span class="sym"&gt;,&lt;/span&gt; g&lt;span class="sym"&gt;,&lt;/span&gt; b&lt;span class="sym"&gt;]&lt;/span&gt;
   &lt;span class="kwa"&gt;def&lt;/span&gt; &lt;span class="kwd"&gt;__getitem__&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;self&lt;span class="sym"&gt;,&lt;/span&gt; key&lt;span class="sym"&gt;):&lt;/span&gt;
       &lt;span class="kwa"&gt;return&lt;/span&gt; self&lt;span class="sym"&gt;.&lt;/span&gt;__c&lt;span class="sym"&gt;[&lt;/span&gt;key&lt;span class="sym"&gt;]&lt;/span&gt;
   &lt;span class="kwa"&gt;def&lt;/span&gt; &lt;span class="kwd"&gt;__setitem__&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;self&lt;span class="sym"&gt;,&lt;/span&gt; key&lt;span class="sym"&gt;,&lt;/span&gt; value&lt;span class="sym"&gt;):&lt;/span&gt;
       self&lt;span class="sym"&gt;.&lt;/span&gt;__c&lt;span class="sym"&gt;[&lt;/span&gt;key&lt;span class="sym"&gt;] =&lt;/span&gt; value
       self&lt;span class="sym"&gt;.&lt;/span&gt;__cB &lt;span class="sym"&gt;=&lt;/span&gt; &lt;span class="kwa"&gt;None&lt;/span&gt;
   &lt;span class="kwa"&gt;def&lt;/span&gt; &lt;span class="kwd"&gt;getBritness&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;self&lt;span class="sym"&gt;):&lt;/span&gt;
       &lt;span class="kwa"&gt;if&lt;/span&gt; self&lt;span class="sym"&gt;.&lt;/span&gt;__cB&lt;span class="sym"&gt;:&lt;/span&gt;
           &lt;span class="kwa"&gt;return&lt;/span&gt; self&lt;span class="sym"&gt;.&lt;/span&gt;__cB
       &lt;span class="kwa"&gt;else&lt;/span&gt;&lt;span class="sym"&gt;:&lt;/span&gt;
           self&lt;span class="sym"&gt;.&lt;/span&gt;__cB &lt;span class="sym"&gt;= ((&lt;/span&gt;self&lt;span class="sym"&gt;.&lt;/span&gt;__c&lt;span class="sym"&gt;[&lt;/span&gt;&lt;span class="num"&gt;0&lt;/span&gt;&lt;span class="sym"&gt;] *&lt;/span&gt; &lt;span class="num"&gt;299&lt;/span&gt;&lt;span class="sym"&gt;) +&lt;/span&gt;
                       &lt;span class="sym"&gt;(&lt;/span&gt;self&lt;span class="sym"&gt;.&lt;/span&gt;__c&lt;span class="sym"&gt;[&lt;/span&gt;&lt;span class="num"&gt;1&lt;/span&gt;&lt;span class="sym"&gt;] *&lt;/span&gt; &lt;span class="num"&gt;587&lt;/span&gt;&lt;span class="sym"&gt;) +&lt;/span&gt;
                       &lt;span class="sym"&gt;(&lt;/span&gt;self&lt;span class="sym"&gt;.&lt;/span&gt;__c&lt;span class="sym"&gt;[&lt;/span&gt;&lt;span class="num"&gt;2&lt;/span&gt;&lt;span class="sym"&gt;] *&lt;/span&gt; &lt;span class="num"&gt;114&lt;/span&gt;&lt;span class="sym"&gt;)) /&lt;/span&gt; &lt;span class="num"&gt;1000&lt;/span&gt;
           &lt;span class="kwa"&gt;return&lt;/span&gt; self&lt;span class="sym"&gt;.&lt;/span&gt;__cB
   &lt;span class="kwa"&gt;def&lt;/span&gt; &lt;span class="kwd"&gt;__sub__&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;self&lt;span class="sym"&gt;,&lt;/span&gt; other&lt;span class="sym"&gt;):&lt;/span&gt;
       &lt;span class="kwa"&gt;return&lt;/span&gt; &lt;span class="sym"&gt;((&lt;/span&gt;&lt;span class="kwb"&gt;max&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;self&lt;span class="sym"&gt;.&lt;/span&gt;__c&lt;span class="sym"&gt;[&lt;/span&gt;&lt;span class="num"&gt;0&lt;/span&gt;&lt;span class="sym"&gt;],&lt;/span&gt; other&lt;span class="sym"&gt;[&lt;/span&gt;&lt;span class="num"&gt;0&lt;/span&gt;&lt;span class="sym"&gt;]) -&lt;/span&gt; &lt;span class="kwb"&gt;min&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;self&lt;span class="sym"&gt;.&lt;/span&gt;__c&lt;span class="sym"&gt;[&lt;/span&gt;&lt;span class="num"&gt;0&lt;/span&gt;&lt;span class="sym"&gt;],&lt;/span&gt; other&lt;span class="sym"&gt;[&lt;/span&gt;&lt;span class="num"&gt;0&lt;/span&gt;&lt;span class="sym"&gt;])) +&lt;/span&gt;
               &lt;span class="sym"&gt;(&lt;/span&gt;&lt;span class="kwb"&gt;max&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;self&lt;span class="sym"&gt;[&lt;/span&gt;&lt;span class="num"&gt;1&lt;/span&gt;&lt;span class="sym"&gt;],&lt;/span&gt; other&lt;span class="sym"&gt;[&lt;/span&gt;&lt;span class="num"&gt;1&lt;/span&gt;&lt;span class="sym"&gt;]) -&lt;/span&gt; &lt;span class="kwb"&gt;min&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;self&lt;span class="sym"&gt;[&lt;/span&gt;&lt;span class="num"&gt;1&lt;/span&gt;&lt;span class="sym"&gt;],&lt;/span&gt; other&lt;span class="sym"&gt;[&lt;/span&gt;&lt;span class="num"&gt;1&lt;/span&gt;&lt;span class="sym"&gt;])) +&lt;/span&gt;
               &lt;span class="sym"&gt;(&lt;/span&gt;&lt;span class="kwb"&gt;max&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;self&lt;span class="sym"&gt;[&lt;/span&gt;&lt;span class="num"&gt;2&lt;/span&gt;&lt;span class="sym"&gt;],&lt;/span&gt; other&lt;span class="sym"&gt;[&lt;/span&gt;&lt;span class="num"&gt;2&lt;/span&gt;&lt;span class="sym"&gt;]) -&lt;/span&gt; &lt;span class="kwb"&gt;min&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;self&lt;span class="sym"&gt;[&lt;/span&gt;&lt;span class="num"&gt;2&lt;/span&gt;&lt;span class="sym"&gt;],&lt;/span&gt; other&lt;span class="sym"&gt;[&lt;/span&gt;&lt;span class="num"&gt;2&lt;/span&gt;&lt;span class="sym"&gt;])))&lt;/span&gt;
   &lt;span class="kwa"&gt;def&lt;/span&gt; &lt;span class="kwd"&gt;__str__&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;self&lt;span class="sym"&gt;):&lt;/span&gt;
       &lt;span class="kwa"&gt;return&lt;/span&gt; &lt;span class="str"&gt;"%02x%02x%02x"&lt;/span&gt; &lt;span class="sym"&gt;% (&lt;/span&gt;self&lt;span class="sym"&gt;.&lt;/span&gt;__c&lt;span class="sym"&gt;[&lt;/span&gt;&lt;span class="num"&gt;0&lt;/span&gt;&lt;span class="sym"&gt;],&lt;/span&gt; self&lt;span class="sym"&gt;.&lt;/span&gt;__c&lt;span class="sym"&gt;[&lt;/span&gt;&lt;span class="num"&gt;1&lt;/span&gt;&lt;span class="sym"&gt;],&lt;/span&gt; self&lt;span class="sym"&gt;.&lt;/span&gt;__c&lt;span class="sym"&gt;[&lt;/span&gt;&lt;span class="num"&gt;2&lt;/span&gt;&lt;span class="sym"&gt;])&lt;/span&gt;

colors &lt;span class="sym"&gt;= []&lt;/span&gt;
num &lt;span class="sym"&gt;=&lt;/span&gt; &lt;span class="num"&gt;25&lt;/span&gt;
comparedNum &lt;span class="sym"&gt;=&lt;/span&gt; &lt;span class="num"&gt;5&lt;/span&gt;

c &lt;span class="sym"&gt;=&lt;/span&gt; &lt;span class="kwd"&gt;Color&lt;/span&gt;&lt;span class="sym"&gt;()&lt;/span&gt;
colors&lt;span class="sym"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;append&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;c&lt;span class="sym"&gt;)&lt;/span&gt;
stopper &lt;span class="sym"&gt;=&lt;/span&gt; &lt;span class="num"&gt;100000&lt;/span&gt;

minBrit &lt;span class="sym"&gt;=&lt;/span&gt; &lt;span class="num"&gt;35&lt;/span&gt;
minColDiff &lt;span class="sym"&gt;=&lt;/span&gt; &lt;span class="num"&gt;100&lt;/span&gt;

&lt;span class="kwa"&gt;print&lt;/span&gt; &lt;span class="str"&gt;"searching..."&lt;/span&gt;&lt;span class="sym"&gt;,&lt;/span&gt;
&lt;span class="kwa"&gt;for&lt;/span&gt; n &lt;span class="kwa"&gt;in&lt;/span&gt; &lt;span class="kwb"&gt;range&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;num&lt;span class="sym"&gt;)[&lt;/span&gt;&lt;span class="num"&gt;1&lt;/span&gt;&lt;span class="sym"&gt;:]:&lt;/span&gt;
   &lt;span class="kwa"&gt;while&lt;/span&gt; stopper&lt;span class="sym"&gt;:&lt;/span&gt;
       newC &lt;span class="sym"&gt;=&lt;/span&gt; &lt;span class="kwd"&gt;Color&lt;/span&gt;&lt;span class="sym"&gt;()&lt;/span&gt;
       passed &lt;span class="sym"&gt;=&lt;/span&gt; &lt;span class="num"&gt;0&lt;/span&gt;
       &lt;span class="kwa"&gt;for&lt;/span&gt; back &lt;span class="kwa"&gt;in&lt;/span&gt; &lt;span class="kwb"&gt;range&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;comparedNum&lt;span class="sym"&gt;):&lt;/span&gt;
           testedNum &lt;span class="sym"&gt;=&lt;/span&gt; n&lt;span class="sym"&gt;-(&lt;/span&gt;back&lt;span class="sym"&gt;+&lt;/span&gt;&lt;span class="num"&gt;1&lt;/span&gt;&lt;span class="sym"&gt;)&lt;/span&gt;
           &lt;span class="kwa"&gt;if&lt;/span&gt; testedNum &lt;span class="sym"&gt;&lt;&lt;/span&gt; &lt;span class="num"&gt;0&lt;/span&gt;&lt;span class="sym"&gt;:&lt;/span&gt;
               passed &lt;span class="sym"&gt;+=&lt;/span&gt; &lt;span class="num"&gt;1&lt;/span&gt;
               &lt;span class="kwa"&gt;continue&lt;/span&gt;
           c &lt;span class="sym"&gt;=&lt;/span&gt; colors&lt;span class="sym"&gt;[&lt;/span&gt;testedNum&lt;span class="sym"&gt;]&lt;/span&gt;
           bDiff &lt;span class="sym"&gt;=&lt;/span&gt; &lt;span class="kwb"&gt;abs&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;c&lt;span class="sym"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;getBritness&lt;/span&gt;&lt;span class="sym"&gt;() -&lt;/span&gt; newC&lt;span class="sym"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;getBritness&lt;/span&gt;&lt;span class="sym"&gt;())&lt;/span&gt;
           cDiff &lt;span class="sym"&gt;=&lt;/span&gt; c &lt;span class="sym"&gt;-&lt;/span&gt; newC
           &lt;span class="kwa"&gt;if&lt;/span&gt;  cDiff &lt;span class="sym"&gt;&gt;=&lt;/span&gt; minColDiff &lt;span class="kwa"&gt;and&lt;/span&gt;  bDiff &lt;span class="sym"&gt;&gt;&lt;/span&gt; minBrit&lt;span class="sym"&gt;:&lt;/span&gt;
               passed &lt;span class="sym"&gt;+=&lt;/span&gt; &lt;span class="num"&gt;1&lt;/span&gt;
           &lt;span class="kwa"&gt;else&lt;/span&gt;&lt;span class="sym"&gt;:&lt;/span&gt;
               &lt;span class="kwa"&gt;break&lt;/span&gt;
       &lt;span class="kwa"&gt;if&lt;/span&gt; passed &lt;span class="sym"&gt;==&lt;/span&gt; comparedNum&lt;span class="sym"&gt;:&lt;/span&gt;
           colors&lt;span class="sym"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;append&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;newC&lt;span class="sym"&gt;)&lt;/span&gt;
           &lt;span class="kwa"&gt;print&lt;/span&gt; &lt;span class="str"&gt;"found:"&lt;/span&gt;&lt;span class="sym"&gt;,&lt;/span&gt; newC&lt;span class="sym"&gt;,&lt;/span&gt;
           &lt;span class="kwa"&gt;break&lt;/span&gt;

       stopper &lt;span class="sym"&gt;-=&lt;/span&gt; &lt;span class="num"&gt;1&lt;/span&gt;

&lt;span class="kwa"&gt;if not&lt;/span&gt; stopper &lt;span class="sym"&gt;&gt;&lt;/span&gt; &lt;span class="num"&gt;0&lt;/span&gt;&lt;span class="sym"&gt;:&lt;/span&gt;
   &lt;span class="kwa"&gt;print&lt;/span&gt; &lt;span class="str"&gt;"searching failed"&lt;/span&gt;
&lt;span class="kwa"&gt;else&lt;/span&gt;&lt;span class="sym"&gt;:&lt;/span&gt;
   &lt;span class="kwa"&gt;print&lt;/span&gt; &lt;span class="str"&gt;"finished"&lt;/span&gt;


html &lt;span class="sym"&gt;=&lt;/span&gt; &lt;span class="str"&gt;"""&lt;/span&gt;
&lt;span class="str"&gt;&lt; head&gt;&lt;/span&gt;
&lt;span class="str"&gt;&lt;style&gt;&lt;/span&gt;
&lt;span class="str"&gt;body {&lt;/span&gt;
&lt;span class="str"&gt;    margin: 0px;&lt;/span&gt;
&lt;span class="str"&gt;    padding: 0px&lt;/span&gt;
&lt;span class="str"&gt;}&lt;/span&gt;
&lt;span class="str"&gt;div {&lt;/span&gt;
&lt;span class="str"&gt;    width: %dpx;&lt;/span&gt;
&lt;span class="str"&gt;    height: 100px;&lt;/span&gt;
&lt;span class="str"&gt;    float: left;&lt;/span&gt;
&lt;span class="str"&gt;}&lt;/span&gt;
&lt;span class="str"&gt;&lt;/style&gt;&lt;/span&gt;
&lt;span class="str"&gt;&lt; /head&gt;&lt;/span&gt;
&lt;span class="str"&gt;&lt; body&gt;&lt;/span&gt;
&lt;span class="str"&gt;"""&lt;/span&gt; &lt;span class="sym"&gt;% (&lt;/span&gt;&lt;span class="num"&gt;800&lt;/span&gt;&lt;span class="sym"&gt;/&lt;/span&gt;n&lt;span class="sym"&gt;)&lt;/span&gt;

python &lt;span class="sym"&gt;=&lt;/span&gt; &lt;span class="str"&gt;"colors = ("&lt;/span&gt;

&lt;span class="kwa"&gt;for&lt;/span&gt; c &lt;span class="kwa"&gt;in&lt;/span&gt; colors&lt;span class="sym"&gt;:&lt;/span&gt;
   html &lt;span class="sym"&gt;+=&lt;/span&gt; &lt;span class="str"&gt;'&lt;div style="background-color: #%s"&gt;&lt;/div&gt;&lt;/span&gt;&lt;span class="esc"&gt;\n&lt;/span&gt;&lt;span class="str"&gt;'&lt;/span&gt; &lt;span class="sym"&gt;%&lt;/span&gt; c
   python &lt;span class="sym"&gt;+=&lt;/span&gt; &lt;span class="str"&gt;'"%s", '&lt;/span&gt; &lt;span class="sym"&gt;%&lt;/span&gt; c

python &lt;span class="sym"&gt;=&lt;/span&gt; python&lt;span class="sym"&gt;[:-&lt;/span&gt;&lt;span class="num"&gt;2&lt;/span&gt;&lt;span class="sym"&gt;] +&lt;/span&gt; &lt;span class="str"&gt;")"&lt;/span&gt;
html &lt;span class="sym"&gt;+=&lt;/span&gt; &lt;span class="str"&gt;"&lt; /body&gt;"&lt;/span&gt;

out &lt;span class="sym"&gt;=&lt;/span&gt; &lt;span class="kwb"&gt;file&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"colors.html"&lt;/span&gt;&lt;span class="sym"&gt;,&lt;/span&gt; &lt;span class="str"&gt;"w"&lt;/span&gt;&lt;span class="sym"&gt;)&lt;/span&gt;

&lt;span class="kwa"&gt;print&lt;/span&gt; &lt;span class="sym"&gt;&gt;&gt;&lt;/span&gt;out&lt;span class="sym"&gt;,&lt;/span&gt; html
&lt;span class="kwa"&gt;print&lt;/span&gt; python

out&lt;span class="sym"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;close&lt;/span&gt;&lt;span class="sym"&gt;()&lt;/span&gt; &lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36064380-2376703634134315116?l=hse-at-work.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hse-at-work.blogspot.com/feeds/2376703634134315116/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36064380&amp;postID=2376703634134315116&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/2376703634134315116'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/2376703634134315116'/><link rel='alternate' type='text/html' href='http://hse-at-work.blogspot.com/2006/11/color-scheme-generator-for-charts.html' title='Color Scheme Generator for Charts'/><author><name>Seweryn Niemiec</name><uri>http://www.blogger.com/profile/04092697334685699065</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36064380.post-2817432287783646692</id><published>2006-11-21T12:42:00.000+01:00</published><updated>2006-11-25T18:11:25.856+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='synchronization'/><category scheme='http://www.blogger.com/atom/ns#' term='GMF'/><category scheme='http://www.blogger.com/atom/ns#' term='EMF'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>Synchronizing EMF and GMF Generated Editors</title><content type='html'>&lt;p&gt;Frequently one does not want graphical representation for objects of all classes of semantic model in a graphical diagram editor, but &lt;span style="font-style: italic;"&gt;graphical objects&lt;/span&gt; usually have references to &lt;span style="font-style: italic;"&gt;non-graphical&lt;/span&gt; and there is still need for creating and editing all of them. In that case it would be nice to reuse EMF generated editor for non-graphical elements as a helper for diagram editor, so there would be no need for creation of custom edit forms. Full article is &lt;a href="http://docs.google.com/View?docid=dcqc65c5_168kvf4"&gt;here&lt;/a&gt;.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36064380-2817432287783646692?l=hse-at-work.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hse-at-work.blogspot.com/feeds/2817432287783646692/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36064380&amp;postID=2817432287783646692&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/2817432287783646692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/2817432287783646692'/><link rel='alternate' type='text/html' href='http://hse-at-work.blogspot.com/2006/11/synchronizing-emf-and-gmf-generated.html' title='Synchronizing EMF and GMF Generated Editors'/><author><name>Seweryn Niemiec</name><uri>http://www.blogger.com/profile/04092697334685699065</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36064380.post-9045426944173761335</id><published>2006-11-16T17:20:00.000+01:00</published><updated>2006-11-16T18:34:05.557+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='regex IP IPv4 regexp pattern'/><title type='text'>Regular Expression To Match IPv4 Addresses</title><content type='html'>I needed a regex pattern to match IPv4 addresses today. I thought that this is quite common
thing and it will be easy to find one on the Net. I have found a lot of them indeed. Unfortunately no one was good enough. Most of them was too simple and could match a string which is not IPv4 address. On the other hand, those more specific didn't match some fully legal IPv4 addresses (for example the one from &lt;a href="http://regexlib.com/Search.aspx?k=ipv4"&gt;regexlib.com&lt;/a&gt;).  So I have developed my own:

&lt;pre&gt;
&lt;span &gt;((2[0-5]{2}|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(2[0-5]{2}|2[0-4]\d|1\d{2}|[1-9]\d|\d)
(/(3[012]|[12]\d|\d))?
&lt;/pre&gt;

This pattern matches all (I hope) IPv4 addresses in &lt;a href="http://en.wikipedia.org/wiki/Dot-decimal_notation"&gt;&lt;b&gt;dot-decimal notation&lt;/b&gt;&lt;/a&gt; (first line) and network blocks in &lt;a href="http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing"&gt;CIDR&lt;/a&gt; notation (when you join second line).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36064380-9045426944173761335?l=hse-at-work.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hse-at-work.blogspot.com/feeds/9045426944173761335/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36064380&amp;postID=9045426944173761335&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/9045426944173761335'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/9045426944173761335'/><link rel='alternate' type='text/html' href='http://hse-at-work.blogspot.com/2006/11/regular-expression-to-match-ipv4.html' title='Regular Expression To Match IPv4 Addresses'/><author><name>Seweryn Niemiec</name><uri>http://www.blogger.com/profile/04092697334685699065</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36064380.post-7451896438808673077</id><published>2006-11-02T18:12:00.000+01:00</published><updated>2006-11-17T11:00:22.181+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rrdtool'/><category scheme='http://www.blogger.com/atom/ns#' term='charts'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='MUD'/><title type='text'>Visualization of Progress in MUDding using Python and RRDTool</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger2/3196/4402/1600/test.0.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://photos1.blogger.com/blogger2/3196/4402/200/test.png" alt="" border="0" /&gt;&lt;/a&gt;


I like skill-based, level-less &lt;a href="http://atp.pedia.szote.u-szeged.hu/%7Eatp/"&gt;MUD&lt;/a&gt;s, so this will be about one of such MUDs, but provided here scripts probably can be adopted to any MUD system or even to any log file. Skill-based MUDs send special message to player when he archives progress in character development. Such message can look like this:

&lt;pre&gt; "You learned a trick of casting snake rune" &lt;/pre&gt;
Let's try to write some code which can visualise progress of character development on time axis. As input data we will use log of all mud sessions. Saving mud session to log-file can be configured in most mud clients.

First we have to extract progression marks and their essence. This can be easily done using following *nix commands:

&lt;pre&gt;grep 'You learned a trick of ' atp_log_0 | \
sort | \
sed -e 's/You learned a trick of casting \([a-zA-Z ]\+\).*/\1/'
&lt;/pre&gt;
As a result we will get something like this:
&lt;pre&gt;...
snake rune
stoneskin
stoneskin
stoneskin
summon
summon
...
&lt;/pre&gt;Now the harder part, we have to count occurrences of the same strings and put them to some database. To see changes in time we have to do this regularly, for example every hour. In this case &lt;a href="http://oss.oetiker.ch/rrdtool/"&gt;rrdtool&lt;/a&gt; would be very good as database engine. Following Python script will do everything what we need:


&lt;pre&gt;&lt;tt&gt;&lt;span style="font-style: italic"&gt;&lt;span style="color: #9A1900"&gt;#!/usr/bin/python&lt;/span&gt;&lt;/span&gt;

&lt;span style="font-weight: bold"&gt;&lt;span style="color: #0000FF"&gt;import&lt;/span&gt;&lt;/span&gt; os
&lt;span style="font-weight: bold"&gt;&lt;span style="color: #0000FF"&gt;import&lt;/span&gt;&lt;/span&gt; rrdtool
&lt;span style="font-weight: bold"&gt;&lt;span style="color: #0000FF"&gt;from&lt;/span&gt;&lt;/span&gt; sys &lt;span style="font-weight: bold"&gt;&lt;span style="color: #0000FF"&gt;import&lt;/span&gt;&lt;/span&gt; argv
&lt;span style="font-weight: bold"&gt;&lt;span style="color: #0000FF"&gt;from&lt;/span&gt;&lt;/span&gt; sys &lt;span style="font-weight: bold"&gt;&lt;span style="color: #0000FF"&gt;import&lt;/span&gt;&lt;/span&gt; exit

&lt;span style="font-weight: bold"&gt;&lt;span style="color: #0000FF"&gt;if&lt;/span&gt;&lt;/span&gt; &lt;span style="font-weight: bold"&gt;&lt;span style="color: #000000"&gt;len&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #990000"&gt;(&lt;/span&gt;argv&lt;span style="color: #990000"&gt;)&lt;/span&gt; &lt;span style="color: #990000"&gt;!&lt;/span&gt;&lt;span style="color: #990000"&gt;=&lt;/span&gt; &lt;span style="color: #993399"&gt;2&lt;/span&gt;&lt;span style="color: #990000"&gt;:&lt;/span&gt;
    &lt;span style="font-weight: bold"&gt;&lt;span style="color: #0000FF"&gt;print&lt;/span&gt;&lt;/span&gt; &lt;span style="color: #FF0000"&gt;"USAGE: %s prepared_log"&lt;/span&gt; &lt;span style="color: #990000"&gt;%&lt;/span&gt; argv&lt;span style="color: #990000"&gt;[&lt;/span&gt;&lt;span style="color: #993399"&gt;0&lt;/span&gt;&lt;span style="color: #990000"&gt;]&lt;/span&gt;
    &lt;span style="font-weight: bold"&gt;&lt;span style="color: #000000"&gt;exit&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #990000"&gt;(&lt;/span&gt;&lt;span style="color: #993399"&gt;1&lt;/span&gt;&lt;span style="color: #990000"&gt;)&lt;/span&gt;

lines &lt;span style="color: #990000"&gt;=&lt;/span&gt; &lt;span style="font-weight: bold"&gt;&lt;span style="color: #000000"&gt;open&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #990000"&gt;(&lt;/span&gt;argv&lt;span style="color: #990000"&gt;[&lt;/span&gt;&lt;span style="color: #993399"&gt;1&lt;/span&gt;&lt;span style="color: #990000"&gt;]&lt;/span&gt;&lt;span style="color: #990000"&gt;,&lt;/span&gt; &lt;span style="color: #FF0000"&gt;"r"&lt;/span&gt;&lt;span style="color: #990000"&gt;)&lt;/span&gt;&lt;span style="color: #990000"&gt;.&lt;/span&gt;&lt;span style="font-weight: bold"&gt;&lt;span style="color: #000000"&gt;readlines&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #990000"&gt;(&lt;/span&gt;&lt;span style="color: #990000"&gt;)&lt;/span&gt;

counter &lt;span style="color: #990000"&gt;=&lt;/span&gt; &lt;span style="color: #990000"&gt;{&lt;/span&gt;&lt;span style="color: #990000"&gt;}&lt;/span&gt;

spell &lt;span style="color: #990000"&gt;=&lt;/span&gt; &lt;span style="color: #FF0000"&gt;""&lt;/span&gt;
&lt;span style="font-weight: bold"&gt;&lt;span style="color: #0000FF"&gt;for&lt;/span&gt;&lt;/span&gt; line &lt;span style="font-weight: bold"&gt;&lt;span style="color: #0000FF"&gt;in&lt;/span&gt;&lt;/span&gt; lines&lt;span style="color: #990000"&gt;:&lt;/span&gt;
    line &lt;span style="color: #990000"&gt;=&lt;/span&gt; line&lt;span style="color: #990000"&gt;[&lt;/span&gt;&lt;span style="color: #990000"&gt;:&lt;/span&gt;&lt;span style="color: #990000"&gt;-&lt;/span&gt;&lt;span style="color: #993399"&gt;1&lt;/span&gt;&lt;span style="color: #990000"&gt;]&lt;/span&gt;
    &lt;span style="font-weight: bold"&gt;&lt;span style="color: #0000FF"&gt;if&lt;/span&gt;&lt;/span&gt; spell &lt;span style="color: #990000"&gt;=&lt;/span&gt;&lt;span style="color: #990000"&gt;=&lt;/span&gt; line&lt;span style="color: #990000"&gt;:&lt;/span&gt;
        counter&lt;span style="color: #990000"&gt;[&lt;/span&gt;line&lt;span style="color: #990000"&gt;]&lt;/span&gt; &lt;span style="color: #990000"&gt;+&lt;/span&gt;&lt;span style="color: #990000"&gt;=&lt;/span&gt; &lt;span style="color: #993399"&gt;1&lt;/span&gt;
    &lt;span style="font-weight: bold"&gt;&lt;span style="color: #0000FF"&gt;else&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #990000"&gt;:&lt;/span&gt;
        counter&lt;span style="color: #990000"&gt;[&lt;/span&gt;line&lt;span style="color: #990000"&gt;]&lt;/span&gt; &lt;span style="color: #990000"&gt;=&lt;/span&gt; &lt;span style="color: #993399"&gt;1&lt;/span&gt;
    spell &lt;span style="color: #990000"&gt;=&lt;/span&gt; line

&lt;span style="font-weight: bold"&gt;&lt;span style="color: #0000FF"&gt;for&lt;/span&gt;&lt;/span&gt; spell &lt;span style="font-weight: bold"&gt;&lt;span style="color: #0000FF"&gt;in&lt;/span&gt;&lt;/span&gt; counter&lt;span style="color: #990000"&gt;.&lt;/span&gt;&lt;span style="font-weight: bold"&gt;&lt;span style="color: #000000"&gt;keys&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #990000"&gt;(&lt;/span&gt;&lt;span style="color: #990000"&gt;)&lt;/span&gt;&lt;span style="color: #990000"&gt;:&lt;/span&gt;
    &lt;span style="font-weight: bold"&gt;&lt;span style="color: #0000FF"&gt;print&lt;/span&gt;&lt;/span&gt; spell &lt;span style="color: #990000"&gt;+&lt;/span&gt; &lt;span style="color: #FF0000"&gt;": "&lt;/span&gt; &lt;span style="color: #990000"&gt;+&lt;/span&gt; &lt;span style="font-weight: bold"&gt;&lt;span style="color: #000000"&gt;str&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #990000"&gt;(&lt;/span&gt;counter&lt;span style="color: #990000"&gt;[&lt;/span&gt;spell&lt;span style="color: #990000"&gt;]&lt;/span&gt;&lt;span style="color: #990000"&gt;)&lt;/span&gt;
    rrdFileName &lt;span style="color: #990000"&gt;=&lt;/span&gt; spell &lt;span style="color: #990000"&gt;+&lt;/span&gt; &lt;span style="color: #FF0000"&gt;".rrd"&lt;/span&gt;
    &lt;span style="font-weight: bold"&gt;&lt;span style="color: #0000FF"&gt;if&lt;/span&gt;&lt;/span&gt; &lt;span style="font-weight: bold"&gt;&lt;span style="color: #0000FF"&gt;not&lt;/span&gt;&lt;/span&gt; os&lt;span style="color: #990000"&gt;.&lt;/span&gt;path&lt;span style="color: #990000"&gt;.&lt;/span&gt;&lt;span style="font-weight: bold"&gt;&lt;span style="color: #000000"&gt;exists&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #990000"&gt;(&lt;/span&gt;rrdFileName&lt;span style="color: #990000"&gt;)&lt;/span&gt;&lt;span style="color: #990000"&gt;:&lt;/span&gt;
        &lt;span style="font-style: italic"&gt;&lt;span style="color: #9A1900"&gt;# create rrd file&lt;/span&gt;&lt;/span&gt;
        rrdtool&lt;span style="color: #990000"&gt;.&lt;/span&gt;&lt;span style="font-weight: bold"&gt;&lt;span style="color: #000000"&gt;create&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #990000"&gt;(&lt;/span&gt;rrdFileName&lt;span style="color: #990000"&gt;,&lt;/span&gt; &lt;span style="color: #FF0000"&gt;'-s'&lt;/span&gt;&lt;span style="color: #990000"&gt;,&lt;/span&gt; &lt;span style="color: #FF0000"&gt;'3600'&lt;/span&gt;&lt;span style="color: #990000"&gt;,&lt;/span&gt;
            &lt;span style="color: #FF0000"&gt;'DS:data:COUNTER:86400:0:50000'&lt;/span&gt;&lt;span style="color: #990000"&gt;,&lt;/span&gt;
            &lt;span style="color: #FF0000"&gt;'RRA:AVERAGE:0.5:1:5000'&lt;/span&gt;&lt;span style="color: #990000"&gt;)&lt;/span&gt;
        &lt;span style="font-weight: bold"&gt;&lt;span style="color: #0000FF"&gt;print&lt;/span&gt;&lt;/span&gt; &lt;span style="color: #FF0000"&gt;"created: "&lt;/span&gt; &lt;span style="color: #990000"&gt;+&lt;/span&gt; rrdFileName
    rrdtool&lt;span style="color: #990000"&gt;.&lt;/span&gt;&lt;span style="font-weight: bold"&gt;&lt;span style="color: #000000"&gt;update&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #990000"&gt;(&lt;/span&gt;rrdFileName&lt;span style="color: #990000"&gt;,&lt;/span&gt; &lt;span style="color: #FF0000"&gt;'N:'&lt;/span&gt; &lt;span style="color: #990000"&gt;+&lt;/span&gt; &lt;span style="font-weight: bold"&gt;&lt;span style="color: #000000"&gt;str&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #990000"&gt;(&lt;/span&gt;counter&lt;span style="color: #990000"&gt;[&lt;/span&gt;spell&lt;span style="color: #990000"&gt;]&lt;/span&gt;&lt;span style="color: #990000"&gt;)&lt;/span&gt;&lt;span style="color: #990000"&gt;)&lt;/span&gt;
&lt;/tt&gt;&lt;/pre&gt;Now we have to play MUD for few hours and collect data. Finally we can attempt to perform visualisation.
Manual generation of image[s] with charts from all .rrd files can be tiring, so we will use following Python script:
&lt;pre&gt;&lt;tt&gt;&lt;span style="font-style: italic"&gt;&lt;span style="color: #9A1900"&gt;#!/usr/bin/python&lt;/span&gt;&lt;/span&gt;

&lt;span style="font-weight: bold"&gt;&lt;span style="color: #0000FF"&gt;import&lt;/span&gt;&lt;/span&gt; os

RRD_EXT &lt;span style="color: #990000"&gt;=&lt;/span&gt; &lt;span style="color: #FF0000"&gt;".rrd"&lt;/span&gt;

colors &lt;span style="color: #990000"&gt;=&lt;/span&gt; &lt;span style="color: #990000"&gt;(&lt;/span&gt;&lt;span style="color: #FF0000"&gt;"B81818"&lt;/span&gt;&lt;span style="color: #990000"&gt;,&lt;/span&gt;&lt;span style="color: #FF0000"&gt;"5CDE00"&lt;/span&gt;&lt;span style="color: #990000"&gt;,&lt;/span&gt;&lt;span style="color: #FF0000"&gt;"0089DE"&lt;/span&gt;&lt;span style="color: #990000"&gt;,&lt;/span&gt;
    &lt;span style="color: #FF0000"&gt;"1A1F14"&lt;/span&gt;&lt;span style="color: #990000"&gt;,&lt;/span&gt;&lt;span style="color: #FF0000"&gt;"DEC400"&lt;/span&gt;&lt;span style="color: #990000"&gt;,&lt;/span&gt;&lt;span style="color: #FF0000"&gt;"486B20"&lt;/span&gt;&lt;span style="color: #990000"&gt;,&lt;/span&gt;&lt;span style="color: #FF0000"&gt;"1216A1"&lt;/span&gt;&lt;span style="color: #990000"&gt;,&lt;/span&gt;
    &lt;span style="color: #FF0000"&gt;"432A96"&lt;/span&gt;&lt;span style="color: #990000"&gt;,&lt;/span&gt;&lt;span style="color: #FF0000"&gt;"913F64"&lt;/span&gt;&lt;span style="color: #990000"&gt;,&lt;/span&gt;&lt;span style="color: #FF0000"&gt;"9A3C17"&lt;/span&gt;&lt;span style="color: #990000"&gt;,&lt;/span&gt;&lt;span style="color: #FF0000"&gt;"F4A179"&lt;/span&gt;&lt;span style="color: #990000"&gt;,&lt;/span&gt;&lt;span style="color: #FF0000"&gt;"4B7B47"&lt;/span&gt;&lt;span style="color: #990000"&gt;,&lt;/span&gt;
    &lt;span style="color: #FF0000"&gt;"7E6C67"&lt;/span&gt;&lt;span style="color: #990000"&gt;,&lt;/span&gt;&lt;span style="color: #FF0000"&gt;"51D9F4"&lt;/span&gt;&lt;span style="color: #990000"&gt;,&lt;/span&gt;&lt;span style="color: #FF0000"&gt;"559E7B"&lt;/span&gt;&lt;span style="color: #990000"&gt;,&lt;/span&gt;&lt;span style="color: #FF0000"&gt;"4B4D35"&lt;/span&gt;&lt;span style="color: #990000"&gt;,&lt;/span&gt;&lt;span style="color: #FF0000"&gt;"D8980E"&lt;/span&gt;&lt;span style="color: #990000"&gt;,&lt;/span&gt;&lt;span style="color: #FF0000"&gt;"A32245"&lt;/span&gt;&lt;span style="color: #990000"&gt;)&lt;/span&gt;

defs &lt;span style="color: #990000"&gt;=&lt;/span&gt; &lt;span style="color: #FF0000"&gt;""&lt;/span&gt;
lines &lt;span style="color: #990000"&gt;=&lt;/span&gt; &lt;span style="color: #FF0000"&gt;""&lt;/span&gt;
num &lt;span style="color: #990000"&gt;=&lt;/span&gt; &lt;span style="color: #993399"&gt;0&lt;/span&gt;&lt;span style="color: #990000"&gt;;&lt;/span&gt;
numc &lt;span style="color: #990000"&gt;=&lt;/span&gt; &lt;span style="color: #993399"&gt;0&lt;/span&gt;&lt;span style="color: #990000"&gt;;&lt;/span&gt;
files &lt;span style="color: #990000"&gt;=&lt;/span&gt; os&lt;span style="color: #990000"&gt;.&lt;/span&gt;&lt;span style="font-weight: bold"&gt;&lt;span style="color: #000000"&gt;listdir&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #990000"&gt;(&lt;/span&gt;&lt;span style="color: #FF0000"&gt;"."&lt;/span&gt;&lt;span style="color: #990000"&gt;)&lt;/span&gt;
&lt;span style="font-weight: bold"&gt;&lt;span style="color: #0000FF"&gt;for&lt;/span&gt;&lt;/span&gt; file &lt;span style="font-weight: bold"&gt;&lt;span style="color: #0000FF"&gt;in&lt;/span&gt;&lt;/span&gt; files&lt;span style="color: #990000"&gt;:&lt;/span&gt;
    base&lt;span style="color: #990000"&gt;,&lt;/span&gt;ext &lt;span style="color: #990000"&gt;=&lt;/span&gt; os&lt;span style="color: #990000"&gt;.&lt;/span&gt;path&lt;span style="color: #990000"&gt;.&lt;/span&gt;&lt;span style="font-weight: bold"&gt;&lt;span style="color: #000000"&gt;splitext&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #990000"&gt;(&lt;/span&gt;file&lt;span style="color: #990000"&gt;)&lt;/span&gt;
    &lt;span style="font-weight: bold"&gt;&lt;span style="color: #0000FF"&gt;if&lt;/span&gt;&lt;/span&gt; ext &lt;span style="color: #990000"&gt;=&lt;/span&gt;&lt;span style="color: #990000"&gt;=&lt;/span&gt; RRD_EXT&lt;span style="color: #990000"&gt;:&lt;/span&gt;
        color &lt;span style="color: #990000"&gt;=&lt;/span&gt; colors&lt;span style="color: #990000"&gt;[&lt;/span&gt;numc&lt;span style="color: #990000"&gt;]&lt;/span&gt;
        defs &lt;span style="color: #990000"&gt;+&lt;/span&gt;&lt;span style="color: #990000"&gt;=&lt;/span&gt; &lt;span style="color: #FF0000"&gt;'DEF:d%d="%s":data:AVERAGE '&lt;/span&gt; &lt;span style="color: #990000"&gt;%&lt;/span&gt; &lt;span style="color: #990000"&gt;(&lt;/span&gt;num&lt;span style="color: #990000"&gt;,&lt;/span&gt; file&lt;span style="color: #990000"&gt;)&lt;/span&gt;
        lines &lt;span style="color: #990000"&gt;+&lt;/span&gt;&lt;span style="color: #990000"&gt;=&lt;/span&gt; &lt;span style="color: #FF0000"&gt;'AREA:d%d#%s:"%s":STACK '&lt;/span&gt; &lt;span style="color: #990000"&gt;%&lt;/span&gt; &lt;span style="color: #990000"&gt;(&lt;/span&gt;num&lt;span style="color: #990000"&gt;,&lt;/span&gt; color&lt;span style="color: #990000"&gt;,&lt;/span&gt; base&lt;span style="color: #990000"&gt;)&lt;/span&gt;
        num &lt;span style="color: #990000"&gt;+&lt;/span&gt;&lt;span style="color: #990000"&gt;=&lt;/span&gt; &lt;span style="color: #993399"&gt;1&lt;/span&gt;
        &lt;span style="font-weight: bold"&gt;&lt;span style="color: #0000FF"&gt;if&lt;/span&gt;&lt;/span&gt; &lt;span style="font-weight: bold"&gt;&lt;span style="color: #000000"&gt;len&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #990000"&gt;(&lt;/span&gt;colors&lt;span style="color: #990000"&gt;)&lt;/span&gt; &lt;span style="color: #990000"&gt;=&lt;/span&gt;&lt;span style="color: #990000"&gt;=&lt;/span&gt; numc&lt;span style="color: #990000"&gt;:&lt;/span&gt;
            numc &lt;span style="color: #990000"&gt;=&lt;/span&gt; &lt;span style="color: #993399"&gt;0&lt;/span&gt;&lt;span style="color: #990000"&gt;;&lt;/span&gt;
        &lt;span style="font-weight: bold"&gt;&lt;span style="color: #0000FF"&gt;else&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #990000"&gt;:&lt;/span&gt;
            numc &lt;span style="color: #990000"&gt;+&lt;/span&gt;&lt;span style="color: #990000"&gt;=&lt;/span&gt; &lt;span style="color: #993399"&gt;1&lt;/span&gt;

command &lt;span style="color: #990000"&gt;=&lt;/span&gt; &lt;span style="color: #FF0000"&gt;'rrdtool graph test.png --end now --start end-58h '&lt;/span&gt; &lt;span style="color: #990000"&gt;+&lt;/span&gt; &lt;span style="color: #990000"&gt;\&lt;/span&gt;
&lt;span style="color: #FF0000"&gt;'--height 400 --width 600 '&lt;/span&gt; &lt;span style="color: #990000"&gt;+&lt;/span&gt; defs &lt;span style="color: #990000"&gt;+&lt;/span&gt; &lt;span style="color: #FF0000"&gt;' '&lt;/span&gt; &lt;span style="color: #990000"&gt;+&lt;/span&gt; lines

k &lt;span style="color: #990000"&gt;=&lt;/span&gt; os&lt;span style="color: #990000"&gt;.&lt;/span&gt;&lt;span style="font-weight: bold"&gt;&lt;span style="color: #000000"&gt;system&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #990000"&gt;(&lt;/span&gt;command&lt;span style="color: #990000"&gt;)&lt;/span&gt;
&lt;span style="font-weight: bold"&gt;&lt;span style="color: #0000FF"&gt;if&lt;/span&gt;&lt;/span&gt; k &lt;span style="color: #990000"&gt;=&lt;/span&gt;&lt;span style="color: #990000"&gt;=&lt;/span&gt; &lt;span style="color: #993399"&gt;0&lt;/span&gt;&lt;span style="color: #990000"&gt;:&lt;/span&gt;
    os&lt;span style="color: #990000"&gt;.&lt;/span&gt;&lt;span style="font-weight: bold"&gt;&lt;span style="color: #000000"&gt;system&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #990000"&gt;(&lt;/span&gt;&lt;span style="color: #FF0000"&gt;"eog test.png"&lt;/span&gt;&lt;span style="color: #990000"&gt;)&lt;/span&gt;
&lt;span style="font-weight: bold"&gt;&lt;span style="color: #0000FF"&gt;else&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #990000"&gt;:&lt;/span&gt;
    &lt;span style="font-weight: bold"&gt;&lt;span style="color: #0000FF"&gt;print&lt;/span&gt;&lt;/span&gt; &lt;span style="color: #FF0000"&gt;"error code: "&lt;/span&gt;&lt;span style="color: #990000"&gt;,&lt;/span&gt; k
&lt;/tt&gt;&lt;/pre&gt;"eog" is a standard Gnome image viewer. Of course you can put here your favourite one.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36064380-7451896438808673077?l=hse-at-work.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hse-at-work.blogspot.com/feeds/7451896438808673077/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36064380&amp;postID=7451896438808673077&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/7451896438808673077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/7451896438808673077'/><link rel='alternate' type='text/html' href='http://hse-at-work.blogspot.com/2006/11/visualisation-of-progress-in-mudding.html' title='Visualization of Progress in MUDding using Python and RRDTool'/><author><name>Seweryn Niemiec</name><uri>http://www.blogger.com/profile/04092697334685699065</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36064380.post-6003310291036393243</id><published>2006-10-31T20:45:00.000+01:00</published><updated>2006-11-30T15:19:54.021+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vlans'/><category scheme='http://www.blogger.com/atom/ns#' term='Catalyst'/><category scheme='http://www.blogger.com/atom/ns#' term='MIB'/><category scheme='http://www.blogger.com/atom/ns#' term='SNMP'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>Cisco/Catalyst Vlans on Ports - final solution</title><content type='html'>&lt;p&gt;With great help from Cisco NMS EMEA TAC, I have finally found solution to map tagged and untagged vlans to physical ports on the Cisco Catalyst switches, without using SNMP Community String Indexing (&lt;a href="http://www.cisco.com/en/US/tech/tk648/tk362/technologies_tech_note09186a00801576ff.shtml"&gt;CSI&lt;/a&gt;). With CSI one can select entity/instance of multi-instanced MIBs, but it is quite awkward and not well supported on most NMSs because you have to use separate community strings for every instance. On Catalysts, BRIDGE-MIB is a multi-instanced MIB, instances of which exist separately for every VLAN. Its dot1dBaseTable is the only way to map bridge port numbers to interfaces from ifTable. Some SNMP tables use bridge port numbering to point physical ports, so to bind data from that tables to something more tangible than bridge port number (like interface from IF-MIB or physical port from ENTITY-MIB) one have to scan dot1dBaseTable 3000 times , in case of having 3000 vlans!&lt;/p&gt;&lt;br&gt;
&lt;p&gt;I came up against BRIDGE-MIB and CIS in Vlan-&gt;Port mapping case because of the port numbering used in &lt;span style="font-style: italic;"&gt;vmMembershipSummaryTable&lt;/span&gt; (CISCO-VLAN-MEMBERSHIP-MIB). I have been using that table to get access ports (ports with only one untagged vlan) for given vlan. CISCO-VLAN-MEMBERSHIP-MIB has another table - vmMembershipTable - which looked promising, but due to some kind of blackout of my mind, I thought that &lt;a href="http://tools.cisco.com/Support/SNMP/do/BrowseOID.do?local=en&amp;translate=Translate&amp;amp;objectInput=1.3.6.1.4.1.9.9.68.1.2.2"&gt;vmMembershipTable&lt;/a&gt; is write only and I have to use that damn &lt;a href="http://tools.cisco.com/Support/SNMP/do/BrowseOID.do?local=en&amp;translate=Translate&amp;amp;objectInput=1.3.6.1.4.1.9.9.68.1.2.1"&gt;vmMembershipSummaryTable&lt;/a&gt;. Now I know that vmMembershipTable can be read, is indexed in the the same manner as interfaces in ifTable and has one very useful column: &lt;span style="font-style: italic;"&gt;vmVlan&lt;/span&gt;.&lt;/p&gt;&lt;br&gt;
&lt;p&gt;So for tagged vlans use &lt;a href="http://tools.cisco.com/Support/SNMP/do/BrowseOID.do?local=en&amp;translate=Translate&amp;amp;objectInput=1.3.6.1.4.1.9.9.46.1.6.1"&gt;
vlanTrunkPortTable&lt;/a&gt; and for untagged - &lt;a href="http://tools.cisco.com/Support/SNMP/do/BrowseOID.do?local=en&amp;translate=Translate&amp;amp;objectInput=1.3.6.1.4.1.9.9.68.1.2.2"&gt;
vmMembershipTable&lt;/a&gt;. Booth contain links to interfaces in ifTable, which can be easily linked to physical ports in ENTITY-MIB, then.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36064380-6003310291036393243?l=hse-at-work.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hse-at-work.blogspot.com/feeds/6003310291036393243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36064380&amp;postID=6003310291036393243&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/6003310291036393243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/6003310291036393243'/><link rel='alternate' type='text/html' href='http://hse-at-work.blogspot.com/2006/10/ciscocatalyst-vlans-on-ports-final.html' title='Cisco/Catalyst Vlans on Ports - final solution'/><author><name>Seweryn Niemiec</name><uri>http://www.blogger.com/profile/04092697334685699065</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36064380.post-8493296888716073799</id><published>2006-10-20T23:48:00.000+02:00</published><updated>2006-10-21T10:26:36.756+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Beryl'/><category scheme='http://www.blogger.com/atom/ns#' term='Xgl'/><title type='text'>Beryl on Xgl</title><content type='html'>Finally I have &lt;a href="http://www.beryl-project.org/"&gt;Beryl&lt;/a&gt; running on my desktop at home.

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger2/3196/4402/1600/scr1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger2/3196/4402/400/scr1.png" alt="" border="0" /&gt;&lt;/a&gt;If you want to better feel how it works (this is very dynamic gadget) then check &lt;a href="http://youtube.com/watch?v=i0ZtcxHUSDQ"&gt;this video&lt;/a&gt;.

I don't like this wavy animation of window [un]minimization, so I've changed it to something else. Beryl setting manager allows you to change almost everything without pain in the ass. Usually all changes take affect immediately and you don't have to restart window manager, but in random cases it doesn't work.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36064380-8493296888716073799?l=hse-at-work.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hse-at-work.blogspot.com/feeds/8493296888716073799/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36064380&amp;postID=8493296888716073799&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/8493296888716073799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/8493296888716073799'/><link rel='alternate' type='text/html' href='http://hse-at-work.blogspot.com/2006/10/beryl-on-xgl.html' title='Beryl on Xgl'/><author><name>Seweryn Niemiec</name><uri>http://www.blogger.com/profile/04092697334685699065</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36064380.post-2434713740933178706</id><published>2006-10-20T17:43:00.000+02:00</published><updated>2006-11-30T15:22:50.728+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='multicasting'/><category scheme='http://www.blogger.com/atom/ns#' term='JGroups'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss Cache'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='clustered'/><title type='text'>JGrups on Linux With Multiple Network Interfaces</title><content type='html'>&lt;p&gt;Few hints for those, who want to run JBoss Cache in clustered mode ([a]synchronous replication/invalidation) on Linux machine with multiple network interface  cards (NICs) and using UDP/multicasting in OSI layers 4/3 . Here is situation overview:

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger2/3196/4402/1600/siec_linux.2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger2/3196/4402/400/siec_linux.png" alt="" border="0" /&gt;&lt;/a&gt;We need multicast communication through &lt;span style="font-style: italic;"&gt;eth1&lt;/span&gt; to other JBoss Cache nodes.
&lt;br&gt;
JBoss Cache uses &lt;a href="http://www.jgroups.org/"&gt;JGroups&lt;/a&gt; for network communication. And I'm going to focus on configuration of this service (Cache configuration is very easy). First of all, for device with multiple NICs, you need to specify a bind address in configuration file (of course if use xml file to configure services) in section&lt;span style="font-style: italic;"&gt; ClusterConfig/UDP&lt;/span&gt;. AFAIK this can't be &lt;span style="font-style: italic;"&gt;0.0.0.0&lt;/span&gt;. Probably you can use any address from your NICs, but I would suggest using the one from eth1 (this will be logical but it won't change process of packet generation and sending). Without this parameter service won't start throwing an exception.
&lt;/p&gt;&lt;br&gt;
&lt;p&gt;Second thing is to specify outgoing NIC. On Linux platform process run by non-root user can't specify source address and outgoing interface for it's packets. The only way to control this is through routing table. Without special entry in routing table for your cache's multicast address, all packets will go outside of machine using DEFAULT route, which in case from above picture will mean eth0. This is not what we want to archive. You can correct it like this:
&lt;blockquote&gt;$ ip r a 228.1.2.3/24 dev eth0&lt;/blockquote&gt;The last thing is packet fragmentation issue. Maybe only I had this problem, but I spend a lot of time trying to solve it. Every replication of bigger amount of data resulted in timeout exception. To get things working I had to set timeout to 120 seconds! Of course that wasn't right solution. Finally I've changed &lt;span style="font-style: italic;"&gt;max_xmit_size&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;frag_size&lt;/span&gt; parameters to MTU minus approximate size of all headers. This is about 1400 B.
&lt;/p&gt;&lt;br&gt;
&lt;p&gt;If you still have problems then check your Ethernet switch connected to eth1. For example if it has IGMP SPAN mode enabled then check if it works correctly. I had problems with it on 3Com SuperStack 3 Switch 3870 with software version 1.01.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36064380-2434713740933178706?l=hse-at-work.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hse-at-work.blogspot.com/feeds/2434713740933178706/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36064380&amp;postID=2434713740933178706&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/2434713740933178706'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/2434713740933178706'/><link rel='alternate' type='text/html' href='http://hse-at-work.blogspot.com/2006/10/jgrups-on-linux-with-multiple-network.html' title='JGrups on Linux With Multiple Network Interfaces'/><author><name>Seweryn Niemiec</name><uri>http://www.blogger.com/profile/04092697334685699065</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36064380.post-755014255776885882</id><published>2006-10-17T16:04:00.000+02:00</published><updated>2006-10-20T23:58:30.910+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Catalyst'/><category scheme='http://www.blogger.com/atom/ns#' term='VLAN'/><category scheme='http://www.blogger.com/atom/ns#' term='SNMP'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><category scheme='http://www.blogger.com/atom/ns#' term='ENTITY-MIB'/><title type='text'>Cisco MIBs horror</title><content type='html'>Suppose you want to know what vlans are configured/allowed on individual ports in one of recent Cisco Catalyst switches - quite basic information. SNMP seems to be right protocol for this task. Structure of most Catalyst switches can be discovered using ENTITY-MIB and that's good news. In entPhysicalTable you can find ports, modules, chassis and many other parts with defined relationships between them. Now you want to find vlans for discovered ports and this is where scary part starts. Since port can have many vlans and vice versa, such mapping can be done in SNMP using one column table with row index build by combination of two numbers (portID.vlanID). As value of this row could be:
&lt;ul&gt;&lt;li&gt;1 meaning native vlan&lt;/li&gt;&lt;li&gt;2 meaning tagged vlan&lt;/li&gt;&lt;/ul&gt;Lack of port-vlan combination in table would mean that this port isn't present in given vlan. Simple? Yes, but too simple for Cisco engineers.&lt;p&gt;Cisco found another solution. In order to get via SNMP vlans per port information for Cat2950, Cat2970, Cat4500 and Cat6500 (with recent IOSes) you have to correctly combine following tables:&lt;/p&gt;&lt;p&gt;&lt;span style="font-style: italic;"&gt;ifTable&lt;/span&gt; from IF-MIB
&lt;span style="font-style: italic;"&gt;entPhysicalTable&lt;/span&gt; from ENTITY-MIB,
&lt;span style="font-style: italic;"&gt;entAliasMappingTable&lt;/span&gt; from ENTITY-MIB,
&lt;span style="font-style: italic;"&gt;vtpVlanTable&lt;/span&gt; from CISCO-VTP-MIB,
&lt;span style="font-style: italic;"&gt;vlanTrunkPortTable&lt;/span&gt; from CISCO-VTP-MIB,
&lt;span style="font-style: italic;"&gt;vmMembershipSummaryTable&lt;/span&gt; from CISCO-VLAN-MEMBERSHIP-MIB,
&lt;span style="font-style: italic;"&gt;dot1dBasePortTable&lt;/span&gt; from BRIDGE-MIB&lt;/p&gt;&lt;p&gt;Some of those tables are 3D, have thousands of columns (one bit per column) and all of them use different, non-continuous indexes. But that would be still to easy. To get mapping from ports in &lt;span style="font-style: italic;"&gt;vmMembershipSummaryTable&lt;/span&gt; to ports in &lt;span style="font-style: italic;"&gt;ifTable&lt;/span&gt; you have to query &lt;span style="font-style: italic;"&gt;dot1dBasePortTable&lt;/span&gt; using separate SNMP community for every vlan. &lt;span style="font-weight: bold;"&gt;Thank you Cisco!&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Does anyone have any other idea how to solve this problem?&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36064380-755014255776885882?l=hse-at-work.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hse-at-work.blogspot.com/feeds/755014255776885882/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36064380&amp;postID=755014255776885882&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/755014255776885882'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/755014255776885882'/><link rel='alternate' type='text/html' href='http://hse-at-work.blogspot.com/2006/10/cisco-mibs-horror.html' title='Cisco MIBs horror'/><author><name>Seweryn Niemiec</name><uri>http://www.blogger.com/profile/04092697334685699065</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36064380.post-8771878756319415027</id><published>2006-10-15T16:43:00.001+02:00</published><updated>2006-10-21T18:19:33.111+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Spring Framework'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss Cache'/><category scheme='http://www.blogger.com/atom/ns#' term='SNMP'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>E-mail Posting Test</title><content type='html'>Currently I try to combine &lt;a href="http://eclipse.org/"&gt;Eclipse Platform&lt;/a&gt; &lt;a href="http://eclipse.org/"&gt;&lt;/a&gt; (OSGi, EMF, GMF) with &lt;a href="http://springframework.org/"&gt;Spring Framework&lt;/a&gt;  (as Beans container and factory) and &lt;a href="http://jboss.com/"&gt;JBoss Cache&lt;/a&gt;&lt;a href="http://jboss.com/"&gt;&lt;/a&gt; (synchronous distributed cache) and many other useful pieces of software (like &lt;a href="http://www.snmp4j.org/"&gt;SNMP4J&lt;/a&gt;) in order to build network management application.&lt;p&gt;All this software is very good. The problem is that Eclipse and JBoss suffer lack of documentation for newly developed stuff while I'm mostly interested in newly developed stuff.&lt;/p&gt;&lt;p&gt;Some measures for today:
Execution time analysis for cached/direct access to following SNMP
tables: VlanTrunkPortTable(from Cisco MIBS) and IfTable combined with InterfacesTable:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;direct run time: 1308&lt;/li&gt;&lt;li&gt;cached run time: 2684  (&lt;span style="color: rgb(0, 0, 0);"&gt;empty cache&lt;/span&gt;)&lt;/li&gt;&lt;li&gt;cached run time: 6    (&lt;span style="color: rgb(0, 0, 0);"&gt;full cache&lt;/span&gt;)&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;So building and propagating cache takes: 1376 milliseconds. That's not good.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36064380-8771878756319415027?l=hse-at-work.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hse-at-work.blogspot.com/feeds/8771878756319415027/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36064380&amp;postID=8771878756319415027&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/8771878756319415027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/8771878756319415027'/><link rel='alternate' type='text/html' href='http://hse-at-work.blogspot.com/2006/10/e-mail-posting-test.html' title='E-mail Posting Test'/><author><name>Seweryn Niemiec</name><uri>http://www.blogger.com/profile/04092697334685699065</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36064380.post-6388685931894880330</id><published>2006-10-15T15:29:00.000+02:00</published><updated>2006-10-15T16:04:47.888+02:00</updated><title type='text'>About This Blog</title><content type='html'>As always my first choice wasn't good. I had to immediately change blog template to completely different. The old one could break your eyes.

I like new things, so I've converted my blog to &lt;a href="http://beta.blogger.com/"&gt;http://beta.blogger.com. &lt;/a&gt;It's one way process, but I have nothing to loose. Let's see how this all works. In the mean time I'll worm up my tea in microwave.

This blog will be mostly about me versus resistance of some cutting edge software development technologies (usually open-source Java and Python frameworks, libraries and tools).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36064380-6388685931894880330?l=hse-at-work.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hse-at-work.blogspot.com/feeds/6388685931894880330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36064380&amp;postID=6388685931894880330&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/6388685931894880330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/6388685931894880330'/><link rel='alternate' type='text/html' href='http://hse-at-work.blogspot.com/2006/10/as-always-my-first-choice-wasnt-good.html' title='About This Blog'/><author><name>Seweryn Niemiec</name><uri>http://www.blogger.com/profile/04092697334685699065</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36064380.post-116091896078735697</id><published>2006-10-15T15:27:00.000+02:00</published><updated>2006-10-15T15:59:59.296+02:00</updated><title type='text'>Let's start</title><content type='html'>World comes to the an end. I have a blog.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36064380-116091896078735697?l=hse-at-work.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hse-at-work.blogspot.com/feeds/116091896078735697/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36064380&amp;postID=116091896078735697&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/116091896078735697'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36064380/posts/default/116091896078735697'/><link rel='alternate' type='text/html' href='http://hse-at-work.blogspot.com/2006/10/lets-start.html' title='Let&apos;s start'/><author><name>Seweryn Niemiec</name><uri>http://www.blogger.com/profile/04092697334685699065</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
