<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Alexey Zakhlestins blog &#187; Uncategorized</title>
	<atom:link href="http://blog.milkfarmsoft.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.milkfarmsoft.com</link>
	<description>Programming for Mac and Web</description>
	<lastBuildDate>Thu, 17 Mar 2011 21:32:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com" />
	<atom:link rel="hub" href="http://superfeedr.com/hubbub" />
			<item>
		<title>using Python with GObject Introspection</title>
		<link>http://blog.milkfarmsoft.com/2011/03/pygi/</link>
		<comments>http://blog.milkfarmsoft.com/2011/03/pygi/#comments</comments>
		<pubDate>Thu, 17 Mar 2011 21:32:23 +0000</pubDate>
		<dc:creator>indeyets</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[gobject introspection]]></category>
		<category><![CDATA[pygi]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.milkfarmsoft.com/?p=191</guid>
		<description><![CDATA[PyGI is a project, which implements dynamic bindings to GObject based libraries for Python using GObject Introspection. In this post I give some hints on using it. <span style="color:#777"> . . . &#8594; Read More: <a href="http://blog.milkfarmsoft.com/2011/03/pygi/">using Python with GObject Introspection</a></span>]]></description>
			<content:encoded><![CDATA[<p>I was recently working on <a href="https://github.com/midgardproject/midgard-daemon">one small tool</a> for <a href="http://www.midgard-project.org/" title="Midgard Project">Midgard Project</a>, and had to deal with a new framework: <a href="http://live.gnome.org/PyGI" title="PyGI - GNOME Live!">PyGI</a>. Strictly speaking, it&#8217;s not &#8220;totally new&#8221;, but it is: a) new for me b) just starts to get attention from application developers.</p>
<p>PyGI is a project, which implements dynamic bindings to GObject based libraries for Python using <a href="http://live.gnome.org/GObjectIntrospection" title="GObjectIntrospection - GNOME Live!">GObject Introspection</a>. Initially, it was a separate project, these days it is merged into main <a href="http://live.gnome.org/PyGObject" title="PyGObject - GNOME Live!">PyGObect</a>. If you read my previous posts, this is kinda what we want to implement for PHP in <a href="http://blog.milkfarmsoft.com/2011/02/gobject-for-php-new-bindings-project/" title="GObject for PHP (new bindings project) &laquo; Alexey Zakhlestins blog">GObject for PHP</a> project, but for Python.</p>
<p>For the project, I used Python 3. This choice led to the requirement of installing latest versions of software, but the good news is, that coming <a href="https://wiki.ubuntu.com/NattyNarwhal">Ubuntu Natty</a> has a good initial set of software. So, I had to install:</p>
<ul>
<li>Python 3.1 (3.2 should work too)</li>
<li><a href="http://ftp.gnome.org/pub/GNOME/sources/gobject-introspection/0.10/" title="ftp.gnome.org">GObject Introspection 0.10.x</a></li>
<li><a href="http://ftp.gnome.org/pub/GNOME/sources/pygobject/2.28/" title="ftp.gnome.org">PyGObject 2.28.0</a> (2.27.x-dev series are ok too)</li>
<li>If you plan to work with ØMQ, as I did, be sure to grab <a href="http://www.zeromq.org/bindings:python" title="Python binding - zeromq">PyZMQ</a> 2.1 series (easy_install will probably work)</li>
</ul>
<p>The main library, I worked with — <a href="https://github.com/midgardproject/midgard-core/tree/ratatoskr">libmidgard2</a> — supports GObject introspection, so I didn&#8217;t need to install anything python-related to make it work.</p>
<p>Ok. Here are some hints on coding using PyGI.</p>
<pre><code class="python">
    # to use introspection-friendly library use import statement similar to this
    from gi.repository import Midgard

    # global functions are available directly in imported package
    Midgard.init()

    # constructors are ALWAYS called with "named" parameters
    config = Midgard.Config(dbtype = "SQLite", database = "testdb")

    # library errors are thrown as exceptions
    import gobject
    try:
        do_something()
    except gobject.GError as e:
        print(e.message)

    # want to know name of objects GType?
    print(obj.__class__.__gtype__.name)

    # want to get list of non-object properties of some GObject?
    property_names = [pspec.name for pspec in obj.props if not pspec.value_type.is_classed()]

    # need to get names of all classes, which inherit from your GObject's class?
    # (note: Midgard.Object is the class to be replaced by your class)
    child_names = [gtype.name for gtype in Midgard.Object.__gtype__.children]

</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.milkfarmsoft.com/2011/03/pygi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Node.js 0.1.98</title>
		<link>http://blog.milkfarmsoft.com/2010/06/node-js-0-1-98/</link>
		<comments>http://blog.milkfarmsoft.com/2010/06/node-js-0-1-98/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 15:42:32 +0000</pubDate>
		<dc:creator>indeyets</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[javascript node.js]]></category>

		<guid isPermaLink="false">http://blog.milkfarmsoft.com/2010/06/node-js-0-1-98/</guid>
		<description><![CDATA[<p>Node.js 0.1.98 was released recently. It has bundled &#8220;readline&#8221; library now, so REPL-mode just got much more usable</p> ]]></description>
			<content:encoded><![CDATA[<p><a href="http://nodejs.org/">Node.js</a> 0.1.98 was released recently. It has bundled &#8220;readline&#8221; library now, so REPL-mode just got much more usable</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.milkfarmsoft.com/2010/06/node-js-0-1-98/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The shortcut to switch tabs is&#8230;</title>
		<link>http://blog.milkfarmsoft.com/2008/01/the-shortcut-to-switch-tabs-is/</link>
		<comments>http://blog.milkfarmsoft.com/2008/01/the-shortcut-to-switch-tabs-is/#comments</comments>
		<pubDate>Fri, 18 Jan 2008 15:41:49 +0000</pubDate>
		<dc:creator>indeyets</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[opera]]></category>
		<category><![CDATA[os]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://blog.milkfarmsoft.com/?p=79</guid>
		<description><![CDATA[<p>The shortcut to switch tabs is…</p> TextMate: Command + Option + Left/Right Skype: Command + Shift + Left/Right Adium, Firefox: Command + Left/Right Colloquy, Firefox: Command + Up/Down Opera, Safari, Terminal: Command + Shift + [/] <p></p> <p>Dear Santa, please, bring me Mk 41 next christmas, so I can fix this world.</p> <span style="color:#777"> . . . &#8594; Read More: <a href="http://blog.milkfarmsoft.com/2008/01/the-shortcut-to-switch-tabs-is/">The shortcut to switch tabs is&#8230;</a></span>]]></description>
			<content:encoded><![CDATA[<p>The shortcut to switch tabs is…</p>
<table border="0" style="margin-top: 0px">
<col width="200" />
<tr>
<td>TextMate:</td>
<td><strong>Command</strong> + <strong>Option</strong> + <strong>Left</strong>/<strong>Right</strong></td>
</tr>
<tr>
<td>Skype:</td>
<td><strong>Command</strong> + <strong>Shift</strong> + <strong>Left</strong>/<strong>Right</strong></td>
</tr>
<tr>
<td>Adium, Firefox:</td>
<td><strong>Command</strong> + <strong>Left</strong>/<strong>Right</strong></td>
</tr>
<tr>
<td>Colloquy, Firefox:</td>
<td><strong>Command</strong> + <strong>Up</strong>/<strong>Down</strong></td>
</tr>
<tr>
<td>Opera, Safari, Terminal:</td>
<td><strong>Command</strong> + <strong>Shift</strong> + <strong>[</strong>/<strong>]</strong></td>
</tr>
</table>
<p></p>
<p>Dear Santa, please, bring me <a href="http://en.wikipedia.org/wiki/Mk_41" title="Mk 41 - Wikipedia, the free encyclopedia">Mk 41</a> next christmas, so I can fix this world.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.milkfarmsoft.com/2008/01/the-shortcut-to-switch-tabs-is/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>YAML: Syck for PHP is not read-only anymore</title>
		<link>http://blog.milkfarmsoft.com/2007/07/yaml-syck-for-php-is-not-read-only-anymore/</link>
		<comments>http://blog.milkfarmsoft.com/2007/07/yaml-syck-for-php-is-not-read-only-anymore/#comments</comments>
		<pubDate>Thu, 05 Jul 2007 19:37:47 +0000</pubDate>
		<dc:creator>indeyets</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[yaml]]></category>

		<guid isPermaLink="false">http://blog.milkfarmsoft.com/?p=57</guid>
		<description><![CDATA[<p>One more good news for you, YAML-users. I&#8217;ve implemented emitter functionality in php-binding of syck library. It is quite straight-forward, no fancy stuff for now, but it should work </p> <p>Supported datatypes:</p> associative arrays indexed arrays strings integers floats booleans null <p>Objects are simply ignored now, though I am planning to add support for them <span style="color:#777"> . . . &#8594; Read More: <a href="http://blog.milkfarmsoft.com/2007/07/yaml-syck-for-php-is-not-read-only-anymore/">YAML: Syck for PHP is not read-only anymore</a></span>]]></description>
			<content:encoded><![CDATA[<p>One more good news for you, YAML-users. <img src='http://blog.milkfarmsoft.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
I&#8217;ve implemented emitter functionality in php-binding of syck library. It is quite straight-forward, no fancy stuff for now, but it should work <img src='http://blog.milkfarmsoft.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Supported datatypes:</p>
<ul>
<li>associative arrays</li>
<li>indexed arrays</li>
<li>strings</li>
<li>integers</li>
<li>floats</li>
<li>booleans</li>
<li>null</li>
</ul>
<p>Objects are simply ignored now, though I am planning to add support for them later. See <a href="http://code.whytheluckystiff.net/svn/syck/trunk/ext/php/TODO">TODO</a> for details.</p>
<p>Example, to give you idea:</p>
<pre>
$data = array(
  'items' => array(
    'item 1',
    'item 2'
  ),
  'count' => 2
);
echo syck_dump($data);
</pre>
<p>take a look at my <a href="http://blog.milkfarmsoft.com/?p=38">previous yaml-post</a> for installation instructions.</p>
<p>Let me know how this works for you <img src='http://blog.milkfarmsoft.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>p.s. should I change the name of that function? :-/</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.milkfarmsoft.com/2007/07/yaml-syck-for-php-is-not-read-only-anymore/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>haxe</title>
		<link>http://blog.milkfarmsoft.com/2006/08/haxe/</link>
		<comments>http://blog.milkfarmsoft.com/2006/08/haxe/#comments</comments>
		<pubDate>Sat, 26 Aug 2006 22:00:00 +0000</pubDate>
		<dc:creator>indeyets</dc:creator>
				<category><![CDATA[flash]]></category>
		<category><![CDATA[haxe]]></category>
		<category><![CDATA[neko]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://blog.milkfarmsoft.com/?p=16</guid>
		<description><![CDATA[<p>Ok, here is something interesting. I was browsing looking for something related to flash/actionscript programming and ways of client-server interaction (remoting). After an hour or so, I found something called &#8220;haXe&#8220;â€¦</p> <p>haXe is a &#8220;web oriented universal language&#8221;, which means, that you can write all the front-end and back-end stuff in haXe, and compile it <span style="color:#777"> . . . &#8594; Read More: <a href="http://blog.milkfarmsoft.com/2006/08/haxe/">haxe</a></span>]]></description>
			<content:encoded><![CDATA[<p>Ok, here is something interesting. I was browsing looking for something related to flash/actionscript programming and ways of client-server interaction (remoting). After an hour or so, I found something called &#8220;<a href="http://haxe.org/">haXe</a>&#8220;â€¦</p>
<p>haXe is a &#8220;web oriented universal language&#8221;, which means, that you can write all the front-end and back-end stuff in haXe, and compile it to the target platform afterwards. Currently, there are three target-platforms: <a href="http://haxe.org/tutos/start/flash">flash</a>, <a href="http://haxe.org/tutos/start/js">javascript</a> and <a href="http://haxe.org/tutos/start/server">neko byte-code</a> (you can learn more about NekoVM <a href="http://nekovm.org/">here</a>). It is a high-level object-oriented strong-typed language with a strict syntax. It supports anonymous local-functions and anonymous objects. Another great thing about haXe: it has type inference, which means, that one rarely needs to specify the type manually. The program will just &#8220;know&#8221; which type should be there. haXe doesn&#8217;t have multiple inheritance, but has support for interfaces and &#8220;class parameters&#8221; (which are similar to C++&#8217;s templates).</p>
<p>If you are into that stuff, you can check all the <a href="http://haxe.org/ref">language reference</a>. Some pieces are really-really interesting. It seems like haXe tries to take the pieces of both object-oriented and functional languages and makes an interesting mixture.</p>
<p>Now, some more practical stuff. As I mentioned, I found haXe, while looking for stuff related to flash programming. Using haXe, it is possible to write code in a language, which is more powerful than ActionScript-3.0 and compile it to swf, targetted to any flash-player version you like. You will still be limited by APIs which are bundled with that version of player, but the language itself is no more a limit. By the way, as a bonus, you get a bunch of powerful haXe&#8217;s <a href="http://haxe.org/api/">api</a>s, which are not available for usual actionscript developers.</p>
<p>haXe supports different kinds of remoting. It is possible to use <a href="http://haxe.org/tutos/remoting/flash_amf">flash&#8217;s AMF remoting</a>, if you need to be compatible with that or <a href="http://haxe.org/tutos/remoting/client_server">native haXe remoting</a>. Synchronous and asynchronous modes are available, of course, and it is also possible to use <a href="http://haxe.org/tutos/remoting/flash_js">flash-javascript interaction</a>. And, yes, I know you want to ask: you can do <a href="http://haxe.org/tutos/ajax">AJAX stuff in haXe</a> too <img src='http://blog.milkfarmsoft.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>You can download haXe <a href="http://haxe.org/download">here</a>. It is precompiled for several platforms. It is trivial to <a href="http://haxe.org/compile">compile it yourself</a>, if you have ocaml compiler anywhere around (which is the case, if you use some kind of unix).</p>
<p>The usage is simple.<br />
Start with creating the following <code>Test.hx</code>:</p>
<pre>
    class Test {
        static function main() {
            trace("Hello World !");
        }
    }
</pre>
<p>Now, just issue the following command in the console: <code>haxe -swf test.swf -main Test</code>. You will have a working swf file which says &#8216;Hello&#8217; to all the world <img src='http://blog.milkfarmsoft.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.milkfarmsoft.com/2006/08/haxe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

