<?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>Ian Mercer &#187; LINQ</title>
	<atom:link href="http://blog.abodit.com/tag/linq/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.abodit.com</link>
	<description>Living in the World&#039;s Smartest House</description>
	<lastBuildDate>Sat, 07 Jan 2012 19:50:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Home Automation with Voxeo (VoxML/Voice XML)</title>
		<link>http://blog.abodit.com/2010/01/home-automation-with-voxeo/</link>
		<comments>http://blog.abodit.com/2010/01/home-automation-with-voxeo/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 18:31:57 +0000</pubDate>
		<dc:creator>Ian Mercer</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Home Automation]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[VoiceXML]]></category>
		<category><![CDATA[Voxeo]]></category>

		<guid isPermaLink="false">http://blog.abodit.com/?p=247</guid>
		<description><![CDATA[One of the features of my home automation system is the ability to call the house up and speak to it to ask it to do things. To enable this I&#8217;m using Voxeo and their excellent developer program which gives me an inbound phone number and the ability to host a VoiceXML application with voice <a href="http://blog.abodit.com/2010/01/home-automation-with-voxeo/" class="more-link">More &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>One of the features of my home automation system is the ability to call the house up and speak to it to ask it to do things.  To enable this I&#8217;m using Voxeo and their <a href="http://www.voxeo.com/developers/evolution-ivr-developer.jsp">excellent developer program</a> which gives me an inbound phone number and the ability to host a VoiceXML application with voice recognition and text to speech.</p>
<p>Using Linq-to-XML I can build the required VoiceXML hand it off to Voxeo when they request it during an incoming call, e.g.</p>
<blockquote><p>XDocument doc = new XDocument(<br />
new XDeclaration(&#8220;1.0&#8243;, &#8220;utf-8&#8243;, &#8220;yes&#8221;),<br />
new XComment(&#8220;Voice XML feed&#8221;),<br />
new XElement(&#8220;vxml&#8221;, new XAttribute(&#8220;version&#8221;, &#8220;2.1&#8243;),<br />
new XElement(&#8220;form&#8221;, new XAttribute(&#8220;id&#8221;, &#8220;MainMenu&#8221;),<br />
new XElement(&#8220;field&#8221;, new XAttribute(&#8220;name&#8221;, &#8220;room&#8221;), hereswhatIdid,<br />
new XElement(&#8220;grammar&#8221;, new XAttribute(&#8220;type&#8221;, &#8220;text/gsl&#8221;),<br />
new XCData(<br />
&#8220;[" +<br />
@" [ " + WholeHouseGrammar() + " ]&#8221; +<br />
&#8220;]&#8221;)),<br />
new XElement(&#8220;noinput&#8221;, &#8220;I did not hear anything.  Please try again&#8221;, new XElement(&#8220;reprompt&#8221;)),<br />
new XElement(&#8220;nomatch&#8221;, &#8220;I did not recognize that command.  Please try again&#8221;, new XElement(&#8220;reprompt&#8221;))), &#8230;</p></blockquote>
<p>The &#8216;WholeHouseGrammar&#8217; is generated on the fly by examining the hierarchy of objects in the house so it includes every room, light, sprinkler, &#8230;</p>
<p>At present the house only understands on/off commands but in the future I hope to hook it up to the natural language engine so that the grammar is instead constructed dynamically from every sentence that the house understands today when you chat to it.</p>
<p>So currently you say things like &#8216;Front right sprinklers on&#8217; when you notice the lawn needs an extra cycle as you drive out the house.  In the future you&#8217;ll be able to ask it more complex questions like &#8216;who called last week on friday after 4pm?&#8217; which is a question it can already handle using the chat interface.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.abodit.com/2010/01/home-automation-with-voxeo/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Tip: getting the index in a foreeach statement</title>
		<link>http://blog.abodit.com/2009/12/tip-getting-the-index-in-a-foreeach-statement/</link>
		<comments>http://blog.abodit.com/2009/12/tip-getting-the-index-in-a-foreeach-statement/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 01:44:00 +0000</pubDate>
		<dc:creator>Ian Mercer</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[LINQ]]></category>

		<guid isPermaLink="false">http://blog.abodit.com/?p=51</guid>
		<description><![CDATA[Using LINQ you can easily get at the index in a foreach statement.]]></description>
			<content:encoded><![CDATA[<p>Using LINQ you can easily get at the index in a foreach statement.</p>
<pre class="brush: csharp; title: ; notranslate">
List x = new List() {&quot;a&quot;, &quot;b&quot;, &quot;c&quot;};
var augmented = x.Select((item, index) =&gt; new { item = s, index = index });
foreach (var d in augmented)
{
  Console.WriteLine(d.item + &quot; &quot; + d.index);
}
Console.ReadKey();

a 0
b 1
c 2
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.abodit.com/2009/12/tip-getting-the-index-in-a-foreeach-statement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linq&#8217;s missing link</title>
		<link>http://blog.abodit.com/2009/03/linq-missing-linqkit/</link>
		<comments>http://blog.abodit.com/2009/03/linq-missing-linqkit/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 04:01:00 +0000</pubDate>
		<dc:creator>Ian Mercer</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[LINQ]]></category>

		<guid isPermaLink="false">http://blog.abodit.com/?p=20</guid>
		<description><![CDATA[I came across this library today and it rocks. http://www.albahari.com/nutshell/linqkit.aspx Without this library trying to pass Linq Expressions into Where clauses on Linq to Entities just didn&#8217;t work beyond some very simple (trivial) examples. With this library I can now combine multiple filter function expressions and pass them to my query, and it works as <a href="http://blog.abodit.com/2009/03/linq-missing-linqkit/" class="more-link">More &#62;</a>]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: 100%;"><span style="font-size: 180%;"><span style="font-weight: bold; font-family: arial;"> </span></span></span>I came across this library today and it rocks.  <a href="http://www.albahari.com/nutshell/linqkit.aspx">http://www.albahari.com/nutshell/linqkit.aspx</a></p>
<p>Without this library trying to pass Linq Expressions into Where clauses on Linq to Entities just didn&#8217;t work beyond some very simple (trivial) examples.</p>
<p>With this library I can now combine multiple filter function expressions and pass them to my query, and it works as intended:</p>
<p><span style="font-family: courier new;"> Expression&lt;func&lt;datetime,bool&gt;&gt; contains = ts.Contains;</span></p>
<p><span style="font-family: courier new;"> var query = from caller in dataContext.CallerIDLogs.AsExpandable()</span><br />
<span style="font-family: courier new;"> where contains.Invoke(caller.DateTime)</span><br />
<span style="font-family: courier new;"> select caller;</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.abodit.com/2009/03/linq-missing-linqkit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

