<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.2" -->
<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/"
	>

<channel>
	<title>Mathieu Fenniak's Weblog</title>
	<link>http://mathieu.fenniak.net</link>
	<description>The Ordinary Life of Some Guy</description>
	<pubDate>Thu, 06 Sep 2007 04:28:39 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.2</generator>
	<language>en</language>
			<item>
		<title>Embedding Python Tips</title>
		<link>http://mathieu.fenniak.net/embedding-python-tips/</link>
		<comments>http://mathieu.fenniak.net/embedding-python-tips/#comments</comments>
		<pubDate>Tue, 30 Mar 2004 08:46:00 +0000</pubDate>
		<dc:creator>Mathieu Fenniak</dc:creator>
		
	<category>programming</category>
	<category>python</category>
	<category>moo</category>
		<guid isPermaLink="false">http://stompstompstomp.com/weblog/entries/72</guid>
		<description><![CDATA[Python is a beautiful programming language.  One of it&#8217;s most wonderful features is a very clean and simple C API that allows Python to be extended with dynamically loadable C modules.  That same C API also allows Python to be embedded in other pieces of software.  This means that any program can [...]]]></description>
			<content:encoded><![CDATA[<p>Python is a beautiful programming language.  One of it&#8217;s most wonderful features is a very clean and simple C API that allows Python to be extended with dynamically loadable C modules.  That same C API also allows Python to be embedded in other pieces of software.  This means that any program can allow the user to enter Python code interactively (or otherwise) to affect the program in whatever way they wish.  This is a powerful capability, but using occasionally requires a few tricks to accomplish the embedder&#8217;s goals.</p>
<p>Today&#8217;s embedding exercise was allowing a MOO server to execute arbitrary Python code:</p>
<pre>
;py_runfunction({&quot;import math&quot;, &quot;return math.sqrt(2*2*2)&quot;})
&gt; 2.8284271247461903
</pre>
<p>Of course, a MOO server can already do square roots&#8230; that wasn&#8217;t the point.  There was no point.  Anyways, here are a few ideas that might help other people embed Python in a useful way.</p>
<div>
<h3><a name="evaluating-statements">Evaluating Statements</a></h3>
<p>One of the first things most people try to do is evaluate an arbitrary statement and get its return value.  This is not quite as easy as it sounds.  Although Python&#8217;s <tt>eval</tt> builtin does this, it may be more limited than the embedding programmer desires.  <tt>eval</tt> will only permit an expression to be evaluated, not a statement:</p>
<pre>
&gt;&gt;&gt; eval(&quot;x = 2&quot;)
Traceback (most recent call last):
  File &quot;&lt;stdin&gt;&quot;, line 1, in ?
  File &quot;&lt;string&gt;&quot;, line 1
    x = 2
      ^
SyntaxError: invalid syntax
</pre>
<p>I suggest that if you want the user to be able to evaluate an arbitrary block of code, wrap an artificial function around it and call the function itself:</p>
<pre>
def f():
    import math
    class Cylinder:
        def _calcVolume(self):
            return math.pi * 
                self.radius**2 * 
                self.height
        volume = property(_calcVolume)
    c = Cylinder()
    c.radius = 12.2
    c.height = 16.12
    return c.volume
</pre>
<p>This allows the user to input much more complex functions, like the above example which uses a class and an import statement.  All that needed to be artificially added was the &#8216;def f():&#8217; and an arbitrary but constant amount of whitespace in front of each line of code.</p>
</div>
<div>
<h3><a name="compiling-code-without-a-module">Compiling Code without a Module</a></h3>
<p>So you&#8217;ve gotten some code from a user, and you want to compile it.  Maybe you&#8217;re creating a function to wrap around the user&#8217;s code.  Where does that function belong?  Where do you evaluate your code?</p>
<p>The first instinct I had was to use <tt>PyImport_AddModule</tt> to get the <tt>__main__</tt> module and start importing functions into its module dictionary.  I had a block of code similar to this (error checking omitted):</p>
<pre>
Py_Initialize();
PyObject* module = PyImport_AddModule(&quot;__main__&quot;);
PyObject* moduleDict = PyModule_GetDict(module);
PyObject* compileRetval = PyRun_String(code, Py_file_input,
    moduleDict, moduleDict);
...
Py_Finalize();
</pre>
<p>This then allowed me to call functions on the <tt>module</tt> object and get some code back.  The only real downside was the initialize and finalize around my code.  I didn&#8217;t want code from one compile to mess with another, and since I was using the <tt>__main__</tt> module, this caused problems.  Eventually I decided to use random strings as the names for my modules so that I could use them all independently, but that sure was ugly.</p>
<p>The solution I stumbled upon was caused by my accidently deleting some lines of code.  I eventually realized that I didn&#8217;t need the <tt>module</tt> object at all.  I could create a new, empty dictionary, and compile the code &#8216;into&#8217; that:</p>
<pre>
PyObject* dict = PyDict_New();
PyObject* compileRetval = PyRun_String(code, Py_file_input,
    dict, dict);
</pre>
<p>Everything continued to work as before, except now I had to <tt>PyDict_GetItem</tt> out of <tt>dict</tt> and use <tt>PyObject_CallObject</tt> rather than the <tt>PyObject_CallMethod</tt> that I could have used before.  But nothing crashed, the world continued to run, and I no longer needed to initialize and finalize around my evaluation.  Yay!</p>
</div>
<div>
<h3><a name="settings-builtins">Settings __builtins__</a></h3>
<p>There was one minor problem.  Some functionality like builtin functions and classes (like <tt>Exception</tt>) was missing.  Oops:</p>
<pre>
// Check for __builtins__...
if (PyDict_GetItemString(dict, &quot;__builtins__&quot;) == NULL)
{
    // Hm... no __builtins__ eh?
    PyObject* builtinMod = PyImport_ImportModule(&quot;__builtin__&quot;);
    if (builtinMod == NULL ||
        PyDict_SetItemString(dict, &quot;__builtins__&quot;, builtinMod) != 0)
    {
        Py_DECREF(dict);
        Py_XDECREF(dict);
        // error handling
        return;
    }
    Py_DECREF(builtinMod);
}
</pre>
<p>Hey, that fixed that right up.</p>
<p>I had this problem when I was using random names for modules, as well.  It seems <tt>PyImport_AddModule</tt> does not set <tt>__builtins__</tt> on a new module &#8212; but it is set up on <tt>__main__</tt> always.</p>
</div>
<div>
<h3><a name="getting-tracebacks-using-the-traceback-module">Getting Tracebacks using the <tt>traceback</tt> Module</a></h3>
<p>What happened when things went wrong?  Well, at first, a lot of crashing.  And things were going wrong a lot, especially when I was trying to use modules that didn&#8217;t exist in the system.  Heh heh.</p>
<p>Thankfully, Python will setup tracebacks that are useful even when you&#8217;re using the C API and screwing things up from the inside.  How on earth do you get at those tracebacks, though?  You can get a lot of information from the <tt>PyErr_*</tt> class of functions, but not a properly formatted Python traceback to display to the user.  Eventually, I ended up using the <tt>traceback</tt> module itself to display an error:</p>
<pre>
char* getPythonTraceback()
{
    // Python equivilant:
    // import traceback, sys
    // return &quot;&quot;.join(traceback.format_exception(sys.exc_type,
    //    sys.exc_value, sys.exc_traceback))

    PyObject *type, *value, *traceback;
    PyObject *tracebackModule;
    char *chrRetval;

    PyErr_Fetch(&amp;type, &amp;value, &amp;traceback);

    tracebackModule = PyImport_ImportModule(&quot;traceback&quot;);
    if (tracebackModule != NULL)
    {
        PyObject *tbList, *emptyString, *strRetval;

        tbList = PyObject_CallMethod(
            tracebackModule,
            &quot;format_exception&quot;,
            &quot;OOO&quot;,
            type,
            value == NULL ? Py_None : value,
            traceback == NULL ? Py_None : traceback);

        emptyString = PyString_FromString(&quot;&quot;);
        strRetval = PyObject_CallMethod(emptyString, &quot;join&quot;,
            &quot;O&quot;, tbList);

        chrRetval = strdup(PyString_AsString(strRetval));

        Py_DECREF(tbList);
        Py_DECREF(emptyString);
        Py_DECREF(strRetval);
        Py_DECREF(tracebackModule);
    }
    else
    {
        chrRetval = strdup(&quot;Unable to import traceback module.&quot;);
    }

    Py_DECREF(type);
    Py_XDECREF(value);
    Py_XDECREF(traceback);

    return chrRetval;
}
</pre>
<p>Of course, when one can&#8217;t import the <tt>traceback</tt> module, one can&#8217;t generate a traceback explaining why not. <tt>:-)</tt></p>
</div>
]]></content:encoded>
			<wfw:commentRSS>http://mathieu.fenniak.net/embedding-python-tips/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>XPCOM Enabled MOO</title>
		<link>http://mathieu.fenniak.net/xpcom-enabled-moo/</link>
		<comments>http://mathieu.fenniak.net/xpcom-enabled-moo/#comments</comments>
		<pubDate>Fri, 29 Nov 2002 00:22:23 +0000</pubDate>
		<dc:creator>Mathieu Fenniak</dc:creator>
		
	<category>programming</category>
	<category>moo</category>
		<guid isPermaLink="false">http://mathieu.fenniak.net/xpcom-enabled-moo/</guid>
		<description><![CDATA[On April 29th, 2002, I began to look at integrating the standalone XPCOM with the LambdaMOO server.
XPCOM is a lightweight cross-platform implementation of the concepts behind Microsoft&#8217;s COM. It has been implemented in the process of the development of Mozilla. XPCOM is essentially COM, but cross-platform, hence the XP.
The integration inside the MOO server is [...]]]></description>
			<content:encoded><![CDATA[<p>On April 29th, 2002, I began to look at integrating the standalone <a href="http://www.mozilla.org/projects/xpcom/">XPCOM</a> with the LambdaMOO server.</p>
<p>XPCOM is a lightweight cross-platform implementation of the concepts behind <a href="http://www.microsoft.com/com/">Microsoft&#8217;s COM</a>. It has been implemented in the process of the development of <a href="http://www.mozilla.org/">Mozilla</a>. XPCOM is essentially COM, but cross-platform, hence the XP.</p>
<p>The integration inside the MOO server is not necessarily for any specific purpose, but I have a few plans in mind for what this integration will permit:</p>
<ul>
<li>
<p>XPCOM can be used to allow builtin functions to be compiled into shared modules and dropped into the MOO &#8216;components&#8217;. These builtin functions will be registered with the &#8216;regxpcom&#8217; program, and be accessible from inside the MOO instantly. There are multiple advantages over doing this rather than the traditional way of modifying the MOO server to add builtin functions. The most major advantage is that XPCOM components can be written in languages other than C. It&#8217;s useful to program in an object-oriented language like C++ when you&#8217;re programming a builtin function that will be used in an object-oriented environment in the first place. Additionally, plug-in DLLs can be isolated in such a way that the crash of a builtin function will not affect the running of the MOO   server.</p>
<p>This has been implemented and is currently undergoing testing. The implementation involved the creation of an &#8216;IBuiltinFunction&#8217; interface. The plug-in DLL exports an IBuiltinFunction derived interface. The MOO server allows access to its data to the XPCOM component via a set of &#8216;IMOOData&#8217;-derived interfaces.</p>
<p><img src="http://mathieu.fenniak.net/wp-content/uploads/2006/05/xpcom-moo-interfaces.png" alt="structure diagram of xpcom interfaces in the moo" />
            </li>
<li>
<p>Another possible use for XPCOM inside the MOO is to allow MOO-code to access XPCOM objects. I expect that originally this will be implemented by creating an XPCOM plug-in DLL that exports builtin functions providing <tt>xpcom_createinstance()</tt>, <tt>xpcom_queryinterface()</tt>, <tt>xpcom_callfunction()</tt>, <tt>xpcom_get_attribute()</tt>, <tt>xpcom_set_attribute()</tt>, <tt>xpcom_releaseinstance()</tt>, and <tt>xpcom_isvalidinstance()</tt>.</p>
<p>xpcom_createinstance() will create an instance of a given contract id, if possible, and return a hash string that represents that instance. Eg:</p>
<blockquote><p><tt>;xpcom_createinstance(&#8221;@mozilla.org/file/directory_service;1&#8243;)<br />=&gt; &#8220;##XPCOM#bbf8cab0-d43a-11d3-8cc2-00609792278c#59e7e77a##&#8221;</tt></p></blockquote>
<p>The string representing that interface is a concationation of the CID, and a pointer address to it to make it unique for each instance. A hash table of these strings will be stored in the server so that implementation of the other <tt>xpcom_*()</tt> functions is relatively efficient.</p>
<p>Implementation of this idea is pending further thought.</p>
</li>
<li>
<p>The <a href="http://www.moo.ca/moozilla">MOOzilla</a> MOO client is written in JavaScript using Mozilla, and utilizes XPCOM heavily. It should be possible to create a plug-in architecture for MOOzilla, using some kind of common interfaces that the MOO server is aware of. Using an implementation of SOAP, (implemented as an XPCOM module, of course), it should be possible for the MOO server to &#8217;script&#8217; MOOzilla, or vice-versa, using out-of-band binary SOAP communication streams. Woo! The purpose? &#8230; Well, why not create an XPCOM module that wraps Gtk+, and then an interface for it on the client side and an interface for message handling on the server side could allow a Gtk+ application to be MOO-server-driven. Of course, this doesn&#8217;t apply just to Gtk+, it could be used for any toolkit&#8230; theoretically.</p>
</li>
</ul>
<p>My efforts of XPCOM integration have yield a MOO which can successfully use XPCOM component builtin functions. My work has been based upon the <a href="http://www.moo.ca/">MOO Canada</a> server source, which is a rather hacked up LambdaMOO 1.8.1. The source has some unfortunate usability problems. It is basically customised just for my building and use of it. It should be possible to adapt it to build on your machine. The Makefile-xpcom-lao file is my Makefile. The automake and autoconf sources are not up to date. With some modifications to the Makefile, it should be possible to get it to build for you. Currently, I don&#8217;t have any example modules that are fit for publication.</p>
<p>The XPCOM enabled MOO server source can also be accessed by <a href="http://subversion.tigris.org/">Subversion</a> clients, or browsed with a web browser, at <a href="http://stompstompstomp.com/svn/moo/mc/xpcom-enabled-branch">http://stompstompstomp.com/svn/moo/mc/xpcom-enabled-branch</a>.</p>
]]></content:encoded>
			<wfw:commentRSS>http://mathieu.fenniak.net/xpcom-enabled-moo/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Unicode, MOO, and MOOzilla</title>
		<link>http://mathieu.fenniak.net/unicode-moo-and-moozilla/</link>
		<comments>http://mathieu.fenniak.net/unicode-moo-and-moozilla/#comments</comments>
		<pubDate>Mon, 25 Nov 2002 11:34:00 +0000</pubDate>
		<dc:creator>Mathieu Fenniak</dc:creator>
		
	<category>programming</category>
	<category>moo</category>
		<guid isPermaLink="false">http://stompstompstomp.com/weblog/entries/87</guid>
		<description><![CDATA[Spent the morning talking with Jason of Achieve MOO.  He came over while I was at Catsy&#8217;s in Toronto.  The original goal was to discuss things related to the Unicode based MOO, and we did that, as well as touching on other topics of mutual interest.
I&#8217;ll be publishing a new unicode patch shortly [...]]]></description>
			<content:encoded><![CDATA[<p>Spent the morning talking with Jason of Achieve MOO.  He came over while I was at Catsy&#8217;s in Toronto.  The original goal was to discuss things related to the Unicode based MOO, and we did that, as well as touching on other topics of mutual interest.</p>
<p>I&#8217;ll be publishing a new unicode patch shortly which allows non-us-ascii keywords and variable names in the MOO.  This means that non-english words and characters can be used as variable, verb, property, and function names in MOO code without any unnecessary escaping.  Collaborating with Jason showed that there are apparently duplicates of characters in the unicode codepage, such as the semicolon, period, quotation marks, and so on, which must be recognized by the MOO in the future as having the same functionality as the us-ascii versions of these characters.  This should be interesting, and I&#8217;ll look into it soon for another unicode patch.</p>
<p>Once that was out of the way, it became apparent that the server handles Unicode great, the only problems left were in front end programs.  Jason&#8217;s native OSX MUD client was able to send text to the MOO, but could not receive it and display it properly.  The &#8216;telnet&#8217; command in an OSX terminal was able to receive but not send, exactly the opposite.  MOOzilla was able to do both.  We didn&#8217;t have the resources available to easily test whether Mooca, the Achieve Java telnet client, could do it correctly and nicely.</p>
<p>Jason was interested in MOOzilla as a client itself.  A number of ideas and problems came out of that discussion.</p>
<p>The idea of somehow making seperable windows out of MOOzilla which are MOO driven came up.  This has been thought of before, but the way it was discussed here was as windows that <i>could</i> be separated, or could be left integrated in MOOzilla.  This would allow a &#8216;power-user&#8217; to keep everything in one complex window, while a beginning user would have a simpler interface that they could complicate if they chose to.  I need to give some thought as to how this might be implemented&#8230; but I know that MOOzilla/Mozilla have the capabilities to do it.</p>
<p>A problem that arose is MOOzilla distribution and access.  A Java client is easy to access because it requires no software installation, is just right there, and is cross-platform.  MOOzilla does require software installation, two pieces of software actually, and the software varies from platform to platform.  This would be streamlined a bit by the proposed &#8216;MOOzilla Package&#8217; which was just MOOzilla, without Mozilla cruft, but would still not be usable in Jason&#8217;s teaching environment.  So&#8230; what would?  Hm&#8230;  if only IE supported XUL/XPCOM.  Now, if someone could make a plugin for IE that would allow the running of an XUL application&#8230; it would probably be a huge plugin.  Could one be made that was MOOzilla-specific?  &#8230; who knows how to make an IE plugin?  Need some magic glue components here&#8230;</p>
]]></content:encoded>
			<wfw:commentRSS>http://mathieu.fenniak.net/unicode-moo-and-moozilla/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>DOM2 in MOO</title>
		<link>http://mathieu.fenniak.net/dom2-in-moo/</link>
		<comments>http://mathieu.fenniak.net/dom2-in-moo/#comments</comments>
		<pubDate>Fri, 15 Nov 2002 11:26:00 +0000</pubDate>
		<dc:creator>Mathieu Fenniak</dc:creator>
		
	<category>programming</category>
	<category>moo</category>
		<guid isPermaLink="false">http://stompstompstomp.com/weblog/entries/90</guid>
		<description><![CDATA[I&#8217;ve taken a big break in MOOzilla documentation writing to implement a DOM2 interface on MOO Canada.  Wheeha!  It took me hours of planning last night to come up with a way to do it that would not involve a server hack to allow circular waif references.
When completed, MC will have a nice [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve taken a big break in MOOzilla documentation writing to implement a DOM2 interface on MOO Canada.  Wheeha!  It took me hours of planning last night to come up with a way to do it that would not involve a server hack to allow circular waif references.</p>
<p>When completed, MC will have a nice clean DOM2 implementation that is actually reference counted, not garbage collected, though a series of magic levers and spells.  It&#8217;s very slick.  Basically, references are only kept going up the tree, and copies of WAIFs as text are kept going down the tree.  It works surprisingly well.</p>
]]></content:encoded>
			<wfw:commentRSS>http://mathieu.fenniak.net/dom2-in-moo/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>MOOzilla 0.9.9</title>
		<link>http://mathieu.fenniak.net/moozilla-099/</link>
		<comments>http://mathieu.fenniak.net/moozilla-099/#comments</comments>
		<pubDate>Wed, 13 Nov 2002 10:53:00 +0000</pubDate>
		<dc:creator>Mathieu Fenniak</dc:creator>
		
	<category>programming</category>
	<category>moo</category>
		<guid isPermaLink="false">http://stompstompstomp.com/weblog/entries/92</guid>
		<description><![CDATA[Spent most of my day working on the MOOZilla help documentation once again.  It&#8217;s amazing how much time one can pour into writing and never get very far.  Technical documentation takes a lot of work&#8230; I spend my time trying to imagine, &#8216;If I wanted help on the &#8216;Connect&#8217; menu option&#8230; what would [...]]]></description>
			<content:encoded><![CDATA[<p>Spent most of my day working on the MOOZilla help documentation once again.  It&#8217;s amazing how much time one can pour into writing and never get very far.  Technical documentation takes a lot of work&#8230; I spend my time trying to imagine, &#8216;If I wanted help on the &#8216;Connect&#8217; menu option&#8230; what would I want to know?  It&#8217;s a pretty simple option&#8230; but if I looked in the help for it, what am I looking for? &#8216;.</p>
<p>The surprising thing is the massive amount of groth that MOOzilla will go through for it&#8217;s next release.  This documentation will eventually include colourful images of MOOzilla being used in various scary ways by people.  Currently I&#8217;m writing just the section on how to use MOOzilla as a MOO/MUD client, and I already have bumped the MOOzilla size up to about 290k, from its previous 75k.  The documentation for how to build with MOOzilla will be very pictureful to be as useful as possible&#8230;  or at least, I guess I&#8217;d like it to be.</p>
<p>Maybe I could make MOOzilla mock-ups using the same HTML rendering that MOOzilla uses itself.  This oughta be smaller than using pictures of the rendered text&#8230;</p>
<p>&#8230; something about that makes me feel uncomfortable.  Well, I&#8217;ll try it out when I get to the building section of the documentation.</p>
<p>My current feature list for 0.9.9:</p>
<ul>
<li>Documentation (1-2 weeks)</li>
<li>Stand-Alone MOOzilla distributions for Windows and Linux.  No Mozilla installation required, just gecko and other technologies bundled together. (1-2 weeks)</li>
<li>Monospaced input windows, single + multi line. (2-3 days, if possible at all w/ XUL+XBL&#8230;)</li>
<li>Save log as web page (1 hour)</li>
</ul>
<p>The biggest problem with this plan for 0.9.9 is that the stand-alone distributions will be for platforms I don&#8217;t have access to.  Teehee&#8230; this means MOOzilla 0.9.9 is probably planned for release around Christmas, after I do have access to an x86 computer to do some development with.</p>
]]></content:encoded>
			<wfw:commentRSS>http://mathieu.fenniak.net/moozilla-099/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>MOOzilla Documentation</title>
		<link>http://mathieu.fenniak.net/moozilla-documentation/</link>
		<comments>http://mathieu.fenniak.net/moozilla-documentation/#comments</comments>
		<pubDate>Tue, 12 Nov 2002 08:46:00 +0000</pubDate>
		<dc:creator>Mathieu Fenniak</dc:creator>
		
	<category>programming</category>
	<category>moo</category>
		<guid isPermaLink="false">http://stompstompstomp.com/weblog/entries/93</guid>
		<description><![CDATA[Began writing MOOzilla&#8217;s documentation today.  Spent quite a bit of time figuring out how to get stuff to work right, and then writing a python program to create a table of contents out of an HTML file.  In the end, the MOOzilla documentation will be viewable using MOOzilla&#8217;s builtin help viewer, which creates [...]]]></description>
			<content:encoded><![CDATA[<p>Began writing MOOzilla&#8217;s documentation today.  Spent quite a bit of time figuring out how to get stuff to work right, and then writing a python program to create a table of contents out of an HTML file.  In the end, the MOOzilla documentation will be viewable using MOOzilla&#8217;s builtin help viewer, which creates a nice little interface for a table of contents, index, glossary, and search functionality.</p>
<p>The documentation will also be put on MOOzilla&#8217;s web site, purely in HTML.  Hopefully it will be useful.  I just would love to hear from people as to what would be useful in the documentation, but &#8230; everyone is dead, it seems.  So I&#8217;ll just pour dozens of hours of work into this documentation with absolutely no knowledge as to whether it will be useful to the universe or not.  Maybe I&#8217;m just burning my time.</p>
]]></content:encoded>
			<wfw:commentRSS>http://mathieu.fenniak.net/moozilla-documentation/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>MOOD</title>
		<link>http://mathieu.fenniak.net/mood/</link>
		<comments>http://mathieu.fenniak.net/mood/#comments</comments>
		<pubDate>Sun, 10 Nov 2002 22:53:00 +0000</pubDate>
		<dc:creator>Mathieu Fenniak</dc:creator>
		
	<category>programming</category>
	<category>moo</category>
		<guid isPermaLink="false">http://stompstompstomp.com/weblog/entries/94</guid>
		<description><![CDATA[I&#8217;ve joined Cecil in reviving our perpetually dying MOOD project.  Based upon a brand new MOO Canada core, we&#8217;ve begun the process of building a MUD-like game in a MOO.
Currently things are looking pretty good.  Cecil is doing a lot of design work on paper, and I&#8217;ve been plowing ahead with smashing stuff. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve joined Cecil in reviving our perpetually dying MOOD project.  Based upon a brand new MOO Canada core, we&#8217;ve begun the process of building a MUD-like game in a MOO.</p>
<p>Currently things are looking pretty good.  Cecil is doing a lot of design work on paper, and I&#8217;ve been plowing ahead with smashing stuff.  I hope I smash things like he&#8217;s planning! <tt>:)</tt></p>
]]></content:encoded>
			<wfw:commentRSS>http://mathieu.fenniak.net/mood/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>MOOzilla 0.9.8</title>
		<link>http://mathieu.fenniak.net/moozilla-098/</link>
		<comments>http://mathieu.fenniak.net/moozilla-098/#comments</comments>
		<pubDate>Sun, 03 Nov 2002 09:23:00 +0000</pubDate>
		<dc:creator>Mathieu Fenniak</dc:creator>
		
	<category>programming</category>
	<category>moo</category>
		<guid isPermaLink="false">http://stompstompstomp.com/weblog/entries/97</guid>
		<description><![CDATA[Pulled my act together and put the necessary files together to make a MOOzilla 0.9.8 release today.  This release could have realistically been done any time in the past half month in which I&#8217;ve had the necessary ten minutes to spare&#8230;. damn, I&#8217;m lazy sometimes.  I&#8217;m going to work on putting together a [...]]]></description>
			<content:encoded><![CDATA[<p>Pulled my act together and put the necessary files together to make a MOOzilla 0.9.8 release today.  This release could have realistically been done any time in the past half month in which I&#8217;ve had the necessary ten minutes to spare&#8230;. damn, I&#8217;m lazy sometimes.  I&#8217;m going to work on putting together a list of things to do for the next version soon&#8230;</p>
<p>Lego simulator development hasn&#8217;t continued at all today.</p>
<p>Created a MOO Transpo in the downtown of MOO Canada, but it doesn&#8217;t yet have the desired functionality of a taxi stand.  It does have a transporter, at least.  This is yet another project to be done now.</p>
<p>I seem to have spent most of the day playing with web browsers&#8230; for some reason reading articles by CodeBitch at MacEdition.net has made me spend time playing with web browsers and CSS websites.  Kinda weird&#8230; to be playing around with one of the most basic tools of the Internet age and just seeing what it can do.  Well, a kinda weird day I guess.</p>
]]></content:encoded>
			<wfw:commentRSS>http://mathieu.fenniak.net/moozilla-098/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>zeroconf MOO</title>
		<link>http://mathieu.fenniak.net/zeroconf-moo/</link>
		<comments>http://mathieu.fenniak.net/zeroconf-moo/#comments</comments>
		<pubDate>Tue, 22 Oct 2002 12:00:00 +0000</pubDate>
		<dc:creator>Mathieu Fenniak</dc:creator>
		
	<category>programming</category>
	<category>moo</category>
		<guid isPermaLink="false">http://stompstompstomp.com/weblog/entries/108</guid>
		<description><![CDATA[Continuing yesterday&#8217;s zeroconf work, I began coding a browse function for the MOO server.  So in addition to being able to advertise its open TCP ports with zeroconf service names, the MOO server is now capable of browsing for zeroconf services.  The implementation from inside the MOO is similar to how listen() functions.
The [...]]]></description>
			<content:encoded><![CDATA[<p>Continuing yesterday&#8217;s zeroconf work, I began coding a browse function for the MOO server.  So in addition to being able to advertise its open TCP ports with zeroconf service names, the MOO server is now capable of browsing for zeroconf services.  The implementation from inside the MOO is similar to how listen() functions.</p>
<p>The <tt>zeroconf_browse()</tt> builtin function takes two arguments: an object representing what object will be &#8216;listening&#8217; for browse finds, and an string which will be the name of the service.  The given object has a verb <tt>zeroconf_browse_add</tt> called on it when a new service is located, with the arguments <tt>{server&#8217;s name, server&#8217;s address, TCP port}</tt>.  <tt>zeroconf_browse_remove</tt> is called whenever a service drops off the network, but I haven&#8217;t yet hammered out details of what arguments will be given to it.</p>
<p>And finally, the <tt>zeroconf_unbrowse()</tt> function takes a service name and stops browsing for that service.</p>
<p>The browsing is all done asynchronously in the current implementation, and a hook has been put in the main server loop to allow this to occur.  The current implementation of zeroconf is highly MacOS X specific, but it <b>can</b> be re-written or extended to support multiple operating systems, especially by embedding Apple&#8217;s mDNSResponder daemon inside the MOO server.  I haven&#8217;t even touched this yet, though.</p>
<p>I started looking into a Mozilla bug, <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=63895">bug #63895</a>, but after some smashing at it with a hammer, I decided that a more informed and subtle approach is needed.  It may indeed be a significant amount of work to fix even.  The code in nsCSSFrameConstructor is a bit too complex for me to sink into it enough to find out what the problem is, so I think I&#8217;ll just ignore it&#8230;</p>
<p>I&#8217;m considering adding a locking system of some kind to Growlmurrdurr so I could write selectively private entries&#8230; but I don&#8217;t know what the point of a weblog that people can&#8217;t read is. <tt>:P</tt></p>
]]></content:encoded>
			<wfw:commentRSS>http://mathieu.fenniak.net/zeroconf-moo/feed/</wfw:commentRSS>
		</item>
	</channel>
</rss>
