<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments for Rustam&#039;s techno-feed</title>
	<atom:link href="http://blog.avangardo.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.avangardo.com</link>
	<description>Navigation and Programming</description>
	<lastBuildDate>Sat, 15 Oct 2011 20:48:53 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>Comment on Ubuntu update 11.10 Oneric by Rustam Kulenov</title>
		<link>http://blog.avangardo.com/2011/10/ubuntu-update-11-10-oneric/#comment-339</link>
		<dc:creator>Rustam Kulenov</dc:creator>
		<pubDate>Sat, 15 Oct 2011 20:48:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.avangardo.com/?p=429#comment-339</guid>
		<description>And finally I received this:
&lt;img src=&quot;http://blog.avangardo.com/wp-content/uploads/2011/10/upgrade_bug.png&quot;/&gt;
After reboot my KMail stopped working, so now I don&#039;t have email client.</description>
		<content:encoded><![CDATA[<p>And finally I received this:<br />
<img src="http://blog.avangardo.com/wp-content/uploads/2011/10/upgrade_bug.png"/><br />
After reboot my KMail stopped working, so now I don&#8217;t have email client.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on C# implementation of Bezier curvature calculation by Jason</title>
		<link>http://blog.avangardo.com/2010/10/c-implementation-of-bezier-curvature-calculation/#comment-232</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Wed, 10 Aug 2011 14:39:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.avangardo.com/?p=202#comment-232</guid>
		<description>whoops, 

I am assuming r1 would turn into
double r1 = System.Math.Sqrt(System.Math.Pow(d1.X * d1.X + d1.Y * d1.Y + d1.Z * d1.Z, 3));</description>
		<content:encoded><![CDATA[<p>whoops, </p>
<p>I am assuming r1 would turn into<br />
double r1 = System.Math.Sqrt(System.Math.Pow(d1.X * d1.X + d1.Y * d1.Y + d1.Z * d1.Z, 3));</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on C# implementation of Bezier curvature calculation by Jason</title>
		<link>http://blog.avangardo.com/2010/10/c-implementation-of-bezier-curvature-calculation/#comment-231</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Wed, 10 Aug 2011 14:37:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.avangardo.com/?p=202#comment-231</guid>
		<description>Hello,
Very good article and easy to follow code.
I am trying to implement this but for a 3d bezier curve. It seems mostly straight forward until the final  curvature calculation:

 double r1 = System.Math.Sqrt(System.Math.Pow(d1.X * d1.X + d1.Y * d1.Y, 3));
 double r2 = System.Math.Abs(d1.X * d2.Y - d2.X * d1.Y);

I am assuming r1 would turn into 
 double r1 = System.Math.Sqrt(System.Math.Pow(d1.X * d1.X + d1.Y * d1.Y, 3));
but what about r2? Are you able to provide any insight?</description>
		<content:encoded><![CDATA[<p>Hello,<br />
Very good article and easy to follow code.<br />
I am trying to implement this but for a 3d bezier curve. It seems mostly straight forward until the final  curvature calculation:</p>
<p> double r1 = System.Math.Sqrt(System.Math.Pow(d1.X * d1.X + d1.Y * d1.Y, 3));<br />
 double r2 = System.Math.Abs(d1.X * d2.Y &#8211; d2.X * d1.Y);</p>
<p>I am assuming r1 would turn into<br />
 double r1 = System.Math.Sqrt(System.Math.Pow(d1.X * d1.X + d1.Y * d1.Y, 3));<br />
but what about r2? Are you able to provide any insight?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Calculating tilt from acceleration by Rustam Kulenov</title>
		<link>http://blog.avangardo.com/2010/09/calculating-tilt-from-acceleration/#comment-219</link>
		<dc:creator>Rustam Kulenov</dc:creator>
		<pubDate>Fri, 05 Aug 2011 10:36:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.avangardo.com/?p=36#comment-219</guid>
		<description>&lt;a href=&quot;#comment-218&quot; rel=&quot;nofollow&quot;&gt;@Chi Yong &lt;/a&gt; 
Sure, I will try to post source code this weekend.
Did you connect to the device and can you see Witilt&#039;s data using console as shown on the following link?
http://blog.avangardo.com/2010/09/witilt-wireless-accelerometergyrotilt-controller/</description>
		<content:encoded><![CDATA[<p><a href="#comment-218" rel="nofollow">@Chi Yong </a><br />
Sure, I will try to post source code this weekend.<br />
Did you connect to the device and can you see Witilt&#8217;s data using console as shown on the following link?<br />
<a href="http://blog.avangardo.com/2010/09/witilt-wireless-accelerometergyrotilt-controller/" rel="nofollow">http://blog.avangardo.com/2010/09/witilt-wireless-accelerometergyrotilt-controller/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Calculating tilt from acceleration by Chi Yong</title>
		<link>http://blog.avangardo.com/2010/09/calculating-tilt-from-acceleration/#comment-218</link>
		<dc:creator>Chi Yong</dc:creator>
		<pubDate>Fri, 05 Aug 2011 03:42:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.avangardo.com/?p=36#comment-218</guid>
		<description>Im getting trouble of reading raw data fr witilt....
Can i have ur source code for reference?
Thanks...</description>
		<content:encoded><![CDATA[<p>Im getting trouble of reading raw data fr witilt&#8230;.<br />
Can i have ur source code for reference?<br />
Thanks&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Asynchronous VS synchronous UDP reads on a heavily loaded feeds. by Rustam Kulenov</title>
		<link>http://blog.avangardo.com/2011/02/asynchronous-vs-synchronous-udp-reads-on-a-heavily-loaded-feeds/#comment-106</link>
		<dc:creator>Rustam Kulenov</dc:creator>
		<pubDate>Sun, 17 Apr 2011 19:02:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.avangardo.com/?p=239#comment-106</guid>
		<description>&lt;pre class=&quot;brush:csharp; collapse:false; gutter: false;&quot;&gt;
internal abstract class UdpReader
{
    /// Maximum buffer size.
    private const int BUFFER_SIZE = 0xffff;

    #region Private fields
    /// Local interface that will receive messages sent to multicast group.
    private IPAddress _iface;

    /// IP address and port for connecting to the multicast group.
    private IPEndPoint _group;

    /// UDP socket to read data from.
    private Socket _socket;

    /// Asynchronous socket operation argument.
    private SocketAsyncEventArgs _socketAsyncArgs;

    /// Buffer which contains received data. The same buffer is provided
    /// for socket reading operation and for FIX/FAST processor.
    private byte[] _buffer = new byte[BUFFER_SIZE];

    /// A value indicating whenter parser is active and should process incoming data.
    private bool _working = false;

    /// This event is in signaled state when the parser is safe to be stopped.
    private ManualResetEvent _safeToStopEvent = new ManualResetEvent(true);

    /// Critical section used to protect parser state (during start and stop).
    private object _stateSync = new object();

    #endregion

    /// Initializes a new instance of the UdpReader&quot; class.
    /// &lt;param name=&quot;iface&quot;&gt;Local IP address used for reading UDP multicast messages.&lt;/param&gt;
    /// &lt;param name=&quot;multicastGroup&quot;&gt;IP address and port of multicast group to listen to.&lt;/param&gt;
    public UdpReader(string iface, IPEndPoint multicastGroup)
    {
        _iface = IPAddress.Parse(iface);
        _group = multicastGroup;

        _socketAsyncArgs = _socketAsyncArgs = new SocketAsyncEventArgs();
        _socketAsyncArgs.Completed += receiveCallback;
        _socketAsyncArgs.SetBuffer(_buffer, 0, BUFFER_SIZE);
    }

    /// Starts the parser.
    public virtual void Start()
    {
        lock (_stateSync)
        {
            _working = true;

            if (!initSocket())
            {
                return;
            }

            _socket.ReceiveAsync(_socketAsyncArgs);
        }
    }

    /// Stops the parser.
    public virtual void Stop()
    {
        lock (_stateSync)
        {
            // stop working thread
            _working = false;
            Thread.Sleep(100);
            _safeToStopEvent.WaitOne(2000);
            releaseSocket();
        }
    }

    /// This callback method is called when new data is received via UDP.
    private void receiveCallback(object src, SocketAsyncEventArgs socketAsyncArgs)
    {
        if (!_working)
        {
            return;
        }

        _safeToStopEvent.Reset();
        try
        {            
            // TODO: Decode and process FAST here.
            // Note, that method called from here will be executed in ThreadPool&#039;s thread.
            // socketAsyncArgs.BytesTransferred shows number of bytes received via UDP

            // Read next UDP datagram.
            if (_working)
            {
                _socket.ReceiveAsync(socketAsyncArgs);
            }
        }
        finally
        {
            _safeToStopEvent.Set();
        }
    }

    /// Initializes the socket object and joins to the multicast group.
    private bool initSocket()
    {  }

    /// Leaves the multicast group and releases the socket object.
    private void releaseSocket()
    {  }
}&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<pre class="brush:csharp; collapse:false; gutter: false;">
internal abstract class UdpReader
{
    /// Maximum buffer size.
    private const int BUFFER_SIZE = 0xffff;

    #region Private fields
    /// Local interface that will receive messages sent to multicast group.
    private IPAddress _iface;

    /// IP address and port for connecting to the multicast group.
    private IPEndPoint _group;

    /// UDP socket to read data from.
    private Socket _socket;

    /// Asynchronous socket operation argument.
    private SocketAsyncEventArgs _socketAsyncArgs;

    /// Buffer which contains received data. The same buffer is provided
    /// for socket reading operation and for FIX/FAST processor.
    private byte[] _buffer = new byte[BUFFER_SIZE];

    /// A value indicating whenter parser is active and should process incoming data.
    private bool _working = false;

    /// This event is in signaled state when the parser is safe to be stopped.
    private ManualResetEvent _safeToStopEvent = new ManualResetEvent(true);

    /// Critical section used to protect parser state (during start and stop).
    private object _stateSync = new object();

    #endregion

    /// Initializes a new instance of the UdpReader" class.
    /// &lt;param name="iface"&gt;Local IP address used for reading UDP multicast messages.&lt;/param&gt;
    /// &lt;param name="multicastGroup"&gt;IP address and port of multicast group to listen to.&lt;/param&gt;
    public UdpReader(string iface, IPEndPoint multicastGroup)
    {
        _iface = IPAddress.Parse(iface);
        _group = multicastGroup;

        _socketAsyncArgs = _socketAsyncArgs = new SocketAsyncEventArgs();
        _socketAsyncArgs.Completed += receiveCallback;
        _socketAsyncArgs.SetBuffer(_buffer, 0, BUFFER_SIZE);
    }

    /// Starts the parser.
    public virtual void Start()
    {
        lock (_stateSync)
        {
            _working = true;

            if (!initSocket())
            {
                return;
            }

            _socket.ReceiveAsync(_socketAsyncArgs);
        }
    }

    /// Stops the parser.
    public virtual void Stop()
    {
        lock (_stateSync)
        {
            // stop working thread
            _working = false;
            Thread.Sleep(100);
            _safeToStopEvent.WaitOne(2000);
            releaseSocket();
        }
    }

    /// This callback method is called when new data is received via UDP.
    private void receiveCallback(object src, SocketAsyncEventArgs socketAsyncArgs)
    {
        if (!_working)
        {
            return;
        }

        _safeToStopEvent.Reset();
        try
        {
            // TODO: Decode and process FAST here.
            // Note, that method called from here will be executed in ThreadPool's thread.
            // socketAsyncArgs.BytesTransferred shows number of bytes received via UDP

            // Read next UDP datagram.
            if (_working)
            {
                _socket.ReceiveAsync(socketAsyncArgs);
            }
        }
        finally
        {
            _safeToStopEvent.Set();
        }
    }

    /// Initializes the socket object and joins to the multicast group.
    private bool initSocket()
    {  }

    /// Leaves the multicast group and releases the socket object.
    private void releaseSocket()
    {  }
}</pre>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Asynchronous VS synchronous UDP reads on a heavily loaded feeds. by Rustam Kulenov</title>
		<link>http://blog.avangardo.com/2011/02/asynchronous-vs-synchronous-udp-reads-on-a-heavily-loaded-feeds/#comment-105</link>
		<dc:creator>Rustam Kulenov</dc:creator>
		<pubDate>Sun, 17 Apr 2011 19:02:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.avangardo.com/?p=239#comment-105</guid>
		<description>&lt;a href=&quot;#comment-104&quot; rel=&quot;nofollow&quot;&gt;@Niru &lt;/a&gt; , as I can see decodeMessage() is private - is it your class method? Do you really have access to it? Moreover decodeMessage() shall be called right after EndReceive() before next call to BeginReceive(). You should also pay attention to threads synchronization, because receiveCallback() will be called from some ThreadPool&#039;s thread.
I can show you how to implement this using .Net 3.5 specific methods, but it is very similar to .Net 2:</description>
		<content:encoded><![CDATA[<p><a href="#comment-104" rel="nofollow">@Niru </a> , as I can see decodeMessage() is private &#8211; is it your class method? Do you really have access to it? Moreover decodeMessage() shall be called right after EndReceive() before next call to BeginReceive(). You should also pay attention to threads synchronization, because receiveCallback() will be called from some ThreadPool&#8217;s thread.<br />
I can show you how to implement this using .Net 3.5 specific methods, but it is very similar to .Net 2:</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Asynchronous VS synchronous UDP reads on a heavily loaded feeds. by Niru</title>
		<link>http://blog.avangardo.com/2011/02/asynchronous-vs-synchronous-udp-reads-on-a-heavily-loaded-feeds/#comment-104</link>
		<dc:creator>Niru</dc:creator>
		<pubDate>Sun, 17 Apr 2011 17:57:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.avangardo.com/?p=239#comment-104</guid>
		<description>Hi Rustam Kulenov,

Thank you very much for your response.

My 3rd party lib call is like

      private void decodeMessage(byte[] aBuf)
        {
            //...
        }


Your code receiveCallback..

&lt;pre class=&quot;brush:csharp; collapse:false; gutter: false;&quot;&gt;
 	private void receiveCallback(IAsyncResult ar)
        {            
            int bytesRead = _socket.EndReceive(ar);
            Counter += bytesRead;
            _socket.BeginReceive(buf, 0, MAX_UDP_PACKET, SocketFlags.None, receiveCallback, null);

            //can i call the decode method here and pass the Buf parameter?
           
            decodeMessage(buf);
        }
&lt;/pre&gt;

Is this okay? any issues do you find? Kindly advise.

Best regards,
Niru</description>
		<content:encoded><![CDATA[<p>Hi Rustam Kulenov,</p>
<p>Thank you very much for your response.</p>
<p>My 3rd party lib call is like</p>
<p>      private void decodeMessage(byte[] aBuf)<br />
        {<br />
            //&#8230;<br />
        }</p>
<p>Your code receiveCallback..</p>
<pre class="brush:csharp; collapse:false; gutter: false;">
 	private void receiveCallback(IAsyncResult ar)
        {
            int bytesRead = _socket.EndReceive(ar);
            Counter += bytesRead;
            _socket.BeginReceive(buf, 0, MAX_UDP_PACKET, SocketFlags.None, receiveCallback, null);

            //can i call the decode method here and pass the Buf parameter?

            decodeMessage(buf);
        }
</pre>
<p>Is this okay? any issues do you find? Kindly advise.</p>
<p>Best regards,<br />
Niru</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Asynchronous VS synchronous UDP reads on a heavily loaded feeds. by Rustam Kulenov</title>
		<link>http://blog.avangardo.com/2011/02/asynchronous-vs-synchronous-udp-reads-on-a-heavily-loaded-feeds/#comment-103</link>
		<dc:creator>Rustam Kulenov</dc:creator>
		<pubDate>Sun, 17 Apr 2011 15:36:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.avangardo.com/?p=239#comment-103</guid>
		<description>&lt;a href=&quot;#comment-102&quot; rel=&quot;nofollow&quot;&gt;@Niru &lt;/a&gt; unfortunattely I don&#039;t know what 3rd party library do you use and what interface does it have. Can it receive IStream as input? If yes, then you can create and provide MemoryStream.</description>
		<content:encoded><![CDATA[<p><a href="#comment-102" rel="nofollow">@Niru </a> unfortunattely I don&#8217;t know what 3rd party library do you use and what interface does it have. Can it receive IStream as input? If yes, then you can create and provide MemoryStream.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Asynchronous VS synchronous UDP reads on a heavily loaded feeds. by Niru</title>
		<link>http://blog.avangardo.com/2011/02/asynchronous-vs-synchronous-udp-reads-on-a-heavily-loaded-feeds/#comment-102</link>
		<dc:creator>Niru</dc:creator>
		<pubDate>Sat, 16 Apr 2011 17:08:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.avangardo.com/?p=239#comment-102</guid>
		<description>Hi Rustam Kulenov,

Thank you very much for your response.

I have a third party component for decoding of FAST messages.

What I am looking is that how to pass the buf var as input to that third party component?

You have line in the receiveCallback

_socket.BeginReceive(buf, 0, MAX_UDP_PACKET, SocketFlags.None, receiveCallback, null);

Best regards,
Niru</description>
		<content:encoded><![CDATA[<p>Hi Rustam Kulenov,</p>
<p>Thank you very much for your response.</p>
<p>I have a third party component for decoding of FAST messages.</p>
<p>What I am looking is that how to pass the buf var as input to that third party component?</p>
<p>You have line in the receiveCallback</p>
<p>_socket.BeginReceive(buf, 0, MAX_UDP_PACKET, SocketFlags.None, receiveCallback, null);</p>
<p>Best regards,<br />
Niru</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- This Quick Cache file was built for (  blog.avangardo.com/comments/feed/ ) in 0.31171 seconds, on Feb 23rd, 2012 at 1:30 pm UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 23rd, 2012 at 2:30 pm UTC -->
