<?xml version="1.0" encoding="UTF-8"?> 
<rss version="2.0"
        xmlns:content="http://purl.org/rss/1.0/modules/content/"
        xmlns:wfw="http://wellformedweb.org/CommentAPI/"
        xmlns:dc="http://purl.org/dc/elements/1.1/"
        xmlns:atom="http://www.w3.org/2005/Atom"
        xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
        xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
        >
<channel>
  <title>asgaard</title>
  <description></description>
  <link>https://blog.asgaard.co.uk/2013/2</link>
  <lastBuildDate>Tue, 12 May 26 17:28:53 +0000</lastBuildDate>
  <language>en</language>
  <count>2</count>
  <offset>0</offset>
      <item>
    <title>Closures, for loops and scoping in JavaScript</title>
    <link>https://blog.asgaard.co.uk/2013/02/08/closures-for-loops-and-scoping-in-javascript</link>
    <pubDate>Fri, 08 Feb 13 21:33:33 +0000</pubDate>
    <guid>https://blog.asgaard.co.uk/2013/02/08/closures-for-loops-and-scoping-in-javascript</guid>
    <description><![CDATA[
<p>
<pre>var funcs = [];
for (var i = 0; i &lt; 10; i++) {
    funcs.push( function() { console.log(i) } );
}</pre>
<p>
What does <code>funcs[0]()</code> output?
<p>
If you said 10, you were right.
<p>
The key here is that although <code>i</code> is accessible from the scope of the closure, it can be modified by other things. The closure doesn&#039;t copy the values it can access when it&#039;s created. 
<p>
In some cases, this kind of thing does work as expected. That&#039;s because in those cases, you are accessing a value that doesn&#039;t change. Even though it looks like it might have. If you combine with a forEach function, you actually get your own value that won&#039;t change.
<p>
You can also do this by creating a copy inside a function expression:
<p>
<pre>var funcs = [];
for (var i = 0; i &lt; 10; i++) {
    (function(i) {
        funcs.push( function() { console.log(i) } );
    }(i));
}</pre>
<p>
<code>funcs[0]()</code> =&gt; 0.
<p>
Note that the <code>i</code> accessible within the closure is a different <code>i</code> from the for loop&#039;s.
<p>
If you&#039;re using any helper libraries (or Node) with your [...]]]></description>
    <content:encoded><![CDATA[
<p>
<pre>var funcs = [];
for (var i = 0; i &lt; 10; i++) {
    funcs.push( function() { console.log(i) } );
}</pre>
<p>
What does <code>funcs[0]()</code> output?
<p>
If you said 10, you were right.
<p>
The key here is that although <code>i</code> is accessible from the scope of the closure, it can be modified by other things. The closure doesn&#039;t copy the values it can access when it&#039;s created. 
<p>
In some cases, this kind of thing does work as expected. That&#039;s because in those cases, you are accessing a value that doesn&#039;t change. Even though it looks like it might have. If you combine with a forEach function, you actually get your own value that won&#039;t change.
<p>
You can also do this by creating a copy inside a function expression:
<p>
<pre>var funcs = [];
for (var i = 0; i &lt; 10; i++) {
    (function(i) {
        funcs.push( function() { console.log(i) } );
    }(i));
}</pre>
<p>
<code>funcs[0]()</code> =&gt; 0.
<p>
Note that the <code>i</code> accessible within the closure is a different <code>i</code> from the for loop&#039;s.
<p>
If you&#039;re using any helper libraries (or Node) with your for loops you don&#039;t need to run into this too often. The above is equivalent to:
<p>
<pre>var funcs = [];
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9].forEach(function(i) {
    funcs.push( function() { console.log(i) } );
});</pre>
<p>
]]></content:encoded>
  </item>
      <item>
    <title>Why is SOE/Planetside 2 so hostile to European players?</title>
    <link>https://blog.asgaard.co.uk/2013/02/02/why-is-soe-planetside-2-so-hostile-to-european-players</link>
    <pubDate>Sat, 02 Feb 13 10:06:19 +0000</pubDate>
    <guid>https://blog.asgaard.co.uk/2013/02/02/why-is-soe-planetside-2-so-hostile-to-european-players</guid>
    <description><![CDATA[
<p>
Last week we had the wonderfully bad &quot;ultimate empire showdown&quot;, which occurred between, I think, 1 and 4AM CET. 
<p>
This week we have the grand patch, which they are releasing at 4AM PST and expect to involve four hours of downtime. They are taking the game down Saturday afternoon for EU players. They are even working antisocial hours in their own time zone to achieve this! That&#039;s professionalism for you.
<p>
The fact it was like this all through beta just makes me think of PS2 as a great game that often won&#039;t let me play it when I want to.
<p>
Also, the station cash prices are more expensive to Europeans: 
<p>
US: 5000 SC = $50.00 =&gt; £31.81
<br>
UK: 5000 SC = £37<hr/>
<p>
Update: The patch was successfully deployed after 7 hours of downtime. Predictably, it introduces significant performance problems (FPS stuttering) and is unstable (2 crashes so far), as well as a generous sprinkling of game logic bugs. Way to go SOE! I dare say by Tuesday we&#039;ll have some hotfixes and the game will be playable aga[...]]]></description>
    <content:encoded><![CDATA[
<p>
Last week we had the wonderfully bad &quot;ultimate empire showdown&quot;, which occurred between, I think, 1 and 4AM CET. 
<p>
This week we have the grand patch, which they are releasing at 4AM PST and expect to involve four hours of downtime. They are taking the game down Saturday afternoon for EU players. They are even working antisocial hours in their own time zone to achieve this! That&#039;s professionalism for you.
<p>
The fact it was like this all through beta just makes me think of PS2 as a great game that often won&#039;t let me play it when I want to.
<p>
Also, the station cash prices are more expensive to Europeans: 
<p>
US: 5000 SC = $50.00 =&gt; £31.81
<br>
UK: 5000 SC = £37<hr/>
<p>
Update: The patch was successfully deployed after 7 hours of downtime. Predictably, it introduces significant performance problems (FPS stuttering) and is unstable (2 crashes so far), as well as a generous sprinkling of game logic bugs. Way to go SOE! I dare say by Tuesday we&#039;ll have some hotfixes and the game will be playable again.
<p>
Update 2: Then they pushed out a hotfix, which now breaks tank cannons. All tanks fire blanks. Performance is still bad. I haven&#039;t played long enough to comment on stability. I don&#039;t know if it actually fixes anything, or just breaks everything else.
<p>
No matter how you frame it, SOE is collectively an incompetent developer. Anyone who decides to deploy a new version of software at 4AM on a Saturday is an idiot.
<p>
According to Twitter feeds, some of them were working for 24 hours solid from Friday through to Saturday. What kind of stupid company thinks having their employees work for 24 hours solid is a good idea? Even if you have willing employees who are happy to do it (hint: you don&#039;t), they&#039;re still going to break everything. 
<p>
I really dislike that some parts of the community are praising their &quot;dedication&quot;. No. Please don&#039;t praise them. They are incompetent and they are incompetent because of their &quot;dedication&quot;. If they worked reasonable hours they&#039;d make fewer mistakes. There is probably a collective force of incompetence somewhere within SOE&#039;s middle management that makes the lives and jobs of the actual workers more difficult by imposing silly deadlines and creating pressure to release software that isn&#039;t ready. As a consumer, you do nobody any favours, neither yourself nor the actual developers, by happily accepting the ridiculous situations and mistakes which come about as a direct consequence of this.]]></content:encoded>
  </item>
  </channel>
</rss>