<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.1.3" -->
<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>angelhill.net/code</title>
	<link>http://angelhill.net/code</link>
	<description>rantings of mad programmer(s)</description>
	<pubDate>Wed, 12 Mar 2008 22:38:31 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.1.3</generator>
	<language>en</language>
			<item>
		<title>Install Leopard from a USB Drive using a restore DVD</title>
		<link>http://angelhill.net/code/2008/03/13/install-leopard-from-a-usb-drive-using-a-restore-dvd/</link>
		<comments>http://angelhill.net/code/2008/03/13/install-leopard-from-a-usb-drive-using-a-restore-dvd/#comments</comments>
		<pubDate>Wed, 12 Mar 2008 22:28:51 +0000</pubDate>
		<dc:creator>zeraien</dc:creator>
		
		<category><![CDATA[mac os x]]></category>

		<guid isPermaLink="false">http://angelhill.net/code/2008/03/13/install-leopard-from-a-usb-drive-using-a-restore-dvd/</guid>
		<description><![CDATA[So you want to install Leopard from a DMG file. I don&#8217;t know how you got it, and I don&#8217;t care. However you have a problem, you only have a USB drive.
You might have noticed that you can&#8217;t install Leopard by restoring a Leopard install DMG onto a USB drive, since most Macs wont boot [...]]]></description>
			<content:encoded><![CDATA[<p>So you want to install Leopard from a DMG file. I don&#8217;t know how you got it, and I don&#8217;t care. However you have a problem, you only have a USB drive.</p>
<p>You might have noticed that you can&#8217;t install Leopard by restoring a Leopard install DMG onto a USB drive, since most Macs wont boot from USB.</p>
<p>But if you have a Mac, odds are you have an old Apple Restore DVD lying around. If you have a Mac OS X Leopard restore DVDs that you got with your new mac, you might have noticed that those DVDs wont allow you to install onto an older mac&#8230;<br />
In theory the information below should work with a Tiger DVD as well.</p>
<p>So you have a USB drive with a restored Leopard image on it, and you have a Leopard (or possibly Tiger) restore DVD from your new shiny mac.</p>
<p>Together they form a working Leopard install. I will enlighten you. The information below applies to a Leopard Restore DVD, so YMMV.</p>
<p>Boot the restore DVD by holding down C when restarting your computer with the DVD inserted. It will tell you that Leopard can&#8217;t be installed on this computer. Press OK, do NOT press Restart.</p>
<p>Open the Terminal application from the Utilities menu. By now your USB drive should be inserted and powered.</p>
<p>I am assuming some knowledge of using the command line.</p>
<p>Navigate to the Leopard partition on your USB drive:<br />
<code style="font-size: small;">cd "/Volumes/Mac OS X Install DVD/"</code></p>
<p><code style="font-size: small;">cd "System/Installation/CDIS/Mac OS X Installer.app/Contents/Mac OS/"</code></p>
<p>You have now entered the secret dungeon of the Mac OS X Installer.</p>
<p>This will run the installer:<br />
<code style="font-size: small;">./Mac OS X Installer ../../../../Packages/OSInstall.mpkg</code></p>
<p>Your Leopard install should now begin and you are on your way to Leopard Heaven.</p>
<p> <img src='http://angelhill.net/code/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://angelhill.net/code/wp-content/uploads/2008/03/leopard-usb-trick-1.jpg" onclick="window.open('http://angelhill.net/code/wp-content/uploads/2008/03/leopard-usb-trick-1.jpg','popup','width=1024,height=659,scrollbars=no,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=yes,left=0,top=0');return false"><img src="http://angelhill.net/code/wp-content/uploads/2008/03/leopard-usb-trick-1-tm.jpg" height="100" width="155" border="1" hspace="4" vspace="4" alt="Leopard Usb Trick-1" /></a></p>
<p><!-- technorati tags start -->
<p style="text-align:right;font-size:10px;">Technorati Tags: <a href="http://www.technorati.com/tag/install" rel="tag">install</a>, <a href="http://www.technorati.com/tag/leopard" rel="tag">leopard</a>, <a href="http://www.technorati.com/tag/mac os x" rel="tag">mac os x</a>, <a href="http://www.technorati.com/tag/usb" rel="tag">usb</a></p>
<p><!-- technorati tags end --></p>
]]></content:encoded>
			<wfw:commentRss>http://angelhill.net/code/2008/03/13/install-leopard-from-a-usb-drive-using-a-restore-dvd/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CakePHP Scaffolding custom urls!</title>
		<link>http://angelhill.net/code/2007/07/27/cakephp-scaffolding-custom-urls/</link>
		<comments>http://angelhill.net/code/2007/07/27/cakephp-scaffolding-custom-urls/#comments</comments>
		<pubDate>Fri, 27 Jul 2007 13:47:25 +0000</pubDate>
		<dc:creator>zeraien</dc:creator>
		
		<category><![CDATA[cakephp]]></category>

		<guid isPermaLink="false">http://angelhill.net/code/2007/07/27/cakephp-scaffolding-custom-urls/</guid>
		<description><![CDATA[I found a way to fix a limitation with cake scaffolding.
When defining scaffolding in a controller, use:
var $scaffold = 'admin'
or whatever prefix you want your scaffold urls to have!
This is not documented, so it might just be a feature of the latest 1.2 branch.
This way you can place your scaffolding methods into a separate namespace [...]]]></description>
			<content:encoded><![CDATA[<p>I found a way to fix a limitation with cake scaffolding.</p>
<p>When defining scaffolding in a controller, use:<br />
<code>var $scaffold = 'admin'</code><br />
or whatever prefix you want your scaffold urls to have!<br />
This is not documented, so it might just be a feature of the latest 1.2 branch.</p>
<p>This way you can place your scaffolding methods into a separate namespace and be able to create non-scaffold methods without having to override the scaffolds and thus lose scaffold functionality.</p>
<p>I personally feel that the cake scaffolding is very powerful, especially in version 1.2. It certainly does not replace a full admin center, but is enough to get the project up and running. Once your model is more or less frozen, you can start removing scaffolding or even better, extending it.</p>
]]></content:encoded>
			<wfw:commentRss>http://angelhill.net/code/2007/07/27/cakephp-scaffolding-custom-urls/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Open Source - Exhilarating</title>
		<link>http://angelhill.net/code/2007/05/11/open-source-exhilarating/</link>
		<comments>http://angelhill.net/code/2007/05/11/open-source-exhilarating/#comments</comments>
		<pubDate>Fri, 11 May 2007 15:21:44 +0000</pubDate>
		<dc:creator>zeraien</dc:creator>
		
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://angelhill.net/code/2007/05/11/open-source-exhilarating/</guid>
		<description><![CDATA[I&#8217;m working on getting Totem (the best all-round media player for gnome in my opinion) to work nicer with HTTP authentication when compiled with xine-lib.
Also planning on delving into an authentication framework for xine. Although that is a much bigger issue and I&#8217;ll need to brush up on the xine API first&#8230;
This is my first [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on getting <a href="http://www.gnome.org/projects/totem/">Totem</a> (the best all-round media player for gnome in my opinion) to work nicer with <a href="http://bugzilla.gnome.org/show_bug.cgi?id=418316">HTTP authentication</a> when compiled with xine-lib.</p>
<p>Also planning on delving into an <a href="http://thread.gmane.org/gmane.comp.video.xine.devel/8508/focus=8587">authentication framework for xine</a>. Although that is a much bigger issue and I&#8217;ll need to brush up on the xine API first&#8230;</p>
<p>This is my first ever work on a major open source project and while none of my patches have yet been committed, I feel great. The idea of giving back to the community that has paid my bills for many years is super cool. I wonder if you ever get tired of contributing to open source projects? I&#8217;m such a n00b!</p>
<p><i>update: <a href="http://hg.debian.org/hg/xine-lib/xine-lib?cmd=changeset;node=2997606ae794;style=gitweb">my very first patch</a> has been submitted</i></p>
]]></content:encoded>
			<wfw:commentRss>http://angelhill.net/code/2007/05/11/open-source-exhilarating/feed/</wfw:commentRss>
		</item>
		<item>
		<title>New Rants</title>
		<link>http://angelhill.net/code/2007/03/29/new-rants/</link>
		<comments>http://angelhill.net/code/2007/03/29/new-rants/#comments</comments>
		<pubDate>Wed, 28 Mar 2007 23:48:14 +0000</pubDate>
		<dc:creator>zeraien</dc:creator>
		
		<category><![CDATA[code]]></category>

		<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://angelhill.net/code/index.php/2007/03/29/new-rants/</guid>
		<description><![CDATA[It&#8217;s been around 2 years since I posted here on this blog.
I have decided to once again revive this blog with interesting projects and other code-worthy things.
One day perhaps this blog and /life will merge, but for now they are indeed separate beings focused on separate issues.
First things that I will be posting here are [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been around 2 years since I posted here on this blog.</p>
<p>I have decided to once again revive this blog with interesting projects and other code-worthy things.</p>
<p>One day perhaps this blog and <a href="/life">/life</a> will merge, but for now they are indeed separate beings focused on separate issues.</p>
<p>First things that I will be posting here are collections of documents and other fun things related to interesting projects that I did during the last three years at university (<a href="http://www.kth.se">KTH</a>).</p>
<p>I must admit reading some of the old entries brings back memories of incompetence and such. I&#8217;ve learned a lot since then, but I still have much to learn.<br />
<!-- technorati tags start -->
<p style="text-align:right;font-size:10px;">Technorati Tags: <a href="http://www.technorati.com/tag/blogging" rel="tag">blogging</a></p>
<p><!-- technorati tags end --></p>
]]></content:encoded>
			<wfw:commentRss>http://angelhill.net/code/2007/03/29/new-rants/feed/</wfw:commentRss>
		</item>
		<item>
		<title>More on Python</title>
		<link>http://angelhill.net/code/2004/12/18/more-on-python/</link>
		<comments>http://angelhill.net/code/2004/12/18/more-on-python/#comments</comments>
		<pubDate>Sat, 18 Dec 2004 01:33:24 +0000</pubDate>
		<dc:creator>zeraien</dc:creator>
		
		<category><![CDATA[game engine]]></category>

		<category><![CDATA[python]]></category>

		<category><![CDATA[c++]]></category>

		<guid isPermaLink="false">http://angelhill.net/code/?p=50</guid>
		<description><![CDATA[
How about this idea&#8230;. Python is a pilot, and C++ is the ship.
Basicly I figure that I still want to keep most of the object infrastructure in C++ but let python control some objects such as ships.


I did come up with the idea of sending extensive data back and forth via lists rather then separate [...]]]></description>
			<content:encoded><![CDATA[<p>
How about this idea&#8230;. Python is a pilot, and C++ is the ship.<br />
<br />Basicly I figure that I still want to keep most of the object infrastructure in C++ but let python control some objects such as ships.
</p>
<p>
I did come up with the idea of sending extensive data back and forth via lists rather then separate methods for everything&#8230; this will surely save time and code, since I wont have to have a method for every little detail that python or C might need to know about a ship.
</p>
<p>
In any case, I am still working on this whole integration thingie.</p>
]]></content:encoded>
			<wfw:commentRss>http://angelhill.net/code/2004/12/18/more-on-python/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Enter: XML</title>
		<link>http://angelhill.net/code/2004/12/18/enter-xml/</link>
		<comments>http://angelhill.net/code/2004/12/18/enter-xml/#comments</comments>
		<pubDate>Sat, 18 Dec 2004 01:22:04 +0000</pubDate>
		<dc:creator>zeraien</dc:creator>
		
		<category><![CDATA[game engine]]></category>

		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://angelhill.net/code/?p=49</guid>
		<description><![CDATA[
Today I realised that perhaps the best way to store data about graphics, sounds, objects and actions would probably be XML.


After creating some basic XML files containing the data for my meager game, I have come to realise that I was correct. Using XML files might create a larger file, but in the end I [...]]]></description>
			<content:encoded><![CDATA[<p>
Today I realised that perhaps the best way to store data about graphics, sounds, objects and actions would probably be XML.
</p>
<p>
After creating some basic XML files containing the data for my meager game, I have come to realise that I was correct. Using XML files might create a larger file, but in the end I believe it to be worth it.<br />
<br />XML makes it easy to store the data about all kinds of shit, and by using DTDs I can even set default values for rarely used fields and all that kind of stuff.<br />
<br />In other words, the ambiguity of [&#8221;ship-01&#8243;,&#8221;ship.png&#8221;,12,5,1] was replaced with
</p>
<pre>&lt;ship type="ship-01"&gt;
    &lt;action name="default"&gt;
        &lt;animation name="ship-01-default"/&gt;
    &lt;/action&gt;
&lt;/ship&gt;
</pre>
<p>
With the animation itself being in a different place. Basically I believe this will allow me to easily create lots of versatile templates for my game without having to wonder down the road what the hell it all means.
</p>
<p>
I am currently working on parsing the XML files with libxml so I can start using the data from the XML files. It has taken me some time to figure out how the stuff works, but I think I got a grasp on it now and tomorrow I should be able to shun the python data files and just use XML. I hope.</p>
]]></content:encoded>
			<wfw:commentRss>http://angelhill.net/code/2004/12/18/enter-xml/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Python is just a figurehead&#8230;</title>
		<link>http://angelhill.net/code/2004/12/16/python-is-just-a-figurehead/</link>
		<comments>http://angelhill.net/code/2004/12/16/python-is-just-a-figurehead/#comments</comments>
		<pubDate>Thu, 16 Dec 2004 02:29:55 +0000</pubDate>
		<dc:creator>zeraien</dc:creator>
		
		<category><![CDATA[game engine]]></category>

		<category><![CDATA[python]]></category>

		<category><![CDATA[c++]]></category>

		<guid isPermaLink="false">http://angelhill.net/code/?p=48</guid>
		<description><![CDATA[
An important thing to consider:
At the moment, most default values for speed, names, hitpoints and such are all set inside unchangeable C code.


And python has no way to change it. This is bad, simply because python should be the one dictating how many hitpoints the Player ship has and what the speed of torpedoes is.


Tomorrow [...]]]></description>
			<content:encoded><![CDATA[<p>
An important thing to consider:<br />
<br />At the moment, most default values for speed, names, hitpoints and such are all set inside unchangeable C code.
</p>
<p>
And python has no way to change it. This is bad, simply because python should be the one dictating how many hitpoints the Player ship has and what the speed of torpedoes is.
</p>
<p>
Tomorrow (or whenever i get time to continue with this), I shall thoroughly look over the control that python has over the objects, and try to decide how to give it more control, as well as get the communication between python and C++ code improved.
</p>
<p>
I believe that C++ should keep track of objects collisions and such, their life or death state etc, and report any change back into python, while python will be the one to set the values.
</p>
<p>
Still hungry, and tired.</p>
]]></content:encoded>
			<wfw:commentRss>http://angelhill.net/code/2004/12/16/python-is-just-a-figurehead/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Actions followup</title>
		<link>http://angelhill.net/code/2004/12/16/actions-followup/</link>
		<comments>http://angelhill.net/code/2004/12/16/actions-followup/#comments</comments>
		<pubDate>Thu, 16 Dec 2004 02:23:18 +0000</pubDate>
		<dc:creator>zeraien</dc:creator>
		
		<category><![CDATA[game engine]]></category>

		<category><![CDATA[python]]></category>

		<category><![CDATA[c++]]></category>

		<guid isPermaLink="false">http://angelhill.net/code/?p=47</guid>
		<description><![CDATA[
After coding for a few hours, I&#8217;ve come to a pretty decent idea of what I am dealing with.


At the moment, sprites and sounds are completely separated from actual objects.
Well, sounds are actually extensions of the base Object, and sprites are stored in a MAP with the object id being the key.


The issue right now [...]]]></description>
			<content:encoded><![CDATA[<p>
After coding for a few hours, I&#8217;ve come to a pretty decent idea of what I am dealing with.
</p>
<p>
At the moment, sprites and sounds are completely separated from actual objects.<br />
<br />Well, sounds are actually extensions of the base Object, and sprites are stored in a MAP with the object id being the key.
</p>
<p>
The issue right now is that there is no way for the object to inform the sprite as to what graphic it wants to have.<br />
<br />Earlier this was done with the object type string, however the object type is now an integer and is more a generic type to help with the creation of the correct class in python.
</p>
<p>
I realise now however, that the reason python was using strings for object type was simply because the strings were equal to the class names inside the C++ code. I think I will go back to that for simplicity.
</p>
<p>
Also, the whole object type thing, while very useful for torpedoes, still needs some clarification as to it&#8217;s role in other instances.
</p>
<p>
As for which sprite will be assigned to which object, perhaps the addObject method can simply accept the name of the sprite that is needed, or even better, the python code will use it&#8217;s newly created Action code to assign a sprite to an object, until such a time, the object will simply be a floating piece of nothing.<br />
<br />However upon first creation of the object the action code will assign a sprite by default so we dont have to do too many method calls for creation of every object.
</p>
<p>
Basically this post if full of random thoughts, so i can remember this stuff tomorrow.</p>
]]></content:encoded>
			<wfw:commentRss>http://angelhill.net/code/2004/12/16/actions-followup/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Orphans and Parents</title>
		<link>http://angelhill.net/code/2004/12/16/orphans-and-parents/</link>
		<comments>http://angelhill.net/code/2004/12/16/orphans-and-parents/#comments</comments>
		<pubDate>Thu, 16 Dec 2004 01:19:51 +0000</pubDate>
		<dc:creator>zeraien</dc:creator>
		
		<category><![CDATA[game engine]]></category>

		<category><![CDATA[c++]]></category>

		<category><![CDATA[oop]]></category>

		<guid isPermaLink="false">http://angelhill.net/code/?p=46</guid>
		<description><![CDATA[
I added a new method to the base object called destroyAllChildren. This one not only makes children into orphans, but also kills them, meaning they are garbage collected and removed from the object manager upon the next loop.


This has proven useful when we add sounds as children to objects. Because as the object is destroyed, [...]]]></description>
			<content:encoded><![CDATA[<p>
I added a new method to the base object called destroyAllChildren. This one not only makes children into orphans, but also kills them, meaning they are garbage collected and removed from the object manager upon the next loop.
</p>
<p>
This has proven useful when we add sounds as children to objects. Because as the object is destroyed, so are the sounds and any other children that are associated with it. However it is also a problem because even though a ship is destroyed, it&#8217;s torpedoes live on. So I think this method will surely not live inside the constructor. I think the best way to get rid of all useless sounds is to make their isAlive method return false when the sound is done playing.
</p>
<p>
Also I just noticed how cleverly (I think) I handled the sound issue. By making sounds into extensions of object class, I have simply been able to add sounds into the very same object container that holds all the other objects. Making sounds into children of objects, I am able to give sounds position data from their parents without relying on specific functionality in the object manager.
</p>
<p>
This seems to work extremely well, and the only downside is that right now sounds are not automatically garbage collected because their isAlive method always returns true. If I could simply make it return false when the sound is finished, garbage collecting sounds will be a piece of cake. Or rather, it will be done automatically since the function is already there.
</p>
<p>
Perhaps a similar method could be used for graphics. To create a Graphic or Animation extension of the object class, and assign this graphic as a child to whatever object it should be assigned to. Then make it&#8217;s obey parent obey the parents every move (not just match velocity), and we&#8217;re good to go. This might be the best idea I&#8217;ve had yet.
</p>
<p>
The cool thing is that with this method, we don&#8217;t need too much special functionality in the object manager, and we can also extend the Graphic object with more details such as multiple layers and whatnot.
</p>
<p>
Hungry. Must eat.</p>
]]></content:encoded>
			<wfw:commentRss>http://angelhill.net/code/2004/12/16/orphans-and-parents/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Object actions and sound</title>
		<link>http://angelhill.net/code/2004/12/16/object-actions-and-sound/</link>
		<comments>http://angelhill.net/code/2004/12/16/object-actions-and-sound/#comments</comments>
		<pubDate>Thu, 16 Dec 2004 00:19:09 +0000</pubDate>
		<dc:creator>zeraien</dc:creator>
		
		<category><![CDATA[game engine]]></category>

		<category><![CDATA[c++]]></category>

		<category><![CDATA[oop]]></category>

		<category><![CDATA[sound]]></category>

		<guid isPermaLink="false">http://angelhill.net/code/?p=45</guid>
		<description><![CDATA[
I am just sitting here thinking about how to handle various actions that an object can perform and how those actions will affect the object, as well deal with sound.


A thought did occur to me that perhaps a good way would be to have a bunch of action objects, and each of those would in [...]]]></description>
			<content:encoded><![CDATA[<p>
I am just sitting here thinking about how to handle various actions that an object can perform and how those actions will affect the object, as well deal with sound.
</p>
<p>
A thought did occur to me that perhaps a good way would be to have a bunch of action objects, and each of those would in turn have its own sound, graphic and other stuff.<br />
<br />This means that we would in essence be free to choose which actions an object can perform, and simply change to a different action library if we wanted to use a different type of engine for the game.
</p>
<p>
For example, a text action library might perform actions by returning or printing text, while a 2D action library might use sprites and sounds for different actions.
</p>
<p>
Now, the trick is to decide how far the actions extend and what kind of default actions each object normally has anyway. Also, where exactly the actions will live, in C++ or in Python?
</p>
<p>
I will attempt to discuss this topic now.
</p>
<p>
<strong>Now Playing: Gamma Ray - Voice In My Head</strong>
</p>
<p> <a href="http://angelhill.net/code/2004/12/16/object-actions-and-sound/#more-45" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://angelhill.net/code/2004/12/16/object-actions-and-sound/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
