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

<channel>
	<title>Alex Scheel Meyer Weblog</title>
	<atom:link href="http://www.scheelmeyer.com/weblog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.scheelmeyer.com/weblog</link>
	<description>A bag of random stuff</description>
	<pubDate>Wed, 12 Nov 2008 19:49:16 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<item>
		<title>Visualizing Simulink Model Structure with Pyparsing</title>
		<link>http://www.scheelmeyer.com/weblog/?p=11</link>
		<comments>http://www.scheelmeyer.com/weblog/?p=11#comments</comments>
		<pubDate>Wed, 12 Nov 2008 19:49:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.scheelmeyer.com/weblog/?p=11</guid>
		<description><![CDATA[To try out some programmatic access to Simulink models, I have been using a modified version of Kjell Magne Fauske&#8217;s pyparsing Simulink parser.
I convert the structure of the model to text in the format of the DOT graphics language, so you can use the wellknown Graphviz application to create nice visualizations of your model-structure. Graphviz [...]]]></description>
			<content:encoded><![CDATA[<p>To try out some programmatic access to Simulink models, I have been using a modified version of <a href="http://www.fauskes.net/nb/parsing-simulink/">Kjell Magne Fauske&#8217;s pyparsing Simulink parser</a>.<br />
I convert the structure of the model to text in the format of the <a href="http://www.graphviz.org/doc/info/lang.html">DOT graphics language</a>, so you can use the wellknown <a href="http://www.graphviz.org/">Graphviz</a> application to create nice visualizations of your model-structure. Graphviz supports direct output to PDF, so it is also pretty nifty as a way of documenting your model.<br />
Here is the sourcecode of my little tool, I hope you find it useful :</p>
<pre name="code" class="py">

&quot;&quot;&quot;
A simple generator of DOT graphics-files from Simulink models.

Credits:
This is basically a modified version of the MDL parser written by
Kjell Magne Fauske - see http://www.fauskes.net/nb/parsing-simulink/.
Thanks Kjell!

&quot;&quot;&quot;

__author__ = &#039;Alex Scheel Meyer&#039;
__license__ = &#039;MIT&#039;

import sys

from pyparsing import *

# parse actions
def convertNumbers(s,l,toks):
  &quot;&quot;&quot;Convert tokens to int or float&quot;&quot;&quot;
  # Taken from jsonParser.py
  n = toks[0]
  try:
    return int(n)
  except ValueError, ve:
    return float(n)

def joinStrings(s,l,toks):
  &quot;&quot;&quot;Join string split over multiple lines&quot;&quot;&quot;
  return [&quot;&quot;.join(toks)]

# Define grammar
dblString = dblQuotedString.setParseAction( removeQuotes )
mdlNumber = Combine( Optional(&#039;-&#039;) + ( &#039;0&#039; | Word(&#039;123456789&#039;,nums) ) + Optional( &#039;.&#039; + Word(nums) ) + Optional( Word(&#039;eE&#039;,exact=1) + Word(nums+&#039;+-&#039;,nums) ) )
mdlObject = Forward()
mdlName = Word(&#039;$&#039;+&#039;.&#039;+&#039;_&#039;+alphas+nums)
mdlValue = Forward()
# Strings can be split over multiple lines
mdlString = (dblString + Optional(OneOrMore(Suppress(LineEnd()) + LineStart() + dblString)))
mdlElements = delimitedList( mdlValue )
mdlArray = Group(Suppress(&#039;[&#039;) + Optional(mdlElements) + Suppress(&#039;]&#039;) )
mdlMatrix =Group(Suppress(&#039;[&#039;) + (delimitedList(Group(mdlElements),&#039;;&#039;)) \
+ Suppress(&#039;]&#039;) )
mdlValue &lt;&lt; ( mdlNumber | mdlName| mdlString  | mdlArray | mdlMatrix )
memberDef = Group( mdlName  + mdlValue ) | Group(mdlObject)
mdlMembers = OneOrMore( memberDef)
mdlObject &lt;&lt; ( mdlName+Suppress(&#039;{&#039;) + Optional(mdlMembers) + Suppress(&#039;}&#039;) )
mdlNumber.setParseAction( convertNumbers )
mdlString.setParseAction(joinStrings)
mdlparser = mdlObject

def findSystems(mdlItem, systemName, knownSystems):
  for item in mdlItem:
    if item[0] == &#039;System&#039;:
      subsystemName = item[1][1]
      if subsystemName in knownSystems:
        knownSystems[subsystemName] += 1
        subsystemName = subsystemName + &#039;(&#039; + str(knownSystems[subsystemName]) + &#039;)&#039;
      else:
        knownSystems[subsystemName] = 1
      print &#039;&quot;&#039; + systemName + &#039;&quot; -&gt; &quot;&#039; + subsystemName + &#039;&quot;;&#039;
      findSystems(item, subsystemName, knownSystems)
    if item[0] == &#039;Block&#039;:
      findSystems(item, systemName, knownSystems)

if __name__ == &#039;__main__&#039;:
  import pprint
  filename = sys.argv[1]
  if len(filename) &gt; 0 :
    input = open(filename, &#039;r&#039;)
    data = input.read()
    result = mdlparser.parseString(data)
    print &quot;digraph {&quot;
    knownSystems = {}
    findSystems(result, filename, knownSystems)
    print &quot;}&quot;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.scheelmeyer.com/weblog/?feed=rss2&amp;p=11</wfw:commentRss>
		</item>
		<item>
		<title>Got hacked :(</title>
		<link>http://www.scheelmeyer.com/weblog/?p=7</link>
		<comments>http://www.scheelmeyer.com/weblog/?p=7#comments</comments>
		<pubDate>Mon, 10 Nov 2008 22:52:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.scheelmeyer.com/weblog/?p=7</guid>
		<description><![CDATA[When going through the files on the server today, I found a suspicious block of php code at the top of every php-file! It was encrypted by encoding it in base 64 and then wrapping it in
eval(base64_decode(&#8217;&#60;data&#62;&#8217;))
I haven&#8217;t really tried to decode it much, but it seems to be some kind of spamming mechanism  [...]]]></description>
			<content:encoded><![CDATA[<p>When going through the files on the server today, I found a suspicious block of php code at the top of <em>every</em> php-file! It was encrypted by encoding it in base 64 and then wrapping it in</p>
<blockquote><p>eval(base64_decode(&#8217;&lt;data&gt;&#8217;))</p></blockquote>
<p>I haven&#8217;t really tried to decode it much, but it seems to be some kind of spamming mechanism <img src='http://www.scheelmeyer.com/weblog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>Naturally I am not so thrilled about the major cleanup this involves, oh well - this is probably a good time to update Wordpress aswell then <img src='http://www.scheelmeyer.com/weblog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.scheelmeyer.com/weblog/?feed=rss2&amp;p=7</wfw:commentRss>
		</item>
		<item>
		<title>Electroma Final Scene</title>
		<link>http://www.scheelmeyer.com/weblog/?p=1</link>
		<comments>http://www.scheelmeyer.com/weblog/?p=1#comments</comments>
		<pubDate>Mon, 10 Nov 2008 22:31:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.scheelmeyer.com/weblog/?p=1</guid>
		<description><![CDATA[
The music is by the little known musician Jackson C. Frank and is called Dialogue
]]></description>
			<content:encoded><![CDATA[<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/Y9BXaJkR2S0&amp;hl=en&amp;fs=1" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/Y9BXaJkR2S0&amp;hl=en&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>The music is by the little known musician <a href="http://en.wikipedia.org/wiki/Jackson_C._Frank">Jackson C. Frank</a> and is called <em>Dialogue</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.scheelmeyer.com/weblog/?feed=rss2&amp;p=1</wfw:commentRss>
		</item>
	</channel>
</rss>
