<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>XiaTek</title>
	<atom:link href="http://xiatek.org/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://xiatek.org</link>
	<description>0&#34;; DROP TABLE title_texts;</description>
	<lastBuildDate>Sun, 18 Nov 2012 18:07:27 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<item>
		<title>Head Track Release Candidate</title>
		<link>http://xiatek.org/?p=326</link>
		<comments>http://xiatek.org/?p=326#comments</comments>
		<pubDate>Sun, 18 Nov 2012 17:12:40 +0000</pubDate>
		<dc:creator>C0BRA</dc:creator>
				<category><![CDATA[C0BRA]]></category>

		<guid isPermaLink="false">http://xiatek.org/?p=326</guid>
		<description><![CDATA[I wanted to get coordinate remapping in before a release candidate, unfortunately I can&#8217;t seem to make it happen so the device will have one specific orientation that it will need to be placed in for it to work correctly (if you can help me with this then please don&#8217;t hesitate to contact me!). You [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to get coordinate remapping in before a release candidate, unfortunately I can&#8217;t seem to make it happen so the device will have one specific orientation that it will need to be placed in for it to work correctly (if you can help me with this then please don&#8217;t hesitate to contact me!).</p>
<p>You can edit the way the filtering/scaling is done by modifying &#8220;/lua/default.lua&#8221; and &#8220;/lua/scale.lua&#8221;, the one I used in the video is EWMA filtering, so you can use that by backing up &#8220;/lua/default.lua&#8221; and renaming &#8220;/lua/ewma.lua&#8221; to &#8220;/lua/default.lua&#8221;.</p>
<p>I will be writing better instructions and usage guide at <a href="http://xiatek.org/headtrack">http://xiatek.org/headtrack</a> at a later date, but for now please report any bugs you encounter at <a href="http://bugs.xiatek.org/">http://bugs.xiatek.org/</a></p>
<p>Thank you.</p>
<p>Download:</p>
<p><a href="https://play.google.com/store/apps/details?id=com.c0bra.head.track" title="Google Play" target="_blank">Android application</a> (<a href="http://files.xiatek.org/HeadTrack/HeadTrack.apk" title="Direct link" target="_blank">direct link to APK</a>)<br />
<a href="http://files.xiatek.org/HeadTrack/HeadTrack_Server.zip" title="Server">Server</a></p>
]]></content:encoded>
			<wfw:commentRss>http://xiatek.org/?feed=rss2&#038;p=326</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>FreeTrack via Android Phone</title>
		<link>http://xiatek.org/?p=317</link>
		<comments>http://xiatek.org/?p=317#comments</comments>
		<pubDate>Tue, 16 Oct 2012 02:13:19 +0000</pubDate>
		<dc:creator>C0BRA</dc:creator>
				<category><![CDATA[C0BRA]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[freetrack]]></category>
		<category><![CDATA[gyroscope]]></category>
		<category><![CDATA[head]]></category>
		<category><![CDATA[track]]></category>
		<category><![CDATA[trackir]]></category>

		<guid isPermaLink="false">http://xiatek.org/?p=317</guid>
		<description><![CDATA[Over the past few weeks, I&#8217;ve been experimenting with FreeTrack and the gyroscope built into my phone (Galaxy Nexus); if you attempt to pipe the orientation obtained from the device straight into a FreeTrack compatible game, you will end up with a shaky and temperamental camera that isn&#8217;t quite sure where it wants to go [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past few weeks, I&#8217;ve been experimenting with FreeTrack and the gyroscope built into my phone (Galaxy Nexus); if you attempt to pipe the orientation obtained from the device straight into a FreeTrack compatible game, you will end up with a shaky and temperamental camera that isn&#8217;t quite sure where it wants to go (gyroscope drift + correction using the magnetic field) as seen here:</p>
<p><iframe width="640" height="360" src="http://www.youtube.com/embed/iz2rpiIzn8o?list=UUWD_FbDPd86-hz0H6PdBqzA&amp;hl=en_US" frameborder="0" allowfullscreen></iframe></p>
<p>You can just slap a moving average on, but it results in undesirable input lag.  Over the past week or two, I&#8217;ve been continually improving the algorithm to smooth the input, yet keep it snappy with as little input lag as possible; right now it is around 66ms input lag, which is almost unnoticeable when playing.  Currently, the camera does not drift with slow movements, yet it does not loose sync with the true orientation, plotting this, we can compare a previous attempt with the current one:</p>
<p><img src="http://i.imgur.com/70rRQ.png"/></p>
<p><img src="http://i.imgur.com/R5lE3.png"/></p>
<p>Blue is input, and red is output; you can see that there is very little input lag and the latest one does not drift away, yet does not become out of sync; this keeps you immersed in the game without anything distracting you.</p>
<p>A limitation that should be noted when compared to other similar devices is, this does not have movement, only orientation.</p>
<p>Here is me using it when I&#8217;m in Arma 2 flying the Apache:</p>
<p><iframe width="640" height="360" src="http://www.youtube.com/embed/wXJ4FvsBPEY" frameborder="0" allowfullscreen></iframe></p>
<p>As you can see, this requires mounting your phone to your head some way; I&#8217;ve done it with velcro.</p>
]]></content:encoded>
			<wfw:commentRss>http://xiatek.org/?feed=rss2&#038;p=317</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Thread Pool</title>
		<link>http://xiatek.org/?p=311</link>
		<comments>http://xiatek.org/?p=311#comments</comments>
		<pubDate>Wed, 11 Jul 2012 12:27:47 +0000</pubDate>
		<dc:creator>C0BRA</dc:creator>
				<category><![CDATA[C0BRA]]></category>

		<guid isPermaLink="false">http://xiatek.org/?p=311</guid>
		<description><![CDATA[I keep writing this, so I&#8217;m also putting it here for future reference: using System; using System.Collections.Generic; using System.Text; using System.Threading; namespace SharePointWorkflowLocator { [Flags] public enum ThreadPoolOptions { StopThreadWhenQueueEmpty = 1, Background = 1 &#60;&#60; 1 } public class ThreadPool&#60;T&#62; { private Action&#60;T&#62; _Action; private Queue&#60;T&#62; _Queue = new Queue&#60;T&#62;(); private float Added = [...]]]></description>
			<content:encoded><![CDATA[<p>I keep writing this, so I&#8217;m also putting it here for future reference:</p>
<pre name="code" class="c-sharp">
using System;
using System.Collections.Generic;
using System.Text;

using System.Threading;

namespace SharePointWorkflowLocator
{
    [Flags]
    public enum ThreadPoolOptions
    {
        StopThreadWhenQueueEmpty = 1,
        Background = 1 &lt;&lt; 1
    }

    public class ThreadPool&lt;T&gt;
    {
        private Action&lt;T&gt; _Action;
        private Queue&lt;T&gt; _Queue = new Queue&lt;T&gt;();
        private float Added = 0;
        private float Done = 0;
        private int _ThreadCount = 0;
        private Thread[] _Threads;
        private ThreadPoolOptions _Options;

        public ThreadPool(Action&lt;T&gt; action, int Threads, ThreadPoolOptions options = 0)
        {
            _Action = action;
            _Threads = new Thread[Threads];
            _ThreadCount = Threads;
            _Options = options;

            for (int i = 0; i &lt; Threads; i++)
            {
                int ii = i; // So it can refer to itself
                _Threads[i] = new Thread(new ThreadStart(delegate
                    {
                        while (true)
                        {
                            T o = GetNext();
                            if (o != null)
                                action.Invoke(o);
                            else if ((_Options &#038; ThreadPoolOptions.StopThreadWhenQueueEmpty) == ThreadPoolOptions.StopThreadWhenQueueEmpty)
                                _Threads[ii].Abort();
                            else
                                Thread.Sleep(100);
                        }
                    }));
            }
        }

        public void Start()
        {
            for (int i = 0; i &lt; _ThreadCount; i++)
                _Threads[i].Start();
        }

        public void Abort()
        {
            for (int i = 0; i &lt; _ThreadCount; i++)
                _Threads[i].Abort();
        }

        public T GetNext()
        {
            lock(_Action)
            {
                if (_Queue.Count == 0)
                    return default(T);

                Done++;
                return _Queue.Dequeue();
            }
        }

        public float GetQueueProgress()
        {
            lock (_Action)
            {
                return Added / Done;
            }
        }

        public void Enqueu(T Arg)
        {
            lock (_Action)
            {
                Added++;
                _Queue.Enqueue(Arg);
            }
        }
    }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://xiatek.org/?feed=rss2&#038;p=311</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bit Orchestra</title>
		<link>http://xiatek.org/?p=296</link>
		<comments>http://xiatek.org/?p=296#comments</comments>
		<pubDate>Sun, 13 Nov 2011 20:48:09 +0000</pubDate>
		<dc:creator>drschnz</dc:creator>
				<category><![CDATA[DrSchnz]]></category>

		<guid isPermaLink="false">http://xiatek.org/?p=296</guid>
		<description><![CDATA[Run a C program such as int main() { int t; for (t = 0;;t++) { putchar((t &#62;&#62; 6 &#124; t &#124; t &#62;&#62; (t &#62;&#62; 16)) * 10 + ((t &#62;&#62; 11) &#38; 7)); } } and you&#8217;ll get pseudo-random gibberish, but pipe the output of the same program into a 8-bit 8kHz pcm sound [...]]]></description>
			<content:encoded><![CDATA[<p>Run a C program such as</p>
<pre class="c">int main() {
    int t;
    for (t = 0;;t++) {
        putchar((t &gt;&gt; 6 | t | t &gt;&gt; (t &gt;&gt; 16)) * 10 + ((t &gt;&gt; 11) &amp; 7));
    }
}</pre>
<p>and you&#8217;ll get pseudo-random gibberish, but pipe the output of the same program into a 8-bit 8kHz pcm sound device and you&#8217;ll get something not far from a <a href="http://www.youtube.com/watch?feature=player_detailpage&#038;v=qlrs2Vorw2Y#t=16s">chip-tune symphony</a>. There&#8217;s been a recent <a href="http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html">trend</a> in the demoscene community of making simple, short programs that produce surprisingly complex music. Now, I don&#8217;t have anything for the hardcore demoscene artists who want to fit a techno song in a 12 byte program, but I do have something for those who want to experiment with algorithmic music.</p>
<p><img src="http://i.imgur.com/LbJ7L.png" alt="Bit Orchestra!" /></p>
<p>Bit Orchestra is a tool for quickly testing and prototyping expressions for create interesting noises (and sometimes even music!). It has some helpful music related functions and allows you to hear the output immediately. You can download Bit Orchestra <a href="https://github.com/downloads/dzamkov/Bit-Orchestra/BitOrchestra%20(1.2).zip">here</a> (sorry, Windows only, at the moment at least) or view the (MIT-licensed) source <a href="https://github.com/dzamkov/Bit-Orchestra">here</a>. Once you&#8217;ve download it, load and try out the included samples.</p>
<p>Also look at <a href="http://www.youtube.com/watch?feature=player_detailpage&amp;v=tCRPUv8V22o#t=314s">this</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://xiatek.org/?feed=rss2&#038;p=296</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Create ZIP archives in C#</title>
		<link>http://xiatek.org/?p=289</link>
		<comments>http://xiatek.org/?p=289#comments</comments>
		<pubDate>Fri, 07 Oct 2011 16:09:26 +0000</pubDate>
		<dc:creator>C0BRA</dc:creator>
				<category><![CDATA[C0BRA]]></category>

		<guid isPermaLink="false">http://xiatek.org/?p=289</guid>
		<description><![CDATA[I was looking for a way to do this not to long ago; I came across some examples that used a third party libary and was over complicated, so I created this class based of one of MSDNs examples. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO.Packaging; using System.IO; public class ZipSticle { [...]]]></description>
			<content:encoded><![CDATA[<p>I was looking for a way to do this not to long ago; I came across some examples that used a third party libary and was over complicated, so I created this class based of one of MSDNs examples.</p>
<pre name="code" class="c-sharp">
using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Text;  
using System.IO.Packaging;  
using System.IO;  

public class ZipSticle  
{  
    Package package;  

    public ZipSticle(Stream s)  
    {  
        package = ZipPackage.Open(s, FileMode.Create);  
    }  

    public void Add(Stream stream, string Name)  
    {  
        Uri partUriDocument = PackUriHelper.CreatePartUri(new Uri(Name, UriKind.Relative));  
        PackagePart packagePartDocument = package.CreatePart(partUriDocument, "");  

        CopyStream(stream, packagePartDocument.GetStream());  
        stream.Close();  
    }  

    private static void CopyStream(Stream source, Stream target)  
    {  
        const int bufSize = 0x1000;  
        byte[] buf = new byte[bufSize];  
        int bytesRead = 0;  
        while ((bytesRead = source.Read(buf, 0, bufSize)) > 0)  
            target.Write(buf, 0, bytesRead);  
    }  

    public void Close()  
    {  
        package.Close();  
    }  
}
</pre>
<p>You can then use it like this:</p>
<pre name="code" class="c-sharp">
FileStream str = File.Open("MyAwesomeZip.zip", FileMode.Create);  
ZipSticle zip = new ZipSticle(str);  

zip.Add(File.OpenRead("C:/Users/C0BRA/SimpleFile.txt"), "Some directory/SimpleFile.txt");  
zip.Add(File.OpenRead("C:/Users/C0BRA/Hurp.derp"), "hurp.Derp");  

zip.Close();
str.Close();
</pre>
<p>You can pass a MemoryStream (or any Stream) to ZipSticle.Add such as:</p>
<pre name="code" class="c-sharp">
FileStream str = File.Open("MyAwesomeZip.zip", FileMode.Create);  
ZipSticle zip = new ZipSticle(str);  

byte[] fileinmem = new byte[1000];
// Do stuff to FileInMemory
MemoryStream memstr = new MemoryStream(fileinmem);
zip.Add(memstr, "Some directory/SimpleFile.txt");

memstr.Close();
zip.Close();
str.Close();
</pre>
]]></content:encoded>
			<wfw:commentRss>http://xiatek.org/?feed=rss2&#038;p=289</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MineViewer 1.6 Update</title>
		<link>http://xiatek.org/?p=265</link>
		<comments>http://xiatek.org/?p=265#comments</comments>
		<pubDate>Thu, 26 May 2011 14:40:25 +0000</pubDate>
		<dc:creator>C0BRA</dc:creator>
				<category><![CDATA[MineViewer]]></category>

		<guid isPermaLink="false">http://xiatek.org/?p=265</guid>
		<description><![CDATA[Added the new block types: Booster TrackPressurePad TrapDoor Bed Web TallGrass DeadShrubs And fixed a bug that stopped you from opening your save while Minecraft is currently running. Download: MediaFire]]></description>
			<content:encoded><![CDATA[<p>Added the new block types:</p>
<ul>
<li>Booster</li>
<li>TrackPressurePad</li>
<li>TrapDoor</li>
<li>Bed</li>
<li>Web</li>
<li>TallGrass</li>
<li>DeadShrubs</li>
</ul>
<p>And fixed a bug that stopped you from opening your save while Minecraft is currently running.</p>
<p>Download:<br />
<a title="MediaFire" href="http://www.mediafire.com/?qud19itno1qt0oi" target="_blank"> MediaFire</a></p>
]]></content:encoded>
			<wfw:commentRss>http://xiatek.org/?feed=rss2&#038;p=265</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>
