<?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>Melvin's tech blog &#187; Howto</title>
	<atom:link href="http://blog.melvinrook.nl/category/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.melvinrook.nl</link>
	<description></description>
	<lastBuildDate>Sat, 31 Jul 2010 11:31:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Printing to a matrix printer from PostgreSQL</title>
		<link>http://blog.melvinrook.nl/2010/07/31/printing-to-a-matrix-printer-from-postgresql/</link>
		<comments>http://blog.melvinrook.nl/2010/07/31/printing-to-a-matrix-printer-from-postgresql/#comments</comments>
		<pubDate>Sat, 31 Jul 2010 11:29:19 +0000</pubDate>
		<dc:creator>Melvin</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Open source]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://blog.melvinrook.nl/?p=188</guid>
		<description><![CDATA[Recently I found an interesting piece of code again which I would like to share with you. I produced the code about a year ago for a project which needed offline data logging. I used the piece of code to print a line to a matrix printer from PostgreSQL. The matrix printer was connected to [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I found an interesting piece of code again which I would like to share with you. <img src='http://blog.melvinrook.nl/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  I produced the code about a year ago for a project which needed offline data logging.</p>
<p>I used the piece of code to print a line to a matrix printer from PostgreSQL. The matrix printer was connected to the database server and supplied with endless paper. I used a matrix printer, because you can print directly to the device.</p>
<p>With the method, described below, it&#8217;s possible to print with a SQL query or print something initiated by a trigger. Using this method you can log specific data &#8216;offline&#8217;.</p>
<p>The print_line method consists of three files; print_line.c which contains the code to address the printer, a Makefile to compile the print_line.c file and a print_line.sql file which creates the function in SQL.</p>
<p><strong>print_line.c</strong><br />
<a href="http://blog.melvinrook.nl/wp-content/uploads/2010/07/print_line.png"><img src="http://blog.melvinrook.nl/wp-content/uploads/2010/07/print_line.png" alt="" title="print_line" width="660" height="523" class="alignnone size-full wp-image-193" /></a></p>
<p><strong>Makefile</strong><br />
<code>MODULES = printhash<br />
PGXS := $(shell pg_config --pgxs)<br />
include $(PGXS)</code></p>
<p><strong>print_line.sql</strong><br />
<code>CREATE FUNCTION print_line(text) RETURNS integer<br />
AS '/usr/local/libexec/print_line.so', 'print_line'<br />
LANGUAGE C STRICT;</code></p>
<p><strong>Installation:</strong><br />
<code>mkdir /home/user/print_line<br />
cd /home/user/print_line<br />
unzip print_line.zip<br />
make<br />
cp print_line.so /usr/local/libexec/<br />
// open postgresql command line client and execute:<br />
# \i /home/user/print_line/print_line.sql</code></p>
<p><strong>Usage:</strong><br />
<code>SELECT print_line('Hello World!');</code></p>
<p><strong>Download:</strong><br />
<a href='http://blog.melvinrook.nl/wp-content/uploads/2010/07/print_line.zip'>Download print_line.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.melvinrook.nl/2010/07/31/printing-to-a-matrix-printer-from-postgresql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Google design&#8230; buggy?!</title>
		<link>http://blog.melvinrook.nl/2010/04/08/new-google-design-buggy/</link>
		<comments>http://blog.melvinrook.nl/2010/04/08/new-google-design-buggy/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 17:29:46 +0000</pubDate>
		<dc:creator>Melvin</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://blog.melvinrook.nl/?p=156</guid>
		<description><![CDATA[Update (April 13, 2010): I asked myself how to file a bug report. It seems blogging is a way to file a bug report. The new design is part of &#8220;the many, many experiments that Google runs&#8221; Jon Wiley commented. On my workstation Google supplied their new design to me. I didn&#8217;t really liked this [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update (April 13, 2010):</strong> I asked myself how to file a bug report. It seems blogging is a way to file a bug report. The new design is part of &#8220;the many, many experiments that Google runs&#8221; Jon Wiley <a href="#comments">commented</a>.</p>
<p>On my workstation Google supplied their new design to me. I didn&#8217;t really liked this new design at first and that feeling became worse when I noticed some bugs. Also, the new design feels slower than before.</p>
<p>The first picture shows a flaw in the text field. &#8216;Taller&#8217; letters will be cut at the bottom:</p>
<p><a href="http://blog.melvinrook.nl/wp-content/uploads/2010/04/google_buggy1.png"><img class="alignnone size-medium wp-image-157" title="google_buggy1" src="http://blog.melvinrook.nl/wp-content/uploads/2010/04/google_buggy1-300x177.png" alt="google_buggy1" width="300" height="177" /></a></p>
<p>The second picture shows a more serious bug. Typing a search phrase and pressing enter results in the page with results and the suggestion dropdown from the previous page still visible.</p>
<p><a href="http://blog.melvinrook.nl/wp-content/uploads/2010/04/google_buggy2.png"><img class="alignnone size-medium wp-image-160" title="google_buggy2" src="http://blog.melvinrook.nl/wp-content/uploads/2010/04/google_buggy2-300x186.png" alt="google_buggy2" width="300" height="186" /></a></p>
<p>I have tried to file a bug report, but it seems impossible to contact them directly.</p>
<p>Would like to try the new Google interface? Perform the following steps to make it so:</p>
<ul>
<li>Visit Google</li>
<li>Clear out the contents in your address bar</li>
<li>Enter the following: javascript:void(document.cookie=”PREF=ID=20b6e4c2f44943bb:U=4bf292d46faad806:TM=1249677602:LM=1257919388:S=odm0Ys-53ZueXfZG;path=/; domain=.google.com”);</li>
<li>Press the Enter key</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.melvinrook.nl/2010/04/08/new-google-design-buggy/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using wxFormBuilder with Code::Blocks on Mandriva 2009</title>
		<link>http://blog.melvinrook.nl/2009/02/20/using-wxformbuilder-with-codeblocks-on-mandriva-2009/</link>
		<comments>http://blog.melvinrook.nl/2009/02/20/using-wxformbuilder-with-codeblocks-on-mandriva-2009/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 14:16:22 +0000</pubDate>
		<dc:creator>Melvin</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Open source]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://blog.melvinrook.nl/?p=137</guid>
		<description><![CDATA[After some puzzling I found out how to setup a nice development environment with wxFormBuilder and Code::Blocks on Mandriva Linux 2009. How to do this is described below. Packages Download and install the following packages and it&#8217;s dependencies: Code::Blocks libwxgtku2.8 libwxgtku2.8-devel wxGTK2.8 wxFormBuilder Download the wxFormBuilder 3.0 linux source including the pre-generated Makefiles. Now unpack [...]]]></description>
			<content:encoded><![CDATA[<p>After some puzzling I found out how to setup a nice development environment with wxFormBuilder and Code::Blocks on Mandriva Linux 2009. How to do this is described below.</p>
<p><strong>Packages</strong></p>
<p>Download and install the following packages and it&#8217;s dependencies:</p>
<ul>
<li> Code::Blocks</li>
<li>libwxgtku2.8</li>
<li>libwxgtku2.8-devel</li>
<li>wxGTK2.8</li>
</ul>
<p><strong>wxFormBuilder</strong></p>
<p>Download the wxFormBuilder 3.0 linux source including the pre-generated Makefiles. Now unpack the tarball, build and install wxFormBuilder:</p>
<ul>
<li>cd /usr/local/src/</li>
<li>wget or fetch wxformbuilder-3.0.57.tar.gz</li>
<li>tar -zxvf wxformbuilder-3.0.57.tar.gz</li>
<li>cd wxformbuilder_3.0.57</li>
<li>make CONFIG=Release</li>
<li>./install/linux/wxfb_export.sh /usr</li>
</ul>
<p><strong>Code::Blocks</strong></p>
<ul>
<li>Start Code::Blocks and open the menu Tools -&gt; Configure tools&#8230;</li>
<li>Click on Add.</li>
<li>The following picture shows how to setup the tool:</li>
</ul>
<p><a href="http://blog.melvinrook.nl/wp-content/uploads/2009/02/cb_edit_tool.png"><img class="alignnone size-medium wp-image-138" title="cb_edit_tool" src="http://blog.melvinrook.nl/wp-content/uploads/2009/02/cb_edit_tool-300x259.png" alt="" width="300" height="259" /></a></p>
<ul>
<li>Save the settings and open the menu File -&gt; New -&gt; Project</li>
<li>Choose wxWidgets project</li>
<li>Walk trough the wizard</li>
<li>Use wxWidgets 2.8.x</li>
<li>Preferred GUI Builder: wxFormBuilder</li>
<li>Application type: Frame Based</li>
<li>Use the default widgets configuration</li>
</ul>
<p>When you would like to modify your GUI you can open the following menu: Tools -&gt; wxFB. Which will launch wxFormBuilder with your GUI. When it asks for conversion, click yes.</p>
<p>Don&#8217;t forget to generate the code (press F8) before you switch back to Code::Blocks. Otherwise you changes won&#8217;t be visible. You also need to build your project in Code::Blocks before your changes are visible.</p>
<p>In certain versions and combinations of the software the following compile error could occur: <em>&#8220;wxMessageBox was not declared in this scope&#8221;</em>. There are two solutions to this problem:</p>
<p>1) I noticed wxFormBuilder changed a bit. All headers where included in the generated code, even when the headers were not necessary. Now not all the headers are included. When you use other wxWidgets methods just add the proper header. In this case you can use the following include:</p>
<pre>#include &lt;wx/msgdlg.h&gt;</pre>
<p>2) Do not use the Code::Blocks wxWidgets template and just setup a clean C::B project. Then also setup a clean wxFormBuilder project by using the inherited class tutorial (*). Finally add the code manually to the project.</p>
<p><strong>Links</strong></p>
<ul>
<li><a href="http://www.codeblocks.org">Code::Blocks</a></li>
<li><a href="http://wxformbuilder.org">wxFormBuilder</a></li>
<li><a href="http://wiki.wxformbuilder.org/Tutorials/UsingWxFormBuilder">Inherited class tutorial</a> (*)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.melvinrook.nl/2009/02/20/using-wxformbuilder-with-codeblocks-on-mandriva-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Game development &#8211; how to begin?</title>
		<link>http://blog.melvinrook.nl/2008/12/11/game-development-how-to-begin/</link>
		<comments>http://blog.melvinrook.nl/2008/12/11/game-development-how-to-begin/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 20:21:33 +0000</pubDate>
		<dc:creator>Melvin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Open source]]></category>
		<category><![CDATA[Phyzle]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://blog.melvinrook.nl/?p=87</guid>
		<description><![CDATA[How to begin with game development? That&#8217;s the very same question I asked myself a few years ago. I think, that&#8217;s is the most difficult step in the process of learning. How should I start? Where should I start? With what should I start? First of all you need to ask the following question: Can [...]]]></description>
			<content:encoded><![CDATA[<h1>How to begin with game development?</h1>
<p>That&#8217;s the very same question I asked myself a few years ago. I think, that&#8217;s is the most difficult step in the process of learning. How should I start? Where should I start? With what should I start?</p>
<p>First of all you need to ask the following question: Can I start? The most simple answer is: yes you can! Everyone can start with game development, but on what time frame? Perhaps you need to learn a bit more of other topics before you actually can begin, because you can&#8217;t really program for example.</p>
<p>When developing games, a good knowledge of programming is a real advantage. It will be a lot easier to understand what&#8217;s going on. So when you are reading my post and you can&#8217;t even program, I would suggest to begin with learning C, C++ or PHP for example. You can take the course on your own by reading books and playing around a bit with simple console based applications or by taking the proper education in a school.</p>
<p>If you can program, then it&#8217;s a lot easier to start with game programming. Now we come to the answers on the questions how, where and with what to start. I think it&#8217;s the best to cover something I have experience with. When I tried to learn game programming, I personally started with a purchase of a GP2X game console.</p>
<p><a href="http://www.gp2x.com/"><img class="alignnone size-medium wp-image-88" title="gp2x" src="http://blog.melvinrook.nl/wp-content/uploads/2008/12/gp2x-300x198.jpg" alt="" width="300" height="198" /></a></p>
<p>The GP2X is a portable device running a modified version of Linux. At the time I started to program for the GP2X, it was possible to create games with C or C++ combined with SDL for the graphics, controls and sounds. I started with loads of projects, but actually I never really finished a project yet. I learned a lot of it though. So when you are really up to a challange, buy a GP2X and start to create games! /* Will post sample code, IDE and games in near future. */</p>
<p>A few months later I started with a project on the Rijswijk university of professional technical education. The goal was to design and create a game from scratch. However, for the university it was important to have an insight on the process of designing and creating a game, because they wanted to start a new programming theme: &#8220;Game development&#8221;. The game programming theme will cover the most important aspects of game development. So there where a few extra requirements. An opensource engine should be used for example. This is important, because then the university is allowed to change some things &#8220;under the hood&#8221;, there is no problem with licensing costs and games can easily be published by students. Also, our projectteam was required to make use of physics simulation. Which, by the way, makes games really more interesting. <img src='http://blog.melvinrook.nl/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>One of the steps in the process was picking the best game engine. We decided to make our own &#8220;package&#8221; which consisted of the following parts:</p>
<ul>
<li>Ogre3D (render engine)</li>
<li>PhysX (physics engine)</li>
<li>NxOgre (wrapper between Ogre3D and PhysX)</li>
<li>FMOD (sound manager)</li>
</ul>
<p>I started learning developing games by following the tutorials for Ogre3D. I also played around with the Ogre3D samples by modifying code and playing around with it. After we had setup a test environment with the help of a NxOgre tutorial named &#8216;Cake&#8217;. <em>&#8220;Cake is a small sandbox type application to quickly prototype or play with any feature of NxOgre. It’s designed to work within two functions; createScene and onFrame, so that all of the Ogre, GUI and Input code is hidden away from direct view and the developer can concentrate on the NxOgre code only.&#8221;</em> (Source: <a href="http://nxogre.org/cake ">cake</a>)</p>
<p>After we played around a lot with cake we decided to start on the game development of the real game. Phyzle, our concept, is an open source puzzle game using physics as its main game play element. The goal is to bring a ball from point A to B as fast as possible using physics elements like magnets, springs and more.</p>
<p>In a level your goal consists of bringing your ball from A to B as fast as possible, without losing or destroying your ball. The faster you finish, the more points you will earn. The ball can be destroyed by elements like fire, hammers or explosions. Besides the destroying elements there are also helping elements. You can use these elements to improve your finishing time. For example you can make use of elements like fans or magnets.</p>
<h2>Making a game concept</h2>
<p>/* Will post this topic in the near future */</p>
<p>In general, I can&#8217;t cover every topic about game development. However, the internet does cover almost every topic. Please make use of it! <sub>And, of course, make use of the following URLs:</sub></p>
<ul>
<li><a href="http://www.gamedev.net/">http://www.gamedev.net/</a></li>
<li><a href="http://www.gamasutra.com/">http://www.gamasutra.com/</a></li>
<li><a href="http://www.gdmag.com">http://www.gdmag.com</a></li>
<li><a href="http://www.devmaster.net/">http://www.devmaster.net/</a></li>
</ul>
<p>/* Disclaimer: This post is still a draft. More topics will be added in the near future. When you need specific information, please ask for it by replying to this post! */</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.melvinrook.nl/2008/12/11/game-development-how-to-begin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing a Call of Duty 4 server on FreeBSD</title>
		<link>http://blog.melvinrook.nl/2008/11/25/installing-a-call-of-duty-4-server-on-freebsd/</link>
		<comments>http://blog.melvinrook.nl/2008/11/25/installing-a-call-of-duty-4-server-on-freebsd/#comments</comments>
		<pubDate>Tue, 25 Nov 2008 18:51:35 +0000</pubDate>
		<dc:creator>Melvin</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Open source]]></category>

		<guid isPermaLink="false">http://blog.melvinrook.nl/?p=49</guid>
		<description><![CDATA[One of the reasons why I write this post is that I always forget how I managed to install the COD4 server on FreeBSD. Another reason is that people keep asking on how I did it, so I will try to provide a complete manual. This post will most likely receive a few updates in [...]]]></description>
			<content:encoded><![CDATA[<p>One of the reasons why I write this post is that I always forget how I managed to install the COD4 server on FreeBSD. Another reason is that people keep asking on how I did it, so I will try to provide a complete manual. This post will most likely receive a few updates in the future. Please post your requests for help by commenting on this post.</p>
<h1>Requirements</h1>
<ul>
<li>FreeBSD (jail) installation</li>
<li>Port/package linux_base-fc4 installed</li>
<li>Enabled linux emulation</li>
<li>COD4 DVD</li>
</ul>
<h1>Creating your server release</h1>
<ul>
<li>First of all you need a MS windows installation or emulation to install/unpack your COD4 DVD. For example you could install/unpack to &#8216;C:\Games\cod4\&#8217;. The reason that you need to do this on windows is because Activision/Infinity Ward doesn&#8217;t provide a serverpackage or unix installation of cod4.</li>
<li>Now patch your installation to the latest version (current version is: 1.7568)</li>
<li>Create a directory &#8216;C:\Games\cod4srv\&#8217;.</li>
<li>Copy the all the files and directories from cod4 to cod4srv.</li>
<li>Go to &#8216;C:\Games\cod4srv\&#8217; and delete the following files as this will save some space on your server:
<ul>
<li>Docs\</li>
<li>main\videos\* (all but keep zakhaev_escape.bik)</li>
<li>players\</li>
</ul>
</li>
<li>Get the cod4 linux binaries from the following URL: http://treefort.icculus.org/cod/ (most recent: cod4-linux-server-06282008.tar.bz2)</li>
<li>Unpack cod4-linux-server-06282008.tar.bz2 to &#8216;C:\Games\cod4srv\&#8217;.</li>
<li>Now pack &#8216;C:\Games\cod4srv\&#8217;</li>
<li>Transfer the pack to your server</li>
<li>Unpack (to the directory &#8216;/home/cod4/cod4srv&#8217; for example)</li>
<li>Keep your original (C:\Games\cod4\) directory for future patching</li>
</ul>
<h1>Running your COD4 server</h1>
<ul>
<li>Create a server.cfg file (an example server.cfg file can be found here)</li>
<li>Put the server.cfg file in the &#8216;/home/cod4/cod4srv/main&#8217; directory</li>
<li>Now we can run the server:
</ul>
<pre>
cod4srv# cd /home/cod4/cod4srv
cod4srv# ./cod4_lnxded +set dedicated 2 +set net_port 28960 sv_maxclients 20 +exec server.cfg +map_rotate &#038;
</pre>
<p>This command will start a dedicated server on port 28960 with 20 slots, map rotation enabled and will load the options from the server.cfg file. The server will run in the background. Optionally you can run the server in a screen session and detach from it.</p>
<h1>Patching your server release</h1>
<p>/* Coming soon */</p>
<h1>Installing anti-cheat mechanisms</h1>
<h2>PunkBuster</h2>
<p>First shutdown or kill your running cod4 server. Now run the following commands:</p>
<pre>
cod4srv# cd /home/cod4/cod4srv
cod4srv# ./pbsetup.run -e
cod4srv# ./pbsetup.run --add-game=cod4 --add-game-path=/home/cod4/cod4srv/
cod4srv# ./pbsetup.run -u
</pre>
<p>While running the PunkBuster setup it will ask you to agree to a license and possibly ask you a few other questions. The PB setup will download and install the most recent files. Now you can run your server again!</p>
<h2>Dmw Pro</h2>
<p>/* Coming soon */</p>
<h1>FAQ</h1>
<p><strong>Why don&#8217;t you play cod4?</strong> Oh, I forgot to tell&#8230; I don&#8217;t really play cod4, I just installed a cod4 server for a couple of friends. And yes, I have an official license key. <img src='http://blog.melvinrook.nl/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.melvinrook.nl/2008/11/25/installing-a-call-of-duty-4-server-on-freebsd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

