<?xml version="1.0" encoding="UTF-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xml:lang="en-US">
	<title>NoshBar's Dumping Ground</title>
	<link rel="alternate" type="text/html" href="http://iwasdeportedandalligotwasthislousydomain.co.uk/index.php" />
	<modified>2026-09-12T05:24:11Z</modified>
	<author>
		<name>NoshBar</name>
	</author>
	<copyright>Copyright 2026, NoshBar</copyright>
	<generator url="http://www.sourceforge.net/projects/sphpblog" version="0.7.0">SPHPBLOG</generator>
	<entry>
		<title>Python doesn&#039;t actually suck too much...</title>
		<link rel="alternate" type="text/html" href="http://iwasdeportedandalligotwasthislousydomain.co.uk/index.php?entry=entry120409-074148" />
		<content type="text/html" mode="escaped"><![CDATA[<h3>Rambly introductory</h3><br />Until recently, I had no reason to code something in Python, as I had all my bases covered by C/C++, ObjectPascal, and PHP.<br />Lately work has had me pottering with some utilities written in Python, and even though I don&#039;t &quot;know&quot; Python, I could read the code just fine (as I guess is the case with most coders), and it seemed like something that would be good for quick prototypes (especially as my main development machine is now a Mac - it comes with Python pre-installed).<br /><br />So I set myself the task of re-creating <a href="static.php?page=helpermonkeybotpython" >HelperMonkeyBot</a> in Python. <br /><br /><h3>Things I used</h3><br />Having had some frustrations with getting an XMPP library and its dependencies set up and working with cross-platform C++ compilers, I was delighted to find <a href="https://github.com/fritzy/SleekXMPP/wiki" >SleekXMPP</a>, which is easily installed by typing:<pre>python setup.py install</pre>I had <a href="http://www.python.org/" >Python</a> 2.7 on OSX and Linux, and Python 3.2 on Windows.<br />I figured this would let me target the two different versions (and -hey-, how different could they be? More on that later, SIGH).<br /><br />As before, I used <a href="http://www.sqlite.org/" >SQLite</a> for the database, using the full-text-search capability it provides.<br />This seems to be enabled in the OSX and Linux distributions I was using (10.7 and 11.10, respectively), but not on Windows Python 3.2.<br />The easy fix is to go the SQLite website and download a new sqlite3.dll and plonk it in the Python32\DLL folder.<br />Well, it WOULD be, but I guess the API has changed (or something, I didn&#039;t have the patience to check)... so I did what any impatient prototyper would have done (just me?) and uninstalled Python 3.2, and installed Python 2.7, replaced the DLL as before, and et voila, success!<br /><br />For an editor/IDE, I initially just edited the code in <a href="https://developer.apple.com/xcode/" >Xcode</a>, but that provided very little other than syntax highlighting.<br />So then I tried <a href="http://pythonide.stani.be/" >SPE</a>, which was great, I could debug code, set breakpoints, do all the things I&#039;m used to with compiled code... buuut it would sometimes crash, or just act weirdly. Nothing deal-breakery, but my lust for shiny new things had to be met, and it was the perfect to excuse to look for MOOORE.<br />I then used <a href="http://www.aptana.com/products/studio3" >Aptana Studio 3</a>, which has PyDev support built in, and worked pretty well (apart from the eye mangling default theme)... but still didn&#039;t feel quite right.<br /><br />After much elimination and many crying supermodels, I finally chose <a href="http://pytools.codeplex.com/" >Python Tools for Visual Studio</a>... what can I say? I absolutely adore that IDE.<br />All the shortcuts I know, incredibly quick stepping through code (with Python 2.7 anyway), easy process killing, warnings in the IDE about mismatched white-spacing... it just felt right for me.<br /><br /><h3>The story so far...</h3><br />Despite the warnings and dismissals from internet experts and people I know, my opinion is that Python doesn&#039;t suck too bad.<br />I know my opinion is worth as much as the rest of the experts, but it boils down to this:<br />Bad code is bad code, how bad it is depends on how much you let yourself abuse the available functionality.<br /><br />This initial code for HelperMonkeyBot must be horrendous to seasoned (hmm, salty) Python coders, but it&#039;s a stepping stone for me, and one I am proud of.<br />Not because I learnt a new language, not because I think it&#039;s great code, but simply because I didn&#039;t abuse it too much.<br /><br />I think the thing I like most about Python is the same thing that has me liking Pascal/Delphi still:<br />people who provide examples in Python/Pascal provide code that is understandable, and seemingly want to explain things more than C/++ coders.<br />For years I would search for things like &quot;avi player delphi&quot; because the code would be easy to read, and there would normally be an accompanying article.<br />The great thing is that Python seems way more popular than Delphi, so a whole new world of easy-to-understand code has opened up to me, huzzah!<br /><br />So, soon I will provide an updated HelperMonkeyBot (I&#039;m testing it at the moment) which -thanks to being in Python with some easy to use helper libraries- sends mail reminders.<br />Not the world&#039;s most amazing feature, but considering the C code I&#039;d have to do for that... YAY!]]></content>
		<id>http://iwasdeportedandalligotwasthislousydomain.co.uk/index.php?entry=entry120409-074148</id>
		<issued>2012-04-09T00:00:00Z</issued>
		<modified>2012-04-09T00:00:00Z</modified>
	</entry>
	<entry>
		<title>WebOS Drumpster</title>
		<link rel="alternate" type="text/html" href="http://iwasdeportedandalligotwasthislousydomain.co.uk/index.php?entry=entry111209-080241" />
		<content type="text/html" mode="escaped"><![CDATA[So, I finally managed to get myself a TouchPad, and it&#039;s even more awesome than I thought it would be.<br />It&#039;s currently set up to dual boot between Android and WebOS, and it runs Ubuntu within WebOS just peachily.<br />WebOS just feels so good to use, the browser just _feels_ nicer to use than Android&#039;s or iOS&#039;s.<br /><br />Anyway, kicking the nerdiness up a notch, man oh man is the PDK nice and easy to use, providing OpenGL and SDL from the start, with the ability to test and debug things on Windows.<br /><br />The fairy tale version of my porting story: I barfed up a bit of SDL bootstrap code to create a window and handle inputs, and everything else just worked!<br /><br />The real version: I am a bleeding tool. I initially looked at the PDK samples, one called &quot;simple&quot;, which included an OpenGL ES 2 header file.<br />So I went on a learning escapade where I FINALLY addressed my lack of GLSL knowledge and suspiciously loving attachment to the fixed rendering pipeline.<br />Shaders and whatnot had never made sense to me, until I found <a href="http://www.arcsynthesis.org/gltut/" >this</a> awesome tutorial.<br /><br />So I finally had some shaders up and running, I had some hand-coded matrix maths stuff going, I had 3d models on screen and rotating and... annoyingly disappearing (some Z issue) and going all over the place.<br /><br />In an effort to see what else GLES 2 provides, I decided to see if there were any other header files...<br />There were/are.<br />An OpenGL ES 1 header file.<br />DAMN MALE OFFSPRING OF A FEMALE CANINE!<br /><br />So yes. Drumpster runs on the TouchPad fantastically.<br />Take that Joggler.<br /><br />Oh, and I found and fixed the bug in <a href="static.php?page=helpermonkeybotcpp" >MonkeyBot</a>... and got it running on the BeagleBone and Bifferboard.<br />I&#039;ll upload the new code &quot;soon&quot;.]]></content>
		<id>http://iwasdeportedandalligotwasthislousydomain.co.uk/index.php?entry=entry111209-080241</id>
		<issued>2011-12-09T00:00:00Z</issued>
		<modified>2011-12-09T00:00:00Z</modified>
	</entry>
	<entry>
		<title>Announcing MonkeyBot: Because I&#039;d rather code than learn how to use SSH</title>
		<link rel="alternate" type="text/html" href="http://iwasdeportedandalligotwasthislousydomain.co.uk/index.php?entry=entry111125-080356" />
		<content type="text/html" mode="escaped"><![CDATA[While that&#039;s not strictly true, I am overly paranoid about a bunch of things, opening a port on my firewall being one of them.<br />Not because I think SSH might have flaws, or the firmware on my modem, but because I&#039;m a complete dufus with no self-esteem who doesn&#039;t trust himself, and I really don&#039;t feel like setting up my PC again, post internet-abuse.<br /><br />Sooo, introducing <a href="static.php?page=helpermonkeybotcpp" >(Helper)MonkeyBot</a>, a little instant messenger bot that sits and worships and listens to your commands.<br />You also get a single-page PHP file to view the stored messages more purdy like.<br />MonkeyBot is open source and released under the ZLib licence, and is thus compatible with its dependencies, <a href="http://www.sqlite.org/" >SQLite</a> and <a href="http://camaya.net/gloox/" >Gloox</a> (which uses <a href="http://www.gnu.org/software/gnutls/" >GnuTLS</a>).<br /><br /><center><a href="images/monkeyview_big.jpg"><img src="/images/monkeyview.jpg" alt=""  /></a></center><br /><br />It&#039;s a little program that logs into an XMPP account and listens for commands from another specified XMPP account (with a secret handshake phrase), and basically stores whatever you type to it (with a category), with the option of recalling/viewing/deleting/searching the data via IM, as well as downloading files for you so that they are ready by the time you get home.<br /><br />An example dialog would be:<br /><pre><a href="mailto:nashbor@gmail.com" >nashbor@gmail</a>: Hey Asshat.<br /><a href="mailto:monkeybot@gmail.com" >monkeybot@gmail.com</a>: What do you want?<br /><a href="mailto:nashbor@gmail.com" >nashbor@gmail.com</a>: todo: Make Drumpster less poo.<br /><a href="mailto:monkeybot@gmail.com" >monkeybot@gmail.com</a>: Stored. (MessageID: 1)<br /><a href="mailto:nashbor@gmail.com" >nashbor@gmail.com</a>: download:http://www.3dconstructionkit.co.uk/3dkit/PC-3D_Construction_Kit_2.zip<br /><a href="mailto:monkeybot@gmail.com" >monkeybot@gmail.com</a>: Stored. (MessageID: 2)<br />...&lt;time passes so slowly, slowly...&gt;<br /><a href="mailto:monkeybot@gmail.com" >monkeybot@gmail.com</a>: Download finished successfully: PC-3D_Construction_Kit_2.zip<br /><a href="mailto:nashbor@gmail.com" >nashbor@gmail.com</a>: search:Drump*<br /><a href="mailto:monkeybot@gmail.com" >monkeybot@gmail.com</a>: ID1: Make Drumpster less poo.<br /><a href="mailto:monkeybot@gmail.com" >monkeybot@gmail.com</a>: Search finished.</pre><br /><br />MonkeyBot is super easy to compile on Ubuntu.<pre>apt-get install gcc g++ libgloox-dev<br />change to the folder with the 7 or so MonkeyBot source files<br />compile sqlite with FTS4 support<br />g++ *.o *.cpp -lgloox -lpthread -ldl</pre><br />On any other platform though... I came across some PITA&#039;s:<br /><br />Not every version of Linux has a package manager, especially when trying to use embedded systems, so you&#039;re stuck compiling things for yourself.<br />I spent much too long trying to get libnettle to compile (WHY? Why can&#039;t you see the libnettle include files? The paths are PERFECT you piece of gangrenous armpit slug!), which GnuTLS needs, which Gloox needs.<br /><br />For Windows however, you can get a precompiled GnuTLS DLL and DEF off the gnu website, which you can create a LIB file from, and link against in Visual Studio.<br />I thought it would be:<br />Compile Gloox, linking to GnuTLS. (of course, you have to remove some files from the solution and make a typedef before it will compile)<br />Compile MonkeyBot, linking to Gloox.<br />Make sure all the GnuTLS and Gloox DLL&#039;s are in the MonkeyBot.EXE folder.<br />Run.<br /><br />But nooo, that gave me weird connection issues in Debug mode, or a crash in Release mode.<br />However, deleting all the GnuTLS DLL&#039;s from the .EXE folder made the Debug build connect just fine all of a sudden.<br />My random-unproved-and-probably-shitty theory is that the Debug Gloox.DLL includes the GnuTLS stuff, at least it should, given its size.<br />As for the Release mode crash... some std::string thing that I couldn&#039;t be bothered trying to find out about.<br /><br />I&#039;m considering rewriting the ChatEngine class so that it can use either Gloox or the XMPPFramework for OSX/iOS... with plans to run MonkeyBot and Apache and PHP and the viewing program on a poor abused jailbroken iPhone I got handed down to me by someone rich because I&#039;m so 3rd world.<br /><br />Anyway, it works for me for now, I discovered a crash when creating custom actions JUST as I was uploading the files to my site... so I guess v0.2 will be coming soon... annnd that you should probably take the time to learn about cron and watchdog scripts...<br />Lots to still be done on MonkeyBot, like remote shell, not sucking, reminders that do something actively...<br /><br />Use it, don&#039;t use it, I don&#039;t care.<br />Rock on.]]></content>
		<id>http://iwasdeportedandalligotwasthislousydomain.co.uk/index.php?entry=entry111125-080356</id>
		<issued>2011-11-25T00:00:00Z</issued>
		<modified>2011-11-25T00:00:00Z</modified>
	</entry>
</feed>
