<?xml version="1.0" encoding="UTF-8"?><rss version="2.0">
  <channel>
    <title>BlackHC&#39;s Adventures in the Dev World</title>
    <link>http://blog.blackhc.net</link>
    <description></description>
    <managingEditor> (Andreas &#39;BlackHC&#39; Kirsch)</managingEditor>
    <pubDate>Wed, 05 Apr 2017 00:19:12 +0100</pubDate>
    <item>
      <title>Reading the Deep Learning Book - Chapter 2</title>
      <link>http://blog.blackhc.net/2017/03/dlb-chapter2/index.html</link>
      <description>&lt;p&gt;This are my notes and observations from reading the &lt;a href=&#34;http://www.deeplearningbook.org/contents/linear_algebra.html&#34;&gt;Linear Algebra chapter&lt;/a&gt; of the &lt;a href=&#34;http://www.deeplearningbook.org/&#34;&gt;Deep Learning&lt;/a&gt; book.&lt;/p&gt;&#xA;&lt;p&gt;The following notes are presented in order of value to the reader. I start with a discussion of the Moore-Penrose pseudoinverse, followed by a short reflection on &amp;quot;broadcasting&amp;quot;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;moore-penrose-pseudoinverse&#34;&gt;Moore-Penrose pseudoinverse&lt;/h2&gt;&#xA;&lt;p&gt;The Moore-Penrose pseudoinverse is defined as:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://www.deeplearningbook.org/contents/linear_algebra.html#pff&#34;&gt;&lt;span class=&#34;math display&#34;&gt;\[ A^{+}:=\lim _{\alpha \searrow  0}\left( A^{T}A+\alpha I\right) ^{-1}A^{T} \]&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;You can click on the formula to jump into the book. (It&#39;s really awesome that all of it is online and you can deep link to pages.)&lt;/p&gt;&#xA;&lt;p&gt;This formula is mystifying. What is its origin? And why does it do what the book says it does?&lt;/p&gt;&#xA;&lt;p&gt;We can get a feeling for its origin by looking at the equation &lt;span class=&#34;math inline&#34;&gt;\(Ax=b\)&lt;/span&gt; that it solves:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[&#xA;\begin{align*} Ax &amp;amp;=b &amp;amp;|&amp;amp; A^{T}\cdot \\ A^{T}Ax &amp;amp;=A^{T}b &amp;amp;|&amp;amp; \left( A^{T}A\right) ^{-1} \cdot \\ \left( A^{T}A\right) ^{-1}A^{T}Ax &amp;amp;=\left( A^{T}A\right) ^{-1}A^{T}b &amp;amp; &amp;amp; \\ x &amp;amp;=\left( A^{T}A\right) ^{-1}A^{T}b  &amp;amp; &amp;amp; \end{align*}&#xA;\]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;So we start with the equation that we want to solve and find a more complex form for solving for &lt;span class=&#34;math inline&#34;&gt;\(x\)&lt;/span&gt; than the usual left-multiplication with the inverse &lt;span class=&#34;math inline&#34;&gt;\(A^{-1}\)&lt;/span&gt;. This is already useful if &lt;span class=&#34;math inline&#34;&gt;\(A^T A\)&lt;/span&gt; is invertible and &lt;span class=&#34;math inline&#34;&gt;\(A\)&lt;/span&gt; is not square (because matrix inverses only exist for square matrices).&lt;/p&gt;&#xA;&lt;p&gt;This already looks similar to the pseudo-inverse, except for the &lt;span class=&#34;math inline&#34;&gt;\(+\alpha I\)&lt;/span&gt; term.&lt;/p&gt;&#xA;&lt;h3 id=&#34;aside-there-is-also-a-right-pseudo-inverse&#34;&gt;Aside: there is also a right pseudo-inverse&lt;/h3&gt;&#xA;&lt;p&gt;We can guess its form by starting with:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[&#xA;\begin{align*} yA&amp;amp;=b&amp;amp;|&amp;amp;\cdot A^{T}\\ yAA^{T}&amp;amp;=bA^{T}&amp;amp;|&amp;amp;\cdot \left( AA^{T}\right) ^{-1}\\ yAA^{T}\left( AA^{T}\right) ^{-1}&amp;amp;=bA^{T}\left( AA^{T}\right) ^{-1}\\ y&amp;amp;=bA^{T}\left( AA^{T}\right) ^{-1}\end{align*}&#xA;\]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;From this, we can make an educated guess:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[&#xA;^{+}A = A^{T}\lim _{\alpha \searrow 0}\left( AA^{T}+\alpha I\right) ^{-1}&#xA;\]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Since we cannot always invert &lt;span class=&#34;math inline&#34;&gt;\(A^TA\)&lt;/span&gt; (respectively &lt;span class=&#34;math inline&#34;&gt;\(AA^T\)&lt;/span&gt;), an obvious question is:&lt;/p&gt;&#xA;&lt;h3 id=&#34;why-can-we-invert-aat-alpha-i-for-positive-alpha&#34;&gt;Why can we invert &lt;span class=&#34;math inline&#34;&gt;\(AA^T+ \alpha I\)&lt;/span&gt; for positive &lt;span class=&#34;math inline&#34;&gt;\(\alpha\)&lt;/span&gt;?&lt;/h3&gt;&#xA;&lt;p&gt;Let&#39;s examine this. &lt;a href=&#34;https://en.wikipedia.org/wiki/Invertible_matrix&#34;&gt;For a matrix to be invertible&lt;/a&gt;, its kernel has to only contain the zero vector:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[\ker \left( A^{T}A+\alpha I\right) =\left\{ 0\right\}\]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;To prove that this is the case for &lt;span class=&#34;math inline&#34;&gt;\(\left( AA^{T}+\alpha I\right)\)&lt;/span&gt;, we need to show that:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[  \left( A^{T}A+\alpha I\right) v = 0 \implies v = 0\]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;So starting with the left side, we can rephrase it as follows:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[ \begin{align*} &#xA;&amp;amp; &amp;amp; \left( A^{T}A+\alpha I\right) v&amp;amp;= 0\\ &#xA;&amp;amp; \Leftrightarrow &amp;amp;A^{T}Av+\alpha Iv&amp;amp;= 0\\ &#xA;&amp;amp; \Leftrightarrow &amp;amp;A^{T}Av &amp;amp;= -\alpha v&#xA;\end{align*} \]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;If &lt;span class=&#34;math inline&#34;&gt;\(v \ne 0\)&lt;/span&gt;, this would mean that &lt;span class=&#34;math inline&#34;&gt;\(-\alpha\)&lt;/span&gt; is a negative &lt;a href=&#34;https://en.wikipedia.org/wiki/Eigenvalues_and_eigenvectors&#34;&gt;eigenvalue&lt;/a&gt; of &lt;span class=&#34;math inline&#34;&gt;\(A^TA\)&lt;/span&gt; as &lt;span class=&#34;math inline&#34;&gt;\(\alpha\)&lt;/span&gt; is &lt;span class=&#34;math inline&#34;&gt;\(&amp;gt;0\)&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;h4 id=&#34;can-ata-have-negative-eigenvalues&#34;&gt;Can &lt;span class=&#34;math inline&#34;&gt;\(A^TA\)&lt;/span&gt; have negative eigenvalues?&lt;/h4&gt;&#xA;&lt;p&gt;Let&#39;s assume &lt;span class=&#34;math inline&#34;&gt;\(v \ne 0\)&lt;/span&gt; and &lt;span class=&#34;math inline&#34;&gt;\(-\alpha\)&lt;/span&gt; is a negative eigenvalue, that is &lt;span class=&#34;math inline&#34;&gt;\(A^{T}Av = -\alpha v\)&lt;/span&gt; holds (and &lt;span class=&#34;math inline&#34;&gt;\(\alpha &amp;gt; 0\)&lt;/span&gt;). We can left-multiply with &lt;span class=&#34;math inline&#34;&gt;\(v^T\)&lt;/span&gt; and obtain:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[ &#xA;\begin{align*} &amp;amp; \Leftrightarrow v^{T}A^{T}Av=v^{T}\left( -\alpha v\right) \\ &amp;amp; \Leftrightarrow \left\| Av\right\| _{2}^{2}=-\alpha v^{T}v=-\alpha \left\| v\right\| _{2}^{2}\\ &amp;amp; \Leftrightarrow -\alpha =\dfrac {\left\| Av\right\| _{2}^{2}} {\left\| v\right\| _{2}^{2}}\geq 0&#xA;\end{align*} &#xA;\]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;(We can divide by &lt;span class=&#34;math inline&#34;&gt;\(\left\| v\right\| _{2}^{2}\)&lt;/span&gt; because we assume &lt;span class=&#34;math inline&#34;&gt;\(v\ne0\)&lt;/span&gt;.) Now this means, that &lt;span class=&#34;math inline&#34;&gt;\(-\alpha\)&lt;/span&gt; has to be &lt;span class=&#34;math inline&#34;&gt;\(&amp;gt;0\)&lt;/span&gt;, so it is not a negative eigenvalue and a contradiction to our initial assumption &lt;span class=&#34;math inline&#34;&gt;\(\alpha &amp;gt; 0\)&lt;/span&gt;. In fact, we have just shown that &lt;span class=&#34;math inline&#34;&gt;\(A^TA\)&lt;/span&gt; in general can only have non-negative eigenvalues. (We can show the same for &lt;span class=&#34;math inline&#34;&gt;\(AA^T\)&lt;/span&gt; the same way.)&lt;/p&gt;&#xA;&lt;p&gt;Because &lt;span class=&#34;math inline&#34;&gt;\(A^TA\)&lt;/span&gt; cannot have negative eigenvalues, this means that &lt;span class=&#34;math inline&#34;&gt;\(v\)&lt;/span&gt; cannot be &lt;span class=&#34;math inline&#34;&gt;\(\ne 0\)&lt;/span&gt;, so &lt;span class=&#34;math inline&#34;&gt;\(v = 0\)&lt;/span&gt;. This is what we wanted to show, and this means that the kernel only contains the zero vector, and &lt;span class=&#34;math inline&#34;&gt;\(AA^T + \alpha I\)&lt;/span&gt; is invertible for &lt;span class=&#34;math inline&#34;&gt;\(\alpha &amp;gt; 0\)&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;what-if-at-a-was-invertible&#34;&gt;What if &lt;span class=&#34;math inline&#34;&gt;\(A^T A\)&lt;/span&gt; was invertible?&lt;/h3&gt;&#xA;&lt;p&gt;For a moment, let&#39;s consider the case when &lt;span class=&#34;math inline&#34;&gt;\(A^T A\)&lt;/span&gt; is invertible: Is the Moore-Penrose pseudoinverse then equal to &lt;span class=&#34;math inline&#34;&gt;\(\left (A^T A \right)^{-1} A^T\)&lt;/span&gt;?&lt;/p&gt;&#xA;&lt;p&gt;Matrix inversion is continuous in the space of invertible matrices. You might remember the definition of continuity from school. &lt;a href=&#34;https://en.wikipedia.org/wiki/Continuous_function#Definition_in_terms_of_limits_of_sequences&#34;&gt;A better definition of continuity&lt;/a&gt; is that it means being able to swap function and limit application:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;A function &lt;span class=&#34;math inline&#34;&gt;\(f\)&lt;/span&gt; is continuous on its domain iff for any convergent series &lt;span class=&#34;math inline&#34;&gt;\(x_n \to x\)&lt;/span&gt; for which &lt;span class=&#34;math inline&#34;&gt;\(f \left( x \right )\)&lt;/span&gt; is defined &lt;span class=&#34;math display&#34;&gt;\[ \lim_{n \to \infty } f \left ( x_n \right ) = f \left ( \lim_{n \to \infty} x_n \right ) = f \left( x \right).\]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Assuming &lt;span class=&#34;math inline&#34;&gt;\(A^T A\)&lt;/span&gt; is invertible and using the fact that matrix inversion is continuous for invertible matrices, we now see:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[ \begin{align*} &#xA;\lim _{\alpha \searrow 0}\left( A^{T} A +\alpha I\right) ^{-1} A^T &amp;amp;= \left( \lim _{\alpha \searrow 0} A^{T} A +\alpha I\right) ^{-1} A^T \\&#xA;&amp;amp;= \left( A^{T}A+0 \, I\right) ^{-1} A^T \\&#xA;&amp;amp;= \left( A^{T}A\right) ^{-1} A^T&#xA;\end{align*}  \]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;So in this special case, the pseudoinverse is exactly the solution we have come up with ourselves.&lt;/p&gt;&#xA;&lt;h3 id=&#34;two-properties-of-the-pseudoinverse&#34;&gt;Two properties of the pseudoinverse&lt;/h3&gt;&#xA;&lt;p&gt;There are two properties mentioned in text that are interesting but not obvious:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://www.deeplearningbook.org/contents/linear_algebra.html#pf10&#34;&gt;When &lt;span class=&#34;math inline&#34;&gt;\(A\)&lt;/span&gt; has more columns than rows, then solving a linear equation using the pseudoinverse provides one of the many possible solutions. Specifically, it provides the solution &lt;span class=&#34;math inline&#34;&gt;\(x=A^+y\)&lt;/span&gt; with minimal Euclidean norm &lt;span class=&#34;math inline&#34;&gt;\(\left\| x \right\|_2\)&lt;/span&gt; among all possible solutions. When &lt;span class=&#34;math inline&#34;&gt;\(A\)&lt;/span&gt; has more rows than columns, it is possible for there to be no solution. In this case, using the pseudoinverse gives us the &lt;span class=&#34;math inline&#34;&gt;\(x\)&lt;/span&gt; for which &lt;span class=&#34;math inline&#34;&gt;\(Ax\)&lt;/span&gt; is as close as possible to &lt;span class=&#34;math inline&#34;&gt;\(y\)&lt;/span&gt; in terms of Euclidean norm &lt;span class=&#34;math inline&#34;&gt;\(\left\| Ax - y \right\|_2\)&lt;/span&gt;.&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;These properties are not obvious and their deduction is enlightening towards the chosen definition of the pseudoinverse, specifically the use of the limit and the constraint of &lt;span class=&#34;math inline&#34;&gt;\(\alpha\)&lt;/span&gt; to be &lt;span class=&#34;math inline&#34;&gt;\(&amp;gt;0\)&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;h4 id=&#34;a-related-optimization-problem&#34;&gt;A related optimization problem&lt;/h4&gt;&#xA;&lt;p&gt;To prove the properties, let&#39;s look at the following regularized minimum-least-squares problem. This is something that is formulated in more detail in &lt;a href=&#34;http://www.deeplearningbook.org/contents/numerical.html#pf11&#34;&gt;Chapter 4 of the book&lt;/a&gt;, but it is quite useful here:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[\min _{x}\left| \left| Ax-b\right| \right| _{2}^{2}+\alpha \left\| x\right\| _{2}^{2}, \, \alpha &amp;gt; 0\]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Let&#39;s solve this optimization problem. First, we set up a cost function:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[ \begin{align*} &#xA;c_\alpha\left( x\right) &amp;amp;=\left\| Ax-b\right\| _{2}^{2}+\alpha \left\| x\right\| _{2}^{2}\\&#xA;&amp;amp; =\left( Ax-b\right) ^{T}\left( Ax-b\right) +\alpha x^{T}x\\&#xA;&amp;amp; =x^{T}AAx-2b^{T}Ax+b^{T}b+\alpha x^{T} x \end{align*} \\&#xA;\]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;The first derivative of &lt;span class=&#34;math inline&#34;&gt;\(c_\alpha\)&lt;/span&gt; is:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[ \nabla c_\alpha\left( x\right) =2A^{T}Ax-2A^{T}b+2\alpha x\]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;And the second derivative is:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[ H_\alpha \left ( x \right ) = 2A^T A + 2\alpha I\]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math inline&#34;&gt;\(H_\alpha\)&lt;/span&gt; is &lt;a href=&#34;https://en.wikipedia.org/wiki/Positive-definite_matrix&#34;&gt;positive definite&lt;/a&gt;, that is &lt;span class=&#34;math inline&#34;&gt;\(v^T H_\alpha \left ( x \right ) v \ge 0\)&lt;/span&gt; for all &lt;span class=&#34;math inline&#34;&gt;\(v\)&lt;/span&gt;. Why? We have already seen that &lt;span class=&#34;math inline&#34;&gt;\(A^T A\)&lt;/span&gt; only has non-negative eigenvalues, so it is positive semidefinite by definition and &lt;span class=&#34;math inline&#34;&gt;\(\alpha I\)&lt;/span&gt; is trivially positive definite for &lt;span class=&#34;math inline&#34;&gt;\(\alpha &amp;gt; 0\)&lt;/span&gt;. The sum of the two is positive definite again. Thus &lt;span class=&#34;math inline&#34;&gt;\(c\)&lt;/span&gt; is a &lt;a href=&#34;https://en.wikipedia.org/wiki/Convex_function&#34;&gt;strictly convex function&lt;/a&gt;. This is along to lines of the one-dimensional case: when the second derivative is &lt;span class=&#34;math inline&#34;&gt;\(&amp;gt; 0\)&lt;/span&gt; everywhere, the function is strictly convex. Convex functions have a global minimum and, for strictly convex functions, this global minimum is unique. So we know there is only exactly one point that minimizes the cost function &lt;span class=&#34;math inline&#34;&gt;\(c_\alpha\)&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;We can determine this global minimum &lt;span class=&#34;math inline&#34;&gt;\(x^*_\alpha\)&lt;/span&gt; by solving &lt;span class=&#34;math inline&#34;&gt;\(\nabla c_\alpha \left ( x \right ) = 0\)&lt;/span&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[ \begin{align*} &#xA;&amp;amp; &amp;amp; \nabla c_\alpha\left( x\right) &amp;amp;= 0 \\&#xA;&amp;amp; \Leftrightarrow &amp;amp; A^{T}Ax-A^{T}b+ax&amp;amp;=0\\&#xA;&amp;amp; \Leftrightarrow &amp;amp;\left( A^{T}A+\alpha I\right) x&amp;amp;=A^{T}b\\&#xA;&amp;amp; \Leftrightarrow &amp;amp; x&amp;amp;=\left( A^{T}A+\alpha I\right) ^{-1}A^{T}b\end{align*}&#xA;\]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;This is exactly the definition of the pseudoinverse without the limit. So we have found:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[&#xA;x^*_{\alpha} = \underset{x}{\operatorname{argmin}} \left| \left| Ax-b\right| \right| _{2}^{2}+\alpha \left\| x\right\| _{2}^{2} = \left( A^{T}A+\alpha I\right) ^{-1}A^{T}b&#xA;\]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;with &lt;span class=&#34;math inline&#34;&gt;\(c_\alpha \left (x^*_\alpha \right ) \leq c_\alpha \left ( x \right )\)&lt;/span&gt; for all &lt;span class=&#34;math inline&#34;&gt;\(x\)&lt;/span&gt;, and &lt;span class=&#34;math inline&#34;&gt;\(x^*_\alpha\)&lt;/span&gt; denotes the minimum point.&lt;/p&gt;&#xA;&lt;p&gt;This expression is continuous in &lt;span class=&#34;math inline&#34;&gt;\(\alpha\)&lt;/span&gt;, so we can take the limit &lt;span class=&#34;math inline&#34;&gt;\(\alpha \searrow 0\)&lt;/span&gt;. Remember, we need the constraint of &lt;span class=&#34;math inline&#34;&gt;\(\alpha &amp;gt; 0\)&lt;/span&gt; for &lt;span class=&#34;math inline&#34;&gt;\(A^TA + \alpha I\)&lt;/span&gt; to be invertible, so we can only take the limit from above. Taking the limit, we obtain:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[&#xA;x^*= \lim_{x \searrow 0} \left( A^{T}A+\alpha I\right) ^{-1}A^{T}b&#xA;\]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;with &lt;span class=&#34;math inline&#34;&gt;\(c \left (x^* \right ) \leq c \left ( x \right )\)&lt;/span&gt; for all &lt;span class=&#34;math inline&#34;&gt;\(x\)&lt;/span&gt; with&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[c \left ( x \right ) = \lim_{\alpha \searrow 0} \left\| Ax-b\right\| _{2}^{2}+\alpha \left\| x\right\| _{2}^{2} = \left\| Ax-b\right\| _{2}^{2}.\]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;What do we gain from this? Well for one, we now know that this expression minimizes &lt;span class=&#34;math inline&#34;&gt;\(\left| \left| Ax-b\right| \right| _{2}^{2}\)&lt;/span&gt;. Furthermore, if there is a solution for &lt;span class=&#34;math inline&#34;&gt;\(A x =b\)&lt;/span&gt;, we can easily use a similar approach to see that the solution &lt;span class=&#34;math inline&#34;&gt;\(x^*\)&lt;/span&gt; is smaller under Euclidean norm than any (other) solution &lt;span class=&#34;math inline&#34;&gt;\(\hat x\)&lt;/span&gt; for &lt;span class=&#34;math inline&#34;&gt;\(Ax=b\)&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;We do this in two steps. First, we observe that&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[A\hat x = b \Leftrightarrow A \hat x - b = 0 \Leftrightarrow \left\| A\widehat {x}-b\right\| _{2}^{2} = 0 \]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;and, because &lt;span class=&#34;math inline&#34;&gt;\(x^*_\alpha\)&lt;/span&gt; minimizes &lt;span class=&#34;math inline&#34;&gt;\(c_\alpha\)&lt;/span&gt;,&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[&#xA;\begin{align*}&#xA;&amp;amp; &amp;amp; c_{\alpha}\left( x_{\alpha }^{*}\right) &amp;amp;\leq c_{\alpha }\left( \hat {x}\right) \\&#xA;&amp;amp; \Leftrightarrow &amp;amp; c_{\alpha}\left( x_{\alpha }^{*}\right) &amp;amp;\leq \left\| A\hat {x}-b\right\| _{2}^{2}+\left\| \hat {x}\right\| _{2}^{2}=0+\alpha \left\| \hat x\right\| _{2}^{2} \\&#xA;&amp;amp; \Leftrightarrow &amp;amp; c_{\alpha}\left( x_{\alpha }^{*}\right) &amp;amp; \leq \alpha \left\| \hat x\right\| _{2}^{2} \end{align*}&#xA;\]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;This expression is again continuous, so we can take the limit &lt;span class=&#34;math inline&#34;&gt;\(\alpha \searrow 0\)&lt;/span&gt;, and we see:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[\begin{align*}&#xA;&amp;amp; c \left( x^{*} \right) \leq 0 \\&#xA;\Leftrightarrow &amp;amp;  \left\| Ax^{*}-b\right\| _{2}^{2} \le 0&#xA;\end{align*}&#xA;\]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Because norms are always non-negative, we have &lt;span class=&#34;math inline&#34;&gt;\(0 \le \left\| Ax^{*}-b\right\| _{2}^{2} \le 0\)&lt;/span&gt;, so &lt;span class=&#34;math inline&#34;&gt;\(\left\| Ax^{*}-b\right\| _{2}^{2} = 0\)&lt;/span&gt;. And we have observed above that this is equivalent to &lt;span class=&#34;math inline&#34;&gt;\(Ax^{*} = b\)&lt;/span&gt;. So if there is at least one exact solution to the problem, we are sure to obtain an exact one, too. To be fair, we could have deduced this in the previous section. However, we can take another limit on the inequality &lt;span class=&#34;math inline&#34;&gt;\(c_{\alpha}\left( x_{\alpha }^{*}\right) \leq \alpha \left\| \hat x\right\| _{2}^{2}\)&lt;/span&gt; and obtain a more interesting result. This time, we only take the limit &lt;span class=&#34;math inline&#34;&gt;\(\alpha \searrow 0\)&lt;/span&gt; of &lt;span class=&#34;math inline&#34;&gt;\(x^{*}_\alpha\)&lt;/span&gt;, but keep &lt;span class=&#34;math inline&#34;&gt;\(c_\alpha\)&lt;/span&gt; fixed:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[&#xA;\begin{align*}&#xA;&amp;amp;&amp;amp;c_{\alpha}\left( x_{\alpha }^{*}\right) &amp;amp;\leq \alpha \left\| \hat x\right\| _{2}^{2} \\&#xA;\Rightarrow  &amp;amp;&amp;amp; c_{\alpha}\left( \lim_{\alpha \searrow 0} x_{\alpha }^{*}\right) &amp;amp;\leq \alpha \left\| \hat x\right\| _{2}^{2}  \\&#xA;\Leftrightarrow &amp;amp;&amp;amp; c_{\alpha}\left( x^{*} \right) &amp;amp;\leq \alpha \left\| \hat x\right\| _{2}^{2} \\&#xA;\Leftrightarrow &amp;amp;&amp;amp; \left\| Ax^{*}-b\right\| _{2}^{2}+\alpha \left\| x^{*}\right\| _{2}^{2} &amp;amp;\leq \alpha \left\| \hat x\right\| _{2}^{2} \\&#xA;\Rightarrow &amp;amp;&amp;amp; \alpha \left\| x^{*}\right\| _{2}^{2} &amp;amp;\leq \alpha \left\| \hat x\right\| _{2}^{2} \\&#xA;\Leftrightarrow &amp;amp;&amp;amp; \left\| x^{*}\right\| _{2}^{2} &amp;amp;\leq \left\| \hat x\right\| _{2}^{2} &#xA;\end{align*}&#xA;\]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Here, we use &lt;span class=&#34;math inline&#34;&gt;\(\left\| Ax^{*}-b\right\| _{2}^{2} \ge 0\)&lt;/span&gt; to be able to drop the term and &lt;span class=&#34;math inline&#34;&gt;\(\alpha &amp;gt; 0\)&lt;/span&gt; to preserve the direction of the inequality, and we obtain the second property about the length of &lt;span class=&#34;math inline&#34;&gt;\(\left \| x^{*} \right \|\)&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Now we have proved both properties that were mentioned in the book. On the one hand, if there are solutions, we will obtain one with minimal norm. On the other hand, if there are no solutions, using the pseudoinverse will provide us with an &lt;span class=&#34;math inline&#34;&gt;\(x\)&lt;/span&gt; that at least minimizes &lt;span class=&#34;math inline&#34;&gt;\(\left| \left| Ax-b\right| \right| _{2}^{2}\)&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;To convince yourself that the expressions above are indeed continuous, we can use the technical argument that we can rewrite &lt;span class=&#34;math inline&#34;&gt;\(c_\alpha \left (x \right )\)&lt;/span&gt; into &lt;span class=&#34;math inline&#34;&gt;\(c \left (\alpha, x \right )\)&lt;/span&gt; and see that it is a continuous function in two variables instead of going the route of using functional analysis and treating &lt;span class=&#34;math inline&#34;&gt;\(c_\alpha\)&lt;/span&gt; as a convergent series of functions.&lt;/p&gt;&#xA;&lt;h2 id=&#34;broadcasting-notation-oh-my...&#34;&gt;Broadcasting notation: oh my...&lt;/h2&gt;&#xA;&lt;p&gt;The broadcasting notation in the Deep Learning book is weird. For one moment, let&#39;s ignore its origins from &lt;a href=&#34;https://docs.scipy.org/doc/numpy-1.10.1/user/basics.broadcasting.html&#34;&gt;numpy&lt;/a&gt;, and let&#39;s look at what&#39;s happening.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://www.deeplearningbook.org/contents/linear_algebra.html#pf4&#34;&gt;In the context of deep learning, we also use some less conventional notation. We allow the addition of matrix and a vector, yielding another matrix: &lt;span class=&#34;math inline&#34;&gt;\(C=A+b\)&lt;/span&gt;, where &lt;span class=&#34;math inline&#34;&gt;\(C_{i,j}=A_{i,j}+b_j\)&lt;/span&gt;. In other words, the vector &lt;span class=&#34;math inline&#34;&gt;\(b\)&lt;/span&gt; is added to each row of the matrix. This shorthand eliminates the need to deﬁne a matrix with &lt;span class=&#34;math inline&#34;&gt;\(b\)&lt;/span&gt; copied into each row before doing the addition. This implicit copying of &lt;span class=&#34;math inline&#34;&gt;\(b\)&lt;/span&gt; to many locations is called broadcasting.&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Let&#39;s say &lt;span class=&#34;math inline&#34;&gt;\(A \in \mathbb{R}^{3 \times 3}\)&lt;/span&gt; and &lt;span class=&#34;math inline&#34;&gt;\(b \in \mathbb{R}^3\)&lt;/span&gt;, for example:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[ A = \left[\begin{matrix}0 &amp;amp; 0 &amp;amp; 0\\1 &amp;amp; 1 &amp;amp; 1\\2 &amp;amp; 2 &amp;amp; 2\end{matrix}\right] , b = \left[\begin{matrix}1\\2\\3\end{matrix}\right] \]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Then, with broadcasting:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[ A + b = \left[\begin{matrix}1 &amp;amp; 2 &amp;amp; 3\\2 &amp;amp; 3 &amp;amp; 4\\3 &amp;amp; 4 &amp;amp; 5\end{matrix}\right] \]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;How do we get there? Essentially, we take the vector &lt;span class=&#34;math inline&#34;&gt;\(b \in \mathbb{R}^3\)&lt;/span&gt;, interpret it as a row vector, and add it to every row of the matrix, so:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[ A + b= A + \left[\begin{matrix}1\\1\\1\end{matrix}\right] b^T \]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Wouldn&#39;t it make more sense to write this as &lt;span class=&#34;math inline&#34;&gt;\(A + b^T\)&lt;/span&gt;? The reason for the unintuitive notation lies in the details of broadcasting: whereas in maths, a vector &lt;span class=&#34;math inline&#34;&gt;\(\mathbb{R}^3\)&lt;/span&gt; is identified as a column matrix &lt;span class=&#34;math inline&#34;&gt;\(\mathbb{R}^{3 \times 1}\)&lt;/span&gt; , in the context of broadcasting it is treated as a row matrix &lt;span class=&#34;math inline&#34;&gt;\(\mathbb{R}^{1 \times 3}\)&lt;/span&gt;. This row matrix is then repeated across the &lt;span class=&#34;math inline&#34;&gt;\(1\)&lt;/span&gt; dimension to make it into a &lt;span class=&#34;math inline&#34;&gt;\(3 \times 3\)&lt;/span&gt; matrix that can be applied to &lt;span class=&#34;math inline&#34;&gt;\(A\)&lt;/span&gt;. However, for matrix multiplications, &lt;span class=&#34;math inline&#34;&gt;\(b\)&lt;/span&gt; continues to be treated as column matrix. This is really confusing. So what&#39;s the reason for this ambiguity?&lt;/p&gt;&#xA;&lt;p&gt;My best guess is that in ML contexts, data entries (examples) are often treated as row vectors. For example, a design matrix stores a number of examples, each in a separate row. So if you want to change the bias of your examples, you want to add a bias vector as row-vector to each row. Indeed, in chapter 8, broadcasting is used to express batch normalization in eq (8.35):&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://www.deeplearningbook.org/contents/optimization.html#pf2d&#34;&gt;&lt;span class=&#34;math display&#34;&gt;\[H&amp;#39;=\dfrac{H-\mu}{\sigma}\]&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;I don&#39;t think this excuses the lack of clarity introduced with this notation, but then again it is too late to change and make everybody use a transposed design matrix... :)&lt;/p&gt;&#xA;&lt;h2 id=&#34;looking-back-and-ahead&#34;&gt;Looking back and ahead&lt;/h2&gt;&#xA;&lt;p&gt;There is much more I could write about, but I think these were the most interesting bits from my notes. We have revisited convex functions, continuity and limits to motivate the curious definition of the Moore-Penrose pesudoinverse. Last but not least, we have looked at the origin of the broadcasting notation and why it might be confusing to someone who is new to ML. Next up: reading Chapter 3 and thinking about probability theory.&lt;/p&gt;&#xA;&lt;p&gt;Stay tuned,&lt;br /&gt;&#xA;Andreas&lt;/p&gt;&#xA;&lt;p&gt;PS: Thanks to my friend Armin Krupp for suggestions and corrections of the draft. All current mistakes and factual errors have been added later.&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Mon, 27 Mar 2017 23:48:34 +0000</pubDate>
    </item>
    <item>
      <title>Recent Medium Posts</title>
      <link>http://blog.blackhc.net/2017/03/recent-medium/index.html</link>
      <description>&lt;p&gt;I have published a couple of posts on Medium to see how it works:&lt;/p&gt;&#xA;&lt;h2 id=&#34;a-dart-repl-poc---hacking-with-dart&#34;&gt;&lt;a href=&#34;https://medium.com/dartlang/dart-repl-poc-f327e3769b6f&#34;&gt;A Dart REPL PoC - Hacking with Dart&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;A well-received post about &lt;a href=&#34;https://github.com/BlackHC/dart_repl&#34; class=&#34;uri&#34;&gt;https://github.com/BlackHC/dart_repl&lt;/a&gt; which is a PoC interactive shell for &lt;a href=&#34;http://dartlang.org&#34;&gt;Dart&lt;/a&gt;. I hope I&#39;ve been able to restore some Karma points with the Dart team over this #butrisesagainharderandstronger..&lt;/p&gt;&#xA;&lt;h2 id=&#34;metamath---formalizing-math&#34;&gt;&lt;a href=&#34;https://medium.com/@BlackHC/metamath-intro-6dd317b992c5&#34;&gt;Metamath - Formalizing math&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;A small write-up about my impressions from learning about Metamath and some questions that I really, really want to find time to look into.&lt;/p&gt;&#xA;&lt;p&gt;A shoddy implementation in Dart can be found here: &lt;a href=&#34;https://github.com/BlackHC/dart_metamath_naive&#34; class=&#34;uri&#34;&gt;https://github.com/BlackHC/dart_metamath_naive&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;reading-the-deep-learning-book---chapter-1&#34;&gt;&lt;a href=&#34;https://medium.com/@BlackHC/deep-learning-book-chapter1-877927211b8b&#34;&gt;Reading the Deep Learning Book - Chapter 1&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;As part of a long study break, I&#39;ve started reading the &lt;a href=&#34;Deep%20Learning%20book&#34;&gt;http://www.deeplearningbook.org/&lt;/a&gt;. I will try to write down my thoughts for each chapter over time as a way of engaging with the material.&lt;/p&gt;&#xA;&lt;p&gt;Stay tuned for more posts and also cross-overs.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;m still trying to decide whether to post the more mathy stuff here.&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br /&gt;&#xA;Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Mon, 13 Mar 2017 21:48:34 +0000</pubDate>
    </item>
    <item>
      <title>Markdown Blog</title>
      <link>http://blog.blackhc.net/2016/12/markdown-blog/index.html</link>
      <description>&lt;p&gt;It&#39;s been a while, but now my blog is up using a static HTML generator with Markdown as underlying format \o/ The static HTML is generated using a couple of small go scripts that wrap &lt;a href=&#34;http://pandoc.org/&#34;&gt;pandoc&lt;/a&gt; and go&#39;s &lt;a href=&#34;https://golang.org/pkg/text/template/&#34;&gt;text/template&lt;/a&gt;. Converting all of my WordPress posts to MarkDown was as fun as such a task can be, and quite tedious. However, it was still nice to read everything I have ever posted again and allowed me to take a more holistic view on everything I&#39;ve done. It has definitely helped me with some life decisions this year.&lt;/p&gt;&#xA;&lt;p&gt;I don&#39;t think this is the end of my efforts to improve this blog because I really should move off the go scripts at some point, and the content menu is very mobile-first (it only looks and works well on my phone screen). Moreover, source highlighting does not work either.&lt;/p&gt;&#xA;&lt;p&gt;The biggest positive take-away, apart from finishing this mini-project, was that committing all intermediate outputs to a repository during the conversion really helped with moving fast. Every time I changed something in the scripts or in the Markdown code, I&#39;d see how it trickles down. With disciplined reviewing, this allowed me to avoid random breakages, and it made debugging quite easy and cheap because &lt;a href=&#34;http://www.syntevo.com/smartgit/&#34;&gt;SmartGit&lt;/a&gt;&#39;s differ would do most of the work for me.&lt;/p&gt;&#xA;&lt;p&gt;I used the opportunity to learn and write some simple Go code. I am split on the language. It feels crude and lacking abstractions. Also, &lt;del&gt;duck typing&lt;/del&gt; structural typing makes it harder to understand and explore code. On the other hand, I have been told all of this is intentional to keep things simple. Indeed, it was always straight-forward to get the code to do the things I want, with few surprises, even though it did usually not feel particularly elegant.&lt;/p&gt;&#xA;&lt;p&gt;My time estimate for the conversion is that I&#39;ve spent about 1 week for research, 1 week to convert the posts and 1 week to learn go and write the scripts. All of this was spread out over about 2 years with bursts of work now and then.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;m not sure what the next steps are for this blog. It feels good to have it looked down in HTML and Markdown in a clean version that is easier to back up. I want to play around with other ways of publishing and organizing information. This blog can be a way to centralize all my efforts and keep pointers and write-ups.&lt;/p&gt;&#xA;&lt;p&gt;Stay tuned! :-)&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sun, 18 Dec 2016 21:48:34 +0000</pubDate>
    </item>
    <item>
      <title>Writer&#39;s block</title>
      <link>http://blog.blackhc.net/2015/07/writers-block/index.html</link>
      <description>&lt;p&gt;&lt;a href=&#34;/images/2015-07-13-writers-block/typewriter-hemingway.jpg&#34;&gt;&lt;img src=&#34;/images/2015-07-13-writers-block/typewriter-hemingway.jpg&#34; alt=&#34;typewriter&#34; style=&#34;width:100.0%&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;I don&#39;t know what to write... to write is to create though. So let&#39;s create:&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve been busy for the last 2 years. Busy with work and busy living. Life always takes you to different places, and for me this was Zurich (from Munich) and Google (from university). Both changes were not that big and yet quite big. They have taken me far away from where I imagined myself to be in this moment of time 2.5 years ago. I was at a loss of words about this for long, but I think I&#39;m finding my voice again. My life at Google is worth a series of articles at a later time, and Zurich is a whole different story with very little Computer Science in my spare time.&lt;/p&gt;&#xA;&lt;p&gt;So let&#39;s go back to the topic: writer&#39;s block. How to overcome it? In a way, I have run out of creative steam during my master thesis, and even though I am busy at Google, it&#39;s a different kind of business to work in a big company and be told what to do. Definitely more boring than university usually :) In a way, my writer&#39;s block, which has kept this blog on hold for the last 24 months, has also been a creator&#39;s block. I have resolved to change this with a willingness to forego some sleep in the months to come and show more discipline and restraint in my outgoing nature ;)&lt;/p&gt;&#xA;&lt;p&gt;My writer&#39;s block in the last year is also a consequence of my reluctance to produce content for the WordPress platform I&#39;m using, which has proven quite painful to maintain over time. The plugins and hand-written glue that keeps some of the blog together is not holding as well as it used to anymore, and I&#39;m not able to fix all the issues in my spare time.&lt;/p&gt;&#xA;&lt;p&gt;It&#39;s more fun to create than to maintain in general.&lt;/p&gt;&#xA;&lt;p&gt;In this spirit, I want to come up with a new blog platform to run this blog on. Assuming that everything around is not fitting my peculiar taste, I will have to come up with something new from old parts. A Frankensteinian blogging system. My main idea is to actually use unit-testing and regression testing on the components and content of the blog to identify issues and maintain a consistent quality overall. In particular, content should stay static and not break in unexpected ways when adding new content that is intended to be orthogonal.&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Mon, 13 Jul 2015 21:48:34 +0000</pubDate>
    </item>
    <item>
      <title>Imitating PBRT-style literate programming in LaTeX</title>
      <link>http://blog.blackhc.net/2013/03/imitating-pbrt-style-literate-programming-in-latex/index.html</link>
      <description>&lt;p&gt;Today, I want to release another bit of code from my master&#39;s thesis. However, this time it won&#39;t be C++ code, instead I&#39;m going to release some LaTeX code which I used to display source code fragments with.&lt;/p&gt;&#xA;&lt;p&gt;Specifically the results look like this:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;/images/2013-03-24-imitating-pbrt-style-literate-programming-in-latex/fragmentexample.png&#34;&gt;&lt;img class=&#34;aligncenter size-medium wp-image-1125&#34; alt=&#34;fragmentexample&#34; src=&#34;/images/2013-03-24-imitating-pbrt-style-literate-programming-in-latex/fragmentexample-300x157.png&#34; width=&#34;300&#34; height=&#34;157&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;You can download the accompanying example PDF &lt;a href=&#34;https://raw.github.com/BlackHC/LaTeX-LiterateProgramming/master/examples.pdf&#34; target=&#34;_blank&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;This mirrors the style of &lt;a href=&#34;http://www.pbrt.org/&#34; target=&#34;_blank&#34;&gt;PBRT&lt;/a&gt;, which &lt;a href=&#34;http://books.google.de/books?id=9nJBAJhTxt8C&amp;amp;lpg=PA55&amp;amp;pg=PA57#v=onepage&amp;amp;q&amp;amp;f=false&#34; target=&#34;_blank&#34;&gt;uses&lt;/a&gt; literate programming to develop and explain an advanced raytracer. Only it doesn&#39;t require you to write source code that adheres to literal programming principles. I used it to take parts of the source code of my master&#39;s thesis and explain them.&lt;/p&gt;&#xA;&lt;p&gt;The following LaTeX code is used to create the fragment above:&lt;/p&gt;&#xA;&lt;pre class=&#34;latex&#34;&gt;&lt;code&gt;\defTaggedCurrentFileFragment&amp;lt;Another file fragment;recursive&amp;gt;+=&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;You can either inline code fragment using a special listing environment, or you can reference code fragments in an external file.&lt;/p&gt;&#xA;&lt;pre class=&#34;cpp&#34;&gt;&lt;code&gt;//&amp;lt;Another file fragment;recursive&amp;gt; =&#xA;int fac_r( int n ) {&#xA;    if( n &amp;lt;= 1 ) {&#xA;        return 1;&#xA;    }&#xA;    return n * fac_r( n - 1 );&#xA;}&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Cross-referencing is allowed as well and forward page references are created just like in PBRT. However, I have not figured out how to create backward references.&lt;/p&gt;&#xA;&lt;p&gt;You can find the &lt;a href=&#34;https://github.com/BlackHC/LaTeX-LiterateProgramming&#34; target=&#34;_blank&#34;&gt;LaTeX code on GitHub&lt;/a&gt;. I have not wrapped it into a LaTeX package because I don&#39;t consider it mature enough, but maybe someone finds it useful, and it eventually ends up in a package (that would be neat :)).&lt;/p&gt;&#xA;&lt;p&gt;To close, I want to say that the book &lt;a href=&#34;http://www.amazon.com/More-Math-Into-LaTeX-4th/dp/0387322892&#34; target=&#34;_blank&#34;&gt;More Math into LaTeX&lt;/a&gt;&lt;a href=&#34;#fn1&#34; class=&#34;footnoteRef&#34; id=&#34;fnref1&#34;&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt; has been very useful while creating these LaTeX macros. It is the first book that covers creating custom macros and commands understandable and in-depth. It feels good to finally understand a bit more about how you can customize LaTeX to fit your needs :)&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br /&gt;&#xA;  Andreas&lt;/p&gt;&#xA;&lt;section class=&#34;footnotes&#34;&gt;&#xA;&lt;hr /&gt;&#xA;&lt;ol&gt;&#xA;&lt;li id=&#34;fn1&#34;&gt;&lt;p&gt;See also &lt;a href=&#34;http://www.math.cornell.edu/~whieldon/Math224_files/More_Math_into_LaTex.pdf&#34; target=&#34;_blank&#34;&gt;http://www.math.cornell.edu/~whieldon/Math224_files/More_Math_into_LaTex.pdf&lt;/a&gt;.&lt;a href=&#34;#fnref1&#34;&gt;↩&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/section&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sun, 24 Mar 2013 23:19:44 +0000</pubDate>
    </item>
    <item>
      <title>Creative learning, Scratch and alternatives for learning how to create games</title>
      <link>http://blog.blackhc.net/2013/02/creative-learning-scratch-and-alternatives-for-learning-how-to-create-games/index.html</link>
      <description>&lt;p&gt;I&#39;m still working at university as a student researcher for the chair of software engineering in a very unconventional placement: I help prepare and teach courses about topics in computer science to pupils, usually age 12-16.&lt;/p&gt;&#xA;&lt;p&gt;My university&lt;a href=&#34;#fn1&#34; class=&#34;footnoteRef&#34; id=&#34;fnref1&#34;&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt; actually invests a lot of resources in promoting engineering degrees and applied sciences because the schools cannot. Schools here have only so many resources, and the computer science and mathematics curricula are mostly boring and uninteresting. For me, computer science is a lot about being creative and about identifying and solving problems. I&#39;m not sure I would have been interested in computer science that much if it had been just another subject like biology or geography.&lt;/p&gt;&#xA;&lt;p&gt;The courses we give are usually just one or two hours long for groups that visit our faculty, but we also have courses that last a whole day or two and cover topics in more detail. We usually choose topics that are more interesting than what you might learn at school and that show that computer science is not just about typing in code for hours without end but consists of analyzing real-world problems, devising algorithms and tinkering.&lt;/p&gt;&#xA;&lt;p&gt;Most pupils already know a bit about computer science, and some even know how to code a bit with Java, but they are always positively surprised when we work out together how to get out of a labyrinth&lt;a href=&#34;#fn2&#34; class=&#34;footnoteRef&#34; id=&#34;fnref2&#34;&gt;&lt;sup&gt;2&lt;/sup&gt;&lt;/a&gt;, how to come up with sorting algorithms, or how to encrypt messages easily with some binary magic &lt;a href=&#34;#fn3&#34; class=&#34;footnoteRef&#34; id=&#34;fnref3&#34;&gt;&lt;sup&gt;3&lt;/sup&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Right now I am tasked with updating and recreating a two-day course about creating games that was held two times in the last years. The original course was only intended for girls with no former coding experience and used Scratch as development tool.&lt;/p&gt;&#xA;&lt;p&gt;The updated version should be a bit more advanced and introduce more elements of game development properly to be both fun and educational. For this, I examined Scratch and alternatives to determine how to proceed. It ended up consuming a whole day and when I was done I had a beautiful mind map covering quite a number of different tools and frameworks. Having some spare time, I decided to write it all up in a blog post :)&lt;/p&gt;&#xA;&lt;h2 id=&#34;scratch&#34;&gt;&lt;a href=&#34;http://scratch.mit.edu/&#34;&gt;Scratch&lt;/a&gt;&lt;a href=&#34;/images/2013-02-28-creative-learning-scratch-and-alternatives-for-learning-how-to-create-games/scratch.jpeg&#34;&gt;&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Scratch is a programming language with an IDE that is targeted at young people who have never coded before. It has been developed by the &lt;a href=&#34;http://llk.media.mit.edu&#34;&gt;Lifelong Kindergarten group&lt;/a&gt; at the &lt;a href=&#34;http://www.media.mit.edu/&#34;&gt;MIT Media Lab&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/2013-02-28-creative-learning-scratch-and-alternatives-for-learning-how-to-create-games/scratch.jpeg&#34; alt=&#34;Scratch&#34; /&gt;&lt;figcaption&gt;&lt;a href=&#34;/images/2013-02-28-creative-learning-scratch-and-alternatives-for-learning-how-to-create-games/scratch-1024x643.jpeg&#34;&gt;Scratch&lt;/a&gt;&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;Coincidentally, I&#39;m participating in an online lecture they are offering right now: &lt;a href=&#34;http://learn.media.mit.edu/&#34;&gt;Learning creative learning&lt;/a&gt;. It is free and quite interesting---and Scratch is mentioned and discussed there as well.&lt;/p&gt;&#xA;&lt;p&gt;Scratch&#39;s user interface is very simple and intuitive to use. You can code programs without having to type code. Everything is based on blocks that can be dragged and dropped to create event-based behaviors. Users can draw their own sprites and animate them or easily import their own pictures and use them. Scratch has an active online community and it is easy to share your projects with others and get feedback, which encourages participation.&lt;/p&gt;&#xA;&lt;p&gt;However, a more experienced user quickly finds many limitations; for example, it is not possible:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;to create procedures, ie custom blocks, and the message sending blocks are too primitive to create really complex behaviors;&lt;/li&gt;&#xA;&lt;li&gt;to rename variables, which makes refactoring impossible;&lt;/li&gt;&#xA;&lt;li&gt;to change the sequence of statements easily; or&lt;/li&gt;&#xA;&lt;li&gt;to create new sprites (game objects) dynamically.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Moreover, I already found a &lt;a href=&#34;https://en.wikipedia.org/wiki/Heisenbug&#34;&gt;Heisenbug&lt;/a&gt;: I could not write a simple lock to keep an event script from being run multiple times that works at run-time---it only works as described in the docs during step debugging (at reduced script execution speed).&lt;/p&gt;&#xA;&lt;p&gt;Nonetheless, I consider it a very valuable tool that can be used to ease children into coding. The current 1.4 release needs to be installed on your computer, but they are working on a 2.0 release that will run entirely in the browser. You can give its beta a try &lt;a href=&#34;http://beta.scratch.mit.edu/projects/editor/&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Creating programs using drag and drop is a very nice idea and I really appreciate Scratch&#39;s user interface. And I&#39;m not the only one: Scratch has spawned many spin-offs that expand on its design. This has been possible because its source code has been released. You can find it &lt;a href=&#34;http://info.scratch.mit.edu/Source_Code&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I have also examined some Scratch spin-offs that &lt;a href=&#34;http://wiki.scratch.mit.edu/wiki/Alternatives_to_Scratch&#34;&gt;I have found&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;h2 id=&#34;snap&#34;&gt;&lt;a href=&#34;http://snap.berkeley.edu/&#34;&gt;Snap&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Snap (formerly called BYOB for Build Your Own Block) extends Scratch and adds support for custom blocks, first-class lists and procedures, and continuations. It becomes a lot more like a functional language this way. You can run it &lt;a href=&#34;http://byob.eecs.berkeley.edu/run&#34;&gt;here&lt;/a&gt;. The available documentation explains the new concepts very well. A German translation  is available for download, too. The last release is from 2011, so it might not be actively maintained anymore.&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/2013-02-28-creative-learning-scratch-and-alternatives-for-learning-how-to-create-games/snap.jpeg&#34; alt=&#34;snap&#34; /&gt;&lt;figcaption&gt;&lt;a href=&#34;/images/2013-02-28-creative-learning-scratch-and-alternatives-for-learning-how-to-create-games/snap-1024x719.jpeg&#34;&gt;snap&lt;/a&gt;&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;h2 id=&#34;starlogo-tng&#34;&gt;&lt;a href=&#34;http://education.mit.edu/projects/starlogo-tng&#34;&gt;StarLogo TNG&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;StarLogo TNG extends Scratch into 3D and has been developed at the MIT as well. It is targeted at multi-agent systems and older users. It is more complex and there are some interesting tutorials and workshops available online: &lt;a href=&#34;http://education.mit.edu/starlogo-tng/complexity/complexity_and_SLTNG1.html&#34;&gt;one&lt;/a&gt; shows how to build an ant population that knows how to pick up objects; and &lt;a href=&#34;http://education.mit.edu/webdav/Epidemic%20Model%20Building%20Tutorial/Epidemic_Model_Building_Tutorial.html&#34;&gt;another one&lt;/a&gt; shows how to develop an epidemic model.&lt;/p&gt;&#xA;&lt;h2 id=&#34;mit-app-inventor&#34;&gt;&lt;a href=&#34;http://appinventor.mit.edu/explore&#34;&gt;MIT App Inventor&lt;/a&gt; &lt;/h2&gt;&#xA;&lt;p&gt;MIT&#39;s App Inventor lets you build mobile apps easily using a Scratch-based programming interface. It supports a WYSIWYG UI editor as well. This used to be Google App Inventor apparently.&lt;/p&gt;&#xA;&lt;h2 id=&#34;gamefroot&#34;&gt;&lt;a href=&#34;http://gamefroot.com/&#34;&gt;GameFroot&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;GameFroot&#39;s editor looks pretty polished. It is browser-based, and it is very simple to create a side-scrolling platformer out of the box. However, scripts are not that important and most behavior is predefined. So it&#39;s probably not a good tool to tinker with. The games that have been created with it naturally look very similar.&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/2013-02-28-creative-learning-scratch-and-alternatives-for-learning-how-to-create-games/gamefroot.jpeg&#34; alt=&#34;GameFroot&#34; /&gt;&lt;figcaption&gt;&lt;a href=&#34;/images/2013-02-28-creative-learning-scratch-and-alternatives-for-learning-how-to-create-games/gamefroot-1024x525.jpeg&#34;&gt;GameFroot&lt;/a&gt;&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;h2 id=&#34;stencyl&#34;&gt;&lt;a href=&#34;http://www.stencyl.com&#34;&gt;Stencyl&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Stencyl is another game-creating tool, but it looks very mature and there is a pro version that is sold for 80-150 USD per year to publish your games to mobile devices and computers. The normal version only supports browser games. It is updated regularly but there is no localization support (yet).&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;http://static.stencyl.com/site/masterpiece1.jpg&#34; alt=&#34;Stencyl&#34; /&gt;&lt;figcaption&gt;&lt;a href=&#34;http://static.stencyl.com/site/masterpiece1.jpg&#34;&gt;Stencyl&lt;/a&gt;&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;The documentation is fairly complete, and it supports writing behavior scripts by using a Scratch-like interface, which supports custom procedures as well, or by writing JavaScript code.&lt;/p&gt;&#xA;&lt;p&gt;Lots of different games have been created with Stencyl. Here are some which I&#39;ve tried and which are really fun to play:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The Little Who&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://www.stencyl.com/game/play/17006&#34;&gt;&lt;img src=&#34;http://static.stencyl.com/games/t17006.png&#34; alt=&#34;The Little Who&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Balls in Space&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://www.stencyl.com/game/play/2008&#34;&gt;&lt;img src=&#34;http://static.stencyl.com/games/t2008.png&#34; alt=&#34;Balls in Space&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The Wish&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://www.stencyl.com/game/play/13846&#34;&gt;&lt;img src=&#34;http://static.stencyl.com/games/t13846.png&#34; alt=&#34;The Wish&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;I&#39;ve also looked at IDEs that are not based on Scratch.&lt;/p&gt;&#xA;&lt;h2 id=&#34;etoys&#34;&gt;&lt;a href=&#34;http://etoysillinois.org/&#34;&gt;Etoys&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Etoys is similar to Scratch but not as polished. However, it has been translated to many different languages. It also lacks the social community features which are so prominent in Scratch. Moreover, you cannot run projects in the browser straight-away because a special plugin has to be installed first. This all probably hinders its adaption.&lt;/p&gt;&#xA;&lt;p&gt;When you actually give it a go, you will be surprised by how nice it is. It feels very different to Scratch because it uses a unified workspace. There is no special script plane like in Scratch. Everything is part of the workspace. For example, when you look through the tutorials, you not only see an elastic ball bouncing, but you also see the special workspace frame that contains all different animation frames and the script code to assign them to the ball one after the other to emulate its deformation. This way you don&#39;t have to imagine anything. It&#39;s all there in the open for you to see---and debug if necessary.&lt;/p&gt;&#xA;&lt;p&gt;Sadly, there is not much documentation and for me it is not as intuitive as Scratch.&lt;/p&gt;&#xA;&lt;h2 id=&#34;alice&#34;&gt;&lt;a href=&#34;http://www.alice.org&#34;&gt;Alice&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Alice is is similar to Scratch and Etoys, only that Alice is using 3D scenes and is geared towards story telling. It&#39;s quite to big with over 600MB, but for this you get quality models to play around with. I can&#39;t say much about its features. There is not much documentation available online. You probably need to buy their book &amp;quot;&lt;a href=&#34;http://www.amazon.com/Learning-Program-Alice-ROM-3rd/dp/0132122472&#34;&gt;Learning to Program with Alice&lt;/a&gt;&amp;quot; to really learn more about it. I do not like this. However, there is some free stuff available. It is somewhat hidden, but here is a &lt;a href=&#34;http://www.cs.duke.edu/csed/alice09/&#34;&gt;link&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Again, you only code using drag and drop, but you can switch to a Java mode which makes the blocks look like their equivalent Java statements.&lt;/p&gt;&#xA;&lt;h2 id=&#34;greenfoot&#34;&gt;&lt;a href=&#34;http://www.greenfoot.org&#34;&gt;Greenfoot&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Greenfoot can be used to teach programming with Java in a game-oriented context. Programming is done in a normal text editor. Greenfoot displays a class hierarchy and allows you to place instances of actors in a 2D scene. You can then control them manually or subclass actors and override their methods.&lt;/p&gt;&#xA;&lt;p&gt;It&#39;s fairly basic but probably a good introduction to Java programming. If you start out with Scratch or Alice, it should be a small step from drag and drop coding to &amp;quot;real&amp;quot; coding.&lt;/p&gt;&#xA;&lt;h2 id=&#34;microsoft-smallbasic&#34;&gt;&lt;a href=&#34;http://smallbasic.com/&#34;&gt;Microsoft SmallBasic&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;I have learnt programming using good ol&#39; QBASIC on my parent&#39;s 386, so I wouldn&#39;t disagree with a Basic dialect as a first language. Microsoft gave it some love, and it looks polished. I&#39;m not sure how many are using it because there is no social community linked to it and the last release is from 2011. There is no specific support for creating games and the language is quite limited.&lt;/p&gt;&#xA;&lt;h2 id=&#34;microsoft-touchdevelop&#34;&gt;&lt;a href=&#34;https://www.touchdevelop.com/&#34;&gt;Microsoft TouchDevelop&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;This is really cool. Microsoft Research has a developed a fully fledged script language for mobile devices, so you can code using a touch-based interface. You can read more about it in the free online book &amp;quot;&lt;a href=&#34;https://www.touchdevelop.com/book&#34;&gt;touchdevelop - programming on the go&lt;/a&gt;&amp;quot;. Of course, it also runs in your browser and you can try it yourself :)&lt;/p&gt;&#xA;&lt;p&gt;I don&#39;t think it is the best choice for creating games, but you can certainly learn how to program with it by creating &amp;quot;serious&amp;quot; apps for your mobile device. Maybe this makes it interesting for adult beginners to programming.&lt;/p&gt;&#xA;&lt;p&gt;That&#39;s it for today.&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br /&gt;&#xA; Andreas&lt;/p&gt;&#xA;&lt;section class=&#34;footnotes&#34;&gt;&#xA;&lt;hr /&gt;&#xA;&lt;ol&gt;&#xA;&lt;li id=&#34;fn1&#34;&gt;&lt;p&gt;Technische Universität München, &lt;a href=&#34;http://www.in.tum.de&#34; class=&#34;uri&#34;&gt;http://www.in.tum.de&lt;/a&gt;&lt;a href=&#34;#fnref1&#34;&gt;↩&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li id=&#34;fn2&#34;&gt;&lt;p&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/Maze_solving_algorithm&#34;&gt;Maze solving algorithm&lt;/a&gt;&lt;a href=&#34;#fnref2&#34;&gt;↩&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li id=&#34;fn3&#34;&gt;&lt;p&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/XOR_cipher&#34;&gt;Xor cypher&lt;/a&gt;&lt;a href=&#34;#fnref3&#34;&gt;↩&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/section&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Thu, 28 Feb 2013 22:02:19 +0000</pubDate>
    </item>
    <item>
      <title>Al et WML</title>
      <link>http://blog.blackhc.net/2013/02/al-et-wml/index.html</link>
      <description>&lt;p&gt;First, I have created some new pages regarding old university projects. Among them is a condensed page about &lt;a href=&#34;http://blog.blackhc.net/projects/university/light-propagation-volumes/&#34;&gt;light propagation volumes&lt;/a&gt;, which also made me update the project files to Visual Studio 2012, a page about my bachelor thesis in mathematics (&lt;a href=&#34;http://blog.blackhc.net/projects/university/bsc-thesis-discrete-elastic-rods/&#34;&gt;Discrete Elastic Rods&lt;/a&gt;) and a page about my master thesis in computer science (&lt;a href=&#34;http://blog.blackhc.net/projects/university/msc-thesis-assisted-object-placement/&#34;&gt;Assisted Object Placement&lt;/a&gt;). I have not written about the latter two subjects before. Maybe I&#39;ll talk some more about them later and write a full post-mortem on them.&lt;/p&gt;&#xA;&lt;p&gt;This is the first of a number of posts that will be related to my master thesis, or rather code drops from its code base. I have written about 60k LoC in the 6 months of my master thesis and there are a few bits that might be useful in the future.&lt;/p&gt;&#xA;&lt;p&gt;The first one that I want to talk about is a very simple file format I came up with. Devising new text file formats is not something that I have been very keen about lately. Especially not as some many already exist. However, I have found none which has really fit my requirements:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;minimal clutter (preferably indentation-based),&lt;/li&gt;&#xA;&lt;li&gt;support for raw text inclusion, and&lt;/li&gt;&#xA;&lt;li&gt;good C++ support.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://en.wikipedia.org/wiki/JSON&#34;&gt;JSON&lt;/a&gt; has too much clutter and doesn&#39;t support raw text. &lt;a href=&#34;http://en.wikipedia.org/wiki/YAML&#34;&gt;YAML&lt;/a&gt;, on the other hand, sounds like the perfect choice, even though it&#39;s not that easy to find a good library for it. However, when it comes to raw text, you run into the issue that tab characters are never allowed as indentation. Moreover, I was not very happy with the API choices and some bugs in the libraries that I tried to use.&lt;/p&gt;&#xA;&lt;p&gt;So I decided to develop a very simple text-based data storage format:&lt;/p&gt;&#xA;&lt;h2 id=&#34;wml---whitespace-markup-language&#34;&gt;WML - Whitespace Markup Language&lt;/h2&gt;&#xA;&lt;p&gt;I&#39;ll just start with an example, ie my readme. You can find the full readme &lt;a href=&#34;https://github.com/BlackHC/WML/blob/master/doc/readme.txt&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;&amp;#39;Whitespace Markup Language&amp;#39;:&#xA;&#xA;    Aims::&#xA;        * very simple&#xA;        * no clutter while writing&#xA;        * only indentation counts&#xA;        * empty lines have no meaning&#xA;        * embedding text is easy&#xA;        * everything is a map internally&#xA;&#xA;&#xA;    Example:&#xA;&#xA;        title       &amp;quot;test\t\t1&amp;quot;&#xA;        path        &amp;#39;c:\unescaped.txt&amp;#39;&#xA;        version     1&#xA;&#xA;        content::&#xA;            unformated text&#xA;&#xA;            newlines count here&#xA;&#xA;        properties:&#xA;            time-changed    10:47am&#xA;            flags   archive system hidden&#xA;&#xA;        streams:&#xA;            stream:&#xA;                data::&#xA;                    some data&#xA;&#xA;                    this is nested too&#xA;                flags:&#xA;                    read&#xA;                    write&#xA;                    execute&#xA;&#xA;            stream:&#xA;                data::&#xA;                    key names&#xA;                    dont have to&#xA;                    be unique (see stream)&#xA;                flags:&#xA;                    read&#xA;                    write:&#xA;                        users   andreas root&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;As you can see, it is a whitespace-based format inspired by Python. Like in Python, indentation is used to convey structure. A WML file represents a map structure: every node has a name and possibly multiple children. A node definition in a WML file either contains the node name first and then multiple children names (which won&#39;t have any children themselves), the node name followed by one colon to signify that a nested definition follows (similar to JSON), or the node name followed by two colons to signify a raw text block. Two different kinds of strings are supported: single-quoted raw strings that do not interpret escape sequences, and double-quoted C strings that support escape sequences.&lt;/p&gt;&#xA;&lt;p&gt;All in all, the grammar is very simple:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;Grammar::&#xA;    INDENT, DEINDENT are virtual tokens that control the indentation level&#xA;    NEWLINE is a line break&#xA;&#xA;    Indentation is done with tabs only at the moment.&#xA;&#xA;    Here is a rough EBNF syntax for WML:&#xA;&#xA;    root: map&#xA;&#xA;    value: identifier | unescaped_string | escaped_string&#xA;&#xA;    identifier: (!whitespace)+&#xA;    unescaped_string: &amp;#39;\&amp;#39;&amp;#39; (!&amp;#39;\&amp;#39;&amp;#39;)* &amp;#39;\&amp;#39;&amp;#39;&#xA;    escaped_string: &amp;#39;&amp;quot;&amp;#39; (!&amp;quot;\&amp;quot;&amp;quot;)* &amp;#39;&amp;quot;&amp;#39; with support for \t, \n, \\, \&amp;#39;, and \&amp;quot;&#xA;&#xA;    key: value&#xA;&#xA;    map: map_entry*&#xA;&#xA;    map_entry: inline_entry | block_entry&#xA;&#xA;    inline_entry: key value+ NEWLINE&#xA;    block_entry: key &amp;#39;:&amp;#39; ( &amp;#39;:&amp;#39; NEWLINE INDENT textblock DEINDENT | NEWLINE INDENT non-empty map DEINDENT )&#xA;&#xA;Note::&#xA;    This file is itself a WML file and root[&amp;quot;Whitespace Markup Language&amp;quot;][&amp;quot;Example&amp;quot;].data() is the example WML node&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I&#39;ve used this format for custom shaders as well as for my settings files and the declaration files of my test scenes:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;boxes:&#xA;    -:&#xA;        name &amp;#39;platform, brown&amp;#39;&#xA;        size 20 2 20&#xA;        webColor 945412&#xA;    -:&#xA;        name &amp;#39;platform, green&amp;#39;&#xA;        size 20 2 20&#xA;        webColor 129429&#xA;    -:&#xA;        name &amp;#39;platform, muddy blue&amp;#39;&#xA;        size 20 2 20&#xA;        webColor 6488a5&#xA;    -:&#xA;        name &amp;#39;platform, light blue&amp;#39;&#xA;        size 20 2 20&#xA;        webColor e5eaf1&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I&#39;ve uploaded the current code for WML to GitHub, and you can find the code &lt;a href=&#34;https://github.com/BlackHC/WML&#34;&gt;here&lt;/a&gt;. The API supports an overloaded index operator to access children of a node and contains both a parser and an emitter for WML.&lt;/p&gt;&#xA;&lt;h2 id=&#34;afterthoughts&#34;&gt;Afterthoughts&lt;/h2&gt;&#xA;&lt;p&gt;First, the current API isn&#39;t brilliant. It would be nice to separate the data model from the parser and emitter by using templates and type traits to improve abstraction. I think I might go and investigate different API types in the future and see which one works best for some simple cases.&lt;/p&gt;&#xA;&lt;p&gt;Second, it would be possible to reduce clutter even more and remove the need for single colons to denote nested maps. A even simpler format could look like this:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;nodeA&#xA;    nodeB nodeC nodeD&#xA;        nodeE&#xA;        nodeF&#xA;    nodeG:&#xA;        raw data&#xA;            with fixed indentation&#xA;&#xA;        would be interpreted as &amp;quot;raw data\n\twith fixed intendation\n...&amp;quot;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This would yield the following JSON-equivalent:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;{ &amp;quot;nodeA&amp;quot;: { &amp;quot;nodeB&amp;quot;: {} , &amp;quot;nodeC&amp;quot;: {} , &amp;quot;nodeD&amp;quot;: {}, &amp;quot;nodeE&amp;quot;: {}, &amp;quot;nodeF&amp;quot;: {}, &amp;quot;nodeG&amp;quot;: { &amp;quot;raw data...&amp;quot; : {} } } }&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This still separates raw text from normal data. A node that contains raw text can never contain other children this way. However, I cannot think of a good way to accomplish that without introducing a special character to end a raw text block.&lt;/p&gt;&#xA;&lt;p&gt;That&#39;s it for now :)&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Tue, 26 Feb 2013 01:45:10 +0000</pubDate>
    </item>
    <item>
      <title>Unity Prototype Project</title>
      <link>http://blog.blackhc.net/2013/02/unity-prototype-project/index.html</link>
      <description>&lt;p&gt;For the last two days I&#39;ve tried out the &lt;a href=&#34;http://unity3d.com/&#34;&gt;Unity engine&lt;/a&gt; with a friend from university, Andreas Ostermaier. If you don&#39;t know the Unity engine, go and check it out.&lt;/p&gt;&#xA;&lt;p&gt;Its design is very similar to &lt;a href=&#34;http://www.garagegames.com/products/torque-2d&#34;&gt;Torque 2D&lt;/a&gt;. I can&#39;t tell who used it first, but Unity&#39;s design is more mature than what I remember from Torque 2D 1.3 back when I was still using it in 2007. A scene is made up of game objects. A game object is a container of components (also called behaviors)&lt;a href=&#34;#fn1&#34; class=&#34;footnoteRef&#34; id=&#34;fnref1&#34;&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt;. A game object always contains a Transform component which places it in the scene (and in the scene hierarchy). Usually, it contains a Mesh component and a Physics component for handling rendering and collision detection. But sometimes empty game objects are useful as well: as respawn points for example. Custom scripts, written in JavaScript or C#, can be wrapped in a Script component and tied to game objects in the same way.&lt;/p&gt;&#xA;&lt;p&gt;Templates/prototype objects&lt;a href=&#34;#fn2&#34; class=&#34;footnoteRef&#34; id=&#34;fnref2&#34;&gt;&lt;sup&gt;2&lt;/sup&gt;&lt;/a&gt;, called prefabs, are used to avoid creating all game objects by hand. Instances of a prefab link back to the prefab, that is the original object, and automatically inherit changes to it (or the children in its hierarchy). Torque 2D 1.3 lacked this feature: GarageGames had an editor plugin in development when I was doing contract work for them but I&#39;m not sure it has ever been released.&lt;/p&gt;&#xA;&lt;p&gt;We have spent the last two days implementing a PoC for a game idea my friend came up with. The idea is about being able to switch between 2D and 3D in a platformer to solve puzzles. It is about reinterpreting a level when it is seen from a 2D perspective. For example, two separate tiles above an acid pool that cannot be reached by jumping from one to the other can suddenly be connected by switching to 2D because they look connected.&lt;/p&gt;&#xA;&lt;p&gt;&lt;bs-carousel class=&#34;img-responsive&#34;&gt; &lt;img src=&#34;/images/overflow/2013/02/Screenshot-10_02_2013-14_10_42-e1360503983882.png&#34; style=&#34;width:100%;&#34;&gt;&lt;span class=&#34;label label-default&#34;&gt;PoCDimRunner 3D&lt;/span&gt; &lt;img src=&#34;/images/overflow/2013/02/Screenshot-10_02_2013-14_12_58-e1360504030554.png&#34; style=&#34;width:100%;&#34;&gt;&lt;span class=&#34;label label-default&#34;&gt;PoCDimRunner 2D&lt;/span&gt; &lt;/bs-carousel&gt;&amp;gt;&lt;/p&gt;&#xA;&lt;p&gt;You can play the PoC build &lt;a href=&#34;http://data.blog.blackhc.net/2013/02/PoCDimRunner_WebPlayer.html&#34;&gt;here&lt;/a&gt;, using Unity&#39;s webplayer, or download it &lt;a href=&#34;http://data.blog.blackhc.net/2013/02/PoCDimRunner.zip&#34;&gt;here&lt;/a&gt; in a .zip archive. Use the left mouse button or &#39;c&#39; to switch between 2D and 3D.&lt;/p&gt;&#xA;&lt;p&gt;There are a few games that are similar to this idea: &lt;a href=&#34;http://en.wikipedia.org/wiki/Echochrome&#34;&gt;Echochrome&lt;/a&gt;, &lt;a href=&#34;http://en.wikipedia.org/wiki/Super_Paper_Mario&#34;&gt;Super Paper Mario&lt;/a&gt;, and &lt;a href=&#34;http://www.youtube.com/watch?v=0jHgHUgP11w&#34;&gt;Crush&lt;/a&gt; (and its sequel &lt;a href=&#34;http://www.youtube.com/watch?v=3ff_MiN-AVM&#34;&gt;Crush 3D&lt;/a&gt;).&lt;/p&gt;&#xA;&lt;p&gt;You can find the code on GitHub (ie &lt;a href=&#34;https://github.com/BlackHC/UnityDimRunner&#34;&gt;here&lt;/a&gt;).&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br /&gt;&#xA; Andreas&lt;/p&gt;&#xA;&lt;section class=&#34;footnotes&#34;&gt;&#xA;&lt;hr /&gt;&#xA;&lt;ol&gt;&#xA;&lt;li id=&#34;fn1&#34;&gt;&lt;p&gt;See eg &lt;a href=&#34;http://gameprogrammingpatterns.com/component.html&#34;&gt;here&lt;/a&gt;, &lt;a href=&#34;http://www.gdcvault.com/play/1911/Theory-and-Practice-of-the&#34;&gt;here&lt;/a&gt;, and &lt;a href=&#34;http://stackoverflow.com/questions/1901251/component-based-game-engine-design&#34;&gt;here&lt;/a&gt; for an overview.&lt;a href=&#34;#fnref1&#34;&gt;↩&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li id=&#34;fn2&#34;&gt;&lt;p&gt;See &lt;a href=&#34;http://en.wikipedia.org/wiki/Prototype_pattern&#34; class=&#34;uri&#34;&gt;http://en.wikipedia.org/wiki/Prototype_pattern&lt;/a&gt;[[2]]&lt;a href=&#34;#fnref2&#34;&gt;↩&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/section&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Wed, 06 Feb 2013 12:48:17 +0000</pubDate>
    </item>
    <item>
      <title>Presentation (seminar) about convex analysis</title>
      <link>http://blog.blackhc.net/2012/09/presentation-seminar-about-convex-analysis/index.html</link>
      <description>&lt;p&gt;Last year (yes, I&#39;m really slow with writing things up &amp;quot;lately&amp;quot;) I did a presentation about convex analysis as part of a seminar about inverse problems in imaging.&lt;/p&gt;&#xA;&lt;p&gt;I want to write about it today.&lt;/p&gt;&#xA;&lt;p&gt;The seminar was based on the book &#39;&lt;a href=&#34;http://www.amazon.com/Handbook-Mathematical-Methods-Springer-Reference/dp/0387929193/ref=sr_1_1?s=books&amp;amp;ie=UTF8&amp;amp;qid=1348325001&amp;amp;sr=1-1&amp;amp;keywords=0387929193&#34;&gt;Handbook of Mathematical Methods in Imaging (Springer Reference)&lt;/a&gt;&#39;. It&#39;s very expensive and, in my opinion, pretty useless to learn about any details. At least the chapter about duality and convex programming was very dense and you could not learn anything from it without consulting other book.&lt;/p&gt;&#xA;&lt;p&gt;The presentation was supposed to give an overview over duality and convex analysis and serve as introduction. Summarzing 42 very concise pages in 45 minutes is impossible, so I had to choose a few topics that give an overview over the important concepts and go into detail there.&lt;/p&gt;&#xA;&lt;p&gt;The book itself does not really contain many proofs which makes it hard to follow. As a mathematician I like proofs. They help clear things up usually and they can give valuable insight into the methods of a theory when they&#39;re good.&lt;/p&gt;&#xA;&lt;p&gt;But proofs suck when you see them on powerpoint slides. They also suck when you&#39;re the presenter.&lt;/p&gt;&#xA;&lt;p&gt;So I gave a blackboard presentation---using a few slides only to show some pictures and sketches which I could not draw well enough on a blackboard.&lt;/p&gt;&#xA;&lt;p&gt;To prepare the presentation I used OneNote and my Bamboo tablet. I scribbled all down over a weekend in one OneNote notebook and later extracted some sketches into another notebook that I used instead of a PowerPoint presentation. I exported the original notes as PDF and used this as handout after the presentation.&lt;/p&gt;&#xA;&lt;p&gt;The presentation was alright. I had fun writing everything down on the blackboard and developing the subset of the theory I wanted to present, and the audience was content with it, too, because it was just at the right speed and like a lecture everybody was used, too.&lt;/p&gt;&#xA;&lt;p&gt;In retrospect I can say that using OneNote and a tablet to create a blackboard presentation was the best decision. I don&#39;t want to think of the time I would have lost if I had created everything with LaTeX or PowerPoint.&lt;/p&gt;&#xA;&lt;p&gt;Long story short: &lt;a href=&#34;http://data.blog.blackhc.net/2012/09/CA.pdf&#34;&gt;here are my notes&lt;/a&gt; :)&lt;/p&gt;&#xA;&lt;p&gt;Cheers, Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sat, 29 Sep 2012 16:19:17 +0000</pubDate>
    </item>
    <item>
      <title>Molecular Dynamics and CUDA---my interdisciplinary project</title>
      <link>http://blog.blackhc.net/2012/04/molecular-dynamics-and-cuda-my-interdisciplinary-project/index.html</link>
      <description>&lt;p&gt;You have to do a interdisciplinary project for your Master&#39;s degree at the Technische Universität München. I decided to do it at the Chair for Scientific Computing.&lt;/p&gt;&#xA;&lt;p&gt;My topic was the &lt;strong&gt;&lt;em&gt;Efficient Implementation of Multi-Center Potential Models in Molecular Dynamics with CUDA&lt;/em&gt;&lt;/strong&gt;. For this, I have parallelized the molecule interaction calculations in the molecular dynamics simulator MarDyn with CUDA, optimized the code, and added support for more advanced potential models on the GPU.&lt;/p&gt;&#xA;&lt;h4 id=&#34;what-is-molecular-dynamics&#34;&gt;What is molecular dynamics?&lt;/h4&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://en.wikipedia.org/wiki/Molecular_dynamics&#34;&gt;Molecular dynamics&lt;/a&gt; deals with the simulation of atoms and molecules. It estimates the interaction between a high number of molecules and atoms using force fields which are modeled using quantum mechanics equations.&lt;/p&gt;&#xA;&lt;p&gt;Such simulations are important for many different areas in biology, chemistry and material sciences. For example you can examine the folding of proteins or the nanoscopic behavior of materials. The simulations are sped up using sophisticated approximations and algorithms.&lt;/p&gt;&#xA;&lt;p&gt;Molecules only have strong force interactions with molecules that are nearby. One of the first approximations is to take into account these strong interactions only and ignore weaker long-distance ones. This space locality of the calculations leads to the &lt;a href=&#34;http://en.wikipedia.org/wiki/Cell_lists&#34;&gt;Linked Cell-algorithm&lt;/a&gt;. It divides the simulation space into a grid of cells and only interactions between molecules inside each cell and with nearby cells are calculated.&lt;/p&gt;&#xA;&lt;p&gt;Molecules are composed of atoms which interact using different physical principles. This is approximated by having different &lt;strong&gt;&lt;em&gt;sites&lt;/em&gt;&lt;/strong&gt; in a molecule that use different &lt;strong&gt;&lt;em&gt;potential models&lt;/em&gt;&lt;/strong&gt;. The most common and simplest potential model is the &lt;em&gt;&lt;strong&gt;&lt;a href=&#34;http://en.wikipedia.org/wiki/Lennard-Jones_potential&#34;&gt;Lennard-Jones potential&lt;/a&gt;&lt;/strong&gt;&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;h4 id=&#34;what-is-mardyn&#34;&gt;What is MarDyn?&lt;/h4&gt;&#xA;&lt;p&gt;MarDyn is a molecular dynamics simulator that has been developed at the Technische Universität München. See &lt;a href=&#34;http://www5.in.tum.de/pub/buchholz_dissertation10.pdf&#34;&gt;Martin Buchholz&#39;s thesis&lt;/a&gt; for more information.&lt;/p&gt;&#xA;&lt;p&gt;Its code is rather ugly and it features some crazy design decisions. I have been told that the people who were initially developing it where learning how to code in C++ at the same time---and it shows :(&lt;/p&gt;&#xA;&lt;h4 id=&#34;previous-work&#34;&gt;Previous work&lt;/h4&gt;&#xA;&lt;p&gt;When I started, there was a &#39;working&#39; implementation of Lennard-Jones potentials for molecules with only one site on the GPU. It used OpenCL and was the result from somebody else&#39;s IDP. However, it was not very useful: the code was crammed into one function and one letter variable names were used through-out.&lt;/p&gt;&#xA;&lt;h4 id=&#34;the-main-aims-of-the-project&#34;&gt;The main aims of the project&lt;/h4&gt;&#xA;&lt;p&gt;The idea was to port the previous OpenCL implementation to CUDA and continue from there to add support for multiple sites with different potential models.&lt;/p&gt;&#xA;&lt;h4 id=&#34;chronology-of-my-work&#34;&gt;Chronology of my work&lt;/h4&gt;&#xA;&lt;p&gt;Porting the code to CUDA was a straight-forward API change. However, I found the original code to be impossible to read, maintain, and optimize. The logic behind the code was not clear or well explained.&lt;/p&gt;&#xA;&lt;p&gt;Consequently my supervisor and I decided that I would rewrite everything and optimize it from the beginning. This took longer than expected and while the resulting parallelism and the logic behind it were clear in the code, code complexity was an issue. The code consisted of three helper functions and two kernel functions in two files and when I went and integrated support for multiple sites and potential models, it became clear that the current design was not clear enough to endure further feature additions and lacked the flexibility for quick changes.&lt;/p&gt;&#xA;&lt;p&gt;Treating the old implementation as a prototype and knowing about many possible traps and fallacies, I set out and rewrote everything again. This time the focus was on modularity and separation of concerns instead of performance. Code architecture was the most important thing this time around. I scaffolded the new version around the old code, which was working correctly and already optimized. I embedded it into the new design step by step. Afterwards I optimized the code.&lt;/p&gt;&#xA;&lt;h4 id=&#34;what-ive-done&#34;&gt;What I&#39;ve done&lt;/h4&gt;&#xA;&lt;p&gt;I&#39;ve:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;worked with CUDA 1.x and 2.x,&lt;/li&gt;&#xA;&lt;li&gt;used both the driver and the runtime API,&lt;/li&gt;&#xA;&lt;li&gt;implemented a template-based, very modular code design,&lt;/li&gt;&#xA;&lt;li&gt;tried lots of optimizations, and&lt;/li&gt;&#xA;&lt;li&gt;learnt how to read PTX to find work-arounds for compiler bugs.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Sadly some of the optimizations didn&#39;t improve the performance noticeably. I think the monolithic, all-in-one approach I&#39;ve used is the main issue.&lt;/p&gt;&#xA;&lt;p&gt;My code uses the driver API, because it would be easy to dump all the CUDA calls and replay them later for debugging purposes.&lt;/p&gt;&#xA;&lt;p&gt;If I could iterate over the code one more time, I&#39;d try to use many small kernels instead of only two rather large ones. Currently the kernels sequentially calculate all potential models for the molecule pair that are needed (for each site). This makes it difficult to measure performance improvements and isolate bottlenecks. And I suspect it&#39;s slower than it has to be.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;d also create a sandbox application to test and develop the kernels instead of using MarDyn as starting point, because it is unnecessarily huge and it is not really needed to verify that the CUDA code works (or not).&lt;/p&gt;&#xA;&lt;h4 id=&#34;final-paper-code&#34;&gt;Final paper &amp;amp; code&lt;/h4&gt;&#xA;&lt;p&gt;You can find the final paper that contains a description of my code and the performance results &lt;a href=&#34;http://data.blog.blackhc.net/2012/04/idp_paper.pdf&#34;&gt;here&lt;/a&gt;, and my code &lt;a href=&#34;http://data.blog.blackhc.net/2012/04/final_cuda_code.zip&#34;&gt;here&lt;/a&gt; (I cannot include MarDyn&#39;s code because its source is closed, but at least I can share my code).&lt;/p&gt;&#xA;&lt;h4 id=&#34;alternatives&#34;&gt;Alternatives&lt;/h4&gt;&#xA;&lt;p&gt;I just want to share two more links:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://codeblue.umich.edu/hoomd-blue/about.html&#34;&gt;HOOMD-blue&lt;/a&gt; is a molecular dynamics framework, which uses CUDA, too, and the code design looks what I probably should have done :)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.ks.uiuc.edu/Research/vmd/&#34;&gt;VMD&lt;/a&gt; is a molecular visualization application, which looks promising, too&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Cheers,&lt;br /&gt;&#xA; Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Mon, 16 Apr 2012 12:49:10 +0000</pubDate>
    </item>
    <item>
      <title>A Long Journey: Acceler8 and TBB</title>
      <link>http://blog.blackhc.net/2011/11/a-long-journey-acceler8-and-tbb/index.html</link>
      <description>&lt;p&gt;A month has passed with &lt;a href=&#34;http://software.intel.com/fr-fr/articles/Acceler8EN/&#34;&gt;Intel&#39;s Acceler8 competition&lt;/a&gt; and it has finally come to an end. It&#39;s been a long way from implementing the first sequential algorithm to having a fully-fledged parallel version.&lt;/p&gt;&#xA;&lt;p&gt;I have never worked with Intel&#39;s Threading Building Block library before and it was a nice opportunity to examine it, since it offered a better abstraction than OpenMP or pthreads.&lt;/p&gt;&#xA;&lt;p&gt;The documentation is very good and you quickly learn how to work with the library. One of the caveats is that I didn&#39;t have to use a low-level synchronization construct once in the development and everything worked fine without any race conditions or similar . The &lt;code&gt;parallel_*&lt;/code&gt; functions (eg &lt;code&gt;parallel_for&lt;/code&gt;, &lt;code&gt;parallel_reduce&lt;/code&gt;, and &lt;code&gt;parallel_scan&lt;/code&gt;) together with &lt;strong&gt;icc&lt;/strong&gt;&#39;s C++0x support (lambda functions) allowed for very concise code and little programming overhead.&lt;/p&gt;&#xA;&lt;p&gt;The implementation builds on Kadane&#39;s algorithm for the two dimensional case using prefix sums. One implementation that gets across the basic idea can be found &lt;a href=&#34;http://input-output.org/2010/01/27/maximum-subarray-sum-problem--in-2d&#34;&gt;here&lt;/a&gt;. Mine is similar and I simply parallelized as much as possible.&lt;/p&gt;&#xA;&lt;p&gt;As you can see the outer two loops iterate over a two-dimensional range that is pretty much an upper right triangle of the whole possible domain. For this I&#39;ve implemented a custom &lt;code&gt;range&lt;/code&gt; that allows for better load balancing. A range in TBB defines an iteration range of any kind and supports a &lt;code&gt;split&lt;/code&gt; operation that is used internally by the task scheduler to distribute the range dynamically on multiple threads as it sees fit.&lt;/p&gt;&#xA;&lt;p&gt;Last but not least I came up with a way to parallelize the 1D part of Kadane&#39;s algorithm that is being used by splitting the column range into linear subranges and merging the subsolutions into one solution, ie a classical divide and conquer approach.&lt;/p&gt;&#xA;&lt;p&gt;Because it&#39;s the most abstract yet interesting part of our implementation, I&#39;m going to go into more detail here. :-)&lt;/p&gt;&#xA;&lt;p&gt;How can you find the maximum subarray of a 1D array, if you know the maximum subarray of the two &amp;quot;halves&amp;quot; (they don&#39;t have to be split evenly)? Well, you don&#39;t, you need more information.&lt;/p&gt;&#xA;&lt;p&gt;We calculate the following information for each chunk:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;maximum subarray that starts at the beginning of the chunk&lt;/li&gt;&#xA;&lt;li&gt;maximum subarray that ends at the end of the chunk&lt;/li&gt;&#xA;&lt;li&gt;total sum&lt;/li&gt;&#xA;&lt;li&gt;maximum subarray&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;It&#39;s easy to figure out how to merge these values for two neighboring chunks into the values of the merged chunk. The merged maximum subarray that starts at the beginning of the merged chunk is either said value for the left chunk or the total sum of the left chunk + that value of the right chunk. You can figure out how it works for the maximum subarray that ends at the end of the merged chunk :-) The maximum subarray is just the biggest of all merged values or the left maximum subarray or right one.&lt;/p&gt;&#xA;&lt;p&gt;Using this idea you can use a simple &lt;code&gt;parallel_reduce&lt;/code&gt; to parallelize Kadane&#39;s algorithm.&lt;/p&gt;&#xA;&lt;p&gt;Of course, there is some overhead but for the right problem sizes this will be faster than the sequential algorithm as always.&lt;/p&gt;&#xA;&lt;p&gt;Two more take-aways:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Always try to use language features like templates or lambda expressions to reduce duplicate code or make the code more concise.&lt;/li&gt;&#xA;&lt;li&gt;Write unit tests. I have used &lt;a href=&#34;http://code.google.com/p/googletest/&#34;&gt;googletest&lt;/a&gt; which is a very small but very capable library, and it has spared me a lot of debugging trouble.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Cheers :-)&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Wed, 16 Nov 2011 22:40:13 +0000</pubDate>
    </item>
    <item>
      <title>Reading Nonfiction Books Quickly</title>
      <link>http://blog.blackhc.net/2011/11/reading-nonfiction-books-quickly/index.html</link>
      <description>&lt;p&gt;I like to read books and I also like to read nonfiction books and in particular nonfiction books that I do not agree with.&lt;/p&gt;&#xA;&lt;h6 id=&#34;speed-reading&#34;&gt;Speed Reading&lt;/h6&gt;&#xA;&lt;p&gt;For this I&#39;ve decided to look into &lt;strong&gt;&lt;a href=&#34;http://en.wikipedia.org/wiki/Speed_reading&#34;&gt;speed reading&lt;/a&gt;&lt;/strong&gt;. It is an umbrella term for methods that increase your reading speed while keeping a satisfactory comprehension level. A usual reading speed is 200-300 wpm (words per minute). Speed reading advertises increasing your speed to &amp;gt; 600 wpm.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve searched around for a bit and read lots of blog posts and articles and here are my favorites:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://www.fourhourworkweek.com/blog/2009/07/30/speed-reading-and-accelerated-learning/&#34; class=&#34;uri&#34;&gt;http://www.fourhourworkweek.com/blog/2009/07/30/speed-reading-and-accelerated-learning/&lt;/a&gt; is a good introduction to the main techniques of speed-reading. It also includes some exercises and is a short read.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://noahfleming.com/blog/speed-read-like-rain-man-75-increased-reading-speed-in-20-minutes&#34; class=&#34;uri&#34;&gt;http://noahfleming.com/blog/speed-read-like-rain-man-75-increased-reading-speed-in-20-minutes&lt;/a&gt; describes the author&#39;s personal experience with fourhourworkweek&#39;s article.&lt;/p&gt;&#xA;&lt;p&gt;There is also speed-reading software available. The idea is your eye movement is the main hindrance to reading really fast, so this software displays the text for you to read in groups of several words in the center of the screen. This way you can read everything at once without having to move your eyes at all. As crazy as it sounds, it works to a great degree.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://www.spreeder.com/&#34; class=&#34;uri&#34;&gt;http://www.spreeder.com/&lt;/a&gt; is  an online reader that works this way. Give it a try! You can make it display the introduction text at 600 wpm or 800 wpm and see how you&#39;ll understand - you&#39;ll be surprised!&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://numberstheorys.tripod.com/speedreading.pdf&#34;&gt;&#39;The Speed Reading Workbook&#39;&lt;/a&gt; is what I&#39;ve been using to practise it. It&#39;s okay written and has plenty of exercises and includes timing and evaluation sheets, which are really useful for measuring your progress.&lt;/p&gt;&#xA;&lt;p&gt;A good summary of many concepts can be found in the PowerPoint Presentation &lt;a href=&#34;http://www.cs.unc.edu/~jjerald/classes/comp321/SpeedRead.ppt&#34;&gt;&#39;Double your Reading Speed in 25 Minutes&#39;&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h5 id=&#34;about-reading-in-general&#34;&gt;About Reading in General&lt;/h5&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://www.matthewcornell.org/blog/2006/2/26/how-to-read-a-lot-of-books-in-a-short-time.html&#34; class=&#34;uri&#34;&gt;http://www.matthewcornell.org/blog/2006/2/26/how-to-read-a-lot-of-books-in-a-short-time.html&lt;/a&gt; is a good read and &lt;a href=&#34;http://pne.people.si.umich.edu/PDF/howtoread.pdf&#34; class=&#34;uri&#34;&gt;http://pne.people.si.umich.edu/PDF/howtoread.pdf&lt;/a&gt; has many good suggestions about how to increase your reading productivity.&lt;/p&gt;&#xA;&lt;h5 id=&#34;own-expierence&#34;&gt;Own Expierence&lt;/h5&gt;&#xA;&lt;p&gt;I&#39;ve been exercising with the workbook now and then for the past weeks and I&#39;ve become faster but this is still an ongoing process for me, so I&#39;m going to blog about it later (or rather update this post).&lt;/p&gt;&#xA;&lt;p&gt;For what it&#39;s worth: my reading speed was 300 wpm and now it is around 550 wpm :-)&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Wed, 02 Nov 2011 13:56:29 +0000</pubDate>
    </item>
    <item>
      <title>Presentation Advice</title>
      <link>http://blog.blackhc.net/2011/08/presentation-advice/index.html</link>
      <description>&lt;p&gt;So.. the summer term has passed and I&#39;m wrapping things up and one of the final things I want to get out of my notebooks into this blog are some notes I took for feedback during my Hauptseminar in my maths studies.&lt;/p&gt;&#xA;&lt;p&gt;Everybody had to do a 60 minutes presentation and the audience was asked to take notes about the presentation style to give feedback later (in addition to paying attention to the presentations).&lt;/p&gt;&#xA;&lt;p&gt;There were 4 blackboards in the room and a beamer.&lt;/p&gt;&#xA;&lt;p&gt;Here are my notes:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;4 pages are the most you can do in 60 minutes (ie write down on the blackboard)&lt;/li&gt;&#xA;&lt;li&gt;really think about your audience and what you want them to take away and focus on that in your presentation&lt;/li&gt;&#xA;&lt;li&gt;practice your presentation a few times before your big day&lt;/li&gt;&#xA;&lt;li&gt;if you use formal mathematical symbolism to express an idea, make sure all symbols and variables are properly defined/explained (for it to make sense!)&lt;/li&gt;&#xA;&lt;li&gt;never tell people to &amp;quot;only ask questions at the end because it would disturb your presentation&amp;quot;!&lt;/li&gt;&#xA;&lt;li&gt;focus on important concepts and ideas&lt;/li&gt;&#xA;&lt;li&gt;motivate definitions and formulas - prefer an algorithmic view on things&lt;/li&gt;&#xA;&lt;li&gt;try to use images and graphs to visualize ideas&lt;/li&gt;&#xA;&lt;li&gt;if you can&#39;t avoid complex definitions and deductions, use a handout&lt;/li&gt;&#xA;&lt;li&gt;make sure the handout doesn&#39;t contain superfluous information which will only confuse readers&lt;/li&gt;&#xA;&lt;li&gt;don&#39;t just copy your handout onto the blackboard, if you hand it out at the beginning of the presentation (it&#39;s okay, of course, if you do it afterwards)&lt;/li&gt;&#xA;&lt;li&gt;never clean all blackboards at the same time&lt;/li&gt;&#xA;&lt;li&gt;avoid long breaks in your presentation&lt;/li&gt;&#xA;&lt;li&gt;keep on talking all the time, even while cleaning the blackboard to keep people engaged&lt;/li&gt;&#xA;&lt;li&gt;if the blackboards are in front of each other, always start writing on the one on the back&lt;/li&gt;&#xA;&lt;li&gt;if you can use PowerPoint, try to use it for complex/boring formulas or for visualizations, which are impossible to draw by hand&lt;/li&gt;&#xA;&lt;li&gt;on the other hand, make sure, you don&#39;t put things into PowerPoint, that would be better written out slowly on the blackboard&lt;/li&gt;&#xA;&lt;li&gt;always listen to criticism politely, but don&#39;t take notes of it, while you&#39;re in front of your audience&lt;/li&gt;&#xA;&lt;li&gt;don&#39;t degrade yourself by apologizing exaggeratedly for mishaps&lt;/li&gt;&#xA;&lt;li&gt;put the sources of referenced material onto the slide the material is used in&lt;/li&gt;&#xA;&lt;li&gt;don&#39;t waste time on complicated &#39;examples&#39; that are too detailed to be of any use for the audience&lt;/li&gt;&#xA;&lt;li&gt;don&#39;t let technicalities obscure examples - stick to the important parts of them&lt;/li&gt;&#xA;&lt;li&gt;it&#39;s nice if the handout doesn&#39;t exactly match the presentation&lt;/li&gt;&#xA;&lt;li&gt;always conclude your presentation with a summary of the main points of your talk&lt;/li&gt;&#xA;&lt;li&gt;try to build intuition for your topic in your audience instead of explaining difficult proofs no one will remember or care for later anyway&lt;/li&gt;&#xA;&lt;li&gt;make sure you have chosen the right priorities for your presentation and trim it down as much as possible&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;This was it :-)&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br /&gt;&#xA; Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sun, 14 Aug 2011 21:13:25 +0000</pubDate>
    </item>
    <item>
      <title>T61 Extractor</title>
      <link>http://blog.blackhc.net/2011/08/t61-extractor/index.html</link>
      <description>&lt;p&gt;I&#39;ve been a vivid fan of &lt;a href=&#34;http://www.thesixtyone.com/&#34;&gt;thesixtyone.com&lt;/a&gt; - until they changed the design. The old site can still be found here: &lt;a href=&#34;http://old.thesixtyone.com/&#34; class=&#34;uri&#34;&gt;http://old.thesixtyone.com/&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Many of my most favorite songs are from this site and I have only been able to listen to them through the site. However, since the aforementioned design change, the site has really died down in my opinion and I was fearful ever since that it would simply go down some day and vanish - taking my songs and playlists with it.&lt;/p&gt;&#xA;&lt;p&gt;As counter-measure I&#39;ve written a java console application to extract playlists and songs from thesixtyone. It uses &lt;a href=&#34;http://seleniumhq.org/&#34;&gt;Selenium&lt;/a&gt; to remote-control a FireFox instance that uses the normal user-interface to play songs and read in playlists.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve uploaded the code to launchpad: &lt;a href=&#34;https://launchpad.net/t61extractor/trunk&#34; class=&#34;uri&#34;&gt;https://launchpad.net/t61extractor/trunk&lt;/a&gt; I&#39;ve tested and used it myself and it runs alright.&lt;/p&gt;&#xA;&lt;p&gt;This was a small weekend project (or rather two weekend project) that I did a few months ago but I only found time now to write about it.&lt;/p&gt;&#xA;&lt;p&gt;The code should be mostly self-explanatory and it&#39;s not a lot of code either.&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br /&gt;&#xA; Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sat, 13 Aug 2011 16:38:54 +0000</pubDate>
    </item>
    <item>
      <title>Books on Numerical Analysis</title>
      <link>http://blog.blackhc.net/2011/08/books-on-numerical-analysis/index.html</link>
      <description>&lt;p&gt;Due my writing an exam on numerical analysis I had the pleasure to look through lots and lots of books on numerical analysis, and here is a list of my favorite ones so far:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&#34;http://www.amazon.com/Afternotes-Numerical-Analysis-G-Stewart/dp/0898713625/ref=sr_1_1?s=books&amp;amp;ie=UTF8&amp;amp;qid=1312149653&amp;amp;sr=1-1&#34;&gt;Afternotes on Numerical Analysis&lt;/a&gt; &amp;amp; &lt;a href=&#34;http://www.amazon.com/Afternotes-Goes-Graduate-School-Numerical/dp/0898714044/ref=sr_1_2?s=books&amp;amp;ie=UTF8&amp;amp;qid=1312149653&amp;amp;sr=1-2&#34;&gt;Afternotes Goes to Graduate School&lt;/a&gt; by G. W. Stewart Both books are very readable and introduce many of the concepts in a light way that builds an intuitive understanding for them. It&#39;s possible to read the books cover to cover in a few days and you can learn a lot very quickly. They are also quite amusing:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&amp;quot;In the nineteenth century the Norwegian mathematician Niels Abel showed that no polynomial of degree five could be solved by a finite number of additions, multiplications, divisions, and root extractions. If we had a finite algorithm for finding eigenvalues of general matrices, we could apply it to companion matrices and make a fool out of Abel. Abel was no fool.&amp;quot;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&#34;http://www.amazon.com/Numerical-Linear-Algebra-Lloyd-Trefethen/dp/0898713617&#34;&gt;Numerical Linear Algebra&lt;/a&gt; by Trefethen Another very good book which I haven&#39;t used much personally, though&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&#34;http://www.amazon.com/Iterative-Nonlinear-Equations-Frontiers-Mathematics/dp/0898713528/ref=sr_1_1?s=books&amp;amp;ie=UTF8&amp;amp;qid=1312152511&amp;amp;sr=1-1&#34;&gt;Numerical Methods&lt;/a&gt; by Kelley contains an okay introduction to CG and GMRES.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&#34;http://www.amazon.de/Numerische-Mathematik-algorithmisch-orientierte-Einf%C3%BChrung/dp/3110203545/ref=pd_bxgy_b_text_b&#34;&gt;Numerische Mathematik I&lt;/a&gt; &amp;amp; &lt;a href=&#34;http://www.amazon.de/Numerische-Mathematik-Gew%C3%B6hnliche-Differentialgleichungen-Lehrbuch/dp/3110203561/ref=sr_1_4?ie=UTF8&amp;amp;qid=1312152645&amp;amp;sr=8-4&#34;&gt;Numerische Mathematik II&lt;/a&gt; are very good books, too. The first volume contains a good introduction to everything but ODEs and PDEs and the second volume consists of a very thorough overview of numerical algorithms for differential equations, including a nice introduction to the general theory of their solvability etc.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&#34;http://www.amazon.com/Numerical-Analysis-Richard-L-Burden/dp/0538733519/ref=sr_1_1?s=books&amp;amp;ie=UTF8&amp;amp;qid=1312152187&amp;amp;sr=1-1&#34;&gt;Numerical Analysis&lt;/a&gt; by Burden and Faires a very nice book that contains lots of visualizations and covers many topics&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;More to follow soon :-)&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br /&gt;&#xA; Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Mon, 01 Aug 2011 01:01:52 +0000</pubDate>
    </item>
    <item>
      <title>ANTLR Stupidity (Warning 209)</title>
      <link>http://blog.blackhc.net/2010/09/antlr-stupidity/index.html</link>
      <description>&lt;p&gt;I&#39;ve been playing around with a Java grammar for ANTLR that was supposed to work straight-away but it did not, with very strange warnings and errors, that made it look like ANTLR only supports lexers with a lookahead of 1 character:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;warning(209): ...: Multiple token rules can match input such as &amp;quot;&amp;#39;*&amp;#39;&amp;quot;: STAR, STAREQ&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;while STAR matches only &#39;&lt;em&gt;&#39; and STAREQ only matches &#39;&lt;/em&gt;=&#39;. This is a huge w-t-f, especially if you have worked with ANTLR before and didn&#39;t have issues with this. This also contradicted all documentation you can find about ANTLR and its lexer rules.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve spent a considerable amount of time with Google trying to find how to fix it. First I&#39;ve found lots of posts on the ANTLR mailing list [antlr-interest] from people &lt;a href=&#34;http://www.mail-archive.com/il-antlr-interest@googlegroups.com/msg04183.html&#34;&gt;who had the same issue and no replies to them&lt;/a&gt;. &lt;a href=&#34;http://www.antlr.org/pipermail/antlr-interest/2009-September/035954.html&#34;&gt;People had issues with replacing character ranges with unicode ranges (or rather a huge list of unicode characters)&lt;/a&gt;, which probably caused the problem in my grammar, too. &lt;a href=&#34;http://groups.google.com.pe/group/il-antlr-interest/browse_thread/thread/2a126c02758d6693&#34;&gt;Others found that ANTLR suddenly behaved as if it only had a one character lookahead, but only if more than 300 lexer rules were used in the grammar&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;After searching for a long time and almost giving up on the mini-project I&#39;ve wanted to use ANTLR for, I&#39;ve found this post: &lt;a href=&#34;http://www.antlr.org/pipermail/antlr-interest/2009-September/035954.html&#34; class=&#34;uri&#34;&gt;http://www.antlr.org/pipermail/antlr-interest/2009-September/035954.html&lt;/a&gt; (which matches my problem more or less but with additional insight) and someone even replied (someone being the guy who maintains the C runtime of ANTLR): &lt;a href=&#34;http://www.antlr.org/pipermail/antlr-interest/2009-September/035955.html&#34; class=&#34;uri&#34;&gt;http://www.antlr.org/pipermail/antlr-interest/2009-September/035955.html&lt;/a&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;If you are sure that the messages are not correct and the lexer rules are not ambiguous, then you probably need to increase the conversion timeout:&lt;/p&gt;&#xA;&lt;p&gt;-Xconversiontimeout 30000&lt;/p&gt;&#xA;&lt;p&gt;if that does not work, then there is a conflict in your rules.&lt;/p&gt;&#xA;Jim&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;And that turns out to be the right advice and the remedy to my problems and the problems of lots of other people probably. However, no warning or error message I encountered mentioned that ANTLR&#39;s internal processing actually timed-out and there was no ambiguity in the grammar itself...&lt;/p&gt;&#xA;&lt;p&gt;This comes to show that any good tool like ANTLR can quickly degrade to a piece of crap and a major source of annoyance if error and warning messages aren&#39;t clear and helpful.&lt;/p&gt;&#xA;&lt;p&gt;On further investigation, you can trigger warnings that the conversion times out:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;internal error: org.antlr.tool.Grammar.createLookaheadDFA(Grammar.java:1279):&#xA;    could not even do k=1 for decision 121; reason: timed out (&amp;gt;1ms)&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;but not consistently. I guess this is a bug - either in ANTLR or in ANTLRWorks... :-|&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Mon, 06 Sep 2010 11:16:48 +0000</pubDate>
    </item>
    <item>
      <title>Limbo</title>
      <link>http://blog.blackhc.net/2010/09/limbo/index.html</link>
      <description>&lt;p&gt;&lt;a href=&#34;http://www.limbogame.org&#34;&gt;Limbo&lt;/a&gt; is a game that has been released on Xbox Live Arcade some time ago, but I&#39;ve only now found time to play it.&lt;/p&gt;&#xA;&lt;p&gt;It is a very nice game - albeit a bit on the short side: it took me about 5 hours to finish it. But this is the only negative bit I can think of. Everything else about the game is very nice. It is very polished and it&#39;s a charm to play. You have to think about the puzzles for some time but the learning curve is okay and there were no unfair bits.&lt;/p&gt;&#xA;&lt;p&gt;The game is black-and-white only (with shades of gray) and you play a boy that apparently got lost in a forest (this is how it starts) and you want to get out.&amp;lt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;/images/2010-09-05-limbo/limbo6101.jpg&#34;&gt;&lt;img src=&#34;/images/2010-09-05-limbo/limbo6101.jpg&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;The game mechanics are very simple: you can only move around, jump and hold on to things to drag them around (or press buttons, etc). In this regard the game is very similar to &lt;a href=&#34;http://www.anotherworld.fr/anotherworld_uk/&#34;&gt;Another World&lt;/a&gt; (another very good game worth playing).&lt;/p&gt;&#xA;&lt;p&gt;The puzzles are all phyiscs-based and because of this the aforementioned fairness is achieved: sometimes you just have to think a bit longer how to solve a puzzle but it is always logical.&lt;/p&gt;&#xA;&lt;iframe width=&#34;800&#34; height=&#34;600&#34; src=&#34;https://www.youtube.com/embed/Y4HSyVXKYz8&#34; frameborder=&#34;0&#34; allowfullscreen&gt;&#xA;&lt;/iframe&gt;&#xA;&lt;p&gt;The game is somewhat violent because it works using the &amp;quot;learning by dying&amp;quot; principle and if you don&#39;t enable the gore filter, you&#39;ll see the poor boy being halved, stabbed, squashed,... many times. However, since he is only a black shape, it&#39;s okay and won&#39;t put you off playing. The game uses many (and only) auto-saves to track your progress and you never feel punished for dying because you&#39;ll get another try straightaway without having to replay more than a few seconds.&lt;/p&gt;&#xA;&lt;p&gt;&amp;quot;Learning by dying&amp;quot; works really well (and is also used in Another World): You don&#39;t have to worry about a &amp;quot;health bar&amp;quot; or rewind time or...&lt;/p&gt;&#xA;&lt;p&gt;The difficulty of the game is just right and it gets harder as you progress through the world: you get to use more objects to solve the puzzles or will have to think of new ways to use physics to achieve your goals. However, one annoying bit is that also autosave points get moved further apart even when there is no need for it. This only happens in the last few &amp;quot;chapters&amp;quot; of the game though.&lt;/p&gt;&#xA;&lt;p&gt;All in all it is very much a game worth playing and a very polished experience - kudos to the developers!&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sun, 05 Sep 2010 13:51:35 +0000</pubDate>
    </item>
    <item>
      <title>Light Propagation Volumes</title>
      <link>http://blog.blackhc.net/2010/07/light-propagation-volumes/index.html</link>
      <description>&lt;p&gt;I&#39;ve finally finished my lab course last week - thanks to my supervisor Matthäus G. Chajdas - &lt;a href=&#34;http://anteru.net/&#34;&gt;you can read his blog here&lt;/a&gt; -, it wasn&#39;t your usual lab course with work sheets and boring homework, instead I&#39;ve been allowed to implement a nice paper about a &lt;a href=&#34;https://en.wikipedia.org/wiki/Global_illumination&#34;&gt;Global Illumination&lt;/a&gt; approximation algorithm called &lt;a href=&#34;http://www.crytek.com/fileadmin/user_upload/inside/presentations/2010_I3D/20100301_lpv.pdf&#34;&gt;(Cascaded) Light Propagation Volumes&lt;/a&gt;. It&#39;s been developed by Crytek and you can find more information (including some presentations and videos) on &lt;a href=&#34;http://www.crytek.com/technology/presentations/&#34;&gt;their server&lt;/a&gt;. (Note: this is an implementation of the I3D paper, not the earlier SIGGRAPH one.)&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/2010-07-18-light-propagation-volumes/LPVfinal0-1024x573.jpg&#34; alt=&#34;Sponza scene (direct + indirect lighting w/ occlusion)&#34; /&gt;&lt;figcaption&gt;Sponza scene (direct + indirect lighting w/ occlusion)&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/2010-07-18-light-propagation-volumes/LPVfinal1-1024x573.jpg&#34; alt=&#34;Sponza scene (only indirect lighting w/ occlusion)&#34; /&gt;&lt;figcaption&gt;Sponza scene (only indirect lighting w/ occlusion)&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/2010-07-18-light-propagation-volumes/LPVfinal2-1024x573.jpg&#34; alt=&#34;Sponza scene (ony direct lighting)&#34; /&gt;&lt;figcaption&gt;Sponza scene (ony direct lighting)&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/2010-07-18-light-propagation-volumes/LPVfinal3-1024x573.jpg&#34; alt=&#34;Sponza scene (boosted indirect lighting w/ occlusion)&#34; /&gt;&lt;figcaption&gt;Sponza scene (boosted indirect lighting w/ occlusion)&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/2010-07-18-light-propagation-volumes/LPVfinal4-1024x573.jpg&#34; alt=&#34;Sponza scene (boosted indirect lighting w/o occlusion)&#34; /&gt;&lt;figcaption&gt;Sponza scene (boosted indirect lighting w/o occlusion)&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;The algorithm approximates global illumination by rendering the light into a &lt;a href=&#34;http://www.vis.uni-stuttgart.de/dachsbacher/download/rsm.pdf&#34;&gt;reflective shadow map&lt;/a&gt;, injecting it into a volume (using a spherical harmonics representation) and propagates the light flux in this volume (hence the name of the algorithm) and taking into account occlusion as possible extension.&lt;/p&gt;&#xA;&lt;p&gt;The whole algorithm is physically motivated but corners everywhere, of course, to be more efficient. The paper also contains a few errors and doesn&#39;t explain everything needed to implement it in great detail (like eg the solid angles of the side faces), so I&#39;ve written two documents detailing the mistakes I&#39;ve found and the additional calculations I&#39;ve performed.&lt;/p&gt;&#xA;&lt;p&gt;You can find the mistakes &lt;a href=&#34;http://data.blog.blackhc.net/2010/07/lpv-corrections.pdf&#34;&gt;here&lt;/a&gt; (including suggested corrections) and the full annotations document &lt;a href=&#34;http://data.blog.blackhc.net/2010/07/lpv-annotations.pdf&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Finally I&#39;ve also uploaded the whole prototype (including my code licensed under the FreeBSD license and the media files) &lt;a href=&#34;http://data.blog.blackhc.net/2010/07/LPVPrototype.zip&#34;&gt;here&lt;/a&gt; - it&#39;s 68 MB big (and it&#39;s been compressed with 7zip with a compression mode that might not be supported by WinZIP. The Sponza model is from Crytek, too. You can download the original model and textures &lt;a href=&#34;http://www.crytek.com/downloads/technology/&#34;&gt;here&lt;/a&gt;. The project uses DirectX 10.1 and by default it won&#39;t run in DirectX 10, because it uses a texture format that is deprecated in D3D10 but supported again 10.1 (BGRA). See the comment by &lt;strong&gt;FatGarfield&lt;/strong&gt; for the location that needs to be changed for it work in DX10, too. (However red and blue will be swapped then.)&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: I&#39;ve updated the project to support Visual Studio 2012. You can find the full download &lt;a href=&#34;http://data.blog.blackhc.net/LPVPrototype.zip&#34;&gt;here&lt;/a&gt; (68 MB).&lt;/p&gt;&#xA;&lt;p&gt;I haven&#39;t implemented cascaded LPVs and I also use only one light/RSM and only inject its depth into the occlusion volume, but the results already look very nice in my opinion.&lt;/p&gt;&#xA;&lt;p&gt;Stay tuned for more :-)&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br /&gt;&#xA; Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sun, 18 Jul 2010 15:44:39 +0000</pubDate>
    </item>
    <item>
      <title>Panorama Stitching</title>
      <link>http://blog.blackhc.net/2010/07/panorama-stitching/index.html</link>
      <description>&lt;p&gt;I&#39;ve finally come around to &amp;quot;clean-up&amp;quot; some old project I&#39;ve had lying around for a few months and upload it. I&#39;m talking about some Panorama Stitching code I wrote for our participation in Microsoft&#39;s Imagine Cup. I&#39;m suppressing all memories of it since it was an epic fail, but at least I still have learnt quite a bit about computer vision and image processing - enough to know that it&#39;s incredibly hard to come up with stable algorithms and kudos to anyone working in the field.&lt;/p&gt;&#xA;&lt;p&gt;Here is the code dump: &lt;a href=&#34;http://data.blog.blackhc.net/2010/07/PanoramaStitching.zip&#34;&gt;PanoramaStitching.zip&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;It contains many small projects which usually use multiple pictures as inputs or multiple webcams (depending on code or chosen preprocessor macros).&lt;/p&gt;&#xA;&lt;p&gt;The most advanced prototype is the SnapshotHomographyConfigurator, which allows you to determine homographies between multiple cameras at once by marking shared points between the images.&lt;/p&gt;&#xA;&lt;p&gt;Another one which works okay is the PanoramaStitching project. It creates panoramas using spherical or cylindrical projections of the input images. However, it is very sensitive to translations of the viewpoint. It works quite well with optimal/artificial images:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;/images/2010-07-17-panorama-stitching/shotA.png&#34;&gt;&lt;img src=&#34;/images/2010-07-17-panorama-stitching/shotA-300x225.png&#34; /&gt;&lt;/a&gt;&lt;a href=&#34;/images/2010-07-17-panorama-stitching/shotB.png&#34;&gt;&lt;img src=&#34;/images/2010-07-17-panorama-stitching/shotB-300x225.png&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;/images/2010-07-17-panorama-stitching/live.jpg&#34;&gt;&lt;img src=&#34;/images/2010-07-17-panorama-stitching/live.jpg&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;(Note: the small misalignment on the right stems from moving the player position slightly. Usually you use a deghosting algorithm to remove such misalignments.)&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve used &lt;a href=&#34;http://opencv.willowgarage.com/wiki/&#34;&gt;OpenCV&lt;/a&gt; for image processing and &lt;a href=&#34;http://www.yaml.org/&#34;&gt;yaml&lt;/a&gt; for loading and storing settings (and also &lt;a href=&#34;http://rapidxml.sourceforge.net/&#34;&gt;rapidxml&lt;/a&gt;). OpenCV&#39;s C++ wrapper is pretty awesome. It&#39;s not perfect but it makes life a lot easier.&lt;/p&gt;&#xA;&lt;p&gt;Stay tuned for more code/project uploads soon :-)&lt;/p&gt;&#xA;&lt;p&gt;PS: Here are the links to some papers which proved useful to me (I didn&#39;t implement most of them though, and some are implemented in OpenCV already):&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.91.5822&#34;&gt;Eliminating Ghosting and Exposure Artifacts in Image Mosaics&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://robots.stanford.edu/cs223b04/algo_tracking.pdf&#34;&gt;Pyramidal Implementation of the Lucas Kanade Feature Tracker - Description of the algorithm&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://research.microsoft.com/apps/pubs/default.aspx?id=70092&#34;&gt;Image Alignment and Stitching: A Tutorial&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.google.de/url?sa=t&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CBYQFjAA&amp;amp;url=http%3A%2F%2Fciteseerx.ist.psu.edu%2Fviewdoc%2Fdownload%3Fdoi%3D10.1.1.96.3162%26rep%3Drep1%26type%3Dpdf&amp;amp;ei=JQVDTNSNOeOJOIzamIYN&amp;amp;usg=AFQjCNHmesBhRUp-0hpn6mxYjZwymax2Cw&amp;amp;sig2=26VpkBOuLIZ2tW1V0VxPCQ&#34;&gt;Seamless Image Stitching by Minimizing False Edges&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://research.microsoft.com/pubs/75614/ShumSzeliski-IJCV00.pdf&#34;&gt;Construction of Panoramic Image Mosaics with Global and Local Alignment&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.hpl.hp.com/techreports/Compaq-DEC/CRL-94-2.pdf&#34;&gt;Image Mosaicing for Tele-Reality Applications&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://faculty.cs.tamu.edu/jchai/CPSC641/shi_tomasi_94.pdf&#34;&gt;Good Features to Track&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sat, 17 Jul 2010 11:00:04 +0000</pubDate>
    </item>
    <item>
      <title>Rotation of Low Order Spherical Harmonics</title>
      <link>http://blog.blackhc.net/2010/06/rotation-of-low-order-spherical-harmonics/index.html</link>
      <description>&lt;p&gt;I&#39;m currently working at university on implementing &lt;a href=&#34;http://www.crytek.com/technology/presentations/&#34;&gt;Light Propagation Volumes&lt;/a&gt;. The paper makes extensive use of &lt;a href=&#34;http://en.wikipedia.org/wiki/Spherical_harmonics&#34;&gt;spherical harmonics&lt;/a&gt; while the implementation uses the first two bands.&lt;/p&gt;&#xA;&lt;p&gt;Below is a visualization of the first 4 bands of the SH basis functions (created using &lt;a href=&#34;http://code.enthought.com/projects/mayavi/&#34;&gt;Mayavi&lt;/a&gt;):&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/2010-06-19-rotation-of-low-order-spherical-harmonics/sh0to3.jpg&#34; alt=&#34;The first 4 bands of the spherical harmonic basis functions&#34; /&gt;&lt;figcaption&gt;The first 4 bands of the spherical harmonic basis functions&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;As you can see the first two bands are 4 functions, so 4 coefficients to store which conveniently fits into one RGBA texture.&lt;/p&gt;&#xA;&lt;p&gt;One of the main transformations that is performed in the LPV paper is the rotation of the spherical harmonics representation of a clamped cosine lobe (that represents surface lighting) onto a normal vector direction. It took me a while to figure out, but actually it&#39;s quite easy, which is why I write about it :-)&lt;/p&gt;&#xA;&lt;p&gt;The analytical presentation of the first four base functions is simple:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[S_0 \left( x, y, z \right ) = \frac{1}{2 \sqrt{\pi}}\]&lt;/span&gt; &lt;span class=&#34;math display&#34;&gt;\[S_1 \left( x, y, z \right ) = - \frac{\sqrt{3}}{2 \sqrt{\pi}} y\]&lt;/span&gt; &lt;span class=&#34;math display&#34;&gt;\[S_2 \left( x, y, z \right ) = \frac{\sqrt{3}}{2 \sqrt{\pi}} z \]&lt;/span&gt; &lt;span class=&#34;math display&#34;&gt;\[S_3 \left( x, y, z \right ) = - \frac{\sqrt{3}}{2 \sqrt{\pi}} x\]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;To evaluate lighting with SH for some direction &lt;span class=&#34;math inline&#34;&gt;\(v\)&lt;/span&gt;, you first determine the coefficients/weights of the SH basis functions and then sum them up.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[ L = \sum_i s_i \, S_i \left( v \right ) \]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Let&#39;s assume we know the coefficients &lt;span class=&#34;math inline&#34;&gt;\(s^z_0, s^z_1, ...\)&lt;/span&gt; of the clamped cosine lobe around the z axis, then we can determine the lighting in direction v for the cosine lobe around the normal n by transforming it into the space where the normal coincides with the z axis (ie rotate n onto the z axis):&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[ L = \sum_i s^z_i \, S_i \left( R_{n \to z} \, v \right ) \]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;where &lt;span class=&#34;math inline&#34;&gt;\(R_{n \to z}\)&lt;/span&gt; is a rotation matrix that rotates n onto z.&lt;/p&gt;&#xA;&lt;p&gt;The idea is to expand &lt;span class=&#34;math inline&#34;&gt;\(S_i \left( R_{n \to z} \, v \right )\)&lt;/span&gt; and rewrite it in terms of &lt;span class=&#34;math inline&#34;&gt;\(S_i \left ( v \right )\)&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Before doing this, let&#39;s first take a look at the coefficients of the clamped cosine lobe:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[\begin{align*} s^z_0 &amp;amp;=\frac{ \sqrt{ \pi } }{ 2 }\\ s^z_1 &amp;amp;= 0\\ s^z_2 &amp;amp;= \sqrt\frac{ \pi }{3}\\ s^z_3 &amp;amp;= 0\\ \end{align*}\]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;The y and x direction are 0 because the cosine lobe is centered isotropic around the z axis:&lt;/p&gt;&#xA;&lt;p&gt;So let&#39;s look at the expanded version of this formula if &lt;span class=&#34;math inline&#34;&gt;\(r_1^T\)&lt;/span&gt;, &lt;span class=&#34;math inline&#34;&gt;\(r_2^T\)&lt;/span&gt;, &lt;span class=&#34;math inline&#34;&gt;\(r_3^T\)&lt;/span&gt; are the row vectors of the matrix, &lt;span class=&#34;math inline&#34;&gt;\(v=\bigl(\begin{smallmatrix} x\\ y\\ z \end{smallmatrix}\bigr)\)&lt;/span&gt; and &lt;span class=&#34;math inline&#34;&gt;\(R_{n \to z}=\left(\begin{smallmatrix} r_1^T\\ r_2^T\\ r_3^T \end{smallmatrix}\right )\)&lt;/span&gt;, then:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[ L = \sum_i s^z_i \, S_i \left( R_{n \to z} \, v \right ) = \sum_i s^z_i \, S_i \left( \left(\begin{smallmatrix} r_1^T \, v\\ r_2^T \, v\\ r_3^T \, v\end{smallmatrix}\right ) \right ) \]&lt;/span&gt; &lt;span class=&#34;math display&#34;&gt;\[\begin{align*} L &amp;amp;= s^z_0 \, c_0\\ &amp;amp;+ s^z_1 \, (-c_1) \, r_2^T \, v \\ &amp;amp;+ s^z_2 \, c_1 \, r_3^T \, v\\ &amp;amp;+ s^z_3 \, (-c_1) \, r_1^T \, v \end{align*} \]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Since &lt;span class=&#34;math inline&#34;&gt;\(s^z_1 = 0\)&lt;/span&gt; and &lt;span class=&#34;math inline&#34;&gt;\(s^z_3 = 0\)&lt;/span&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[ L = s^z_0 \, c_0 + s^z_2 \, c_1 \, r_3^T \, v = s^z_0 \, c_0 + s^z_2 \, c_1 \, r_{31} \, x + s^z_2 \, c_1 \, r_{32} \, y + s^z_2 \, c_1 \, r_{33} \, z \]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[ L = s^z_0 \, S_0 \left ( v \right ) - s^z_2 \, r_{32} \, S_1 \left ( v \right )+ s^z_2 \, r_{33} \, S_2 \left ( v \right ) - s^z_2 \, r_{31} \, S_3 \left ( v \right ) \]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Now the question is: what is the third row of &lt;span class=&#34;math inline&#34;&gt;\(R_{n \to z}\)&lt;/span&gt;? If we look at the inverse matrix instead: &lt;span class=&#34;math inline&#34;&gt;\(R_{z \to n}\)&lt;/span&gt;, we can immediately see that its third column has to be n, because &lt;span class=&#34;math display&#34;&gt;\[ R_{z \to n} \, \bigl(\begin{smallmatrix} 0\\ 0\\ 1 \end{smallmatrix}\bigr) = n \]&lt;/span&gt; by construction. Since rotations are orthogonal matrices, the inverse is the same as the transposed, so we can deduce that the third row of &lt;span class=&#34;math inline&#34;&gt;\(R_{n \to z}\)&lt;/span&gt; is the same as the third column of &lt;span class=&#34;math inline&#34;&gt;\(R_{z \to n}\)&lt;/span&gt;, that is: n. Thus with &lt;span class=&#34;math inline&#34;&gt;\(n = \bigl(\begin{smallmatrix} n_x\\ n_y\\ n_z \end{smallmatrix}\bigr)\)&lt;/span&gt; we get:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[ L = s^z_0 \, S_0 \left ( v \right ) - s^z_2 \, n_y \, S_1 \left ( v \right )+ s^z_2 \, n_z \, S_2 \left ( v \right ) - s^z_2 \, n_x \, S_3 \left ( v \right ) \]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;So the SH coefficients of the clamped cosine lobe along n are:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[ s^n_0 = s^z_0 = \frac{ \sqrt{ \pi } }{ 2 } \\ s^n_1 = - s^z_2 \, n_y = -\sqrt{ \frac{ \pi }{3} } \, n_y \\ s^n_2 = s^z_2 \, n_z = \sqrt{\frac{ \pi }{3} } \, n_z \\ s^n_1 = - s^z_2 \, n_x = - \sqrt{\frac{ \pi }{3}} \, n_x \]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;This is it :-)&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br /&gt;&#xA; Andreas&lt;/p&gt;&#xA;&lt;p&gt;PS: a few screenshots from the LPV project:&lt;/p&gt;&#xA;&lt;div class=&#34;row&#34;&gt;&#xA;&lt;div class=&#34;thumbnail col-sm-8&#34;&gt;&#xA;&lt;p&gt;&lt;a target=&#34;_blank&#34; href=&#34;/images/overflow/2010/06/GPUPropCopy-0616.jpeg&#34;&gt;&lt;img class=&#34;img-responsive&#34; src=&#34;/images/overflow/2010/06/GPUPropCopy-0616.jpeg&#34;&gt;&lt;/a&gt;&lt;span&gt;GPUPropCopy&lt;/span&gt;&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;div class=&#34;col-sm-4&#34;&gt;&#xA;&lt;div class=&#34;row&#34;&gt;&#xA;&lt;div class=&#34;thumbnail&#34; style=&#34;margin-bottom: 7px;&#34;&gt;&#xA;&lt;p&gt;&lt;a target=&#34;_blank&#34; href=&#34;/images/overflow/2010/06/noLPV_2.JPG&#34;&gt;&lt;img class=&#34;img-responsive&#34; src=&#34;/images/overflow/2010/06/noLPV_2.JPG&#34;&gt;&lt;/a&gt;&lt;span&gt;noLPV_2&lt;/span&gt;&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;div class=&#34;row&#34;&gt;&#xA;&lt;div class=&#34;thumbnail&#34;&gt;&#xA;&lt;p&gt;&lt;a target=&#34;_blank&#34; href=&#34;/images/overflow/2010/06/noLPV.JPG&#34;&gt;&lt;img class=&#34;img-responsive&#34; src=&#34;/images/overflow/2010/06/noLPV.JPG&#34;&gt;&lt;/a&gt;&lt;span&gt;noLPV&lt;/span&gt;&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;div class=&#34;row&#34;&gt;&#xA;&lt;div class=&#34;thumbnail col-sm-6&#34;&gt;&#xA;&lt;p&gt;&lt;a target=&#34;_blank&#34; href=&#34;/images/overflow/2010/06/LPV32P128C_2.JPG&#34;&gt;&lt;img class=&#34;img-responsive&#34; src=&#34;/images/overflow/2010/06/LPV32P128C_2.JPG&#34;&gt;&lt;/a&gt;&lt;span&gt;LPV32P128C_2&lt;/span&gt;&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;div class=&#34;thumbnail col-sm-6&#34;&gt;&#xA;&lt;p&gt;&lt;a target=&#34;_blank&#34; href=&#34;/images/overflow/2010/06/LPV32P128C.JPG&#34;&gt;&lt;img class=&#34;img-responsive&#34; src=&#34;/images/overflow/2010/06/LPV32P128C.JPG&#34;&gt;&lt;/a&gt;&lt;span&gt;LPV32P128C&lt;/span&gt;&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sat, 19 Jun 2010 23:10:05 +0000</pubDate>
    </item>
    <item>
      <title>Rigid Body Motion</title>
      <link>http://blog.blackhc.net/2010/05/rigid-body-motion/index.html</link>
      <description>&lt;p&gt;Last week I had to give a presentation about Rigid Body Motion (ie the basics of rigid body physics and some general mechanics).&lt;/p&gt;&#xA;&lt;p&gt;Here are two versions of my presentation (one with less text and one with more):&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://data.blog.blackhc.net/2010/05/Rigid-Body-Motion-Presentation.pptx&#34;&gt;Rigid Body Motion Presentation as PPTX&lt;/a&gt;; &lt;a href=&#34;http://data.blog.blackhc.net/2010/05/Rigid-Body-Motion-Presentation.pdf&#34;&gt;Rigid Body Motion Presentation as PDF&lt;/a&gt;&lt;br /&gt;&#xA;&lt;a href=&#34;http://data.blog.blackhc.net/2010/05/Rigid-Body-Motion-Full-Version.pptm&#34;&gt;Rigid Body Motion Full Version as PPTM&lt;/a&gt;; &lt;a href=&#34;http://data.blog.blackhc.net/2010/05/Rigid-Body-Motion-Full-Version.pdf&#34;&gt;Rigid Body Motion Full Version as PDF&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;If you are truly interested in learning about rigid body physics, here are some books/links:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;“Technische Mechanik 1 &amp;amp; 3” by Gross, Hauger, Schröder &amp;amp; Wall&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.pixar.com/companyinfo/research/pbm2001/&#34;&gt;“Physically Based Modeling” by Pixar (SIGGRAPH 2001)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;“Mathematics for 3D Game Programming &amp;amp; Computer Graphics” by Eric Lengyel&lt;/li&gt;&#xA;&lt;li&gt;“Physics for Game Developers” by David M. Bourg&lt;/li&gt;&#xA;&lt;li&gt;“Game Physics” by David H. Eberly&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://chrishecker.com/Rigid_Body_Dynamics&#34;&gt;Chris Hecker&#39;s Rigid Body Physics page&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Cheers, Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sun, 30 May 2010 15:10:11 +0000</pubDate>
    </item>
    <item>
      <title>PowerPoint LaTeX</title>
      <link>http://blog.blackhc.net/2010/05/powerpoint-latex/index.html</link>
      <description>&lt;p&gt;Hey everybody :-)&lt;/p&gt;&#xA;&lt;p&gt;I only wanted to point out that I&#39;ve uploaded a new and improved version of PowerPoint LaTeX at &lt;a href=&#34;http://code.google.com/p/powerpointtools/&#34; class=&#34;uri&#34;&gt;http://code.google.com/p/powerpointtools/&lt;/a&gt; - it now supports MiKTeX /&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve also finally added a project page for it to this blog. More updates might follow soon if I find enough spare time :-)&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br /&gt;&#xA; Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sun, 30 May 2010 09:58:04 +0000</pubDate>
    </item>
    <item>
      <title>A quick note on quantifiers: For almost all and there exist infinitely many</title>
      <link>http://blog.blackhc.net/2010/03/a-quick-note-on-quantifiers-for-almost-all-and-there-exist-infinitely-many/index.html</link>
      <description>&lt;p&gt;It&#39;s been a while since my last post and now it&#39;s time for a mathematical post:&lt;/p&gt;&#xA;&lt;p&gt;I&#39;m currently preparing for a math exam (calculus) and I&#39;m thinking it would be nice if there was a way to avoid much of the &amp;quot;for every &lt;span class=&#34;math inline&#34;&gt;\(\epsilon &amp;gt; 0\)&lt;/span&gt; there is an &lt;span class=&#34;math inline&#34;&gt;\(N \in \mathbb{N}\)&lt;/span&gt;, so that for all &lt;span class=&#34;math inline&#34;&gt;\(n \ge N\)&lt;/span&gt; some property ... holds&amp;quot; stuff you find in textbooks. Some textbooks actually shorten it to &amp;quot;for every &lt;span class=&#34;math inline&#34;&gt;\(\epsilon &amp;gt; 0\)&lt;/span&gt; some property ... holds for almost all &lt;span class=&#34;math inline&#34;&gt;\(n\)&lt;/span&gt;&amp;quot;.&lt;/p&gt;&#xA;&lt;p&gt;However, I haven&#39;t found a quantifier to express this anywhere yet, so I&#39;m proposing to introduce a new one:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math inline&#34;&gt;\(\tilde{\forall} x \in M: P(x)\)&lt;/span&gt; should mean &amp;quot;for almost all &lt;span class=&#34;math inline&#34;&gt;\(x \in M\)&lt;/span&gt; &lt;span class=&#34;math inline&#34;&gt;\(P(x)\)&lt;/span&gt; holds&amp;quot;, which suggests that there are only finitely many elements for which it does not hold.&lt;/p&gt;&#xA;&lt;p&gt;One can formalize this as:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[ \tilde{\forall} x \in M: P(x) \equiv \exists n \in \mathbb{N}: \left | \left \{ x \in M \mid \neg P(x) \right \} \right | \le n \]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Of course, a new existential quantifier is required then, too (for negation):&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math inline&#34;&gt;\(\tilde{\exists} x \in M: P(x)\)&lt;/span&gt; stands for &amp;quot;there exist infinitely many &lt;span class=&#34;math inline&#34;&gt;\(x \in M\)&lt;/span&gt;, for which &lt;span class=&#34;math inline&#34;&gt;\(P(x)\)&lt;/span&gt; holds&amp;quot;.&lt;/p&gt;&#xA;&lt;p&gt;And this can be formalized as:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[\tilde{\exists} x \in M: P(x) \equiv \forall n \in \mathbb{N}: \left | \left \{ x \in M \mid P(x) \right \} \right | &amp;gt; n \]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;It&#39;s easy to see that &lt;span class=&#34;math display&#34;&gt;\[\neg \left ( \tilde{\forall} x \in M: P(x) \right ) \equiv \tilde{\exists} x \in M: \neg P(x) \]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Thus one can use the two quantifiers just as one would use &lt;span class=&#34;math inline&#34;&gt;\(\forall\)&lt;/span&gt; and &lt;span class=&#34;math inline&#34;&gt;\(\exists\)&lt;/span&gt; usually. Note however than &lt;span class=&#34;math inline&#34;&gt;\(\forall\)&lt;/span&gt; and &lt;span class=&#34;math inline&#34;&gt;\(\tilde{\forall}\)&lt;/span&gt; don&#39;t interchange and neither do &lt;span class=&#34;math inline&#34;&gt;\(\exists\)&lt;/span&gt; and &lt;span class=&#34;math inline&#34;&gt;\(\tilde{\exists}\)&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;One last note: it might be worth using a different notation, for example: &lt;span class=&#34;math inline&#34;&gt;\(\exists ^ \infty\)&lt;/span&gt; might be easier to understand than &lt;span class=&#34;math inline&#34;&gt;\(\tilde{\exists}\)&lt;/span&gt;, and &lt;span class=&#34;math inline&#34;&gt;\(\forall ^ \approx\)&lt;/span&gt; might be better than &lt;span class=&#34;math inline&#34;&gt;\(\tilde{\forall}\)&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ll try to formalize these quantifiers some more when I find some spare time.&lt;/p&gt;&#xA;&lt;p&gt;Stay tuned for coding related updates soon :-)&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sat, 27 Mar 2010 14:55:00 +0000</pubDate>
    </item>
    <item>
      <title>Random Things</title>
      <link>http://blog.blackhc.net/2009/11/random-things/index.html</link>
      <description>&lt;p&gt;It&#39;s been a while since the last update. Here&#39;s a small update on what I&#39;m thinking about various stuff.&lt;/p&gt;&#xA;&lt;h4 id=&#34;prototype&#34;&gt;Prototype&lt;/h4&gt;&#xA;&lt;p&gt;Gameplay is okay I guess. Nothing I would spent too much time on though. It looks a lot worse than GTA 4 though (same as Crackdown).&lt;/p&gt;&#xA;&lt;h4 id=&#34;resident-evil&#34;&gt;Resident Evil&lt;/h4&gt;&#xA;&lt;p&gt;Seems to be lots of fun and some nice graphics, too.&lt;/p&gt;&#xA;&lt;h4 id=&#34;red-faction-guerrilla&#34;&gt;Red Faction: Guerrilla&lt;/h4&gt;&#xA;&lt;p&gt;Some weird texture filtering issues and the presentation doesn&#39;t knock off my chair (terrain popping and other ugliness), but multiplayer is loads of fun with friends. Physics isn&#39;t completely stable though. I played the game for one hour in MP with friends and there were quite a few cases where geometry dropped through the floor with enough pressure from above (after destroying a building).&lt;/p&gt;&#xA;&lt;h4 id=&#34;brüno&#34;&gt;Brüno&lt;/h4&gt;&#xA;&lt;p&gt;A bad and quite stupid movie (Ali G in Da House is probably the only movie I kinda like that stars Cohen). If you haven&#39;t watched it already, don&#39;t &amp;gt;_&amp;lt;&lt;/p&gt;&#xA;&lt;h4 id=&#34;shadow-complex&#34;&gt;Shadow Complex&lt;/h4&gt;&#xA;&lt;p&gt;I bought shadow complex a few weeks ago and I have to say that it is an awesome game. I read somewhere that the developer used the Metroid series as inspiration and it shows. It&#39;s really fun to play and quite addictive. The graphics are pretty awesome (it is using the Unreal 3 engine) and the whole presentation is pretty polished. It certainly is worth its 1200 gamerpoints&lt;/p&gt;&#xA;&lt;h3 id=&#34;summing-formulas&#34;&gt;Summing Formulas&lt;/h3&gt;&#xA;&lt;p&gt;A month ago I was doing some exercises in an analysis book (Königsberger) and found a nice/interesting problem:&lt;/p&gt;&#xA;&lt;p&gt;Prove that if we denote of the sum of the numbers 1 to n to the p-th power by &lt;span class=&#34;math display&#34;&gt;\[ S_n^p = 1^p + 2^p + ... + n^p \]&lt;/span&gt;, then the following equation by Pascal holds: &lt;span class=&#34;math display&#34;&gt;\[ (p+1) S_n^p + \binom{ p + 1 }{ 2 } S_n^{p-1} + \binom{ p + 1 }{ 3 } S_n^{p-2} + ... + S_n^0 = (n+1)^{p+1} - 1 \]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;It can be used to get recursively/iteratively get formulas for sums of higher powers of numbers.&lt;/p&gt;&#xA;&lt;p&gt;This is interesting because the proof doesn&#39;t need any advanced maths (like eg the Euler-MacLaurin formula, which can be used to show this, too).&lt;/p&gt;&#xA;&lt;p&gt;You can download the proof and a few examples &lt;a href=&#34;http://data.blog.blackhc.net/2009/11/PascalSumFormula.pdf&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Cheers&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Fri, 27 Nov 2009 16:56:20 +0000</pubDate>
    </item>
    <item>
      <title>Extracting Information from StudiVZ</title>
      <link>http://blog.blackhc.net/2009/10/extracting-information-from-studivz/index.html</link>
      <description>&lt;p&gt;Some time ago somebody stole 1 million data records from &lt;a href=&#34;http://www.studivz.net/&#34;&gt;StudiVZ&lt;/a&gt;, the German Facebook clone. I&#39;m not exactly sure why people call the person a hacker who stole data, because it appears he simply wrote a tool that harvested the publicly available data from StudiVZ (which everyone with an account can view).&lt;/p&gt;&#xA;&lt;p&gt;People on StudiVZ share all their data by default---contrary to Facebook which values a person&#39;s private data a lot more. Thus by simply opening each profile from a dummy user and processing the HTML data from StudiVZ one can extract a lot and some more information from random people who probably don&#39;t even know about it or don&#39;t care.. so I&#39;m not sure about the stealing part.&lt;/p&gt;&#xA;&lt;p&gt;Apparently there are some captcha&#39;s when you start browsing searches beyond a few pages. I guess that is where the hacking part comes in, because getting around a captcha probably constitutes hacking---maybe?&lt;/p&gt;&#xA;&lt;p&gt;Anyway I think part of the media coverage is a bit ridiculous because anyone can write a simple harvester in an hour or two. It took me one and half hours, so I think I&#39;m on the safe side with this estimate and I didn&#39;t really have a clue about this stuff before either.&lt;/p&gt;&#xA;&lt;p&gt;Since I don&#39;t want to &amp;quot;hack&amp;quot;, I&#39;ve only written a very tame harvester. It connects to your personal StudiVZ account, and retrieves the name and profile ID (and thus profile URL) of all your friends in the &amp;quot;Meine Freunde&amp;quot; pages.&lt;/p&gt;&#xA;&lt;p&gt;It could do a lot more with that like retrieving everybody&#39;s birthday or random pictures, but I&#39;m too lazy to code that because you use the same pattern for extracting data over and over again and it stops being interesting quite fast.&lt;/p&gt;&#xA;&lt;p&gt;You can download the project &lt;a href=&#34;http://data.blog.blackhc.net/2009/10/StudiVZExtractor.zip&#34;&gt;here&lt;/a&gt;. It is a one file C# project. I&#39;m releasing it under GPL (whatever).&lt;/p&gt;&#xA;&lt;p&gt;It&#39;s really easy to explain how it works:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It uses &lt;code&gt;System.Net&lt;/code&gt;&#39;s &lt;code&gt;HttpWebRequest&lt;/code&gt; and &lt;code&gt;HttpWebResponse&lt;/code&gt; to get (and post) web pages.&lt;/li&gt;&#xA;&lt;li&gt;StudiVZ (like every other portal) uses cookies, so I create a &lt;strong&gt;CookieContainer &lt;/strong&gt;and use it in every http request.&lt;/li&gt;&#xA;&lt;li&gt;There are a few hidden values that StudiVZ expects during login. I&#39;m retrieving them from the main page using custom built regular expressions. I&#39;ve found a &lt;a href=&#34;http://derekslager.com/blog/posts/2007/09/a-better-dotnet-regular-expression-tester.ashx&#34;&gt;handy AJAX tester for .NET regular expressions&lt;/a&gt;. It was really useful for building the expressions and debugging them. (BTW you can find all URLs I used in the comments.)&lt;/li&gt;&#xA;&lt;li&gt;After login I use the same pattern: get page &amp;amp; parse using regex for everything.&lt;/li&gt;&#xA;&lt;li&gt;Visual Studio has an awesome &amp;quot;HTML Visualizer&amp;quot; for strings. It displays the content of a string as HTML page, which is really nifty if you&#39;re doing anything related to HTML processing.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The code is quite ugly. Well, it&#39;s not production code and this is only meant as a proof of concept.&lt;/p&gt;&#xA;&lt;p&gt;Also note that I have at most violated the AGB of StudiVZ and not committed any criminal acts and I&#39;m not planning to sell my friend&#39;s profile IDs or data either :-)&lt;/p&gt;&#xA;&lt;p&gt;Maybe someone can extend the code and make it more useful. I guess it would be fun to automatically download all your pictures (including tags) and feed them into flickr or picasa... but someone else can do that.&lt;/p&gt;&#xA;&lt;p&gt;Cheers, Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Mon, 19 Oct 2009 18:34:42 +0000</pubDate>
    </item>
    <item>
      <title>My Bachelor Thesis</title>
      <link>http://blog.blackhc.net/2009/10/my-bachelor-thesis/index.html</link>
      <description>&lt;figure&gt;&#xA;&lt;img src=&#34;/images/2009-10-17-my-bachelor-thesis/frontshot-300x238.png&#34; alt=&#34;Screenshot of Utah&#34; /&gt;&lt;figcaption&gt;Screenshot of Utah&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;For the last two months I have been working on my bachelor thesis at the Chair of Computer Graphics and Visualization. It is about &amp;quot;Multi-Tile Terrain Rendering with OGL/Equalizer&amp;quot;. The chair has a very nice Direct3D 10 terrain rendering engine and they want to run it at the newly founded KAUST (King Abdullah University of Science and Technology) in a massive CAVE environment. A CAVE is a room whose walls are actually screens. The CAVE at KAUST even supports stereoscopic rendering, so in total 12 screens that you need to render to.&lt;/p&gt;&#xA;&lt;p&gt;My job was to port a terrain engine from Direct3D to OpenGL and afterwards to the Equalizer framework, which is an open-source framework for parallelizing OpenGL applications.&lt;/p&gt;&#xA;&lt;p&gt;You can find/download an online version of my bachelor thesis &lt;a href=&#34;http://data.blog.blackhc.net/2009/10/BachelorThesisOnline.pdf&#34;&gt;here&lt;/a&gt;. I&#39;ll upload the LaTeX at a later date and update this post.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve spent the last months writing about all this, so I don&#39;t feel like talking about the thesis itself anymore. Instead the remainder of this post will contain a post-mortem of it. &lt;!-- more --&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;post-mortem&#34;&gt;Post-Mortem&lt;/h3&gt;&#xA;&lt;h4 id=&#34;preparations&#34;&gt;Preparations&lt;/h4&gt;&#xA;&lt;p&gt;I think I did a good job at preparing myself for the thesis: I&#39;m a LaTex noob, so I got 4 LaTeX books; and I&#39;m a (paper-)writing noob, so I got 3 books about writing papers and writing good English.&lt;/p&gt;&#xA;&lt;p&gt;The books have helped me a lot and it is always a good decision to get as many books as possible, because the more sources you have, the better. :)&lt;/p&gt;&#xA;&lt;p&gt;I got pretty much all the LaTeX books from our university library:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.amazon.de/gp/product/389842510X/ref=sib_rdr_dp&#34;&gt;[Einstieg in] LaTeX&lt;/a&gt; A big book (696 pages) but not particularly helpful. The reviewer on Amazon is pretty much right: it contains lots of information., but always stops short of providing the really useful details/information.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.amazon.de/LATEX-GE-PACKT-Karsten-G%C3%BCnther/dp/3826615883/ref=sr_1_6?ie=UTF8&amp;amp;s=books&amp;amp;qid=1255775138&amp;amp;sr=8-6&#34;&gt;LaTeX - Ge-packt&lt;/a&gt; A small but thick pocket book (608 pages). I totally forgot I had it and it stood on my bookshelf until I found it yesterday. I&#39;ve used it though while writing another paper last year, and it&#39;s pretty neat. It&#39;s a nifty reference, that&#39;s what it is.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.amazon.de/LaTeX-Hacks-Techniken-professionellen-Textsatz/dp/3897214776/ref=pd_sim_b_5&#34;&gt;LaTeX Hacks: Tipps und Techniken für professionellen Textsatz&lt;/a&gt; This book is very good. It contains 100 &amp;quot;LaTeX hacks&amp;quot; (on 416 pages). These are small, closed sections describing the solution to a specific problem you might encounter while using LaTeX. I&#39;ve used the book a lot of times and it references many useful LaTeX packages, too---so it&#39;s a good start for searches.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.amazon.de/Wissenschaftliche-Arbeiten-schreiben-LaTeX-CD-ROM/dp/3826658922/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1255777607&amp;amp;sr=1-1&#34;&gt;Wissenschaftliche Arbeiten schreiben mit LATEX&lt;/a&gt; &lt;strong&gt;Get this book&lt;/strong&gt; if you want to write your thesis with LaTeX. It&#39;s incredibly useful and covers most of what you&#39;ll need. It takes you on a journey through all features of LaTeX that you will use and describes the most common use cases. It even has a section describing how to fix common LaTeX errors like overflowed hboxes and others.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;I&#39;ve also bought some books about writing papers and the English language in general:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&#34;http://www.amazon.com/Manual-Writers-Research-Dissertations-Seventh/dp/0226823377/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1255778175&amp;amp;sr=1-1&#34;&gt;A Manual for Writers of Research Papers, Theses, and Dissertations, Seventh Edition: Chicago Style for Students and Researchers&lt;/a&gt; This book covers everything you need to know about the style and format of a thesis. It has a huge chapter about how to add citations and what format the bibligraphy should use, etc. In retrospect reading it was probably overkill, because a bachelor thesis apparently doesn&#39;t have very strict requirements (well, I&#39;ll see about that when I get my feedback..). It, however, contains a few nice chapters about editing your text and improving its readability, and the punctuation and spelling chapters are nice, too.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&#34;http://www.amazon.co.uk/Oxford-Guide-Effective-Writing-Speaking/dp/0192806130/ref=pd_sim_b_1&#34;&gt;Oxford Guide to Effective Writing and Speaking&lt;/a&gt; I&#39;ve only read this book in parts but it&#39;s not bad. It contains a useful introduction to English grammar, if you want to refresh that knowledge.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&#34;http://www.amazon.co.uk/Oxford-Guide-Plain-English-Martin/dp/0199233454/ref=sr_1_11?ie=UTF8&amp;amp;s=books&amp;amp;qid=1255779088&amp;amp;sr=8-11&#34;&gt;Oxford Guide to Plain English&lt;/a&gt; &lt;strong&gt;Get this book&lt;/strong&gt; This book is simply awesome. Plain English refers to writing English in a simple and easily understood way. This book describes what makes a text &#39;plain&#39;/easy to read and how to transform your texts to improve readability. It contains lots and lots of examples of complicated texts and shows how easy it is to improve them with few changes. The book itself is a very nice read and in parts even funny. The author clearly knows what he is teaching and it helped me a lot while writing my bachelor thesis.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h4 id=&#34;writing-the-thesis&#34;&gt;Writing the Thesis&lt;/h4&gt;&#xA;&lt;p&gt;I had two months for the implementation of the project and for writing the thesis. The plan was to implement everything in August and write everything in September and be done at the beginning of October (before my birthday). So last week I ended up being in crunch mode working 15 hours on it every day :-|&lt;/p&gt;&#xA;&lt;p&gt;The implementation went mostly as planned. I found a few driver bugs though, bought &lt;a href=&#34;http://www.gremedy.com/&#34;&gt;gDEBugger&lt;/a&gt; for debugging shader issues and found some bugs in it, too. I think I reported 5-7 bugs in gDEBugger&#39;s support forum in a matter of days and still have to write/extend a few reports.&lt;/p&gt;&#xA;&lt;p&gt;I wrote my thesis in LaTeX and used the very good &lt;a href=&#34;http://www.xm1math.net/texmaker/&#34;&gt;Texmaker&lt;/a&gt; as editor. It supports multiple file projects and allows you to select a main file (usually latex is called with the file that is currently being edited).&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://www.jedit.org/&#34;&gt;jEdit&lt;/a&gt; also supports LaTeX editing through a plugin: &lt;a href=&#34;http://plugins.jedit.org/plugins/?LaTeXTools&#34;&gt;LaTeXTools&lt;/a&gt;. It isn&#39;t working as well as Texmaker though, but it generally has more text editing options and supports directory searches and regexp which is useful for a multi-file project.&lt;/p&gt;&#xA;&lt;p&gt;I used subversion for version management, which proved useful at times, even though TortoiseSVN&#39;s difference viewer doesn&#39;t support line wrapping :(&lt;/p&gt;&#xA;&lt;p&gt;For creating vector graphics, a very cool LaTeX package exists. It&#39;s called &lt;a href=&#34;http://sourceforge.net/projects/pgf/&#34;&gt;TikZ&lt;/a&gt; (&amp;quot;Tikz ist kein Zeichenprogramm&amp;quot;), and it allows you to create illustrations the LaTeX way: by coding them. See &lt;a href=&#34;http://www.texample.net/tikz/examples/&#34; class=&#34;uri&#34;&gt;http://www.texample.net/tikz/examples/&lt;/a&gt; for some neat looking examples.&lt;/p&gt;&#xA;&lt;p&gt;I really wanted to use it to create my illustrations, but due to time constraints I couldn&#39;t read the whole manual (it&#39;s huge!) and even then it would have been too difficult. You see, it suffers from the same problem TeX and LaTeX suffer from in general. It&#39;s easy to write something that looks okay, but as soon as you want to tweak something to look exactly the way you imagine it and it is not a standard option, you end up reading weird package code and wishing you had a Phd in TeX editing.&lt;/p&gt;&#xA;&lt;p&gt;TikZ has exactly the same problem. I understood the tutorials and the manual well enough, but I wanted to create class diagrams with it. I got lost quickly and the 500 page manual didn&#39;t offer a straight-forward way either.&lt;/p&gt;&#xA;&lt;p&gt;In the end, I installed the latest version of &lt;a href=&#34;http://www.inkscape.org/&#34;&gt;Inkscape&lt;/a&gt; and created all my illustrations with it. Well, actually I always tried to create them with TikZ first, got frustrated after losing an hour or two, and spent another hour creating them in Inkscape.&lt;/p&gt;&#xA;&lt;p&gt;While Inkscape makes it harder to change an illustration later on and there is no way to layout diagrams automatically, you can still become quite fast with it after learning a few hotkeys.&lt;/p&gt;&#xA;&lt;p&gt;I wanted to use Eclipse and &lt;a href=&#34;http://www.uml2.org/download_studio_eclipse_3.4.html&#34;&gt;Omondo&#39;s UML plugin&lt;/a&gt; to create some diagrams of a Java subproject and it failed horribly..&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;Having to wait 20 minutes, while it hogs your computer at 100% CPU usage and 400 MB memory usage, to create a UML model of a 5 classes project is quite unacceptable!&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Starting Eclipse later crashed it every time, too, by the way. I had to uninstall the damned plugin for Eclipse to start at all again.&lt;/p&gt;&#xA;&lt;p&gt;In the end I recreated the classes in C++ and used Visual Studio&#39;s class diagram viewer to display the classes. You can then print the diagram to PDF and edit it some more in Inkscape, which supports importing single-page PDFs.&lt;/p&gt;&#xA;&lt;p&gt;I hope I&#39;ll find time to write about game development related topics again in the next weeks. There are a few things I want to work on, but sadly university starts on Monday again and it will probably use up most of my time.&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br /&gt;&#xA; Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sat, 17 Oct 2009 13:43:19 +0000</pubDate>
    </item>
    <item>
      <title>Sploidz Revisited (Unofficially)</title>
      <link>http://blog.blackhc.net/2009/08/sploidz-revisited/index.html</link>
      <description>&lt;p&gt;I&#39;ve already written about the semi-conductor project and how I&#39;ve written some Flash animations/applications for it. Of course, I&#39;m more interested in making fun stuff&lt;a href=&#34;#fn1&#34; class=&#34;footnoteRef&#34; id=&#34;fnref1&#34;&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt;, so I&#39;ve decided to put my knowledge to good use and write a small game to see how difficult/awkward Flash actually is.&lt;/p&gt;&#xA;&lt;p&gt;To sum it up, it is somewhat awkward, at least if you use the IDE itself. FlashDevelop still is as nice as ever, but you can quickly develop games nonetheless. I prefer Torque Game Builder though in retrospect.&lt;/p&gt;&#xA;&lt;p&gt;Before I continue talking about the development itself, let&#39;s take a look at the actual game. &lt;a href=&#34;http://www.redthumbgames.com/sploidz/&#34;&gt;Sploidz&lt;/a&gt; was the first game I wrote using Torque Game Builder for Joshua Dallman, and since I still had all the assets in my subversion repository, it was an easy decision to try and port this game. If you want to play it, you can download it for &lt;strong&gt;free&lt;/strong&gt; &lt;a href=&#34;http://www.redthumbgames.com/sploidz/&#34;&gt;here&lt;/a&gt;. I haven&#39;t ported everything: I&#39;ve just rewritten the main characteristic features that make up Sploidz&#39;s code in ActionScript.&lt;/p&gt;&#xA;&lt;p&gt;Without further ado, here is the game:&lt;/p&gt;&#xA;&lt;object id=&#34;SploidzCC&#34; classid=&#34;clsid:d27cdb6e-ae6d-11cf-96b8-444553540000&#34; width=&#34;512&#34; height=&#34;384&#34; codebase=&#34;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0&#34;&gt;&#xA;&lt;param name=&#34;align&#34; value=&#34;middle&#34;&gt;&lt;param name=&#34;allowFullScreen&#34; value=&#34;true&#34;&gt;&lt;param name=&#34;quality&#34; value=&#34;high&#34;&gt;&lt;param name=&#34;bgcolor&#34; value=&#34;#ffffff&#34;&gt;&lt;param name=&#34;src&#34; value=&#34;images/overflow/2009/08/SploidzCC.swf&#34;&gt;&lt;param name=&#34;name&#34; value=&#34;SploidzCC&#34;&gt;&lt;param name=&#34;allowfullscreen&#34; value=&#34;true&#34;&gt;&lt;embed id=&#34;SploidzCC&#34; type=&#34;application/x-shockwave-flash&#34; width=&#34;512&#34; height=&#34;384&#34; src=&#34;/images/overflow/2009/08/SploidzCC.swf&#34; name=&#34;SploidzCC&#34; bgcolor=&#34;#ffffff&#34; quality=&#34;high&#34; allowfullscreen=&#34;true&#34; align=&#34;middle&#34;&gt;&#xA;&lt;/object&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://data.blog.blackhc.net/2009/08/Sploidz.swf&#34;&gt;Click to open Sploidz in its own window&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Because the art is still copyrighted and I haven&#39;t heard back from Joshua yet, I decided to create a free version that only uses &amp;quot;coder art&amp;quot; :-)&lt;/p&gt;&#xA;&lt;p&gt;Mr. jRAD has said that this version looks cuter, decide for yourself:&lt;/p&gt;&#xA;&lt;object id=&#34;SploidzCC&#34; classid=&#34;clsid:d27cdb6e-ae6d-11cf-96b8-444553540000&#34; width=&#34;512&#34; height=&#34;384&#34; codebase=&#34;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0&#34;&gt;&#xA;&lt;param name=&#34;align&#34; value=&#34;middle&#34;&gt;&lt;param name=&#34;allowFullScreen&#34; value=&#34;true&#34;&gt;&lt;param name=&#34;quality&#34; value=&#34;high&#34;&gt;&lt;param name=&#34;bgcolor&#34; value=&#34;#ffffff&#34;&gt;&lt;param name=&#34;src&#34; value=&#34;images/overflow/2009/08/SploidzCC.swf&#34;&gt;&lt;param name=&#34;name&#34; value=&#34;SploidzCC&#34;&gt;&lt;param name=&#34;allowfullscreen&#34; value=&#34;true&#34;&gt;&lt;embed id=&#34;SploidzCC&#34; type=&#34;application/x-shockwave-flash&#34; width=&#34;512&#34; height=&#34;384&#34; src=&#34;/images/overflow/2009/08/SploidzCC.swf&#34; name=&#34;SploidzCC&#34; bgcolor=&#34;#ffffff&#34; quality=&#34;high&#34; allowfullscreen=&#34;true&#34; align=&#34;middle&#34;&gt;&#xA;&lt;/object&gt;&#xA;&lt;p&gt;&lt;a href=&#34;/images/overflow/2009/08/SploidzCC.swf&#34;&gt;Click to open SploidzCC in its own window&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Below you&#39;ll find a description of the development and at least one helpful trick and most importantly a link to the source code of the &amp;quot;copyright-free&amp;quot; version.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Because the orginal version is way too difficult to be really fun, I actually sat down one more time and added code to make the platform slower if you&#39;re in danger of losing (up to 3 times slower):&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;object id=&#34;SploidzMoreFun&#34; classid=&#34;clsid:d27cdb6e-ae6d-11cf-96b8-444553540000&#34; width=&#34;512&#34; height=&#34;384&#34; codebase=&#34;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0&#34;&gt;&#xA;&lt;param name=&#34;align&#34; value=&#34;middle&#34;&gt;&lt;param name=&#34;allowFullScreen&#34; value=&#34;true&#34;&gt;&lt;param name=&#34;quality&#34; value=&#34;high&#34;&gt;&lt;param name=&#34;bgcolor&#34; value=&#34;#ffffff&#34;&gt;&lt;param name=&#34;src&#34; value=&#34;images/overflow/2009/08/SploidzMoreFun.swf&#34;&gt;&lt;param name=&#34;name&#34; value=&#34;SploidzMoreFun&#34;&gt;&lt;param name=&#34;allowfullscreen&#34; value=&#34;true&#34;&gt;&lt;embed id=&#34;SploidzMoreFun&#34; type=&#34;application/x-shockwave-flash&#34; width=&#34;512&#34; height=&#34;384&#34; src=&#34;/images/overflow/2009/08/SploidzMoreFun.swf&#34; name=&#34;SploidzMoreFun&#34; bgcolor=&#34;#ffffff&#34; quality=&#34;high&#34; allowfullscreen=&#34;true&#34; align=&#34;middle&#34;&gt;&#xA;&lt;/object&gt;&#xA;&lt;p&gt;&lt;a href=&#34;/images/overflow/2009/08/SploidzMoreFun.swf&#34;&gt;Click to open SploidzMoreFun in its own window&lt;/a&gt;&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xA;&lt;h3 id=&#34;development&#34;&gt;Development&lt;/h3&gt;&#xA;&lt;p&gt;I think I spent less than 20 hours on the project. It&#39;s hard to say because I worked on it on three different days, but only probably less than 6 hours on each.&lt;/p&gt;&#xA;&lt;p&gt;The main problems during the development were:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How do I get the art assets into Flash?&lt;/li&gt;&#xA;&lt;li&gt;How do I use the IDE and objects in a way that is helpful?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Lessons learned:&lt;/p&gt;&#xA;&lt;p&gt;Even though the project isn&#39;t that big, it didn&#39;t take long for annoying bugs to appear - mainly in the matching code, because it&#39;s somewhat asynchronous and you have to make sure that an item doesn&#39;t get removed between events, etc. So again, I can only say that assertions and lots of debug messages are your friend and are really useful for understanding the sometimes mysterious ways of non-obvious code interaction.&lt;/p&gt;&#xA;&lt;p&gt;Again one of the biggest headache was how to make the game a game and this resulted in implementing the platform game element from the original Sploidz game, although I wanted to avoid that in the beginning because of the added complexity. Roy pointed out though, that if you have 8 columns and only 5 different item types, the main idea of matching items becomes trivial. It&#39;s obvious, but I didn&#39;t think of it while coding the proof of concept code. Of course you have to somewhat tune the speed and animation durations of everything to make it playable. The game is really hard at the moment, but that&#39;s better than too easy and I especially added the &amp;quot;survival timer&amp;quot; in the upper right panel to allow for some competition and personal best times. I might change the platform code at some point to be more player-friendly, but I have more pressing projects to do at the moment: my Bachelor Thesis... /o.&lt;/p&gt;&#xA;&lt;p&gt;As said above, I actually sat down and added a time scaler to the platform. The code is quite simple but helps the game a bit (I managed to survive 2 minutes and it was more challenging and less depressing to play the game ^ ^). The code is quite simple:&lt;/p&gt;&#xA;&lt;pre class=&#34;actionscript&#34;&gt;&lt;code&gt;public function getPlatformTimeScale():Number {&#xA;    var maxRow:int = 0;&#xA;    for ( var column:int = 0 ; column &amp;lt; Grid.numColumns ; column++ ) {&#xA;        var firstEmptyRow:int = grid.getFirstEmptyCellRow( column );&#xA;        if ( firstEmptyRow &amp;gt; maxRow ) {&#xA;            maxRow = firstEmptyRow;&#xA;        }&#xA;    }&#xA;&#xA;    const minScale:Number = 1.0;&#xA;    const maxScale:Number = 3.0;&#xA;    var scale:Number = minScale + (maxScale - minScale) * Math.pow( maxRow / (Grid.numRows - 1), 8 );&#xA;    trace( &amp;quot;Using platform scale: &amp;quot; + scale );&#xA;    return scale;&#xA;}&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;As you see, it uses a power function to make the platform slower only if really few empty rows are left.&lt;/p&gt;&#xA;&lt;h4 id=&#34;interesting-things-to-know&#34;&gt;Interesting things to know&lt;/h4&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If you want to important a sequence of images (say you have an animation stored as picture frames &lt;code&gt;diamond_black00.png&lt;/code&gt; to &lt;code&gt;diamond_black15.png&lt;/code&gt;, only select the first image when &amp;quot;importing to stage&amp;quot; in Flash, otherwise you won&#39;t get the dialog asking you whether you want to import an image sequence as animation.&lt;/li&gt;&#xA;&lt;li&gt;If you have animations that stores multiple frames in one image, you&#39;ll have to split the images up into the respective frames. To do this in Photoshop make use of &amp;quot;guides&amp;quot; and slicing and notice the &amp;quot;Slices from Guides&amp;quot; button that is offered. It&#39;s really helpful. You can also store the creation of the guides and the slicing as action/macro and reuse it which also saves some time.&lt;/li&gt;&#xA;&lt;li&gt;If you ever get the error &amp;quot;type was not defined or was not a compile-time constant&amp;quot;, you might have a symbol instance that has the same name and class name. Flash freaks out for some reason and displays this weird error message.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;For added fanciness, I&#39;ve also included two older builds that show the evolution of the game code.&lt;/p&gt;&#xA;&lt;p&gt;Note: There are bugs in these builds, so they are really just meant to show the progress on the first and second day.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://data.blog.blackhc.net/2009/08/Sploidz0810.swf&#34;&gt;Click to open Sploidz0810 in its own window&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://data.blog.blackhc.net/2009/08/Sploidz0813.swf&#34;&gt;Click to open Sploidz0813 in its own window&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Fun note: I implemented most of the fancy features (combo matches, the score bubbles, the platform) today in a few hours (a lot less than expected). I think ActionScript is an okay language, although it lacks quite a few comfort features of regular modern programming languages (eg function overloading or delegate types that actually check parameter type).&lt;/p&gt;&#xA;&lt;p&gt;Last but not least here is the link to the code: &lt;a href=&#34;http://data.blog.blackhc.net/2009/08/FlashySploidz.zip&#34;&gt;FlashySploidz Source&lt;/a&gt; I release the code itself under GPL and the art under Common Creative.&lt;/p&gt;&#xA;&lt;p&gt;Over and out, Andreas&lt;/p&gt;&#xA;&lt;section class=&#34;footnotes&#34;&gt;&#xA;&lt;hr /&gt;&#xA;&lt;ol&gt;&#xA;&lt;li id=&#34;fn1&#34;&gt;&lt;p&gt;of course, the math stuff is also fun from a different point of view&lt;a href=&#34;#fnref1&#34;&gt;↩&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/section&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sun, 23 Aug 2009 09:08:26 +0000</pubDate>
    </item>
    <item>
      <title>More Book Reviews and re: Design Patterns</title>
      <link>http://blog.blackhc.net/2009/08/more-book-reviews-and-re-design-patterns/index.html</link>
      <description>&lt;h3 id=&#34;pattern-oriented-software-architecture---a-system-of-patterns-posa-i&#34;&gt;&lt;a href=&#34;http://www.amazon.com/Pattern-Oriented-Software-Architecture-System-Patterns/dp/0471958697&#34;&gt;Pattern-Oriented Software Architecture - A System of Patterns&lt;/a&gt; (PoSA I)&lt;/h3&gt;&#xA;&lt;p&gt;I&#39;ve finally finished &lt;a href=&#34;http://www.amazon.com/Pattern-Oriented-Software-Architecture-System-Patterns/dp/0471958697&#34;&gt;Pattern-Oriented Software Architecture - A System of Patterns&lt;/a&gt; and I want to say a few words about it.&lt;/p&gt;&#xA;&lt;p&gt;First I don&#39;t think, it&#39;s a must-buy. It&#39;s okay to read (but more about that in a minute) and certainly it can come in handy to look up patterns while developing, but if you have small budget, it&#39;s better to get it from a library.&lt;/p&gt;&#xA;&lt;p&gt;The book can be roughly divided into 4 parts: &lt;em&gt;architectural patterns&lt;/em&gt;, &lt;em&gt;design patterns&lt;/em&gt;, &lt;em&gt;idioms&lt;/em&gt;, &amp;quot;trivia&amp;quot;.&lt;/p&gt;&#xA;&lt;p&gt;The chapter about architectural patterns is the most interesting, where as the chapter about design patterns is okay, too, but also borrow or expands upon lots of concepts from the &lt;a href=&#34;http://www.amazon.com/Design-Patterns-Object-Oriented-Addison-Wesley-Professional/dp/0201633612&#34;&gt;GoF book&lt;/a&gt;. The idioms chapter only contains one idiom (think small, language-specific &amp;quot;design pattern&amp;quot;, e.g. reference counting in C++).&lt;/p&gt;&#xA;&lt;p&gt;The &amp;quot;trivia&amp;quot; part contains information what pattern are, who came up with the idea, influences, the community, yada yada. The most interesting topic being the community and links in there.&lt;/p&gt;&#xA;&lt;p&gt;The book itself is quite boring to read and the patterns are described in endless detail, which is good, if you want to look things up and avoid common mistakes. On the other hand this makes it a book, you should not read front to back, because it doesn&#39;t really make sense and you won&#39;t get a lot out of it either. (I actually read it front to back, and from that experience I draw my advice :-|) Just skim over the patterns, until you find something you don&#39;t know and then read the paragraphs that are interesting until you think you understand the pattern and then read some more to verify that you really understand it, but you can probably skip 40% (or more) of the text, if you just want to learn about new patterns and not go into all the details.&lt;/p&gt;&#xA;&lt;p&gt;Next I&#39;ll try to write a few words about each pattern, so I (and maybe you, too) can look up the pattern here instead of in the book.&lt;/p&gt;&#xA;&lt;p&gt;Note: I just found an awesome page, &lt;a href=&#34;http://vico.org/pages/PatronsDisseny.html&#34; class=&#34;uri&#34;&gt;http://vico.org/pages/PatronsDisseny.html&lt;/a&gt;, that contains information about all patterns in the book, so it doesn&#39;t make sense for me to write about each and every one of them.&lt;/p&gt;&#xA;&lt;h4 id=&#34;architectural-patterns&#34;&gt;Architectural Patterns&lt;/h4&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Layers&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;To sum up 20 pages: it&#39;s good to use a multi-layered architecture in your software.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Pipes and Filters&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;This is something Pragmatic Programmer mentioned, too: Use and support the usage of your tools through pipes and filters. This is mainly something that is common on Unix, but it&#39;s incredibly useful and if you support some standard text I/O helps interoperability with little cost.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://en.wikipedia.org/wiki/Blackboard_system&#34;&gt;Blackboard&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Finally an interesting pattern, it&#39;s also described in Pragmatic Programmer, but you can read the description here, too, because it&#39;s a quite interesting pattern.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Broker&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Model-View-Controller&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&#34;http://en.wikipedia.org/wiki/Presentation-abstraction-control&#34;&gt;Presentation-Abstraction-Control&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;This one is interesting and worth having heard of. It&#39;s similar to MVC above, but more general.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Microkernel&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Reflection&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h4 id=&#34;design-patterns&#34;&gt;Design Patterns&lt;/h4&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Whole-Part&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Master-Slave Anyone who has ever done parallel programming with MPI has used this pattern extensively&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Proxy&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Command Processor A more elaborate version of the Command patten in the GoF book&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;View Handler The pattern describes how to design a document/view manager&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Forwarder-Receiver&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Client-Dispatcher-Server&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Publisher-Subscriber&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h4 id=&#34;idioms&#34;&gt;Idioms&lt;/h4&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Counted Pointer&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Now that I&#39;m done with this, I want to share a few useful resources mentioned in the book:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.hillside.net/patterns&#34; class=&#34;uri&#34;&gt;http://www.hillside.net/patterns&lt;/a&gt; - contains some useful links&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.c2.com/ppr/&#34; class=&#34;uri&#34;&gt;http://www.c2.com/ppr/&lt;/a&gt; - contains a few pattern descriptions&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Personally idioms are very interesting for me, too, because the day-to-day coding work is in a specific language and idioms are exactly about that.&lt;/p&gt;&#xA;&lt;p&gt;A little googling already turns up lots of useful sources. For example:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://users.rcn.com/jcoplien/Patterns/C++Idioms/EuroPLoP98.html&#34; class=&#34;uri&#34;&gt;http://users.rcn.com/jcoplien/Patterns/C++Idioms/EuroPLoP98.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms&#34;&gt;http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;There are a few more pattern books that I plan to read, so let&#39;s see how that turns out..&lt;/p&gt;&#xA;&lt;h3 id=&#34;a-manual-for-writers-of-research-papers-theses-and-dissertations&#34;&gt;&lt;a href=&#34;http://www.amazon.com/Manual-Writers-Research-Dissertations-Seventh/dp/0226823377&#34;&gt;A Manual for Writers of Research Papers, Theses, and Dissertations&lt;/a&gt;&lt;/h3&gt;&#xA;&lt;p&gt;This is an awesome book, that explains a lot about how to write research papers and also about all the little details you should pay attention, too. It&#39;s a good read - I spent 1.5 hours a day for a bit more than a week to read through it - and I think it&#39;s going to be quite useful, when I start writing my Bachelor Thesis in a few days.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;m currently writing some &lt;a href=&#34;http://www.antlr.org/&#34;&gt;ANTLR&lt;/a&gt; grammar and &lt;a href=&#34;http://www.stringtemplate.org&#34;&gt;StringTemplate&lt;/a&gt; stuff and I might write something about that, too, on the weekend.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;m not sure I&#39;m really happy with ANTLR, but it&#39;s probably the best thing out there at the moment, but I&#39;m totally in love with StringTemplate, even though you might say it has some rough edges, too.&lt;/p&gt;&#xA;&lt;p&gt;But more on that on another day.&lt;/p&gt;&#xA;&lt;p&gt;Over and out,&lt;br /&gt;&#xA; Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Tue, 18 Aug 2009 08:44:12 +0000</pubDate>
    </item>
    <item>
      <title>PowerPointLaTeX Update</title>
      <link>http://blog.blackhc.net/2009/08/powerpointlatex-update/index.html</link>
      <description>&lt;p&gt;Because people complained to me about the formula feature in my PowerPointLaTeX add-in, which used a somewhat experimental approach to editing formula objects by adding an editing text shape that contained the formula code and that would be merged back into the formula as soon as you deselect it, I decided to rewrite it to use a standard modal dialog to edit formula objects:&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/2009-08-05-powerpointlatex-update/PPTLaTeX_eqeditor.JPG&#34; alt=&#34;Updated Ribbon (above) and Formula Editor Dialog (below)&#34; /&gt;&lt;figcaption&gt;Updated Ribbon (above) and Formula Editor Dialog (below)&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;The editor isn&#39;t perfect (yet), but it certainly shouldn&#39;t add any bugs to the add-in and solve some natural issues the old approach created.&lt;/p&gt;&#xA;&lt;h3 id=&#34;implementation-note&#34;&gt;Implementation Note&lt;/h3&gt;&#xA;&lt;p&gt;The idea was pretty straight-forward but the actual UI design was a PITA due me not knowning the panel/flow/table layout concepts very well and the code still has some annoying quirks with auto-scroll, so I need to fix that later.&lt;/p&gt;&#xA;&lt;p&gt;I almost rewrote the whole cache system, because I&#39;m using a background thread for updating the preview (if the text is changed, a 500 msec timer is started which triggers an update) and the update accesses the cache system, which in turn accesses PowerPoint to return some data, which in turn is busy because of the modal dialog -&amp;gt; &lt;strong&gt;dead-lock&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The solution to this is very simple but was not obvious to me at first (I actually began to rewrite the cache system with a feeling that there should be an easier solution): The background thread needs an Invoke call to update the preview picture because the control has been created by a different thread (the main thread) and the code to get an updated picture can simply be moved into Invoke delegate function.&lt;/p&gt;&#xA;&lt;p&gt;This solved all my problems and made 4 hours of previous work and thinking about a new cache system obsolete :-|&lt;/p&gt;&#xA;&lt;p&gt;Download the new build at: &lt;a href=&#34;http://code.google.com/p/powerpointtools/downloads/list&#34; class=&#34;uri&#34;&gt;http://code.google.com/p/powerpointtools/downloads/list&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br /&gt;&#xA; Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Wed, 05 Aug 2009 00:48:34 +0000</pubDate>
    </item>
    <item>
      <title>Semi-Conductor Optimization (Uni Project)</title>
      <link>http://blog.blackhc.net/2009/08/semi-conductor-optimization-uni-project/index.html</link>
      <description>&lt;p&gt;I&#39;ve written my last exam yesterday (except for two oral exams in September), so now I have got some spare time before I start working on my Bachelor Thesis tomorrow and I want to use it to wrap up a few things.&lt;/p&gt;&#xA;&lt;p&gt;During this term I took part in a course that was both a (research) project/presentation/lecture thing, which was fun but also a lot of work. I&#39;ve already written about one mathematical aspect of it in my post about &lt;a href=&#34;http://blog.blackhc.net/2009/05/analysis-cauchy-schwarz-and-reciprocal-sums/&#34;&gt;Analysis, Cauchy-Schwarz and Reciprocal Sums&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The project was about optimizing semi-conductor wiring placement. We wrote a small paper about our findings and the work it was based one - you can look download it &lt;a href=&#34;http://data.blog.blackhc.net/2009/08/SemiConductorPaper.pdf&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;We also created a self-running presentation that doesn&#39;t contain any Maths at all but makes heavy use of Flash animations (which were exported to .gif manually, which was a huge pain in the ass, which I will never do again if possible) to visualize all the concepts and algorithms.&lt;/p&gt;&#xA;&lt;p&gt;You can download a PowerPoint 2007 (.pptx) version &lt;a href=&#34;http://data.blog.blackhc.net/2009/07/Aufbereitung.pptx&#34;&gt;here&lt;/a&gt; or one that works with PowerPoint 2003 &lt;a href=&#34;http://data.blog.blackhc.net/2009/07/Aufbereitung.ppt&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;For the Student&#39;s I sat down and wrote a small Flash application to show the algorithms at work. It&#39;s not obvious how it works, so let me explain the major points:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;On the right you have a number of panels that you can enlarge by clicking on the small button in the upper right of each panel.&lt;/li&gt;&#xA;&lt;li&gt;The upper three panels show different views of the same dataset. They will all be updated as you run the algorithm step by step.&lt;/li&gt;&#xA;&lt;li&gt;The fourth panel lets you change the number of wires and/or their activity.&lt;/li&gt;&#xA;&lt;li&gt;The last panel shows the electrical field that is created by one active wire in the center. It was created using MatLAB. I&#39;ve also uploaded the script &lt;a href=&#34;http://data.blog.blackhc.net/2009/08/leiter.m&#34;&gt;here&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://data.blog.blackhc.net/2009/08/Abitag.swf&#34;&gt;Abitag&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Last but not least I&#39;ve also uploaded the current version of all my .fla and .as files. You can download it &lt;a href=&#34;http://data.blog.blackhc.net/2009/08/FlashSources.zip&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;ActionScript is a nice language and you can quickly learn it using the &lt;a href=&#34;http://help.adobe.com/en_US/Flash/10.0_Welcome/WS091A3800-D889-4425-B647-C44097B73F34.html&#34;&gt;available resources from Adobe&lt;/a&gt;. While ActionScript 2.0 is arguably weird, ActionScript 3.0 is quite logical and it&#39;s syntax is straight-forward and consistent, too. You can&#39;t say that about the IDE (Flash CS4), which is braindead, but if you&#39;re only interested in writing ActionScript code, &lt;a href=&#34;http://www.flashdevelop.org/&#34;&gt;FlashDevelop&lt;/a&gt; is an excellent and free alternative.&lt;/p&gt;&#xA;&lt;p&gt;This is it for now, maybe I&#39;ll play around with Flash some more another time. Cheers,&lt;br /&gt;&#xA; Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sun, 02 Aug 2009 12:29:55 +0000</pubDate>
    </item>
    <item>
      <title>From Vertex Positions to Packed Element Arrays</title>
      <link>http://blog.blackhc.net/2009/07/from-vertex-positions-to-packed-element-arrays/index.html</link>
      <description>&lt;p&gt;At my new workplace at university I&#39;m currently porting an advanced terrain rendering engine from DirectX to OpenGL. One of the performance optimizations the engine uses is that it draws the terrain tiles right from the index buffer without using a vertex buffer at all - that is it packs the vertex position into the 32-bit index and unpacks it in the vertex shader.&lt;/p&gt;&#xA;&lt;p&gt;Why is this faster than rendering using a vertex buffer and no index buffer?&lt;/p&gt;&#xA;&lt;p&gt;When using an index buffer the graphics card can make use of a cache of already transformed (vertex-shaded) vertices and when an index is reused, it can use the cached result instead of running the vertex shader again. Of course, this only works if there exists a certain temporal locality, but that is given. If no index buffer is used, the vertex cache won&#39;t be used, because the implicit index is different for each vertex.&lt;/p&gt;&#xA;&lt;p&gt;Since I need to port the engine from DirectX to OpenGL, I did some research to see if it is possible to do the same in OpenGL. It&#39;s not really possible but you can achieve something quite similar in OpenGL 3.0.&lt;/p&gt;&#xA;&lt;h3 id=&#34;using-the-input-assembler-stage-without-buffers-opengl&#34;&gt;Using the Input-Assembler Stage without Buffers (OpenGL)&lt;/h3&gt;&#xA;&lt;p&gt;This is meant as OpenGL analogon for &lt;a href=&#34;http://msdn.microsoft.com/en-us/library/bb232912(VS.85).aspx&#34;&gt;Using the Input-Assembler Stage without Buffers (Direct3D 10)&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I think the title is self-explanatory but for greater clarity let me rephrase it: The aim is to render something without using vertex or index buffers, that is (in OpenGL speak) using neither vertex data nor an elements array to render something. Instead the automatically supplied &lt;code&gt;gl_VertexID&lt;/code&gt; attribute (&lt;code&gt;vertexId&lt;/code&gt; in DirectX) is used to determine the vertex the shader is currently processing.&lt;/p&gt;&#xA;&lt;p&gt;The example in MSDN simply draws a triangle using &lt;code&gt;vertexId&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre class=&#34;c&#34;&gt;&lt;code&gt;VSOut VSmain(VSIn input)&#xA;{&#xA;    VSOut output;&#xA;&#xA;    if (input.vertexId == 0)&#xA;        output.pos = float4(0.0, 0.5, 0.5, 1.0);&#xA;    else if (input.vertexId == 2)&#xA;        output.pos = float4(0.5, -0.5, 0.5, 1.0);&#xA;    else if (input.vertexId == 1)&#xA;        output.pos = float4(-0.5, -0.5, 0.5, 1.0);&#xA;&#xA;    output.color = clamp(output.pos, 0, 1);&#xA;&#xA;    return output;&#xA;}&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;If you want to do the same thing in OpenGL, you have at least two problems:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;OpenGL uses &lt;code&gt;glVertex\*&lt;/code&gt; as end marker for the specification of a single vertex and the array rendering commands (&lt;code&gt;glDrawArrays&lt;/code&gt;, &lt;code&gt;glDrawElements&lt;/code&gt;, etc.) all require an enabled vertex array.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;gl_VertexID&lt;/code&gt; is only supplied if:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the vertex comes from a vertex array command that specifies a complete primitive (e.g. DrawArrays, DrawElements)&lt;/li&gt;&#xA;&lt;li&gt;all enabled vertex arrays have non-zero buffer object bindings, and&lt;/li&gt;&#xA;&lt;li&gt;the vertex does not come from a display list, even if the display list was compiled using DrawArrays / DrawElements with data sourced from buffer objects.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;(from &lt;a href=&#34;http://www.opengl.org/registry/specs/EXT/gpu_shader4.txt&#34;&gt;GL_EXT_gpu_shader_4&lt;/a&gt;)&lt;/p&gt;&#xA;&lt;p&gt;There is no way around these requirements, but what you can do is to create dummy vertex buffer with one element, bind it as vertex array and simply draw as many vertices as you want. If you don&#39;t access gl_Vertex there is no way that uninitialized data can affect the shader and although behavior is generally undefined in OpenGL, if you render beyond the vertex buffer size, it has worked so far that I&#39;ve test this on.&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/2009-07-18-from-vertex-positions-to-packed-element-arrays/circle.JPG&#34; alt=&#34;Drawing a circle without accessing gl_Vertex&#34; /&gt;&lt;figcaption&gt;Drawing a circle without accessing gl_Vertex&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;You can download the source code &lt;a href=&#34;http://data.blog.blackhc.net/2009/07/CircleVertexID.zip&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;packing-vertex-positions-into-the-elements-array&#34;&gt;Packing Vertex Positions into the Elements Array&lt;/h3&gt;&#xA;&lt;p&gt;The next step is to start packing and unpacking data in the &lt;code&gt;gl_VertexID&lt;/code&gt;. For this, an integer type and bit operations (shifting and masking at least) are required in the vertex shader, so it requires GLSL 1.30 at least.&lt;/p&gt;&#xA;&lt;p&gt;The code is quite short from my proof of concept project, so I&#39;m pasting the shader here:&lt;/p&gt;&#xA;&lt;pre class=&#34;c&#34;&gt;&lt;code&gt;#version 130&#xA;#extension GL_EXT_gpu_shader4 : enable&#xA;&#xA;out vec4 color;&#xA;&#xA;vec3 unpackVertex(int index) {&#xA;    return vec3( index &amp;amp; 0xFF, (index &amp;gt;&amp;gt; 8 ) &amp;amp; 0xFF, (index &amp;gt;&amp;gt; 16) &amp;amp; 0xFF ) * (2 / 255.0) - vec3(1.0);&#xA;}&#xA;&#xA;void main()&#xA;{&#xA;    vec3 unpackedData = unpackVertex( gl_VertexID );&#xA;    gl_Position = vec4( unpackedData, 1.0 );&#xA;    color = vec4( (unpackedData + 1.0) / 2.0, 1.0 );&#xA;}&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;In main.cpp the equivalent can be found for setting up the elements array:&lt;/p&gt;&#xA;&lt;pre class=&#34;c&#34;&gt;&lt;code&gt;#define packFloat(v) (int(((v) + 1.0) / 2 * 255) &amp;amp; 255)&#xA;#define packVertex(x,y,z) (packFloat( x ) + (packFloat( y ) &amp;lt;&amp;lt; 8 ) + (packFloat( z ) &amp;lt;&amp;lt; 16))&#xA;&#xA;void display(void) {&#xA;    [...]&#xA;&#xA;    unsigned indices[] = {&#xA;    packVertex( 0.0, 0.0, -1.0 ), packVertex( 1.0, 0.0, -1.0 ), packVertex( 1.0, 1.0, -1.0 ),&#xA;    packVertex( 0.0, 0.0, -1.0 ), packVertex( -1.0, 0.0, -1.0 ), packVertex( -1.0, -1.0, -1.0 )&#xA;    };&#xA;    glDrawElements( GL_TRIANGLES, sizeof( indices ) / sizeof( *indices ), GL_UNSIGNED_INT, indices );&#xA;&#xA;    [...]&#xA;}&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;For the code to actually make sense I should initialize an index buffer/elements array buffer in OpenGL and upload the indices into it but this was just for testing.&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/2009-07-18-from-vertex-positions-to-packed-element-arrays/positionPacking.JPG&#34; alt=&#34;Drawing two triangles by packing their position into the index buffer&#34; /&gt;&lt;figcaption&gt;Drawing two triangles by packing their position into the index buffer&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;You can download the source code &lt;a href=&#34;http://data.blog.blackhc.net/2009/07/IndexPacking.zip&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Note:&lt;/p&gt;&#xA;&lt;p&gt;It has been brought to my attention (thanks Yagero), that on NVIDIA cards the driver currently reduces the element array data size from int to short, which causes the third byte (ie z values in this packing scheme) to always be 0.&lt;/p&gt;&#xA;&lt;p&gt;A fix is to use an element array buffer (index buffer) which prevents the driver from messing with the data size.&lt;/p&gt;&#xA;&lt;p&gt;You can download the adapted source code &lt;a href=&#34;http://data.blog.blackhc.net/2009/07/IndexPackingWBuffer.zip&#34;&gt;here&lt;/a&gt;. To show that it works, I have swapped the x and z component in the packing scheme.&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sat, 18 Jul 2009 17:42:16 +0000</pubDate>
    </item>
    <item>
      <title>Fast Forward</title>
      <link>http://blog.blackhc.net/2009/07/fast-forward/index.html</link>
      <description>&lt;p&gt;I&#39;ve quite a few things I&#39;ve wanted to write about a long time ago and I actually started working on them and taking notes, etc. but never found time for one reason or another to write and publish the actual posts. So this is meant as fast forward of all these text bits.&lt;/p&gt;&#xA;&lt;h2 id=&#34;movies-and-games&#34;&gt;Movies and Games&lt;/h2&gt;&#xA;&lt;h3 id=&#34;memento&#34;&gt;Memento&lt;/h3&gt;&#xA;&lt;p&gt;One awesome movie. I&#39;ve seen it twice already and I still love the movie and its plot. I don&#39;t want to spoil too much of the story, but some will probably inevitable.&lt;/p&gt;&#xA;&lt;p&gt;A few bullet points:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Telling a story in reverse is pretty cool in itself and perfect for the movie&lt;/li&gt;&#xA;&lt;li&gt;I wonder if one could use this kind of plot for a game, too, but it would make the plot quite linear because the player could only do things that won&#39;t change the outcome of the future (i.e. what he has already played).&lt;/li&gt;&#xA;&lt;li&gt;If the game is linear though and goal based it could be possible easily because you would replay it like a movie. If it&#39;s plot-centric, it could be fun and create a kind of suspense similar to Memento.&lt;/li&gt;&#xA;&lt;li&gt;Fahrenheit would be a game that is plot-centric like that..&lt;/li&gt;&#xA;&lt;li&gt;The movie depicts a chaotic system: small imprecision leads to huge consequences (&amp;quot;Don&#39;t believe his lies&amp;quot;).&lt;/li&gt;&#xA;&lt;li&gt;One of the impressions I liked most is the way you have to constantly reevaluate everything you have seen so far because of some new piece of information from the past which totally changes the whole movie a whole time.&lt;/li&gt;&#xA;&lt;li&gt;It&#39;s kind of difficult to remember the movie at first because the human brain is not used to this presentation of causality (seeing the effect before the cause).&lt;/li&gt;&#xA;&lt;li&gt;The movie gets you thinking about what defines yourself - what are you if you can&#39;t remember things anymore and how do you define yourself through your memory.&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;A few weeks ago I read a psychology case book that contained a case similar to Memento. Alcoholics sometimes damage their brain through alcohol abuse and lose all ability to memorize anything new. Their long-term memory only works up until some point of time and after that they won&#39;t remember anything. They constantly live at that moment and will be lost forever.&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;fahrenheit&#34;&gt;Fahrenheit&lt;/h3&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://en.wikipedia.org/wiki/Fahrenheit_(video_game)&#34;&gt;Fahrenheit&lt;/a&gt; is a pretty cool. Like many movies it is excellent for 90% of the playtime and then it suddenly starts to suck and/or becomes very weird story-wise.&lt;/p&gt;&#xA;&lt;p&gt;It&#39;s not a typical game as more a cinematic experience that does a good job at combining gaming aspects with a very advanced plot and some pretty awesome action scenes.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve really enjoyed the game and just like &lt;a href=&#34;http://en.wikipedia.org/wiki/Omikron:_The_Nomad_Soul&#34;&gt;Omikron: The Nomad Soul&lt;/a&gt; (an earlier game by developer &lt;a href=&#34;http://www.quanticdream.com/&#34;&gt;Quantic Dream&lt;/a&gt;) it&#39;s positively refreshing and different.&lt;/p&gt;&#xA;&lt;p&gt;Some random notes:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Vista compatibility sucks. I had to download a hacked binary to make it start at all on Vista. Otherwise it ran fine except for one crash that was due to my notebook overheating slightly.&lt;/li&gt;&#xA;&lt;li&gt;Like in many other games you can&#39;t skip cut scenes or dialogs easily which is annoying if you just want to replay a chapter up to a certain point&lt;/li&gt;&#xA;&lt;li&gt;More annoyingly it seems that if you replay an earlier chapter, you have to replay the ones following it, too. Be careful with that :-|&lt;/li&gt;&#xA;&lt;li&gt;As said - the story is awesome until you have played 90% of the game then it turns a bit into being on the bizarre side of things[[:especially the internet &amp;quot;A.I.&amp;quot; :o]].&lt;/li&gt;&#xA;&lt;li&gt;Also &amp;quot;Hiding at Tiffany&#39;s&amp;quot; is awful. If you ever play the game be ready to replay it a few times: You have to hide at Tiffany&#39;s place from someone who is searching for, and you have 30 seconds or so to find a hiding place, after which the person starts searching for. The problem is that you don&#39;t know where the person will search for you and if you are caught, you obviously won&#39;t see where he would search afterwards, so you have to replay the same part quite a few times if you have bad luck... it was one of the more frustrating parts of the game.&lt;/li&gt;&#xA;&lt;li&gt;Zero Punctuation has a good review of the story issue of Fahrenheit hidden in his review of Condemned 2, it is also funny. &lt;a href=&#34;http://www.escapistmagazine.com/videos/view/zero-punctuation/34-Condemned-2-Bloodshot&#34;&gt;It&#39;s certainly worth watching&lt;/a&gt; :)&lt;/li&gt;&#xA;&lt;li&gt;The way the controls work in Fahrenheit is also pretty interesting. The wikipedia article about Fahrenheit has a good description of it in its Gameplay section.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;books&#34;&gt;Books&lt;/h2&gt;&#xA;&lt;h3 id=&#34;the-pragmatic-programmer&#34;&gt;The Pragmatic Programmer&lt;/h3&gt;&#xA;&lt;p&gt;Last year I think I wrote that I had started reading &amp;quot;&lt;a href=&#34;http://www.pragprog.com/the-pragmatic-programmer&#34;&gt;The Pragmatic Programmer&lt;/a&gt;&amp;quot;. I actually finished reading it quite a while ago, but here are a few remarks about it:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It&#39;s a good and nice read and the book contains lots of helpful suggestions and things to keep in mind when coding or designing software or even just when you want to communicate with co-workers, etc.&lt;/li&gt;&#xA;&lt;li&gt;It&#39;s a &amp;quot;common sense&amp;quot; book - similar to Code Complete - and when you read it, you&#39;ll often think &amp;quot;that&#39;s straight-forward&amp;quot; or &amp;quot;that&#39;s the logical thing to do&amp;quot;, but it still valuable to have all that common sense written down somewhere and to be able to look at it now and then in search for inspiration.&lt;/li&gt;&#xA;&lt;li&gt;It&#39;s not as useful as Code Complete though, which was a real eye opener (and still is) and it&#39;s not going to improve your coding style a lot or the way to think about code design.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;opengl-superbible&#34;&gt;OpenGL Superbible&lt;/h3&gt;&#xA;&lt;p&gt;I&#39;ve bought the &amp;quot;&lt;a href=&#34;http://www.openglsuperbible.com/&#34;&gt;OpenGL Superbible&lt;/a&gt;&amp;quot; and it&#39;s a pretty good book if you want to learn OpenGL or read a light text about certain advanced OpenGL features before rolling up your sleeves and digging around in the extension specs. It&#39;s written like a big and pretty complete tutorial and the latest edition is a lot better suited for the new features than, say, the latest edition of the &lt;a href=&#34;http://www.opengl.org/documentation/red_book/&#34;&gt;OpenGL Programming Guide&lt;/a&gt; (which is pretty horrible - I&#39;ve read through the sixth edition and it&#39;s pretty much the second edition plus a paragraph tacked on here and there and long explanations of deprecated features).&lt;/p&gt;&#xA;&lt;p&gt;The only part of the book that is really, really weak and totally useless is the part about GLSL and shader programming. It contains a short description about GLSL and while the chapter summary mentions functions like glUniform and co, the function is not mentioned anywhere in the chapter nor does it provide even one example on how to set or access vertex attributes or uniforms, which is essential.&lt;/p&gt;&#xA;&lt;p&gt;If you want to learn about GLSL and shader programming in OpenGL I can only recommend the OpenGL Shading Language and the GLSL language specifications.&lt;/p&gt;&#xA;&lt;h3 id=&#34;multi-core-programming&#34;&gt;Multi-Core Programming&lt;/h3&gt;&#xA;&lt;p&gt;First &lt;strong&gt;don&#39;t buy this book&lt;/strong&gt;. It&#39;s from Intel Press (you can read the book description &lt;a href=&#34;http://www.intel.com/intelpress/sum_mcp.htm&#34;&gt;here&lt;/a&gt;) and it&#39;s ridiculously expensive for the content it provides.&lt;/p&gt;&#xA;&lt;p&gt;I got it for free at university presentation from Intel and have read through most of it in the last weeks and really - if you want to learn about OpenMP and threading techniques and tools, there are better sources available online for free.&lt;/p&gt;&#xA;&lt;h3 id=&#34;real-time-rendering&#34;&gt;Real-Time Rendering&lt;/h3&gt;&#xA;&lt;p&gt;This book on the other hand is &lt;strong&gt;awesome&lt;/strong&gt; - buy it if you are interested in computer graphics and want to understand the underlying principles better. It&#39;s well-written and presents lots of advanced computer graphics topics in a very understandable way. Especially the chapters about local and global illumination and the physical base of them are very good. It is good starting point to look for resources and papers and the book&#39;s homepage is also pretty useful: &lt;a href=&#34;http://realtimerendering.com/&#34; class=&#34;uri&#34;&gt;http://realtimerendering.com/&lt;/a&gt;.&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sat, 18 Jul 2009 14:50:42 +0000</pubDate>
    </item>
    <item>
      <title>Extending Java and Javac</title>
      <link>http://blog.blackhc.net/2009/06/extending-java-and-javac/index.html</link>
      <description>&lt;p&gt;Today I want to write about something I&#39;ve been working ages ago - specifically in March I wanted to see if I can extend a Java compiler to support &lt;a href=&#34;https://en.wikipedia.org/wiki/Language_Integrated_Query&#34;&gt;LINQ&lt;/a&gt; expressions, too.&lt;/p&gt;&#xA;&lt;p&gt;I probably spend more time on finding a good open-source compiler to experiment with than I later spent on trying things out, so let me share my preferred source with you: &lt;a href=&#34;http://openjdk.java.net/&#34; class=&#34;uri&#34;&gt;http://openjdk.java.net/&lt;/a&gt; is a good address to start with. More specifically &lt;a href=&#34;http://openjdk.java.net/groups/compiler/&#34; class=&#34;uri&#34;&gt;http://openjdk.java.net/groups/compiler/&lt;/a&gt; contains some valuable information about the way the compiler works. A nice thing is that there is a branch that has added support for &lt;a href=&#34;http://www.antlr.org/&#34;&gt;ANTLR&lt;/a&gt; which makes adding new language features a tad bit easier as you get to change a grammar file instead of having to tweak hand-written lexers and parsers. More info about it can be found at &lt;a href=&#34;http://openjdk.java.net/projects/compiler-grammar/&#34; class=&#34;uri&#34;&gt;http://openjdk.java.net/projects/compiler-grammar/&lt;/a&gt;. You can download the source code from &lt;a href=&#34;http://hg.openjdk.java.net/&#34; class=&#34;uri&#34;&gt;http://hg.openjdk.java.net/&lt;/a&gt; - don&#39;t follow the link to &lt;code&gt;http://hg.openjdk.java.net/compiler-grammar/compiler-grammar&lt;/code&gt;, that one will only allow you to download part of the branch (and nothing interesting either, which was very frustrating at the beginning).&lt;/p&gt;&#xA;&lt;p&gt;I didn&#39;t come around to add support for LINQ in the end, but to get known to the compiler and the ANTLR grammer, I added support for the &lt;code&gt;var&lt;/code&gt; keyword as known from C#, which allows for automatic type deduction and for &lt;strong&gt;anonymous objects&lt;/strong&gt; (again using the C# syntax). Thus my changes allowed for the following to compile and execute correctly:&lt;/p&gt;&#xA;&lt;pre class=&#34;java&#34;&gt;&lt;code&gt;public class Test {&#xA;    public static void main(String[] args) {&#xA;        // automatic type deduction&#xA;        var t = Math.atan(1);&#xA;        System.out.println( t );&#xA;&#xA;        // anonymous type&#xA;        var i = new { Amount = 108, message = &amp;quot;hello&amp;quot; };&#xA;        System.out.println( i.Amount );&#xA;    }&#xA;}&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;!-- more --&gt;&#xA;&lt;h3 id=&#34;automatic-type-deduction&#34;&gt;Automatic Type Deduction&lt;/h3&gt;&#xA;&lt;p&gt;Let&#39;s take a look at how I added support for the &lt;code&gt;var&lt;/code&gt; keyword, which requires an initializer at the variable declaration and automatically deduces the type used and uses that.&lt;/p&gt;&#xA;&lt;p&gt;This itself is not a feature that I&#39;d actually recommend using in general because it obfuscates a variable&#39;s type[[:obviously...]] and makes it harder to read and understand the code but in conjunction with LINQ and anonymous types, it is very useful, because you don&#39;t want to know the type of the query[[:and you actually can&#39;t if the result is based on an anonymous type]].&lt;/p&gt;&#xA;&lt;p&gt;The nice thing about ANTLR is that it&#39;s.. &lt;em&gt;nice&lt;/em&gt;. I&#39;m going post the diff from my repository to show how easy it was to add support for the &lt;code&gt;var&lt;/code&gt; keyword in the grammar file:&lt;/p&gt;&#xA;&lt;p&gt;It originally looked like this:&lt;/p&gt;&#xA;&lt;pre class=&#34;antlr&#34;&gt;&lt;code&gt;localVariableDeclaration returns [com.sun.tools.javac.util.List list]&#xA;    @init {&#xA;        [...]&#xA;        }&#xA;    @after {&#xA;        [...]&#xA;        }&#xA;    : variableModifiers type&#xA;        {&#xA;            mods = $variableModifiers.tree;&#xA;            type = $type.tree;&#xA;        }&#xA;    va1=variableDeclarator&#xA;        {&#xA;            JCExpression ntype = pu.makeTypeArray(type,$va1.i, $va1.dimPosition, $va1.endPosition);&#xA;            JCStatement ntype1 = T.at($va1.pos).VarDef(mods, $va1.name, ntype, $va1.tree);&#xA;            //pu.storeEnd(ntype1, $va1.stop);&#xA;            ptree = ntype1;&#xA;            listBuffer.append(ntype1);&#xA;        }&#xA;    (cm=&amp;#39;,&amp;#39; va2=variableDeclarator&#xA;        {&#xA;            JCExpression ntype = pu.makeTypeArray(type,$va2.i, $va2.dimPosition, $va2.endPosition);&#xA;            JCStatement ntype1 = T.at($va2.pos).VarDef(mods, $va2.name, ntype, $va2.tree);&#xA;            pu.storeEnd(ptree, $cm);&#xA;            ptree = ntype1;&#xA;            listBuffer.append(ntype1);&#xA;        }&#xA;    )*&#xA;;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I changed it to:&lt;/p&gt;&#xA;&lt;pre class=&#34;antlr&#34;&gt;&lt;code&gt;localVariableDeclaration returns [com.sun.tools.javac.util.List list]&#xA;    @init {&#xA;        [...]&#xA;    }&#xA;    @after {&#xA;        [...]&#xA;    }&#xA;    : variableModifiers&#xA;        {&#xA;            mods = $variableModifiers.tree;&#xA;        }&#xA;    (VAR |&#xA;    type&#xA;        {&#xA;            type = $type.tree;&#xA;        }&#xA;    )&#xA;&#xA;    va1=variableDeclarator&#xA;        {&#xA;            JCExpression ntype = null;&#xA;            if( type != null )&#xA;                ntype = pu.makeTypeArray(type,$va1.i, $va1.dimPosition, $va1.endPosition);&#xA;            JCStatement ntype1 = T.at($va1.pos).VarDef(mods, $va1.name, ntype, $va1.tree);&#xA;            //pu.storeEnd(ntype1, $va1.stop);&#xA;            ptree = ntype1;&#xA;            listBuffer.append(ntype1);&#xA;        }&#xA;    (cm=&amp;#39;,&amp;#39; va2=variableDeclarator&#xA;        {&#xA;            JCExpression ntype = null;&#xA;            if( type != null )&#xA;                ntype = pu.makeTypeArray(type,$va1.i, $va1.dimPosition, $va1.endPosition);&#xA;            JCStatement ntype1 = T.at($va2.pos).VarDef(mods, $va2.name, ntype, $va2.tree);&#xA;            pu.storeEnd(ptree, $cm);&#xA;            ptree = ntype1;&#xA;            listBuffer.append(ntype1);&#xA;        }&#xA;    )*&#xA;;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The code changes the way a local variable declaration works by using &lt;code&gt;(VAR | type)&lt;/code&gt; instead of &lt;code&gt;type&lt;/code&gt; and later in the grammar the VAR token is added VAR : &#39;var&#39;;  and a lookahead rule also needs to be adapted[[:trial and error ftw...]]:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;localVariableHeader&#xA;    : variableModifiers (type|VAR) IDENTIFIER (&amp;#39;[&amp;#39;&amp;#39;]&amp;#39;)* (&amp;#39;=&amp;#39;|&amp;#39;,&amp;#39;|&amp;#39;;&amp;#39;)&#xA;;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The code doesn&#39;t enforce that a &lt;code&gt;var&lt;/code&gt; variable needs to have an initializer, this is later done in the actual implementation. It would be easy to add a flag to the variableDeclarator but it would require even more changes to the grammar file.&lt;/p&gt;&#xA;&lt;p&gt;Now we only need to run ANTLR and regenerate the parser and lexer from the grammar and we&#39;re done with this part.&lt;/p&gt;&#xA;&lt;p&gt;The main change is in &lt;code&gt;visitVarDef&lt;/code&gt; in &lt;code&gt;MemberEnter&lt;/code&gt; (which completes the &lt;code&gt;Enter&lt;/code&gt; stage - see &lt;a href=&#34;http://openjdk.java.net/groups/compiler/doc/compilation-overview/index.html&#34; class=&#34;uri&#34;&gt;http://openjdk.java.net/groups/compiler/doc/compilation-overview/index.html&lt;/a&gt; for more info):&lt;/p&gt;&#xA;&lt;pre class=&#34;java&#34;&gt;&lt;code&gt;public void visitVarDef(JCVariableDecl tree) {&#xA;    Env localEnv = env;&#xA;    if ((tree.mods.flags &amp;amp; STATIC) != 0 ||&#xA;            (env.info.scope.owner.flags() &amp;amp; INTERFACE) != 0) {&#xA;        localEnv = env.dup(tree, env.info.dup());&#xA;        localEnv.info.staticLevel++;&#xA;    }&#xA;    // old: attr.attribType(tree.vartype, localEnv);&#xA;    // BlackHC: deduce the type from the initializer if we have a variant&#xA;    if( tree.vartype == null ) {&#xA;        if( tree.init != null ) {&#xA;            tree.vartype = make.Type(attr.attribExpr(tree.init, localEnv));&#xA;            tree.vartype.type = tree.init.type;&#xA;        }&#xA;        else {&#xA;            log.error(tree.pos, &amp;quot;initializer.required.for.implicit.type&amp;quot;);&#xA;            return;&#xA;        }&#xA;    }&#xA;    else {&#xA;        attr.attribType(tree.vartype, localEnv);&#xA;    }&#xA;&#xA;    Scope enclScope = enter.enterScope(env);&#xA;    VarSymbol v =&#xA;            new VarSymbol(0, tree.name, tree.vartype.type, enclScope.owner);&#xA;    v.flags_field = chk.checkFlags(tree.pos(), tree.mods.flags, v, tree);&#xA;    tree.sym = v;&#xA;    if (tree.init != null) {&#xA;        v.flags_field |= HASINIT;&#xA;        if ((v.flags_field &amp;amp; FINAL) != 0 &amp;amp;&amp;amp; tree.init.getTag() != JCTree.NEWCLASS) {&#xA;            Env initEnv = getInitEnv(tree, env);&#xA;            initEnv.info.enclVar = v;&#xA;            v.setLazyConstValue(initEnv(tree, initEnv), log, attr, tree.init);&#xA;        }&#xA;    }&#xA;    if (chk.checkUnique(tree.pos(), v, enclScope)) {&#xA;            chk.checkTransparentVar(tree.pos(), v, enclScope);&#xA;        enclScope.enter(v);&#xA;    }&#xA;    annotateLater(tree.mods.annotations, localEnv, v);&#xA;    v.pos = tree.pos;&#xA;}&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The code simply initializes the initializer expression&#39;s type early and sets the variable&#39;s type to it.&lt;/p&gt;&#xA;&lt;p&gt;Because of this Attr&#39;s visitVarDef needs to be adapted to avoid recreating the type later, we have to add a hack but since it&#39;s prototype code it&#39;s not that big an issue. In line 735):&lt;/p&gt;&#xA;&lt;pre class=&#34;java&#34;&gt;&lt;code&gt;// BlackHC: this if condition is a hack to keep anonymous objects, etc. from breaking &amp;gt;_&amp;lt;&#xA;if( tree.init.type != tree.vartype.type )&#xA;    attribExpr(tree.init, initEnv, v.type);&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Now only an additional line needs to be added to res/compiler.properties to add the error message text that should appear if the initializer is missing and we&#39;re done (in line 475):&lt;/p&gt;&#xA;&lt;pre class=&#34;java&#34;&gt;&lt;code&gt;compiler.err.initializer.required.for.implicit.type=&#xA;initializer required for implicitly-typed variables&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I also added a line to com.sun.tools.javac.main.Main&#39;s compile function to display a custom string to make sure that the correct compiler is run, but that&#39;s just cosmetic.&lt;/p&gt;&#xA;&lt;p&gt;With this, a new keyword has been added to the Java compiler with a few lines being changed only. The compiler itself is not that straight-forward to understand if you&#39;re not used to its design, but it&#39;s still amazing that it&#39;s that easy. It took me about 15 hours at most to implement this feature. 80% of the time was spent looking through the code and grammar and identifying how to best add the keyword and implement it.&lt;/p&gt;&#xA;&lt;p&gt;If you want to test your compiler something like the following command-line is needed (on Windows)[[:or you can configure Eclipse accordingly..]]:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;java -cp MyJavaC\bin;antlrworks-1.2.3.jar com.sun.tools.javac.Main Test\Test.java&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h3 id=&#34;anonymous-objects&#34;&gt; Anonymous Objects&lt;/h3&gt;&#xA;&lt;p&gt;This was an even simpler feature to implement that did not require any code changes at all. The change only allows for local &lt;code&gt;var&lt;/code&gt; variables but this is just because we only changed the localVariableDeclaration rule. Adding anonymous objects (ie. &lt;code&gt;new { fieldName = initializer [, ...] }&lt;/code&gt;) is straight-forward once you have automatic type deduction and if you think about it, it&#39;s obvious that it&#39;s nothing but a rewrite of &lt;code&gt;new Object() { public var fieldName = initializer; [...] }&lt;/code&gt;. ANTLR shows its strength here:&lt;/p&gt;&#xA;&lt;pre class=&#34;antlr&#34;&gt;&lt;code&gt;creator returns [JCExpression tree]&#xA;        @init {&#xA;            [...]&#xA;        }&#xA;    : &amp;#39;new&amp;#39; nonWildcardTypeArguments cr1=classOrInterfaceType cl1=classCreatorRest&#xA;        {&#xA;            [...]&#xA;        }&#xA;    | &amp;#39;new&amp;#39; cr2=classOrInterfaceType cl2=classCreatorRest&#xA;        {&#xA;            createdName = $cr2.tree;&#xA;            args = $cl2.list;&#xA;            body = $cl2.tree;&#xA;            $tree = T.at(pos).NewClass(null, typeArgs, createdName, args, body);&#xA;            pu.storeEnd($tree, $cl2.stop);&#xA;        }&#xA;    // BlacHC: add C# anonymous types&#xA;    | &amp;#39;new&amp;#39; &amp;#39;{&amp;#39; typebody=anonymousTypeBody b2=&amp;#39;}&amp;#39;&#xA;        {&#xA;            createdName = T.at(pos).Ident(names.fromString(&amp;quot;Object&amp;quot;));&#xA;            $tree = T.at(pos).NewClass(null, typeArgs, createdName, args, $typebody.tree);&#xA;            pu.storeEnd($tree, $b2);&#xA;        }&#xA;    | arrayCreator&#xA;        {&#xA;            $tree = $arrayCreator.tree;&#xA;        }&#xA;;&#xA;&#xA;anonymousTypeBody returns [JCClassDecl tree]&#xA;        @init {&#xA;            ListBuffer&amp;lt;JCTree&amp;gt; defs = new ListBuffer&amp;lt;JCTree&amp;gt;();&#xA;            JCTree ptree = null;&#xA;            String dc = ((AntlrJavacToken) $start).docComment;&#xA;        }&#xA;        @after {&#xA;            JCModifiers mods = T.at(Position.NOPOS).Modifiers(0);&#xA;            $tree = T.at(((AntlrJavacToken) $start).getStartIndex()).AnonymousClassDef(mods, defs.toList());&#xA;            if (ptree != null) {&#xA;                pu.storeEnd(ptree, $stop);&#xA;            }&#xA;        }&#xA;    : (va1=variableDeclarator&#xA;        {&#xA;            JCVariableDecl tree = T.at($va1.pos).VarDef(T.at(Position.NOPOS).Modifiers(Flags.PUBLIC | Flags.FINAL), $va1.name, null, $va1.tree);&#xA;            pu.attach(tree, dc);&#xA;            ptree = tree;&#xA;            defs.append(tree);&#xA;        }&#xA;    (cm=&amp;#39;,&amp;#39; va2=variableDeclarator&#xA;        {&#xA;            JCVariableDecl tree = T.at(va2.pos).VarDef(T.at(Position.NOPOS).Modifiers(Flags.PUBLIC | Flags.FINAL), $va2.name, null, $va2.tree);&#xA;            pu.storeEnd(ptree, $cm);&#xA;            ptree = tree;&#xA;            pu.attach(tree, dc);&#xA;            defs.append(tree);&#xA;        }&#xA;    )*)?&#xA;;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This is all that is needed. The code is mostly copy&#39;n&#39;pasted from other rules (classOrInterfaceType and classCreatorRest) and it wasn&#39;t really that difficult. The long compile times of ANTLR were the only obstacles when writing it.&lt;/p&gt;&#xA;&lt;h3 id=&#34;try-it&#34;&gt;Try it&lt;/h3&gt;&#xA;&lt;p&gt;I&#39;ve uploaded my current sources (ready to compile and run) and you can download the zip &lt;a href=&#34;http://data.blog.blackhc.net/2009/06/javaext_blog.zip&#34;&gt;here&lt;/a&gt;. Just execute the compileAndRun.bat and my javac and the test should be compiled and run.&lt;/p&gt;&#xA;&lt;h3 id=&#34;what-else&#34;&gt;What Else?&lt;/h3&gt;&#xA;&lt;p&gt;This is it for today. But let me tell you about a few final thoughts:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Hacking away on compiler code and grammar files is a lot fun&lt;/li&gt;&#xA;&lt;li&gt;It&#39;s not feasible for real projects, because you don&#39;t want to start questioning the validity of the compiler you&#39;re using - I had that with QuakeC and it wasn&#39;t fun at all - and chasing compiler bugs is terrible in general when you want to spend your time working on project&#39;s actual code&lt;/li&gt;&#xA;&lt;li&gt;I have started working on a preprocessor that would read in Java code with the extended syntax and emit normal 1.6 Java code. If you want to do something like this, you can probably find a grammar of your language on ANTLR&#39;s homepage - for Java it is: &lt;a href=&#34;http://openjdk.java.net/projects/compiler-grammar/antlrworks/Java.g&#34; class=&#34;uri&#34;&gt;http://openjdk.java.net/projects/compiler-grammar/antlrworks/Java.g&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;This approach is more difficult though because you suddenly lose the nice functionality that gives you an expression&#39;s type for free (which is a non-trivial thing to code on your own if you consider imports and local classes, etc.).&lt;/li&gt;&#xA;&lt;li&gt;It&#39;s best thing to do, if you want to extend the language and it&#39;s a good idea to give it a thought if you have a project whose code could greatly benefit from some additional language features that can be easily emulated using normal code, too.&lt;/li&gt;&#xA;&lt;li&gt;ANTLR is nice for quick prototyping even though the hand-written Java parser and lexer are faster in general.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sun, 21 Jun 2009 00:07:19 +0000</pubDate>
    </item>
    <item>
      <title>\(\epsilon\) Induction</title>
      <link>http://blog.blackhc.net/2009/05/epsilon-induction/index.html</link>
      <description>&lt;p&gt;Induction over natural numbers is a standard tool in Mathematics. But what about doing induction over real numbers (non-negative real numbers)? The structure is different and it&#39;s not immediately clear what is meant, so let me clarify it.&lt;/p&gt;&#xA;&lt;p&gt;Let &lt;span class=&#34;math inline&#34;&gt;\(P(v)\)&lt;/span&gt; be a proposition that we want to show for all &lt;span class=&#34;math inline&#34;&gt;\(v \in \mathbb{R}^+_0\)&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Then we can use the following &amp;quot;induction principle&amp;quot; to prove it:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[ \exists \epsilon \in \mathbb{R}^+ \]&lt;/span&gt; &lt;span class=&#34;math display&#34;&gt;\[ \text{a)} \forall u \in \left [0,\epsilon \right ]: P(u) \]&lt;/span&gt; &lt;span class=&#34;math display&#34;&gt;\[ \text{b)} \forall v \ge \epsilon: \left( \forall u \in \left [0, v - \epsilon \right ]: P(u) \right ) \Rightarrow P(v) \]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;It&#39;s easy to show that this is a correct way to prove it. I&#39;ll use induction over natural numbers to prove it :-)&lt;/p&gt;&#xA;&lt;p&gt;Let &lt;span class=&#34;math inline&#34;&gt;\(I_k := \left [k \cdot \frac \epsilon 2, (k+1) \cdot \frac \epsilon 2 \right ]\)&lt;/span&gt;. Then let&#39;s show by induction over &lt;span class=&#34;math inline&#34;&gt;\(k\)&lt;/span&gt; that &lt;span class=&#34;math inline&#34;&gt;\(\text{(*)} \forall u \in I_k: P(u)\)&lt;/span&gt;:&lt;/p&gt;&#xA;&lt;h4 id=&#34;base&#34;&gt;Base:&lt;/h4&gt;&#xA;&lt;p&gt;From a) it follows that (*) already holds for &lt;span class=&#34;math inline&#34;&gt;\(I_0\)&lt;/span&gt; and &lt;span class=&#34;math inline&#34;&gt;\(I_1\)&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;h4 id=&#34;induction-step-k-ge-2&#34;&gt;Induction Step (&lt;span class=&#34;math inline&#34;&gt;\(k \ge 2\)&lt;/span&gt;):&lt;/h4&gt;&#xA;&lt;p&gt;If (*) holds for &lt;span class=&#34;math inline&#34;&gt;\(I_0, ..., I_{k-1}\)&lt;/span&gt;, then it obviously holds for all &lt;span class=&#34;math inline&#34;&gt;\(u \in \left [ 0, k \cdot \frac \epsilon 2 \right ]\)&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Fix &lt;span class=&#34;math inline&#34;&gt;\(v \in I_k\)&lt;/span&gt;, then &lt;span class=&#34;math inline&#34;&gt;\(v \le (k+1) \cdot \frac \epsilon 2 \Leftrightarrow v - \epsilon \le (k-2) \cdot \frac \epsilon 2 &amp;lt; k \cdot \frac \epsilon 2\)&lt;/span&gt;. With b) it follows that &lt;span class=&#34;math inline&#34;&gt;\(P(v)\)&lt;/span&gt; holds.&lt;/p&gt;&#xA;&lt;p&gt;That is, &lt;span class=&#34;math inline&#34;&gt;\(P(v)\)&lt;/span&gt; &lt;span class=&#34;math inline&#34;&gt;\(\forall v \in I_k\)&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;It should be possible to show that you can generalize this to: &lt;span class=&#34;math display&#34;&gt;\[ \exists \epsilon \in \mathbb{R}^+ \]&lt;/span&gt; &lt;span class=&#34;math display&#34;&gt;\[ \text{a)} \forall u \in \left [0,\epsilon \right ]: P(u) \]&lt;/span&gt; &lt;span class=&#34;math display&#34;&gt;\[ \text{b)} \left( \forall u \in \left [\psi(v), \phi( v ) \right ]: P(u) \right ) \Rightarrow P(v) \]&lt;/span&gt; with &lt;span class=&#34;math inline&#34;&gt;\(\phi( v ): \mathbb{R}^+ \to \mathbb{R}^+_0\)&lt;/span&gt;, &lt;span class=&#34;math inline&#34;&gt;\(\psi( v ): \mathbb{R}^+ \to \mathbb{R}^+_0\)&lt;/span&gt; and &lt;span class=&#34;math inline&#34;&gt;\(\psi(v) \le \phi(v) &amp;lt; v\)&lt;/span&gt;.&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Tue, 26 May 2009 22:25:48 +0000</pubDate>
    </item>
    <item>
      <title>Analysis, Cauchy-Schwarz and Reciprocal Sums</title>
      <link>http://blog.blackhc.net/2009/05/analysis-cauchy-schwarz-and-reciprocal-sums/index.html</link>
      <description>&lt;h3 id=&#34;konkrete-analysis&#34;&gt;Konkrete Analysis&lt;/h3&gt;&#xA;&lt;p&gt;First I want to share some solutions for the exercises of a Maths book. The book is called &lt;a href=&#34;http://www.springer.com/computer/mathematics/book/978-3-540-70845-2&#34;&gt;Konkrete Analysis by Folkmar Bornemann&lt;/a&gt; and is written in German as are my solutions for some of the exercises. (I think I cover about 70% of all exercises in the book and pretty much every easy one :-))&lt;/p&gt;&#xA;&lt;p&gt;I don&#39;t claim that my solutions are correct and there are probably quite a few (uncorrected) mistakes, but right now I haven&#39;t been able to find any other openly available solutions. Although the book claims to be easily readable without attending the lectures of Professor Bornemann, I doubt that it is possible to do so successfully without being able to do the exercises and while doing so being able to get help or look at possible solutions to find new ideas.&lt;/p&gt;&#xA;&lt;p&gt;I did all the exercises as way to prepare myself for the exam (it was very successful alas probably not in the most time efficient way), so it also contains solutions for old exams (but those are appended at the end and probably not interesting at all).&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://data.blog.blackhc.net/2009/05/konkrete-analysis-solutions.pdf&#34;&gt;You can download the PDF konkrete-analysis-solutions here.&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;cauchy-schwarz-and-a-problem&#34;&gt;Cauchy-Schwarz and a Problem&lt;/h3&gt;&#xA;&lt;p&gt;The book is quite useful though as was the lecture &amp;quot;Analysis for Computer Scientists&amp;quot; which was based on the book (or vice-versa) and it is probably the single one lecture that has taught most since I started attending Computer Science at university.&lt;/p&gt;&#xA;&lt;p&gt;One of the many topics (we covered a lot which was one of the nice things) was inequalities and the useful things you can do with them. Especially the Cauchy-Schwarz inequality turns out to be quite useful while being pretty basic:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math inline&#34;&gt;\(&amp;lt; a,b &amp;gt; \leq ||a|| \cdot ||b||\)&lt;/span&gt; with &lt;span class=&#34;math inline&#34;&gt;\(&amp;lt; a , b &amp;gt; = || a || \cdot || b ||\)&lt;/span&gt; when &lt;span class=&#34;math inline&#34;&gt;\(\exists \lambda: a = \lambda b\)&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Interestingly enough this can already yield results that are quite difficult to obtain otherwise. For example we can easily prove some lower or upper bounds by applying it. That is, we can show the existence of a maximum or minimum of some functions.&lt;/p&gt;&#xA;&lt;p&gt;To do this, we first obtain a lower or upper bound (for the right or the left side respectively) and then we can use the equality case to prove the existence of the a minium or maximum.&lt;/p&gt;&#xA;&lt;p&gt;For example, let&#39;s take a look at the following problem:&lt;/p&gt;&#xA;&lt;p&gt;We have &lt;span class=&#34;math display&#34;&gt;\[ x \in \mathbb{R}^n, 0 &amp;lt; x, \sum_{i=1}^n {x_i} = 1 \]&lt;/span&gt; and want to minimize &lt;span class=&#34;math display&#34;&gt;\[ \sum_{i=1}^n { \frac 1 x } \]&lt;/span&gt;. We simply set &lt;span class=&#34;math display&#34;&gt;\[ a_i := \sqrt{x_i}, b_i := \sqrt{ \frac 1 x_i } \]&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;With Cauchy-Schwarz we then get:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[ \sum_{i=1}^n { a_i b_i } = \sum_{i=1}^n { \sqrt{ x_i } \frac 1 {\sqrt{ x_i }} } = \sum_{i=1}^n 1 = n \]&lt;/span&gt; &lt;span class=&#34;math display&#34;&gt;\[ \leq \sqrt{ \sum_{i=1}^n \sqrt{x_i}^2 } \sqrt{ \sum_{i=1}^n \frac 1 {\sqrt{x_i}^2} } = \sqrt { \sum_{i=1}^n x_i } \sqrt{\sum_{i=1}^n \frac 1 x_i } = 1 \cdot \sqrt{\sum_{i=1}^n \frac 1 x_i } \]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;That is: &lt;span class=&#34;math display&#34;&gt;\[ \sum_{i=1}^n \frac 1 x_i \geq n^2 \]&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Now we know an lower bound for the reciprocal sum. To determine the minimal x vector, we remember to start with:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[ a = \lambda b \Leftrightarrow \sqrt x_i = \lambda \frac 1 x_i \Leftrightarrow x_i = \lambda \]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;We use that with the constraint: &lt;span class=&#34;math display&#34;&gt;\[ 1 = \sum_{i=1}^n x_i = \sum_{i=1}^n \lambda = n \cdot \lambda \]&lt;/span&gt;, resulting in: &lt;span class=&#34;math display&#34;&gt;\[ x_i = \lambda = \frac 1 n \]&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;h4 id=&#34;generalization&#34;&gt;Generalization&lt;/h4&gt;&#xA;&lt;p&gt;The nice thing is you can go and generalize this finding to more interesting minimization problems as there also exist more advanced versions of the Cauchy-Schwarz inequality (actually it&#39;s Hölder&#39;s inequality) adding degrees of freedom to play around with (just one DoF in my case).&lt;/p&gt;&#xA;&lt;p&gt;Thus it is possible to solve the following class of problems using a slightly more advanced Cauchy-Schwarz inequality:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[ x,q \in \mathbb{R}^n; 0 &amp;lt; x, q\]&lt;/span&gt; &lt;span class=&#34;math display&#34;&gt;\[0 &amp;lt; \alpha, \gamma &amp;lt; \infty; \beta &amp;gt; 0 \]&lt;/span&gt; &lt;span class=&#34;math display&#34;&gt;\[\large\sum_{i=1}^n {x_i}^\gamma = \beta \]&lt;/span&gt; &lt;span class=&#34;math display&#34;&gt;\[\min \sum_{i=1}^n \frac {q_i} {x_i^\alpha} \]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;by utilizing&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[ \large \sum_{i=1}^n { a_i b_i } \le \sqrt[p]{ \sum_{i=1}^n {a_i^p}} \sqrt[{p}&amp;#39;]{ \sum_{i=1}^n {b_i^{p&amp;#39;}}} \]&lt;/span&gt; with &lt;span class=&#34;math display&#34;&gt;\[ \frac 1 p + \frac 1 {p&amp;#39;} = 1 \]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Equality requires the same linear dependence condition as the normal Cauchy-Schwarz inequation.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve only deduced the solution for &lt;span class=&#34;math inline&#34;&gt;\(\gamma = 1\)&lt;/span&gt; but it shouldn&#39;t be difficult to adapt it once you get the idea how it works (it&#39;s fairly straight forward).&lt;/p&gt;&#xA;&lt;p&gt;You can find the whole deduction in the PDF &lt;a href=&#34;http://data.blog.blackhc.net/2009/05/minimum-of-a-generalized-reciprocal-sum.pdf&#34;&gt;&amp;quot;Minimum of a Generalized Reciprocal Sum&amp;quot;&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;For completeness&#39; sake here are the results for an optimal solution &lt;span class=&#34;math inline&#34;&gt;\(x^{*}\)&lt;/span&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[\large x_i^{*} = \beta \cdot \frac { \sqrt[1 + \alpha]{q_i} }{\sum_{k=1}^n \sqrt[1 + \alpha]{q_k}} \]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[\large \frac { \left ( \sum_{i=1}^n \sqrt[{1 + \alpha}]{q_i} \right )^{1 + \alpha}} {\beta^\alpha}=\sum_{i=1}^n {\frac {q_i} {{x_i^{*}}^\alpha}}\]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;h4 id=&#34;epilog&#34;&gt;Epilog&lt;/h4&gt;&#xA;&lt;p&gt;Coming up with the solution was actually a lot of fun and quite interesting because I didn&#39;t know it was possible to deduce it this way nor did I know how to do it before. If you read the PDF, I think it&#39;s quite nice how you can play around with the formulas and come up with new things from the Cauchy-Schwarz inequality.&lt;/p&gt;&#xA;&lt;p&gt;If you are only interested in &lt;span class=&#34;math inline&#34;&gt;\(x ^ {*}\)&lt;/span&gt;, you can shortcut everything by immediately skipping to the equality case once &lt;span class=&#34;math inline&#34;&gt;\(p\)&lt;/span&gt; and &lt;span class=&#34;math inline&#34;&gt;\(p&amp;#39;\)&lt;/span&gt; have been determined and solve for that. I mainly wrote it all out because I wanted to make sure that it actually was correct.&lt;/p&gt;&#xA;&lt;p&gt;If it wasn&#39;t for my Analysis lecture last term, I probably wouldn&#39;t have found this.&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Thu, 07 May 2009 22:29:48 +0000</pubDate>
    </item>
    <item>
      <title>The Reverse Pigeonhole Principle</title>
      <link>http://blog.blackhc.net/2009/05/the-reverse-pigeonhole-principle/index.html</link>
      <description>&lt;p&gt;Everybody (I hope) knows the pigeonhole principle.&lt;/p&gt;&#xA;&lt;p&gt;In short it states that:&lt;/p&gt;&#xA;&lt;p&gt;If &lt;span class=&#34;math inline&#34;&gt;\(f: N \to M\)&lt;/span&gt; and &lt;span class=&#34;math inline&#34;&gt;\(n:= \left | N \right | \geq \left | M \right | =: m\)&lt;/span&gt;, then there exists at least one &lt;span class=&#34;math inline&#34;&gt;\(m_0\)&lt;/span&gt; with &lt;span class=&#34;math inline&#34;&gt;\(\left | f^{-1}\left ( m_0 \right ) \right | \geq \left \lceil \frac {n} {m} \right \rceil\)&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;For example, if we have n + 1 pigeons in only n pigeonholes, there is (at least) one pigeonhole that has at least two pigeons inside (thus the name).&lt;/p&gt;&#xA;&lt;p&gt;One thing I haven&#39;t seen mentioned anywhere yet (at least not with this name) is the &lt;strong&gt;reverse pigeonhole principle&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;p&gt;If &lt;span class=&#34;math inline&#34;&gt;\(f: N \to M\)&lt;/span&gt; and &lt;span class=&#34;math inline&#34;&gt;\(n := \left | N \right | \geq \left | M \right | =: m\)&lt;/span&gt;, then there exists at least one &lt;span class=&#34;math inline&#34;&gt;\(m_0 \in M\)&lt;/span&gt; with &lt;span class=&#34;math inline&#34;&gt;\(\left | f^{-1}\left ( m_0 \right ) \right | \leq \left \lfloor \frac {n} {m} \right \rfloor\)&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Again an example: if we have n + 1 pigeons (it&#39;s valid up to 2n - 1) and n pigeonholes, then there exists (at least one) pigeonhole with at most one pigeon in it.&lt;/p&gt;&#xA;&lt;p&gt;The proof for the reverse principle is simple:&lt;/p&gt;&#xA;&lt;p&gt;Assume that for all &lt;span class=&#34;math inline&#34;&gt;\(m_0 \in M\)&lt;/span&gt;: &lt;span class=&#34;math inline&#34;&gt;\(\left | f^{-1}\left ( m_0 \right ) \right | &amp;gt; \left \lfloor \frac {n} {m} \right \rfloor\)&lt;/span&gt;, that is each such set contains at least &lt;span class=&#34;math inline&#34;&gt;\(\left \lfloor \frac {n} {m} \right \rfloor + 1\)&lt;/span&gt; elements, then from &lt;span class=&#34;math inline&#34;&gt;\(\frac n m - 1 &amp;lt; \left \lfloor \frac {n} {m} \right \rfloor\)&lt;/span&gt; it follows that:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[ n = \sum_{m_0 \in M} { \left | f^{-1} \left ( m_0 \right ) \right | \geq m \left ( \left \lfloor \frac {n} {m} \right \rfloor + 1 \right ) &amp;gt; m \cdot \frac n m = n } \]&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;This clearly is a contradiction, so the original assumption must have been wrong, which proves the reverse pigeonhole principle.&lt;/p&gt;&#xA;&lt;p&gt;I haven&#39;t seen this written down anywhere before and it&#39;s useful to keep it in my mind on its own because it shortens some arguments, so I hope this might help someone :-)&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br /&gt;&#xA; Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Tue, 05 May 2009 00:36:37 +0000</pubDate>
    </item>
    <item>
      <title>PowerPoint Tools</title>
      <link>http://blog.blackhc.net/2009/04/powerpoint-tools/index.html</link>
      <description>&lt;p&gt;I&#39;ve finally managed to upload a version of my PowerPoint LaTeX add-in for &lt;a href=&#34;http://office.microsoft.com/en-gb/powerpoint/default.aspx&#34;&gt;PowerPoint&lt;/a&gt; 2007.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;m just going to post a short Vimeo video here that shows how inline formulas work (the main feature):&lt;/p&gt;&#xA;&lt;iframe src=&#34;https://player.vimeo.com/video/4442353&#34; width=&#34;480&#34; height=&#34;420&#34; frameborder=&#34;0&#34; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&#xA;&lt;/iframe&gt;&#xA;&lt;p&gt;I&#39;ve tried to work on the add-in during my spring vacation but somehow I have instead spent all my time watching four seasons of House M.D. (which was totally worth it though :-)).&lt;/p&gt;&#xA;&lt;p&gt;There are still some features like support for MikeTeX, code clean-ups, small bugfixes and a preference window that I should work on, but I don&#39;t plan on selling it, so I don&#39;t really care if it&#39;s still somewhat work-in-progress. I&#39;m going to continue working on it when I have to use PowerPoint again.&lt;/p&gt;&#xA;&lt;p&gt;You can check it out (and another add-in dubbed Language Painter that I wrote to fix some annoyances when writing presentations in languages different from your keyboard layout) at &lt;a href=&#34;http://code.google.com/p/powerpointtools/&#34; class=&#34;uri&#34;&gt;http://code.google.com/p/powerpointtools/&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xA;&lt;h3 id=&#34;inter-mortem&#34;&gt;&amp;quot;Inter-Mortem&amp;quot;&lt;/h3&gt;&#xA;&lt;p&gt;I&#39;m not really done with the project but I think it&#39;s time nonetheless to talk about the project itself. Initially I looked into using &lt;a href=&#34;http://texpoint.necula.org/&#34;&gt;TexPoint&lt;/a&gt; for a presentation I had to prepare, but it wasn&#39;t very user-friendly in my opinion and I also didn&#39;t really want to install &lt;a href=&#34;http://miktex.org/&#34;&gt;MiKTeX&lt;/a&gt; again, so the idea was born to use a web service (from codecogs.com or wordpress.com) to render the equations and embed the formulas as pictures. A few tests later I knew that it was feasible, so I started to work on the project.&lt;/p&gt;&#xA;&lt;p&gt;The bulk of the code was written in 4 days during my winter vacation (so that was 4 months ago) - I&#39;ve only added minor things since then.&lt;/p&gt;&#xA;&lt;p&gt;This warrants the question what took me so long to upload it and/or write about it. The main reason why it was delayed by such a long time is that I wanted to polish it some more and make sure it really has a well-rounded feature set. In retrospect I shouldn&#39;t have added support for non-inline equations because people will hardly use them and the way you edit them is kind of crazy (I create a text shape in the current slide to let the user change the equation) and I reverted lots of the later changes because I wasn&#39;t sure which direction to take UI-wise.&lt;/p&gt;&#xA;&lt;p&gt;The user interface is mostly okay in my opinion but the ribbon might need a redesign to streamline it some more and also maybe come up with new things users would want to do. For that I&#39;ll probably wait until I have to use it again (probably in a few weeks&#39; time) and then take notes about what to improve.&lt;/p&gt;&#xA;&lt;p&gt;The design of the code is somewhat messy when you look at it, but that&#39;s because it grew out of a experimental project to see if it was possible to embed LaTeX code the way I wanted, and most of the functionality ended up in one big file/class (LaTeXTool.cs)  because everything is centered around inline formulas.&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Fri, 03 Apr 2009 09:47:10 +0000</pubDate>
    </item>
    <item>
      <title>What I (don&#39;t) like about C#</title>
      <link>http://blog.blackhc.net/2009/03/what-i-dont-like-about-c/index.html</link>
      <description>&lt;p&gt;I&#39;ve been using C# personally quite a bit lately and want to share with you a list of the things I like or don&#39;t about it.&lt;/p&gt;&#xA;&lt;p&gt;First the things I like about it (compared to C++ and Java sometimes):&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;code&gt;out&lt;/code&gt; and &lt;code&gt;ref&lt;/code&gt; keywords are awesome You actually need to use them both when declaring out and reference parameters and in the actual function calls. This really avoids confusion and makes the code clearer compared to the way references are transparently handled in C++.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;a class&#39;s definition and declaration is kept in just one file Avid C++ coders will probably disagree with me here, but I really like this way of coding things. It allows me to code faster and also reduces one source of compiler errors. To be honest I would probably go insane when coding in C++ if it wasn&#39;t for Visual Assist&#39;s nifty &amp;quot;Move Implementation to Source File&amp;quot; and &amp;quot;Create Declaration/Implementation&amp;quot; refactorings. Likewise one could say that C#&#39;s (or .NET&#39;s) notion of assemblies is better and less messy than C/C++&#39;s compilation units.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Properties are simply awesome Properties look like normal member variables but you can write your own getter and setter functions and also give both different access levels, so e.g. you can have a property that is public for reading but protected for writing. Moreover, you can have C# create the code automatically, so you just end up with a way to specify separate access levels.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Read-only variables can be set anywhere in the constructor If you know C++&#39;s initialization lists, you will thank god for this feature, because this feature gives you a lot more freedom and again results in more readable code (at least in my opinion).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;code&gt;override&lt;/code&gt; and &lt;code&gt;new&lt;/code&gt; keywords are really handy Again this is a feature to avoid unnecessary bugs because you get warnings as soon as you &amp;quot;override&amp;quot; a method that doesn&#39;t exist.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;What I don&#39;t like:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;No &lt;code&gt;typedefs&lt;/code&gt; This really bugs me, because the concept of typedefs is a good way to add abstraction to your code and the &lt;code&gt;using&lt;/code&gt; keyword in C# only marginally improves the situation, because it only affects the current module.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;No default/optional parameters You have to overload methods instead, which is kind of annoying. I hope this gets fixed sooner or later.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;No inner classes like in Java Passing on references to constructors is annoying and inner classes in Java really help it quite often.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;No &lt;code&gt;synchronized&lt;/code&gt; keyword like in Java Again this is a nice-to-have feature because it would  clean up some code.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Thu, 12 Mar 2009 21:49:54 +0000</pubDate>
    </item>
    <item>
      <title>How to make WordPress display Full Text in RSS Feeds</title>
      <link>http://blog.blackhc.net/2009/01/how-to-make-wordpress-display-full-text-in-rss-feeds/index.html</link>
      <description>&lt;h3 id=&#34;and-why-some-wordpress-moderators-are-idiots&#34;&gt;... and why some WordPress Moderators are idiots&lt;/h3&gt;&#xA;&lt;p&gt;Today I got an email asking me to enable full text RSS feeds - so far so good, only when I activated the &amp;quot;Full Text&amp;quot; option nothing changed - neither in FireFox, nor in Google Reader, nor anywhere else. Only in &lt;a href=&#34;http://blog.persistent.info/2007/10/feed-proxy-view-raw-rssatom-feed-data.html&#34;&gt;Feed Proxy&lt;/a&gt; I saw a tag appear that contained the full text (including html tags), but the description still only contained the excerpt (without html tags).&lt;/p&gt;&#xA;&lt;p&gt;Before I link you to the thread that made me conclude the statement in the post title, let me quote from the &lt;a href=&#34;http://cyber.law.harvard.edu/rss/rss.html&#34;&gt;RSS 2.0 specs&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;A channel may contain any number of items. An item may represent a &amp;quot;story&amp;quot; -- much like a story in a newspaper or magazine; if so its description is a synopsis of the story, and the link points to the full story. &lt;strong&gt;An item may also be complete in itself, if so, the description contains the text (entity-encoded HTML is allowed; see &lt;a href=&#34;http://cyber.law.harvard.edu/rss/encodingDescriptions.html&#34;&gt;examples&lt;/a&gt;), and the link and title may be omitted.&lt;/strong&gt; All elements of an item are optional, however at least one of title or description must be present.&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;That said take a look at &lt;a href=&#34;http://wordpress.org/support/topic/190901&#34; class=&#34;uri&#34;&gt;http://wordpress.org/support/topic/190901&lt;/a&gt; - having the problem described above and reading the replies, it just left me with one question:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;If Otto42 is a moderator, where does WordPress get its trolls from?&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;The RSS Specs are pretty unspecific and blurry when it comes to the issue, one can at most point to &lt;a href=&#34;http://www.feedvalidator.org/docs/warning/DuplicateDescriptionSemantics.html&#34; class=&#34;uri&#34;&gt;http://www.feedvalidator.org/docs/warning/DuplicateDescriptionSemantics.html&lt;/a&gt;, but the main issue I have is that the rants of this &amp;quot;moderator&amp;quot; won&#39;t help me fix my problem, because Google Reader and FireFox still don&#39;t display the full entries.&lt;/p&gt;&#xA;&lt;h3 id=&#34;a-fix-for-it&#34;&gt;A fix for it&lt;/h3&gt;&#xA;&lt;p&gt;If you want to fix it, you can do the following (in WP 2.7):&lt;/p&gt;&#xA;&lt;p&gt;Open up &lt;code&gt;wp-includes/feed-rss2.php&lt;/code&gt; and change&lt;/p&gt;&#xA;&lt;pre class=&#34;php&#34;&gt;&lt;code&gt;&amp;lt;?php if (get_option(&amp;#39;rss_use_excerpt&amp;#39;)) : ?&amp;gt;&#xA;    &amp;lt;description&amp;gt;&amp;lt;![CDATA[&amp;lt;?php the_excerpt_rss() ?&amp;gt;]]&amp;gt;&amp;lt;/description&amp;gt;&#xA;&amp;lt;?php else : ?&amp;gt;&#xA;    &amp;lt;description&amp;gt;&amp;lt;![CDATA[&amp;lt;?php the_excerpt_rss() ?&amp;gt;]]&amp;gt;&amp;lt;/description&amp;gt;&#xA;    &amp;lt;?php if ( strlen( $post-&amp;gt;post_content ) &amp;gt; 0 ) : ?&amp;gt;&#xA;        &amp;lt;content:encoded&amp;gt;&amp;lt;![CDATA[&amp;lt;?php the_content() ?&amp;gt;]]&amp;gt;&amp;lt;/content:encoded&amp;gt;&#xA;    &amp;lt;?php else : ?&amp;gt;&#xA;        &amp;lt;content:encoded&amp;gt;&amp;lt;![CDATA[&amp;lt;?php the_excerpt_rss() ?&amp;gt;]]&amp;gt;&amp;lt;/content:encoded&amp;gt;&#xA;    &amp;lt;?php endif; ?&amp;gt;&#xA;&amp;lt;?php endif; ?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;to&lt;/p&gt;&#xA;&lt;pre class=&#34;php&#34;&gt;&lt;code&gt;&amp;lt;?php if (get_option(&amp;#39;rss_use_excerpt&amp;#39;)) : ?&amp;gt;&#xA;&amp;lt;description&amp;gt;&amp;lt;![CDATA[&amp;lt;?php the_excerpt_rss() ?&amp;gt;]]&amp;gt;&amp;lt;/description&amp;gt;&#xA;&amp;lt;?php else : ?&amp;gt;&#xA;&amp;lt;description&amp;gt;&amp;lt;![CDATA[&amp;lt;?php the_content() ?&amp;gt;]]&amp;gt;&amp;lt;/description&amp;gt;&#xA;&amp;lt;?php endif; ?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Similarly, if you want to fix your comments, too, open &lt;code&gt;wp-includes/feed-rss2-comments.php&lt;/code&gt; and change&lt;/p&gt;&#xA;&lt;pre class=&#34;php&#34;&gt;&lt;code&gt;&amp;lt;?php if ( post_password_required($comment_post) ) : ?&amp;gt;&#xA;    &amp;lt;description&amp;gt;&amp;lt;?php echo ent2ncr(__(&amp;#39;Protected Comments: Please enter your password to view comments.&amp;#39;)); ?&amp;gt;&amp;lt;/description&amp;gt;&#xA;    &amp;lt;content:encoded&amp;gt;&amp;lt;![CDATA[&amp;lt;?php echo get_the_password_form() ?&amp;gt;]]&amp;gt;&amp;lt;/content:encoded&amp;gt;&#xA;&amp;lt;?php else : // post pass ?&amp;gt;&#xA;    &amp;lt;description&amp;gt;&amp;lt;?php comment_text_rss() ?&amp;gt;&amp;lt;/description&amp;gt;&#xA;    &amp;lt;content:encoded&amp;gt;&amp;lt;![CDATA[&amp;lt;?php comment_text() ?&amp;gt;]]&amp;gt;&amp;lt;/content:encoded&amp;gt;&#xA;&amp;lt;?php endif; // post pass&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;to&lt;/p&gt;&#xA;&lt;pre class=&#34;php&#34;&gt;&lt;code&gt;&amp;lt;?php if ( post_password_required($comment_post) ) : ?&amp;gt;&#xA;    &amp;lt;description&amp;gt;&amp;lt;![CDATA[&amp;lt;?php echo get_the_password_form() ?&amp;gt;]]&amp;gt;&amp;lt;/description&amp;gt;&#xA;&amp;lt;?php else : // post pass ?&amp;gt;&#xA;    &amp;lt;description&amp;gt;&amp;lt;![CDATA[&amp;lt;?php comment_text() ?&amp;gt;]]&amp;gt;&amp;lt;/description&amp;gt;&#xA;&amp;lt;?php endif; // post pass&lt;/code&gt;&lt;/pre&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sat, 31 Jan 2009 10:46:17 +0000</pubDate>
    </item>
    <item>
      <title>Seminar about Motion Retargeting</title>
      <link>http://blog.blackhc.net/2009/01/seminar-about-motion-retargeting/index.html</link>
      <description>&lt;p&gt;&lt;a href=&#34;/images/2009-01-30-seminar-about-motion-retargeting/creatureanimationwb.gif&#34;&gt;&lt;img src=&#34;/images/2009-01-30-seminar-about-motion-retargeting/creatureanimationwb.gif&#34; alt=&#34;creatureanimationwb&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Two weeks ago I had to give a presentation about Motion Retargeting, which I want to share with you now. I created it due to me attending a seminar about the latest developments in Computer Graphics at university and my presentation was about the Siggraph &#39;08 paper &amp;quot;&lt;a href=&#34;http://www.chrishecker.com/images/c/cb/Sporeanim-siggraph08.pdf&#34;&gt;Real-time Motion Retargeting to Highly Varied User-Created Morphologies&lt;/a&gt;&amp;quot; from Chris Hecker et al. You can check it out on &lt;a href=&#34;http://www.chrishecker.com/Real-time_Motion_Retargeting_to_Highly_Varied_User-Created_Morphologies&#34;&gt;Chris Hecker&#39;s homepage&lt;/a&gt; - his website also contains a bunch of other really cool articles and presentations from various conferences, so it certainly is worth taking a look at it.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve also sifted through quite a lot of IK papers and lectures for my presentation to understand the later part about the IK solver in Spore and I&#39;ve found a few links that are a nice read:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.chrishecker.com/Inverse_Kinematics&#34;&gt;Chris Hecker&#39;s talk&lt;/a&gt; about IK is a nice introduction (you also get an audiostream which is nice, too).&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://ir.lib.sfu.ca/handle/1892/7119&#34;&gt;Chris Welman&#39;s Master Thesis&lt;/a&gt; is nice for reading about some of the common methods to solve IK problems.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://graphics.ucsd.edu/courses/cse169_w05/index.html&#34;&gt;Steve Rotenberg&#39;s Computer Animation&lt;/a&gt; course is awesome - the slides about IK are nice, but the ones about locomotion are just awesome[[:they really really are!]]!&lt;/li&gt;&#xA;&lt;li&gt;Particle IK and particle physics in games are related a lot (the constraint solver is pretty much the same) and for a nice read I can recommend &lt;a href=&#34;http://www.teknikus.dk/tj/gdc2001.htm&#34;&gt;Thomas Jakobsen&#39;s Advanced Character Physics&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.pixar.com/companyinfo/research/pbm2001/&#34;&gt;Pixar&#39;s Physically Based Modelling&lt;/a&gt; course from 2001 is also nice to get going with physics again - it also explains everything you need to understand the idea behind ODE solvers in rigid body simulations  and also has a very nice explanation of stiffness in ODEs.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://books.google.com/books?id=2anZacrFaxoC&amp;amp;printsec=frontcover&#34;&gt;Principles of Animal Locomotion&lt;/a&gt; is a very neat book that is about, well, the principles of animal locomotion, which I have read a bit thanks to Google books and it certainly is quite interesting.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.robotom.de/robi.htm&#34;&gt;Numerical Robot Kinematics Based on Stochastic and Molecular Simulation Methods&lt;/a&gt; is interesting, too, just to see what&#39;s possible with particle IK&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Ive created a huge PowerPoint presentation for my seminar  :-) It includes a few videos (thanks again to Chris Hecker for uploading them and replying to my emails incredibly fast [[:he replied to each and every one of them within 20 minutes, which is crazy fast, if you&#39;re used to university communication ;-)]]) and two &lt;strong&gt;awesome&lt;/strong&gt; IK solvers that I&#39;ve implemented with VBA macros[[:VBA is horrible BTW]] to show how CCD and Particle IK solvers work.&lt;/p&gt;&#xA;&lt;p&gt;You can find a zip with all the videos and high resolution images &lt;a href=&#34;http://data.blog.blackhc.net/2009/01/MotionRetargeting.zip&#34;&gt;here&lt;/a&gt;(includes both a PPT 2003 file and a 2007 file). I&#39;ve also uploaded a small version without videos, macros as PPT 2003 file &lt;a href=&#34;http://data.blog.blackhc.net/2009/01/motionretargetingcompat.ppt&#34;&gt;here&lt;/a&gt;, if you don&#39;t feel like downloading the 23 MB .zip file.&lt;/p&gt;&#xA;&lt;p&gt;Here&#39;s a video of the two IK solvers:&lt;/p&gt;&#xA;&lt;iframe src=&#34;https://player.vimeo.com/video/3021779&#34; width=&#34;500&#34; height=&#34;381&#34; frameborder=&#34;0&#34; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&#xA;&lt;/iframe&gt;&#xA;&lt;p&gt;The CCD solver usually works by solving one bone per inner iteration - I only added a max delta angle to create smooth animations (same for the max delta length in the Particle IK solver).&lt;/p&gt;&#xA;&lt;p&gt;It seems as if the CCD solver could converge faster if it randomly chose the first joint instead of starting with the end effector joint in every outer iteration.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve exported the code into an additional IK Playground presentation which contains just one slide and the two IK solvers with the setup you see in the video above. You can find the PPT 2003 version of it &lt;a href=&#34;http://data.blog.blackhc.net/2009/01/ikplayground.ppt&#34;&gt;here&lt;/a&gt; and the 2007 one &lt;a href=&#34;http://data.blog.blackhc.net/2009/01/ikplayground.pptm&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve zipped up the macros &lt;a href=&#34;http://data.blog.blackhc.net/2009/01/mr-pptmacros.zip&#34;&gt;here&lt;/a&gt; if you want to use them in your own slides. I&#39;ve also written a handy VBA form that allows one to edit everything more easily (the macros are hardly documented though, but if anyone really wants to use them and runs into problems - you can always drop me a line or two in a comment :))&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/2009-01-30-seminar-about-motion-retargeting/iksolvertool1.jpg&#34; alt=&#34;The IK Solver Tool Form&#34; /&gt;&lt;figcaption&gt;&lt;a href=&#34;/images/2009-01-30-seminar-about-motion-retargeting/iksolvertool1-1024x622.jpg&#34;&gt;The IK Solver Tool Form&lt;/a&gt;&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;BTW I&#39;m not sure you know about it, but &lt;a href=&#34;http://www.blender.org/&#34;&gt;Blender&lt;/a&gt; contains an awesome video editor - the UI needs some time to get used to, but the online documentation has improved a lot and with it, it works like a charm. Blender also supports some &lt;a href=&#34;http://wiki.blender.org/index.php/Manual/Sequence_Plugins&#34;&gt;pretty professional filters&lt;/a&gt;, so it&#39;s going to be my video editing tool of choice from now on.&lt;/p&gt;&#xA;&lt;p&gt;Cheers, Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Fri, 30 Jan 2009 23:32:20 +0000</pubDate>
    </item>
    <item>
      <title>Logical Equivalence</title>
      <link>http://blog.blackhc.net/2009/01/logical-equivalence/index.html</link>
      <description>&lt;p&gt;It has taken me 3 months to finally solve this problem---well, actually this is the first time in three months that I have taken a look at the problem again.&lt;/p&gt;&#xA;&lt;p&gt;Anyway---I proudly present:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[ (b \Rightarrow B_0) \land (\lnot b \Rightarrow B_1) \equiv \]&lt;/span&gt; &lt;span class=&#34;math display&#34;&gt;\[ \equiv (\lnot b \lor B_0) \land (b \lor B_1) \equiv \]&lt;/span&gt; &lt;span class=&#34;math display&#34;&gt;\[ \equiv (b \land B_0) \lor (\lnot b \land B_1) \lor (B_0 \land B_1) \equiv \]&lt;/span&gt; &lt;span class=&#34;math display&#34;&gt;\[ \equiv (b \land B_0) \lor (\lnot b \land B_1) \lor ((b \lor \lnot b) \land B_0 \land B_1)\equiv \]&lt;/span&gt; &lt;span class=&#34;math display&#34;&gt;\[ \equiv (b \land B_0) \lor (\lnot b \land B_1) \lor (b \land B_0 \land B_1) \lor (\lnot b \land B_0 \land B_1) \equiv \]&lt;/span&gt; &lt;span class=&#34;math display&#34;&gt;\[ \equiv (b \land B_0) \lor (b \land B_0 \land B_1) \lor (\lnot b \land B_1) \lor (\lnot b \land B_0 \land B_1) \equiv \]&lt;/span&gt; &lt;span class=&#34;math display&#34;&gt;\[ \equiv (b \land (B_0 \lor (B_0 \land B_1)) \lor (\lnot b \land (B_1 \lor (B_0 \land B_1)) \equiv \]&lt;/span&gt; &lt;span class=&#34;math display&#34;&gt;\[ \equiv (b \land B_0) \lor (\lnot b \land B_1) \]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;\o/&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Fri, 30 Jan 2009 22:25:40 +0000</pubDate>
    </item>
    <item>
      <title>VGA Project for Technical Computer Science</title>
      <link>http://blog.blackhc.net/2009/01/vga-project-for-technical-computer-science/index.html</link>
      <description>&lt;p&gt;Today I&#39;m going to write[[:you&#39;ll probably find this as a project page soon, too]] about a project that I&#39;ve worked on for university together with other students for technical computer science.&lt;/p&gt;&#xA;&lt;h3 id=&#34;some-introductory-words&#34;&gt;Some Introductory Words&lt;/h3&gt;&#xA;&lt;p&gt;Some background information first maybe: everybody has to participate in a small project for technical computer science during the course of their studies at my university. Usually it&#39;s just a small project done by a team of three students. I was lucky though and had good marks in the final exams TCS in the first term and was offered with maybe 50 other students to participate in bigger projects that actually work with hardware and have bigger team sizes too (about 10 people usually).&lt;/p&gt;&#xA;&lt;p&gt;The project started in my second term and due to us being quite lazy students and being not pressured from the faculty itself, only started really working on the project in our summer vacation which explains why we only finished it two weeks ago (mid/end of the third term).&lt;/p&gt;&#xA;&lt;p&gt;The aim of the project was roughly to display &lt;em&gt;stuff&lt;/em&gt; on a monitor by programming an AVR microcontroller as well as an &lt;a href=&#34;https://en.wikipedia.org/wiki/Field-programmable_gate_array&#34;&gt;FPGA&lt;/a&gt;. We further had a working networking interface (using an old 10 MBit Ethernet card) to retrieve the &lt;em&gt;stuff&lt;/em&gt; we should display. We had to write everything (from the Clients to access/connect to our hardware to the VGA signal output code) on our own (except for a &lt;a href=&#34;http://www.sics.se/~adam/uip/uip-1.0-refman/a00150.html&#34;&gt;uip network stack&lt;/a&gt; to use on the AVR microcontroller).&lt;/p&gt;&#xA;&lt;p&gt;The hardware (&lt;em&gt;which we didn&#39;t have to put together&lt;a href=&#34;#fn1&#34; class=&#34;footnoteRef&#34; id=&#34;fnref1&#34;&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt;)&lt;/em&gt; looks like this:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;/images/overflow/Bild058.jpg&#34;&gt;&lt;img src=&#34;/images/overflow/Bild058.jpg&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;We actually started working on and off during the second term, but getting everything setup and running (the FPGA people could probably fill books with horrible stories about &lt;a href=&#34;http://www.xilinx.com/&#34;&gt;Xilinx&lt;/a&gt;...) took quite some time and we were incredibly happy when we could connect via network to the AVR for first time and make the little LEDs on the FPGA flash in a pattern.&lt;/p&gt;&#xA;&lt;p&gt;More than half a year later we were quite happy to produce images like these on the screen though:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;/images/overflow/Bild047.jpg&#34;&gt;&lt;img src=&#34;/images/overflow/Bild047.jpg&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;the-features&#34;&gt;The Features&lt;/h3&gt;&#xA;&lt;p&gt;&lt;a href=&#34;/images/overflow/Bild056.jpg&#34;&gt;&lt;img src=&#34;/images/overflow/Bild056.jpg&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;As you can read above the whole project didn&#39;t really have a specific outline, it was more like throwing hardware at us and telling us to get creative (and get something done, too, obviously :-)).&lt;/p&gt;&#xA;&lt;p&gt;We settled on some features when we really started to implement things and had a better intuition about what is possible and what we cannot do:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Java Client to communicate with the hardware&lt;/li&gt;&#xA;&lt;li&gt;AVR server code only to communicate with the client and network card and transmit/pass through data to the FPGA&lt;/li&gt;&#xA;&lt;li&gt;FPGA displays the data on the screen (as 80x40 ASCII output on a resolution of 640x480 at 60 Hz)&lt;/li&gt;&#xA;&lt;li&gt;Fixed color and font tables (ASCII charset and the usual DOS terminal colors)&lt;/li&gt;&#xA;&lt;li&gt;Custom font and color tables can be sent, too&lt;/li&gt;&#xA;&lt;li&gt;AVR has a built-in web interface and can be accessed like a website and offers a small Web Client to send and display text messages on the screen (using the default colors and the usual ASCII charset)&lt;/li&gt;&#xA;&lt;li&gt;Java Client has editors for all three content types (font, color, screen) and can show a preview&lt;/li&gt;&#xA;&lt;li&gt;Java Client has an Image Converter that can take arbitrary images and create custom font, color and screen data to show them in the best way possible&lt;/li&gt;&#xA;&lt;li&gt;AVR can also output log/debug messages as html in the web interface[[:that feature only made it in last week when I went back to take some pictures and decided to grab some logs, too :-)]]. Click &lt;a href=&#34;http://data.blog.blackhc.net/2009/01/webclientgetlog.txt&#34;&gt;here&lt;/a&gt; and &lt;a href=&#34;http://data.blog.blackhc.net/2009/01/webclientpostextendedinfo.txt&#34;&gt;here&lt;/a&gt; or &lt;a href=&#34;http://data.blog.blackhc.net/2009/01/wholesession.txt&#34;&gt;here&lt;/a&gt; for examples :-)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Moreover there is some unfinished stuff like a hardware emulator to test the Java client with (that was never properly finished) or a batch testsuite to send messages without having to use the Java Client&lt;a href=&#34;#fn2&#34; class=&#34;footnoteRef&#34; id=&#34;fnref2&#34;&gt;&lt;sup&gt;2&lt;/sup&gt;&lt;/a&gt; or the prototype Java Client and the first version of it (different codebase from what I&#39;ve heard) etc. etc.&lt;/p&gt;&#xA;&lt;p&gt;You can download the code for the AVR and its subprojects (testsuite, emulator) &lt;a href=&#34;http://data.blog.blackhc.net/2009/01/avr.zip&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;the-final-product&#34;&gt;The Final &amp;quot;Product&amp;quot;&lt;/h3&gt;&#xA;&lt;p&gt;First, let&#39;s take a look at what you see after you power everything up:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;/images/overflow/Bild059.jpg&#34;&gt;&lt;img src=&#34;/images/overflow/Bild059.jpg&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;ETI is the abbreviation for Introduction to Technical Computer Science and GP4 stands for our project (including its number).&lt;/p&gt;&#xA;&lt;p&gt;Next we have photo of the old terminal we were using to display debug information from the AVR (I spent hours reading it while coding the AVR):&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;/images/overflow/Bild060.jpg&#34;&gt;&lt;img src=&#34;/images/overflow/Bild060.jpg&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Let&#39;s take a look at the web client now:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;/images/2009-01-26-vga-project-for-technical-computer-science/webclientff.gif&#34;&gt;&lt;img src=&#34;/images/2009-01-26-vga-project-for-technical-computer-science/webclientff.gif&#34; alt=&#34;The Web Client&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;The Java Client is more awesome though.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ll just drop a few pictures showing and the results on the real screen:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;/images/overflow/starwars1.JPG&#34;&gt;&lt;img src=&#34;/images/overflow/starwars1.JPG&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;/images/overflow/Bild021.jpg&#34;&gt;&lt;img src=&#34;/images/overflow/Bild021.jpg&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;For the rest I&#39;ve prepared a litttle slideshow:&lt;/p&gt;&#xA;&lt;object width=&#34;600&#34; height=&#34;400&#34; data=&#34;http://picasaweb.google.com/s/c/bin/slideshow.swf&#34; type=&#34;application/x-shockwave-flash&#34;&gt;&#xA;&lt;param name=&#34;flashvars&#34; value=&#34;host=picasaweb.google.com&amp;amp;captions=1&amp;amp;RGB=0x000000&amp;amp;feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2Fblackhc%2Falbumid%2F5280471616100762225%3Fkind%3Dphoto%26alt%3Drss&#34;&gt;&lt;param name=&#34;src&#34; value=&#34;http://picasaweb.google.com/s/c/bin/slideshow.swf&#34;&gt;&#xA;&lt;/object&gt;&#xA;&lt;h3 id=&#34;the-development&#34;&gt;The Development&lt;/h3&gt;&#xA;&lt;p&gt;We were a team of ten students, which is quite huge (at least for my taste - &lt;em&gt;and it also turned out to be quite difficult to manage&lt;/em&gt;). Three of us volunteered to be the official project leads, ie. the people responsible for keeping an eye on everything, organizing meetings and being the contact persons for &lt;a href=&#34;http://www.lrr.in.tum.de/~acher/&#34;&gt;Dr. Acher&lt;/a&gt; from the TCS chair.&lt;/p&gt;&#xA;&lt;p&gt;We initially divided us up into 3 teams: an FPGA team, an AVR team and a Java Client team. The Java Client team and the FPGA one were the biggest ones, because we thought most of the work had to be done there (&lt;em&gt;that turned out to be true&lt;/em&gt;), while the AVR team only consisted of me (doing all the C programming for the project) and Andreas Hubel who wrote the HTML/JavaScript code for the web client amongst other things. In retrospect the AVR was a lot of work, too, and, of course, underestimated by me, because I thought passing along information from A (the Java Client) to B (the FPGA) could be done in a day, which was not true.&lt;/p&gt;&#xA;&lt;p&gt;A big chunk of the project was done in 3 days during our summer vacation when we all met and locked ourselves up in the lab and worked on the project from 9 am to 9 pm (at least a few stayed that long..). The rest was coded during various afternoons and sometimes weekends in our third term.&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xA;&lt;h3 id=&#34;the-teams&#34;&gt;The Team(s)&lt;/h3&gt;&#xA;&lt;p&gt;&lt;strong&gt;Java Client: &lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;Martin Klenk&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;Fabian Immler&lt;/li&gt;&#xA;&lt;li&gt;Andreas Lang&lt;/li&gt;&#xA;&lt;li&gt;Lucas Louca&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;AVR:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;Andreas Kirsch&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;Andreas Hubel&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;FPGA: &lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Jan Seeger&lt;/li&gt;&#xA;&lt;li&gt;Niko Demmel&lt;/li&gt;&#xA;&lt;li&gt;Andreas Hubel&lt;/li&gt;&#xA;&lt;li&gt;Fabian Otto&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Documentation:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Lucas Louca&lt;/li&gt;&#xA;&lt;li&gt;Markus Lachinger&lt;/li&gt;&#xA;&lt;li&gt;Andreas Lang&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;em&gt;&lt;strong&gt;2 Project Leads&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;As you might notice in the end we had another dedicated team that created the documentation for the project and we actually only had 2 project leads.&lt;/p&gt;&#xA;&lt;p&gt;I was one of the project leads and responsible for 20%&lt;a href=&#34;#fn3&#34; class=&#34;footnoteRef&#34; id=&#34;fnref3&#34;&gt;&lt;sup&gt;3&lt;/sup&gt;&lt;/a&gt; of all emails sent around---I guess I like to talk a lot :&amp;gt;---and had a lot of fun organizing meetings, writing long emails and trying my best not to annoy people too much :-)&lt;/p&gt;&#xA;&lt;h3 id=&#34;what-went-right-speaking-as-project-lead&#34;&gt;What Went Right (speaking as project lead)&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Communication was okay and surprisingly good most of the times.&lt;/li&gt;&#xA;&lt;li&gt;We decided to setup a CMS and Subversion Repository early-on. Jan installed &lt;a href=&#34;http://trac.edgewall.org/&#34;&gt;Trac&lt;/a&gt; on his server which did both) and the included MediaWiki was really helpful for collecting information and getting everybody up-to-date. We also had a Who-is-Who page with a portrait photo of everybody and their contact details (ICQ, AIM, mobile number, etc etc) which was really helpful quite a few times&lt;a href=&#34;#fn4&#34; class=&#34;footnoteRef&#34; id=&#34;fnref4&#34;&gt;&lt;sup&gt;4&lt;/sup&gt;&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;The FPGA team made extensive use of &lt;a href=&#34;https://en.wikipedia.org/wiki/Pair_programming&#34;&gt;Pair Programming&lt;/a&gt; to come to copes with VHDL and a huge state machine that was responsible for the AVR communication back end.&lt;/li&gt;&#xA;&lt;li&gt;We actually spent some time prototyping things and working everything out before hacking the final code together (though, of course, lots of prototype code wasn&#39;t rewritten but just kept and still lives in the current codebase :().&lt;/li&gt;&#xA;&lt;li&gt;We had a lot of fun and some crazy time together (both good and bad times with weird bugs and long debugging sessions)&lt;/li&gt;&#xA;&lt;li&gt;All of the planned features worked in the end.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;what-went-wrong&#34;&gt;What Went Wrong&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Organizing people is very difficult.&lt;/li&gt;&#xA;&lt;li&gt;Keeping the team together even more so.&lt;/li&gt;&#xA;&lt;li&gt;The team was a bit too big with some people idling more than others, because the project could have (arguably) been done by (say) 6 people probably.&lt;/li&gt;&#xA;&lt;li&gt;We changed bits of the communication protocols a few times, which wasn&#39;t very nice, because code had to be rewritten (and sometimes even the design had to be changed).&lt;/li&gt;&#xA;&lt;li&gt;Debugging was a huge PITA in general.&lt;/li&gt;&#xA;&lt;li&gt;Even more R&amp;amp;D would probably have been beneficial in retrospect.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;what-ive-done-on-the-project&#34;&gt;What I&#39;ve Done on the Project&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Project Lead I think I&#39;ve spent most time of all with organizing things and writing general project related emails&lt;/li&gt;&#xA;&lt;li&gt;Wrote all of the AVR C code (3500 LOCs)&lt;/li&gt;&#xA;&lt;li&gt;Implemented a small HTTP server (&lt;strong&gt;a very primitive one&lt;/strong&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Implemented a generic state machine for the server which allows to add new message handlers easily&lt;/li&gt;&#xA;&lt;li&gt;Talked to both the FPGA and Java Client people to figure out how to get data sent back and forth&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;what-ive-learnt&#34;&gt;What I&#39;ve Learnt&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Organizing stuff and trying to make everybody stay on the ball is a lot harder than it sounds&lt;/li&gt;&#xA;&lt;li&gt;It also needs a lot of time&lt;/li&gt;&#xA;&lt;li&gt;Even a team of 10 people is &lt;strong&gt;huge&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;If somebody doesn&#39;t really do anything, don&#39;t wait for a happy ending. Confront people as soon as you notice that and don&#39;t let it drag on (- do it in a nice way though). This is something I&#39;ve learned the hard way in the end, and it&#39;s biggest annoyance in retrospect, because some people worked their asses off, while other(s) did not at all..&lt;/li&gt;&#xA;&lt;li&gt;Low-level hardware programming is always crazy because you&#39;re limited in your choice of debugging tools (printfs for me if the stack hasn&#39;t been trashed.. &amp;gt;_&amp;lt;) and you experience weird bugs sometimes that no one can even remotely explain (at first).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;section class=&#34;footnotes&#34;&gt;&#xA;&lt;hr /&gt;&#xA;&lt;ol&gt;&#xA;&lt;li id=&#34;fn1&#34;&gt;&lt;p&gt;we actually had to wire the VGA connector ourselves - and the communication channel between the AVR and FPGA&lt;a href=&#34;#fnref1&#34;&gt;↩&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li id=&#34;fn2&#34;&gt;&lt;p&gt;some people call me crazy for implementing a command-line parser using CMD&#39;s batch language ^ ^&lt;a href=&#34;#fnref2&#34;&gt;↩&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li id=&#34;fn3&#34;&gt;&lt;p&gt;62 out of 306 emails and probably some of the longest, too&lt;a href=&#34;#fnref3&#34;&gt;↩&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li id=&#34;fn4&#34;&gt;&lt;p&gt;especially for me because I suck at remembering names and - well, it was my suggestion to finally be able to relate names to faces&lt;a href=&#34;#fnref4&#34;&gt;↩&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/section&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Mon, 26 Jan 2009 20:12:56 +0000</pubDate>
    </item>
    <item>
      <title>Learn Java Interfaces in 10 Minutes</title>
      <link>http://blog.blackhc.net/2009/01/learn-java-interfaces-in-10-minutes/index.html</link>
      <description>&lt;p&gt;I&#39;ve written a small Eclipse project&lt;a href=&#34;#fn1&#34; class=&#34;footnoteRef&#34; id=&#34;fnref1&#34;&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt; that tries to explain interfaces and their use through commented code examples. It also shows how to make for-each loops support iterating over your classes and how to use the iterator interface to create data to iterate over just in time.&lt;/p&gt;&#xA;&lt;p&gt;You can find the project &lt;a href=&#34;http://info1.blackhc.net/wp-content/uploads/2009/01/interfacesin10minutes.zip&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Cheers, Andreas&lt;/p&gt;&#xA;&lt;section class=&#34;footnotes&#34;&gt;&#xA;&lt;hr /&gt;&#xA;&lt;ol&gt;&#xA;&lt;li id=&#34;fn1&#34;&gt;&lt;p&gt;The name is inspired by &amp;quot;Learn Python in 10 Minutes&amp;quot;, which is a very nice tutorial that explains everything through code examples&lt;a href=&#34;#fnref1&#34;&gt;↩&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/section&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sat, 24 Jan 2009 17:44:15 +0000</pubDate>
    </item>
    <item>
      <title>WordPress Hacking II</title>
      <link>http://blog.blackhc.net/2009/01/wordpress-hacking-ii/index.html</link>
      <description>&lt;p&gt;&lt;img src=&#34;/images/2009-01-24-wordpress-hacking-ii/privatepagesfix.jpg&#34; alt=&#34;privatepagesfix&#34; /&gt; I have a few private pages that I use to store random stuff and ideas and private pages (for a reason I don&#39;t understand) don&#39;t show up in the pages widget.&lt;/p&gt;&#xA;&lt;p&gt;It turns out that WordPress&#39;s &lt;code&gt;get_pages&lt;/code&gt; function always filters them out, while &lt;code&gt;get_posts&lt;/code&gt; doesn&#39;t (it actually has some logic to figure out whether to show private pages or not).&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve decided to fix this. A real fix would probably be merging &lt;code&gt;get_pages&lt;/code&gt; and &lt;code&gt;get_posts&lt;/code&gt; because both seem to do pretty much the same except that get_posts is a tad bit more advanced, but I&#39;m all for quick fixes at the moment, because I don&#39;t have much time and I don&#39;t want to end up considering myself a PHP developer ;-)&lt;/p&gt;&#xA;&lt;p&gt;To make &lt;code&gt;get_pages&lt;/code&gt; return private pages, too, you have to open the file &lt;code&gt;wp-includes/post.php&lt;/code&gt; and change the following lines near the bottom of the &lt;code&gt;get_pages&lt;/code&gt; function:&lt;/p&gt;&#xA;&lt;pre class=&#34;php&#34;&gt;&lt;code&gt;$query = &amp;quot;SELECT * FROM $wpdb-&amp;gt;posts $join WHERE (post_type = &amp;#39;page&amp;#39; AND post_status = &amp;#39;publish&amp;#39;) $where &amp;quot;;&#xA;$query .= $author_query;&#xA;$query .= &amp;quot; ORDER BY &amp;quot; . $sort_column . &amp;quot; &amp;quot; . $sort_order ;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;to:&lt;/p&gt;&#xA;&lt;pre class=&#34;php&#34;&gt;&lt;code&gt;$private_pages_inclusion_where = &amp;quot;;&#xA;if ( is_user_logged_in() ) {&#xA;    $private_pages_inclusion_where  = current_user_can( &amp;quot;read_private_pages&amp;quot; ) ? &amp;quot; OR post_status = &amp;#39;private&amp;#39;&amp;quot; : &amp;quot; OR post_author = $user_ID AND post_status = &amp;#39;private&amp;#39;&amp;quot;;&#xA;}&#xA;&#xA;$query = &amp;quot;SELECT * FROM $wpdb-&amp;gt;posts $join WHERE (post_type = &amp;#39;page&amp;#39; AND (post_status = &amp;#39;publish&amp;#39; $private_pages_inclusion_where)) $where &amp;quot;;&#xA;$query .= $author_query;&#xA;$query .= &amp;quot; ORDER BY &amp;quot; . $sort_column . &amp;quot; &amp;quot; . $sort_order ;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;If you also want to make it easier to distinguish private pages from normal ones, you can also change the following bits in &lt;code&gt;wp-includes/classes.php&lt;/code&gt; in the method &lt;code&gt;Walker_Page::start_el&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre class=&#34;php&#34;&gt;&lt;code&gt;$output .= $indent . &amp;#39;&amp;lt;li class=&amp;quot;&amp;#39; . $css_class . &amp;#39;&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;&amp;#39; . get_page_link($page-&amp;gt;ID) .&#xA;    &amp;#39;&amp;quot; title=&amp;quot;&amp;#39; . attribute_escape(apply_filters(&amp;#39;the_title&amp;#39;, $page-&amp;gt;post_title)) . &amp;#39;&amp;quot;&amp;gt;&amp;#39; .&#xA;    $link_before . apply_filters(&amp;#39;the_title&amp;#39;, $page-&amp;gt;post_title) . $link_after . &amp;#39;&amp;lt;/a&amp;gt;&amp;#39;;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;to:&lt;/p&gt;&#xA;&lt;pre class=&#34;php&#34;&gt;&lt;code&gt;$output .= $indent . &amp;#39;&amp;lt;li class=&amp;quot;&amp;#39; . $css_class . &amp;#39;&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;&amp;#39; . get_page_link($page-&amp;gt;ID) .&#xA;    &amp;#39;&amp;quot; title=&amp;quot;&amp;#39; . attribute_escape(apply_filters(&amp;#39;the_title&amp;#39;, $page-&amp;gt;post_title)) . &amp;#39;&amp;quot;&amp;gt;&amp;#39; .&#xA;    $link_before . apply_filters(&amp;#39;the_title&amp;#39;, $page-&amp;gt;post_title) . ($page-&amp;gt;post_status == &amp;#39;private&amp;#39; ? &amp;quot; (Private)&amp;quot; : &amp;quot;) . $link_after . &amp;#39;&amp;lt;/a&amp;gt;&amp;#39;;&lt;/code&gt;&lt;/pre&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sat, 24 Jan 2009 12:34:44 +0000</pubDate>
    </item>
    <item>
      <title>Partial Integration and the Substitution Rule</title>
      <link>http://blog.blackhc.net/2009/01/partial-integration-and-the-substitution-rule/index.html</link>
      <description>&lt;p&gt;I only want to write this down to have a place to look it up:&lt;/p&gt;&#xA;&lt;p&gt;If we want to integrate &lt;span class=&#34;math inline&#34;&gt;\(\displaystyle{ \int_{a}^{b}{f&amp;#39;\left(x \right) g\left( x\right)} }\)&lt;/span&gt; , we can use: &lt;span class=&#34;math display&#34;&gt;\[&#xA;\begin{aligned}&#xA;(f \cdot g)&amp;#39;\left( x \right) &amp;amp; = f&amp;#39;\left(x \right)g\left(x \right) +  f\left(x \right)g&amp;#39;\left(x \right) \\&#xA; \Leftrightarrow f\left(x \right)g\left(x \right) \big | _ {a=x}^b &amp;amp; = \int _ {a}^{b}{ f&amp;#39;\left(x \right)g\left(x \right) +  f\left(x \right)g&amp;#39; \left(x \right) } \, dx  \\&#xA;\Leftrightarrow \int _ {a}^{b}{ f&amp;#39;\left(x \right)g\left(x \right) } \, dx &amp;amp; = f\left(x \right)g\left(x \right) | _ {a=x}^b - \int _ {a}^{b}{ f\left(x \right)g&amp;#39; \left(x \right) } \, dx&#xA;\end{aligned}&#xA;\]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;And if we want to substitute a function in an integral:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[{\int_{g\left(a \right)}^{g\left(b \right)}{ f\left( x \right) } \, dx = F \left ( g \left ( b \right ) \right ) - F \left ( g \left ( a \right ) \right ) = \left (F \circ g \right ) \left ( b \right ) - \left (F \circ g \right ) \left ( a \right ) = } \\=\int_{a}^{b}{ \left (F \circ g \right ) &amp;#39; \left ( x \right ) } \, dx = \int_{a}^{b}{ f \left ( g \left ( x \right ) \right ) } \, g&amp;#39; \left ( x \right ) \, dx \]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;(with &lt;span class=&#34;math inline&#34;&gt;\(F \left ( x \right ) = \int^{x}{ f \left ( x \right )} \, dx\)&lt;/span&gt;) or using a trick:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[\int_{a}^{b}{f \left ( g \left ( x \right ) \right ) } \, dx = F \left ( b \right ) - F \left ( a \right ) = \left ( F \circ g \circ g^{-1} \right ) \left ( b \right ) - \left ( F \circ g \circ g^{-1} \right ) \left ( a \right )=\\=\left ( F \circ g^{-1} \right ) \left( g \left ( b \right ) \right ) - \left ( F \circ g^{-1} \right ) \left( g \left ( a \right ) \right ) = \int_{g \left ( a \right )}^{g \left ( b \right )}{ \left ( F \circ g^{-1} \right ) &amp;#39; \left ( x \right ) } \, dx = \\=\int_{g \left ( a \right )}^{g \left ( b \right )}{ F&amp;#39; \left ( g^{-1} \left ( x \right ) \right ) \, {g^{-1}} &amp;#39; \left ( x \right ) } \, dx = \int_{g \left ( a \right )}^{g \left ( b \right )}{ f \left ( g \left ( g^{-1} \left ( x \right ) \right ) \right ) \, {g^{-1}}&amp;#39; \left ( x \right ) } \, dx = \\ = \int_{g \left ( a \right )}^{g \left ( b \right )} { f \left ( x \right ) \, \frac{1}{g&amp;#39; \left ( g^{-1} \left ( x \right ) \right ) } } \, dx \]&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;(with &lt;span class=&#34;math inline&#34;&gt;\(F \left ( x \right ) = \int^{x}{ f \left ( g \left ( x \right ) \right )} \, dx\)&lt;/span&gt;)&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Fri, 09 Jan 2009 23:21:54 +0000</pubDate>
    </item>
    <item>
      <title>Best-of-Explosm Web 2.0</title>
      <link>http://blog.blackhc.net/2008/12/best-of-explosm-web-20/index.html</link>
      <description>&lt;p&gt;&lt;a href=&#34;http://pipes.yahoo.com/pipes/&#34;&gt;&lt;img src=&#34;http://l.yimg.com/us.yimg.com/i/us/pps/logo_1.gif&#34; /&gt;&lt;/a&gt;&lt;a href=&#34;http://pipes.yahoo.com/pipes/&#34;&gt;Yahoo Pipes&lt;/a&gt; are an interesting concept, as are the other existing mashup tools (like Microsoft&#39;s Popfly or &lt;a href=&#34;http://ubiquity.mozilla.com/&#34;&gt;Ubiquity&lt;/a&gt;), and it is amazing what can be done with a few clicks with them.&lt;/p&gt;&#xA;&lt;p&gt;Because I&#39;ve wanted to learn how to work with Yahoo Pipes (before the Google Mashup Editor is released to the public), I&#39;ve decided to take my best-of-explosm viewer to a different level and &lt;strong&gt;prototype &lt;/strong&gt;it with Yahoo Pipes.&lt;/p&gt;&#xA;&lt;p&gt;This just shows the first page (it&#39;s easier to view - &lt;em&gt;and create&lt;/em&gt; - the feed in groups of 20 pictures than all at once). You can follow the link if you want to view more pages.&lt;/p&gt;&#xA;&lt;p&gt;Stay tuned for more. Cheers, Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sun, 28 Dec 2008 14:54:08 +0000</pubDate>
    </item>
    <item>
      <title>Microsoft PowerPoint Rant</title>
      <link>http://blog.blackhc.net/2008/12/microsoft-powerpoint-rant/index.html</link>
      <description>&lt;p&gt;I have to do a presentation at university and it needs to be done in PowerPoint - OpenOffice and LaTeX are explicity not allowed. Usually I&#39;m all for Microsoft, but PowerPoint really lacks quite a few things that one would expect to be common in modern presentation software:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;ability to insert document properties&lt;/li&gt;&#xA;&lt;li&gt;working document properties - somehow I get an error message every time I try to open the document property viewer...&lt;/li&gt;&#xA;&lt;li&gt;changing the language of a presentation (for all slides, etc.) - it&#39;s just a huge W-T-F that you have to use macros or add-ins to do that&lt;/li&gt;&#xA;&lt;li&gt;table of contents slides - it&#39;s incredible that there is no way to automate this in PowerPoint.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;LaTeX is a 1000x more user-friendly in that regard to be honest. You can download some packages for free that automate everything that is worth automating and you won&#39;t be bothered with updating all possible things manually everytime. It also usually supports more powerful slides with advanced navigation, etc.&lt;/p&gt;&#xA;&lt;p&gt;Nonetheless if PowerPoint sucks, then** Visual Basic for Applications for PowerPoint** is one big &lt;strong&gt;brainfuck&lt;/strong&gt;. The level of stupidity and general suckiness of VBA as language and the fact that you somehow don&#39;t find up-to-date documentation about it online (no language specs?) and some braindead decisions in the PowerPoint macro API make it a real PITA to work with..&lt;/p&gt;&#xA;&lt;p&gt;Anyway, I&#39;ve written a macro to create a Table of Contents slide automatically for a PowerPoint presentation - it also allows for updating it later on and for customizing its title without overwriting it on update:&lt;/p&gt;&#xA;&lt;pre class=&#34;monobasic&#34;&gt;&lt;code&gt;&amp;#39; create a Table of Contents slide as second slide (but you can move it around afterwards)&#xA;&amp;#39; you can use the macro to update an already generated one without it resetting the title or the slide&amp;#39;s position&#xA;Const TOCTag = &amp;quot;TOC?Level&amp;quot;&#xA;Const TOCSlideName = &amp;quot;TOC?Slide&amp;quot;&#xA;&#xA;Sub CreateTOCSlide()&#xA;    Dim contentSlide As Slide&#xA;    On Error Resume Next&#xA;    Set contentSlide = ActivePresentation.Slides(TOCSlideName)&#xA;&#xA;    If contentSlide Is Nothing Then&#xA;        Set contentSlide = ActivePresentation.Slides.AddSlide(2, ActivePresentation.Slides(1).CustomLayout)&#xA;        contentSlide.Name = TOCSlideName&#xA;        contentSlide.Layout = ppLayoutText&#xA;        contentSlide.Shapes.title.TextFrame.TextRange.Text = &amp;quot;Table of Contents&amp;quot;&#xA;    End If&#xA;&#xA;    UpdateTOCSlide&#xA;End Sub&#xA;&#xA;Private Function FindTOCSlideWithTitle(title As String) As Slide&#xA;    Dim cSlide As Slide&#xA;    For Each cSlide In ActivePresentation.Slides&#xA;        If cSlide.Tags(TOCTag) &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&#xA;            If cSlide.Shapes.title.TextFrame.TextRange.Text = title Then&#xA;                Set FindTOCSlideWithTitle = cSlide&#xA;                Exit Function&#xA;            End If&#xA;        End If&#xA;    Next cSlide&#xA;    Set FindTOCSlideWithTitle = Nothing&#xA;End Function&#xA;&#xA;Sub UpdateIndentationFromTOC()&#xA;    Dim contentSlide As Slide&#xA;    On Error Resume Next&#xA;    Set contentSlide = ActivePresentation.Slides(TOCSlideName)&#xA;&#xA;    If contentSlide Is Nothing Then&#xA;        Exit Sub&#xA;    End If&#xA;&#xA;    Dim contentTextRange As TextRange2&#xA;    Set contentTextRange = contentSlide.Shapes.Placeholders(2).TextFrame2.TextRange&#xA;&#xA;    Dim p As TextRange2&#xA;    For Each p In contentTextRange.Paragraphs()&#xA;        Dim cSlide As Slide&#xA;        Set cSlide = FindTOCSlideWithTitle(Left(p.Text, Len(p.Text) - 1))&#xA;        If Not cSlide Is Nothing Then&#xA;            cSlide.Tags.Add TOCTag, p.ParagraphFormat.indentLevel&#xA;        End If&#xA;    Next p&#xA;End Sub&#xA;&#xA;Private Sub UpdateTOCSlide()&#xA;    Dim contentSlide As Slide&#xA;    On Error Resume Next&#xA;    Set contentSlide = ActivePresentation.Slides(TOCSlideName)&#xA;&#xA;    If contentSlide Is Nothing Then&#xA;        Exit Sub&#xA;    End If&#xA;&#xA;    Dim contentTextRange As TextRange2&#xA;    Set contentTextRange = contentSlide.Shapes.Placeholders(2).TextFrame2.TextRange&#xA;&#xA;    contentSlide.Shapes.Placeholders(2).TextFrame2.DeleteText&#xA;    contentTextRange.ParagraphFormat.Bullet.Type = ppBulletNumbered&#xA;&#xA;    Dim index As Integer&#xA;    index = 1&#xA;&#xA;    For Each pSlide In ActivePresentation.Slides&#xA;        Dim tagValue As Integer&#xA;        tagValue = Val(pSlide.Tags(TOCTag))&#xA;        If tagValue &amp;gt; 0 Then&#xA;            contentTextRange.InsertAfter pSlide.Shapes.title.TextFrame.TextRange.Text &amp;amp; vbCrLf&#xA;            contentTextRange.Lines(index, 1).ParagraphFormat.indentLevel = tagValue&#xA;            contentTextRange.Lines(index, 1).ParagraphFormat.LeftIndent = 40 * tagValue&#xA;            &amp;#39;contentTextRange.Lines(index).ParagraphFormat.Bullet.Type = ppBulletNumbered&#xA;            index = index + 1&#xA;        End If&#xA;    Next pSlide&#xA;End Sub&#xA;&#xA;Sub ToggleTOCEntrySlide()&#xA;    Dim currentSlide As Slide&#xA;    Set currentSlide = ActiveWindow.View.Slide&#xA;&#xA;    Dim newValue As String&#xA;    If currentSlide.Tags(TOCTag) &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&#xA;        newValue = &amp;quot;&amp;quot;&#xA;    Else&#xA;        newValue = &amp;quot;1&amp;quot;&#xA;    End If&#xA;    currentSlide.Tags.Add TOCTag, newValue&#xA;&#xA;    UpdateTOCSlide&#xA;End Sub&#xA;&#xA;Private Function ClampIndentLevel(level As Integer) As Integer&#xA;    If level &amp;lt; 1 Then&#xA;        ClampIndentLevel = 1&#xA;    ElseIf level &amp;gt; 5 Then&#xA;        ClampIndentLevel = 5&#xA;    Else&#xA;        ClampIndentLevel = level&#xA;    End If&#xA;End Function&#xA;&#xA;Sub IndentTOCEntrySlide()&#xA;    Dim currentSlide As Slide&#xA;    Set currentSlide = ActiveWindow.View.Slide&#xA;&#xA;    currentSlide.Tags.Add TOCTag, ClampIndentLevel(1 + Val(currentSlide.Tags(TOCTag)))&#xA;&#xA;    UpdateTOCSlide&#xA;End Sub&#xA;&#xA;Sub UnindentTOCEntrySlide()&#xA;    Dim currentSlide As Slide&#xA;    Set currentSlide = ActiveWindow.View.Slide&#xA;&#xA;    currentSlide.Tags.Add TOCTag, ClampIndentLevel(Val(currentSlide.Tags(TOCTag)) - 1)&#xA;    UpdateTOCSlide&#xA;End Sub&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&amp;#39; create a Table of Contents slide as second slide (but you can move it around afterwards)&#xA;&amp;#39; you can use the macro to update an already generated one without it resetting the title or the slide&amp;#39;s position&#xA;Sub CreateContentTableSlide()&#xA;    Const contentSlideName = &amp;quot;ContentTable&amp;quot;&#xA;&#xA;    Dim contentSlide As Slide&#xA;    On Error Resume Next&#xA;    Set contentSlide = Nothing&#xA;    Set contentSlide = ActivePresentation.Slides(contentSlideName)&#xA;&#xA;    On Error GoTo 0&#xA;    If contentSlide Is Nothing Then&#xA;        Set contentSlide = ActivePresentation.Slides.AddSlide(2, ActivePresentation.Slides(1).CustomLayout)&#xA;        contentSlide.Name = contentSlideName&#xA;        contentSlide.Layout = ppLayoutText&#xA;        contentSlide.Shapes.Title.TextFrame.TextRange.Text = &amp;quot;Table of Contents&amp;quot;&#xA;    End If&#xA;&#xA;    Dim contentTextRange As TextRange&#xA;    Set contentTextRange = contentSlide.Shapes.Placeholders(2).TextFrame.TextRange&#xA;&#xA;    With contentTextRange&#xA;        .ParagraphFormat.Bullet.Type = ppBulletNumbered&#xA;        .Text = &amp;quot;&amp;quot;&#xA;    End With&#xA;&#xA;    For Each pSlide In ActivePresentation.Slides&#xA;        If (pSlide.Layout = ppLayoutTitle) Or (pSlide.Layout = ppLayoutTitleOnly) Then&#xA;        ElseIf pSlide.Name = contentSlideName Then&#xA;        Else&#xA;            contentTextRange.InsertAfter pSlide.Shapes.Title.TextFrame.TextRange.Text &amp;amp; vbNewLine&#xA;        End If&#xA;    Next pSlide&#xA;End Sub&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The most recent version can be found in &lt;a href=&#34;http://data.blog.blackhc.net/2009/01/mr-pptmacros.zip&#34;&gt;this .zip file here&lt;/a&gt; (TOC.bas).&lt;/p&gt;&#xA;&lt;p&gt;Some remarks:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&amp;quot;On Error Resume Next&amp;quot; - it&#39;s crazy that VBA uses this to control its error handler (this construct dates back to QuickBasic..)&lt;/li&gt;&#xA;&lt;li&gt;VBA doesn&#39;t support normal exception handling it seems&lt;/li&gt;&#xA;&lt;li&gt;what does the set statement do and why is it necessary to use it when dealing with object references - I&#39;ve experienced strange error messages before I started using it&lt;/li&gt;&#xA;&lt;li&gt;VBA doesn&#39;t seem to support a Continue statement (continue as the counterpart to break)&lt;/li&gt;&#xA;&lt;li&gt;The VBA documentation is inside the Access documentation (in case you look for it)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Hopefully this is useful for other poor souls who have to or try to work with PowerPoint&#39;s macro facilities.&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br /&gt;&#xA;  Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Thu, 18 Dec 2008 22:52:04 +0000</pubDate>
    </item>
    <item>
      <title>More WordPress Pimping</title>
      <link>http://blog.blackhc.net/2008/12/more-wordpress-pimping/index.html</link>
      <description>&lt;p&gt;&lt;strong&gt;Note: this is post didn&#39;t make it through the markdown conversion very well. I&#39;m still keeping the explanations, but the examples had to be removed.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;PHP and CSS and all that funky web design stuff are funky, because they are so easy to use and you quickly get results. I like it.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve decided to release my first plugin into the world (it&#39;s big hack, but it has turned out to be very useful on my other blog &lt;a href=&#34;http://info1.blackhc.net&#34; class=&#34;uri&#34;&gt;http://info1.blackhc.net&lt;/a&gt;).&lt;/p&gt;&#xA;&lt;p&gt;It supports 3 text replacements:&lt;/p&gt;&#xA;&lt;h3 id=&#34;xkcd-style-tooltips-as-replacement-for-footnotes&#34;&gt;&lt;a href=&#34;http://www.xkcd.com&#34;&gt;Xkcd&lt;/a&gt;-style Tooltips as Replacement for Footnotes&lt;/h3&gt;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;[[:This is a default footnote. Hover over it to display it.]]&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;You can use a different marker, too: Example:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;[[:My Footnote#This is a default footnote. Hover over it to display it.]]&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h3 id=&#34;linking-to-wikipedia&#34;&gt;Linking to Wikipedia&lt;/h3&gt;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;[[wikipedia:Pie]]&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The link text can be changed, too, of course. Example (you can use &lt;code&gt;:&lt;/code&gt; as seperator, too):&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;[[wikipedia:pi#Fake Pie]]&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h3 id=&#34;expandable-text&#34;&gt;Expandable Text&lt;/h3&gt;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;[[expandable#Expandable Text...]]&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The link text can be changed, too:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;[[expandable#Click me! Click me! Pleeease!#Yay!]]&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;And we can nest it and it works with other tags. Example:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;[[expandable:#Expandable Text...&#xA;&#xA;[[expandable:Click me! Click me! Pleeease!#Yay!]]&#xA;&#xA;[sourcecode lang=&amp;quot;java&amp;quot;]&amp;lt;br /&amp;gt;&#xA;// some Java code&amp;lt;br /&amp;gt;&#xA;[/sourcecode]&#xA;&#xA;]]&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;We can also use a Heredoc-like mode: Example:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;[[expandable_ex:EOD#Heredoc-like Expandable#[[[[[[[]][[EOD]]&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h3 id=&#34;escaping-and&#34;&gt;Escaping [[ and ]]&lt;/h3&gt;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;Escaping [[escape_left]] and [[escape_right]]&lt;/code&gt;&lt;/pre&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Fri, 12 Dec 2008 18:37:31 +0000</pubDate>
    </item>
    <item>
      <title>WordPress Hacking</title>
      <link>http://blog.blackhc.net/2008/11/wordpress-hacking/index.html</link>
      <description>&lt;p&gt;Since I&#39;ve been working on another blog (&lt;a href=&#34;http://info1.blackhc.net&#34; class=&#34;uri&#34;&gt;http://info1.blackhc.net&lt;/a&gt;) for my tutorial at university, I&#39;ve played around with using Microsoft Word for publishing and editing content on the blog. I gotta say that SmartArts are really nice and good way to lighten up blog posts easily.&lt;/p&gt;&#xA;&lt;p&gt;However Word&#39;s support for the current version of WordPress is sub-optimal - that is, it totally messes up formatting when retrieving existing blog posts (that is, Word doesn&#39;t recognize any paragraphs or line breaks). I&#39;ve spent some time digging around in the blog&#39;s .php code to find a way to fix it and after an hour or so, I&#39;ve been able to fix it. It&#39;s one-liner I want to share with you:&lt;/p&gt;&#xA;&lt;pre class=&#34;php&#34;&gt;&lt;code&gt;//&amp;#39;description&amp;#39; =&amp;gt; $post[&amp;#39;main&amp;#39;], // line 1939 in xmlrpc.php (function mw_getPost)&#xA;&amp;#39;description&amp;#39; =&amp;gt; wpautop( $post[&amp;#39;main&amp;#39;] ),&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The function &lt;a href=&#34;http://codex.wordpress.org/Function_Reference/wpautop&#34;&gt;&lt;code&gt;wpautop&lt;/code&gt;&lt;/a&gt; adds &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; tags to your text (and by default &lt;code&gt;&amp;lt;br&amp;gt;&lt;/code&gt; tags, too).&lt;/p&gt;&#xA;&lt;p&gt;This will fix the formatting bug in Word. This is a hack, of course, but it works for Word.&lt;/p&gt;&#xA;&lt;p&gt;WordPress has a bug in its Atom Publishing Protocol code, too: It messes up the status code header when asking for user credentials, which prevents your browser from displaying the login form. Again only one line needs to be changed:&lt;/p&gt;&#xA;&lt;pre class=&#34;php&#34;&gt;&lt;code&gt;// header(&amp;#39;Status: &amp;#39; . $msg); // line 1014 in wp-app.php (function: auth_required)&#xA;header(&amp;#39;Status: 401 &amp;#39; . $msg);&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Stay tuned for more updates in the next months.. :-) Cheers,&lt;br /&gt;&#xA; Andreas&lt;/p&gt;&#xA;&lt;p&gt;PS: University is really keeping me busy..&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sat, 22 Nov 2008 13:27:20 +0000</pubDate>
    </item>
    <item>
      <title>A Visual Studio Macro Day</title>
      <link>http://blog.blackhc.net/2008/10/a-visual-studio-macro-day/index.html</link>
      <description>&lt;p&gt;Today I decided to continue work on a Visual Studio macro I started developing on Sunday (I mainly worked on it today though - Sunday was just document reading before heading back to Munich and going out with friends).&lt;/p&gt;&#xA;&lt;p&gt;The samples from Microsoft simply use the comments from MSDN on functions/methods that are part of a class&#39;s interface implementation.&lt;/p&gt;&#xA;&lt;p&gt;I &#39;documented&#39; a few of my functions by copying the summary out of MSDN but it&#39;s a tedious job and consequently I decided to try and automate it. Although Visual Basic &#39;sucks&#39; or is a least quite some change from writing C/C++/C# code all the time, the Automation model is very powerful and quite nice to use.&lt;/p&gt;&#xA;&lt;p&gt;My macro provides two methods:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;One to add comments to all methods that are part of an interface&#39;s implementation&lt;/li&gt;&#xA;&lt;li&gt;One to add comments to the method the cursor currently resides in&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;My code currently only adds comments from interface definitions that have been defined outside the current project. It&#39;s pretty nifty in my opinion because usually these interface comments won&#39;t change a lot and thus it&#39;s safe to add them to the source code, while the interfaces one has written themself can still change and the macros can&#39;t track that and/or update the comments afterwards.&lt;/p&gt;&#xA;&lt;p&gt;However, I&#39;ve added a configuration boolean, so this behavior can be turned off if needed.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;My code won&#39;t remove or replace comments, it will just add the comment in front of other comments - if the comment doesn&#39;t already exist - I&#39;ve tried to make it quite safe, so code loss or corruption will be avoided.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;I hope this code is helpful. I&#39;m releasing it under the Microsoft Public License. If there are good reasons to use a different license, feel free to tell me so :)&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br /&gt;&#xA; Andreas&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xA;&lt;pre class=&#34;monobasic&#34;&gt;&lt;code&gt;&amp;#39; Andreas &amp;#39;BlackHC&amp;#39; Kirsch 2008&#xA;&amp;#39; released under Microsoft Public License&#xA;Imports System&#xA;Imports EnvDTE&#xA;&#xA;Public Module CommentImplementedMethods&#xA;    &amp;#39; we usually only want to use external interfaces because it&amp;#39;s safer to assume those won&amp;#39;t change anytime soon&#xA;    Const UseExternalInterfaceCommentsOnly = True&#xA;&#xA;    Private Function GetSummaryFromDocComment(ByVal docComment As String) As String&#xA;        Const summaryStartTag = &amp;quot;&amp;lt;summary&amp;gt;&amp;quot;&#xA;        Const summaryEndTag = &amp;quot;&amp;lt;/summary&amp;gt;&amp;quot;&#xA;        Dim summaryIndex = docComment.IndexOf(summaryStartTag)&#xA;        If summaryIndex = -1 Then&#xA;            Return &amp;quot;&amp;quot;&#xA;        End If&#xA;        Dim summaryStart = docComment.Substring(summaryIndex + summaryStartTag.Length)&#xA;        Return summaryStart.Substring(0, summaryStart.IndexOf(summaryEndTag))&#xA;    End Function&#xA;&#xA;    &amp;#39;Private Function GetInterfaceByName(ByRef classObject As CodeClass, ByRef name As String) As CodeInterface&#xA;    &amp;#39;    For Each implementedInterface As CodeInterface In classObject.ImplementedInterfaces&#xA;    &amp;#39;        If implementedInterface.Name = name Then&#xA;    &amp;#39;            Return implementedInterface&#xA;    &amp;#39;        End If&#xA;    &amp;#39;    Next&#xA;    &amp;#39;End Function&#xA;&#xA;    Private Function GetMethod(ByRef interfaceObject As CodeInterface, ByRef methodObject As CodeFunction) As CodeFunction&#xA;        Dim prototypeFlags As Int32 = vsCMPrototype.vsCMPrototypeParamTypes Or vsCMPrototype.vsCMPrototypeType&#xA;        Dim prototype As String = methodObject.Prototype(prototypeFlags)&#xA;&#xA;        Dim separationIndex = methodObject.Name.IndexOf(&amp;quot;.&amp;quot;c)&#xA;        If separationIndex &amp;lt;&amp;gt; -1 Then&#xA;            Dim interfaceName = methodObject.Name.Substring(0, separationIndex)&#xA;            If interfaceName &amp;lt;&amp;gt; interfaceObject.Name Then&#xA;                Return Nothing&#xA;            End If&#xA;&#xA;            Dim realMethodName = methodObject.Name.Substring(separationIndex + 1)&#xA;            prototype = prototype.Replace(methodObject.Name, realMethodName)&#xA;        End If&#xA;&#xA;        For Each member As CodeElement In interfaceObject.Members&#xA;            If member.Kind &amp;lt;&amp;gt; vsCMElement.vsCMElementFunction Then&#xA;                Continue For&#xA;            End If&#xA;&#xA;            Dim method As CodeFunction = member&#xA;            If method.Prototype(prototypeFlags) = prototype Then&#xA;                Return method&#xA;            End If&#xA;        Next&#xA;&#xA;        Return Nothing&#xA;    End Function&#xA;&#xA;    Private Function GetInterfaceMethod(ByRef methodObject As CodeFunction) As CodeFunction&#xA;        Dim parentClass As CodeClass = methodObject.Parent&#xA;        For Each implementedInterface As CodeInterface In parentClass.ImplementedInterfaces&#xA;            If implementedInterface.InfoLocation = vsCMInfoLocation.vsCMInfoLocationProject And UseExternalInterfaceCommentsOnly Then&#xA;                Continue For&#xA;            End If&#xA;            Dim matchedMethod = GetMethod(implementedInterface, methodObject)&#xA;            If Not IsNothing(matchedMethod) Then&#xA;                Return matchedMethod&#xA;            End If&#xA;        Next&#xA;    End Function&#xA;&#xA;    Private Function GetCurrentMethod() As CodeFunction&#xA;        Dim sel As TextSelection = _&#xA;            CType(DTE.ActiveDocument.Selection, TextSelection)&#xA;        Dim pnt As TextPoint = CType(sel.ActivePoint, TextPoint)&#xA;&#xA;        Dim method As CodeFunction = pnt.CodeElement(vsCMElement.vsCMElementFunction)&#xA;        Return method&#xA;    End Function&#xA;&#xA;    Private Sub AddCommentToMethod(ByRef methodObject As CodeFunction, ByRef newComment As String)&#xA;        If methodObject.Comment.IndexOf(newComment) &amp;lt;&amp;gt; -1 Then&#xA;            &amp;#39; This comment has already been added&#xA;            Exit Sub&#xA;        End If&#xA;        methodObject.Comment = newComment &amp;amp; vbNewLine &amp;amp; methodObject.Comment&#xA;    End Sub&#xA;&#xA;    Public Sub CommentImplementedMethod()&#xA;        Try&#xA;            Dim currentMethod = GetCurrentMethod()&#xA;            If IsNothing(currentMethod) Then&#xA;                MsgBox(&amp;quot;Not inside a method scope at the moment!&amp;quot;)&#xA;                Exit Sub&#xA;            End If&#xA;&#xA;            Dim interfaceMethod = GetInterfaceMethod(currentMethod)&#xA;            If IsNothing(interfaceMethod) Then&#xA;                If UseExternalInterfaceCommentsOnly Then&#xA;                    MsgBox(&amp;quot;*External* interface method could not be found!&amp;quot;)&#xA;                Else&#xA;                    MsgBox(&amp;quot;Interface method could not be found!&amp;quot;)&#xA;                End If&#xA;                Exit Sub&#xA;            End If&#xA;&#xA;            Dim newComment = GetSummaryFromDocComment(interfaceMethod.DocComment)&#xA;            AddCommentToMethod(currentMethod, newComment)&#xA;        Catch ex As Exception&#xA;            MsgBox(ex.Message)&#xA;        End Try&#xA;    End Sub&#xA;&#xA;    Private Sub TraverseAndCommentImplementedMethods(ByRef elements As CodeElements)&#xA;        For Each child As CodeElement In elements&#xA;            If child.Kind = vsCMElement.vsCMElementFunction Then&#xA;                Dim currentMethod = CType(child, CodeFunction)&#xA;                If IsNothing(currentMethod) Then&#xA;                    Exit Sub&#xA;                End If&#xA;&#xA;                Dim interfaceMethod = GetInterfaceMethod(currentMethod)&#xA;                If IsNothing(interfaceMethod) Then&#xA;                    Exit Sub&#xA;                End If&#xA;&#xA;                Dim newComment = GetSummaryFromDocComment(interfaceMethod.DocComment)&#xA;                AddCommentToMethod(currentMethod, newComment)&#xA;            End If&#xA;            TraverseAndCommentImplementedMethods(child.Children)&#xA;        Next&#xA;    End Sub&#xA;&#xA;    Public Sub CommentAllImplementedMethodsInFile()&#xA;        Try&#xA;            TraverseAndCommentImplementedMethods(DTE.ActiveDocument.ProjectItem.FileCodeModel.CodeElements)&#xA;        Catch ex As Exception&#xA;            MsgBox(ex.Message)&#xA;        End Try&#xA;    End Sub&#xA;End Module&lt;/code&gt;&lt;/pre&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Mon, 06 Oct 2008 21:08:32 +0000</pubDate>
    </item>
    <item>
      <title>VSTorqueScript #6</title>
      <link>http://blog.blackhc.net/2008/10/vstorquescript-6/index.html</link>
      <description>&lt;p&gt;I&#39;ve spent the last two days working on the Debug Engine and I&#39;ve made some progress:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Tracepoint Support&lt;/li&gt;&#xA;&lt;li&gt;Breakpoint Support&lt;/li&gt;&#xA;&lt;li&gt;Support for the Watch window (I might have enlisted this already once but now support is more complete)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;I&#39;m not going to post any screenshots this time, instead I&#39;ll try to create an alpha package for you to test. This will probably take some time, too, because I want to make sure that you can install and uninstall it cleanly. I&#39;ve been using the experimental hive so far, so I have to make sure it doesn&#39;t corrupt anyone&#39;s installation accidentially... :-)&lt;/p&gt;&#xA;&lt;p&gt;A few implementation notes for interested people as always:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;If you ever have to &lt;a href=&#34;http://bytes.com/forum/thread239603.html&#34;&gt;marshal&lt;/a&gt; an object to an &lt;code&gt;IntPtr&lt;/code&gt;, be very careful, because doing the wrong thing will certainly crash your application - &lt;em&gt;I had that happen to me and it took me quite some time to figure out why Visual Studio was suddenly &#39;experiencing internal problems&#39; and had to be closed&#39; all the time&lt;/em&gt;:&lt;/p&gt;&#xA;&lt;p&gt;When you have to convert an IntPtr to a wrapped object, use&lt;/p&gt;&#xA;&lt;pre class=&#34;cs&#34;&gt;&lt;code&gt;    MyObject object = (MyType) GetObjectFromIUnknown( intPtr ); // or As MyType;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;As you see, the intPtr is a COM object and every COM object implements IUnknown, so the call is pretty safe. The conversion afterwards is already &#39;managed&#39;, so safe, too. If you want to convert an IntPtr from an object, you have to be more careful though. The &lt;code&gt;Marshal&lt;/code&gt; namespace offers at least two methods for it:&lt;/p&gt;&#xA;&lt;pre class=&#34;cs&#34;&gt;&lt;code&gt;public static IntPtr GetComInterfaceForObject(&#xA;    Object o,&#xA;    Type T&#xA;)&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&lt;pre class=&#34;cs&#34;&gt;&lt;code&gt;public static IntPtr GetIUnknownForObject(&#xA;    Object o&#xA;)&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;strong&gt;Don&#39;t use the latter for anything except if you really need an &lt;code&gt;IUnknown&lt;/code&gt; interface &lt;code&gt;IntPtr&lt;/code&gt; pointer!&lt;/strong&gt; The method really only returns a pointer to the &lt;code&gt;IUnknown&lt;/code&gt; interface of the object, which usually isn&#39;t what the unmanaged code expects - which probably will result in misinterpreting some uninitialized memory as a &lt;strong&gt;vtable &lt;/strong&gt;that is &lt;em&gt;not&lt;/em&gt; there. You have to use &lt;code&gt;GetComInterfaceForObject&lt;/code&gt; and don&#39;t forget this. Because you&#39;re only working with &lt;code&gt;IntPtrs&lt;/code&gt; in the end, there is nothing to warn you about your misstep.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you want to use an object with &lt;code&gt;System.Collection.Generic.Dictionary&amp;lt;K,V&amp;gt;&lt;/code&gt;, it&#39;s not sufficient to implement &lt;code&gt;IEquatable&amp;lt;K&amp;gt;&lt;/code&gt; as stated in the documentation - you also have to override &lt;code&gt;GetHashCode&lt;/code&gt; (&lt;em&gt;and override the normal &lt;code&gt;Equals&lt;/code&gt;, too, then while you&#39;re at it&lt;/em&gt;), because &lt;code&gt;Dictionary&lt;/code&gt; uses &lt;code&gt;GetHashCode&lt;/code&gt; for the bucket assignments and you can implement &lt;code&gt;IEquatable&lt;/code&gt; as hard as you want, &lt;code&gt;GetHashCode&lt;/code&gt; might simply assign two &amp;quot;equal&amp;quot; objects to different buffers and you have a problem..&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;One of the benefits of COM is that no one cares about your implementation.. take advantage of it! I had to remember this the hard way, when I implemented my breakpoint code. At first I wrote a &lt;code&gt;PendingBreakpoint&lt;/code&gt; class, which implemented &lt;code&gt;IDebugPendingBreakpoint2&lt;/code&gt;, and then a &lt;code&gt;BoundBreakpoint&lt;/code&gt; one, which implemented &lt;code&gt;IDebugBoundBreakpoint2&lt;/code&gt;. It was unnecessary messy and today I sighed and rewrote the breakpoint code to use just one &lt;code&gt;Breakpoint&lt;/code&gt; class that implements both interfaces and it&#39;s a lot more elegant now.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Funny fact: An enum that is even mentioned in MSDN and the SDK docs is missing from the &lt;code&gt;Interops&lt;/code&gt; library:&lt;/p&gt;&#xA;&lt;pre class=&#34;cs&#34;&gt;&lt;code&gt;public enum enum_BP_UNBOUND_REASON&#xA;{&#xA;    BPUR_UNKNOWN = 0x0000,&#xA;    BPUR_CODE_UNLOADED = 0x0002,&#xA;    BPUR_BREAKPOINT_REBIND = 0x0003,&#xA;    BPUR_BREAKPOINT_ERROR = 0x0004&#xA;};&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The initialization process for the DE is as follows:&lt;/p&gt;&#xA;&lt;ol type=&#34;1&#34;&gt;&#xA;&lt;li&gt;DebugEngine and Program Creation Events&lt;/li&gt;&#xA;&lt;li&gt;Load Complete Event&lt;/li&gt;&#xA;&lt;li&gt;Call CreatePendingBreakpoint for all known breakpoints&lt;/li&gt;&#xA;&lt;li&gt;First Continue Call&lt;/li&gt;&#xA;&lt;li&gt;Entry Point Event&lt;/li&gt;&#xA;&lt;li&gt;Either the second Continue call or the SDM enters break mode&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;I had to write a few wrapper classes, too, which I might post about next time around. It&#39;s enough for today though.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Cheers,&lt;br /&gt;&#xA; Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Fri, 03 Oct 2008 22:35:32 +0000</pubDate>
    </item>
    <item>
      <title>Crysis notes - random</title>
      <link>http://blog.blackhc.net/2008/10/crysis-notes-random/index.html</link>
      <description>&lt;p&gt;Last week I had the joy of playing and &lt;a href=&#34;http://www.joystiq.com/2007/02/14/alex-ward-flips-out-during-mtv-interview/&#34;&gt;&lt;strong&gt;beating&lt;/strong&gt;&lt;/a&gt; Crysis (you&#39;ll find out later why I emphasize that I beat it). While playing I took some notes, which I want to share with you (some might be funny facts, others might show why Crysis sucks and others could be proof for some awesomeness that you can---&lt;em&gt;still?&lt;/em&gt;---find in the game).&lt;/p&gt;&#xA;&lt;p&gt;First off though, this is going to contain lots and lots of &lt;em&gt;spoilers&lt;/em&gt;, so just lemme put up a&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;em&gt;&lt;strong&gt;SPOILER ALERT&lt;/strong&gt;&lt;/em&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;sign here before continuing.&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xA;&lt;p&gt;Let me also start with a few clarifications: although it might totally sound as if Crysis is a shitty game when you read my notes, it still is an awesome game with the best graphics, best physics and best destructible game environment you can find anywhere at the moment.&lt;/p&gt;&#xA;&lt;p&gt;And it &lt;a href=&#34;http://www.crysis-online.com/viewer.php?id=172&#34;&gt;looks&lt;/a&gt; &lt;a href=&#34;http://img511.imageshack.us/img511/6769/crysis20071102151055481fn2.jpg&#34;&gt;gorgeous&lt;/a&gt;..&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://www.crysis-online.com/viewer.php?id=188&#34;&gt;Absolutely&lt;/a&gt; &lt;a href=&#34;http://www.crysis-online.com/viewer.php?id=207&#34;&gt;gorgeous&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Let&#39;s start now:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;img src=&#34;http://media.ignimgs.com/guides/guides/694190/crysis_009.jpg&#34; alt=&#34;Crysis Screenshot&#34; align=&#34;right&#34; /&gt; I&#39;m always kind of an explorer in games. After killing everyone in the first map in the part when you have to disable the jammer, I went around and looked at everything. I also began a violent rampage and destroyed everything I could, too. It&#39;s &lt;strong&gt;fun&lt;/strong&gt;. &lt;em&gt;To be honest when I played the game for the first time at my cousin&#39;s, I spent half an hour destroying huts, cars, boats and trees---lots of them---and I had the most fun in a long time, too.&lt;/em&gt; Having destroyed everything I noticed that there was a fridge in the hut, so I opened it and died. You heard me: &lt;strong&gt;the bloody fridge killed me when I opened it!&lt;/strong&gt; Never try to open a fridge in the game when something is behind you and blocking you because the door of the fridge will squish you like a fly. Of course, I hadn&#39;t saved, so I enjoyed playing the same part a second time &amp;gt;_&amp;lt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I also realized that corpses disappear really quickly and there is not ragdoll physics on them either. I had the German version installed (except for the English language paks), so I figured that the German version has been cut, but a quick search quickly showed that Crytek removed some features everywhere and actively banned people who released mods which re-enabled some of them. I&#39;m always pissed when I have to play a cut version because of some weird sense for censorship in Germany (for whatever reason---Crysis is rated AO in Germany, so I honestly don&#39;t get it), but the way threads were closed and deleted on all possible Crysis boards really made me angry. Crytek/EA sent emails to boards that contained threads they didn&#39;t like and pressured the admins into deleting stuff---someone must have learnt a thing or two from his history lessons, right Crytek? Sometimes soldiers lose their caps and when you shoot these, you actually get to see &lt;a href=&#34;http://img389.imageshack.us/img389/7730/02crysislochwo4.jpg&#34;&gt;the original blood decals and splatter&lt;/a&gt; and it&#39;s pretty crazy how high-detail they are and how much better they look compared to the &amp;quot;blood patches&amp;quot; available.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Playing 10+x intro videos is also incredibly annoying, I removed most of them after starting Crysis for the third time because they were simply annoying.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;One thing that is very nice are the suit shortcuts (&lt;em&gt;double-tapping some keys to activate a suit mode, e.g. jump for strength, crouch for stealth, sprint for speed and walk backwards for armor&lt;/em&gt;). For the first one or two hours I played without them and when I discovered them in the options menu, the game suddenly became a lot more fun. I still can vividly remember a scene in the first level, where I used the suit shortcuts to do some pretty crazy stunts and runs: Jumping onto a roof, sprinting and jumping towards a jeep and shooting everyone inside during the final jump. Later I kept sprinting towards soldiers like some kind of Predator and used one of them as shield before throwing him onto his colleagues.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Crysis&#39; &lt;strong&gt;AI&lt;/strong&gt; is pretty horribly though. At least the low-level AI stuff: Soldiers didn&#39;t see me countless times, although I was standing right in front of them or shooting at them and they simply didn&#39;t notice me. Later in the game I found out that the silencers had some weird/exaggerated effect and that turning the silencer weapon modification off actually fixed some of the issues but in general I had lots of problems with it. If you were standing on a roof and actively shoot someone, the bots wouldn&#39;t notice it---even when playing on &lt;em&gt;Hard&lt;/em&gt; or &lt;em&gt;Delta&lt;/em&gt; difficulty.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I also once chased a patrol boat in sprint mode and I was pretty disappointed by the fact that you can&#39;t &lt;em&gt;&lt;strong&gt;board&lt;/strong&gt;&lt;/em&gt; a boat :-( You can jump onto it by using speed mode, sprinting under water and jumping out of the water like a flying fish---if you time it well, you can actually land on a patrol boat but the AI totally freaks out when that happens: The driver stops the boat, but doesn&#39;t do anything else, while the cannoneer jerks around continuously which looks &lt;strong&gt;really&lt;/strong&gt; awkward and buggy.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;img src=&#34;http://media.ignimgs.com/guides/guides/694190/crysis_050.jpg&#34; align=&#34;right&#34; /&gt; In general you can have quite a lot of fun by trying weird strategies. For example, there is a command post on a cliff that you have to take out and I drove to it with a boat and jumped up the rocks on the cliff side---only to get stuck between two rocks which eventually forced me to reload the last quicksave, because I couldn&#39;t get the player unstuck. The game often punishes you for unconventional actions because the suit makes it really easy to get outside the level designer&#39;s thinking which is often equal to a total breakdown of gameplay and fun. I&#39;m used to become creative when I have additional powers like those provided by the nano suit and I felt encouraged to use different approaches to what I&#39;d normally do in a &lt;em&gt;first-person shooter&lt;/em&gt;. I think that&#39;s just the conditioning from other games where you often have to use special abilities in the levels to solve puzzles (e.g. Prince of Persia or Prey). It&#39;s a pity Crysis didn&#39;t really require that.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Did I mention that the physics system is awesome? It is. If there is one single element that makes Crysis exceptional than it is its graphics. But only its physics system makes the game a pleasure to watch. The way you can destroy things really adds a lot and the way the environment reacts to your destruction---like sandbags being hurled around by a grenade explosion---make the game more satisfying. I once read that one of the intentions of Crytek was to make the game play and look like a good action movie and I often felt this way when playing. Trying my best to make the action look worthwhile---but often enough the game punished me for that idea.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;img src=&#34;http://media.ignimgs.com/guides/guides/694190/crysis_026.jpg&#34; align=&#34;right&#34; /&gt; I actually replayed the second level of the game, because at first I used a boat to avoid most of the level and get to the village where a hostage was kept and it wasn&#39;t fun at all because I entered the level from the wrong side (unintended by the game designers) and it was very boring.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I still don&#39;t get why anyone can say that Crysis&#39;s AI is awesome.. its squad behavior is horrible and soldiers generally die like flies. There was one particular moment when I was inside a house and soldiers kept in pouring one by one from the same entrance (mind you there were windows and they had grenades, too, but didn&#39;t use them) and I killed them one by one. This was when I decided to restart the level.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;blockquote&gt;&#xA;You need to force Crysis to be fun, if you want to have fun.&#xA;&lt;/blockquote&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Because of all the AI issues I decided to try the &lt;a href=&#34;http://www.moddb.com/mods/crysis-advanced-ai&#34;&gt;Advanced AI mod for Crysis&lt;/a&gt; and I have to admit that the opponents became a lot tougher but still had issues (again I suspect some silencer weirdness happening). Later in the game I removed the mod again, because I experienced some weird bugs with the viewmodels and decided that I should play the game vanilla, so I know who is responsible for bugs.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;img src=&#34;http://media.ignimgs.com/guides/guides/694190/crysis_035.jpg&#34; align=&#34;right&#34; /&gt; In some levels it is also ridiculously easy to get out of the level area and be notified that you will be terminated in &lt;strong&gt;&lt;em&gt;3...2...1...&lt;em&gt;woops&lt;/em&gt;&lt;/em&gt;&lt;/strong&gt; if you don&#39;t get back---if you toy around with strength mode, it&#39;s pretty easy to jump into areas you shouldn&#39;t be in. &lt;em&gt;I think the levels weren&#39;t tested sufficiently with the different suit modes and/or the guidlines for the level designers weren&#39;t good enough.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In the level in which you have to destroy the AAA batteries Crysis became pretty boring for me. Everything was nice but it was repetitive, too, and it wasn&#39;t challenging at all although it was still difficult (on &lt;em&gt;Hard&lt;/em&gt;/&lt;em&gt;Delta&lt;/em&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The tank level after it is pretty awesome. I got lost a few times though and didn&#39;t know what to do because being told to &amp;quot;&lt;em&gt;move forward to alpha front line&lt;/em&gt;&amp;quot; or something like that doesn&#39;t really help when you have no idea what people are talking about and the map doesn&#39;t show anything either (I kind of expected an &lt;em&gt;ETQW&lt;/em&gt;-esque map to show up and tell me what to do). The first time I played the level I drove around and felt totally lost because I didn&#39;t know what to do and whom to shoot. Then I decided that I wouldn&#39;t let either of the accompanying tanks &#39;die&#39; and restarted the level and stuck to that and although I had to reload more often, it was ok and fun because I had more of a mission than just reaching some train station---instead I took the enemy tanks and positions out one by one till I ran out of shells. &lt;em&gt;GameStar complained about the lack of guidance in the game and I have to surprise myself by agreeing with them on this finding :-/&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I noticed some weird &lt;strong&gt;viewmodel bugs &lt;/strong&gt;during the game. Sometimes when looking through the scope and switching back, the view position wouldn&#39;t be reset and suddenly you wouldn&#39;t see your weapon anymore. Another weird bug was with the actual player viewmodel: The player&#39;s arm were suddenly visible behind me holding nothing. Saving and reloading would fix those bugs most of the time.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;img src=&#34;http://media.ignimgs.com/guides/guides/694190/crysis_119.jpg&#34; align=&#34;right&#34; /&gt; Another weird thing was my fight against &lt;strong&gt;General Kyong&lt;/strong&gt;: I didn&#39;t know what to do at first and I didn&#39;t really think of it, when I switched to strength mode and &lt;em&gt;punched&lt;/em&gt; General Kyong to death. You heard right: I punched him to death---&lt;strong&gt;without losing any health or being hit once.&lt;/strong&gt; How stupid is that for a boss fight? The poor coward tried to run away from me but he wasn&#39;t faster than me, of course, because he was using strength mode, too. He also somehow didn&#39;t manage to shoot because his mini-gun has quite some start-up time. That was the most sobering moment in the game for me because what I did felt totally wrong and I should have lost for that. Instead it worked exceptionally well and &lt;em&gt;I punched him some 10 to 20 times before he dropped dead..&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;img src=&#34;http://media.ignimgs.com/guides/guides/694190/crysis_139.jpg&#34; align=&#34;right&#34; /&gt; The &lt;strong&gt;alienship&lt;/strong&gt; was a &lt;strong&gt;&lt;em&gt;meh&lt;/em&gt;&lt;/strong&gt; level, too: it was nice in the beginning and the zero gravity stuff was okay, too, but it was too long to be interesting. At the end, I had to wait like 10 minutes in the last chamber, before something actually happened.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The &amp;quot;Paradise Lost&amp;quot; level looks very nice and I enjoyed the snow and ice, too. I still doubt that anything can actually burn at -200 degrees (F or °C, doesn&#39;t really matter either), but whatever.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;During the cut-scene in which Prophet reappears the game actually crashed a few times for me (that is it crashed each time I replayed it). I waited some 10 minutes hoping that it was some overheating issue with the graphics card and indeed it worked after that, but good lord, I really was scared that playing Crysis was over for me at that moment.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The carrier levels are okay, although the seemingly endless waves of aliens were tedious after some time. I never get why games that try to appear &lt;em&gt;&#39;serious&#39;&lt;/em&gt; and &lt;em&gt;&#39;realistic&#39;&lt;/em&gt; still employ boss fights and the like as a means of game design. It totally doesn&#39;t make sense and only Arcade games should use it. &lt;em&gt;When I played Half-Life 2, the boss helicopter totally put me off, and the same applies to all boss fights in Crysis. It simply doesn&#39;t feel right...&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;img src=&#34;http://media.ignimgs.com/guides/guides/694190/crysis_220.jpg&#34; align=&#34;right&#34; /&gt; Especially if you can&#39;t finish the game for some &lt;strong&gt;damn bug!!!&lt;/strong&gt; One thing that really made me angry and with angry I mean annoyed and with annoyed I mean totally pissed off was a bug in the last bit of the last level where you have to shoot a hatch with the TAC gun: &lt;em&gt;&lt;strong&gt;The damn thing wouldn&#39;t lock on!&lt;/strong&gt;&lt;/em&gt; I replayed the last part of the level for 3 or 4 times on &lt;em&gt;Hard&lt;/em&gt; until I was totally upset with the game. Add to that some annoying bug where you can fall through the deck and I gave up. I googled a bit and I found out that quite a few people had actually &lt;a href=&#34;http://www.crysis-online.com/forum/index.php?topic=15620.msg242535&#34;&gt;experienced that bug&lt;/a&gt; and it has turned them off as much as me. I switched to god mode, infinite ammo, etc. and replayed the last half of the level to see if I could maybe actually finish the game and indeed it worked when I played it for the fifth time.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The ending totally sucks. Cliff hangers are okay sometimes, but I really felt like it was a really bad ending---especially after that incredibly stupid boss fight.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Last but not least a last &lt;em&gt;bug&lt;/em&gt;: If you catch a hunter, it needs quite a few punches to &lt;em&gt;die&lt;/em&gt;. If you simply throw it away from you after catching it, it immediately deactivates. Logic?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;All in all, the bugs in Crysis and the constant AI issues drove me nuts and I totally felt like I beat the game when it was over and I don&#39;t want to touch it anytime soon again. I feel sorry for EA&#39;s QA people. They must have been in for a painful one if the released game still had so many bugs :( However Crysis is still a good game (if you have a fast PC) and has some nice cut-scenes and action sequences and the graphics and physics in the game are simple the best you can find at the moment (except for Crysis Warhead I guess).&lt;/p&gt;&#xA;&lt;p&gt;With this I conclude my &#39;random notes&#39; review and hope that &lt;strong&gt;Crysis: Warhead&lt;/strong&gt; has fewer bugs and is more fun to play because Crysis really deserved to be more fun.&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br /&gt;&#xA; Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Thu, 02 Oct 2008 00:21:15 +0000</pubDate>
    </item>
    <item>
      <title>VSTorqueScript #5.1</title>
      <link>http://blog.blackhc.net/2008/09/vstorquescript-51/index.html</link>
      <description>&lt;p&gt;Sadly there isn&#39;t a lot new that I can post since I&#39;ve hardly had time to work on my pet project during the last week - a few friends from Texas and California came over for the Oktoberfest and it suffices to say that I drank a lot of beer last week.&lt;/p&gt;&#xA;&lt;p&gt;Nonetheless there is some progress and I&#39;ve finished support for stepping in break mode (although I still have no idea what &lt;code&gt;enum_STEPKIND.STEP_BACKWARDS&lt;/code&gt; is about since I&#39;ve never heard of stepping &lt;em&gt;&lt;strong&gt;backwards&lt;/strong&gt;&lt;/em&gt; before).&lt;/p&gt;&#xA;&lt;p&gt;There is no screenshot this time because you wouldn&#39;t really see a difference, except if I did, before/after screenshots to show that the stepping works.&lt;/p&gt;&#xA;&lt;p&gt;A few coding notes as always:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The current TorqueScript telnet debugger doesn&#39;t really tell you whether it breaks because of stepping or because it has hit a breakpoint, so I have to figure it myself. It is pretty straightforward though because stepping usually implies a certain callstack change (or the lack thereof) when finished:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&amp;quot;Step Into&amp;quot; implies that the new callstack height &amp;gt; old height&lt;/li&gt;&#xA;&lt;li&gt;&amp;quot;Step Over&amp;quot; implies no change&lt;/li&gt;&#xA;&lt;li&gt;&amp;quot;Step Out&amp;quot; implies of course: new callstack height &amp;lt; old height&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;So it&#39;s pretty easy to figure out whether the stepping was finished or interrupted by a breakpoint.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The class diagram designer/viewer in Visual Studio 200x is awesome. If you haven&#39;t tried it, you&#39;ve missed a really helpful feature of Visual Studio. Lately I&#39;ve been using it to comment my public functions and parameters, etc. and for small refactorings (like name changes) in general.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Last but not least I think I&#39;ve written a neat communication class for synchronous and asynchronous message processing which I&#39;d like to share (&lt;strong&gt;&lt;em&gt;if you&#39;re going to use it though, please tell me and/or send me some feedback&lt;/em&gt;&lt;/strong&gt;):&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xA;&lt;pre class=&#34;cs&#34;&gt;&lt;code&gt;using System;&#xA;using System.Collections.Generic;&#xA;using System.Linq;&#xA;using System.Text;&#xA;using System.Threading;&#xA;using System.Diagnostics;&#xA;&#xA;namespace BlackHC.VSTorqueScript.DebugEngine&#xA;{&#xA;    class Communication&#xA;    {&#xA;        [Flags]&#xA;        public enum ReturnAction&#xA;        {&#xA;            ContinueSearch = 0,&#xA;            AcceptMessage = 1,&#xA;            RemoveHandler = 2,&#xA;            Done = AcceptMessage | RemoveHandler&#xA;        }&#xA;&#xA;        /// &amp;lt;summary&amp;gt;&#xA;        /// Delegate Communication will call to send a message&#xA;        /// &amp;lt;/summary&amp;gt;&#xA;        public delegate void SendMessageDelegate(string message);&#xA;        /// &amp;lt;summary&amp;gt;&#xA;        /// Delegate which Communication will call to read a message&#xA;        /// &amp;lt;/summary&amp;gt;&#xA;        public delegate string ReadMessageDelegate();&#xA;&#xA;        public delegate void ReplyMessageHandler(string message);&#xA;        public delegate ReturnAction MessageHandler(Communication sender, string message);&#xA;&#xA;        /// &amp;lt;summary&amp;gt;&#xA;        /// Events in this list are invoked in reverse order (to allow FILO-style message handler processing).&#xA;        /// Lock MessageHandlers when adding message handlers&#xA;        /// &amp;lt;/summary&amp;gt;&#xA;        public event MessageHandler MessageHandlers;&#xA;&#xA;        private readonly ReadMessageDelegate ReadMessage;&#xA;        private readonly SendMessageDelegate SendMessage;&#xA;&#xA;        private Thread asyncMessageReceiver;&#xA;        private object asyncLock = new object();&#xA;&#xA;        /// &amp;lt;param name=&amp;quot;readMessage&amp;quot;&amp;gt;Delegate to read messages from&amp;lt;/param&amp;gt;&#xA;        /// &amp;lt;param name=&amp;quot;sendMessage&amp;quot;&amp;gt;Delegate to send messages with&amp;lt;/param&amp;gt;&#xA;        public Communication(ReadMessageDelegate readMessage, SendMessageDelegate sendMessage)&#xA;        {&#xA;            ReadMessage = readMessage;&#xA;            SendMessage = sendMessage;&#xA;        }&#xA;&#xA;        /// &amp;lt;summary&amp;gt;&#xA;        /// Start processing incoming messages by starting the asynchronous processing thread&#xA;        /// &amp;lt;/summary&amp;gt;&#xA;        public void StartReceiving()&#xA;        {&#xA;            if (asyncMessageReceiver == null)&#xA;            {&#xA;                asyncMessageReceiver = new Thread(ReceiveMessages);&#xA;                asyncMessageReceiver.Start();&#xA;            }&#xA;        }&#xA;&#xA;        /// &amp;lt;summary&amp;gt;&#xA;        /// End the asynchronous receiver thread&#xA;        /// &amp;lt;/summary&amp;gt;&#xA;        public void Close()&#xA;        {&#xA;            if (asyncMessageReceiver != null)&#xA;            {&#xA;                asyncMessageReceiver.Abort();&#xA;            }&#xA;        }&#xA;&#xA;        /// &amp;lt;summary&amp;gt;&#xA;        /// Send a simple message&#xA;        /// &amp;lt;/summary&amp;gt;&#xA;        public void Send(string message)&#xA;        {&#xA;            SendMessage(message);&#xA;        }&#xA;&#xA;        /// &amp;lt;summary&amp;gt;&#xA;        /// Send a request and wait for a reply that starts with the expected string. Time-out after a specified period of time&#xA;        /// &amp;lt;/summary&amp;gt;&#xA;        /// &amp;lt;param name=&amp;quot;request&amp;quot;&amp;gt;Request to send&amp;lt;/param&amp;gt;&#xA;        /// &amp;lt;param name=&amp;quot;replyStartsWith&amp;quot;&amp;gt;Start of the reply to wait for&amp;lt;/param&amp;gt;&#xA;        /// &amp;lt;param name=&amp;quot;millisecondsTimeout&amp;quot;&amp;gt;Timeout time in msecs (-1 for infinite)&amp;lt;/param&amp;gt;&#xA;        /// &amp;lt;param name=&amp;quot;timedOut&amp;quot;&amp;gt;Out variable to be set depending of whether the request timed-out or not&amp;lt;/param&amp;gt;&#xA;        /// &amp;lt;returns&amp;gt;remaining part of the found message (after the replyStartsWith part)&amp;lt;/returns&amp;gt;&#xA;        public string SyncRequest(string request, string replyStartsWith, int millisecondsTimeout, out bool timedOut)&#xA;        {&#xA;            AutoResetEvent waitHandler = new AutoResetEvent(false);&#xA;            String reply = &amp;quot;&amp;quot;;&#xA;&#xA;            MessageHandler handler = delegate(Communication sender, string message)&#xA;            {&#xA;                if (message.StartsWith(replyStartsWith))&#xA;                {&#xA;                    reply = message.Substring(replyStartsWith.Length);&#xA;                    waitHandler.Set();&#xA;                    return ReturnAction.Done;&#xA;                }&#xA;                else&#xA;                {&#xA;                    return ReturnAction.ContinueSearch;&#xA;                }&#xA;            };&#xA;&#xA;            lock (asyncLock)&#xA;            {&#xA;                Send(request);&#xA;                MessageHandlers += handler;&#xA;            }&#xA;&#xA;            timedOut = waitHandler.WaitOne(millisecondsTimeout, false);&#xA;            if (!timedOut)&#xA;            {&#xA;                // remove the handler again, since we timed-out&#xA;                lock (asyncLock)&#xA;                {&#xA;                    MessageHandlers -= handler;&#xA;                }&#xA;            }&#xA;            return reply;&#xA;        }&#xA;&#xA;        public string SyncRequest(string request, string replyStartsWith, int millisecondsTimeout)&#xA;        {&#xA;            bool timedOut;&#xA;            return SyncRequest(request, replyStartsWith, millisecondsTimeout, out timedOut);&#xA;        }&#xA;&#xA;        // TODO: add a time-out here, too? [9/18/2008 Andreas]&#xA;        /// &amp;lt;summary&amp;gt;&#xA;        /// Starts an asynchronous request.&#xA;        /// &amp;lt;/summary&amp;gt;&#xA;        /// &amp;lt;param name=&amp;quot;request&amp;quot;&amp;gt;Message request to be sent&amp;lt;/param&amp;gt;&#xA;        /// &amp;lt;param name=&amp;quot;replyStartsWith&amp;quot;&amp;gt;Start of the reply to wait for&amp;lt;/param&amp;gt;&#xA;        /// &amp;lt;param name=&amp;quot;replyMessageHandler&amp;quot;&amp;gt;Message handler that is passed the rest of the message (after the replyStartsWith part)&amp;lt;/param&amp;gt;&#xA;        public void AsyncRequest(string request, string replyStartsWith, ReplyMessageHandler replyMessageHandler)&#xA;        {&#xA;            MessageHandler handler = delegate(Communication sender, string message)&#xA;            {&#xA;                if (message.StartsWith(replyStartsWith))&#xA;                {&#xA;                    string reply = message.Substring(replyStartsWith.Length);&#xA;                    replyMessageHandler(reply);&#xA;                    return ReturnAction.Done;&#xA;                }&#xA;                else&#xA;                {&#xA;                    return ReturnAction.ContinueSearch;&#xA;                }&#xA;            };&#xA;&#xA;            lock (asyncLock)&#xA;            {&#xA;                Send(request);&#xA;                MessageHandlers += handler;&#xA;            }&#xA;        }&#xA;&#xA;        private void ReceiveMessages()&#xA;        {&#xA;            while (true)&#xA;            {&#xA;                try&#xA;                {&#xA;                    string message;&#xA;                    try&#xA;                    {&#xA;                        message = ReadMessage();&#xA;                    }&#xA;                    catch (System.Exception)&#xA;                    {&#xA;                        // the connection has been closed or something similar has happened, so terminate the thread&#xA;                        return;&#xA;                    }&#xA;&#xA;                    if (message != null)&#xA;                    {&#xA;                        ProcessMessage(message);&#xA;                    }&#xA;                    else&#xA;                    {&#xA;                        // lost connection, terminate the thread, too&#xA;                        return;&#xA;                    }&#xA;&#xA;                }&#xA;                catch (System.Exception e)&#xA;                {&#xA;                    // don&amp;#39;t let Visual studio die here&#xA;                    Trace.WriteLine(&amp;quot;Exception in ReceiveMessages: &amp;quot; + e.ToString());&#xA;                }&#xA;            }&#xA;        }&#xA;&#xA;        private void ProcessMessage(string message)&#xA;        {&#xA;            if (MessageHandlers != null)&#xA;            {&#xA;                System.Delegate[] invocationList;&#xA;                lock (asyncLock)&#xA;                {&#xA;                    invocationList = (System.Delegate[])MessageHandlers.GetInvocationList().Clone();&#xA;                }&#xA;&#xA;                foreach (System.Delegate eventDelegate in invocationList.Reverse())&#xA;                {&#xA;                    MessageHandler handler = (MessageHandler)eventDelegate;&#xA;&#xA;                    ReturnAction action = handler.Invoke(this, message);&#xA;                    if ((action &amp;amp; ReturnAction.RemoveHandler) != 0)&#xA;                    {&#xA;                        // FIXME: is this lock necessary? [9/18/2008 Andreas]&#xA;                        lock (asyncLock)&#xA;                        {&#xA;                            MessageHandlers -= handler;&#xA;                        }&#xA;                    }&#xA;                    if ((action &amp;amp; ReturnAction.AcceptMessage) != 0)&#xA;                    {&#xA;                        break;&#xA;                    }&#xA;                }&#xA;            }&#xA;            else&#xA;            {&#xA;                Trace.WriteLine(String.Format(&amp;quot;Communication: Unhandled message - &amp;#39;{0}&amp;#39;&amp;quot;, message));&#xA;            }&#xA;        }&#xA;    }&#xA;}&lt;/code&gt;&lt;/pre&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Mon, 29 Sep 2008 09:04:30 +0000</pubDate>
    </item>
    <item>
      <title>VSTorqueScript #5</title>
      <link>http://blog.blackhc.net/2008/09/vstorquescript-5/index.html</link>
      <description>&lt;p&gt;It took me quite long to make progess in the last days. Partially this is due me being in Munich again and working in my uni job part-time again - and I&#39;m stunned each time how tired I am when I come home.&lt;/p&gt;&#xA;&lt;p&gt;It also is due to me experimenting with my &lt;em&gt;TelnetDebuggerClient&lt;/em&gt; implementation that connects my debug engine to Torque&#39;s Telnet Debugger. I&#39;ve tried quite a few different approaches for synchronous and asynchronous communication before I could settle for the simplest and the more advanced ones reside in the repository&#39;s history. I&#39;ll probably have to switch to them sooner or later because I only implement asynchronous communication at the moment which is fine for most things except when you need more advanced debugging info like for displaying objects properly in the debug window for example.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve also had to read the &amp;quot;&lt;a href=&#34;http://pragprog.com/titles/tpantlr/the-definitive-antlr-reference&#34;&gt;Definitive ANTLR Reference&lt;/a&gt;&amp;quot; in one night because I had to return it to uni&#39;s library the next day, so I was busy for 7 hours reading 350 pages of a parser reference. It was interesting though and tonight I&#39;ll try to write a QuakeC grammar - that&#39;s the plan at least.&lt;/p&gt;&#xA;&lt;p&gt;However yesterday, I had time to work on the debug engine some more and here&#39;s a picture that tells it all:&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/2008-09-17-vstorquescript-5/callstack1.jpg&#34; alt=&#34;VSTorqueScript now supports displaying the callstack, too&#34; /&gt;&lt;figcaption&gt;VSTorqueScript now supports displaying the callstack, too&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;As you see you can now break a program and it will retrieve the callstack from Torque and update the callstack window automatically and open the right file and jump to the correct file position, too - &lt;em&gt;or rather as I&#39;ve just noticed one-line off because VS line indicies have base 0 and TorqueScript uses base 1 &amp;gt;&lt;/em&gt;&amp;gt;..._&lt;/p&gt;&#xA;&lt;p&gt;A few implementation notes as always:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;It seems, if your &lt;em&gt;Debug Engine&lt;/em&gt; doesn&#39;t implement &lt;strong&gt;&lt;em&gt;IDebugEngineLaunch2&lt;/em&gt;&lt;/strong&gt;, your &lt;em&gt;Program Provider&lt;/em&gt; has to implement &lt;em&gt;&lt;strong&gt;IDebugProgramProvider2.WatchForProviderEvents&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Moreover, if you don&#39;t implement &lt;strong&gt;&lt;em&gt;IDebugEngineLaunch2&lt;/em&gt;&lt;/strong&gt;, which in turn forces you to implement &lt;em&gt;&lt;strong&gt;IDebugProcess2&lt;/strong&gt;&lt;/em&gt; (and maybe &lt;em&gt;&lt;strong&gt;IDebugProcess3&lt;/strong&gt;&lt;/em&gt;, too), suddenly some &amp;quot;deprecated&amp;quot; methods in your Program class (your &lt;em&gt;&lt;strong&gt;IDebugProgram2&lt;/strong&gt;&lt;/em&gt; implementation) will be called, which, if you follow MSDN and the debug engine sampe, will result in failed asserts and the nice fail message &lt;em&gt;&amp;quot;This function is not called by the debugger.&amp;quot;&lt;/em&gt; :-) It&#39;s kind of logical that &lt;em&gt;&lt;strong&gt;IDebugProgram2.Execute()&lt;/strong&gt;&lt;/em&gt; is going to be called because the debugger has no &lt;em&gt;&lt;strong&gt;IDebugProcess2&lt;/strong&gt;&lt;/em&gt; interface to call _Execute _on..&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What is &lt;strong&gt;&lt;em&gt;enum_FRAMEINFO_FLAGS_VALUES&lt;/em&gt;&lt;/strong&gt;? It&#39;s undocumented and I suspect it&#39;s used for the undocumented &lt;em&gt;&lt;strong&gt;m_dwFlags&lt;/strong&gt;&lt;/em&gt; field in &lt;em&gt;&lt;strong&gt;FRAMEINFO&lt;/strong&gt;&lt;/em&gt;...&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I&#39;m totally stunned by how &lt;strong&gt;stable&lt;/strong&gt; Visual Studio is. Most of the interfaces I implement are only half implemented and return E_NOTIMPL on most calls and Visual Studio runs and runs well and only displays the information it can in a clean way.&lt;/p&gt;&#xA;&lt;p&gt;I guess this is one of the advantages of the &lt;em&gt;COM programming/design paradigma&lt;/em&gt; and I think it&#39;s great. Being able to implement interfaces bit by bit and add functionality slowly makes debugging easier and also helps you understand things better - which is good because even though a lot is documented, you still need some practice and trial &amp;amp; error to get things right eventually.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Enough is enough though for now, and I&#39;ll head to uni in a bit.&lt;/p&gt;&#xA;&lt;p&gt;Only one last remark: I&#39;ve started reading the book &amp;quot;&lt;a href=&#34;http://www.pragprog.com/the-pragmatic-programmer&#34;&gt;The Pragmatic Programmer&lt;/a&gt;&amp;quot; and so far it&#39;s really entertaining and, I guess, good. I&#39;ll write more on it, when I&#39;ve finished it and can actually assess its qualities..&lt;/p&gt;&#xA;&lt;p&gt;Cheers, Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Wed, 17 Sep 2008 10:53:50 +0000</pubDate>
    </item>
    <item>
      <title>Weird Things Happen</title>
      <link>http://blog.blackhc.net/2008/09/weird-things-happen/index.html</link>
      <description>&lt;p&gt;Today I was at work for the first time since August and nobody seems to have logged into my shared workstation since then: my account name was still in the login field.&lt;/p&gt;&#xA;&lt;p&gt;The first weird thing that happened was that suddenly the application I&#39;ve been working on didn&#39;t run correctly anymore.&lt;/p&gt;&#xA;&lt;p&gt;First let me tell you a bit about the app: It renders a volume texture with some custom raytracing shaders in one window and allows editing of the &lt;strong&gt;transfer function&lt;/strong&gt; - this is a function (or texture) that maps a value in the volume texture to a color in another window. The &lt;em&gt;transfer function&lt;/em&gt; is made up of shapes that you can colorize and stretch or deform the way you want to allow for easy editing. Look at &lt;a href=&#34;http://software.sci.utah.edu/doc/User/Tutorials/BioImage/Figures/editTFWindow.jpg&#34;&gt;this picture&lt;/a&gt; to see what a transfer function (editor) could look like - this isn&#39;t ours though. The &lt;strong&gt;TF&lt;/strong&gt; editor uses an &lt;strong&gt;FBO&lt;/strong&gt; to render the &lt;em&gt;transfer function&lt;/em&gt; into the &lt;em&gt;transfer texture&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;While the rest of the app was running mostly fine (that is AntTweakBar rendered fine and the background of the transfer function editor which is a histogram of the volume texture, too), the actual transfer function rendering was corrupted. On my workstation you could move the primitive around and while you did so it would either totally disappear, invert its color or show small light green or purple blocks that stayed stationary inside the window as you moved the primitive around - the whole look liked corrupted memory that stayed corrupted and was only visible when the primitive rendered over it.&lt;/p&gt;&#xA;&lt;p&gt;It&#39;s a pity I didn&#39;t take any screenshots but I didn&#39;t think of that back then.&lt;/p&gt;&#xA;&lt;p&gt;I was totally at a loss with this behavior, so I rebooted which didn&#39;t fix it. Somehow I was hoping that the gfx card broke in the last month and it wasn&#39;t my code which caused this totally inexplicable behavior. To determine this I logged into another workstation in our lab, checked out my code and run the program. To my horror it had similar problems... not quite the same but still strangely colored sprinkles all over the editor window when the primitive was rendered there. Both workstations are using graphics cards from &lt;strong&gt;Nvidia&lt;/strong&gt; (&lt;strong&gt;8800 GTX&lt;/strong&gt; if I recall correctly).&lt;/p&gt;&#xA;&lt;p&gt;I tried to determine the revision which broke rendering with a binary search like trial &amp;amp; error through our revision history at work and found out that it broke when I changed the way the primitives were rendered to the texture.&lt;/p&gt;&#xA;&lt;p&gt;It used to simply iterate through all primitives and render them once into the &lt;em&gt;FBO&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The paper I&#39;m implementing at the moment required a special solution for overlapping primitives though, so I switched to a more complicated 2.5 pass rendering.&lt;/p&gt;&#xA;&lt;p&gt;If &lt;span class=&#34;math inline&#34;&gt;\(c_i\)&lt;/span&gt; is the color value of the &lt;em&gt;i&lt;/em&gt;th primitive and &lt;span class=&#34;math inline&#34;&gt;\(\alpha_i\)&lt;/span&gt; its alpha value, then the resulting color and alpha are calculated as follows: &lt;span class=&#34;math display&#34;&gt;\[\left&amp;lt; c, \alpha \right&amp;gt; = \left&amp;lt; \frac{\displaystyle\sum_i^n{c_i \alpha_i}}{\displaystyle\sum_{i}^n{\alpha_i}},\max_{i=1..n}{\alpha_i} \right&amp;gt;\]&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;For this I do three passes and use two floating point textures:&lt;/p&gt;&#xA;&lt;ol type=&#34;1&#34;&gt;&#xA;&lt;li&gt;&lt;p&gt;Render the primitives into a temp texture with&lt;/p&gt;&#xA;&lt;pre class=&#34;cpp&#34;&gt;&lt;code&gt;   glBlendFuncSeparate( GL_SRC_ALPHA, GL_ONE, GL_ONE, GL_ONE );&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;to get &lt;span class=&#34;math display&#34;&gt;\[\left&amp;lt; {\displaystyle\sum_i^n{c_i \alpha_i}},{\displaystyle\sum_{i}^n{\alpha_i}} \right&amp;gt;\]&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Next I set the &lt;em&gt;FBO&lt;/em&gt; to the real transfer function texture and use the temp texture as source and divide the color values by their alpha using a custom shader.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Finally I use&lt;/p&gt;&#xA;&lt;pre class=&#34;cpp&#34;&gt;&lt;code&gt;  glBlendEquation( GL_MAX );&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;and only masks all except the alpha channel and render all primitives again into the transfer function texture. This gets the correct term into the alpha channel of the texture.&lt;/p&gt;&#xA;&lt;p&gt;This usually works and although it&#39;s a bit cumbersome it yields the correct result. Only now I identified it to be the source of all my trouble.&lt;/p&gt;&#xA;&lt;p&gt;Here&#39;s the relevant part in our source code:&lt;/p&gt;&#xA;&lt;pre class=&#34;cpp&#34;&gt;&lt;code&gt;_checkGLErrors();&#xA;m_fbo.AttachTexture( GL_COLOR_ATTACHMENT0_EXT, m_tempTexture.glTarget, m_tempTexture.glTexID );&#xA;assert( m_fbo.IsValid() );&#xA;m_fbo.Bind();&#xA;_checkGLErrors();&#xA;&#xA;glClearColor( 0.0, 0.0, 0.0, 0.0 );&#xA;glClear( GL_COLOR_BUFFER_BIT );&#xA;&#xA;// C = srcC * srcA + dstC = C * A + C&amp;#39; * A&amp;#39; + ...&#xA;// A = srcA + dstA = A + A&amp;#39; + A&amp;#39;&amp;#39; + ...&#xA;glBlendFuncSeparate( GL_SRC_ALPHA, GL_ONE, GL_ONE, GL_ONE );&#xA;glBlendEquationSeparate( GL_FUNC_ADD, GL_FUNC_ADD );&#xA;&#xA;for( Primitive::PList::const_iterator i = m_primitives.begin() ; i != m_primitives.end() ; i++ ) {&#xA;    (*i)-&amp;gt;bake();&#xA;}&#xA;&#xA;m_fbo.Unattach( GL_COLOR_ATTACHMENT0_EXT );&#xA;m_fbo.Disable();&#xA;_checkGLErrors();&#xA;&#xA;// divide color by alpha&#xA;glMatrixMode( GL_PROJECTION );&#xA;glLoadIdentity();&#xA;&#xA;glBlendFunc( GL_ONE, GL_ZERO );&#xA;&#xA;procInf.imageOp( m_tempTexture, m_transferFunction, m_program );&#xA;&#xA;// render again this time to figure out the max alpha value&#xA;&#xA;glMatrixMode( GL_PROJECTION );&#xA;glLoadIdentity();&#xA;glOrtho( 0.0, 1.0, 0.0, 1.0, -1.0, 1.0 );&#xA;&#xA;m_fbo.AttachTexture( GL_COLOR_ATTACHMENT0_EXT, m_transferFunction.glTarget, m_transferFunction.glTexID );&#xA;assert( m_fbo.IsValid() );&#xA;m_fbo.Bind();&#xA;_checkGLErrors();&#xA;&#xA;glColorMask( GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE );&#xA;glBlendEquation( GL_MAX );&#xA;&#xA;for( Primitive::PList::const_iterator i = m_primitives.begin() ; i != m_primitives.end() ; i++ ) {&#xA;    (*i)-&amp;gt;bake();&#xA;}&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Now I was ready to hunt the bug but the problem the revision was written more than a few days before I left in August and it was working back then. I refused to believe that it was broken and I went to my boss who had been using his rig in the last days and indeed it worked. I couldn&#39;t really believe my eyes. Two workstations appeared to be broken for some reason (&lt;em&gt;driver issues or even the gfx cards? - who would know..&lt;/em&gt;).&lt;/p&gt;&#xA;&lt;p&gt;I went back and somehow managed to change the appearance of the bug on one of the workstations - all the framebuffer corruptions went away and were replaced with what seemed like an unchanging alpha channel of one of the FBO textures with alpha being 0 on the initial position of the primitive and 1.0 everywhere else, so it masked it out at its initial position.&lt;/p&gt;&#xA;&lt;p&gt;For some reason I thought that maybe using BlendFuncSeparate and the normal BlendFunc function together maybe left OGL&#39;s state machine in a mess for some reason so I added calls to disable and enable blending to code to render the call to glBlendFunc useless (see the code above and/or below).&lt;/p&gt;&#xA;&lt;pre class=&#34;cpp&#34;&gt;&lt;code&gt;_checkGLErrors();&#xA;m_fbo.AttachTexture( GL_COLOR_ATTACHMENT0_EXT, m_tempTexture.glTarget, m_tempTexture.glTexID );&#xA;assert( m_fbo.IsValid() );&#xA;m_fbo.Bind();&#xA;_checkGLErrors();&#xA;&#xA;glClearColor( 0.0, 0.0, 0.0, 0.0 );&#xA;glClear( GL_COLOR_BUFFER_BIT );&#xA;&#xA;// C = srcC * srcA + dstC = C * A + C&amp;#39; * A&amp;#39; + ...&#xA;// A = srcA + dstA = A + A&amp;#39; + A&amp;#39;&amp;#39; + ...&#xA;glBlendFuncSeparate( GL_SRC_ALPHA, GL_ONE, GL_ONE, GL_ONE );&#xA;glBlendEquationSeparate( GL_FUNC_ADD, GL_FUNC_ADD );&#xA;&#xA;for( Primitive::PList::const_iterator i = m_primitives.begin() ; i != m_primitives.end() ; i++ ) {&#xA;    (*i)-&amp;gt;bake();&#xA;}&#xA;&#xA;m_fbo.Unattach( GL_COLOR_ATTACHMENT0_EXT );&#xA;m_fbo.Disable();&#xA;_checkGLErrors();&#xA;&#xA;// divide color by alpha&#xA;glMatrixMode( GL_PROJECTION );&#xA;glLoadIdentity();&#xA;&#xA;---&amp;gt; glDisable(GL_BLEND); &amp;lt;---&#xA;glBlendFunc( GL_ONE, GL_ZERO );&#xA;&#xA;procInf.imageOp( m_tempTexture, m_transferFunction, m_program );&#xA;&#xA;// render again this time to figure out the max alpha value&#xA;&#xA;glMatrixMode( GL_PROJECTION );&#xA;glLoadIdentity();&#xA;glOrtho( 0.0, 1.0, 0.0, 1.0, -1.0, 1.0 );&#xA;&#xA;m_fbo.AttachTexture( GL_COLOR_ATTACHMENT0_EXT, m_transferFunction.glTarget, m_transferFunction.glTexID );&#xA;assert( m_fbo.IsValid() );&#xA;m_fbo.Bind();&#xA;_checkGLErrors();&#xA;&#xA;---&amp;gt; glEnable( GL_BLEND ); &amp;lt;---&#xA;glColorMask( GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE );&#xA;glBlendEquation( GL_MAX );&#xA;&#xA;for( Primitive::PList::const_iterator i = m_primitives.begin() ; i != m_primitives.end() ; i++ ) {&#xA;    (*i)-&amp;gt;bake();&#xA;}&#xA;&#xA;m_fbo.Disable();&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;When I ran the program, it decided to work normally and render everything the way it should. I was stunned once again. Now the good thing with causality is that everything is supposed to be repeatable, so I removed the statements again and was expecting to see the bug appear again.. - but guess what it did &lt;strong&gt;not&lt;/strong&gt; and suddenly the machine was working again as supposed.&lt;/p&gt;&#xA;&lt;p&gt;I tried the same fix with the other workstation in our lab and it fixed it before I had time to take some screenshots of the persisting framebuffer corruption.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;m still at a loss here and I guess I won&#39;t be able to come up with an explanation of my own for this, so if anyone has an idea, feel free to tell me :-)&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br /&gt;&#xA; Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Mon, 15 Sep 2008 19:15:17 +0000</pubDate>
    </item>
    <item>
      <title>VSTorqueScript #4</title>
      <link>http://blog.blackhc.net/2008/09/vstorquescript-4/index.html</link>
      <description>&lt;p&gt;My little pet project is actually called &lt;strong&gt;VSTorqueScript&lt;/strong&gt;, so I&#39;ve decided to use the correct title for my posts, too.&lt;/p&gt;&#xA;&lt;p&gt;Today has been a somewhat productive day, although not as productive as I&#39;ve hoped, because I was stuck with a &lt;a href=&#34;http://social.msdn.microsoft.com/Forums/en-US/vsx/thread/877e1933-e285-4d47-b268-9f3a23778c66&#34;&gt;very stupid issue&lt;/a&gt; for 3 or 4 hours. I&#39;m not proud of it, but it made me go to the &lt;a href=&#34;http://social.msdn.microsoft.com/Forums/en-US/vsx/threads/&#34;&gt;VSX forum&lt;/a&gt; and become &lt;a href=&#34;http://social.msdn.microsoft.com/Forums/en-US/vsx/thread/d7890a3c-5945-40dc-8f39-66dbbe3e7f3a&#34;&gt;active&lt;/a&gt; there.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve worked more on the debug engine afterwards (well, actually I went jogging and swimming - &lt;em&gt;in that order.. think about it&lt;/em&gt;) and made some progress. Quite a bit of the stub stuff is implemented now and I think I&#39;ll start implementing the real thing tomorrow.&lt;/p&gt;&#xA;&lt;p&gt;No screenshots this time, I&#39;m sorry, but for the SDK users, I have a little helper file. If you look at the managed debug example, you&#39;ll find an &lt;em&gt;AD7Events&lt;/em&gt; file that wraps the debug event interfaces. I wasn&#39;t easily able to port it over, so I decided to write my own version of it (while keeping the comments).&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve appended it to the post, if you want to take a look.&lt;/p&gt;&#xA;&lt;p&gt;On other news I&#39;ll probably switch this blog over to my own webspace soon to get some advantages (like expandable sourcecode amongst things), but I think I&#39;ll stick to wordpress.com for a few more weeks. It&#39;s really a pity that you can&#39;t redirect from wordpress to your domain, but only vice-versa :(&lt;/p&gt;&#xA;&lt;p&gt;Anyway, off to work some more on my code.&lt;/p&gt;&#xA;&lt;p&gt;Cheers, Andreas&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xA;&lt;p&gt;Here it is:&lt;/p&gt;&#xA;&lt;pre class=&#34;cs&#34;&gt;&lt;code&gt;    using System;&#xA;    using System.Collections.Generic;&#xA;    using System.Linq;&#xA;    using System.Text;&#xA;    using Microsoft.VisualStudio.Debugger.Interop;&#xA;    using Microsoft.VisualStudio;&#xA;    &#xA;    namespace BlackHC.VSTorqueScript.DebugEngine&#xA;    {&#xA;        #region Event base classes&#xA;    &#xA;        interface IEvent : IDebugEvent2&#xA;        {&#xA;            uint Attributes&#xA;            {&#xA;                get;&#xA;            }&#xA;    &#xA;            Guid IID&#xA;            {&#xA;                get;&#xA;            }&#xA;        }&#xA;    &#xA;        abstract class Event&amp;lt;ieventtype&amp;gt; : IEvent where IEventType : class&#xA;        {&#xA;            public Guid IID&#xA;            {&#xA;                get { return typeof(IEventType).GUID; }&#xA;            }&#xA;    &#xA;            public int GetAttributes(out uint eventAttributes)&#xA;            {&#xA;                eventAttributes = Attributes;&#xA;                return VSConstants.S_OK;&#xA;            }&#xA;    &#xA;            public abstract uint Attributes&#xA;            {&#xA;                get;&#xA;            }&#xA;        }&#xA;    &#xA;        class AsynchronousEvent&amp;lt;ieventtype&amp;gt; : Event&amp;lt;ieventtype&amp;gt; where IEventType : class&#xA;        {&#xA;            public override uint Attributes&#xA;            {&#xA;                get { return (uint)enum_EVENTATTRIBUTES.EVENT_ASYNCHRONOUS; }&#xA;            }&#xA;        }&#xA;    &#xA;        class SynchronousEvent&amp;lt;ieventtype&amp;gt; : Event&amp;lt;ieventtype&amp;gt; where IEventType : class&#xA;        {&#xA;            public override uint Attributes&#xA;            {&#xA;                get { return (uint)enum_EVENTATTRIBUTES.EVENT_SYNCHRONOUS; }&#xA;            }&#xA;        }&#xA;    &#xA;        class StoppingEvent&amp;lt;ieventtype&amp;gt; : Event&amp;lt;ieventtype&amp;gt; where IEventType : class&#xA;        {&#xA;            public override uint Attributes&#xA;            {&#xA;                get { return (uint)enum_EVENTATTRIBUTES.EVENT_ASYNC_STOP; }&#xA;            }&#xA;        }&#xA;    &#xA;        #endregion&#xA;    &#xA;        #region Event classes&#xA;    &#xA;        /// &amp;lt;summary&amp;gt;&#xA;        /// The debug engine (DE) sends this interface to the session debug manager (SDM) when an instance of the DE is created.&#xA;        /// &amp;lt;/summary&amp;gt;&#xA;        sealed class EngineCreateEvent : AsynchronousEvent&amp;lt;idebugenginecreateevent2&amp;gt;, IDebugEngineCreateEvent2&#xA;        {&#xA;            private IDebugEngine2 engine;&#xA;    &#xA;            public EngineCreateEvent(IDebugEngine2 engine)&#xA;            {&#xA;                this.engine = engine;&#xA;            }&#xA;    &#xA;            #region IDebugEngineCreateEvent2 Members&#xA;    &#xA;            public int GetEngine(out IDebugEngine2 pEngine)&#xA;            {&#xA;                pEngine = engine;&#xA;                return VSConstants.S_OK;&#xA;            }&#xA;    &#xA;            #endregion&#xA;        }&#xA;    &#xA;        /// &amp;lt;summary&amp;gt;&#xA;        /// This interface is sent by the debug engine (DE) to the session debug manager (SDM) when a program is attached to.&#xA;        /// &amp;lt;/summary&amp;gt;&#xA;        sealed class ProgramCreateEvent : AsynchronousEvent&amp;lt;idebugprogramcreateevent2&amp;gt;, IDebugProgramCreateEvent2&#xA;        {&#xA;        }&#xA;    &#xA;        /// &amp;lt;summary&amp;gt;&#xA;        /// This interface is sent by the debug engine (DE) to the session debug manager (SDM) when a module is loaded or unloaded.&#xA;        /// &amp;lt;/summary&amp;gt;&#xA;        sealed class ThreadCreateEvent : AsynchronousEvent&amp;lt;idebugthreadcreateevent2&amp;gt;, IDebugThreadCreateEvent2&#xA;        {&#xA;        }&#xA;    &#xA;        /// &amp;lt;summary&amp;gt;&#xA;        /// This interface is sent by the debug engine (DE) to the session debug manager (SDM) when a program is loaded, but before any code is executed.&#xA;        /// &amp;lt;/summary&amp;gt;&#xA;        sealed class LoadCompleteEvent : StoppingEvent&amp;lt;idebugloadcompleteevent2&amp;gt;, IDebugLoadCompleteEvent2&#xA;        {&#xA;        }&#xA;    &#xA;        /// &amp;lt;summary&amp;gt;&#xA;        /// This interface is sent by the debug engine (DE) to the session debug manager (SDM) when a thread has exited.&#xA;        /// &amp;lt;/summary&amp;gt;&#xA;        sealed class ThreadDestroyEvent : StoppingEvent&amp;lt;idebugthreaddestroyevent2&amp;gt;, IDebugThreadDestroyEvent2&#xA;        {&#xA;            private uint exitCode;&#xA;    &#xA;            public ThreadDestroyEvent(uint exitCode)&#xA;            {&#xA;                this.exitCode = exitCode;&#xA;            }&#xA;    &#xA;            #region IDebugThreadDestroyEvent2 Members&#xA;    &#xA;            public int GetExitCode(out uint pdwExit)&#xA;            {&#xA;                pdwExit = exitCode;&#xA;                return VSConstants.S_OK;&#xA;            }&#xA;    &#xA;            #endregion&#xA;        }&#xA;    &#xA;        /// &amp;lt;summary&amp;gt;&#xA;        /// This interface is sent by the debug engine (DE) to the session debug manager (SDM) when a program has run to completion&#xA;        /// or is otherwise destroyed.&#xA;        /// &amp;lt;/summary&amp;gt;&#xA;        sealed class ProgramDestroyEvent : StoppingEvent&amp;lt;idebugprogramdestroyevent2&amp;gt;, IDebugProgramDestroyEvent2&#xA;        {&#xA;            private uint exitCode;&#xA;    &#xA;            public ProgramDestroyEvent(uint exitCode)&#xA;            {&#xA;                this.exitCode = exitCode;&#xA;            }&#xA;    &#xA;            #region IDebugProgramDestroyEvent2 Members&#xA;    &#xA;            public int GetExitCode(out uint pdwExit)&#xA;            {&#xA;                pdwExit = exitCode;&#xA;                return VSConstants.S_OK;&#xA;            }&#xA;    &#xA;            #endregion&#xA;        }&#xA;    &#xA;        #endregion&#xA;    &#xA;        /// &amp;lt;summary&amp;gt;&#xA;        /// Extensions for IDebugEventCallback2 implementations&#xA;        /// &amp;lt;/summary&amp;gt;&#xA;        static class IDebugEventCallback2Extension&#xA;        {&#xA;            static internal int Event(this IDebugEventCallback2 pCallback, IDebugEngine2 pEngine, IDebugProgram2 pProgram, IDebugThread2 pThread, IEvent pEvent)&#xA;            {&#xA;                Guid iid = pEvent.IID;&#xA;                return pCallback.Event(pEngine, null, pProgram, pThread, pEvent, ref iid, pEvent.Attributes);&#xA;            }&#xA;        }&#xA;    }&lt;/code&gt;&lt;/pre&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Fri, 12 Sep 2008 00:46:05 +0000</pubDate>
    </item>
    <item>
      <title>Visual TorqueScript #3.75</title>
      <link>http://blog.blackhc.net/2008/09/visual-torquescript-375/index.html</link>
      <description>&lt;p&gt;Another minor update, which I&#39;m mostly using to publish a useful patch. I&#39;ve forgotten to mention that I&#39;ve already created a custom settings page for my Visual TorqueScript projects. Yesterday night (before going to bed) I decided to add a configuration dependent page, too. As you&#39;ll see it&#39;s very &lt;em&gt;Torsion-esque&lt;/em&gt;, which is intentional and I plan to support .torsion files directly (as project files) later-on.&lt;/p&gt;&#xA;&lt;p&gt;The main reason is that Torsion rocks and there is no reason to have yet another project file format for TorqueScript projects.&lt;/p&gt;&#xA;&lt;p&gt;I hope that it will also be an incentive for people to give my plugin a try (if I ever release it).&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/2008-09-10-visual-torquescript-375/settingspage.jpg&#34; /&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;A few notes (&lt;em&gt;programatically&lt;/em&gt; so to speak :D):&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Again the managed project framework is awesome and once you figure out where to look for things you&#39;ll certainly find eternal bliss, too..&lt;/li&gt;&#xA;&lt;li&gt;I generally derive from &lt;em&gt;SettingsPage&lt;/em&gt; directly, because I don&#39;t want any of the regular faff in my project.&lt;/li&gt;&#xA;&lt;li&gt;Don&#39;t forget to publish your pages via &lt;em&gt;ProvideObject&lt;/em&gt;(or &lt;em&gt;ProvideClass&lt;/em&gt; from my previous post)&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You don&#39;t need to create your own GUIDs for everything. Classses are automatically provided with a unique GUID - try it and access &lt;em&gt;typeof(SomeClassWithoutGuidAttribute).GUID&lt;/em&gt; and it&#39;ll still work.&lt;/p&gt;&#xA;&lt;strong&gt;(If I said something wrong, please correct me..)&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;em&gt;SettingsPage&lt;/em&gt; has an &lt;em&gt;IsDirty&lt;/em&gt; property which you have to set, when a property is changed (to update the Apply button state). It results in pretty ugly copy&#39;n&#39;paste code, because you can&#39;t use default property accessors anymore. To fix this I spent an hour or two and I&#39;ve come up with an elegant (in my opinion) patch to fix the issue:&lt;/p&gt;&#xA;&lt;pre class=&#34;diff&#34;&gt;&lt;code&gt;Index: ProjectBase/SettingsPage.cs&#xA;===================================================================&#xA;--- ProjectBase/SettingsPage.cs (revision 10)&#xA;+++ ProjectBase/SettingsPage.cs (working copy)&#xA;@@ -27,7 +27,26 @@&#xA;&#xA; namespace Microsoft.VisualStudio.Package&#xA; {&#xA;+    // Added to make it easier to edit pages [9/10/2008 Andreas]&#xA;&#xA;+    class SettingsPagePropertyDescriptor : DesignPropertyDescriptor&#xA;+    {&#xA;+        public SettingsPagePropertyDescriptor(PropertyDescriptor prop)&#xA;+            : base(prop)&#xA;+        {&#xA;+        }&#xA;+&#xA;+        public override void SetValue(object component, object value)&#xA;+        {&#xA;+            if (component is SettingsPage)&#xA;+            {&#xA;+                SettingsPage page = (SettingsPage)component;&#xA;+                page.IsDirty = true;&#xA;+            }&#xA;+            base.SetValue(component, value);&#xA;+        }&#xA;+    }&#xA;+&#xA;     /// &amp;lt;summary&amp;gt;&#xA;     /// The base class for property pages.&#xA;     /// &amp;lt;/summary&amp;gt;&#xA;@@ -78,7 +97,7 @@&#xA;             get { return this.grid; }&#xA;         }&#xA;&#xA;-        protected bool IsDirty&#xA;+        protected internal bool IsDirty&#xA;         {&#xA;             get&#xA;             {&#xA;@@ -203,6 +222,13 @@&#xA;&#xA;         #endregion&#xA;&#xA;+        #region overriden methods.&#xA;+        public override DesignPropertyDescriptor CreateDesignPropertyDescriptor(PropertyDescriptor propertyDescriptor)&#xA;+        {&#xA;+            return new SettingsPagePropertyDescriptor(propertyDescriptor);&#xA;+        }&#xA;+        #endregion&#xA;+&#xA;         #region IPropertyPage methods.&#xA;         public virtual void Activate(IntPtr parent, RECT[] pRect, int bModal)&#xA;         {&#xA;@@ -410,6 +436,8 @@&#xA;                 try&#xA;                 {&#xA;                     Marshal.WriteIntPtr(ppUnk, p);&#xA;+                    // Reset IsDirty before rebinding all properties [9/10/2008 Andreas]&#xA;+                    IsDirty = false;&#xA;                     this.BindProperties();&#xA;                     // BUGBUG -- this is really bad casting a pointer to &amp;quot;int&amp;quot;...&#xA;                     this.grid.SetSelectedObjects(1, ppUnk.ToInt32());&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;It also contains a one-line fix to reset IsDirty when reloading the page or switching configurations (ie. any time the properties are reset to their old value).&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br/&gt; Black&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Wed, 10 Sep 2008 10:55:44 +0000</pubDate>
    </item>
    <item>
      <title>Visual TorqueScript #3.5</title>
      <link>http://blog.blackhc.net/2008/09/visual-torquescript-35/index.html</link>
      <description>&lt;p&gt;Small update: After hours and hours of error and trial (and implementing a few interfaces by using Copy&amp;amp;Paste wisely), I&#39;ve finally managed to get Visual Studio to load my debug engine.&lt;/p&gt;&#xA;&lt;p&gt;This looks gorgeous, doesn&#39;t it?&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/2008-09-09-visual-torquescript-35/deregistered.jpg&#34; /&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;A few notes for those interested in writing Debug Engines:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;See my previous post for the ProvideDebugEngine helper attribute&lt;br /&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;There exists a really nice &lt;strong&gt;managed debug engine example&lt;/strong&gt;, that isn&#39;t part of the SDK. You can find it &lt;a href=&#34;http://code.msdn.microsoft.com/debugenginesample&#34;&gt;here&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;You are &lt;strong&gt;required&lt;/strong&gt; to set a PortSupplier, even if the documentation says otherwise (this was a major source of frustration in the last hour).&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Since _ProvideDebugEngine_requires a Type for &lt;em&gt;PortSupplier&lt;/em&gt;, I&#39;ve been using this stub class:&lt;/p&gt;&#xA;&lt;pre class=&#34;cs&#34;&gt;&lt;code&gt;    /// &amp;lt;summary&amp;gt;&#xA;    /// The class is just a stub for use with ProvideDebugEngine.&#xA;    /// It seems it&amp;#39;s mandatory to provide a PortSupplier GUID with a debug engine.&#xA;    /// &amp;lt;/summary&amp;gt;&#xA;    [Guid(&amp;quot;708C1ECA-FF48-11D2-904F-00C04FA302A1&amp;quot;)]&#xA;    internal sealed class DefaultPortSupplier&#xA;    {&#xA;    }&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I&#39;ve also added another attribute (&lt;em&gt;ProvideClass&lt;/em&gt;) for convenience to register a class directly (it&#39;s the same as using &lt;em&gt;ProvideObject&lt;/em&gt; on the current class type).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Since the code is quite short, I&#39;m going to provide it here directly:&lt;/p&gt;&#xA;&lt;pre class=&#34;cs&#34;&gt;&lt;code&gt;using System;&#xA;using System.Collections.Generic;&#xA;using System.Linq;&#xA;using System.Text;&#xA;&#xA;namespace Microsoft.VisualStudio.Shell&#xA;{&#xA;    /// &amp;lt;summary&amp;gt;&#xA;    /// This is just a wrapper for ProvideObject to provide the class the attribute is used on&#xA;    /// &amp;lt;/summary&amp;gt;&#xA;    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]&#xA;    class ProvideClass : RegistrationAttribute&#xA;    {&#xA;        public override void Register(RegistrationAttribute.RegistrationContext context)&#xA;        {&#xA;            ProvideObjectAttribute objectProvider = new ProvideObjectAttribute(context.ComponentType);&#xA;            objectProvider.Register(context);&#xA;        }&#xA;&#xA;        public override void Unregister(RegistrationAttribute.RegistrationContext context)&#xA;        {&#xA;            ProvideObjectAttribute objectProvider = new ProvideObjectAttribute(context.ComponentType);&#xA;            objectProvider.Unregister(context);&#xA;        }&#xA;    }&#xA;}&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Cheers,&lt;br/&gt; Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Tue, 09 Sep 2008 22:52:30 +0000</pubDate>
    </item>
    <item>
      <title>Visual TorqueScript #3</title>
      <link>http://blog.blackhc.net/2008/09/visual-torquescript-3/index.html</link>
      <description>&lt;p&gt;I&#39;ve spent a part of the last two days cursing the managed project framework (it&#39;s a bliss, too, and I&#39;m thankful that it&#39;s available at the same time), because it is too different from what I need, and I&#39;ll probably end up rewriting most of it to use different approaches and not use _MSBuild _anymore.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve spent more time, however, on reading up on &lt;em&gt;Debug Engines&lt;/em&gt; in &lt;em&gt;Visual Studio 2008&lt;/em&gt; and I&#39;ve started work on my own yesterday. To be honest, I haven&#39;t really started to work on it, I&#39;ve rather spent the evening and most of today figuring out how to register a debug engine at all and write attributes for that, so that it becomes an automated process, just like it&#39;s done for &lt;em&gt;Packages&lt;/em&gt; and &lt;em&gt;Language Services&lt;/em&gt; by using attributes like ProvidePackage and ProvideLanguageService.&lt;/p&gt;&#xA;&lt;p&gt;The code has turned out pretty nicely and now you can use the attributes like this, for example, to register a debug engine:&lt;/p&gt;&#xA;&lt;pre class=&#34;cs&#34;&gt;&lt;code&gt;    [ProvideDebugEngine(&amp;quot;{5887F58F-3B7F-401d-95CE-A7BADA1E4D7D}&amp;quot;, &amp;quot;TorqueScript Debug Engine&amp;quot;,&#xA;        Attach = true, ProgramProvider = typeof(VSTorqueScript_DebugEngine))]&#xA;    [ProvideIncompatibleEngineInfo( &amp;quot;{5887F58F-3B7F-401d-95CE-A7BADA1E4D7A}&amp;quot; )]&#xA;    [ProvideIncompatibleEngineInfo( &amp;quot;{5887F58F-3B7F-401d-95CE-A7BADA1E4D7F}&amp;quot; )]&#xA;    [ProvideAutoSelectIncompatibleEngineInfo( &amp;quot;{5887F58F-3B7F-401d-95CE-A7BADA1E4D7F}&amp;quot; )]&#xA;    [ProvideObject(VSTorqueScript_DebugEngine)&#xA;    [Guid(GuidList.guidVSTorqueScript_DebugEngineString)]&#xA;    public sealed class VSTorqueScript_DebugEngine&#xA;...&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;In my opinion this looks pretty neat - and it works.. &lt;strong&gt;/&lt;/strong&gt; I really love the whole concept of attributes and the way they make coding a lot easier (even though it&#39;s hard to find information about useful attributes, as you only find out they exist when you stumble over them or write them on your own).&lt;/p&gt;&#xA;&lt;p&gt;You can find the code here: &lt;a href=&#34;http://www.icculus.org/~black/weblog/VS_DebugEngine/&#34; class=&#34;uri&#34;&gt;http://www.icculus.org/~black/weblog/VS_DebugEngine/&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;A few notes:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The implementation was done making heavy use of copy&amp;amp;paste and quick replace (I copied the table containing the help description of the metrics into the source file and reworked it using RE magic to look the way it does now)&lt;/li&gt;&#xA;&lt;li&gt;At first I used &lt;em&gt;Type.GetProperties&lt;/em&gt; to enumerate all properties and write them out into the registry but that bloated the resulting registry entry, of course. Because of this I later switched to the &lt;em&gt;HashTable&lt;/em&gt; approach that I first found in SDK&#39;s implementation of &lt;em&gt;ProvideLanguageServiceAttribute&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li&gt;The restriction that all attribute parameters must be constant expressions forced me to make a few changes - at first I had &lt;em&gt;Guid&lt;/em&gt; properties and for the incompatible engines list I expected a &lt;em&gt;Guid[]&lt;/em&gt;, which didn&#39;t work. I changed the &lt;em&gt;Guid&lt;/em&gt;s to &lt;em&gt;String&lt;/em&gt;s and added the &lt;emphasis&gt;Provide*EngineInfo&lt;/emphasis&gt; attributes instead of the incompatible engines list (same for the autoselect one, of course).&lt;/li&gt;&#xA;&lt;li&gt;The &lt;em&gt;Provide*EngineInfo&lt;/em&gt; attributes contained their registry code at first. This was ugly because they kind of required a &lt;em&gt;ProvideDebugEngine&lt;/em&gt; attribute to exist, too, which I couldn&#39;t enforce. Later I changed them to be pure value holders and moved all registry code into &lt;em&gt;ProvideDebugEngine&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Now nothing happens if you don&#39;t supply a &lt;em&gt;ProvideDebugEngine&lt;/em&gt; attribute, too.&lt;/p&gt;&#xA;&lt;p&gt;Now I&#39;ll try to start to work on the actual Debug Engine for TorqueScript.&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br /&gt;&#xA; Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Tue, 09 Sep 2008 16:24:55 +0000</pubDate>
    </item>
    <item>
      <title>Visual TorqueScript #2</title>
      <link>http://blog.blackhc.net/2008/09/visual-torquescript-2/index.html</link>
      <description>&lt;p&gt;I haven&#39;t found time to add IntelliSense to the language service yet, so I&#39;ve only added a basic parser and enabled brace highlighting/matching which was easier to do.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve been told that a working debugger would be the most important feature, so I try to get started with it, but before I can do that I have to add a custom project type to support the standard .cs extension for TorqueScript and to offer a specialized debug options property page for Torque&#39;s telnet debugger.&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/2008-09-07-visual-torquescript-2/customprojecttype.jpg&#34; /&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;Here you can see the progress I&#39;ve made so far: I&#39;ve added a new custom project type and changed everything to support TorqueScript files that use the usual .cs extension. There is no conflict with C# whatsoever. (At least from what I know..)&lt;/p&gt;&#xA;&lt;p&gt;Next I&#39;ll look into removing the MSBuild faff (if possible at all) and adding the debug configuration page.&lt;/p&gt;&#xA;&lt;p&gt;Last but not least I&#39;ve found another neat tool that I can only recommend and want to share with whoever might read this: It&#39;s called &lt;strong&gt;VSSDK Assist&lt;/strong&gt; and it&#39;s a so-called &lt;em&gt;Guidance Package&lt;/em&gt; - it provides you with a neat assistance window that helps you do common tasks using the Visual Studio SDK in the preferred way (it supplies you with lots of dialog-based wizards for all kinds of things like custom pages/tools/editors/projects/...).&lt;/p&gt;&#xA;&lt;p&gt;You can grab it &lt;a href=&#34;http://www.codeplex.com/vssdkassist&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;More to come.&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br/&gt; Black&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sun, 07 Sep 2008 00:40:21 +0000</pubDate>
    </item>
    <item>
      <title>Visual TorqueScript #1</title>
      <link>http://blog.blackhc.net/2008/09/visual-torquescript-1/index.html</link>
      <description>&lt;p&gt;I&#39;ve spent most of this week learning as much about Visual Studio&#39;s extensibility features as possible and I&#39;ve decided to start a tiny project to see how easy it is to add a new language service to Visual Studio.&lt;/p&gt;&#xA;&lt;p&gt;My conclusion so far is: it&#39;s not easy and that obvious but it certainly is easier than writing your own IDE. There is also the advantage that you have access to a nice debugging environment if you manage to write your own debugger service.&lt;/p&gt;&#xA;&lt;p&gt;Anyway, I&#39;ve started to work on adding basic support for TorqueScript to Visual Studio and after much learning, I&#39;ve finished implementing the colorizer for TorqueScript today:&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/2008-09-05-visual-torquescript-1/scannertest.jpg&#34; /&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;As you see I have to use the extension &lt;code&gt;.tscript&lt;/code&gt; for now, because as you know &lt;code&gt;.cs&lt;/code&gt; is already reserved for C#. I&#39;m going to fix this later by adding a TorqueScript project type that overrides this link locally for your TorqueScript projects (I could live with that).&lt;/p&gt;&#xA;&lt;p&gt;Creating your own language services is pretty easy, if you are ok with using C# and ManagedBabel. You just have to supply the specific grammar files for the managed lexer and parser generators and you&#39;re pretty much done with the basic stuff.&lt;/p&gt;&#xA;&lt;p&gt;The Visual Studio SDK is pretty neat (you can grab it from &lt;a href=&#34;http://www.microsoft.com/downloads/details.aspx?FamilyId=59EC6EC3-4273-48A3-BA25-DC925A45584D&amp;amp;displaylang=en&#34;&gt;here&lt;/a&gt; if you want) and another neat thing no one has probably heard about is that Microsoft gives away the &lt;a href=&#34;http://msdn.microsoft.com/en-us/vsx/bb933751.aspx&#34;&gt;Visual Studio Shell&lt;/a&gt; for free - yeah for free. That means you can build your own custom tools that have the Visual Studio look and feel and you don&#39;t have to pay Microsoft a dime for it.&lt;/p&gt;&#xA;&lt;p&gt;A good place to start in general if you&#39;re interested is the &lt;a href=&#34;http://msdn.microsoft.com/en-us/vsx/default.aspx&#34;&gt;VS Extensibility Center&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Stay tuned for more features (syntax parsing and debugging featues are the next thing on my plan).&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br/&gt; BlackHC&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Fri, 05 Sep 2008 12:00:05 +0000</pubDate>
    </item>
    <item>
      <title>Halo: Combat Evolved</title>
      <link>http://blog.blackhc.net/2008/09/halo-combat-evolved/index.html</link>
      <description>&lt;p&gt;Yay, I&#39;ve finally found time to play through Halo 1 for the PC. To be honest I didn&#39;t even know that I owned the game a few days ago, but when I looked through one of my drawers, I found it together with Supreme Commander and GTA: San Andreas \o/&lt;/p&gt;&#xA;&lt;p&gt;To make playing it look like work or at least like something worthier than just playing, I&#39;ve taken notes occasionally and here they are:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;The vehicles are very easy to steer&lt;/strong&gt;: they always automatically try to drive towards your current view direction and you only use forward and backward to accelerate and slow down. I was used to ETQW&#39;s steering system and it took me some time to get used to, but it&#39;s pretty ok for the game.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;I like to use my rifle as club&lt;/strong&gt;. For the first half of the game I had a really closed-combat fighting style: start shooting while running on and when you need to reload or simply are near enough, hit the enemies with your gun before jumping to cover. It was very effective against Grunts and against Elites, too, since my timing was right most of the times and I was there, when their shield broke down. The ability to throw grenades and shooting at the same time (pretty much) also increased combat speed a lot and made everything more fluid, because I was able to react to everything always in an effective way. The Flood was pretty scary at first, because I had to learn a totally different combat technique and after getting used to it during the first few hours, I took me a bit to keep my distance again. After getting the shotgun and surviving the Library level fighting against the Flood became fun or at worst slightly boring and annoying, though I still have to watch out to prevent myself from becoming surrounded. &lt;em&gt;I think, it is a pretty neat idea to make the Flood monsters get up again after being shot for the first time. It facilitates being surrounded and increases the risk of being overrun.&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Level design is pretty weird sometimes.&lt;/strong&gt; And with &lt;em&gt;weird&lt;/em&gt; I mean &lt;strong&gt;repetitive&lt;/strong&gt; - just look at the Library level to see the beauty of copy&#39;n&#39;paste. The last level, where you have to drive the buggy through a weird obstacle course that makes no sense whatsoever is pretty awkward, too - the buggy is a bit to wide to be driven through everything elegantly using the controls and I got stuck all the time. Moreover the buggy is too slow for all the little ramps you can find and I was left wondering why they put them there (maybe the buggy&#39;s speed was changed after the level was designed?)&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;I don&#39;t like checkpoints.&lt;/strong&gt; Especially when they&#39;re used to tune the game difficulty by spreading them lighter in later levels &amp;gt;_&amp;lt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;So far, so good. I like Halo a lot and although some levels seemed a bit stretched (Library again), playing it was fun. I don&#39;t know, what I&#39;m going to play next, but I think that maybe I should spend some of my time coding again - &lt;em&gt;nah, just joking, next I&#39;m going to play Call of Duty or more Sam &amp;amp; Max&lt;/em&gt;...&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br/&gt; Black&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Tue, 02 Sep 2008 22:37:08 +0000</pubDate>
    </item>
    <item>
      <title>Mirror&#39;s Edge</title>
      <link>http://blog.blackhc.net/2008/08/mirrors-edge/index.html</link>
      <description>&lt;p&gt;&lt;a href=&#34;http://www.mirrorsedge.com/&#34;&gt;Mirror&#39;s Edge&lt;/a&gt; is one awesome game. There is hardly any information out about the game yet and the official homepage is &lt;em&gt;lacking&lt;/em&gt; but if you&#39;re interested, there is at least one good &lt;a href=&#34;http://www.on-mirrors-edge.com/&#34;&gt;fansite&lt;/a&gt; (&lt;em&gt;I haven&#39;t checked for others yet&lt;/em&gt;) and a few trailers that really make me want to see more (or work for &lt;a href=&#34;http://www.dice.se/&#34;&gt;DICE&lt;/a&gt; - &lt;em&gt;you decide&lt;/em&gt;..).&lt;/p&gt;&#xA;&lt;p&gt;Check out the trailers:&lt;/p&gt;&#xA;&lt;div class=&#34;embed-responsive embed-responsive-4by3&#34;&gt;&#xA;&lt;iframe class=&#34;embed-responsive-item&#34; src=&#34;https://www.youtube.com/embed/2N1TJP1cxmo&#34; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&#xA;&lt;/iframe&gt;&#xA;&lt;/div&gt;&#xA;&lt;div class=&#34;embed-responsive embed-responsive-4by3&#34;&gt;&#xA;&lt;iframe class=&#34;embed-responsive-item&#34; src=&#34;https://www.youtube.com/embed/BZaFptKwrPc&#34; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&#xA;&lt;/iframe&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;If you&#39;re interested in some additional thoughts, please continue and read on:&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xA;&lt;p&gt;First I have to say that I love the trailers and really really can&#39;t wait to see more. I always wanted to see a game that takes on the Le-Parcour concept and transforms it into fun gameplay - see one of my GID entries, that sadly wasn&#39;t finished, or games like &lt;a href=&#34;http://www.thewayoftheninja.org/n.html&#34;&gt;N&lt;/a&gt; for example.&lt;/p&gt;&#xA;&lt;p&gt;What exactly characterizes this &lt;a href=&#34;http://en.wikipedia.org/wiki/Parkour&#34;&gt;Le-Parcour&lt;/a&gt; feeling? For me it&#39;s movement-centered fast-paced gameplay that rewards you with fluent animations and a feeling that you _flow _through the level in one progressive move.&lt;/p&gt;&#xA;&lt;p&gt;From the games I&#39;ve played the &lt;a href=&#34;http://en.wikipedia.org/wiki/Prince_of_Persia&#34;&gt;Prince of Persia&lt;/a&gt; series (beginning with &lt;a href=&#34;http://en.wikipedia.org/wiki/Prince_of_Persia:_The_Sands_of_Time&#34;&gt;Sands of Time&lt;/a&gt;) has managed to convey this feeling quite well. Particularly the escape scenes from the Dahaka are excellent:&lt;/p&gt;&#xA;&lt;p&gt;[youtube=http://www.youtube.com/watch?v=dy4Mi7LneeU]&lt;/p&gt;&#xA;&lt;p&gt;Mirror&#39;s Edge reminds me a bit of a mix of &lt;a href=&#34;http://en.wikipedia.org/wiki/Oni_(video_game)&#34;&gt;Oni&lt;/a&gt; (because of the hand-to-hand combat) and Prince of Persia, although it still appears to be very different.&lt;/p&gt;&#xA;&lt;p&gt;One of the things I like is that it has no HUD whatsoever (or at least a very limited one to avoid motion sickness), which really helps immersion and this minimalistic feature goes hand in hand with the very clean design of the city (look at their choice of colors) and creates a setting that can only be described as &lt;strong&gt;stylish&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I think, it&#39;s an important point to make the players feel like they&#39;re playing a work of art and thus try to play it that way: trying to find elegant ways through the level, not brute-force ones.&lt;/p&gt;&#xA;&lt;p&gt;The city conveys this, too. To return to the choice of colors: notice how everything is held mainly in white and all other colors are full, saturated and warm ones. They are also used in a clear and concise way. There is no mixing of them or gradients. It really sets forth the mood of the game in that part of it.&lt;/p&gt;&#xA;&lt;p&gt;The use of the &#39;Runner vision&#39; as visual hint is also very non-intrusive and stylized, too. It again fits the general design style. Though I have to say, that I don&#39;t think that those hints are sufficient as visual cues. I&#39;d get totally lost in the level of the last trailer (&lt;em&gt;if it&#39;s not entirely linear and there is only way to traverse the level&lt;/em&gt; &lt;em&gt;because you also gotta have dead-ends then&lt;/em&gt; - &lt;em&gt;this is probably true for the roof-top level, too&lt;/em&gt;) and it&#39;s pretty frustrating if you reach one, since it breaks the &lt;em&gt;flow&lt;/em&gt; of the game.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;d guess adding some arrows, that fade in, would certainly help it, but I&#39;m curious how they are going to fix that anyhow.&lt;/p&gt;&#xA;&lt;p&gt;Another problem I really wonder about is: what happens if things go wrong?&lt;/p&gt;&#xA;&lt;p&gt;Nothing&#39;s worse than making one wrong move or time a key press badly and suddenly you have to load your last savegame or quicksave and replay the last 3 minutes, because you have forgotten to save. Especially when it comes to arcade games or platformers that only allow checkpoints, they tend to suffer from this a lot, because it&#39;s not really fun to replay the same parts of level over and over again, even if you agree, that it&#39;s probably just your fault for having two left hands.&lt;/p&gt;&#xA;&lt;p&gt;The main feature that helped Prince of Persia against becoming terribly annoying was the time rewind power of his dagger - that is: &lt;em&gt;you can rewind the last ten seconds and begin again with whatever you were doing from there&lt;/em&gt; on). Mirror&#39;s Edge could suffer from the issue, if they don&#39;t add something similar. Imagine dying, because you didn&#39;t rebalance Faith - &lt;em&gt;that&#39;s the main protagonist in the game BTW&lt;/em&gt; - correctly while walking over a bar. Now you gotta wait a few seconds for the game to reload an old save point and start anew. This totally breaks the &lt;strong&gt;flow&lt;/strong&gt; of the game. All motions and actions are stopped and you&#39;re forced to wait. You lose control and that&#39;s bad.&lt;/p&gt;&#xA;&lt;p&gt;They really need to tackle that issue and I&#39;m curious, how it&#39;s going to be solved in Mirror&#39;s Edge.&lt;/p&gt;&#xA;&lt;p&gt;They also have to fix the sounds. The current moaning of Faith now and then gets on your nerves after a short time, too - just listen to the trailer again and imagine hearing that sound every minute for a few hours. It&#39;s a pretty scary prospect, isn&#39;t it?&lt;/p&gt;&#xA;&lt;p&gt;That said, Mirror&#39;s Edge is one of the games that I&#39;ll try to watch actively for new developments and press releases, because it certainly could become a really fun and entertaining game that brings some fresh ideas to the first-person genre.&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br/&gt; Black&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Mon, 25 Aug 2008 21:59:30 +0000</pubDate>
    </item>
    <item>
      <title>Random Notes</title>
      <link>http://blog.blackhc.net/2008/08/random-notes/index.html</link>
      <description>&lt;p&gt;&lt;a href=&#34;http://www.bit-blot.com/aquaria/&#34;&gt;&lt;img src=&#34;/images/2008-08-16-random-notes/aquarialogo1.png&#34; /&gt;&lt;/a&gt;I can&#39;t come up with anything to write right now, so I&#39;ve decided to publish some random notes &lt;strong&gt;:-)&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Random notes:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I&#39;m listening to &lt;a href=&#34;http://www.thesixtyone.com/Duffy1/collection/item/18202/?autoplay_song&#34;&gt;Duffy - Mercy&lt;/a&gt; on &lt;a href=&#34;http://www.thesixtyone.com/&#34;&gt;thesixtyone&lt;/a&gt; right now - I&#39;m kind of surprised to find it there to be honest.&lt;br /&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;Right now I try to read &lt;a href=&#34;http://en.wikipedia.org/wiki/Design_Patterns&#34;&gt;&amp;quot;Design Patterns&amp;quot; by the &amp;quot;Gang of Four&amp;quot;&lt;/a&gt;. Reading it is kind of tedious though because it contains a lot of text for simple things, but I don&#39;t just want to skim over it either, so I constantly have to force myself to continue reading.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I&#39;ve stumbled over some good links from going through the Wikipedia entries for some design patterns. One interesting one in particular is: &lt;a href=&#34;http://c2.com/cgi/wiki?PatternBacklash&#34; class=&#34;uri&#34;&gt;http://c2.com/cgi/wiki?PatternBacklash&lt;/a&gt; Quote (&lt;em&gt;so true&lt;/em&gt;):&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;I&#39;ve gained the impression that &lt;a href=&#34;http://c2.com/cgi/wiki?DesignPatterns&#34;&gt;DesignPatterns&lt;/a&gt; violate &lt;a href=&#34;http://c2.com/cgi/wiki?OnceAndOnlyOnce&#34;&gt;OnceAndOnlyOnce&lt;/a&gt;. If you need to use a design-pattern often enough for it to become a &#39;pattern&#39;, it should be refactored into a single language statement just like every other &#39;pattern&#39; you refactor. If you &lt;em&gt;can&#39;t&lt;/em&gt; refactor the design-pattern due to language limitations or other constraints, you&#39;ll end up apply the same pattern, by hand, repeatedly (thus the name &#39;pattern&#39;). Of course, given a &lt;a href=&#34;http://c2.com/cgi/wiki?TuringComplete&#34;&gt;TuringComplete&lt;/a&gt; language you can potentially refactor anything, but beware &lt;a href=&#34;http://c2.com/cgi/wiki?GreenspunsTenthRuleOfProgramming&#34;&gt;GreenspunsTenthRuleOfProgramming&lt;/a&gt; and the overhead required to refactor design patterns in any generic manner. The need for &lt;a href=&#34;http://c2.com/cgi/wiki?DesignPatterns&#34;&gt;DesignPatterns&lt;/a&gt; should be considered a &lt;a href=&#34;http://c2.com/cgi/wiki?LanguageSmell&#34;&gt;LanguageSmell&lt;/a&gt;. A language that has a lot of &lt;a href=&#34;http://c2.com/cgi/wiki?DesignPatterns&#34;&gt;DesignPatterns&lt;/a&gt; smells a great deal worse than one that requires only a few.&lt;/p&gt;&#xA;&lt;p&gt;-- &lt;a href=&#34;http://c2.com/cgi/wiki?DesignPatternsAreMissingLanguageFeatures&#34;&gt;DesignPatternsAreMissingLanguageFeatures&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;li&gt;I&#39;ve installed &lt;a href=&#34;http://msdn.microsoft.com/en-us/vstudio/products/default.aspx&#34;&gt;Visual Studio 2008&lt;/a&gt; because I had a) access to it b) I once read that it contained some stuff to simplify the addition of new languages to it. There is an &lt;a href=&#34;http://msdn.microsoft.com/en-us/vsx/default.aspx&#34;&gt;SDK&lt;/a&gt; available and I recommend to anyone to check it out - especially the stuff about using the Visual Studio Shell for your own projects (&lt;em&gt;it&#39;s neat-o&lt;/em&gt;). My only issue with it is that all my work project are still using Visual Studio 2005 and there is no way to open 2005 projects without converting them which sucks - &lt;em&gt;I let you guess why&lt;/em&gt; &lt;strong&gt;:-)&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;There is an &lt;a href=&#34;http://www.microsoft.com/downloads/details.aspx?FamilyID=51A5C65B-C020-4E08-8AC0-3EB9C06996F4&amp;amp;displaylang=en&#34;&gt;SDK&lt;/a&gt; available for Visual Studio 2005, too.&lt;/li&gt;&#xA;&lt;li&gt;I&#39;m looking into writing a language extension for &lt;a href=&#34;http://en.wikipedia.org/wiki/QuakeC&#34;&gt;QuakeC&lt;/a&gt;, though I&#39;m not sure whether it is worth the trouble, because most people I know who still code in &lt;em&gt;QuakeC&lt;/em&gt; use Linux **&amp;gt;_&amp;gt;&#39;**&lt;/li&gt;&#xA;&lt;li&gt;Doing the same for TorqueScript might be a good idea though, and I could probably even sell it - again I&#39;m not sure whether coding it would be that rewarding.&lt;/li&gt;&#xA;&lt;li&gt;I&#39;ve been playing &lt;a href=&#34;http://www.bit-blot.com/aquaria/&#34;&gt;Aquaria&lt;/a&gt; a lot in the last days and I really enjoy it, although it&#39;s not the kind of game I usually play. It certainly is worth its 30 USD.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://grammar.ccc.commnet.edu/grammar/adverbs.htm&#34; class=&#34;uri&#34;&gt;http://grammar.ccc.commnet.edu/grammar/adverbs.htm&lt;/a&gt; is an awesome site about English grammar!&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The latest Linux-Hater is simply awesome - and funny: &lt;a href=&#34;http://linuxhaters.blogspot.com/2008/08/bundle-me-this.html&#34;&gt;Bundle me this&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;I think that&#39;s enough for now and I&#39;m going to back to reading/playing/listening to music.&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br/&gt; Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sat, 16 Aug 2008 13:35:26 +0000</pubDate>
    </item>
    <item>
      <title>Olympics in the PRC &#39;08</title>
      <link>http://blog.blackhc.net/2008/08/olympics-in-the-prc-08/index.html</link>
      <description>&lt;figure&gt;&#xA;&lt;img src=&#34;/images/2008-08-09-olympics-in-the-prc-08/china-olympics.jpg&#34; alt=&#34;Human Rights, Executions and the Beijing Olympics 2008&#34; /&gt;&lt;figcaption&gt;Human Rights, Executions and the Beijing Olympics 2008&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;&lt;em&gt;Short Note: This totally sums up what I think of the Olympics in China this year&lt;/em&gt;..&lt;/p&gt;&#xA;&lt;p&gt;And the strip is really funny :D&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sat, 09 Aug 2008 21:04:22 +0000</pubDate>
    </item>
    <item>
      <title>What I&#39;ve been thinking about lately..</title>
      <link>http://blog.blackhc.net/2008/07/what-ive-been-thinking-about-lately/index.html</link>
      <description>&lt;p&gt;I&#39;ve just finished watching &lt;a href=&#34;http://www.google.de/url?sa=t&amp;amp;ct=res&amp;amp;cd=1&amp;amp;url=http%3A%2F%2Fwww.imdb.com%2Ftitle%2Ftt0119008%2F&amp;amp;ei=dSGKSJCRL4igmwOp_bUU&amp;amp;usg=AFQjCNHrRDI3oIOxAeoCq5hhmrWuq1Zn3w&amp;amp;sig2=uHHW33lVC0sG2trhR-OlGA&#34;&gt;Donnie Brasco&lt;/a&gt; with some friends and I really have to say that it&#39;s an awesome movie. Al Pacino and Johnny Depp really deliver an amazing performance. It&#39;s based on a real-life story &lt;a href=&#34;http://en.wikipedia.org/wiki/Donnie_Brasco&#34;&gt;which is worth a look&lt;/a&gt;, too - there are a few differences to the movie, though.&lt;/p&gt;&#xA;&lt;p&gt;Lately I&#39;ve been watching quite a few movies, not that I would have that much spare time but after an exam, I spoil myself with a movie now, and then and since I&#39;ve had four exams in the last week you can guess how many movies I&#39;ve watched. I&#39;ve been busy like a bee this term which also accounts for the lack of new posts on this blog in the last months and I&#39;ve pretty much finished the second and the fourth term in one /&lt;/p&gt;&#xA;&lt;p&gt;This means that I will have more time in the next terms to work at university and earn some money. Moreover it&#39;s not just about the money but also about the projects I plan to work on, but more on this later. Right now I&#39;m working for the chair for medical visualization and augmented reality and my only (and current) project so far has been about implementing a paper about &lt;a href=&#34;http://www.cg.tuwien.ac.at/research/publications/2005/Thurner-2005-IVR/&#34;&gt;&amp;quot;Importance-Driven Volume Rendering&amp;quot;&lt;/a&gt;, where I&#39;m currently and still stuck with work on the UI for the transfer functions (the data only consists of intensity values and since people prefer colors, some preprocessing has to be done). The bad thing is that I&#39;ve totally forgotten everything else over it - I&#39;ve spent like two weeks &lt;a href=&#34;http://www.real-time-volume-graphics.org/&#34;&gt;reading up on volume rendering&lt;/a&gt; and raycasting in general and even wrote a &lt;a href=&#34;http://data.blog.blackhc.net/stuff/isocaster3.jpg&#34;&gt;very&lt;/a&gt; &lt;a href=&#34;http://data.blog.blackhc.net/stuff/isocaster1.jpg&#34;&gt;simple&lt;/a&gt; &lt;a href=&#34;http://data.blog.blackhc.net/stuff/isocaster2.jpg&#34;&gt;raycaster&lt;/a&gt; in &lt;a href=&#34;http://developer.amd.com/gpu/rendermonkey/Pages/default.aspx&#34;&gt;RenderMonkey&lt;/a&gt;, but I hardly remember any of it anymore now..&lt;/p&gt;&#xA;&lt;p&gt;Most of the lectures that I attended this term were pretty interesting (Linear Algebra, Theoretical Computer Science, Computer Networks) but Algorithms and Data Structures was more on the incompetent side of things due to the lecturer not preparing for any of the lectures beforehand and an incredible amount of errors in his slides - our weekly schedule was as follows: 2 hours of new subject matter, 1 hour of discussing the corrections of the errors he introduced in the former 2 hours. In the end I only attended that one hour because it was more fun and I didn&#39;t get as confused. My main source for learning about algorithms thus was &lt;em&gt;the book&lt;/em&gt; (&lt;a href=&#34;http://books.google.de/books?id=NLngYyWFl_YC&amp;amp;printsec=frontcover&amp;amp;hl=en&amp;amp;sig=ACfU3U1HUQNCJwwoNz-3zllqkVYlfL92NA&#34;&gt;Cormen et al&lt;/a&gt;). I&#39;ve also attended Software Engineering and I&#39;m still not sure about what to think of it, so I&#39;ll wait for the exam and maybe reread Code Complete for it to get some common sense about the general topics back again.&lt;/p&gt;&#xA;&lt;p&gt;I must admit that university hasn&#39;t told me a lot of new things so far. Especially nothing that I couldn&#39;t have learned on my own just as well or even better in less time to be really honest.&lt;/p&gt;&#xA;&lt;p&gt;So all in all I must say that anyone who is bright (I consider that myself) and already knows a lot about programming is well-advised to try and get a job in the industry directly if possible because anything else is just a waste of time.&lt;/p&gt;&#xA;&lt;p&gt;On other news I&#39;ve finally acquired my own domain: &lt;a href=&#34;http://www.blackhc.net&#34;&gt;blackhc.net&lt;/a&gt; after blackhc.com was already taken. I haven&#39;t really had any time so far to set it up properly, but I&#39;ve already routed blog.blackhc.net to this blog, so it&#39;s not a total waste.. :)&lt;/p&gt;&#xA;&lt;p&gt;I might also move this blog to it but I&#39;m not entirely sure yet, because I&#39;m pretty happy with wordpress.com&#39;s service so far. There is a little bit of irony to it, too, since I only got the idea of getting my own webspace, because I wanted to post a blog entry about matrices, etc. and needed formula support for it. I searched with google and everything I found required its own wordpress installation with plugins and so on. Then I started to look at domain names and found out that blackhc.com was already taken by someone else and that HostMonster was really very cheap (5 USD a month if you subscribe for 2 years) and the deal was pretty much settled. After I bought the domain and the hosting package, I went on to search how to install the plugins in wordpress and eventually found &lt;a href=&#34;http://faq.wordpress.com/2007/02/18/can-i-put-math-or-equations-in-my-posts/&#34;&gt;this FAQ posting&lt;/a&gt;.. Now I know that wordpress.com can do LaTeX after all and I have lots of cheap webspace, too - I should call that a net gain, right?&lt;/p&gt;&#xA;&lt;p&gt;That said, I think this post has become long enough and I&#39;ll drop by in a few days and write more after my last exam. I also still have that linear algebra post in the queue and possibly a few others, so hopefully I&#39;ll have enough time to finalize them and publish them soon.&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br/&gt; Black&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Tue, 29 Jul 2008 21:48:58 +0000</pubDate>
    </item>
    <item>
      <title>Best of Cyanide &amp; Happiness</title>
      <link>http://blog.blackhc.net/2008/05/best-of-cyanide-happiness/index.html</link>
      <description>&lt;p&gt;Long ago (about three weeks ago to be correct) I still had lots of free time and no university lectures yet, so I decided to look at all - &lt;em&gt;I repeat: at all 1000-something&lt;/em&gt; - Cyanide &amp;amp; Happiness comic strips on &lt;a href=&#34;http://www.explosm.net&#34;&gt;www.explosm.net&lt;/a&gt; and make a collection of the ones that I liked the most. Of course my collection isn&#39;t complete and I got pretty tired at the end but I still think I&#39;ve found quite a few gems among the strips.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve stored them as a list of links in a raw txt file (it can be found &lt;a href=&#34;http://data.blog.blackhc.net/explosm/explosm.txt&#34;&gt;here&lt;/a&gt;, if you want take a look a it) and it wasn&#39;t really usable the way it was. I wanted to put it on my blog though to let others view it in a comfortable way but since I didn&#39;t have enough time I postponed it... &lt;em&gt;till yesterday&lt;/em&gt;. Yesterday I&#39;ve finally found enough time to sit down and think and code something nice to let you (and myself, too) browse through my favorites.&lt;/p&gt;&#xA;&lt;p&gt;You can find the final page here: &lt;a href=&#34;http://data.blog.blackhc.net/explosm/explosmviewer.html&#34; class=&#34;uri&#34;&gt;http://data.blog.blackhc.net/explosm/explosmviewer.html&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h4 id=&#34;how-does-it-work&#34;&gt;How does it work?&lt;/h4&gt;&#xA;&lt;p&gt;It uses AJAX! Well actually it only uses XMLHttpRequest to query the &lt;a href=&#34;http://data.blog.blackhc.net/explosm/explosmviewer.dat&#34;&gt;.dat file&lt;/a&gt; that stores a preprocessed list of C&amp;amp;H links (plus the respective image links) and uses that data to let you browse my favorites dynamically but it contains the code to create the said .dat file out of my raw .txt file.&lt;/p&gt;&#xA;&lt;p&gt;Consequently if I ever update my list, I can do so simply by updating the .txt file with a few links and regenerate the .dat file with all additional information.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;m mostly using some RegExp to parse the Explosm pages and my .txt and .dat files. If you want to try the code out yourself, mind that you need to uncomment the compileList( true ); line and use Internet Explorer to run it because FireFox doesn&#39;t allow cross-domain access which is naturally needed if you want to parse the pages on explosm.net. The result is copied into the clipboard and can be then saved and uploaded to the webspace of choice (if you adapt the links in the script, too).&lt;/p&gt;&#xA;&lt;p&gt;Enjoy :-)&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br/&gt; Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sun, 11 May 2008 13:43:50 +0000</pubDate>
    </item>
    <item>
      <title>New Room, New Uni Term</title>
      <link>http://blog.blackhc.net/2008/04/new-room-new-uni-term/index.html</link>
      <description>&lt;p&gt;Finally the second university term has started and I&#39;m back in Munich working hard to get through university as fast as possible.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve also moved into a new room - I&#39;m staying at a dorm now - and it&#39;s really pretty awesome. There are lots of exchange students (Belgium, France, Italy, Japan to name a few) and we&#39;re all having a good time constantly, so really it&#39;s a huge improvement when it comes to meeting other people. On the other hands it not a typical dorm either: my room has got its own little bathroom and it&#39;s all new because the building has been renovated in the past year - &lt;em&gt;although to be honest, some parts are still being renovated, which sucks because there is still a scaffolding outside my window and I can&#39;t really look outside&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;But pictures can convey a lot more than words, so here are some low-res photos that I have taken with my web-cam.&lt;/p&gt;&#xA;&lt;div class=&#34;row&#34;&gt;&#xA;&lt;div class=&#34;thumbnail col-sm-3&#34;&gt;&#xA;&lt;p&gt;&lt;a target=&#34;_blank&#34; href=&#34;/images/overflow/2008/04/picture0001.jpg&#34;&gt;&lt;img class=&#34;img-responsive&#34; src=&#34;/images/overflow/2008/04/picture0001.jpg&#34;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;div class=&#34;thumbnail col-sm-3&#34;&gt;&#xA;&lt;p&gt;&lt;a target=&#34;_blank&#34; href=&#34;/images/overflow/2008/04/picture0002.jpg&#34;&gt;&lt;img class=&#34;img-responsive&#34; src=&#34;/images/overflow/2008/04/picture0002.jpg&#34;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;div class=&#34;thumbnail col-sm-3&#34;&gt;&#xA;&lt;p&gt;&lt;a target=&#34;_blank&#34; href=&#34;/images/overflow/2008/04/picture0003.jpg&#34;&gt;&lt;img class=&#34;img-responsive&#34; src=&#34;/images/overflow/2008/04/picture0003.jpg&#34;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;div class=&#34;row&#34;&gt;&#xA;&lt;div class=&#34;thumbnail col-sm-3&#34;&gt;&#xA;&lt;p&gt;&lt;a target=&#34;_blank&#34; href=&#34;/images/overflow/2008/04/picture0004.jpg&#34;&gt;&lt;img class=&#34;img-responsive&#34; src=&#34;/images/overflow/2008/04/picture0004.jpg&#34;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;div class=&#34;thumbnail col-sm-3&#34;&gt;&#xA;&lt;p&gt;&lt;a target=&#34;_blank&#34; href=&#34;/images/overflow/2008/04/picture0005.jpg&#34;&gt;&lt;img class=&#34;img-responsive&#34; src=&#34;/images/overflow/2008/04/picture0005.jpg&#34;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;div class=&#34;thumbnail col-sm-3&#34;&gt;&#xA;&lt;p&gt;&lt;a target=&#34;_blank&#34; href=&#34;/images/overflow/2008/04/picture0006.jpg&#34;&gt;&lt;img class=&#34;img-responsive&#34; src=&#34;/images/overflow/2008/04/picture0006.jpg&#34;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;div class=&#34;row&#34;&gt;&#xA;&lt;div class=&#34;thumbnail col-sm-3&#34;&gt;&#xA;&lt;p&gt;&lt;a target=&#34;_blank&#34; href=&#34;/images/overflow/2008/04/picture0007.jpg&#34;&gt;&lt;img class=&#34;img-responsive&#34; src=&#34;/images/overflow/2008/04/picture0007.jpg&#34;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sat, 19 Apr 2008 20:24:08 +0000</pubDate>
    </item>
    <item>
      <title>SplashDamage Photos on Flickr</title>
      <link>http://blog.blackhc.net/2008/03/splashdamage-photos-on-flickr/index.html</link>
      <description>&lt;p&gt;Do you know what a games company looks like? And if you think you do, let me add some adjectives that will change everything: an awesome games company, a cool games company, a &lt;em&gt;&lt;a href=&#34;http://www.splashdamage.com&#34;&gt;SplashDamage&lt;/a&gt;-esque&lt;/em&gt; game company :D&lt;/p&gt;&#xA;&lt;p&gt;We (some folks from the &lt;em&gt;#q3mods&lt;/em&gt;) had a meeting recently at Arnout&#39;s, Gordon&#39;s and David&#39;s place in March - it was like from &lt;em&gt;Friends&lt;/em&gt;, the series, only they have got a house, a gaming TV, lots of game and Guitar Hero 3 / They were so kind to let me stay in the dungeon (the basement) - for a week and I spent all of my free time playing Guitar Hero or watching them work at SplashDamage&#39;s office, which was grand. I can&#39;t really say a lot more, otherwise I&#39;d get torn to pieces by some attorneys for violating the NDA I&#39;ve signed but let me repeat: It was &lt;strong&gt;&lt;em&gt;awesome&lt;/em&gt;&lt;/strong&gt;. We all stayed at the their place, played games (&lt;em&gt;&lt;a href=&#34;http://www.guitarherogame.com/gh3/&#34;&gt;Guitar Hero&lt;/a&gt;!!&lt;/em&gt; and lots of Wii games), watched movies, ordered pizza and Chinese and even ate it all up, too, and had a splendid time.&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br/&gt; Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Wed, 19 Mar 2008 00:13:16 +0000</pubDate>
    </item>
    <item>
      <title>Edu2 Postmortem</title>
      <link>http://blog.blackhc.net/2008/03/edu2-postmortem/index.html</link>
      <description>&lt;p&gt;I think I&#39;ve been talking about &lt;strong&gt;Edu2&lt;/strong&gt; a lot already and I don&#39;t really feel like giving a huge overview again - &lt;em&gt;probably I will end up doing so nonetheless&lt;/em&gt;. &lt;strong&gt;Edu2&lt;/strong&gt; is finished, over, done. I&#39;m not going to touch it again - &lt;em&gt;ever&lt;/em&gt;! That said, I think there are a few nice things and lots of bad things to say and tell about it. I usually paint bleak pictures and I won&#39;t stop here, because I try to be honest with the negative side of things.&lt;/p&gt;&#xA;&lt;p&gt;I guess this is going to be a bigger postmortem because there are many different topics that I should mention to give the reader a fair impression.&lt;/p&gt;&#xA;&lt;p&gt;To begin with, a few links first for those interested in &lt;strong&gt;Edu1&lt;/strong&gt; and &lt;strong&gt;Edu2&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.edu-shooter.de/&#34;&gt;http://www.edu-shooter.de/ Official Edu1 Page - only German though&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://sourceforge.net/projects/edu2&#34;&gt;http://sourceforge.net/projects/edu2 Our SourceForge Project - you can even download an almost final build&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;em&gt;Interesting fact: google for Edu2 and you&#39;ll find a project that is almost about the same things that we worked on - except it&#39;s 2D only.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xA;&lt;p&gt;First let me tell you what &lt;strong&gt;Edu2&lt;/strong&gt; is about: Imagine Second Life, Facebook, some uni/educational content and mini-games (flash stuff) merged to one product. That is &lt;strong&gt;Edu2&lt;/strong&gt; from what I could figure out of the business plan and my work on the prototype.First observation: this sounds like a huge project - too huge for one university term. Thus we only worked on a &#39;&lt;em&gt;prototype&lt;/em&gt;&#39;. Second observation: it sounds like a project that is a tad bit megalomaniac and doomed to fail because the market is kind of saturated, too. I, honestly, think that this will be its likely fate, if anyone should ever try to develop it.&lt;/p&gt;&#xA;&lt;p&gt;The project was actually about creating a business plan (half of the team) and creating a prototype (the other half), so I don&#39;t think it&#39;s a bad idea, because social networks really are big nowadays and experience doing social network stuff (even if it&#39;s only a very raw prototype) can come in handy maybe. It&#39;s mostly useless if you think that it&#39;s helping you get a job in the game industry because it&#39;s a very different business area and at most the prototype team may have learnt something valuable because it was working with mostly standard game tools.&lt;/p&gt;&#xA;&lt;p&gt;One really funny note here: We visited &lt;a href=&#34;http://www.ubi.com/&#34;&gt;Ubisoft Germany&lt;/a&gt; and &lt;a href=&#34;http://www.electronic-arts.de/&#34;&gt;EA Germany&lt;/a&gt; and presented our project there. At the time being there, I was somewhat excited to get an opportunity to talk to some important people there. However, I wonder: why did we even go to visit them? What do they have to do with our project? Why would they be interested? Obviously, they are not - &lt;em&gt;except maybe &lt;strong&gt;EA&lt;/strong&gt;, which we all know, plans to have a go for total world domination with unoriginal, corporate games (this is supposed to change though, so &lt;strong&gt;thumbs up&lt;/strong&gt;)&lt;/em&gt; - so I question the use of the whole visits.&lt;/p&gt;&#xA;&lt;p&gt;Had we got a simple but interesting game, it might have been of more use and we could have possibly pulled of what I would call a &amp;quot;&lt;a href=&#34;http://www.computerandvideogames.com/article.php?id=174936&amp;amp;site=pcg&#34;&gt;Portal&lt;/a&gt;&amp;quot; and actually present something convincing that would have been a true first playable prototype of a game. So the first big point that deserves mentioning is:&lt;/p&gt;&#xA;&lt;h2 id=&#34;a-good-project-needs-a-concise-and-down-to-earth-vision-behind-it.&#34;&gt;A good project needs a concise and down-to-earth vision behind it.&lt;/h2&gt;&#xA;&lt;p&gt;&lt;strong&gt;Edu2&lt;/strong&gt; certainly didn&#39;t have one, because no one really had an idea of what to do or rather everything was pretty blurry. We had a few docs with very rough but mostly too vague ideas and the problem was that decisions could hardly be made because, of course, you had the &lt;em&gt;&lt;strong&gt;big real thing&lt;/strong&gt;&lt;/em&gt; looming behind the prototype. In the end everybody or rather tiny groups of people who talked about it decided from case to case without lots of deeper thoughts behind it simply to get things done.&lt;/p&gt;&#xA;&lt;h2 id=&#34;communication-in-general-was-pretty-bad&#34;&gt;Communication in general was pretty bad&lt;/h2&gt;&#xA;&lt;p&gt;Really there was little communication between the different groups and I, at least, had very little contact to everyone else, so it was very hard to involve the team in decisions - since we were the coders, we pretty much had control over the core functionality, because our level designer didn&#39;t have that much freedom: their task was to extend and clean up the original Edu1 campus level (a level consisting of a virtual university campus) and add gecko terminals now and then. We had a few fun ideas the night before the presentation, for example:&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Adding zones that would open a gecko window with specific content - e.g. Amazon in the store or the mini-game selection window when you are near a gaming console..&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Those were ideas that actually were really interesting and could have added a lot to &lt;strong&gt;Edu2&lt;/strong&gt;&#39;s &#39;gameplay&#39; but sadly time was a very constraining factor and in the end they didn&#39;t make it in, even though the code was pretty much in place. Additional trigger brushes would have been needed, but there simply wasn&#39;t enough time to recompile the map. Clearly, we could have come up with those things earlier if we had talked and discussed things more.&lt;/p&gt;&#xA;&lt;p&gt;The only person I was talking a lot to was &lt;em&gt;&lt;strong&gt;Frank &#39;res(2k)&#39; Richter&lt;/strong&gt;&lt;/em&gt;, a pretty damn good coder, who is currently working on the free and awesome &lt;a href=&#34;http://apricot.blender.org/&#34;&gt;&lt;strong&gt;Blender/CrystalSpace&lt;/strong&gt; &#39;Apricot&#39; game in Amsterdam&lt;/a&gt;. He did an amazing job with &lt;a href=&#34;http://sourceforge.net/projects/offscreengecko/&#34;&gt;&lt;strong&gt;offscreengecko&lt;/strong&gt;&lt;/a&gt;, a gecko client that makes it really easy to include &lt;a href=&#34;http://developer.mozilla.org/en/docs/XULRunner&#34;&gt;&lt;strong&gt;gecko &lt;/strong&gt;(&lt;strong&gt;XUL&lt;/strong&gt;)&lt;/a&gt; in games, and the &lt;strong&gt;Edu2/DarkPlaces&lt;/strong&gt; code we worked on in general - &lt;em&gt;&lt;a href=&#34;http://icculus.org/twilight/darkplaces/&#34;&gt;&lt;strong&gt;DarkPlaces &lt;/strong&gt;&lt;/a&gt;is the name of the engine for newbies to this blog&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;We talked a lot about things and it was great to have someone on the project, who is at least as experienced as I was and quite certainly a lot more experienced than I am to be honest. A few things went wrong there nonetheless:&lt;/p&gt;&#xA;&lt;ol type=&#34;1&#34;&gt;&#xA;&lt;li&gt;I was chosen to be the coding lead between the two of us. Since there wasn&#39;t anyone else, I don&#39;t think, I really had much to do as &amp;quot;lead&amp;quot; and that there was a huge difference in what we did, but I tried to take responsibility and keep bugging him to work on stuff, question him about things that we needed to work on, try to decide on the tasks we should do next, etc.. It was a team process and I hope that he isn&#39;t too angry with me about it :-/&lt;/li&gt;&#xA;&lt;li&gt;Again and again and this time, too, I&#39;ve been way too protective of my code and way too restrictive and critical of other&#39;s code. When someone changes things in my code - that is code I&#39;ve been working on - and I consider the changes to mess up the code (design) or be problematic - that can drive me nuts pretty quickly. So I guess I&#39;m quite bad tempered when it comes to coding. I&#39;m pretty glad that I only frustrated Frank once for real and I&#39;m still very sorry about it and I hope that I&#39;ve learnt my lesson now.&lt;/li&gt;&#xA;&lt;li&gt;Even though I&#39;ve tried my best, work was sometimes distributed awkwardly resulting in conflicts and things being done twice - although those few times I don&#39;t think that time was really totally wasted but it certainly wasn&#39;t used as efficiently as possible, which is bad because we both had other, more important things to do.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Another fun fact: no one has told our self-taught mappers and modelers how to do so effectively. &lt;strong&gt;Edu2&lt;/strong&gt;&#39;s only map apparently had compile times of 20+ hours at the end of the project and we had lots of bloated models with ridiculous triangle and vertex counts without any real justification for it.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;m not sure I should mention this, but we had a lot of trouble with our only character modeler &lt;em&gt;&lt;strong&gt;Jarno Müller&lt;/strong&gt;&lt;/em&gt;, who, to put it in a nut-shell, wasn&#39;t a least bit as professional as he claimed to be - &lt;em&gt;considering the fact that he seems to own &lt;a href=&#34;http://www.grafiker.org/&#34;&gt;his own company&lt;/a&gt; that does gfx contract work&lt;/em&gt;. I&#39;ve already ranted about him in a past blog entry, but I think he deserves to be named, because otherwise the way he behaved and partially crippled the project - &lt;em&gt;we had to use standard free Quake3 models in the end for god&#39;s sake&lt;/em&gt; - wouldn&#39;t make a difference and the incredibly unprofessional way he acted and left the project (by simply not replying to emails at all in general anymore and not participating seriously in any way before either) pissed me (and others) off big time. He was offered help multiple times in the beginning to try and see how to export models from &lt;a href=&#34;http://www.maxon.net/pages/products/cinema4d/cinema4d_e.html&#34;&gt;Cinema4D&lt;/a&gt; into a format Darkplaces supports but didn&#39;t answer any emails and then a week or two after we extended his deadline to produce one model at least he sent us a model we couldn&#39;t open because he used the latest C4D version and there was no converter to be found quickly - and he, of course, demanded that we tell him how to export the model to DP and he didn&#39;t really adhere to one requirement that he was told from the very beginning (Quake3 multi-part model, easy support for different skins, multiple low-poly models - WoW-style).&lt;/p&gt;&#xA;&lt;p&gt;Anyway, to sum everything up, here&#39;s an overview of some of the pros and cons:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Pros&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I have meet some interesting people and also made a few new friends (hopefully).&lt;/li&gt;&#xA;&lt;li&gt;I finally worked again on DarkPlaces, which was nice, because I have only been working with GarageGames engines for the past two years.&lt;/li&gt;&#xA;&lt;li&gt;We pretty much started from scratch game-code wise and had &lt;strong&gt;Edu2&lt;/strong&gt; actually been a real game and had there been a FPP in the end, it would have been an ueber-useful experience. But even without that, it was pretty interesting.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Cons:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I really have lost a lot of time with the project that I really could and should have used for other things.&lt;/li&gt;&#xA;&lt;li&gt;The final prototype really is mostly useless, except if I get myself motivated enough to port back some of its features to &lt;a href=&#34;http://www.alientrap.org/nexuiz/&#34;&gt;&lt;strong&gt;Nexuiz&lt;/strong&gt;&lt;/a&gt;..&lt;/li&gt;&#xA;&lt;li&gt;The prototype hasn&#39;t been actually officially used for anything else than a small video.&lt;/li&gt;&#xA;&lt;li&gt;Thus I can conclude that it was a terrible waste of time&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Worth mentioning:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The crunch time in the last two days was really fun and sleeping ten hours in three days says it all.. It was probably the most fun I&#39;ve had in a long time (before visiting &lt;strong&gt;&lt;a href=&#34;http://www.splashdamage.com&#34;&gt;SplashDamage&lt;/a&gt;&lt;/strong&gt; again).&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;I think that&#39;s it for me.&lt;/p&gt;&#xA;&lt;p&gt;Cheers, Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Tue, 18 Mar 2008 01:13:50 +0000</pubDate>
    </item>
    <item>
      <title>Windows Weirdness</title>
      <link>http://blog.blackhc.net/2008/03/vista-weirdness/index.html</link>
      <description>&lt;p&gt;Lately I&#39;ve spent a lot of time developing batch files for Edu2, writing for weirdness for batch renames and having fun with the command-line in general, since it is my tool of choice that goes beyond simple Explorer and SVN Tortoise jobs. And because of that I&#39;ve found a few quirks and bugs that are either funny or at least worth noting since they are a PITA to track down.&lt;/p&gt;&#xA;&lt;h5 id=&#34;how-to-crash-cmd.exe&#34;&gt;How to crash cmd.exe&lt;/h5&gt;&#xA;&lt;p&gt;Plain and simple:&lt;/p&gt;&#xA;&lt;pre class=&#34;bash&#34;&gt;&lt;code&gt;for /R %f in () do echo&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;crashes cmd.exe in Vista&lt;/p&gt;&#xA;&lt;h5 id=&#34;environment-variable-mess-up&#34;&gt;Environment Variable Mess-Up&lt;/h5&gt;&#xA;&lt;p&gt;Maybe you know the environment settings dialog in XP/Vista. It allows you to specify environment variables both for the global environment and for the current user. (The former only if you&#39;re an admin though.) A neat feature is that you can, of course, set the same environment variable twice and Vista/XP will merge them to one, which naturally allows for some neat system configuration.&lt;/p&gt;&#xA;&lt;p&gt;However, it has its issues, too, of course.. Notably it handles case-sensitivity of environment variable names inconsistently, which results in some pretty weird behavior.&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xA;&lt;p&gt;For example let&#39;s assume we have a global and a user &lt;code&gt;PATH&lt;/code&gt; environment variable, then Windows would merge the two, so that for applications &lt;code&gt;PATH&lt;/code&gt; will be &lt;code&gt;%PATH_global%&lt;/code&gt; &lt;code&gt;%PATH_user%&lt;/code&gt; (where &lt;code&gt;_global&lt;/code&gt; and &lt;code&gt;_user&lt;/code&gt; refer to specific variables). You can easily try that by opening &lt;code&gt;cmd.exe&lt;/code&gt; and typing in &lt;code&gt;set path&lt;/code&gt; and notice how they are merged.&lt;/p&gt;&#xA;&lt;p&gt;Now what happens if you have e.g. a global &lt;code&gt;Path&lt;/code&gt; and a local &lt;code&gt;PATH&lt;/code&gt;. You&#39;d expect that they either show up as two different environment variables (if Windows treats them as case-sensitive) or they will be merged into one variable again (if they are treated case-insensitively). Sadly none of the above happens: &lt;code&gt;$ set path&lt;/code&gt; will return &lt;code&gt;Path = %Path_global% %Path_global%&lt;/code&gt;, which is both useless and can cause severe headaches, when only one half of your environment variable is available suddenly (for example after installing a program that changes or adds environment variables).&lt;/p&gt;&#xA;&lt;p&gt;What happens? My guess and the only possible explanation are that Vista&#39;s (maybe XP&#39;s, too) handling is inconsistent. Detection of variables that need to be merged is case-insensitive, while the actual merging is not. It fails to find the user environment variable and instead uses the global one again (maybe it uses the same buffer to cache their value before concatenating them).&lt;/p&gt;&#xA;&lt;p&gt;It took me some time to figure it out because, obviously, the &lt;code&gt;set&lt;/code&gt; command and everything else treats them as case-insensitive.&lt;/p&gt;&#xA;&lt;h5 id=&#34;file-associations&#34;&gt;File Associations&lt;/h5&gt;&#xA;&lt;p&gt;I&#39;ve been using &lt;strong&gt;&lt;a href=&#34;http://notepad-plus.sourceforge.net/&#34;&gt;&lt;em&gt;Notepad++&lt;/em&gt;&lt;/a&gt;&lt;/strong&gt; for over half a year now and I really &lt;em&gt;really&lt;/em&gt; like it. But a few days ago I made the mistake of switching over to using it exclusively over notepad and for that I decided to change its file associations. Thank god it provides a simple dialog for that in its preferences window and it was a nice and easy task. Except that I also changed the file associations for .bat and .cmd files and instead of changing the &amp;quot;Edit&amp;quot; verb it changed the &amp;quot;Open/Execute&amp;quot; verb, which caused .bat files to only be opened in &lt;em&gt;Notepad++&lt;/em&gt; instead of being executed.&lt;/p&gt;&#xA;&lt;p&gt;Windows 95/98/ME/2000/XP had a really nice file association tab in their folder options which gave you total control over pretty much all aspects (except for some obscure cases where you had no choice but use &lt;em&gt;regedit&lt;/em&gt; to change things). Now Vista&#39;s designer apparently have decided that it gives users too much control and that that is a bad idea - so they have totally crippled it. I repeat: totally and fully crippled it. Instead of being able to edit and manage various verbs, specify DDE actions, setting a default verb, etc. etc., you only have a &amp;quot;Change Action&amp;quot; button that only allows you to specify the command-line. They have also moved it to System Settings, which is probably a better location than Folder Options where it was next to the visual appearance tab, but it&#39;s totally useless now - &lt;em&gt;as are more freeware tools that you find on the internet :(&lt;/em&gt;. After some cursing, goggling and worrying I eventually found &lt;a href=&#34;http://www.winhelponline.com/articles/105/1/File-association-fixes-for-Windows-Vista.html&#34;&gt;some .reg files&lt;/a&gt; that restore Vista&#39;s default associations but that&#39;s really not what I would call a perfect solution.&lt;/p&gt;&#xA;&lt;p&gt;Stay tuned for a last blog post about Edu2: a post-mortem (coming soon hopefully) and more,&lt;br/&gt; Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sun, 16 Mar 2008 00:14:35 +0000</pubDate>
    </item>
    <item>
      <title>Edu2 is finally done \o/</title>
      <link>http://blog.blackhc.net/2008/03/edu2-is-finally-done-o/index.html</link>
      <description>&lt;p&gt;Edu2 is finally over (at least for me). I&#39;ve uploaded a 99% final build - the only thing that is missing are correct credits, but I hope to receive them ASAP and then I&#39;m really really really done with it. Which means lots of free space on my harddisk - the beast is over 2 GB big here...&lt;/p&gt;&#xA;&lt;p&gt;On the other hand lots of new awesome projects are out there waiting for me to contribute and I&#39;ve already joined two new projects (WoWar and SemuruC) and also finally have time to concentrate on another one (with the mysterious name &amp;quot;DasProjekt&amp;quot;). More news, links and information about them later.&lt;/p&gt;&#xA;&lt;p&gt;First I have to come up with a Post Mortem for Edu2.&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br /&gt;&#xA;Black&lt;/p&gt;&#xA;&lt;p&gt;PS: On different other news I hope that I have been able to convince the head of PR of EA Germany to use Nexuiz as FPS example game at one of their public discussion rounds. More on that later, too - hopefully!&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Tue, 04 Mar 2008 21:57:13 +0000</pubDate>
    </item>
    <item>
      <title>Final Java Homework at uni</title>
      <link>http://blog.blackhc.net/2008/02/final-java-homework-at-uni/index.html</link>
      <description>&lt;p&gt;This is the final Java homework in our Java introductory course at university. Enjoy :-)&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://data.blog.blackhc.net/MineSweeper.html&#34;&gt;Click here to play the game&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Greetings,&lt;br/&gt; Black&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Tue, 19 Feb 2008 22:44:58 +0000</pubDate>
    </item>
    <item>
      <title>Edu2p Stuff</title>
      <link>http://blog.blackhc.net/2008/02/edu2p-stuff/index.html</link>
      <description>&lt;p&gt;Finally, I&#39;ve found some time to write a tiny post linking to a couple of pics of Edu2 (the prototype) - the project that has kept me busy for the last 3-4 months and burned me out pretty badly from what I can tell..&lt;/p&gt;&#xA;&lt;p&gt;First a small animation that shows the terminal:&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/overflow/stuff/terminalworking.gif&#34; alt=&#34;Working terminals in edu2&#34; /&gt;&lt;figcaption&gt;Working terminals in edu2&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;This was an awesome step in my opinion and it&#39;s really great to see it live (especially in a real level).&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/overflow/stuff/edu2p000.jpg&#34; alt=&#34;Nexuiz&amp;#39;s Homepage in its (new) default menu&#34; /&gt;&lt;figcaption&gt;Nexuiz&#39;s Homepage in its (new) default menu&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;Res2k aka Frank Richter hacked that into Nexuiz&#39;s new menu (written by div0 - kudos to him for fixing/rewriting the broken piece of shit that my old menu was after all). It&#39;s pretty nice but of course Nexuiz doesn&#39;t support Gecko atm (and won&#39;t either in the near future due to potential security vulnerabilities), and that feature only existed in our branch for some time. I guess I&#39;ll add it back soon, too, because it was really useful.&lt;/p&gt;&#xA;&lt;p&gt;Next comes Edu2&#39;s chat window which is really a big step forward because it uses &lt;em&gt;client-side code&lt;/em&gt; and the &lt;em&gt;menu&lt;/em&gt; to replace engine features (ie. the normal messagemode input line when you want to chat). This should be an example for more serious projects, too, because it was really easy and &lt;strong&gt;clean&lt;/strong&gt; and it&#39;s really a lot more professional than the usual DarkPlaces Quake1 look.&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/overflow/stuff/edu2p_chat1.jpg&#34; alt=&#34;The first version of the Edu2 chat window&#34; /&gt;&lt;figcaption&gt;The first version of the Edu2 chat window&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;Of course, it wasn&#39;t finished and still isn&#39;t fully, so I added a button to view a chat log of different sizes (apparently I don&#39;t have a screenshot of that and I&#39;m too lazy to grab one so here it is without the varying chat log size feature):&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/overflow/stuff/edu2000001.jpg&#34; alt=&#34;Chat window with chat log&#34; /&gt;&lt;figcaption&gt;Chat window with chat log&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;Next we spent some time adding model rendering support to the menu. Poor res2k spent a few days writing lots of code and doing many changes in a separate branch that got mostly thrown away by me later and/or rewritten due to bad management (that would be) but that prototype code was used as a base and was probably cleaner than the current result hiding in DP&#39;s codebase.&lt;/p&gt;&#xA;&lt;p&gt;Anyway a nice first pic after the &amp;quot;hack&amp;quot;:&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/overflow/stuff/edu2000006.jpg&#34; alt=&#34;Model rendering in the menu&#34; /&gt;&lt;figcaption&gt;Model rendering in the menu&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;And even with alpha-blending support - that required some &amp;quot;clever&amp;quot; thinking on my side - and maybe div0 will add that to Nexuiz at least because it was on his wish-list:&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;http://data.blog.blackhc.net/stuff/edu2000007.jpg&#34; alt=&#34;Alpha-Blending Support When Rendering Models&#34; /&gt;&lt;figcaption&gt;Alpha-Blending Support When Rendering Models&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;We also wanted to feature at least one mini-game (actually we wanted to design something proper but in the end it was our job again to do it and in the very end I volunteered due to having a similar task in my introductory computer science course at university). Guess the game:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;/images/2008-02-17-edu2p-stuff/edu2000016.jpg&#34; alt=&#34;The Game&#34; /&gt;&lt;img src=&#34;/images/2008-02-17-edu2p-stuff/edu2000017.jpg&#34; alt=&#34;Another Pic of The Game&#34; /&gt;&lt;img src=&#34;/images/2008-02-17-edu2p-stuff/edu2000018.jpg&#34; alt=&#34;Last Pic of The Game at That stage&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;Guessed? Yeah pure, good, simple ol&#39; MineSweeper! It looks like that in its final version though: &lt;img src=&#34;/images/overflow/stuff/edu2000021.jpg&#34; alt=&#34;The Game Finished&#34; /&gt;&lt;img src=&#34;/images/2008-02-17-edu2p-stuff/edu2000026.jpg&#34; alt=&#34;The Game in Export Mode&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;Even div0 didn&#39;t think that such things (resizeable and moveable(!) windows and dynamic items) would be possible in his menu but I hacked that in pretty quickly and it&#39;s not even that big a hack to be honest &lt;em&gt;:-)&lt;/em&gt;).&lt;/p&gt;&#xA;&lt;p&gt;In the mean-time res2k and I have worked on the player model in the game itself - res2k did the groundwork and it&#39;s a very good one to say this and when he was away for a weekend I simply added animation support from Zymotic and adapted it to our needs somewhat- res2k was a bit angry with me when he came back and found animations somewhat working already but I &lt;em&gt;let him&lt;/em&gt;- &lt;em&gt;I didn&#39;t really have any spare time either&lt;/em&gt; - finish the rest of course and he also added some code to allow taunts to be sent from clients to server which broadcasts it to all clients which does pretty awesome things using temporary entities in QuakeC - which I&#39;m pretty proud of coming up with to be sincere. Another big TODO which res2k worked on and which shall not go unmentioned here is all the gecko stuff - except for the dynamic texture code in DP and the first set of gecko builtins and wrappers, he created all of our Gecko backend - which is a free sourceforge project called OffscreenGecko - and even added support for JavaScript interaction with Darkplaces (the various VMs). A major task and because he&#39;s currently in the Amsterdam working on CrystalSpace and the like, it&#39;s up to &lt;strong&gt;me&lt;/strong&gt; to kick some asses and use that in Edu2p for some new ueber-awesome features.&lt;/p&gt;&#xA;&lt;p&gt;Anyway, what I&#39;ve been working on lately is skin support in edu2p - thus another contribution to the playermodel code :P - and intergrating it with the menu plus allowing the users to select different models for the player&#39;s legs, torso and head. I think it looks pretty great with Quake3&#39;s models but sadly we can&#39;t use them and many of the free ones that can be found on &lt;a href=&#34;http://ioquake3.org/&#34;&gt;ioquake3&lt;/a&gt;&#39;s homepage are incompatible and badly tagged (or rather Darkplaces has problems with them that Quake3 has not).&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;/images/2008-02-17-edu2p-stuff/edu2000028.jpg&#34; alt=&#34;the menu with multi-part player selection&#34; /&gt;&lt;img src=&#34;/images/2008-02-17-edu2p-stuff/edu2000034.jpg&#34; alt=&#34;another model mix&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;/images/2008-02-17-edu2p-stuff/edu2000032.jpg&#34; alt=&#34;In-game&#34; /&gt; &lt;img src=&#34;/images/2008-02-17-edu2p-stuff/edu2000035.jpg&#34; alt=&#34;another mix ingame&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;Now imagine that with more WoW-like models and you can see where Edu2(p) is heading. Sadly we have no player modeler right now, who could create such models and the modeler/animator we had that was capable of this was - &lt;em&gt;I sadly have to conclude in retrospect&lt;/em&gt; - a complete jerk and arrogant retard - &lt;em&gt;and yes that is mean and probably uncalled for in this public blog but I&#39;m not naming him and I&#39;m pretty pissed off that he still hasn&#39;t replied to 10 emails from me, hasn&#39;t done the work he was more than once politely asked to &lt;strong&gt;and&lt;/strong&gt; agreed to, didn&#39;t give any feedback though we were more than willing to help and adjust requirements if needed and used way too many repeated exclamation and question marks for my taste in his emails and simply dropped of my radar&lt;/em&gt;. I&#39;ll still try to see if I can fix the models that we can use but there&#39;s a grim perspective to it with little more than two weeks till the final presentation.&lt;/p&gt;&#xA;&lt;p&gt;Anyway this is it from me and stay tuned for a really final update on edu2p and more stories and rants and disclosures  - no NDA! \o/&lt;/p&gt;&#xA;&lt;p&gt;Black&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sun, 17 Feb 2008 23:37:52 +0000</pubDate>
    </item>
    <item>
      <title>About &#34;Jugend denkt Zukunft&#34;</title>
      <link>http://blog.blackhc.net/2008/01/about-jugend-denkt-zukunft/index.html</link>
      <description>&lt;p&gt;About 1.5 years ago some students (including me) from our school participated in a federally supported project called &lt;a href=&#34;http://www.jugend-denkt-zukunft.de/&#34;&gt;&amp;quot;Jugend denkt Zukunft&amp;quot;&lt;/a&gt; (&lt;em&gt;&amp;quot;Youth think Future&amp;quot; - and yes it sounds shitty in German, too, and uses bad grammar...&lt;/em&gt;).&lt;/p&gt;&#xA;&lt;p&gt;Interestingly enough most articles that have been translated don&#39;t translate the grammar error, too, examples &lt;a href=&#34;http://www.ifok.de/en/ifok/news/detail/article/innovations-for-2020-nationwide-awards-for-young-foresight-germany/&#34;&gt;here&lt;/a&gt;, &lt;a href=&#34;http://www.icaa.eu/company/Vodafone/article/1933.html&#34;&gt;here&lt;/a&gt; and &lt;a href=&#34;http://www.goethe.de/ges/soz/dos/jug/sjz/en1144290.htm&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Let me explain what it is about: The school partners with a local company (or rather the other way around because it seems that the local company has to pay a lot of money (some 6000 EUR) to the organization - &lt;em&gt;NGO, of course &lt;/em&gt;- to participate and you (that is if you are the students) are part of a &amp;quot;role-playing game&amp;quot;, in which you first learn about &amp;quot;mega trends&amp;quot; of the future and then in the last two days have to come up with new product ideas that have more or less (mostly less) to do with the company and its current product lines.&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xA;&lt;p&gt;The problem is, if you have to come up with new products for a service-provider (computer-related would be paradise probably) or at least one that directly sells to end users, you&#39;re lucky, because you can actually come up with something useful or feasible (maybe). But if you end up at a company that produces screws, you&#39;re_, well,_ screwed.. because you&#39;ll never find something that is useful or makes sense and has something to do with your company in a way that won&#39;t leave people scratching their heads afterwards.&lt;/p&gt;&#xA;&lt;p&gt;Another big point is that I pity the company that gets new ideas from a group of pupils that it couldn&#39;t come up with on its own - lock a few of your employees in a room for a week and you&#39;ll probably get lots of good ideas, too, - without having to pay 6000 bucks and you can still lay them off it they don&#39;t ;) - but it&#39;s all about PR and publicity and making yourself look good in the public eyes and less about being efficient and actually producing results or teaching the students anything except faking and presenting fake results.&lt;/p&gt;&#xA;&lt;p&gt;But even worse they don&#39;t consider the effects on the pupils themselves. Everybody congratulates them for what they&#39;ve done and how innovative their fake products are (the products are mostly based on concepts and technologies that are yet to be invented) and how great they are after all. It&#39;s like entering bizarro world if you&#39;re used to the real world with real research and real products. The worst moment I&#39;ve experienced was when some otherwise cool students started to bitch about not being placed better in a state ranking of the best &amp;quot;Jugend denkt Zukunft&amp;quot; projects and in their opinion&amp;quot;they didn&#39;t get a prize because their product was too realistic and too innovative&amp;quot; - and I wanted to smack him over the head too badly but resisted in the last moment. Their &amp;quot;product&amp;quot; was an idea consisting of a couple of fake powerpoint presentations that contained no actual information what-so-ever and a wrapped book that ought to represent an eBook-like thing.&lt;/p&gt;&#xA;&lt;p&gt;So actually all you learn from doing those projects is how to produce professional-looking &lt;strong&gt;bullshit&lt;/strong&gt;. Not less but not more either. It&#39;s sad and pathetic and the PR crowd probably cheers for they have taught a new generation that you can quite probably sell shit if it&#39;s only gift-wrapped nicely enough.&lt;/p&gt;&#xA;&lt;p&gt;My opinion might be a too pessimistic one but I&#39;ve gone through the actual project week and felt pathetic, attended two nominations for the project a few months ago - first the state-wide nomination of the best projects in Bavaria (was sometime in October) and we were placed third - in your face, guy from above! - and then the federal nomination in Berlin (it took place last December) and we even won first place (with two other schools) and I still felt very pathetic and both times my main thought was &amp;quot;what the fuck? why are we rewarded anything for this fake crap?&amp;quot; (our school won some good money by the way).&lt;/p&gt;&#xA;&lt;p&gt;Moreover the whole nominations were crap, too. They were meant to be &amp;quot;innovation fairs&amp;quot; (another crappy name, but I simply want to convey the bad wording of the German expressions they used) and the one in Bavaria was a run-away joke - a fair of 5 teams presenting 5 bad ideas and the winners were already chosen beforehand, so it didn&#39;t matter at all. And it was sponsored by Wrigleys - I must mention this because we&#39;re shown a Wrigleys&#39; video and a Wrigleys representative was there and talked and the big nomination in Berlin wasn&#39;t better either. That one was sponsored by Vodafone and two other companies (&lt;em&gt;sorry I didn&#39;t listen this time at all&lt;/em&gt;) and this time there were maybe 15 teams and it was possible to win an audience award - at least we were told.. In the end it turned out that the audience award really wasn&#39;t determined by the audience but by the groups themselves because in the final gathering before or after the sponsors talked each group&#39;s name and idea would be mentioned and the ones who clapped and cheered the loudest would win. I shouldn&#39;t mention they only had one microphone for measuring the noise level and it was in the front at the stage and as incredible as it may sound the group who sat in front - won - &lt;em&gt;oh my god, what a surprise!&lt;/em&gt; But kudos to the group who came up with the whole fair scheme (except for the clapping idea it was mostly great) and also kudos to &lt;a href=&#34;http://www.ifok.de/en/&#34;&gt;IFOK &lt;/a&gt; for out-sourcing that to students, too.&lt;/p&gt;&#xA;&lt;p&gt;The secretary for families and youth even talked at the federal nomination and congratulated us for being a new elite and the innovators of the future in Germany. So instead of actually encouraging real research and real projects they make us participate in a project that will at best help us to obtain credits by false pretenses later in our lives... but of course, you can argue that you should foster both (actual research and presentations of it) but I&#39;m still shocked by the opinions of some students who participated and simply think that they actually are great because of it.&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br/&gt; Andreas&lt;/p&gt;&#xA;&lt;p&gt;But now I&#39;ve ranted enough about it (and I want to finally get it posted)&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sat, 19 Jan 2008 00:57:25 +0000</pubDate>
    </item>
    <item>
      <title>Nice Comparison of Free-Software Shooters</title>
      <link>http://blog.blackhc.net/2007/12/nice-comparison-of-free-software-shooters/index.html</link>
      <description>&lt;p&gt;On &lt;a href=&#34;http://www.linux-gamers.net/smartsection.item.81/comparison-of-free-software-shooters.html&#34; class=&#34;uri&#34;&gt;http://www.linux-gamers.net/smartsection.item.81/comparison-of-free-software-shooters.html&lt;/a&gt; you can find a very nice comparison, which is pretty extensive and to my shame I have to admit that I haven&#39;t played many of them - I really ought to try War§ow soon.&lt;/p&gt;&#xA;&lt;p&gt;Nexuiz gets a pretty good review (&lt;em&gt;in your face, AlienArena :P)&lt;/em&gt; but still note:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;While most of the game is cleaned up far beyond its Quake 1 roots, it is still lacking in presentation with &lt;strong&gt;the menu being very circa 1990s&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;em&gt;/me sighs&lt;/em&gt;&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Mon, 31 Dec 2007 14:41:28 +0000</pubDate>
    </item>
    <item>
      <title>This Evening&#39;s Worklog</title>
      <link>http://blog.blackhc.net/2007/12/this-evenings-worklog/index.html</link>
      <description>&lt;p&gt;Today I&#39;ve decided to work on BSS again - &lt;strong&gt;&lt;em&gt;finally&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;And I&#39;ve even come up with a few neat bullet points to help me clean-up the codebase and I really feel like sharing them with the world today (&lt;em&gt;although everybody can come up with them in a few minutes, too, but &lt;strong&gt;hey&lt;/strong&gt; - now I can say that you&#39;ve only copied my thoughts &lt;strong&gt;:-P&lt;/strong&gt;):&lt;/em&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;h4 id=&#34;how-to-fix-and-clean-up-stuff-quickly&#34;&gt;How to fix and clean-up stuff quickly:&lt;/h4&gt;&#xA;&lt;h5 id=&#34;what-do-i-want&#34;&gt;What do I want?&lt;/h5&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;remove unnecessary code&lt;/li&gt;&#xA;&lt;li&gt;clean-up the design&lt;/li&gt;&#xA;&lt;li&gt;untangle tight couplings&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;How do I do that???&lt;/p&gt;&#xA;&lt;h4 id=&#34;hack-polish&#34;&gt;Hack &amp;amp; Polish&lt;/h4&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;look at a specific code section&lt;/li&gt;&#xA;&lt;li&gt;rewrite it quickly while keeping the behavior the same&lt;/li&gt;&#xA;&lt;li&gt;don&#39;t look at the overall design concepts - &lt;strong&gt;to KISS&lt;/strong&gt; (to keep it simple &lt;em&gt;STUPID&lt;/em&gt;)_&lt;/li&gt;&#xA;&lt;li&gt;as soon as the new code actually seems to &lt;em&gt;work&lt;/em&gt;, go and &lt;strong&gt;polish&lt;/strong&gt; it slightly (to make it readable again)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Repeat these steps a few times..&lt;/p&gt;&#xA;&lt;p&gt;Now look at the &lt;em&gt;&amp;quot;overall picture&amp;quot;&lt;/em&gt; and try to identify common patterns and remove duplicate code again by writing generic helper code - &lt;strong&gt;but this time keep it decoupled and make it less messy!&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Rinse and repeat...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;OK... sounds great? Yes, it does! And it even works to some degree. I&#39;ve tried it this evening and although I - &lt;em&gt;like always :-( &lt;/em&gt;- lose too much time browsing around and getting lost in the WWW, I still made some progress.&lt;/p&gt;&#xA;&lt;p&gt;Here&#39;s my worklog as proof (and to tease Joshua a bit ;-P):&lt;/p&gt;&#xA;&lt;table&gt;&#xA;&lt;tr&gt;&#xA;&lt;td&gt;&#xA;18:32&#xA;&lt;/td&gt;&#xA;&lt;td&gt;&#xA;starting to work on BSS&#39;s cleanup&#xA;&lt;/td&gt;&#xA;&lt;/tr&gt;&#xA;&lt;tr&gt;&#xA;&lt;td&gt;&#xA;19:20&#xA;&lt;/td&gt;&#xA;&lt;td&gt;&#xA;removed some Sploidz-specific code from the items module&#xA;&lt;/td&gt;&#xA;&lt;/tr&gt;&#xA;&lt;tr&gt;&#xA;&lt;td&gt;&#xA;20:00&#xA;&lt;/td&gt;&#xA;&lt;td&gt;&#xA;removed more files, tracked down Joshua&#39;s new coder (wtf didnt he tell me?!?) and found out that two files were missing in the SVN repository (added them from a backup that I have with me here)&#xA;&lt;/td&gt;&#xA;&lt;/tr&gt;&#xA;&lt;tr&gt;&#xA;&lt;td&gt;&#xA;20:30&#xA;&lt;/td&gt;&#xA;&lt;td&gt;&#xA;changed bits of EventFSM and t2dFSM&#xA;&lt;/td&gt;&#xA;&lt;/tr&gt;&#xA;&lt;tr&gt;&#xA;&lt;td&gt;&#xA;21:00&#xA;&lt;/td&gt;&#xA;&lt;td&gt;&#xA;reworking BlockItem&#xA;&lt;/td&gt;&#xA;&lt;/tr&gt;&#xA;&lt;tr&gt;&#xA;&lt;td&gt;&#xA;21:45&#xA;&lt;/td&gt;&#xA;&lt;td&gt;&#xA;BlockItem now uses a FSM&#xA;&lt;/td&gt;&#xA;&lt;/tr&gt;&#xA;&lt;tr&gt;&#xA;&lt;td&gt;&#xA;22:45&#xA;&lt;/td&gt;&#xA;&lt;td&gt;&#xA;BlockGame now is decoupled from Grid (gamelogic-wise) and BlockItem from BaseItem (the latter might be reverted later though)&#xA;&lt;/td&gt;&#xA;&lt;/tr&gt;&#xA;&lt;tr&gt;&#xA;&lt;td&gt;&#xA;23:00&#xA;&lt;/td&gt;&#xA;&lt;td&gt;&#xA;trying to rewrite BlockGame&#39;s setupItem function again but deciding that it&#39;s pretty late&#xA;&lt;/td&gt;&#xA;&lt;/tr&gt;&#xA;&lt;/table&gt;&#xA;&lt;p&gt;Enough for today. One more Dexter episode for me now (actually the first today) and then good night!&lt;/p&gt;&#xA;&lt;p&gt;Good night,&lt;br/&gt; Black&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Tue, 25 Dec 2007 22:21:16 +0000</pubDate>
    </item>
    <item>
      <title>Blender2md5 Exporter</title>
      <link>http://blog.blackhc.net/2007/12/blender2md5-exporter/index.html</link>
      <description>&lt;p&gt;&lt;em&gt;Update: I&#39;ve (sadly) worked on it some more today and there&#39;s a new version online. You can find it on icculus:&lt;/em&gt; &lt;a href=&#34;http://svn.icculus.org/darkwar/trunk/base/scripts/&#34; class=&#34;uri&#34;&gt;http://svn.icculus.org/darkwar/trunk/base/scripts/&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;/images/2007-12-23-blender2md5-exporter/blender2md5_new.jpg&#34; /&gt; &lt;img src=&#34;/images/2007-12-23-blender2md5-exporter/blender2md5_newnew.jpg&#34; alt=&#34;Latest interface&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;For the past 4 days I&#39;ve been working on and off on some changes to der_ton&#39;s blender2md5 exporter - &lt;em&gt;&lt;strong&gt;big thanks to him for developing the exporter in the first place&lt;/strong&gt;&lt;/em&gt; - and in doing so I&#39;ve finally learnt &lt;a href=&#34;http://www.python.org/&#34;&gt;Python&lt;/a&gt;, which is an &lt;strong&gt;awesome&lt;/strong&gt; scripting language to say the least.&lt;/p&gt;&#xA;&lt;p&gt;I haven&#39;t really changed much of the exporter&#39;s internal workings (only a few clean-ups here and there which hopefully didn&#39;t break it) because I mainly concentrated on GUI changes. &lt;em&gt;fleeky&lt;/em&gt;, a nice circus fellow who is DarkWar&#39;s only active modeller at the moment, pestered me long enough to add support for exporting multiple animations from &lt;a href=&#34;http://www.blender.org/&#34;&gt;Blender&lt;/a&gt; to md5, that I finally gave in and started working.&lt;/p&gt;&#xA;&lt;p&gt;Thank God, Python&#39;s &lt;a href=&#34;http://wiki.python.org/moin/BeginnersGuide/Programmers?highlight=%28BeginnersGuide%2F%29&#34;&gt;tutorial page&lt;/a&gt; is excellent, too - especially &lt;a href=&#34;http://www.poromenos.org/tutorials/python?&#34;&gt;&#39;Learn Python in 10 Minutes&#39;&lt;/a&gt;, which really does a very good job at showing you many language features very fast - which arguably isn&#39;t useful for total newbies but it gives a nice overview and invites you to play around.. and is &lt;strong&gt;really&lt;/strong&gt; helpful when you start to code because you already know about some &amp;quot;advanced&amp;quot; language features early-on and can look them up when you think that they might help you solve a problem more elegantly (in contrast to not knowing about the features at all).&lt;/p&gt;&#xA;&lt;p&gt;Another tip for Python beginners: get &lt;a href=&#34;http://www.activestate.com/Products/activepython/&#34;&gt;ActivePython&lt;/a&gt; and &lt;a href=&#34;http://www.activestate.com/Products/komodo_edit/&#34;&gt;Komodo Edit&lt;/a&gt; (or even the IDE if you have the money and/or are a student and willing to go through their registration process, which I might if I&#39;ll happen to work more with Python). Both are free and will get you started with Python coding quickly. They really helped me a lot while learning and coding the new features.&lt;/p&gt;&#xA;&lt;p&gt;Anyway, so what did I code? First let&#39;s take a look at the original exporter interface:&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/overflow/blender2md5_old.jpg&#34; alt=&#34;Old blender2md5 Interface&#34; /&gt;&lt;figcaption&gt;Old blender2md5 Interface&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;My first changes were about adding a simple batch system that allows you to set the properties for one animation and mesh to export and then specify a batch file and append them to it. Then you can export all &amp;quot;jobs&amp;quot; from the specified batch file or directly specify it and export from it:&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/overflow/blender2md5_oldnew.jpg&#34; alt=&#34;Interface with first change set&#34; /&gt;&lt;figcaption&gt;Interface with first change set&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;This was ok but it didn&#39;t feel that nice - since you&#39;d have to manually edit the batch file if you wanted to change export properties, etc.&lt;/p&gt;&#xA;&lt;p&gt;Today then I&#39;ve decided to spend one last day on the project and rewrite most of the GUI: it now displays all default buttons at the bottom and allows one to insert as many animations to export as one wishes. It displays the animations each with their own target filename, start and end frame and action dropdown menu in a table and now also exports all other settings to settings files (batch files don&#39;t really describe it correctly). Even better I&#39;ve added support for automatically saving the settings to Blender&#39;s .blend files which should really help automate exporting a lot.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Just open the scene file, open the plugin, hit export and you&#39;re done!&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Right now I have disabled (commented out) exporting camera animations because they don&#39;t really fit anymore, but if there&#39;s a need for them, I&#39;ll put them back in).&lt;/p&gt;&#xA;&lt;p&gt;And finally, here&#39;s the new interface:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;/images/2007-12-23-blender2md5-exporter/blender2md5_new.jpg&#34;&gt;&lt;img src=&#34;/images/2007-12-23-blender2md5-exporter/blender2md5_new.jpg&#34; alt=&#34;New Blender2md5 Interface&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Give a try. You can find the python script in Darkwar&#39;s repository: &lt;a href=&#34;http://svn.icculus.org/darkwar/trunk/base/scripts/&#34; class=&#34;uri&#34;&gt;http://svn.icculus.org/darkwar/trunk/base/scripts/&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Mirrored for now at: &lt;a href=&#34;http://home.in.tum.de/~kirschan/blender2md5.py&#34; class=&#34;uri&#34;&gt;http://home.in.tum.de/~kirschan/blender2md5.py&lt;/a&gt; (out-dated but I&#39;m leaving it in case icculus.org is down again and someone badly needs a mostly working exporter)&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Either copy it into your Blender plugin directory or manually open it in Blender&#39;s text editor and run it with Alt/Meta-P.&lt;/p&gt;&#xA;&lt;p&gt;Enjoy and Merry Christmas!&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sun, 23 Dec 2007 22:44:52 +0000</pubDate>
    </item>
    <item>
      <title>Alientrap Application Email</title>
      <link>http://blog.blackhc.net/2007/12/alientrap-application-email/index.html</link>
      <description>&lt;p&gt;Funny, I&#39;ve just found the original email (at least the text) that I&#39;ve sent to Lee Vermeulen when I applied at Alientrap after I saw a screenshot of Nexdm something on flipcode - &lt;em&gt;RIP&lt;/em&gt; :-(&lt;/p&gt;&#xA;&lt;p&gt;Note that this dates back to: Saturday, 23. August 2003, 19:25:14&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;I&#39;ll just tell the truth :&lt;/p&gt;&#xA;&lt;p&gt;I&#39;m almost 16 years old and live in Germany, but I do understand matrices, etc. I have 8 years of programming experience but only 2 in c/c++. I just learnt OpenGL, so don&#39;t expect me to be a John Carmack.&lt;/p&gt;&#xA;&lt;p&gt;Now let&#39;s get to the positive aspects. I want to learn, learn, learn - so give me a problem and I&#39;ll work until I&#39;ve got a solution. Math is not a problem to me, I like it pretty much (especially when I finished calculating some formula).&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve got a adsl flatrate, so I can always search the internet for additional informations.&lt;/p&gt;&#xA;&lt;p&gt;Perhaps I could be tester, or help finding bugs, etc., until I learnt more opengl and other programming technics.&lt;/p&gt;&#xA;&lt;p&gt;Sincerely yours, Andreas Kirsch&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Also observe the cute mistakes - which I&#39;m still making today, too &lt;strong&gt;&amp;gt;_&amp;gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;But anyway, there were &lt;em&gt;&lt;strong&gt;forty&lt;/strong&gt;&lt;/em&gt; applicants and only three &#39;&lt;em&gt;who survived the &amp;quot;look at the code and try to implement one of the features on the TODO list&amp;quot; test, out of 40+ applicants?&lt;/em&gt;&#39; (&lt;em&gt;LordHavoc&lt;/em&gt; in IRC). Two of them got jobs in the game industry shortly afterwards, so I was the &lt;em&gt;only one&lt;/em&gt; left out of 40 applicants!&lt;/p&gt;&#xA;&lt;p&gt;Well guys (the 37 of them), you clearly suck, &lt;strong&gt;because you didn&#39;t even try&lt;/strong&gt;. I have tried and although LordHavoc pretty much dismissed all of my changes as useless or not committable in the beginning, I still got onto the team and I honestly have never regretted it.&lt;/p&gt;&#xA;&lt;p&gt;So always: &lt;strong&gt;try your best, even if it looks as if you&#39;re failing, because you&#39;re not the only one and your attempt already is a success compared to simply giving-up up-front!&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Now enough of that, enjoy your weekend!&lt;/p&gt;&#xA;&lt;p&gt;Greetings,&lt;br/&gt; Black&lt;/p&gt;&#xA;&lt;p&gt;PS: Always a nice read - &lt;a href=&#34;http://www.thejonjones.com/2005/08/24/smart-people-are-dumb-failure-is-awesome/&#34; class=&#34;uri&#34;&gt;http://www.thejonjones.com/2005/08/24/smart-people-are-dumb-failure-is-awesome/&lt;/a&gt;&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Fri, 07 Dec 2007 20:06:48 +0000</pubDate>
    </item>
    <item>
      <title>xkcd \o/</title>
      <link>http://blog.blackhc.net/2007/12/xkcd-o/index.html</link>
      <description>&lt;figure&gt;&#xA;&lt;img src=&#34;http://imgs.xkcd.com/comics/just_alerting_you.jpg&#34; /&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;Today I was waiting for the care-taker to arrive and take a look at some installation issues and while I was waiting I decided to browse a bit around in xkcd. And well... there are a few links that might worth sharing - &lt;em&gt;and I&#39;m not going to link &lt;a href=&#34;http://xkcd.com/231&#34;&gt;&lt;strong&gt;Cat Proximity&lt;/strong&gt;&lt;/a&gt; again this time!&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;And here are the other ones that I&#39;ve found interesting while randomly browsing through the archive:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://xkcd.com/167/&#34;&gt;Nihilism&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://xkcd.com/306/&#34;&gt;Orphaned Projects&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://xkcd.com/65/&#34;&gt;Banter&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://xkcd.com/83/&#34;&gt;Katamari&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://xkcd.com/15/&#34;&gt;Just Alerting You (the one I&#39;ve directly linked above)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;So enough of that, there&#39;s more work to be done!&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br/&gt; Black&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Fri, 07 Dec 2007 11:48:42 +0000</pubDate>
    </item>
    <item>
      <title>I have a problem that I cannot explain - I have no reason why it should have been so plain...</title>
      <link>http://blog.blackhc.net/2007/12/i-have-a-problem/index.html</link>
      <description>&lt;p&gt;I have a problem and a solution, but the problem is nice, so lemme tell you about it first.. The problem is as follows:&lt;/p&gt;&#xA;&lt;p&gt;We have got &lt;em&gt;&lt;strong&gt;31&lt;/strong&gt;&lt;/em&gt; tracks and &lt;em&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;/em&gt; trains, Each train is so big, that between two there needs to be at least one free track. Now, how many valid combinations do exist to place the 10 trains on the 31 tracks?&lt;/p&gt;&#xA;&lt;p&gt;Read on if you think that you have got the solution and want to compare it with mine (no guarantee that I&#39;ve got it right though..)&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xA;&lt;h1 id=&#34;my-solution&#34;&gt;My solution:&lt;/h1&gt;&#xA;&lt;p&gt;A valid combination needs to have the remaining &lt;strong&gt;31 - 10 = 21&lt;/strong&gt; tracks (after the trains have been placed) distributed between the trains in such a way, that there is at least one (free) track between two trains.&lt;/p&gt;&#xA;&lt;p&gt;If &lt;strong&gt;&lt;em&gt;s_0, ..., s_10&lt;/em&gt;&lt;/strong&gt; represent the number of free tracks between two trains, respectively for &lt;strong&gt;&lt;em&gt;s_0&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;s_10&lt;/em&gt;&lt;/strong&gt; between the outer most trains and the outside world, then &lt;em&gt;&lt;strong&gt;s_0, s_10 &amp;gt;= 0&lt;/strong&gt;&lt;/em&gt; and &lt;strong&gt;&lt;em&gt;s_1, ... ,s_9 &amp;gt;= 1&lt;/em&gt;&lt;/strong&gt; (for a valid combination). Now we can add two tracks left and right that may not be used, so that we can then require &lt;em&gt;&lt;strong&gt;s_0, s_10 &amp;gt;= 1&lt;/strong&gt;&lt;/em&gt;, too. That is &lt;em&gt;&lt;strong&gt;21+2=23&lt;/strong&gt;&lt;/em&gt; tracks distributed on &lt;strong&gt;&lt;em&gt;11&lt;/em&gt;&lt;/strong&gt; (s_0 to s_10) numbers, and each needs to be &lt;strong&gt;&lt;em&gt;&amp;gt;= 1&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Have you heard of &lt;strong&gt;&lt;em&gt;ordered number partitions&lt;/em&gt;&lt;/strong&gt;? An ordered number partition is a partition of a (natural) number &lt;strong&gt;&lt;em&gt;n&lt;/em&gt;&lt;/strong&gt; into &lt;strong&gt;&lt;em&gt;k&lt;/em&gt;&lt;/strong&gt; (natural) numbers, so that the sum of those k numbers is equal to n, and because natural numbers are greater 0, all numbers have to be at least 1.&lt;/p&gt;&#xA;&lt;p&gt;If you want to determine the count of possible partitions, you can imagine it as sum of n 1s: 1 + 1 + 1 + 1 + ... + 1&lt;br/&gt; That is: &lt;em&gt;n&lt;/em&gt; &lt;strong&gt;1&lt;/strong&gt;s and n-1 &#39;&lt;em&gt;&lt;strong&gt;+&lt;/strong&gt;&lt;/em&gt;&#39; signs. We can now group the sum into k sub-sums by selecting &lt;strong&gt;&lt;em&gt;k - 1&lt;/em&gt;&lt;/strong&gt; &lt;code&gt;+&lt;/code&gt; signs and separate the sum into sub-sums at that position. E.g.:&lt;br/&gt; 1 + 1 + 1 + 1 + 1 + 1 divided in 3 sub-sums: &lt;strong&gt;( 1 + 1 + 1 ) + 1 + ( 1 + 1 )&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;The number of selecting &lt;em&gt;&lt;strong&gt;k - 1&lt;/strong&gt;&lt;/em&gt; &lt;code&gt;+&lt;/code&gt; signs out of &lt;em&gt;&lt;strong&gt;n - 1&lt;/strong&gt;&lt;/em&gt; is simply the binomial coefficient of &lt;em&gt;&lt;strong&gt;&lt;span class=&#34;math inline&#34;&gt;\(\binom {n - 1} {k - 1}\)&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;!&lt;/p&gt;&#xA;&lt;p&gt;So with our numbers we get: &lt;em&gt;&lt;strong&gt; = 22 10 = 646646&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;\o/&lt;/p&gt;&#xA;&lt;p&gt;Excellent work, soldier!&lt;/p&gt;&#xA;&lt;p&gt;Cheers, Black&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Thu, 06 Dec 2007 22:32:25 +0000</pubDate>
    </item>
    <item>
      <title>Geckos here and Geckos there - Gecko&#39;s everywhere!</title>
      <link>http://blog.blackhc.net/2007/12/geckos-here-and-geckos-there-geckos-everywhere/index.html</link>
      <description>&lt;p&gt;Oh a new update and again it&#39;s going to be short - &lt;em&gt;probably or at least not proof-read....&lt;/em&gt;. Ok, so what about the last screenshot? Well a small update - with moving bits! /&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/2007-12-02-geckos-here-and-geckos-there-geckos-everywhere/geckokeyinjectiondemo.gif&#34; alt=&#34;Click it! -- Gecko in Darkplaces with text injection&#34; /&gt;&lt;figcaption&gt;Click it! -- Gecko in Darkplaces with text injection&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;This is nice, isn&#39;t it?&lt;/p&gt;&#xA;&lt;p&gt;And again this is for EDU2 - an undisclosed, well, maybe it&#39;s kinda disclosed now, but you still don&#39;t know what it is about, wannabe project after another wannabe project from the Univserity of Jena, which happen to work on with another very talented (&lt;em&gt;it seems!&lt;/em&gt;) programmer, who happens to work on Crystal Space, too (&lt;em&gt;hint hint..&lt;/em&gt;).&lt;/p&gt;&#xA;&lt;p&gt;For what it&#39;s worth at least I get to spend some time on DarkPlaces again which is a lot of fun because it feels like going to back your roots, since it all started with DarkPlaces more than 4(?!) years ago. &lt;em&gt;I can&#39;t believe it&#39;s already been that long ago, but that&#39;s life..&lt;/em&gt; So even if the project turns out be a failure (chances are 70% if you ask me - you&#39;ll get a more elaborate opinion soon), at least and this is the most importan, I work with LordHavoc on something again (semi-again since we only talk about design issues now and then but this is already an improvement). However, what is not an improvement but rather very very awkward, is that I&#39;m wasting so much time with it and actually I&#39;m really horribly neglecting a project (BSS) I&#39;ve been working on for Joshua, whom I owe more than just a lot. And I feel bad for it. Oh! How bad I feel! Which reminds me to spend the next days on his project and finally get something done again... On other news (or rather similar news) university (the one I actually attend in Munich) is killing my time, too - I have a 30+ hour week at university and add to that the time I have to spend on homework, lecture preparation and wrap-up and I have probably and quite certainly less spare time (it converges to minus zero) than my favo&lt;strong&gt;u&lt;/strong&gt;rite work-aholics at SplashDamage (yes, you even work on weekends!). Now with the additional projects this actually results in severe sleep deprivation but, &lt;em&gt;well,&lt;/em&gt; that&#39;s been my choice and in February it&#39;ll be over for sure.&lt;/p&gt;&#xA;&lt;p&gt;So... now I&#39;ve been talking and writing a lot of thoughts down and I think that&#39;s enough for today. More news and screenshots from our multi-touch-screen thingy and &lt;strong&gt;BSS(!)&lt;/strong&gt; soon.&lt;/p&gt;&#xA;&lt;p&gt;Stay awake and tuned,&lt;br/&gt; Black&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Sun, 02 Dec 2007 22:53:53 +0000</pubDate>
    </item>
    <item>
      <title>Puzzle Piece #1</title>
      <link>http://blog.blackhc.net/2007/11/puzzle-piece-1/index.html</link>
      <description>&lt;p&gt;Ok, lately I didn&#39;t have enough time to update this blog and right now I&#39;m still busy with uni and other stuff. What I refer to with &amp;quot;other stuff&amp;quot; is for example:&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/2007-11-28-puzzle-piece-1/geckodp2.jpg&#34; alt=&#34;One of the first screenshots with Gecko support in Darkplaces.&#34; /&gt;&lt;figcaption&gt;One of the first screenshots with Gecko support in Darkplaces.&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;or:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://vpod.tv/loiclemeur/135867&#34; class=&#34;uri&#34;&gt;http://vpod.tv/loiclemeur/135867&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;BTW does anyone want Torque support for Gecko, too? ;-)&lt;/p&gt;&#xA;&lt;p&gt;Anyway, more updates soon (hopefull).&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br/&gt; Black&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Wed, 28 Nov 2007 16:15:28 +0000</pubDate>
    </item>
    <item>
      <title>Oh floating-point comparisons, oh floating-point comparisons - why do you float above causality :(</title>
      <link>http://blog.blackhc.net/2007/10/oh-floating-point-comparison-why-do-you-float-above-causality/index.html</link>
      <description>&lt;p&gt;You know, actually I always wondered why people had problems with understanding why you need &lt;em&gt;epsilon tests&lt;/em&gt; for float comparisons: you simply lose precision when you calculate something because &lt;em&gt;floats&lt;/em&gt; aren&#39;t lossless and so you can&#39;t simply use &lt;code&gt;==&lt;/code&gt; to compare them, because chances are high that two floats that ought to be equal won&#39;t be equal bit-wise. Thus you use &lt;em&gt;epsilon tests&lt;/em&gt; instead and only check if both are almost the same (&lt;a href=&#34;http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm&#34;&gt;there are many techniques&lt;/a&gt; for this though).&lt;/p&gt;&#xA;&lt;p&gt;I think this concept is easily understandable, but what about comparisons for floats that are bit-wise equal?&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Yes, yes, yes! No, no, no!&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;So let&#39;s take a look at this code:&lt;/p&gt;&#xA;&lt;pre class=&#34;cpp&#34;&gt;&lt;code&gt;// Update Current Time.&#xA;mCurrentTime += elapsedTime;&#xA;&#xA;// Check if the animation has finished.&#xA;if (!mConfigDataBlock - &amp;gt; mAnimationCycle &amp;amp;&amp;amp; mCurrentTime &amp;gt;= mTotalIntegrationTime) {&#xA;    // Animation has finished.&#xA;    mAnimationFinished = true;&#xA;&#xA;    // Are we restoring the animation?&#xA;    if (mAutoRestoreAnimation) {&#xA;        // Yes, so play last animation.&#xA;        playAnimation(mLastAnimationName, false);&#xA;    } else {&#xA;        // No, so fix Animation at end of frames.&#xA;        mCurrentTime = mTotalIntegrationTime - (mFrameIntegrationTime * 0.5);&#xA;    }&#xA;}&#xA;&#xA;// Update Current Mod Time.&#xA;mCurrentModTime = mFmod(mCurrentTime, mTotalIntegrationTime);&#xA;&#xA;// Calculate Current Frame.&#xA;mCurrentFrameIndex = (S32)(mCurrentModTime / mFrameIntegrationTime);&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This is from TGB&#39;s &lt;strong&gt;&lt;code&gt;t2dAnimationController::updateAnimation&lt;/code&gt;&lt;/strong&gt; function. I had a very weird bug that caused an animation with 5 frames (base 0) and that shouldn&#39;t cycle to run through the following frames: &lt;code&gt;start/0 -&amp;gt; 1 -&amp;gt; 2 -&amp;gt; 3 -&amp;gt;0 -&amp;gt; 4/end&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Just so you know some initial conditions:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;mConfigDataBlock-&amp;gt;mAnimationCycle = false&lt;/code&gt;&lt;/strong&gt;, so &lt;strong&gt;&lt;code&gt;!mConfigDataBlock-&amp;gt;mAnimationCycle = true&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;mAutoRestoreAnimation = false&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;So obviously the if-block doesn&#39;t get executed for some unknown reason but the &lt;strong&gt;&lt;code&gt;mFmod&lt;/code&gt;&lt;/strong&gt; call still wraps the time around and the index jumps to 0 for one frame. Then &lt;strong&gt;&lt;code&gt;mCurrentTime&lt;/code&gt;&lt;/strong&gt; increases even more, the if-block gets executed and the time is reset to a value that makes it jump to the last frame (ie. it doesn&#39;t wrap now) and then the animations correctly ends.&lt;/p&gt;&#xA;&lt;p&gt;Now this sounds easy to fix and it is. Simply add an _epsilon test _and you&#39;re fine off and everything works correctly. But to make sure that I&#39;ve actually fixed the bug for the right reason, I did some more test runs with the original code and echoed the value of the floats to determine when the bug occured.&lt;/p&gt;&#xA;&lt;p&gt;The first little shock was: it echoed: &lt;code&gt;&amp;quot;3.00000 &amp;gt;= 3.00000&amp;quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xA;&lt;p&gt;But this is not bad, is it? It&#39;s simply the precision error in the float that causes it. The printing algorithm rounds it to a certain decimal for which both values are equal but actually they aren&#39;t, right?&lt;/p&gt;&#xA;&lt;p&gt;Well, so I changed the format string to &lt;em&gt;&lt;code&gt;&amp;quot;%f %f %u %u&amp;quot;&lt;/code&gt;&lt;/em&gt; and did a pointer conversion to output the integer representation of the two floats, too. They ought to be different now. But the output now was: &lt;em&gt;&lt;code&gt;&amp;quot;3.00000 3.00000 1050253722 1050253722&amp;quot;&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Which was very bad for my state of mind. I actually started the debugger and stepped through the function in the disassembler and somehow the greater than or equal comparison would fail to recognize &lt;strong&gt;bit-wise&lt;/strong&gt; equal floats as equal!&lt;/p&gt;&#xA;&lt;p&gt;The interesting thing was when I added an additional float comparison check a few lines above, the bug wouldn&#39;t happen anymore, so I&#39;ve found a Heisenbug. It gets even nastier: I don&#39;t know if you know any assembler, but maybe you have heard of the asm op &lt;strong&gt;&lt;code&gt;FINIT&lt;/code&gt;&lt;/strong&gt;, which resets the FPU state and all registers. Now if I add a &lt;strong&gt;&lt;code&gt;__asm { FINIT  }&lt;/code&gt;&lt;/strong&gt; right before the if-check the bug disappears, too.&lt;/p&gt;&#xA;&lt;p&gt;So it seems its an FPU bug. Some calculations that TGB performs confuse the FPU and it won&#39;t be in a valid state when the float comparison happens.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve also talked to other coders and general consensus was that you shouldn&#39;t really trust the FPU too much and always use epsilon tests (that is some redundancy) just to be on the safe side, because you can&#39;t really foresee the state of the FPU at any given time.&lt;/p&gt;&#xA;&lt;p&gt;TTimo has also mentioned, that the FPU state can be corrupted by other tasks and across task switches, too, so all I&#39;m really certain of now is that this all is some kind of Pandora&#39;s box that I don&#39;t want to open ever again...&lt;/p&gt;&#xA;&lt;p&gt;So to sum it up: always use epsilon checks and don&#39;t ask too many questions when your code breaks without (if it&#39;s possible), because you might not like what you will find out.&lt;/p&gt;&#xA;&lt;p&gt;Anyway, stay tuned,&lt;br/&gt; Black&lt;/p&gt;&#xA;&lt;p&gt;PS: I&#39;ve moved to Munich because of university and I&#39;m only at home on the weekends and only then I have continuous internet access, so updates might become rare again.&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Fri, 05 Oct 2007 21:46:56 +0000</pubDate>
    </item>
    <item>
      <title>GameStar&#39;s &#34;Enemy Territory: Quake Wars&#34; review</title>
      <link>http://blog.blackhc.net/2007/09/gamestars-enemy-territory-quake-wars-review/index.html</link>
      <description>&lt;p&gt;Ok, today I&#39;ve got a pretty unusual blog entry. If you&#39;re German and interested in computer games, then maybe you have read &lt;a href=&#34;http://www.gamestar.de/magazin/test/action/enemy_territory_quake_wars/1474102/enemy_territory_quake_wars.html&#34;&gt;this&lt;/a&gt; ETQW review. If not, well, it&#39;s a shame because you have possibly missed one very biased review that really shows gaming journalism at its best. Of course, I&#39;m not and can&#39;t be totally unbiased about the game, but see for yourself.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve taken the freedom to actually translate the whole article into English, so that the non-German speaking folks can enjoy this masterpiece of penmanship, too. It&#39;s not so much about the style though (because that surely was mostly lost in my translation), but about obvious mistakes and unfair reviewing... Enjoy!&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;(Oh before I forget it, this text is my very own translation, so while I&#39;ve tried my best to preserve the semantics, I might have failed and maybe accidentally removed some errors - also credits and kudos for this goes to our beloved GameStar and its writers... so if you don&#39;t like the translation it&#39;s all their fault :))&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;So how many errors did &lt;strong&gt;you&lt;/strong&gt; find?&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Cheers,&lt;br/&gt; BlackHC&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xA;&lt;h1 id=&#34;enemy-territory-quake-wars&#34;&gt;Enemy Territory: Quake Wars&lt;/h1&gt;&#xA;&lt;h2 id=&#34;splash-damagesic-mixes-the-complexity-of-battlefield-2-with-the-pace-of-quake---and-doesnt-satisfy-either-of-the-two-fan-bases-with-it.&#34;&gt;Splash Damage(sic) mixes the complexity of Battlefield 2 with the pace of Quake - and doesn&#39;t satisfy either of the two fan bases with it.&lt;/h2&gt;&#xA;&lt;p&gt;If you crossbreed a horse with a donkey, you get a mule - a quadruped, that has the advantages of both parents, because it is can be used as pack animal as well as a mount. If you crossbreed Battlefield with Quake, you get Enemy Territory: Quake Wars - a multiplayer shooter, that has the advantages of both parents, because.. Wait a second, exactly not! Because Splash Damage&#39;s attempt to merge two different multiplayer games with obviously different kinds of gaming experience has only been partially successful. And this disastrous crossbreeding is not the only issue the game is having.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-plot-slim&#34;&gt;The plot: slim&lt;/h2&gt;&#xA;&lt;p&gt;The developers didn&#39;t hold themselves up with an extensive background plot: The alien Strogg attack mankind and spawn conflicts all round the world. Similar to Battlefield each of the twelve maps tells a small bit of the story of the bigger conflict. Hence in &amp;quot;Valley&amp;quot; you have to keep the Strogg from contaminating the drinking water supplies of the American West coast. In &amp;quot;Island&amp;quot; the human forces have to shoot their way through a marvelous beach to the enemy base, steal important data and escape. And &amp;quot;Slipgate&amp;quot; sends you to a small African village, where you have to hack a Strogg slipgate and suddenly arrive at the opposite end of the world (see the box with the &amp;quot;example mission&amp;quot;).&lt;/p&gt;&#xA;&lt;p&gt;In doing so primarily the level design is convincing. The maps are diverse and some are spectacularly built - surprising what the developers could get out of the three years old Doom 3 graphics framework. Even more surprising that of all things all the interiors (you would think one of the engine&#39;s strengths) are designed rather dully, textured unsightly and lit weakly.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-heroes-plump&#34;&gt;The heroes: plump&lt;/h2&gt;&#xA;&lt;p&gt;No multiplayer shooter without classes. Quake Wars is no exception here. And has no surprises: The Soldier of the GDF and the Aggressor of the Strogg take heavy equipment into the battle, the Medic/Technician heal wounded teammates, the Engineer/Constructor repair damaged vehicles, the Field Ops/Oppressor deploy turrets[sic!] on the battlefield and the Covert Ops/Infiltrator shoot around with high precision weapons. Sounds like a system designed for teamwork, but it has issues because of design quirks. For instance you normally don&#39;t need a medic, because its faster to wait for respawn instead for the rescuing defibrillator.&lt;/p&gt;&#xA;&lt;p&gt;Because the team isn&#39;t punished for the death of a teammate with a deduction of points, there are hardly any heroic medics on the battlefield. The Field Ops of the GDF who helps his teammates with ammunition packs is also only of limited use for teamplay because you die very fast in combat as usual for quake games and thus you&#39;ll rarely run out of bullets anyway. While we&#39;re talking about dying: We would have appreciated more feedback about the origin of the final shot, too. It happens too seldom that you know why you&#39;re suddenly lying on the ground.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-missions-cool&#34;&gt;The missions: cool&lt;/h2&gt;&#xA;&lt;p&gt;The only sensible use for the classes are the cool missions that you need to complete in the course of a round. For instance only the sniper can hack a shield generator. This is necessary in &amp;quot;Valley&amp;quot; where a mobile command post (MCP) will only fire its missile at the Stroog base when the latter isn&#39;t protected by a shield anymore. To get the MCP into position, an engineer should be present to repair the defenseless machine after it has been damaged by enemy fire.&lt;/p&gt;&#xA;&lt;p&gt;This idea distinguishes Quake Wars from the usual flag capturing of a Battlefield 2 and pleasantly concentrates the action onto the currently important area of the map. In the process the developers have now and then overshot the mark. If for example the Strogg try to defend the branched tube system in &amp;quot;Sewer&amp;quot;, 32 players race around shooting at each other - not a bit of tactis or teamwork in there.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-weapons-not-cool&#34;&gt;The weapons: not cool&lt;/h2&gt;&#xA;&lt;p&gt;Quake Wars has everything from a machine rifle over a shotgun and a nailgun to the legendary railgun that should keep Quake fans happy. But the awesome weapon balancing of the original is painfully missing though. If you are playing as a Strogg for example and try to shoot through your scope, the zoom is pixelating everything for a moment before the view becomes clear again. In a fast paced game like Quake Wars this often already causes death. Generally all Strogg weapons seem weaker than their GDF counterparts. The railgun of the Infiltrator for example has a stronger recoil than the sniper rifle of the Covert Ops.&lt;/p&gt;&#xA;&lt;p&gt;A hint of tactics is creates by the extras: Especially the freely placeable and rotatable turrets are fun, particularly since some of them trigger super weapons like the ion laser[sic]. On the other hand lots of it is really uselss: The stationary camera for example was never needed because it doesn&#39;t have any advantages except for the small reconnaissance area and it takes too long to deploy. The mines are likewise only of limited use because you have to place them first and then activate them. In a game like Battlefield that tries to be realistic this would be sensible but in Quake Wars it doesn&#39;t suit the high speed of the game.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-vehicles-fast&#34;&gt;The vehicles: fast&lt;/h2&gt;&#xA;&lt;p&gt;On most of the maps a variety of land and air vehicles is available - from the unarmed but incredibly fast Quad to the Cyclops, a heavy armored Strogg mech. From outside all the vehicles look worse than in Battlefield 2. When you enter them though, you get to see the nicest cockpits of the genre. The driving experience is ok, too. The only exception is the tank of the GDF, whose mass you don&#39;t notice because of the mediocre game physics and the fact that is tossed around like a rubber ball, when it explodes.&lt;/p&gt;&#xA;&lt;p&gt;Apropos explosions: Especially on maps with lots of vehicles an exceellent combat experience is created. Debris is falling from sky, vehicles are exploding and it&#39;s cracking and Banging everywhere. A bit more work on the effects would have been nice though - the explosions look flat and hardly spectacular.&lt;/p&gt;&#xA;&lt;h2 id=&#34;score&#34;&gt;Score:&lt;/h2&gt;&#xA;&lt;h3 id=&#34;general-conclusion-although-we-miss-the-teamplay-experience-the-online-battles-are-still-fun.&#34;&gt;General Conclusion: Although we miss the teamplay experience, the online battles are still fun.&lt;/h3&gt;&#xA;&lt;h3 id=&#34;rating&#34;&gt;Rating:&lt;/h3&gt;&#xA;&lt;p&gt;&lt;strong&gt;Graphics:&lt;/strong&gt;&lt;br/&gt; + sharp textures&lt;br/&gt; + incredible view distance&lt;br/&gt; + good animations&lt;br/&gt; - partly sparsely detailed landscape&lt;br/&gt; - moderate effects&lt;br/&gt; - frame cap&lt;br/&gt; 8/10&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Sound:&lt;/strong&gt;&lt;br/&gt; + cracking explosions&lt;br/&gt; + good English voice actors&lt;br/&gt; - bad German voice actors&lt;br/&gt; - partly dull weapon sounds&lt;br/&gt; 8/10&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Balance&lt;/strong&gt;&lt;br/&gt; + maps are mostly balanced well&lt;br/&gt; - unfair bottlenecks&lt;br/&gt; - Strogg are a bit weaker than GDF&lt;br/&gt; 6/10&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Atmosphere&lt;/strong&gt;&lt;br/&gt; + nice battle atmosphere&lt;br/&gt; + gloomy end time scenario&lt;br/&gt; - teamwork experience is hardly building up&lt;br/&gt; - radio messages get annoying after some time&lt;br/&gt; 7/10&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;User Interface&lt;/strong&gt;&lt;br/&gt; + intuitive shooter controls&lt;br/&gt; + well arranged server browser&lt;br/&gt; + useful command map&lt;br/&gt; - fiddly quick chat&lt;br/&gt; 9/10&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Game Content&lt;/strong&gt;&lt;br/&gt; + 12 partly big maps&lt;br/&gt; + 3 game modes&lt;br/&gt; + 5 classes&lt;br/&gt; + numerous gameplay options&lt;br/&gt; 10/10&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Level Design&lt;/strong&gt;&lt;br/&gt; + very diverse&lt;br/&gt; + infantry and vehicle maps&lt;br/&gt; + pretty realistic settings&lt;br/&gt; - dull interiors&lt;br/&gt; 9/10&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Teamwork&lt;/strong&gt;&lt;br/&gt; + different missions for different classes&lt;br/&gt; - help is not rewarded&lt;br/&gt; - Medic/Technician and Field Ops/Oppressor are only of limited use&lt;br/&gt; 5/10&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Weapons &amp;amp; Extras&lt;/strong&gt;&lt;br/&gt; + big weapon selection for every need&lt;br/&gt; + cool turrets&lt;br/&gt; + popular Quake weapons&lt;br/&gt; - some extras are useless&lt;br/&gt; 9/10&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Multiplayer Modes&lt;/strong&gt;&lt;br/&gt; + more thrilling than usual flag capturing&lt;br/&gt; + difficult tasks&lt;br/&gt; - only stopwatch mode interesting for online matches&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;: Action-filled online shooting without teamplay experience (&lt;strong&gt;79%&lt;/strong&gt;)&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Wed, 26 Sep 2007 23:10:12 +0000</pubDate>
    </item>
    <item>
      <title>Game in a Day Event September &#39;07</title>
      <link>http://blog.blackhc.net/2007/09/game-in-a-day-event-september-07/index.html</link>
      <description>&lt;h3 id=&#34;the-game&#34;&gt;The Game&lt;/h3&gt;&#xA;&lt;p&gt;Oh dear, it&#39;s really been a while since I&#39;ve found time and will to write anything for this blog. But things change and I&#39;d like to write down a few things about this month&#39;s GID event.&lt;/p&gt;&#xA;&lt;p&gt;First, here&#39;s a cross-link to the GID&#39;s board: &lt;a href=&#34;http://www.gameinaday.net/viewtopic.php?t=122&#34; class=&#34;uri&#34;&gt;http://www.gameinaday.net/viewtopic.php?t=122&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Now the game is called &lt;strong&gt;Fireworks!&lt;/strong&gt; and it&#39;s about, well you might have guessed it, fireworks, but not really. I&#39;ve rather taken a more unrealistic approach and thought about what fireworks look like in cartoons, etc. There they often explode to some drawing or shape, which of course is pretty much impossible. But the idea is nice, and since I&#39;ve wanted to do some mouse-based/movement-based game, I thought that doing a firework-themed drawing game would be fun.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;/images/2007-09-17-game-in-a-day-event-september-07/screenshot4.jpg&#34; alt=&#34;Firework-themed game&#34; /&gt; See the screenshot on the right for what the firewor-theme looks like. You first draw over a shape that is shown and when you are finished the firework starts. You do this to collect as many points as possible to get into the highscore list (doesnt sound like duh?).&lt;/p&gt;&#xA;&lt;p&gt;The actual idea consisted of actually drawing stuff freely and mistakes would appear in the final firework, too, but I had to give up that idea because I couldn&#39;t get T2D to render particles at a certain quantity at low FPS, too, and I didn&#39;t want to use separate objects for it. Maybe the invalid strokes will come back , because I kind of like the idea of making invalid strokes more visible.&lt;/p&gt;&#xA;&lt;p&gt;The score system is pretty ok but the UI suffered because of the time constraint and isn&#39;t as dynamic as it should be, but you can get boni and multipliers for lots of things.&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/2007-09-17-game-in-a-day-event-september-07/screenshot1.jpg&#34; alt=&#34;Original brush-based approach&#34; /&gt;&lt;figcaption&gt;Original brush-based approach&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;Enough said, here&#39;s the link to the current final build (there might follow one with sounds later): &lt;a href=&#34;http://data.blog.blackhc.net/gid/0709/Fireworks!0.99.zip&#34; class=&#34;uri&#34;&gt;http://data.blog.blackhc.net/gid/0709/Fireworks!0.99.zip&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;And here&#39;s an excerpt from the readme:&lt;/p&gt;&#xA;&lt;h2 id=&#34;preliminary-stuff&#34;&gt;Preliminary Stuff&lt;/h2&gt;&#xA;&lt;p&gt;This is the almost or probably final version of Fireworks!, a GID game (15/16.9.2007).&lt;/p&gt;&#xA;&lt;p&gt;Pure dev time: 19 hours atm spanning from Saturday till Monday.&lt;/p&gt;&#xA;&lt;p&gt;The game is released as is, etc.&lt;/p&gt;&#xA;&lt;p&gt;Most of the source scripts are included, so you can take a look at a few bits pretty clean code midst very hackish stuff.&lt;/p&gt;&#xA;&lt;h2 id=&#34;about-the-game&#34;&gt;About the Game&lt;/h2&gt;&#xA;&lt;p&gt;It&#39;s pretty simple: You have to draw over the contours visible in each level to earn points and start/arrange the fireworks (that&#39;s pretty much the story).&lt;/p&gt;&#xA;&lt;p&gt;The score system is pretty simple: The longer you stay on a contour (the cursor trail is cyan), the more points you get, and after many points in a row, you receive a power multiplier as reward. Likewise, if you draw fast enough over a part of a contour that hasnt been painted yet (purple at the beginning, green if you&#39;ve already drawn over it), you&#39;ll receive a speed multipier. Also if you manage to finish multiple contours with one, you&#39;ll get a combo multiplier.&lt;/p&gt;&#xA;&lt;p&gt;Each multiplier starts with x2 and increases if you draw accordingly.&lt;/p&gt;&#xA;&lt;p&gt;But be careful! The multipliers are only applied to the score of your stroke, when you release the mouse button! They add up and multiply your score: e.g. +1000 x + 2 + 2 means 1000 * (2+2). And if you miss a line or your mouse slips a bit and the cursor trail turns red, you&#39;ll lose the combo and the power multiplier (not the speed one, though)! So be careful and don&#39;t try to make too big a combo or draw too difficult a contour at once because you could lose lots of points...&lt;/p&gt;&#xA;&lt;p&gt;If you manage to paint a whole contour line with one stroke, it&#39;ll double your current score and also increment your combo multiplier. Same if you manage to paint all contour lines with only one stroke per line. Last but not least, one last word: there&#39;s a highscore and there are 5 levels at the moment. There is no game-over condition yet, so you can simply play through all levels and try to get a good highscore.&lt;/p&gt;&#xA;&lt;h2 id=&#34;post-mortem&#34;&gt;Post-mortem&lt;/h2&gt;&#xA;&lt;!-- more --&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Don&#39;t always get lost searching for some stupid tools that aren&#39;t really that necessary for the project&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Ok, this time I can&#39;t say that I did a lot of bad things, although I think I&#39;ve spent way too much time trying to find a good GIF animator to build the gif movies with (quite possibly 4-5 hours over the course of the last three days).&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Beware possible feature creep and rather try to cut and stay focused on the game vision&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Development itself went fairly smoothly although I almost got lost with the particle brush feature: I probably spent 3 hours on it, until I realized that it wouldn&#39;t work under the setting I&#39;ve been planning for it, and I had to refocus on the actual game instead of toying around with it some more.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Limit yourself on the engine and try to stay inside the game script side of things&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;I think it was a good decision to use vanilla TGB 1.1.3 (although I maybe should have tried working with 1.1.5 for this game) and not doing any engine changes, because it helped me concentrate on the important gameplay ideas instead of implementing everything cleanly and properly. Plus it kept me from debugging the engine at all. On the downside it again took me half an hour to remember the parameter passing bug in eval statements in vanilla TorqueScript and use the work-around in my code. Also the t2dPath implementation is horrible &lt;strong&gt;and buggy!&lt;/strong&gt; And I thank god, that it didn&#39;t blow up all the time and I was able to correct the mess ups with a text editor or simply recreate the level.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Be flexible about the game design and simply &lt;em&gt;keep it simple, stupid&lt;/em&gt; (again!)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The original game I envisioned isn&#39;t all that different from the outcome but it still is different enough that I wouldn&#39;t have imagined it to be this way. The design changed a fair bit with me making up my mind on it only Sunday morning (while showering). I spent most of Saturday night with feature proof-of-contest coding and setting up everything for the actual gameplay code. Being open to changes helped me a great bit, because I would simply adapt the game look and design to limitations (both time and feature), and keep on creating a playable game.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Try to reward the player with nice graphics and sounds&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;I think the visuals help the game a lot because you really rather play something that looks nice. At the same time it&#39;s a pity and a real problem that the game doesn&#39;t make use of any sounds or background music and this hurts it quite a lot.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Good/intelligent level design is even more important for small prototypes&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Another thing I only learnt a short while ago about is that the order of the levels (something I spent less than a minute on) had a huge implication on how the gameplay was perceived by players. Because the the first levels can be solved by making one continuous stroke, many players thought that this was the main task of the game and were confused when they played on. For me the level design simply was something to do half an hour before the planned release because I was only concerned with the code and showing that it works well, whereas actually the level design is more important than the code because only it determines how the game is viewed (fun or boring). I certainly have to spend more time and consideration on level design at the next GID.&lt;/p&gt;&#xA;&lt;p&gt;All in all though it went fairly well and even if the game might not be as much fun as it could have been, I still am of the opinion that it looks and play fairly professional for a game that has been produced in less than 20 manhours.&lt;/p&gt;&#xA;&lt;p&gt;That&#39;s it for today.&lt;br/&gt; Over and out,&lt;br/&gt; BlackHC&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Mon, 17 Sep 2007 23:15:57 +0000</pubDate>
    </item>
    <item>
      <title>Coroutines</title>
      <link>http://blog.blackhc.net/2007/07/coroutines/index.html</link>
      <description>&lt;p&gt;Have you ever heard of Coroutines? I haven&#39;t until a few months ago when digibob (from SplashDamage) mentioned them and explained to me what they are. Instead of pasting his explanation from my IRC logs, I&#39;ll instead quote Wikipedia:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;In computer science, coroutines are program components that generalize subroutines to allow multiple entry points and suspending and resuming of execution at certain locations.&lt;/p&gt;&#xA;&lt;p&gt;[...]&lt;/p&gt;&#xA;&lt;p&gt;Coroutines are more generic than subroutines. The start of a subroutine is the only point of entry; the start of a coroutine is the first point of entry, and places within a coroutine following returns (&lt;strong&gt;yields&lt;/strong&gt;) are subsequent points of entry. Subroutines can return only once; in contrast, coroutines can return (yield) several times. The lifespan of subroutines is dictated by &lt;a href=&#34;http://en.wikipedia.org/wiki/LIFO&#34;&gt;last in, first out&lt;/a&gt; (the last subroutine called is the first to return); in contrast, the lifespan of coroutines is dictated entirely by their use and need.&lt;/p&gt;&#xA;&lt;p&gt;(from &lt;a href=&#34;http://en.wikipedia.org/wiki/Coroutine&#34; class=&#34;uri&#34;&gt;http://en.wikipedia.org/wiki/Coroutine&lt;/a&gt;)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Let&#39;s continue with an (pseudo-code) example:&lt;/p&gt;&#xA;&lt;pre class=&#34;cpp&#34;&gt;&lt;code&gt;coroutine unsigned coFibbonacci() {&#xA;    unsigned a, b;&#xA;    a = 0;&#xA;    b = 1;&#xA;    while( 1 ) {&#xA;        unsigned c;&#xA;&#xA;        YIELD( b );&#xA;        c = a;&#xA;        a = b;&#xA;        b += c;&#xA;    }&#xA;}&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Calling coFibbonacci repeatedly would return the Fibonacci series. A more advanced example (which I won&#39;t paste here) would possibly consist of game scripts that control scripted sequences and always yield when waiting for operations to be performed, so that the control flow will look natural while basically being event-based. Usually one uses state machines in languages that don&#39;t support coroutines but an implementation using coroutines would be a lot more elegant.&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xA;&lt;p&gt;Many scripting languages have coroutine support,  like e.g. Python or Lua, while coroutines  are widely unsupported in most other &amp;quot;normal&amp;quot; languages (notable exception .NET). I have read some of the Python coroutine/generator specs in more detail to figure out some implementation details and the example code is also very neat to see the advantages of coroutines when traversing trees (for example) . In particular I&#39;ve read &lt;a href=&#34;http://www.python.org/dev/peps/pep-0255/&#34;&gt;PEP 255 - Simple Generators&lt;/a&gt; and &lt;a href=&#34;http://www.python.org/dev/peps/pep-0342/&#34;&gt;PEP 342 - Coroutines via Enhanced Generators&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Seeing all the advantages I wondered whether and how difficult it would be to implement basic coroutine support in C/C++. The answer depends on several factors. First of all it is possible to write an implementation that doesn&#39;t use evil setjmps or asm and that makes use of some C/C++ features in clever ways. My pure C/C++ implementation makes use of &lt;a href=&#34;http://en.wikipedia.org/wiki/Duff&amp;#39;s_device&#34;&gt;Duff&#39;s Device&lt;/a&gt; to implement multiple entry points and static variables to save the &amp;quot;locals&amp;quot; between calls.&lt;/p&gt;&#xA;&lt;p&gt;It&#39;s pretty small and simple:&lt;/p&gt;&#xA;&lt;pre class=&#34;cpp&#34;&gt;&lt;code&gt;#define YIELD( value )&#xA;   do {&#xA;      yieldIndex = __COUNTER__;&#xA;      return (value);&#xA;   case __COUNTER__ - 1:&#xA;      ;&#xA;   } while( 0 )&#xA;&#xA;#define RETURN( value )&#xA;   do {&#xA;      yieldIndex = -1;&#xA;      return (value);&#xA;   } while( 0 )&#xA;&#xA;#define COROUTINE( returnType, name )&#xA;   returnType name() {&#xA;       static int yieldIndex = -1;&#xA;       switch( yieldIndex ) {&#xA;          case -1:&#xA;&#xA;#define ENDCOROUTINE&#xA;         yieldIndex = -1;&#xA;      }&#xA;   }&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;PS: it should actually work with &lt;code&gt;__LINE__&lt;/code&gt; instead of &lt;code&gt;__COUNTER__&lt;/code&gt; and &lt;code&gt;__COUNTER__ - 1&lt;/code&gt; but VC somehow doesn&#39;t like it&lt;br /&gt;&#xA;PSS: the backslashes in the macro definitions were removed by Wordpress&lt;/p&gt;&#xA;&lt;p&gt;Recently my interest for coroutines has been renewed and I created a macro-based implementation that would allow multiple &amp;quot;generators&amp;quot; to be created and run in parallel. For this the stackframe of the coroutine had to be saved and restored later and normal locals instead of statics had to be used.&lt;/p&gt;&#xA;&lt;p&gt;The main issue with this implementation is that Duff&#39;s Device couldn&#39;t be used anymore since VC will correctly warn (and error out) that it is told to jump over local variable declarations - which of course would be very bad normally.&lt;/p&gt;&#xA;&lt;p&gt;Thus I had to write custom &lt;code&gt;__asm&lt;/code&gt; inline code to perform the jumps. Moreover when yielding the code has to jump over local deconstructors to avoid early clean-ups of the stackframe.&lt;/p&gt;&#xA;&lt;p&gt;This version is a lot bigger and because of the use of the &lt;code&gt;__asm&lt;/code&gt; keyword not very portable (although the asm code itself is very primitive and should run on any processor):&lt;/p&gt;&#xA;&lt;pre class=&#34;cpp&#34;&gt;&lt;code&gt;#define COROUTINE( returnType, name, paramList ) class name {&#xA;   size_t yieldOffset;&#xA;   void *stackCopy;&#xA;   size_t stackSize;&#xA;&#xA;public:&#xA;   name() : stackCopy( 0 ), stackSize( 0 ), yieldOffset( 0 ) {&#xA;   }&#xA;&#xA;   ~name() {&#xA;      /* this is something bad actually - it should always finish but oh well */&#xA;      if( stackCopy ) {&#xA;         delete stackCopy;&#xA;      }&#xA;   }&#xA;&#xA;   returnType operator() paramList {&#xA;      size_t __yieldExitOffset;&#xA;      __asm { mov __yieldExitOffset, offset yieldExit_##name }&#xA;      returnType __yieldReturnValue;&#xA;      char __frameStart;&#xA;&#xA;      if( stackCopy ) {&#xA;         /* restore the stack */&#xA;         memcpy( &amp;amp;__frameStart - stackSize, stackCopy, stackSize );&#xA;         size_t localYieldOffset = yieldOffset;&#xA;         __asm { jmp localYieldOffset }&#xA;      }&#xA;&#xA;#define CONCAT( a, b ) a ## b&#xA;#define LABEL( line ) CONCAT( __label__, line )&#xA;&#xA;#define YIELD( value ) do {&#xA;         char __frameEnd;&#xA;         /* copy the stack frame */&#xA;         if( stackCopy ) {&#xA;            delete stackCopy;&#xA;         }&#xA;         stackSize = &amp;amp;__frameStart - &amp;amp;__frameEnd;&#xA;         stackCopy = new char[ stackSize ];&#xA;         memcpy( stackCopy, &amp;amp;__frameEnd, stackSize );&#xA;&#xA;         __yieldReturnValue = (value);&#xA;         size_t localYieldOffset;&#xA;         __asm { mov localYieldOffset, offset LABEL( __LINE__ ) }&#xA;         yieldOffset = localYieldOffset;&#xA;         __asm { jmp __yieldExitOffset }&#xA;LABEL( __LINE__ ):&#xA;         ;&#xA;         } while( 0 )&#xA;&#xA;#define RETURN( value )&#xA;   do {&#xA;      /* remove the stack copy and clean up */&#xA;      if( stackCopy ) {&#xA;         delete stackCopy;&#xA;         stackCopy = 0;&#xA;         stackSize = 0;&#xA;      }&#xA;&#xA;      yieldOffset = 0;&#xA;      return (value);&#xA;   } while( 0 )&#xA;&#xA;#define ENDCOROUTINE( name )&#xA;yieldExit_##name:&#xA;      return __yieldReturnValue;&#xA;   } /* function done */&#xA;}; /* class done */&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;PSS: again backslashes were removed by Wordpress&lt;/p&gt;&#xA;&lt;p&gt;If you&#39;re interested in some example code, &lt;a href=&#34;http://data.blog.blackhc.net/weblog/coroutine_implementations.zip&#34;&gt;here&lt;/a&gt;&#39;s a zip with my VC 7.1 project.&lt;/p&gt;&#xA;&lt;p&gt;The only known and unfixable bug in the latest implementation is that it doesn&#39;t adapt pointers to local variables between yields (but for this real compiler-support would be needed).&lt;/p&gt;&#xA;&lt;p&gt;Greetings,&lt;br /&gt;&#xA;     Black&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Tue, 17 Jul 2007 22:01:35 +0000</pubDate>
    </item>
    <item>
      <title>Game in a Day Event (June &#39;07)</title>
      <link>http://blog.blackhc.net/2007/06/game-in-a-day-event-june-07/index.html</link>
      <description>&lt;p&gt;This weekend I&#39;ve participated for the first time in the GID event. The common task is to create a running game prototype in 24 hours (24 hours pure developement time + naps is allowed, too).&lt;/p&gt;&#xA;&lt;p&gt;I think it went well considering that this was my first participation but essentially I&#39;ve failed because my game prototype is nowhere near finished. It&#39;s rather at an early proof-of-concept stage instead...&lt;/p&gt;&#xA;&lt;p&gt;Let me introduce the prototype/game quickly - it has no name yet, so let us look at some screenshots instead:&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/2007-06-18-game-in-a-day-event-june-07/teaser.gif&#34; alt=&#34;Teaser&#34; /&gt;&lt;figcaption&gt;Teaser&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/2007-06-18-game-in-a-day-event-june-07/finallyWalking.gif&#34; alt=&#34;A running stickman&#34; /&gt;&lt;figcaption&gt;A running stickman&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;You see, it&#39;s about a stickman that can move. I&#39;m not going to go into more details yet because the game doesn&#39;t consist of much more right now. If you want to see a more interesting animation though, &lt;a href=&#34;http://data.blog.blackhc.net/gid/0706/Supercompressed_walkRunFrontDone_small.GIF&#34;&gt;click here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;For those interested here&#39;s a postmortem.&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xA;&lt;h3 id=&#34;postmortem&#34;&gt;Postmortem&lt;/h3&gt;&#xA;&lt;p&gt;The first problem arose right when I wanted to start: what should I code?&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve come up with a few different ideas the days before the GID started: a Zone66/Baryon remake (space-shooter like), a Prince of Persia remake and/or a platform game in general or a game which was consisted of drawing shapes with the mouse - &lt;em&gt;I&#39;ve played a few very neat games of this kind lately: &lt;a href=&#34;http://www.konjak.org/chalk.htm&#34;&gt;Chalk&lt;/a&gt; and &lt;a href=&#34;http://www.kloonigames.com/blog/games/crayon/&#34;&gt;Crayon Physics&lt;/a&gt;&lt;/em&gt; - and I felt that this was an idea that I&#39;d really love to explore but on the other hand I couldn&#39;t come up with an interesting and original gameplay idea.&lt;/p&gt;&#xA;&lt;p&gt;Beforehand I&#39;ve prepared a few things for a possible platform game. I really love stickman flash animations (for example the one &lt;a href=&#34;http://www.killsometime.com/animations/animation.asp?ID=135&#34;&gt;here&lt;/a&gt;) and thus I&#39;ve decided that a stickman would be the perfect protagonist, especially since it certainly is easy to create good-looking animations for him.&lt;/p&gt;&#xA;&lt;p&gt;Searching around with Google, I&#39;ve also found a very neat tool called &lt;a href=&#34;http://www.geocities.com/peter_bone_uk/pivot.html&#34;&gt;Pivot Stickfigure Animator&lt;/a&gt;, which allows one to easily create animations for stickfigures and other similar shapes and export them to animated GIFs.&lt;/p&gt;&#xA;&lt;p&gt;An idea I had Saturday morning was a game in which the stickman is running all the time and you have to do cool moves to avoid obstacles and maybe fight enemies. This should create tension and force the player to always pay attention while rewarding him with neat animations and fun gameplay. The feelings created in the players should be similar to those I felt when playing &lt;strong&gt;Prince of Persia: Warrior Within&lt;/strong&gt; when you&#39;re trying to escape from the time guardian - &lt;em&gt;I really love these parts of the game!&lt;/em&gt; - but at first I thought that the idea was not worth pursuing. Later though, Juz from #q3mods proposed the same gameplay idea and I told myself that this can&#39;t be a coincidence and decided to create my prototype based on it.&lt;/p&gt;&#xA;&lt;p&gt;So I&#39;ve only been able to come up with a good game idea late into Saturday afternoon while the others were already working on their games which is the first thing that went wrong: &lt;strong&gt;unsufficient preparation&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The next one was that I concentrated too much on creating art and sadly the results aren&#39;t stunning despite the time I&#39;ve spent on creating the animations. A reason for this could have been my horrible and most terrible art pipeline which looks like this: Pivot Animator -&amp;gt; GIF Constructor -&amp;gt; GIMP -&amp;gt; GIF Constructor -&amp;gt; GIMP -&amp;gt; TGB This couldn&#39;t be automated and every step had to be done by hand.&lt;/p&gt;&#xA;&lt;p&gt;After about 10 hours of work the game was &lt;a href=&#34;http://data.blog.blackhc.net/gid/0706/Supercompressed_newFeature.gif&#34;&gt;this&lt;/a&gt; far. I&#39;ve also lost quite some time (~2.5h) developing a movement cache system that wasn&#39;t used at all because the game never got far enough to support more complex moves and combos which is another thing that went wrong: &lt;strong&gt;wasting time on useless stuff&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;It also turned out that although I have already developed a few games in TGB I still didn&#39;t know some systems well enough (mainly collisions and physics) because I&#39;ve never coded a platform game before and I had to use trial&amp;amp;error quite frequently while implementing new features. Which leads to another thing that I could have done better: &lt;strong&gt;know your tools beforehand!&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;And last but not least, now that I&#39;m looking at my end-product, I realize that I haven&#39;t stayed with the simplistic gameplay idea I&#39;ve had in the beginning but instead diverged to a too complex game ; thus last two items on my list of stuff that went wrong are: &lt;strong&gt;violation of the KISS &lt;em&gt;(keep it simple, stupid!)&lt;/em&gt; principle and feature-creep.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;On the other hand there are a few things that went right, too: This is the first time I&#39;ve developed a game using rapid iterative development and it worked surprisingly well: hack a few features into the game first as fast as possible, then clean-up and refactor the code afterwards and repeat. (Normally I&#39;m attempting to write the clean version directly but this takes more planning.)&lt;/p&gt;&#xA;&lt;p&gt;Moreover I&#39;ve learnt many things about TGB I haven&#39;t known before and I&#39;ve grown even more fond of it as a game development system. And ultimately I&#39;m going to continue development of this game even after the GID&#39;s deadline because I really like my stickfigures.&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xA;&lt;p&gt;On other news I&#39;ve finally finished my A-Level exams and it seems that I&#39;ve really rocked them. Tomorrow I&#39;ll be allowed to take a look at the marking and hopefully that will explain why I got such good marks..&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Mon, 18 Jun 2007 22:02:33 +0000</pubDate>
    </item>
    <item>
      <title>About Code, Quality and General Hackability</title>
      <link>http://blog.blackhc.net/2007/05/about-code-quality-and-general-hackability/index.html</link>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;Good code is elegant.&lt;br /&gt;&#xA;Good code is short and to-the-point and offers the simplest solution to a certain problem.&lt;br /&gt;&#xA;Good code is easy to maintain and to understand.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;What is &lt;em&gt;good&lt;/em&gt; code??&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xA;&lt;p&gt;I&#39;ve always been trying to write the best possible code and I think in the past years I&#39;ve learnt quite a lot on how to write code that in my opinion is good code - mainly due to guidance from great books like Code Complete and Programming Pearls and from reading other&#39;s code (mostly id&#39;s) to see how they write their code and from reading other&#39;s to see how not to write code because it was hard to understand or a plain and utter ugly hack.&lt;/p&gt;&#xA;&lt;p&gt;There always comes a moment for every programmer now and then to go out of your regular thinking patterns and reflect about all the code that you have written and really evaluate its quality, its advantages and its disadvantages.&lt;/p&gt;&#xA;&lt;p&gt;The moment seems to be here right now for me.&lt;/p&gt;&#xA;&lt;p&gt;In general I really hope and believe that my coding style has evolved to the better in the last years but there is certainly a lot that I need to criticize if I&#39;m honest.&lt;/p&gt;&#xA;&lt;p&gt;The first and biggest point is that the code I&#39;m the most proud of seems barely readable and baffling to most of the coders I&#39;ve talked to &lt;em&gt;(- all of them to be honest).&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Why?&lt;/p&gt;&#xA;&lt;p&gt;The code I&#39;m the most proud of is elegant, works and I can extend it easily and after reading a few bits I quickly understand its design again. It also is very complex but it arguably does an at least moderate if not good job at dividing the problems into different subproblems, defining interfaces, separating everything from each other and so on &lt;em&gt;(see Code Complete for a list of things it tries to achieve and possibly achieves).&lt;/em&gt; The one thing it probably and quite certainly lacks is good documentation. I&#39;m not a fan of writing lots of documentation because code changes and updating comments is a tedious process you&#39;re often forget to do. This naturally leaves the readers of your code more confused than without misleading comments in the first place.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve been trying to make my code document itself - look at DarkWar&#39;s shell code to see what I mean: the function names are more than descriptive, the code reads like a book and it is its own flow diagram pretty much. Still people are frightened by it and most of Nexuiz&#39;s coders are scared by the menu system I&#39;ve written.&lt;/p&gt;&#xA;&lt;p&gt;The problem as I see it currently is, that although I haven&#39;t over-engineered the code, I certainly have taken too many measures to make it only work as intended. That is, the code will fail when you try to hack it - which in my opinion still should be a good thing, but apparently isn&#39;t.&lt;/p&gt;&#xA;&lt;p&gt;More precisely, the design doesn&#39;t allow one to add hacks, because it&#39;s so tight and so self-contained in its thought-model that there is only one way to make changes: make them correctly and have them fit the abstract design concept or if that doesn&#39;t work, change and adapt the whole model to your changes.&lt;/p&gt;&#xA;&lt;p&gt;I consider this great, since, if you know the design and the code, it prevents you from doing stupid things and provides an easy way to add features, since there are only correct ways to do it - albeit only few though.&lt;/p&gt;&#xA;&lt;p&gt;The problem with this is, however, that you need to allow other people to hack your code and try things, as this is the way most people seem to learn and understand new designs: (intelligent) Trial &amp;amp; Error until they find the right solution.&lt;/p&gt;&#xA;&lt;p&gt;If you don&#39;t, people will be scared by your code, because from their perspective it is like a brick wall that doesn&#39;t allow any changes to its structure.&lt;/p&gt;&#xA;&lt;p&gt;There are two solutions for this issue:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Tell people to read your code like a book first and then start to carefully change it, but this is what I&#39;ve been doing most of the time and it certainly doesn&#39;t seem to work&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Try to change your code to fail more gracefully and allow more hacks: soften pre- and post-conditions in functions, maybe weaken the design contracts, and so on. All in all: allow more holes in the code design.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;I don&#39;t like either solution to be honest, but I&#39;m still searching for a satisfying answer.&lt;/p&gt;&#xA;&lt;p&gt;I only know that writing code that allows hacks too easily is bug-prone and quite probably a hack-magnet and will lead to equal confusion among readers because of the lack of a strict (abstract) design (as was the case for me in some parts of DarkPlaces) and it makes coding-life - once you know the codebase - more difficult too, because you&#39;ll have to fix more bugs. Writing non-perfect code can turn out fine, too, though, as I&#39;ve experienced during Sploidz&#39;s development - some of the designs and parts of the code are a bit hacky but all in all it still leaves a good feeling when I&#39;m reading it and it has allowed for fast development - and Shelled&#39;s development - server-side mostly though since the client-side really needs a rewrite -, but one has to carefully measure every hack and loophole one allows.&lt;/p&gt;&#xA;&lt;p&gt;To sum it up before I write another ten pages, code has to be hackable and it shouldn&#39;t provide too much resistance against bad changes and hacks at first to let people toy around with ideas and get comfortable with the code but then it should still limit them to writing good code in general by making the hacks fail in the big picture, i.e. for small hacks it should work but if you want to make it work for real, you should need to do it right and the code should also point you towards it, that is, the code layout should offer a guidance for the changes you want to make.&lt;/p&gt;&#xA;&lt;p&gt;There is already lots of code out there that does this and also lots of code that is going to be released, so I hope that I&#39;ll find some more insight on this soon :)&lt;/p&gt;&#xA;&lt;p&gt;All this rant has been created from a simple insight while I was taking a break from learning for my A-level exams, and I hope that I&#39;ll be able to investigate this some more when I&#39;m done with my exams.&lt;/p&gt;&#xA;&lt;p&gt;Anyway, stay tuned,&lt;br /&gt;&#xA;Black&lt;/p&gt;&#xA;&lt;p&gt;PS: My first exam is in English, so this hopefully ought to be some good and valuable practice.&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Mon, 07 May 2007 21:08:44 +0000</pubDate>
    </item>
    <item>
      <title>Oh school oh presentations!</title>
      <link>http://blog.blackhc.net/2007/03/oh-school-oh-presentations/index.html</link>
      <description>&lt;p&gt;Again I&#39;ve been busy with school. I had to prepare a presentation about &lt;a href=&#34;http://en.wikipedia.org/wiki/Thomas_Bernhard&#34;&gt;Thomas Bernhard&lt;/a&gt; for German class and I&#39;ve spent the last 4 days in my room reading his books, that is &amp;quot;Gehen&amp;quot; and &amp;quot;Der Untergeher&amp;quot;, and reading his biography and reading more of both and creating a presentation that contained 60(!) slides in the end. Presenting took me awfully long - more than 70 minutes - but at least the teacher thought it was a fine. You can find an example of Thomas Bernhard &lt;strong&gt;&lt;a href=&#34;http://www.conjunctions.com/archives/c31-tb.htm&#34;&gt;here&lt;/a&gt;&lt;/strong&gt; (although the translation may be not that good).&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve uploaded the source and the presentation to my webspace.It released under FDL. You can find it &lt;a href=&#34;http://data.blog.blackhc.net/presentations/Thomas%20Bernhard%20Source.zip&#34;&gt;&lt;strong&gt;here&lt;/strong&gt;&lt;/a&gt;. Doing this I&#39;ve come to think that my other physics presentations might be worth uploading, too, so here they are:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;one about the Doppler effect: &lt;a href=&#34;http://data.blog.blackhc.net/presentations/doppler-effekt%20source.zip&#34;&gt;&lt;strong&gt;here&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;one about optical resolutions, telescopes and microscopes (that makes use of some nice java applets): &lt;a href=&#34;http://icculus.org/~black/presentations/%20Optisches%20Aufl%f6sungsverm%f6gen%20Source.zip&#34;&gt;&lt;strong&gt;here&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;They are all written in German. Anyway, I hope someone can use it or read it or like it. Fortunately I&#39;m going to work on some computer-related topics again now - although my A-levels exams will begin soon :(, but until then I&#39;ll try to code.&lt;/p&gt;&#xA;&lt;p&gt;Greetings,&lt;br /&gt;&#xA;Andreas&lt;/p&gt;&#xA;&lt;p&gt;PS: I&#39;ve also uploaded my entry for the BWM (Bundeswettbewerb Mathematik - this is a national math contest) in 2007. You can find it &lt;a href=&#34;http://data.blog.blackhc.net/weblog/BWM07.zip&#34;&gt;&lt;strong&gt;here&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Tue, 27 Mar 2007 16:29:22 +0000</pubDate>
    </item>
    <item>
      <title>Shelled Project Pages</title>
      <link>http://blog.blackhc.net/2007/03/shelled-project-pages/index.html</link>
      <description>&lt;p&gt;I&#39;ve finally found enough time to write a few things about &lt;a href=&#34;http://www.shelledgame.com/&#34;&gt;Shelled&lt;/a&gt; and put up a general TODO &lt;a href=&#34;http://http://blackhc.wordpress.com/projects/shelled-for-redthumbgames/&#34;&gt;Shelled info page&lt;/a&gt; and one describing &lt;a href=&#34;http://blackhc.wordpress.com/projects/shelled-for-redthumbgames/inside-shelleds-development/&#34;&gt;my memories of its development&lt;/a&gt;. So if you&#39;re interested you can take a look at it and tell me how you like them respectively how you like the game. By the way its totally free and you can download the  game source and mod it, too, so if you haven&#39;t tried it out, do now!&lt;/p&gt;&#xA;&lt;p&gt;On other news I&#39;ve been working on this and that and my GarageGames project still isn&#39;t finished as I&#39;m waiting for some artwork and I&#39;ve been playing around with Doom 3 and Quake 4 (respectively their &lt;a href=&#34;http://www.iddevnet.com&#34;&gt;SDKs&lt;/a&gt;), maybe I&#39;ll post a few screenshots in a few weeks. I&#39;m still in a trial-and-error phase but I know what I want to do, so hopefully I&#39;ll be able to create something nice. There are also a few other projects and tasks that keep me busy: mostly school at the moment and preparing for my A-levels - though I&#39;ve only started last week with that -, the second round of a computer science competition and other stuff.&lt;/p&gt;&#xA;&lt;p&gt;Anyway stay tuned for more info soon.&lt;/p&gt;&#xA;&lt;p&gt;Black&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Thu, 08 Mar 2007 12:33:03 +0000</pubDate>
    </item>
    <item>
      <title>Senior papers and what&#39;s all the fuss about them anyway..</title>
      <link>http://blog.blackhc.net/2007/01/senior-papers-and-whats-all-the-fuss-about-them-anyway/index.html</link>
      <description>&lt;p&gt;Yeah, finally I&#39;ve finished my senior paper and handed it in today. So what&#39;s all the fuss about senior papers anyway?&lt;/p&gt;&#xA;&lt;p&gt;Here in Germany you have to write a senior paper in the last grade before A-levels in one of your two main courses. It has to be similar to a scientific paper about a topic you and your teacher choose. Typically it&#39;s about 10 pages long but most often it seems to take about 20 pages.&lt;/p&gt;&#xA;&lt;p&gt;It&#39;s probably the longest non-coding project I&#39;ve ever done and I really hope it&#39;ll stay this way for some time since I&#39;m not thrilled by the thought of doing anything like it again (at least for the next 3 to 5 years). The same applies to all my classmates, although its probably the longest project they&#39;ve ever done for them. Everyone has been writing and printing and correcting and printing again constantly for the last 2 to 3 weeks and this has literally been crunch mode for most of us.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;m actually even feeling a bit burned-out because of it since I&#39;ve been spending most of my vacation working on it instead of relaxing and now after one day of school I again feel ready for some real vacation..&lt;/p&gt;&#xA;&lt;p&gt;Anyway, I&#39;ve uploaded my senior paper and you can find it &lt;a href=&#34;http://data.blog.blackhc.net/seniorpaper/facharbeit070108.pdf&#34;&gt;here&lt;/a&gt;. However, currently there exists only a German version of it, so if you don&#39;t understand German it will be of little use for you. I&#39;ll try to create an English version of it with LaTeX when I find some free time but I can&#39;t promise anything.&lt;/p&gt;&#xA;&lt;p&gt;The sources to it are released under the &amp;quot;GNU Free Documentation License&amp;quot; and can be downloaded &lt;a href=&#34;http://data.blog.blackhc.net/seniorpaper/source.zip&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The senior paper is about &amp;quot;creating graphical simulations with a pc&amp;quot; and describes some of the techniques required to create a raytracer. (The German title is &amp;quot;Modellierung graphischer Simulationen am PC&amp;quot;.)&lt;/p&gt;&#xA;&lt;p&gt;Stay tuned for some more coding-related entries soon but I&#39;m still busy with another school project so it make take a while before I&#39;m back to normal.&lt;/p&gt;&#xA;&lt;p&gt;Black&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Mon, 08 Jan 2007 14:20:13 +0000</pubDate>
    </item>
    <item>
      <title>XML, XSLT, HTML and what it has to do with Torque GameBuilder</title>
      <link>http://blog.blackhc.net/2006/12/xml-xslt-html-and-what-it-has-to-do-with-torque-gamebuilder/index.html</link>
      <description>&lt;p&gt;&lt;em&gt;Good title, eh?&lt;/em&gt;&lt;br /&gt;&#xA;But really, it seems like a lot of interesting buzz words were thrown together to create a leet-looking tagline and yes, that is my original intention.&lt;/p&gt;&#xA;&lt;p&gt;On the other hand I really had to do with all those buzz words, simply because I was too lazy to start up &lt;a href=&#34;http://www.stack.nl/~dimitri/doxygen/&#34;&gt;Doxygen&lt;/a&gt;... You see, &lt;a href=&#34;http://www.garagegames.com/products/torque/tgb/&#34;&gt;Torque GameBuilder&lt;/a&gt;(or short TGB) didn&#39;t use to have very good documentation or rather the function and class reference was always at least a little bit obsolete, so when I needed a good and fast-loading reference, I preferred my self-created .chm file over GarageGames&#39; pdf reference - which was also awkward to navigate in. TGB has console functions that output all console functions and classes in doxygen-friendly C++-parser compatible data and you can feed that to doxygen and create a nice reference from it, so that is pretty simple job and gives you a very useful custom reference nevertheless.&lt;/p&gt;&#xA;&lt;p&gt;But as it comes I&#39;m now using &lt;a href=&#34;http://www.sickheadgames.com/torsion.php&#34;&gt;Torsion&lt;/a&gt; (a nice little IDE for TorqueScript) and it has its own way of extracting the symbol information from TGB and storing it in an .exports file, which is nothing else but a renamed .xml file. XML stands for E&lt;strong&gt;x&lt;/strong&gt;tended &lt;strong&gt;M&lt;/strong&gt;ark-up Language and is the generic big brother of HTML, if you haven&#39;t heard of it.&lt;/p&gt;&#xA;&lt;p&gt;Knowing this and being in dire need of a new reference file, I thought &amp;quot;Heck, I&#39;m too lazy to take the 10 minutes and 5 relatively-easy steps to create my usual doxygen documentation for the new release - no, I&#39;m somehow going to use the XML data to create my documentation! And although I don&#39;t know anything about XML in general or any tools for working with it, it certainly will be a lot more entertaining, time-saving and fun than the doxygen way!&amp;quot;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Well, sometimes I&#39;m as dumb as you can get - but not this time! Yes, it drained all my resources for half a day and yes, eventually I started up doxygen and did it the usual way, but... - ok, lets rephrase that: Although I haven&#39;t been able to use it productively after all, I&#39;ve learnt a lot and it certainly will help me some other time in my life. *puh*&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;As I&#39;m owning Visual Studio .NET, I was convinced that it would offer some way to edit XML data and represent it in a human-readable way. I&#39;ve used Torsion&#39;s exports xml from a free TGB game (you can download it from &lt;a href=&#34;http://www.garagegames.com/&#34;&gt;www.garagegames.com&lt;/a&gt;) called Marble Tactices and here is a little excerpt:&lt;/p&gt;&#xA;&lt;pre class=&#34;xml&#34;&gt;&lt;code&gt;&amp;lt;class&amp;gt;&#xA;&amp;lt;name&amp;gt;ActionMap&amp;lt;/name&amp;gt;&#xA;&amp;lt;base&amp;gt;SimObject&amp;lt;/base&amp;gt;&#xA;&amp;lt;method&amp;gt;&#xA;&amp;lt;name&amp;gt;bind&amp;lt;/name&amp;gt;&#xA;&amp;lt;args&amp;gt; device, action, [modifier spec, mod...], command &amp;lt;/args&amp;gt;&#xA;&amp;lt;/method&amp;gt;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This isn&#39;t exactly readable and after opening it in VS.NET I spend a long time trying to figure out how to control its representation. After approximately half an hour I stumbled over the XML stylesheet language or more correctly: XML stylesheet language transformations (XSLT).&lt;/p&gt;&#xA;&lt;p&gt;Here&#39;s the same excerpt from above after it has been transformed by one of my XSLT files (or rather by msxsl with one of my XSLT files specified as stylesheet):&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;ActionMap   &lt;em&gt;SimObject&lt;/em&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Methods&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;bind( device, action, [modifier spec, mod...], command )&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;XSLT is an XML-based format that can be used to describe the conversion from one XML dataset to another. HTML or rather so-called &lt;strong&gt;well-formed HTML&lt;/strong&gt;(HTML that adheres to the XML standard) can thus be seen as the output dataset and consequently you can use XSLT to describe the conversion process that transforms the content of a certain type of XML files into concise and human-readable data (human-readable as in &amp;quot;pleasant to the reader&#39;s eye&amp;quot;).&lt;/p&gt;&#xA;&lt;p&gt;Microsoft&#39;s help is very neat and I only took me half an hour to have the first basic version working and it probably took longer to learn HTML and CSS (knowledge which I haven&#39;t actually used for my final PoC) than to understand XSLT as concept thanks to very good examples and good documentation. Talking about documentation, if you need to learn HTML, XML, CSS or any other web-related standard, &lt;a href=&#34;http://www.w3.org/&#34;&gt;W3C&lt;/a&gt; is the best place to find specifications and help.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Well, maybe it&#39;s just me but it&#39;s a lot easier to learn something new comprehensively if you read the specs rather than some whacky tutorials for beginners that you can find on the net everywhere...&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Anyway, XSLT is great, great and again great like a lot of things that have to do with XML since they are very easy to use. XML really seems like a good way to go, since there are many nice generic tools available for it and one doesn&#39;t have to reinvent the wheel all the time.&lt;/p&gt;&#xA;&lt;p&gt;If you find time to look at my XSLT &amp;quot;code&amp;quot; and the output it&#39;s capable to create, you&#39;ll realize what a time-safer it could become, if XML becomes more widely used (in games programming).&lt;/p&gt;&#xA;&lt;p&gt;Writing all 3 XSLT PoCs/tests took me a bit over half a day and finding, learning and getting mktree to work properly took one third of that time, so you see that XSLT really has got a nice learning-curve. For those who don&#39;t know mktree, it is a free javascript library that you can use the create tree structures in your HTML/DHTML files.&lt;/p&gt;&#xA;&lt;p&gt;You can find and download my Torsion exports -&amp;gt; HTML XSLT example (3 proofs of concept) &lt;a href=&#34;http://data.blog.blackhc.net/weblog/XSLT_example.zip&#34;&gt;here&lt;/a&gt;. &lt;em&gt;BTW Everything else of importance is explained in the readme.txt.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Enjoy and stay tuned,&lt;br /&gt;&#xA; Andreas Kirsch&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Tue, 05 Dec 2006 14:52:25 +0000</pubDate>
    </item>
    <item>
      <title>Wohaa!</title>
      <link>http://blog.blackhc.net/2006/11/wohaa/index.html</link>
      <description>&lt;p&gt;A lot has happened in the past weeks and I still can&#39;t believe it. But first things first:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;http://www.bwinf.de/fileadmin/templates/bwinf/bwinf.gif&#34; alt=&#34;Official BWINF logo (courtesy of BWINF)&#34; /&gt;For the second time I&#39;m taking part in Germany&#39;s federal computer science contest (for students): It&#39;s called &amp;quot;&lt;a href=&#34;http://www.bwinf.de/&#34;&gt;Bundeswettbewerb Informatik&lt;/a&gt;&amp;quot; and consists of 5 problems (respectively 6 for teens aged under 16) which have to be solved in about two months&#39; time. I wrote and tested everything in about 4 days (2 days in my fall vacation and 2 days right before the submission date). The code isn&#39;t beautiful:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;it&#39;s meant to be short, so it won&#39;t waste too many pages when printed out;&lt;/li&gt;&#xA;&lt;li&gt;it&#39;s meant to be simply and make use of libraries, so the documentation can be kept short and to the point (no need to explain sorting when STL already does it);&lt;/li&gt;&#xA;&lt;li&gt;it was hacked together in only 4 days in semi-crunch mode.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The documentation isn&#39;t very good either, for the aforementioned reasons and I wrote all ~14 pages in 2 days, so there wasn&#39;t much time to correct and proofread, but anyway you can download my submission &lt;a href=&#34;http://data.blog.blackhc.net/weblog/BWINF06.zip&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;(BTW if you happen to be a corrector for BWINF and specifically happen to be mine, please note that I always exaggerate and am pessimistic, and my submission is pretty good after and I&#39;ve taken it very seriously *nervous laughter*)&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;If it wasn&#39;t for my job application at &lt;a href=&#34;http://www.splashdamage.com&#34;&gt;Splash Damage&lt;/a&gt;, of which I unexpectedly heard back four days before the final submission date of the contest, I would quite possibly not have taken the time to finish 4 problems in total, write some lousy documentation for them and send them off, but the motivation boost that the reply from SD gave me (or rather the prospect of it) was simply incredible. Now the answer to my application is a whole different story and I&#39;ll tell it some other time.&lt;/p&gt;&#xA;&lt;p&gt;In other news, Shelled! has finally been released Tuesday night and I&#39;ve been playing it like mad online and people seem to enjoy it, too. I guess we can call it an success, even though there are still some minor bugs in the release build. But Joshua, the owner, founder - and the honorable master of Red Thumb Games found a job/internship at GarageGames and has been busy since, so he decided to release the current version of Shelled! for free instead of waiting another month or two until some kind of copy protection had been built in by us. &lt;/p&gt;&#xA;&lt;p&gt;Download it from &lt;a href=&#34;http://www.shelledgame.com/&#34;&gt;http://www.shelledgame.com&lt;/a&gt; and give it a try!&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ll try to write a post-mortem soon and add it to my project page, but right now I&#39;m busy with some contract work I got from &lt;a href=&#34;http://www.garagegames.com&#34;&gt;GarageGames&lt;/a&gt; (&lt;em&gt;thanks Joshua!)&lt;/em&gt; and I have already spent enough valuable time writing up this post :)&lt;/p&gt;&#xA;&lt;p&gt;So stay tuned and watch out for the &lt;em&gt;fish&lt;/em&gt;,&lt;br /&gt;&#xA; Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Fri, 17 Nov 2006 18:41:49 +0000</pubDate>
    </item>
    <item>
      <title>Tired Fish</title>
      <link>http://blog.blackhc.net/2006/10/tired-fish/index.html</link>
      <description>&lt;p&gt;I have really, really never imagined that my life would become that boring coding-wise after school starting again. There is almost nothing to tell since the last post. I&#39;ve worked a bit more on the raytracer but eventually decided that I should sacrifice completeness over finishing my senior paper I was writing it for, since everything I wanted to put into the paper was already in the codebase. So I finished it: right now it&#39;s 10/11 pages long and contains a lot of matrix math, etc. and no direct code at all - even the description of the inner-workings of a raytracer is held very generic, so that hopefully even my math teacher, who doesn&#39;t know programming languages very well (- she probably only knows Basic or Pascal), will understand it.&lt;/p&gt;&#xA;&lt;p&gt;You can find the current version of the senior paper &lt;a href=&#34;http://data.blog.blackhc.net/seniorpaper/facharbeit061018.pdf&#34;&gt;here&lt;/a&gt;, but be warned, it is written in German, so you might only be interested in it, if you know German or like looking at cool formulas and proofs.&lt;/p&gt;&#xA;&lt;p&gt;I won&#39;t upload the raytracer right now, since it isn&#39;t finished yet.&lt;/p&gt;&#xA;&lt;p&gt;What else can I tell you? Well, if my coding life hasn&#39;t been very productive &lt;em&gt;- to put it more accurately my fish almost died of boredom -&lt;/em&gt; my other life &lt;em&gt;(you could call it &amp;quot;social life&amp;quot;, but I&#39;m not sure about how correct that would be..)&lt;/em&gt; has been exceptionally busy: I broke my other wrist, too, and had to run around with a cast for the last three weeks. My birthday was also in the beginning of October and my birthday party, too :)&lt;/p&gt;&#xA;&lt;p&gt;The aftermath of it is still frightening me, but first things first. Since a good friend of mine has the same birthdate as I, we decided to celebrate together. We rented a few room, invited about 70 people and hoped for the best. Thank god, only about 40 came, but the party was still pretty wild and many bottles of beers broke..&lt;/p&gt;&#xA;&lt;p&gt;The rooms were rented from the Red Cross, but we didn&#39;t know that the actual owner of the house was the next-door neighbour. He apparently came over two times during the night to tell people that were outside to be quieter, but he didn&#39;t talk to us, and only on the third time he asked for us and threatened to call the police if we don&#39;t leave his house, yadda yadda. A nice ending for an otherwise good party.&lt;/p&gt;&#xA;&lt;p&gt;It came worse: The guy from the Red Cross was woken up by the owner early morning and was angry, too. Normally we would have had another 10 hours to clean the rooms and give everything a polished look again, but he retured way too early, looked at everything and gave me a pretty bad time. Not that I cared much, I didn&#39;t drink a lot that night: being in the kitchen preparing pizzas, mopping away spilled beer and taking responsibility usually leaves you sober. Additionally I didn&#39;t sleep one minute and being in such a zen-like state of mind, the guy could have mutated into a twenty-headed hydra and I wouldn&#39;t have been surprised. If he had exploded into pieces, I may have applauded, but of course only because of my dark sense of humour.&lt;/p&gt;&#xA;&lt;p&gt;Needless to say that we lost the 100 Euros we paid as bond, but if you think it can&#39;t come worse, so did I. The universe always finds new ways to catch us off guard. The owner also had a Porsche, of course, which he very, very cleverly parked right in front of the party location. It was one of those free, not secured parking lots and in the next morning he saw that someone had stuffed an empty pack of cigarettes into his exhaust.&lt;/p&gt;&#xA;&lt;p&gt;I don&#39;t know who did that, or whether the person was invited to the party, or had been to that party, but the owner was pretty omniscient about everything - not that he had actually seen anything but he &lt;em&gt;&amp;quot;knew&amp;quot;&lt;/em&gt;. Well, it seems you gotta know your rights very well in this land, else you&#39;re fucked. He threatened to beat me up, if I don&#39;t remove that pack of cigarettes from his exhaust pipe immediately and told me that he&#39;d send the car to the Porsche shop and have the mechanics look all over it and send us the bill for it regardless whether something was broken or not. A nice gentleman. Especially if common sense tells you that a Porsche engine probably could blow out anything that is in the exhaust pipe with such a speed that it could kill a cat &lt;strike&gt;or baby&lt;/strike&gt;. But ok, nothing against that. We apologized to everyone for everything and weather and bought some nice please-forgive-and-forget-us gifts and hoped that it would be over now. Last we asked someone at the Red Cross, they told us that the Porsche was gone for a couple of days...&lt;/p&gt;&#xA;&lt;p&gt;--&lt;br /&gt;&#xA; Black&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Mon, 30 Oct 2006 00:18:47 +0000</pubDate>
    </item>
    <item>
      <title>Some News &amp; Stuff</title>
      <link>http://blog.blackhc.net/2006/09/some-news-stuff/index.html</link>
      <description>&lt;p&gt;Howdy,&lt;br /&gt;&#xA;it&#39;s been a while since my last post and to sum what has happened since then: nothing. Well that may not be entirely correct but it fits pretty much. I&#39;ve heard that &lt;code&gt;SplashDamage is looking for a game programmer with no required CS degree&lt;/code&gt;, so I thought: hey, why shouldn&#39;t I simply apply for the fun of it.&lt;/p&gt;&#xA;&lt;p&gt;As it turns out, writing all your application texts (most for the first time) in English isn&#39;t that entertaining. To put it nicely, it&#39;s dead boring. So I&#39;m stuck with a finished CV and a few prepared source codes and don&#39;t know when I&#39;ll get over my laziness and write the rest. Moreover, I want to finish my C++ raytracer first (at least get the design nicely together), so that I can add it to my portfolio.&lt;/p&gt;&#xA;&lt;p&gt;And since I&#39;m still pretty busy working on Shelled and fighting Don Quijoteish battles in my real-life, I don&#39;t believe that anything will ever be finished anytime soon.&lt;/p&gt;&#xA;&lt;p&gt;Anyway, I have dug out some really old renders from my raytracer and they look neat - even if the results were neither wanted nor expected...&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/2006-09-15-some-news-stuff/testbeautiful.jpg&#34; alt=&#34;Some beautiful rendering&#34; /&gt;&lt;figcaption&gt;Some beautiful rendering&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;This was taken after putting in some neat refraction and reflection code, but since no energy was lost during these operations, it looks like some weird mirror thing. Anyway, &lt;em&gt;neat, isn&#39;t it?&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Regarding Shelled! everything is going great and it&#39;s a really fun game and I can hardly stop playing once started.&lt;/p&gt;&#xA;&lt;p&gt;Stay tuned for updates regarding my raytracer and Shelled! and enjoy life like my fish does,&lt;br /&gt;&#xA; Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Fri, 15 Sep 2006 12:29:26 +0000</pubDate>
    </item>
    <item>
      <title>My Visit of the Games Convention 2006</title>
      <link>http://blog.blackhc.net/2006/08/my-visit-of-the-games-convention-2006/index.html</link>
      <description>&lt;p&gt;The Games Convention: Europe&#39;s biggest game show - and I was there! Rather I was one of 183,000 visitors, so you can imagine how big this event is and how damn lost you can get inside the big convention halls.&lt;/p&gt;&#xA;&lt;p&gt;It was fun nevertheless and a great thing to see. There were DJs, special guests, moderated events and and and everywhere all the time. And I better not forget to mention all the &lt;em&gt;gorgeous&lt;/em&gt; booth babes that were around.&lt;/p&gt;&#xA;&lt;p&gt;Yeah, GC was really a visual feast. But first things first: A friend and I arrived at about 11 am and stayed for 6.5 long hours and visited every hall and almost every booth. Some of our highlights were:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Saw some great case moddings (pictures below)&lt;/li&gt;&#xA;&lt;li&gt;Saw Sebastian Lahm (German soccer player who is in the national team) at the Nintendo booth signing footballs&lt;/li&gt;&#xA;&lt;li&gt;Heard some known hip-hopper singing at the EA booth (but silly me, I&#39;ve already forgotten his hip-hop artist name)&lt;/li&gt;&#xA;&lt;li&gt;Played and watched a preview of &lt;em&gt;&lt;a href=&#34;http://www.crysis-game.com/&#34;&gt;Crysis&lt;/a&gt;&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;Previewed &lt;a href=&#34;http://www.gothic3.com/&#34;&gt;&lt;em&gt;Gothic 3&lt;/em&gt;&lt;/a&gt; and watched the trailer&lt;/li&gt;&#xA;&lt;li&gt;Played &lt;em&gt;&lt;a href=&#34;http://stalker-game.com/&#34;&gt;Stalker&lt;/a&gt; - yeah, it&#39;s finally going to be release soon - really!&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;Met &lt;a href=&#34;http://en.wikipedia.org/wiki/Johnathan_Wendel&#34;&gt;Fatal1ty&lt;/a&gt; at the Creative Labs booth, where he moderated a lottery. People had to ask him good questions to win a prize -_ but I didn&#39;t dare ask him about the reasons why he lost against the Chinese Doom3 player, should I have?_&lt;/li&gt;&#xA;&lt;li&gt;Stayed in queue for about 30 min to play &lt;a href=&#34;http://www.enemyterritory.com/&#34;&gt;Enemy Territ&lt;/a&gt;&lt;a href=&#34;http://www.enemyterritory.com/&#34;&gt;ory: Quake Wars&lt;/a&gt; (after other friends of mine had waited for an undisclosed time but gave up their seats for us - &lt;em&gt;thanks to them, Michi &amp;amp; Olli&lt;/em&gt;). It really kicks ass and I can&#39;t wait to play it online.&lt;/li&gt;&#xA;&lt;li&gt;We also met Wils and Digibob at the SplashDamage/ET:QW booth (bongoboy was around, too, but I didn&#39;t know him from IRC). Wils was so kind to guide me around in ET:QW and show me some tricks throughout the game session. &lt;em&gt;Thanks Wils!&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;Saw a lot of hot chicks but I&#39;ve mentioned that already, didn&#39;t I?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;em&gt;Ok, ok, so this was the text part. I know that you all want to see some pictures, so here we go - but due to their amount and the lack of auto-generated thumbnails (thank you, WordPress), I had to add a &#39;More&#39; tag. I hope it doesn&#39;t bother you. Enjoy the pictures.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xA;&lt;p&gt;Now, let&#39;s start with the case modding pictures. They aren&#39;t great and there aren&#39;t many of them since I needed the flash space for something else - &lt;em&gt;you guess&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;/images/2006-08-28-my-visit-of-the-games-convention-2006/pict4367-large.JPG&#34; alt=&#34;Nice case mod&#34; /&gt; &lt;img src=&#34;/images/2006-08-28-my-visit-of-the-games-convention-2006/pict4370-large.JPG&#34; alt=&#34;A closer shot from cool case mod&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;We also saw some guys dancing on dance pads, the nice booth of &lt;a href=&#34;http://www.eve-online.com/&#34;&gt;EVE online&lt;/a&gt; and a live reggea band playing some good music:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;/images/2006-08-28-my-visit-of-the-games-convention-2006/pict4346-large.jpg&#34; alt=&#34;Some guys trying out the dance pads&#34; /&gt; &lt;img src=&#34;/images/2006-08-28-my-visit-of-the-games-convention-2006/pict4358-large.JPG&#34; alt=&#34;Eve Online&#34; /&gt; &lt;img src=&#34;/images/2006-08-28-my-visit-of-the-games-convention-2006/pict4362-large.jpg&#34; alt=&#34;A cool reggea band playing.. reaggea&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;There were also like 30 plastic models of famous game and comic characters (Solid Snake, Spiderman, Ms. Croft, and and and). Most of my pictures only look good at 100x100 since they are too blurry otherwise, so I&#39;m only going to show you a famous orc and the batman.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;/images/2006-08-28-my-visit-of-the-games-convention-2006/pict4381-large.JPG&#34; alt=&#34;Warcraft Orc&#34; /&gt;&lt;img src=&#34;/images/2006-08-28-my-visit-of-the-games-convention-2006/pict4383-large.jpg&#34; alt=&#34;Batman model&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;Another cool thing, which hadn&#39;t had anything directly to do with games, were some hot cars (notice the booth babes behind the orange one - they were hot, too):&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;/images/2006-08-28-my-visit-of-the-games-convention-2006/pict4373-large.JPG&#34; alt=&#34;Hot car&#34; /&gt;&lt;img src=&#34;/images/2006-08-28-my-visit-of-the-games-convention-2006/pict4375-large.jpg&#34; alt=&#34;Another neat car&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;At the Midway stand (publisher for Unreal Tournament 2007, etc) there was a huge - and with &lt;strong&gt;huge&lt;/strong&gt; I really mean it - Unreal Tournament model. It was like 4 meters high and looked like rendered - &lt;em&gt;my fish points out that things are normally the other way but it really looked like it was taken out of some UE3 screenshot..&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://blackhc.wordpress.com/2006/08/28/my-visit-of-the-games-convention-2006/a-giant-ut-model/&#34;&gt;&lt;img src=&#34;/images/2006-08-28-my-visit-of-the-games-convention-2006/pict4412-large.JPG&#34; alt=&#34;A giant UT model&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;And now finally we arrive at the type of pictures you have all waited for: the booth babes.&lt;/p&gt;&#xA;&lt;p&gt;Let&#39;s see: do you like Lara Croft?&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;/images/2006-08-28-my-visit-of-the-games-convention-2006/pict4397-enhanced-large.JPG&#34; alt=&#34;Real and hot Lara Croft model&#34; /&gt; Okay, that shot wasn&#39;t perfect, so what do you think of this one?&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;/images/2006-08-28-my-visit-of-the-games-convention-2006/pict4395-large.JPG&#34; alt=&#34;A better shot of Lara Croft&#34; /&gt;&lt;figcaption&gt;A better shot of Lara Croft&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;&lt;em&gt;Better eh?&lt;/em&gt; Or if you don&#39;t like her, what about her?&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;/images/2006-08-28-my-visit-of-the-games-convention-2006/pict4414-large.JPG&#34; alt=&#34;Hot booth babe under a UT model&#34; /&gt;  Maybe you like them in conjunction with cars?&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;/images/2006-08-28-my-visit-of-the-games-convention-2006/pict4425-large.JPG&#34; alt=&#34;2 hot babes and a car&#34; /&gt;&lt;img src=&#34;/images/2006-08-28-my-visit-of-the-games-convention-2006/pict4423-large.jpg&#34; alt=&#34;Two hot chicks and a car - another pose&#34; /&gt; Or do you want to see them in a group? &lt;img src=&#34;/images/2006-08-28-my-visit-of-the-games-convention-2006/pict4407-large.jpg&#34; alt=&#34;Hot dancers posing after their cool performance&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;I hope you enjoyed these photos as much as I did when I took them..&lt;/p&gt;&#xA;&lt;p&gt;Stay tuned,&lt;br /&gt;&#xA; Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Mon, 28 Aug 2006 19:15:26 +0000</pubDate>
    </item>
    <item>
      <title>The Return of QuickGamma</title>
      <link>http://blog.blackhc.net/2006/08/the-return-of-quickgamma/index.html</link>
      <description>&lt;p&gt;&lt;img src=&#34;/images/2006-08-22-the-return-of-quickgamma/quickgamma-logo.jpg&#34; alt=&#34;QuickGamma Logo&#34; align=&#34;right&#34; /&gt; QuickGamma is a very nice tool, originally written by Randy &#39;ydnar&#39; Reddig, which allows you to set and reset the screen&#39;s gamma easily. The program itself stays nicely hidden in the tasktray, so it won&#39;t take away any valuable taskbar space.&lt;/p&gt;&#xA;&lt;p&gt;You can download the new 0.1.2 version (which was created by me based on ydnar&#39;s 0.1.1 release) &lt;a href=&#34;http://data.blog.blackhc.net/weblog/quickgamma_0.1.2.zip&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;After my explorer crashed horribly a few times yesterday and I had to kill the old QuickGamma app in the task manager and then restart it again each time, I decided that something had to be done about it.&lt;/p&gt;&#xA;&lt;p&gt;So after searching for too long in MSDN and with Google, I finally found some documentation on some custom-registered &amp;quot;TaskbarCreated&amp;quot; message. Shame on you, Microsoft, for not making this information easily accessible!&lt;/p&gt;&#xA;&lt;p&gt;Anyway, I&#39;ve added support for automatically reregistering the QuickGamma tray icon after an explorer restart and also removed the idle thread priority, so it should always be responsive from now.&lt;/p&gt;&#xA;&lt;p&gt;Stay tuned and enjoy the new version of this neat, little tool.&lt;/p&gt;&#xA;&lt;p&gt;Andreas&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;PS: It also seems that the old download link is down, so, if you want the original QuickGamma, simply ask me.&lt;/em&gt;&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Tue, 22 Aug 2006 12:21:16 +0000</pubDate>
    </item>
    <item>
      <title>Sploidz - About a Game</title>
      <link>http://blog.blackhc.net/2006/08/sploidz-about-a-game/index.html</link>
      <description>&lt;p&gt;Finally after 8 months of hard but fun work &lt;a href=&#34;http://www.sploidz.com&#34;&gt;Sploidz&lt;/a&gt; is done and has been released by Red Thumb Games. I was the lead (and only) programmer for that project (David House did code the prototype, however) and I&#39;m &lt;em&gt;&lt;strong&gt;so&lt;/strong&gt;&lt;/em&gt; proud to see it released and played by you!&lt;/p&gt;&#xA;&lt;p&gt;Here check out this screen:&lt;/p&gt;&#xA;&lt;p&gt; &lt;a href=&#34;/images/2006-08-21-sploidz-about-a-game/sploidz-2006-08-20-15-12-31-73-medium.JPG&#34;&gt;&lt;img src=&#34;/images/2006-08-21-sploidz-about-a-game/sploidz-2006-08-20-15-12-31-73-medium.JPG&#34; alt=&#34;Sploidz Promo Screen&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Weee, exciting, isn&#39;t it?&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;If you want to find out more about the project, don&#39;t forget to check it out &lt;a href=&#34;/projects-before-2008/sploidz-for-redthumbgames/&#34;&gt;in the project area&lt;/a&gt; or download it directly from &lt;a href=&#34;http://www.sploidz.com/&#34;&gt;http://www.sploidz.com&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Enjoy the game,&lt;/p&gt;&#xA;&lt;p&gt;Andreas&lt;/p&gt;&#xA;&lt;p&gt;__&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Mon, 21 Aug 2006 17:01:48 +0000</pubDate>
    </item>
    <item>
      <title>Everybody can use GLSL - even I.</title>
      <link>http://blog.blackhc.net/2006/08/everybody-can-use-glsl-even-i/index.html</link>
      <description>&lt;p&gt;Well, it&#39;s hard to believe but true. &lt;em&gt;Yesss&lt;/em&gt;, I seem to have mastered the basics of GLSL and I&#39;ve really managed to write a phong shader that even supports normal maps and tangent space.&lt;/p&gt;&#xA;&lt;p&gt;You validly wonder how I achieved this? The answer is..&lt;/p&gt;&#xA;&lt;p&gt;Typhoon Lab&#39;s &lt;a href=&#34;http://www.typhoonlabs.com/index.php?option=com_content&amp;amp;task=view&amp;amp;id=13&amp;amp;Itemid=33&#34;&gt;Shader Designer&lt;/a&gt;!&lt;/p&gt;&#xA;&lt;p&gt;It&#39;s really a great tool to quickly develop GLSL shaders and preview them with various textures and models. It also includes all necessary OpenGL extension specifications and the GLSL specs. You haven&#39;t downloaded it already? Go get it, or maybe not? Perhaps I&#39;ve been paid by them to do some illegal &lt;strike&gt;(or is this kind of obvious surreptitious advertising legal?)&lt;/strike&gt; advertising? - &lt;em&gt;my fish now scowls at me; you wouldn&#39;t believe that fish can do that..&lt;/em&gt; No, to be honest I&#39;m just very excited about GLSL and everything. And this tool has certainly helped me debug my shaders and gain some experience with the language before taking on some serious project.&lt;/p&gt;&#xA;&lt;p&gt;Before I forget it, I&#39;ve uploaded my first (and right now only) Shader Designer project for you. The one that supports tangent space &lt;em&gt;- yay!&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Here, grab it: &lt;a href=&#34;http://data.blog.blackhc.net/first_shaderdesigner_project.zip&#34;&gt;First ShaderDesigner Project&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;But now I&#39;ll tell you the actual reason why I&#39;m so excited: I&#39;ve added GLSL shader support to &lt;a href=&#34;http://entar.quakedev.com/wiki/index.php/Vengeance_r2_Downloads&#34;&gt;Vengeance2&lt;/a&gt;. You might have to wait for a new build that supports the feature though, since it is brand-new - you could, however, directly grab the SVN version and compile it yourself to be able to see these hot effects now. OK, there are dozens if not hundreds of other engines which already support phong shading and probably do so better than my code does but hey, do you remember &lt;em&gt;- I&#39;m excited!&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;About the dev aspect of it:&lt;/p&gt;&#xA;&lt;p&gt;It&#39;s been incredibly easy to add GLSL lighting support to this Quake1 engine. At first I doubted that I would be able to add support for lighting the worldmodel (the map), too, but it turned out to be pretty easily and it even is relatively fast. I&#39;m using distance checks and PVS culling, which both turned out to be very easy to code and yield good performance. Thus I&#39;m quite happy with the result.&lt;/p&gt;&#xA;&lt;p&gt;For the ones of you, who always want to see some hot pics and some action, I&#39;ve got a few screenshots for you:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;/images/2006-08-15-everybody-can-use-glsl-even-i/vr2-2006-08-15-01-43-25-61-small.JPG&#34;&gt;&lt;img src=&#34;/images/2006-08-15-everybody-can-use-glsl-even-i/vr2-2006-08-15-01-43-25-61-small.thumbnail.JPG&#34; alt=&#34;E1M1 without shader lights&#34; /&gt;&lt;/a&gt;&lt;a href=&#34;/images/2006-08-15-everybody-can-use-glsl-even-i/vr2-2006-08-15-01-43-30-79-small.JPG&#34;&gt;&lt;img src=&#34;/images/2006-08-15-everybody-can-use-glsl-even-i/vr2-2006-08-15-01-43-30-79-small.thumbnail.JPG&#34; alt=&#34;E1M1 With One Shader Light&#34; /&gt;&lt;/a&gt;&lt;a href=&#34;/images/2006-08-15-everybody-can-use-glsl-even-i/vr2-2006-08-15-01-44-06-83-small.JPG&#34;&gt;&lt;img src=&#34;/images/2006-08-15-everybody-can-use-glsl-even-i/vr2-2006-08-15-01-44-06-83-small.thumbnail.JPG&#34; alt=&#34;E1M1 With One Shader Light - Look at the Specular Lighting&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;/images/2006-08-15-everybody-can-use-glsl-even-i/vr2-2006-08-15-01-45-46-74-small.JPG&#34;&gt;&lt;img src=&#34;/images/2006-08-15-everybody-can-use-glsl-even-i/vr2-2006-08-15-01-45-46-74-small.thumbnail.JPG&#34; alt=&#34;E1M1 Dead Bloodhound - Look at the Specular Lighting&#34; /&gt;&lt;/a&gt;&lt;a href=&#34;/images/2006-08-15-everybody-can-use-glsl-even-i/vr2-2006-08-15-01-47-10-65-small.JPG&#34;&gt;&lt;img src=&#34;/images/2006-08-15-everybody-can-use-glsl-even-i/vr2-2006-08-15-01-47-10-65-small.thumbnail.JPG&#34; alt=&#34;E1M1 Dynamic Lighting Using Shader Lights&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Stay tuned and remember the wise words of my fish.&lt;/p&gt;&#xA;&lt;p&gt;Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Tue, 15 Aug 2006 00:27:27 +0000</pubDate>
    </item>
    <item>
      <title>Hello, my Name is..</title>
      <link>http://blog.blackhc.net/2006/08/hello-my-name-is/index.html</link>
      <description>&lt;p&gt;This is my first post here and I guess people introduce themselves with their first post. I&#39;m going to introduce my fish instead. He&#39;s so much cooler than I am - although I&#39;m bigger than him, but who isn&#39;t?&lt;/p&gt;&#xA;&lt;p&gt;You see, actually I don&#39;t even know whether he really is a &#39;he&#39;, if you understand what I want to say. I mean, how do you determine this for a fish? I guess the male fish don&#39;t have a, well, a counterpart to what the female fish don&#39;t have.. you understand, do you?&lt;/p&gt;&#xA;&lt;p&gt;Actually I think: I shouldn&#39;t know. People who know such stuff and publicly tell other people about it.. Who cares anyway? It&#39;s a fish after all. Though.. no, no, let me go back to the task of describing the fish - my fish.&lt;/p&gt;&#xA;&lt;p&gt;It - let&#39;s call it it for a while although now &lt;strike&gt;he&lt;/strike&gt; it looks at me a bit furiously - isn&#39;t that big, a lot smaller than my 1.88m. I daresay as big as fish nowadays get but you never know after Chernobyl and all that other almost melt-downs and leaks. The color of fish is indifferent, isn&#39;t it? Let&#39;s just say my fish is yellow. I don&#39;t want to discriminate my fish. With all that lawsuits because of people&#39;s color and race and smoking habits, I really don&#39;t feel like taking part in &lt;em&gt;that&lt;/em&gt; discussion.&lt;/p&gt;&#xA;&lt;p&gt;I don&#39;t want to hurt anybody&#39;s feelings. So let me simply declare my fish is some yellow fish. It&#39;s a pity that &lt;strike&gt;it&lt;/strike&gt; &lt;em&gt;- you can&#39;t say&lt;/em&gt; no &lt;em&gt;to those eyes -&lt;/em&gt; he has no arms and no hands but only fins. We&#39;re already a perfect team but we would be invincible, if he could give me a &lt;em&gt;hand&lt;/em&gt; with coding. But the way things are, he can only assist me with his mind and his well-educated comments and notes on my work. You&#39;re going to appreciate his words, too &lt;em&gt;- believe me&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;By the way if someone wants to know more about me, simply take a look at the &lt;strong&gt;About&lt;/strong&gt; page.&lt;/p&gt;&#xA;&lt;p&gt;Andreas&lt;/p&gt;&#xA;</description>
      <author>Andreas &#39;BlackHC&#39; Kirsch</author>
      <pubDate>Mon, 14 Aug 2006 22:50:58 +0000</pubDate>
    </item>
  </channel>
</rss>