<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Scripting StreamInsight queries</title><link>http://blogs.msdn.com/b/meek/archive/2010/08/31/scripting-streaminsight-queries.aspx</link><description>Over the past couple of weeks, a handful of people have asked for help dynamically creating StreamInsight queries. I usually scrawl some boxes and arrows on the whiteboard and say &amp;ldquo;you could try something like this&amp;hellip;&amp;rdquo; My hand-waving</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Scripting StreamInsight queries</title><link>http://blogs.msdn.com/b/meek/archive/2010/08/31/scripting-streaminsight-queries.aspx#10259979</link><pubDate>Tue, 24 Jan 2012 10:40:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10259979</guid><dc:creator>Anon44761</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I have the same problem as Cormac. I want to use the following query:&lt;/p&gt;
&lt;p&gt;from i in input1 where isEqualTo50(i.X) select i&amp;quot;&lt;/p&gt;
&lt;p&gt;where isEqualTo50 is a static function but i have the following error:&lt;/p&gt;
&lt;p&gt;The name isEqualTo50 does not exist in the current context&lt;/p&gt;
&lt;p&gt;Is there a way to do this?&lt;/p&gt;
&lt;p&gt;Thank you for your help, &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10259979" width="1" height="1"&gt;</description></item><item><title>re: Scripting StreamInsight queries</title><link>http://blogs.msdn.com/b/meek/archive/2010/08/31/scripting-streaminsight-queries.aspx#10255391</link><pubDate>Wed, 11 Jan 2012 05:57:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10255391</guid><dc:creator>Cormac</dc:creator><description>&lt;p&gt;Thanks for the great technique. I just came across it recently.&lt;/p&gt;
&lt;p&gt;One question though. I found a few useful query patterns on Linqpads sample streaminsight queries. One of them is DetectSpikes() for example and it&amp;#39;s signature is... &lt;/p&gt;
&lt;p&gt;CepStream&amp;lt;SpikeEvent&amp;gt; DetectSpikes&amp;lt;TInput&amp;gt;(&lt;/p&gt;
&lt;p&gt;	CepStream&amp;lt;TInput&amp;gt; inputStream, int threshold, double ratio, &lt;/p&gt;
&lt;p&gt;	TimeSpan windowSize, TimeSpan hopSize,&lt;/p&gt;
&lt;p&gt;	Expression&amp;lt;Func&amp;lt;TInput, int&amp;gt;&amp;gt; fieldSelector)&lt;/p&gt;
&lt;p&gt;If I wanted to try to parse something like this...&lt;/p&gt;
&lt;p&gt; &amp;quot;from e in DetectSpikes(inputstream, 40, 0.5, TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(1), w =&amp;gt; double.Parse(w.strValue)) select e&amp;quot;&lt;/p&gt;
&lt;p&gt;No surprise I get an error &amp;quot;The name &amp;#39;DetectSpikes&amp;#39; does not exist in the current context&amp;quot;. Is there any way to get this to work.&lt;/p&gt;
&lt;p&gt;Thanks for your help,&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10255391" width="1" height="1"&gt;</description></item><item><title>re: Scripting StreamInsight queries</title><link>http://blogs.msdn.com/b/meek/archive/2010/08/31/scripting-streaminsight-queries.aspx#10095357</link><pubDate>Tue, 23 Nov 2010 12:33:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10095357</guid><dc:creator>Klaus Aschenbrenner</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Do you also have an example available how to use the provided class &amp;quot;QueryTemplateScripter&amp;quot;? &lt;/p&gt;
&lt;p&gt;Thanks for your help&lt;/p&gt;
&lt;p&gt;Klaus Aschenbrenner&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://www.csharp.at"&gt;http://www.csharp.at&lt;/a&gt; | &lt;a rel="nofollow" target="_new" href="http://twitter.com/Aschenbrenner"&gt;twitter.com/Aschenbrenner&lt;/a&gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10095357" width="1" height="1"&gt;</description></item><item><title>re: Scripting StreamInsight queries</title><link>http://blogs.msdn.com/b/meek/archive/2010/08/31/scripting-streaminsight-queries.aspx#10057342</link><pubDate>Thu, 02 Sep 2010 16:22:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10057342</guid><dc:creator>Colin Meek</dc:creator><description>&lt;p&gt;@David: Thanks for the pointers! C# REPL looks pretty cool. &lt;/p&gt;
&lt;p&gt;The app domain solution works well for &amp;#39;remote&amp;#39; StreamInsight server instances since we can connect to the same server instance from the separate app domain. It doesn&amp;#39;t work as smoothly for an &amp;#39;embedded&amp;#39; StreamInsight server since the server and the query expression cannot cross the boundary -- they aren&amp;#39;t serializable. I&amp;#39;ve been toying with an alternate solution for the embedded case that exploits the query expression serialization support buried in the StreamInsight client SDK... I&amp;#39;ll let you know if I can figure it out.&lt;/p&gt;
&lt;p&gt;-Colin&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10057342" width="1" height="1"&gt;</description></item><item><title>re: Scripting StreamInsight queries</title><link>http://blogs.msdn.com/b/meek/archive/2010/08/31/scripting-streaminsight-queries.aspx#10057036</link><pubDate>Wed, 01 Sep 2010 23:28:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10057036</guid><dc:creator>David Cuccia</dc:creator><description>&lt;p&gt;Cool! Thanks for sharing.&lt;/p&gt;
&lt;p&gt;In related work, you might be aware of the C# REPL recently released by the Mono team as well:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://www.mono-project.com/CsharpRepl"&gt;www.mono-project.com/CsharpRepl&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Also, I ran across this post by Ayende recently: &lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://ayende.com/Blog/archive/2010/08/24/runtime-code-compilation-amp-collectible-assemblies-are-no-go.aspx"&gt;ayende.com/.../runtime-code-compilation-amp-collectible-assemblies-are-no-go.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;He found that he could not un-load the compiled queries, which became a memory leak. Work-around was to compile in a separate app domain and dump that process when the size got too big. Any thoughts?&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10057036" width="1" height="1"&gt;</description></item></channel></rss>