<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>Graal Forums - Blogs</title>
		<link>http://forums.graalonline.com/forums/blog.php</link>
		<description>Graalonline Forums</description>
		<language>en</language>
		<lastBuildDate>Fri, 18 May 2012 22:57:40 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://forums.graalonline.com/forums/images/misc/rss.jpg</url>
			<title>Graal Forums - Blogs</title>
			<link>http://forums.graalonline.com/forums/blog.php</link>
		</image>
		<item>
			<title><![CDATA[I haven't written much here, but I do come often somehow]]></title>
			<link>http://forums.graalonline.com/forums/blog.php?b=311</link>
			<pubDate>Thu, 19 Apr 2012 05:55:06 GMT</pubDate>
			<description>Alas, my adventures through the Graal-Internet space has been an interesting voyage. With the various places I have been to, I feel like this place is interesting. The many encounters of many internet-thriving species, from the websiticus to.... 
Aaaand, I have lost my train of thought. Was going...</description>
			<content:encoded><![CDATA[<div>Alas, my adventures through the Graal-Internet space has been an interesting voyage. With the various places I have been to, I feel like this place is interesting. The many encounters of many internet-thriving species, from the websiticus to....<br />
Aaaand, I have lost my train of thought. Was going to write something epic but I don't have the brainpower to today. I guess now this is going to be like a diary now.<br />
<br />
Today I ate like twenty potstickers. It was delicious but for some reason aftertaste of potstickers stick to people for like ages. It's weird right? But yeah, gotta get ready for dem friend hangouts tommorow. Moviemaking day one shall be greatlious. Great and glorious, for the old mind of me. Or to other people reading this, as I forgot you guys can see this. Well, if that's the case...<br />
HI PEOPLE I AM HERE AND STUFF<br />
And also yeah. Uh, yeah.<br />
<br />
I should write something more cool next time.</div>

]]></content:encoded>
			<dc:creator>lardy227</dc:creator>
			<guid isPermaLink="true">http://forums.graalonline.com/forums/blog.php?b=311</guid>
		</item>
		<item>
			<title>i am recruiting for house lannister</title>
			<link>http://forums.graalonline.com/forums/blog.php?b=310</link>
			<pubDate>Thu, 22 Mar 2012 00:19:36 GMT</pubDate>
			<description><![CDATA[we are a local house occupying the realm of unholy nation 
 
we actually don't have a ruling lord yet so we are accepting applications to become our leader]]></description>
			<content:encoded><![CDATA[<div>we are a local house occupying the realm of unholy nation<br />
<br />
we actually don't have a ruling lord yet so we are accepting applications to become our leader</div>

]]></content:encoded>
			<dc:creator>Mark Sir Link</dc:creator>
			<guid isPermaLink="true">http://forums.graalonline.com/forums/blog.php?b=310</guid>
		</item>
		<item>
			<title>Project: Image to level format parsing. Part 1</title>
			<link>http://forums.graalonline.com/forums/blog.php?b=309</link>
			<pubDate>Tue, 20 Mar 2012 03:58:32 GMT</pubDate>
			<description><![CDATA[I started a little project last night. I was talking to someone in IRC about a Graal clone they were doing, and eventually it landed on the subject of me suggesting to pull away from Graal and just clone Zelda until he figures out what he wants with his project. I figured he'd be better off copying...]]></description>
			<content:encoded><![CDATA[<div>I started a little project last night. I was talking to someone in IRC about a Graal clone they were doing, and eventually it landed on the subject of me suggesting to pull away from Graal and just clone Zelda until he figures out what he wants with his project. I figured he'd be better off copying a more well-known game that is built exactly the same and simply replace the content with stuff from LttP. Well it eventually made its way to obtaining the levels from LttP in the format of NW, which his game already loads. <br />
<br />
There are levels floating around Graal that have some of the LttP overworld in NW format, but not the entire overworld. In fact, most of the overworld is missing. So I set out to create a converter that would take an image and create a tileset of all unique tiles, and then take that data and create a level format.<br />
<br />
The process is fairly simple. You take an image(in this case, the image of the entire LttP overworld) and run a few loops. Since tiles are 8x8 pixels, you can take the size of the overworld and create a loop /8 of that. Then you loop through the overworld, grabbing all the pixel data of a tile. Have an array(or in my case, an arraylist[I'm doing this in Java], though a hashmap would work as well) handy. Also create a function that will look up in that array whether or not an instant exists. Okay, loop through the image and for every tile, check if the pixel data exists in the array of tiles. If it doesn't, then add it to the list and grab that portion of the image and add it to an imagebuffer/canvas. You can know where to add it to the tileset image by finding the size of the tiles array.<br />
<br />
With java, even while looping through such a large image and grabbing the 64 pixels of each tile and then looping through an array, this was a fairly fast process. The tileset you end up with is quite a mess though. A code doesn't know how to organize like-tiles unless you tell it to... and we did not do that.<br />
<br />
But does it matter? The goal here is to automate the entire process, so we'll never have to actually use the tileset ourselves. So this is the image I ended up with:<br />
<a href="http://forums.graalonline.com/forums/blog_attachment.php?attachmentid=59&amp;d=1332215326" rel="Lightbox" id="attachment59" target="_blank"><img src="http://forums.graalonline.com/forums/blog_attachment.php?attachmentid=59&amp;thumb=1&amp;d=1332215326" class="thumbnail" border="0" alt="Click image for larger version

Name:	loz_ow-tileset.png
Views:	34
Size:	64.5 KB
ID:	59" style="margin: 2px" /></a><br />
<br />
Ya, quite a mess.<br />
<br />
Anyways. I didn't jump quite into creating an NW format yet. I instead opted to generate a level using Tiled since its raw format is insanely easy to export to. You can find Tiled over at <a href="http://www.mapeditor.org" target="_blank">www.mapeditor.org</a>. This was actually pretty easy as well. All I did was again, loop through each tile in the overworld. I created a duplicate of my lookup function and made it return the id of the tile(based on its position in the created tileset). Besides that, all you have to do is take the now-found id and export it into the level file. I won't elaborate on the format because this isn't the final goal(NW is). Point is, is that we spit the id out into the file. In Tiled's RAW format it's as simple as appending a new line to the .tmx file:<br />
<br />
&lt;tile gid=&quot;TILEIDVALUE&quot;/&gt;<br />
<br />
Because Tiled's XML automatically arranges the tiles visually by the map's width and height.<br />
<br />
Anyways, you can view the source here. I didn't create this with the idea of others using it in mind, at least not yet. So everything is literally hard-coded to the specifications I needed to generate the LttP map. Even the Tiled export function uses predefined text instead of formatting it appropriately.<br />
<br />
<a href="http://pastebin.com/Rzc6K2af" target="_blank">http://pastebin.com/Rzc6K2af</a><br />
<br />
You can check out the Tiled level(I opened the level in Tiled and resaved it as compressed gzip to greatly reduce the size, so don't be surprised if opening it in a text editor spits out nothing like what I posted) in the attachments:<br />
<a href="http://forums.graalonline.com/forums/blog_attachment.php?attachmentid=60&amp;d=1332215785" >lightworld.zip</a><br />
<br />
I'm setting out to actually create a NW gmap with this parsing system as well, but it will take a lot more work.</div>

]]></content:encoded>
			<dc:creator>DustyPorViva</dc:creator>
			<guid isPermaLink="true">http://forums.graalonline.com/forums/blog.php?b=309</guid>
		</item>
		<item>
			<title>Officer Geno</title>
			<link>http://forums.graalonline.com/forums/blog.php?b=307</link>
			<pubDate>Thu, 08 Mar 2012 20:09:50 GMT</pubDate>
			<description><![CDATA[on april 9th I will be sworn in as a federal transportation security officer. after bar-tending for  over a year i'm afraid to have a real job. i love bar tending. why did i apply...why did they hire me? 
 
 
idk what to do feeling sad now :(]]></description>
			<content:encoded><![CDATA[<div>on april 9th I will be sworn in as a federal transportation security officer. after bar-tending for  over a year i'm afraid to have a real job. i love bar tending. why did i apply...why did they hire me?<br />
<br />
<br />
idk what to do feeling sad now :(</div>

]]></content:encoded>
			<dc:creator>Geno</dc:creator>
			<guid isPermaLink="true">http://forums.graalonline.com/forums/blog.php?b=307</guid>
		</item>
		<item>
			<title><![CDATA[[Community] Ten Things That Could Save Our Game]]></title>
			<link>http://forums.graalonline.com/forums/blog.php?b=305</link>
			<pubDate>Tue, 21 Feb 2012 10:21:12 GMT</pubDate>
			<description>I. Multi-Platform Account Management 
 
Manage player information available across all mediums for Graal Online. This includes things like iPhone account statistics, player and development accounts, guilds, the support center, and so on. This can probably be accomplished through a revision of the...</description>
			<content:encoded><![CDATA[<div><font face="System"><font size="7">I. Multi-Platform Account Management</font></font><br />
<br />
Manage player information available across all mediums for Graal Online. This includes things like iPhone account statistics, player and development accounts, guilds, the support center, and so on. This can probably be accomplished through a revision of the account control panel we currently use on the site.<br />
<br />
<font size="7"><font face="System">II. Content Integration</font></font><br />
<br />
Someone with considerable image editing and webpage design skills should step up to the plate and work on making a new site for the community which integrates all aspects of Graal Online.<br />
<br />
As it stands, the Graal Online website is a disjointed mess of various flash websites with annoying auto-play videos, thrown altogether on one splash page like some kind of fluorescent nightmare.<br />
<br />
It would be nice to have things like news content feeds through facebook and twitter that have also been posted on the website, and lots of other features like that which go a little bit beyond the 'Web 2.0' features the site already has.<br />
<br />
Additionally, things like the Graal Bible, Gelat Shop, and Server Rentals should be made more apparent on the site, and players should be able to manage all aspects of every account they use, including ones for mobile devices.<br />
<br />
<font size="7"><font face="System">III. Self-Funding Servers</font></font><br />
<br />
Server renewal fees should be made payable through successful item sales using the Gelat Shop.<br />
<br />
<font size="7"><font face="System">IV. Public Resource Galleries</font></font><br />
<br />
A collection of resources uploaded by players for free use and modification on any server.<br />
<br />
Like the Scripted Development Toolkits idea below, it could be periodically updated as an install package that gets revised over time. Or, there could be an extra section added onto our Screenshot Gallery. The Code Gallery should probably be included in the same place.<br />
<br />
Keeping a collection of useful resources would make it easier for future generations to get their creations off the ground faster, and have a good chance of improving the overall look of Graal as a whole. While I realize some may think this will lead to a lot of recycling, I think differently. I think plenty of people will make an effort to build and modify previous good work until it absolutely shines out among others.<br />
<br />
Why? Because people like to customize and personalize the work published on their own individual servers.<br />
<br />
That alone can yield some unexpected results sometimes. Especially if users are experimenting and educating themselves at the same time.<br />
<br />
<font size="7"><font face="System">V. Community Projects</font></font><br />
<br />
Players with considerable skill should be asked to spearhead major community projects with oversight from Graal administration. Graal Kingdoms and Zone have been good gold servers for a while now, but they still don't get as much daily traffic as Zodiac and Era do on average.<br />
<br />
That is problematic, because we really could use a few servers in the Gold category right now that users have a more active role in shaping. Every once in a while, Stefan might be able to assist with a project or two, but really the scripters involved should be self-sufficient, motivated, and autonomous to begin with. They will be expected to keep their team together, or else new ones will be hired in and given a shot to direct the project instead.<br />
<br />
Basically, the aim of this is to reinforce the existence of a strong server or set of servers which give Graal a good image, while simultaneously pressuring teams of quality developers to stay together. Right now servers are lacking cohesion, and we need something that brings both players and developers to the table.<br />
<br />
<font size="7"><font face="System">VI. Scripted Development Toolkits</font></font><br />
<br />
Built much like a swiss army knife, multi-tool scripts for development could speed up server production across all servers astronomically.<br />
<br />
If the community were to focus on creating a big integrated system of scripted tools that come together like an operating system and have it officially included in the new scripted RC, there's the potential for a lot of work to get done.<br />
<br />
Lately I've been drafting up a list of tools which would be very nice utilities for all servers to use. And all of them have already been publicly released through the code gallery. This is just another reason why I think resource galleries are a great idea.<br />
<br />
<font size="7"><font face="System">VII. Global and Moderator Leadership</font></font><br />
<br />
In addition to normal duties, willing globals on the forums should try to motivate users to participate in activities which will benefit the community at large.<br />
<br />
If possible, Playerworld Administrators should do things like polling players about what up-and-coming worlds they like, what rules players think should be in place, and so forth.<br />
<br />
Likewise, Moderators in their respective forums should do things to promote the general education of users participating in the forums like highlighting important threads, hosting collaboration projects, and whatever else works to assist others with improvement.<br />
<br />
<font size="7"><font face="System">VIII. Taking Risks</font></font><br />
<br />
If you are a server owner, you need to take some risks now and then on new users who might be a little bit under your expectations. If you work with them long enough and refer them to tutorials and whatnot, they can improve a lot over time.<br />
<br />
Similarly, if a user has a new idea that you don't like, at least give them the opportunity to present their idea. Their idea could wind up exceeding your expectations, and could require very few steps to undo in some instances if things don't work out.<br />
<br />
<font size="7"><font face="System">IX. Additional Codes Of Conduct</font></font><br />
<br />
Let's be honest. Everyone knows the community is kind of toxic right now. The PC version of the game is not faring so well right now, and we as users are partially to blame, because there's so much constant fighting going on over various things. Staff professionalism is at an all-time low lately, and it's because there aren't really many rules laid out for developers other than property and ownership rights.<br />
<br />
If anything, the rules list should be expanded for all levels of Graal, including roles and expectations for Global Staff, Server Owners, Server Developers, Super Moderators, Moderators, and any other user professionally representing Graal Online.<br />
<br />
The fact that all levels of administration and staff can be found on the forums bickering with each other over the most unimportant issues is quite unfortunate for our community as a whole, yet it's been going on for at least ten full years.<br />
<br />
<font size="7"><font face="System">X. Asking Important Questions</font></font><br />
<br />
Most importantly, I think it is important for people to ask the community or community leaders about their opinions.<br />
<br />
However, doing so requires a good deal of unbiased inquiry. Should you do things like posting polls in the forums to find out what the community thinks about something, don't make your questions slanted toward the answer you want to hear. Let the community make its voice heard by keeping things balanced.<br />
<br />
If we are to move forward on our own as developers without much aid from higher administration, we need to address what our own faults are as an entity before we can rid ourself of bad habits.<br />
<br />
If there's going to be any change, it needs to begin with us.</div>

]]></content:encoded>
			<dc:creator>Draenin</dc:creator>
			<guid isPermaLink="true">http://forums.graalonline.com/forums/blog.php?b=305</guid>
		</item>
		<item>
			<title><![CDATA[[Community] What Sinks A Server]]></title>
			<link>http://forums.graalonline.com/forums/blog.php?b=301</link>
			<pubDate>Mon, 20 Feb 2012 10:20:00 GMT</pubDate>
			<description><![CDATA[I've been around long enough to have seen a fair number of servers fail. It's never a pretty sight, but I see it as something to learn from. Each server has a reason for being abandoned, and we've been ignoring some of these reasons for far too long. 
 
In this entry, I'll be listing all the...]]></description>
			<content:encoded><![CDATA[<div>I've been around long enough to have seen a fair number of servers fail. It's never a pretty sight, but I see it as something to learn from. Each server has a reason for being abandoned, and we've been ignoring some of these reasons for far too long.<br />
<br />
In this entry, I'll be listing all the reasons why I've seen servers fail. Each reason is directly related to a playerworld that I've seen go under, or to well-established servers which are now declining in popularity.<br />
<br />
If we do not address these issues as a community, I don't see how any server is going to survive for long in the future.<br />
<br />
So far, here is what I've seen ruin servers:<br />
<br />
<br />
<font size="7"><font face="System">Changes in Server Management</font></font><br />
<br />
Rapid changes in server management can mess things up in all sorts of ways.<br />
<br />
New managers are not usually familiar with all aspects of the server in the same way the first manager probably was. They're also bound to have different chemistries with different developers, and could need an entirely new staff team altogether.  They also won't have the same ideas in mind for the server, and that could cause some major changes to the way things will unfold for a server.<br />
<br />
<font size="7"><font face="System">Content Disputes</font></font><br />
<br />
Content disputes seem to happen constantly on Graal. From what I can gather, it mostly has to do with a lot of ordinary players craving recognition for their work or ideas. There is nothing wrong with this desire, but it has the potential to be destructive.<br />
<br />
The best way to deal with this if you are responsible for content is to be receptive to the ideas of fellow team members. If there is a disagreement, either talk it out or be democratic about what gets put into the game.<br />
<br />
<font size="7"><font face="System">Development Assignments</font></font><br />
<br />
All too often, I see a lot of managers waiting on others to complete important assignments before they are able to continue making progress on their server. And while I understand the importance of giving out assignments, it hinders a server's progress greatly. The best way to overcome a creative obstacle is to come back to the project you're having difficulty with later.<br />
<br />
If you work on some other things you're interested in while a big project sits on the backburner, you'll probably find yourself coming back to revisit that project with a more practiced hand. Think about it.<br />
<br />
<font size="7"><font face="System">Lack of Staff</font></font><br />
<br />
Good developers need to start hooking up. For serious.<br />
<br />
There are so many servers out there that are ridiculously under-staffed right now because of an increase in the number of playerworlds being worked on. Developers have spread out a little too much over the past few years because everyone is trying to get their server idea off the ground and not enough people are participating in active teams.<br />
<br />
This is particularly problematic for players responsible for things like levels, sprites, and so on because they are expected to do work that would be better off divided amongst several people.<br />
<br />
<font size="7"><font face="System">Lack of Direction</font></font><br />
<br />
When working on a server, have a list ready of things you want to accomplish. And moreover, what you want players to be able to accomplish as well.<br />
<br />
<font size="7"><font face="System">Too Much Ambition</font></font><br />
<br />
Don't say you are going to make 1000 spells if you only have the time and skills to make 100.  Set reasonable goals. A daily goal of just one or two new small projects a day can keep you in practice and produce a lot of content in a short amount of time.<br />
<br />
If you keep looking at the big picture, you are going to be overwhelmed. I guarantee you. But if you keep working on smaller projects and occasionally revisit bigger ones to touch up and make additions on them, you'll find yourself producing a ridiculous amount of work.<br />
<br />
<font size="7"><font face="System">Poor Attendance</font></font><br />
<br />
Showing up for 1-3 hours every day and doing nothing but work can drastically improve your server. Especially if everyone does it.<br />
<br />
But not everyone can be on at the same time. We all have busy lives. So make use of comments in RC on some kind of non-existent account for what needs to be prioritized. That way other developers can tell what needs to be done soon if they get the time.<br />
<br />
<font size="7"><font face="System">Owner Tyranny</font></font><br />
<br />
Owners step in too frequently to intervene on changes other developers implement sometimes, and this can hinder a server's progress. And worse, they sometimes make other developers feel inferior by constantly refusing creative input.<br />
<br />
Similarly, if submissions are always rejected without positive suggestions for changes, it's likely that a developer might leave as well. And that's the last thing you want to happen, especially when so many servers are hurting for good people right now.<br />
<br />
Even if a developer might not not be the best, practice and education will make a huge difference in that developer's skills over time. If you are a server owner, have patience with people and try to foster their creativity. If they are in the right environment, around people who know what they're doing, they will get better.</div>

]]></content:encoded>
			<dc:creator>Draenin</dc:creator>
			<guid isPermaLink="true">http://forums.graalonline.com/forums/blog.php?b=301</guid>
		</item>
		<item>
			<title>Chopsticks Kitten</title>
			<link>http://forums.graalonline.com/forums/blog.php?b=304</link>
			<pubDate>Sat, 18 Feb 2012 19:26:32 GMT</pubDate>
			<description><![CDATA[bzvUyu3zOmE&autoplay=1]]></description>
			<content:encoded><![CDATA[<div><object width="853" height="505">
  <param name="movie" value="http://www.youtube.com/v/bzvUyu3zOmE&amp;autoplay=1?fs=1;hd=1">
  </param>
  <param name="allowFullScreen" value="true"></param>
  <param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/v/bzvUyu3zOmE&amp;autoplay=1?fs=1;hd=1" type="application/x-shockwave-flash" width="853" height="505" allowscriptaccess="always" allowfullscreen="true">
</embed>
</object></div>

]]></content:encoded>
			<dc:creator>Cow2001</dc:creator>
			<guid isPermaLink="true">http://forums.graalonline.com/forums/blog.php?b=304</guid>
		</item>
		<item>
			<title>return of better than jorollychu blog</title>
			<link>http://forums.graalonline.com/forums/blog.php?b=297</link>
			<pubDate>Mon, 23 Jan 2012 06:50:12 GMT</pubDate>
			<description>what kind of peanut butter does every1 like to eat</description>
			<content:encoded><![CDATA[<div>what kind of peanut butter does every1 like to eat</div>

]]></content:encoded>
			<dc:creator>Mark Sir Link</dc:creator>
			<guid isPermaLink="true">http://forums.graalonline.com/forums/blog.php?b=297</guid>
		</item>
		<item>
			<title><![CDATA[[Graal Kingdoms] Alchemy Speed-Leveling Guide]]></title>
			<link>http://forums.graalonline.com/forums/blog.php?b=293</link>
			<pubDate>Sat, 21 Jan 2012 03:16:08 GMT</pubDate>
			<description><![CDATA[I know all of what's in this entry is general knowledge to the populace, but I've decided to put it all down in writing for the world to see. Share it with your friends who haven't seen it, and by all means encourage them to use it to their benefit. 
 
I am assuming players reading this guide have...]]></description>
			<content:encoded><![CDATA[<div>I know all of what's in this entry is general knowledge to the populace, but I've decided to put it all down in writing for the world to see. Share it with your friends who haven't seen it, and by all means encourage them to use it to their benefit.<br />
<br />
I am assuming players reading this guide have at least a basic knowledge of how Alchemy works. So if you don't know how to do Alchemy, look into another guide. I just don't have the line space to include that.<br />
<br />
<br />
<font face="System"><font size="7">I. Materials List</font></font><br />
<ul><li>Gold Keys (10)</li>
<li>House Kit</li>
<li>Scroll of Housecellar (Optional)</li>
<li>Alchemy Skill Scroll</li>
<li>Alchemy Spellbook</li>
<li>Recipe: <font color="Red">Dust of Visibility</font></li>
<li>Recipe: <font color="Blue">Dust of Piercing Vision</font></li>
<li>Wand (Non-Chargable)</li>
<li>Enchanted Cauldron (1+)</li>
<li>Cauldron (15+)</li>
<li>Rubies (4000+)</li>
<li>Sapphires (Several Thousand)</li>
<li>Carrots (Several Thousand)</li>
<li>Water (Several Thousand)</li>
</ul><br />
<font face="System"><font size="7">II. Equipment List (Optional)</font></font><br />
<br />
If you need to modify this list, feel free. But from what I know, these pieces of equipment will get you up to 30 Intelligence using the fewest slots.<br />
<ul><li>Ring of Elrond (2)</li>
<li>Gloves of Ancaria (1)</li>
<li>Halloween Wizard Hat (1)</li>
<li>Wand of Sorcery (1)</li>
</ul>Note: If you have substituted one piece for another in your equipment, that's fine as long as your base Intelligence stat is looking good. Strive for 30. I've provided one of the cheapest means I know of improving it in this list.<br />
<br />
<font face="System"><font size="7">III. Procedure</font></font><br />
<br />
<font face="System"><font size="5">The Setup</font></font><br />
<ul><li>First, you need to learn the Alchemy Skill and Spell. Grab them from a shop or buy them from another player. Same goes for the wand you'll need for casting.<br /></li>
<li> Next, use your Gold Keys to get 10 Intelligence Potions from the chest in the Main Island dungeon.<br /></li>
<li> Now you'll need a house to do this in. And an additional floor on the house wouldn't hurt.<br /></li>
<li>Arrange your Cauldrons on one floor of your house, preferably close together and in rows / columns. On another floor, place your Enchanted Cauldron. Outside is a bad place for Alchemists.<br /></li>
<li>Assuming you have all your materials together, put on all your equipment and ready your wand.</li>
</ul><br />
<font face="System"><font size="5">Transmuting <font color="Red">Rubies</font> Into <font color="Red">DoV</font></font></font><br />
<ul><li>To gain a lot of Experience, you'll want to make<font color="Red"> Dust of Visibility</font> with <font color="Red">Rubies</font> in your Enchanted Cauldron. This is because you're more likely to slag on the recipe at a low Mental level, even with a lot of Int.<br /></li>
<li>An Enchanted Cauldron will boost the yield of whatever you're currently making, thereby allowing you to earn more experience when you identify larger stacks of your product. If you can produce a lot of <font color="Red">DoV</font>, you can identify a lot of it as well. Once you have all the stacks of it made and Identified, store it or sell it.<br /></li>
<li>To check and see how much experience you're making when you Identify the Dust of Visibility stacks, periodically check your /stats.</li>
</ul><br />
<font face="System"><font size="5">Transmuting <font color="Blue">Sapphires</font> into <font color="Blue">DoPV</font></font></font><br />
<ul><li>You'll want to use up your stockpiles of <font color="Blue">Sapphires</font>, Carrots, and Waters to make <font color="Blue">Dust of Piercing Vision</font>, which you can Identify and sell to vendors for a considerable price. You can produce these in mass quantities on another floor by putting the ingredients in your cluster of Cauldrons.<br /></li>
<li>Once you have the Platinum from that, do a few quick trades to get more <font color="Blue">Sapphires</font>. Continue the process to generate however much Platinum you need to get more <font color="Blue">Sapphires</font>. This is what I call '<font color="Blue">Sapphire Recycling.</font> '</li>
</ul><br />
<font face="System"><font size="5">The Grind</font></font><br />
<ul><li>Alternate between making <font color="Red">Dust of Visibility</font> and <font color="Blue">Sapphire Recycling</font>  until you get up into higher levels. Generally speaking, you'll start to slag a lot less at around level 50 or 60.<br /></li>
<li>The actual leveling process involved with Alchemy is incredibly quick, but the process of gathering materials can take a long time depending on how the market is for <font color="Red">Rubies</font> and <font color="Blue">Sapphires</font>.</li>
</ul><br />
<font face="System"><font size="5">Sweet Victory</font></font><br />
<ul><li>Go outside and reveal yourself to the world as the glorious Level 110 hermit that you are!</li>
</ul></div>

]]></content:encoded>
			<dc:creator>Draenin</dc:creator>
			<guid isPermaLink="true">http://forums.graalonline.com/forums/blog.php?b=293</guid>
		</item>
		<item>
			<title>Infinity</title>
			<link>http://forums.graalonline.com/forums/blog.php?b=289</link>
			<pubDate>Thu, 03 Nov 2011 19:10:38 GMT</pubDate>
			<description><![CDATA[Did you know? I just found this gem: 
 
 
PHP: 
--------- 
echo("inf"+0); // 2147483647 
--------- 
From preliminary testing, "inf" is a special value. The binary operations like +, -, etc. do not modify the value (as you would expect). Similarly, -"inf" === "-inf" (and so "inf"+"-inf" = 0).]]></description>
			<content:encoded><![CDATA[<div>Did you know? I just found this gem:<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2" dir="ltr" style="
		margin: 0px;
		padding: 4px;
		border: 1px inset;
		width: 640px;
		height: 34px;
		text-align: left;
		overflow: auto">
		<code style="white-space:nowrap">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">echo(</span><span style="color: #DD0000">"inf"</span><span style="color: #007700">+</span><span style="color: #0000BB">0</span><span style="color: #007700">);&nbsp;</span><span style="color: #FF8000">//&nbsp;2147483647&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
		</code>
	</div>
</div>From preliminary testing, &quot;inf&quot; is a special value. The binary operations like +, -, etc. do not modify the value (as you would expect). Similarly, -&quot;inf&quot; === &quot;-inf&quot; (and so &quot;inf&quot;+&quot;-inf&quot; = 0).</div>

]]></content:encoded>
			<dc:creator>Tolnaftate2004</dc:creator>
			<guid isPermaLink="true">http://forums.graalonline.com/forums/blog.php?b=289</guid>
		</item>
		<item>
			<title>The need for closures.</title>
			<link>http://forums.graalonline.com/forums/blog.php?b=281</link>
			<pubDate>Thu, 06 Oct 2011 05:58:48 GMT</pubDate>
			<description>There is a dire need for closures. A closure is a function accompanied by its enclosing environment to which the function has access. 
 
Closures would solve a few persistent problems in GraalScript. They would give us the ability to define private variables as well as give as a framework for...</description>
			<content:encoded><![CDATA[<div>There is a dire need for closures. A closure is a function accompanied by its enclosing environment to which the function has access.<br />
<br />
Closures would solve a few persistent problems in GraalScript. They would give us the ability to define private variables as well as give as a framework for functional inheritance. <br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2" dir="ltr" style="
		margin: 0px;
		padding: 4px;
		border: 1px inset;
		width: 640px;
		height: 258px;
		text-align: left;
		overflow: auto">
		<code style="white-space:nowrap">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">RegularChicken</span><span style="color: #007700">()&nbsp;{<br />&nbsp;&nbsp;return&nbsp;new&nbsp;</span><span style="color: #0000BB">TStaticVar</span><span style="color: #007700">(</span><span style="color: #DD0000">"Chicken"</span><span style="color: #007700">);<br />}<br /><br />function&nbsp;</span><span style="color: #0000BB">FunkyChicken</span><span style="color: #007700">()&nbsp;{<br />&nbsp;&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">chicken&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">RegularChicken</span><span style="color: #007700">(),<br />&nbsp;&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">says&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"How&nbsp;you&nbsp;doodle-doing?"</span><span style="color: #007700">;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">chicken</span><span style="color: #007700">.</span><span style="color: #0000BB">learn&nbsp;</span><span style="color: #007700">=&nbsp;function&nbsp;(</span><span style="color: #0000BB">text</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">says&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">text</span><span style="color: #007700">;<br />&nbsp;&nbsp;};<br />&nbsp;&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">o</span><span style="color: #007700">.</span><span style="color: #0000BB">squawk&nbsp;</span><span style="color: #007700">=&nbsp;function()&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo(</span><span style="color: #0000BB">says</span><span style="color: #007700">);<br />&nbsp;&nbsp;};<br />&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">chicken</span><span style="color: #007700">;<br />}&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
		</code>
	</div>
</div>(Of course the above is a ridiculous example; the base class is there for instructive purposes only, not to mention the fact that this is all hypothetical.)<br />
<br />
Unfortunately, defining a function in any scope hoists it to be visible script-wide. This is problematic when we want to define private &quot;methods&quot;.<br />
<br />
On top of that, through closures we can create generators<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2" dir="ltr" style="
		margin: 0px;
		padding: 4px;
		border: 1px inset;
		width: 640px;
		height: 322px;
		text-align: left;
		overflow: auto">
		<code style="white-space:nowrap">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">thirty_one_bit_hash&nbsp;</span><span style="color: #007700">=&nbsp;function&nbsp;(</span><span style="color: #0000BB">A</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">i&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">memory&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">overflow&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br />&nbsp;&nbsp;return&nbsp;function&nbsp;()&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">curr</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">tmem</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">i&nbsp;</span><span style="color: #007700">&gt;=&nbsp;</span><span style="color: #0000BB">A</span><span style="color: #007700">.</span><span style="color: #0000BB">length</span><span style="color: #007700">()&nbsp;&amp;&amp;&nbsp;!</span><span style="color: #0000BB">memory</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">curr&nbsp;</span><span style="color: #007700">=&nbsp;(</span><span style="color: #0000BB">getascii</span><span style="color: #007700">(</span><span style="color: #0000BB">A</span><span style="color: #007700">.</span><span style="color: #0000BB">charAt</span><span style="color: #007700">(</span><span style="color: #0000BB">i</span><span style="color: #007700">++))&lt;&lt;</span><span style="color: #0000BB">24</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;(</span><span style="color: #0000BB">getascii</span><span style="color: #007700">(</span><span style="color: #0000BB">A</span><span style="color: #007700">.</span><span style="color: #0000BB">charAt</span><span style="color: #007700">(</span><span style="color: #0000BB">i</span><span style="color: #007700">++))&lt;&lt;</span><span style="color: #0000BB">16</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;(</span><span style="color: #0000BB">getascii</span><span style="color: #007700">(</span><span style="color: #0000BB">A</span><span style="color: #007700">.</span><span style="color: #0000BB">charAt</span><span style="color: #007700">(</span><span style="color: #0000BB">i</span><span style="color: #007700">++))&lt;&lt;</span><span style="color: #0000BB">8</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">overflow&nbsp;</span><span style="color: #007700">&lt;&nbsp;</span><span style="color: #0000BB">7</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">curr&nbsp;</span><span style="color: #007700">+=&nbsp;</span><span style="color: #0000BB">getascii</span><span style="color: #007700">(</span><span style="color: #0000BB">A</span><span style="color: #007700">.</span><span style="color: #0000BB">charAt</span><span style="color: #007700">(</span><span style="color: #0000BB">i</span><span style="color: #007700">++));<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">overflow&nbsp;</span><span style="color: #007700">=&nbsp;(</span><span style="color: #0000BB">overflow</span><span style="color: #007700">+</span><span style="color: #0000BB">1</span><span style="color: #007700">)%</span><span style="color: #0000BB">8</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">tmem&nbsp;</span><span style="color: #007700">=&nbsp;((</span><span style="color: #0000BB">1</span><span style="color: #007700">&lt;&lt;</span><span style="color: #0000BB">overflow</span><span style="color: #007700">)-</span><span style="color: #0000BB">1</span><span style="color: #007700">)&amp;</span><span style="color: #0000BB">curr</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">curr&nbsp;</span><span style="color: #007700">&gt;&gt;=&nbsp;</span><span style="color: #0000BB">overflow</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">curr&nbsp;</span><span style="color: #007700">+=&nbsp;</span><span style="color: #0000BB">memory</span><span style="color: #007700">&lt;&lt;(</span><span style="color: #0000BB">32</span><span style="color: #007700">-</span><span style="color: #0000BB">overflow</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">memory&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">tmem</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">curr</span><span style="color: #007700">;<br />&nbsp;&nbsp;};<br />}&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
		</code>
	</div>
</div>and curry functions<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2" dir="ltr" style="
		margin: 0px;
		padding: 4px;
		border: 1px inset;
		width: 640px;
		height: 130px;
		text-align: left;
		overflow: auto">
		<code style="white-space:nowrap">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">add</span><span style="color: #007700">(</span><span style="color: #0000BB">a</span><span style="color: #007700">,</span><span style="color: #0000BB">b</span><span style="color: #007700">)&nbsp;return&nbsp;</span><span style="color: #0000BB">a</span><span style="color: #007700">+</span><span style="color: #0000BB">b</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">add1&nbsp;</span><span style="color: #007700">=&nbsp;(function&nbsp;(</span><span style="color: #0000BB">N</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;return&nbsp;function&nbsp;(</span><span style="color: #0000BB">a</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">add</span><span style="color: #007700">(</span><span style="color: #0000BB">a</span><span style="color: #007700">,</span><span style="color: #0000BB">N</span><span style="color: #007700">);<br />&nbsp;&nbsp;};<br />})(</span><span style="color: #0000BB">1</span><span style="color: #007700">);&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
		</code>
	</div>
</div>The problems I can see with implementing closures in GraalScript are:<ol style="list-style-type: decimal"><li>anonymous functions would have to be handled differently internally. They cannot be hoisted (which may be an entirely different issue), among other things. Also, I'm gonna whine some more if we can't have proper <i>anonymous</i> functions (i.e., that don't need to be in an assignment).</li>
<li>the look-up chain. What is likely to be the most desired behavior would involve upwards search through the referring environments when searching for temporary variables, which may get costly (although look-up is fast according to my benchmarking [data not shown]). We should use <font face="Courier New">temp</font> to bind the symbol to the current scope and make it accessible to inner scopes.</li>
<li> memory costs. It's 2011, I think we'll live.</li>
</ol><br />
In summary, <i>pretty please, Stefan</i>? We love your work (:cool:), and I'd love to hear your two cents regarding (im)possibility or problems.</div>

]]></content:encoded>
			<dc:creator>Tolnaftate2004</dc:creator>
			<guid isPermaLink="true">http://forums.graalonline.com/forums/blog.php?b=281</guid>
		</item>
		<item>
			<title>The real horrors are anonymous functions.</title>
			<link>http://forums.graalonline.com/forums/blog.php?b=280</link>
			<pubDate>Wed, 05 Oct 2011 06:28:15 GMT</pubDate>
			<description><![CDATA[For those not in the know, an anonymous function is one that doesn't have a name per se. In GraalScript, these functions must be bound to an identifier. 
 
 
PHP: 
--------- 
temp.anon = function (a,b,c) { return a+b|c; }; 
--------- 
This behavior precludes truly anonymous functions and makes code...]]></description>
			<content:encoded><![CDATA[<div>For those not in the know, an <i>anonymous function</i> is one that doesn't have a name <i>per se</i>. In GraalScript, these functions must be bound to an identifier.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2" dir="ltr" style="
		margin: 0px;
		padding: 4px;
		border: 1px inset;
		width: 640px;
		height: 34px;
		text-align: left;
		overflow: auto">
		<code style="white-space:nowrap">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">anon&nbsp;</span><span style="color: #007700">=&nbsp;function&nbsp;(</span><span style="color: #0000BB">a</span><span style="color: #007700">,</span><span style="color: #0000BB">b</span><span style="color: #007700">,</span><span style="color: #0000BB">c</span><span style="color: #007700">)&nbsp;{&nbsp;return&nbsp;</span><span style="color: #0000BB">a</span><span style="color: #007700">+</span><span style="color: #0000BB">b</span><span style="color: #007700">|</span><span style="color: #0000BB">c</span><span style="color: #007700">;&nbsp;};&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
		</code>
	</div>
</div>This behavior precludes truly anonymous functions and makes code overly verbose, for when they are used as callbacks or function parameters.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2" dir="ltr" style="
		margin: 0px;
		padding: 4px;
		border: 1px inset;
		width: 640px;
		height: 162px;
		text-align: left;
		overflow: auto">
		<code style="white-space:nowrap">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">anon&nbsp;</span><span style="color: #007700">=&nbsp;function&nbsp;(</span><span style="color: #0000BB">a</span><span style="color: #007700">,</span><span style="color: #0000BB">b</span><span style="color: #007700">,</span><span style="color: #0000BB">c</span><span style="color: #007700">)&nbsp;{&nbsp;return&nbsp;</span><span style="color: #0000BB">a</span><span style="color: #007700">+</span><span style="color: #0000BB">b</span><span style="color: #007700">|</span><span style="color: #0000BB">c</span><span style="color: #007700">;&nbsp;};<br /></span><span style="color: #0000BB">delayedCall</span><span style="color: #007700">(</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">anon</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;OR<br /><br /></span><span style="color: #0000BB">delayedCall</span><span style="color: #007700">(<br />&nbsp;&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">anon&nbsp;</span><span style="color: #007700">=&nbsp;function&nbsp;(</span><span style="color: #0000BB">a</span><span style="color: #007700">,</span><span style="color: #0000BB">b</span><span style="color: #007700">,</span><span style="color: #0000BB">c</span><span style="color: #007700">)&nbsp;{&nbsp;return&nbsp;</span><span style="color: #0000BB">a</span><span style="color: #007700">+</span><span style="color: #0000BB">b</span><span style="color: #007700">|</span><span style="color: #0000BB">c</span><span style="color: #007700">;&nbsp;}<br />);<br /></span><span style="color: #FF8000">//&nbsp;but&nbsp;when&nbsp;will&nbsp;I&nbsp;ever&nbsp;use&nbsp;'temp.anon'?&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
		</code>
	</div>
</div>When passing a function to another function, it does not suffice to refer to the function by the identifier to which it is now bound.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2" dir="ltr" style="
		margin: 0px;
		padding: 4px;
		border: 1px inset;
		width: 640px;
		height: 194px;
		text-align: left;
		overflow: auto">
		<code style="white-space:nowrap">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">delayedCall</span><span style="color: #007700">(</span><span style="color: #0000BB">f</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;if&nbsp;(!</span><span style="color: #0000BB">waitfor</span><span style="color: #007700">(</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">name</span><span style="color: #007700">,</span><span style="color: #DD0000">"onInterrupt"</span><span style="color: #007700">,</span><span style="color: #0000BB">1</span><span style="color: #007700">))<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">f</span><span style="color: #007700">(</span><span style="color: #0000BB">1</span><span style="color: #007700">,</span><span style="color: #0000BB">2</span><span style="color: #007700">,</span><span style="color: #0000BB">3</span><span style="color: #007700">);&nbsp;</span><span style="color: #FF8000">//&nbsp;nope!<br /></span><span style="color: #007700">}<br /><br /></span><span style="color: #FF8000">//&nbsp;rather,&nbsp;...<br /><br /></span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">delayedCall</span><span style="color: #007700">(</span><span style="color: #0000BB">f</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;if&nbsp;(!</span><span style="color: #0000BB">waitfor</span><span style="color: #007700">(</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">name</span><span style="color: #007700">,</span><span style="color: #DD0000">"onInterrupt"</span><span style="color: #007700">,</span><span style="color: #0000BB">1</span><span style="color: #007700">))<br />&nbsp;&nbsp;&nbsp;&nbsp;(@&nbsp;</span><span style="color: #0000BB">f</span><span style="color: #007700">)(</span><span style="color: #0000BB">1</span><span style="color: #007700">,</span><span style="color: #0000BB">2</span><span style="color: #007700">,</span><span style="color: #0000BB">3</span><span style="color: #007700">);<br />}&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
		</code>
	</div>
</div>I've tried to emulate object literals, like that of JavaScript, by trying to construct an object using the <font face="Courier New">with</font> statement. However, anonymous functions cannot be defined within <font face="Courier New">with</font>.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2" dir="ltr" style="
		margin: 0px;
		padding: 4px;
		border: 1px inset;
		width: 640px;
		height: 114px;
		text-align: left;
		overflow: auto">
		<code style="white-space:nowrap">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">with&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">a&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">TStaticVar</span><span style="color: #007700">())&nbsp;{<br />&nbsp;&nbsp;</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">a&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">,<br />&nbsp;&nbsp;</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">b&nbsp;</span><span style="color: #007700">=&nbsp;function&nbsp;()&nbsp;{&nbsp;echo(</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">a</span><span style="color: #007700">);&nbsp;};<br />}<br /><br /></span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">a</span><span style="color: #007700">.</span><span style="color: #0000BB">b</span><span style="color: #007700">();&nbsp;</span><span style="color: #FF8000">//&nbsp;error,&nbsp;temp.a.b&nbsp;is&nbsp;null&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
		</code>
	</div>
</div>Tomorrow (or whenever...), the need for closures.</div>

]]></content:encoded>
			<dc:creator>Tolnaftate2004</dc:creator>
			<guid isPermaLink="true">http://forums.graalonline.com/forums/blog.php?b=280</guid>
		</item>
		<item>
			<title>The real horror is interpretting equality as assigment.</title>
			<link>http://forums.graalonline.com/forums/blog.php?b=279</link>
			<pubDate>Sat, 01 Oct 2011 06:38:42 GMT</pubDate>
			<description><![CDATA[For backwards compatibility, the = (assignment) operator (and by extension, the := operator) has been made to act like the == (equality) operator when used in the context of the condition of a control structure. 
 
There's nothing more elegant than writing, e.g., 
 
PHP: 
--------- 
while ((temp.p...]]></description>
			<content:encoded><![CDATA[<div>For backwards compatibility, the <font face="Courier New">=</font> (assignment) operator (and by extension, the <font face="Courier New">:=</font> operator) has been made to act like the <font face="Courier New">==</font> (equality) operator when used in the context of the condition of a control structure.<br />
<br />
There's nothing more elegant than writing, e.g.,<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2" dir="ltr" style="
		margin: 0px;
		padding: 4px;
		border: 1px inset;
		width: 640px;
		height: 66px;
		text-align: left;
		overflow: auto">
		<code style="white-space:nowrap">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">while&nbsp;((</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">p&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">a</span><span style="color: #007700">.</span><span style="color: #0000BB">index</span><span style="color: #007700">(</span><span style="color: #0000BB">b</span><span style="color: #007700">))&nbsp;&gt;=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;do&nbsp;stuff&nbsp;with&nbsp;temp.p<br /></span><span style="color: #007700">}&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
		</code>
	</div>
</div>Unfortunately due to misinterpretation (<i>that's right...</i>), this is impossible.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2" dir="ltr" style="
		margin: 0px;
		padding: 4px;
		border: 1px inset;
		width: 640px;
		height: 178px;
		text-align: left;
		overflow: auto">
		<code style="white-space:nowrap">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">onCreated</span><span style="color: #007700">()&nbsp;{<br />&nbsp;&nbsp;</span><span style="color: #0000BB">a&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">;<br />&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">1&nbsp;</span><span style="color: #007700">&amp;&amp;&nbsp;(</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">a&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">3</span><span style="color: #007700">));<br />&nbsp;&nbsp;echo(</span><span style="color: #0000BB">a</span><span style="color: #007700">);<br />}<br /><br />function&nbsp;</span><span style="color: #0000BB">id</span><span style="color: #007700">(</span><span style="color: #0000BB">x</span><span style="color: #007700">)&nbsp;return&nbsp;</span><span style="color: #0000BB">x</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">//expected&nbsp;output:&nbsp;3<br />//actual&nbsp;output:&nbsp;1&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
		</code>
	</div>
</div>Change a single character...<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2" dir="ltr" style="
		margin: 0px;
		padding: 4px;
		border: 1px inset;
		width: 640px;
		height: 178px;
		text-align: left;
		overflow: auto">
		<code style="white-space:nowrap">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">onCreated</span><span style="color: #007700">()&nbsp;{<br />&nbsp;&nbsp;</span><span style="color: #0000BB">a&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">id&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">1&nbsp;</span><span style="color: #007700">&amp;&amp;&nbsp;(</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">a&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">3</span><span style="color: #007700">));<br />&nbsp;&nbsp;echo(</span><span style="color: #0000BB">a</span><span style="color: #007700">);<br />}<br /><br />function&nbsp;</span><span style="color: #0000BB">id</span><span style="color: #007700">(</span><span style="color: #0000BB">x</span><span style="color: #007700">)&nbsp;return&nbsp;</span><span style="color: #0000BB">x</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">//expected&nbsp;output:&nbsp;3<br />//actual&nbsp;output:&nbsp;3&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
		</code>
	</div>
</div>Clearly, not all boolean contexts consider assignment to be equality. It seems ridiculous to change the behavior of an operator based on context. C'mon Stefan, end these shenanigans. Nobody uses <font face="Courier New">=</font> as equality any more, and if nothing else, leave <font face="Courier New">:=</font> to mean assignment in all contexts.<br />
<br />
Also note in the former example that <font face="Courier New">a</font> does not stop at <font face="Courier New">temp.a</font> in the prefix lookup chain since the assignment was in the <font face="Courier New">if</font> statement, although <font face="Courier New">temp.a</font> was used therein (we'd expect an output of 0 if the lookup chain stopped at <font face="Courier New">temp.a</font> and instead of assignment we tested for equality).<br />
<br />
More on the horror of <font face="Courier New">temp.-</font> and the lookup chain eventually.</div>

]]></content:encoded>
			<dc:creator>Tolnaftate2004</dc:creator>
			<guid isPermaLink="true">http://forums.graalonline.com/forums/blog.php?b=279</guid>
		</item>
		<item>
			<title><![CDATA["Queues" and "Threads"]]></title>
			<link>http://forums.graalonline.com/forums/blog.php?b=278</link>
			<pubDate>Fri, 30 Sep 2011 05:55:59 GMT</pubDate>
			<description>GraalScript is not multithreaded, though we can imitate threads due to the asynchrony of triggers and their nonblocking nature. 
 
Thread safety is paramount, so inputs and outputs from the threads are thrown into thread-safe arrays called queues. Thread safety allows multiple threads to access the...</description>
			<content:encoded><![CDATA[<div>GraalScript is not multithreaded, though we can imitate <i>threads</i> due to the asynchrony of triggers and their nonblocking nature.<br />
<br />
Thread safety is paramount, so inputs and outputs from the threads are thrown into thread-safe arrays called <i>queues</i>. Thread safety allows multiple threads to access the queue without modifying it at the same time.<br />
<br />
Obviously, since we are not really dealing with true threads or concurrency, there are no locks involved in the queue, and the underlying structure is a simple array. The array is prioritized in a FIFO pattern.<br />
<br />
Below is an implementation of the linear (though unstable) sleepsort algorithm using &quot;threads&quot; and &quot;queues&quot; that behave similarly to the <i>threading</i> and <i>queue</i> modules in python. (Due to limitations however, the <font face="Courier New">join</font> method from the aforementioned modules has been renamed <font face="Courier New">wait</font>).<br />
<br />
Class <b>testqueue</b>:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2" dir="ltr" style="
		margin: 0px;
		padding: 4px;
		border: 1px inset;
		width: 640px;
		height: 482px;
		text-align: left;
		overflow: auto">
		<code style="white-space:nowrap">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">put</span><span style="color: #007700">(</span><span style="color: #0000BB">data</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">queue</span><span style="color: #007700">.</span><span style="color: #0000BB">add</span><span style="color: #007700">(</span><span style="color: #0000BB">data</span><span style="color: #007700">);<br />&nbsp;&nbsp;</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">length</span><span style="color: #007700">++;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">trigger</span><span style="color: #007700">(</span><span style="color: #DD0000">"Append"</span><span style="color: #007700">);<br />}<br /><br />public&nbsp;function&nbsp;</span><span style="color: #0000BB">get</span><span style="color: #007700">()&nbsp;{<br />&nbsp;&nbsp;while&nbsp;(</span><span style="color: #0000BB">this</span><span style="color: #007700">.empty()&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&amp;&amp;&nbsp;!</span><span style="color: #0000BB">waitfor</span><span style="color: #007700">(</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">name</span><span style="color: #007700">,</span><span style="color: #DD0000">"onAppend"</span><span style="color: #007700">));<br />&nbsp;&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">data&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">queue</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">0</span><span style="color: #007700">&#93;;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">queue</span><span style="color: #007700">.</span><span style="color: #0000BB">delete</span><span style="color: #007700">(</span><span style="color: #0000BB">0</span><span style="color: #007700">);<br />&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">data</span><span style="color: #007700">;<br />}<br /><br />public&nbsp;function&nbsp;</span><span style="color: #0000BB">task_done</span><span style="color: #007700">()&nbsp;{<br />&nbsp;&nbsp;if&nbsp;(!(--</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">length</span><span style="color: #007700">))<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">trigger</span><span style="color: #007700">(</span><span style="color: #DD0000">"QueueEmptied"</span><span style="color: #007700">);<br />&nbsp;&nbsp;</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">length&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">max</span><span style="color: #007700">(</span><span style="color: #0000BB">0</span><span style="color: #007700">,</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">length</span><span style="color: #007700">);<br />}<br /><br />public&nbsp;function&nbsp;</span><span style="color: #0000BB">wait</span><span style="color: #007700">()&nbsp;{<br />&nbsp;&nbsp;while&nbsp;(!</span><span style="color: #0000BB">this</span><span style="color: #007700">.empty()&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&amp;&amp;&nbsp;!</span><span style="color: #0000BB">waitfor</span><span style="color: #007700">(</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">name</span><span style="color: #007700">,</span><span style="color: #DD0000">"onQueueEmptied"</span><span style="color: #007700">));<br />&nbsp;&nbsp;return;<br />}<br /><br />public&nbsp;function&nbsp;empty()&nbsp;{<br />&nbsp;&nbsp;return&nbsp;!</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">queue</span><span style="color: #007700">.</span><span style="color: #0000BB">size</span><span style="color: #007700">();<br />}&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
		</code>
	</div>
</div>Class <b>testthread</b>:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2" dir="ltr" style="
		margin: 0px;
		padding: 4px;
		border: 1px inset;
		width: 640px;
		height: 226px;
		text-align: left;
		overflow: auto">
		<code style="white-space:nowrap">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">start</span><span style="color: #007700">()&nbsp;{<br />&nbsp;&nbsp;</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">onRunThread&nbsp;</span><span style="color: #007700">=&nbsp;function&nbsp;()&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">run</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">trigger</span><span style="color: #007700">(</span><span style="color: #DD0000">"ThreadDone"</span><span style="color: #007700">);<br />&nbsp;&nbsp;};<br />&nbsp;&nbsp;</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">trigger</span><span style="color: #007700">(</span><span style="color: #DD0000">"RunThread"</span><span style="color: #007700">);<br />&nbsp;&nbsp;return;<br />}<br /><br />public&nbsp;function&nbsp;</span><span style="color: #0000BB">wait</span><span style="color: #007700">()&nbsp;{<br />&nbsp;&nbsp;while&nbsp;(!</span><span style="color: #0000BB">waitfor</span><span style="color: #007700">(</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">name</span><span style="color: #007700">,</span><span style="color: #DD0000">"onThreadDone"</span><span style="color: #007700">));<br />&nbsp;&nbsp;return;<br />}&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
		</code>
	</div>
</div>Our sleepsort script:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2" dir="ltr" style="
		margin: 0px;
		padding: 4px;
		border: 1px inset;
		width: 640px;
		height: 498px;
		text-align: left;
		overflow: auto">
		<code style="white-space:nowrap">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">onCreated</span><span style="color: #007700">()&nbsp;{<br />&nbsp;&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">queue&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">TStaticVar</span><span style="color: #007700">(</span><span style="color: #DD0000">"TestQueue"</span><span style="color: #007700">);<br />&nbsp;&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">queue</span><span style="color: #007700">.</span><span style="color: #0000BB">join</span><span style="color: #007700">(</span><span style="color: #DD0000">"testqueue"</span><span style="color: #007700">);<br />&nbsp;&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">thread&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">TStaticVar</span><span style="color: #007700">(</span><span style="color: #DD0000">"TestThread"</span><span style="color: #007700">);<br />&nbsp;&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">thread</span><span style="color: #007700">.</span><span style="color: #0000BB">join</span><span style="color: #007700">(</span><span style="color: #DD0000">"testthread"</span><span style="color: #007700">);<br />&nbsp;&nbsp;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">numbers&nbsp;</span><span style="color: #007700">=&nbsp;{</span><span style="color: #0000BB">1</span><span style="color: #007700">,</span><span style="color: #0000BB">2</span><span style="color: #007700">,</span><span style="color: #0000BB">3</span><span style="color: #007700">,</span><span style="color: #0000BB">4</span><span style="color: #007700">,</span><span style="color: #0000BB">5</span><span style="color: #007700">,</span><span style="color: #0000BB">6</span><span style="color: #007700">,</span><span style="color: #0000BB">7</span><span style="color: #007700">,</span><span style="color: #0000BB">1</span><span style="color: #007700">,</span><span style="color: #0000BB">3</span><span style="color: #007700">,</span><span style="color: #0000BB">2</span><span style="color: #007700">,</span><span style="color: #0000BB">4</span><span style="color: #007700">,</span><span style="color: #0000BB">6</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">4</span><span style="color: #007700">,</span><span style="color: #0000BB">3</span><span style="color: #007700">,</span><span style="color: #0000BB">2</span><span style="color: #007700">,</span><span style="color: #0000BB">5</span><span style="color: #007700">,</span><span style="color: #0000BB">6</span><span style="color: #007700">,</span><span style="color: #0000BB">7</span><span style="color: #007700">,</span><span style="color: #0000BB">7</span><span style="color: #007700">,</span><span style="color: #0000BB">5</span><span style="color: #007700">,</span><span style="color: #0000BB">4</span><span style="color: #007700">,</span><span style="color: #0000BB">3</span><span style="color: #007700">,</span><span style="color: #0000BB">2</span><span style="color: #007700">,</span><span style="color: #0000BB">1</span><span style="color: #007700">};<br />&nbsp;&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">q&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">TestQueue</span><span style="color: #007700">();<br />&nbsp;&nbsp;for&nbsp;(</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">i</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">numbers</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">q</span><span style="color: #007700">.</span><span style="color: #0000BB">put</span><span style="color: #007700">(</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">i</span><span style="color: #007700">);<br />&nbsp;&nbsp;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">threads&nbsp;</span><span style="color: #007700">=&nbsp;{};<br />&nbsp;&nbsp;for&nbsp;(</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">i</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">numbers</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">curr&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">TestThread</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">curr</span><span style="color: #007700">.</span><span style="color: #0000BB">queue&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">q</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">curr</span><span style="color: #007700">.</span><span style="color: #0000BB">run&nbsp;</span><span style="color: #007700">=&nbsp;function&nbsp;()&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/*&nbsp;this&nbsp;loop&nbsp;below&nbsp;is&nbsp;completely<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;unnecessary.&nbsp;I&nbsp;include&nbsp;it&nbsp;because<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;this&nbsp;is&nbsp;generally&nbsp;the&nbsp;format&nbsp;you&nbsp;should<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;use&nbsp;for&nbsp;your&nbsp;target&nbsp;functions.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">while&nbsp;(!</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">queue</span><span style="color: #007700">.empty())&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">v&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">queue</span><span style="color: #007700">.</span><span style="color: #0000BB">get</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">sleep</span><span style="color: #007700">(</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">v</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo(</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">v</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">queue</span><span style="color: #007700">.</span><span style="color: #0000BB">task_done</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">threads</span><span style="color: #007700">.</span><span style="color: #0000BB">add</span><span style="color: #007700">(</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">curr</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">curr</span><span style="color: #007700">.</span><span style="color: #0000BB">start</span><span style="color: #007700">();<br />&nbsp;&nbsp;}<br />&nbsp;&nbsp;</span><span style="color: #0000BB">temp</span><span style="color: #007700">.</span><span style="color: #0000BB">q</span><span style="color: #007700">.</span><span style="color: #0000BB">wait</span><span style="color: #007700">();<br />&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;clean&nbsp;up<br /></span><span style="color: #007700">}&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
		</code>
	</div>
</div><b>Note:</b> this algorithm works best with integers, and will round numbers down to the nearest 0.1 (on serverside) otherwise when <font face="Courier New">sleep</font>ing.</div>

]]></content:encoded>
			<dc:creator>Tolnaftate2004</dc:creator>
			<guid isPermaLink="true">http://forums.graalonline.com/forums/blog.php?b=278</guid>
		</item>
		<item>
			<title>Crash your NPC-Server</title>
			<link>http://forums.graalonline.com/forums/blog.php?b=277</link>
			<pubDate>Wed, 28 Sep 2011 17:42:09 GMT</pubDate>
			<description><![CDATA[While mucking about, attempting to duplicate this and temp from one function in another, I found a single line that will crash your NPC-Server. 
 
No loops, just an assignment and a function call; all perfectly legal GS2. 
 
echo(temp.t = temp); 
 
BAM. (Maybe it doesn't work on your server, I...]]></description>
			<content:encoded><![CDATA[<div>While mucking about, attempting to duplicate <font face="Courier New">this</font> and <font face="Courier New">temp</font> from one function in another, I found a single line that will crash your NPC-Server.<br />
<br />
No loops, just an assignment and a function call; all perfectly legal GS2.<br />
<br />
<blockquote><font size=1>NPC Code:</font><hr><pre>echo(temp.t = temp);</pre><hr></blockquote><br />
<br />
BAM. (Maybe it doesn't work on your server, I don't know, but it has taken down Zenkou every time I've tried so far.)<br />
<br />
Get your server back up with NC command <font face="Courier New">/npcstart</font>.</div>

]]></content:encoded>
			<dc:creator>Tolnaftate2004</dc:creator>
			<guid isPermaLink="true">http://forums.graalonline.com/forums/blog.php?b=277</guid>
		</item>
	</channel>
</rss>

