<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>me, q and kdb+</title>
	<atom:link href="http://lifeisalist.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://lifeisalist.wordpress.com</link>
	<description>Weblog about learning q and kdb+</description>
	<lastBuildDate>Mon, 16 Jan 2012 18:28:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='lifeisalist.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>me, q and kdb+</title>
		<link>http://lifeisalist.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://lifeisalist.wordpress.com/osd.xml" title="me, q and kdb+" />
	<atom:link rel='hub' href='http://lifeisalist.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Clever trick with exec</title>
		<link>http://lifeisalist.wordpress.com/2011/11/26/clever-trick-with-exec/</link>
		<comments>http://lifeisalist.wordpress.com/2011/11/26/clever-trick-with-exec/#comments</comments>
		<pubDate>Sat, 26 Nov 2011 23:41:34 +0000</pubDate>
		<dc:creator>enlistme</dc:creator>
				<category><![CDATA[kdb+]]></category>
		<category><![CDATA[q]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://lifeisalist.wordpress.com/?p=488</guid>
		<description><![CDATA[Shame on me that I didn&#8217;t know how clever the following syntax is exec a!b from tab It is quite possible that to achieve the same effect I have used something like (value d)[0]!(value d:exec a,b from tab)[1] Saying that &#8230; <a href="http://lifeisalist.wordpress.com/2011/11/26/clever-trick-with-exec/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lifeisalist.wordpress.com&amp;blog=8443923&amp;post=488&amp;subd=lifeisalist&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Shame on me that I didn&#8217;t know how clever the following syntax is</p>
<p><code>exec a!b from tab<br />
</code><br />
It is quite possible that to achieve the same effect I have used something like</p>
<p><code>(value d)[0]!(value d:exec a,b from tab)[1]<br />
</code></p>
<p>Saying that it is a coding horror is not enough&#8230;</p>
<p>Anyway, let&#8217;s look at the result of both queries which is exactly the same. However, the second approach is not only longer but also slower&#8230;</p>
<p>So what is the result? A dictionary that keys and values are based on columns&#8217; content. In other words <a title="exec Reference" href="http://code.kx.com/wiki/Reference/exec">exec</a> returns this</p>
<p><code>tab:([] a:0 1 2 3; b:`a`b`c`d)<br />
exec a!b from tab<br />
0| a<br />
1| b<br />
2| c<br />
3| d<br />
</code><br />
instead of<br />
<code><br />
exec a, b from tab<br />
a| 0 1 2 3<br />
b| a b c d<br />
</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lifeisalist.wordpress.com/488/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lifeisalist.wordpress.com/488/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lifeisalist.wordpress.com/488/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lifeisalist.wordpress.com/488/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lifeisalist.wordpress.com/488/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lifeisalist.wordpress.com/488/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lifeisalist.wordpress.com/488/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lifeisalist.wordpress.com/488/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lifeisalist.wordpress.com/488/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lifeisalist.wordpress.com/488/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lifeisalist.wordpress.com/488/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lifeisalist.wordpress.com/488/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lifeisalist.wordpress.com/488/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lifeisalist.wordpress.com/488/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lifeisalist.wordpress.com&amp;blog=8443923&amp;post=488&amp;subd=lifeisalist&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lifeisalist.wordpress.com/2011/11/26/clever-trick-with-exec/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bebe76a2e8a0c2978c763fe10d784377?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">enlistme</media:title>
		</media:content>
	</item>
		<item>
		<title>Dictionary lookup</title>
		<link>http://lifeisalist.wordpress.com/2011/11/18/dictionary-lookup/</link>
		<comments>http://lifeisalist.wordpress.com/2011/11/18/dictionary-lookup/#comments</comments>
		<pubDate>Fri, 18 Nov 2011 21:45:15 +0000</pubDate>
		<dc:creator>enlistme</dc:creator>
				<category><![CDATA[kdb+]]></category>
		<category><![CDATA[general]]></category>
		<category><![CDATA[q]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://lifeisalist.wordpress.com/?p=476</guid>
		<description><![CDATA[A dictionary is an ordered collection of key-value pairs. So if you want to find a specific value, you need to use a proper key, e.g. having a dictionary d:`a`b`c!1 `eo 3.0 you can lookup `b like this d[`b] `eo &#8230; <a href="http://lifeisalist.wordpress.com/2011/11/18/dictionary-lookup/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lifeisalist.wordpress.com&amp;blog=8443923&amp;post=476&amp;subd=lifeisalist&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A dictionary is an ordered collection of <em>key-value</em> pairs. So if you want to find a specific <em>value</em>, you need to use a proper <em>key</em>, e.g. having a dictionary</p>
<p><code> d:`a`b`c!1 `eo 3.0</code></p>
<p>you can lookup <em>`b</em> like this</p>
<p><code>d[`b]<br />
`eo<br />
</code></p>
<p>If you try to access a key that is out of dictionary domain, you will get a <em>null value</em> which type is the same as type of the first <em>value</em> in dictionary, e.g.</p>
<p><code>d[`outOfDomain]<br />
0N</code></p>
<p>And now comes a tricky thing. What will happen if the first value is&#8230; a table? It has no null value so what kind of result we can expect? Well&#8230; a table schema. Similarly, for a dictionary &#8220;<em>a null value&#8221;</em> is an empty dictionary and for enumeration &#8211; an empty list.</p>
<p><code>d:`a`b`c!(([] c1:til 3;c2:3?`4);`ooo;3.0)</p>
<p>d[`a]<br />
c1 c2<br />
-------<br />
0 milg<br />
1 igfb<br />
2 kaod</p>
<p>d[`outOfDomain]<br />
c1 c2<br />
-------</p>
<p></code></p>
<p>You should be especially aware of that when testing lookup results. If dictionary contains complex types in its range list, using <a title="null function" href="http://code.kx.com/wiki/Reference/null">null</a> will not be enough. And you will <strong>not</strong> get any error.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lifeisalist.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lifeisalist.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lifeisalist.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lifeisalist.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lifeisalist.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lifeisalist.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lifeisalist.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lifeisalist.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lifeisalist.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lifeisalist.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lifeisalist.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lifeisalist.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lifeisalist.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lifeisalist.wordpress.com/476/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lifeisalist.wordpress.com&amp;blog=8443923&amp;post=476&amp;subd=lifeisalist&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lifeisalist.wordpress.com/2011/11/18/dictionary-lookup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bebe76a2e8a0c2978c763fe10d784377?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">enlistme</media:title>
		</media:content>
	</item>
		<item>
		<title>Geeky table&#8217;s schema definition</title>
		<link>http://lifeisalist.wordpress.com/2011/11/10/geeky-tables-schema-definition/</link>
		<comments>http://lifeisalist.wordpress.com/2011/11/10/geeky-tables-schema-definition/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 20:03:32 +0000</pubDate>
		<dc:creator>enlistme</dc:creator>
				<category><![CDATA[kdb+]]></category>
		<category><![CDATA[q]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://lifeisalist.wordpress.com/?p=467</guid>
		<description><![CDATA[Table&#8217;s schema in q is simply an empty table with fixed column types. It can be defined like that tab:([] c1:`int$(); c2:`symbol$(); c3:`date$()) or like that tab:([] c1:0#0N; c2:0#`; c3:0#0Nd) The second definition is less obvious but&#8230; it is still &#8230; <a href="http://lifeisalist.wordpress.com/2011/11/10/geeky-tables-schema-definition/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lifeisalist.wordpress.com&amp;blog=8443923&amp;post=467&amp;subd=lifeisalist&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Table&#8217;s schema in <a title="q programming language" href="http://en.wikipedia.org/wiki/Q_%28programming_language_from_Kx_Systems%29">q </a>is simply an empty table with fixed column types. It can be defined like that</p>
<p><code>tab:([] c1:`int$(); c2:`symbol$(); c3:`date$())<br />
</code></p>
<p>or like that</p>
<p><code>tab:([] c1:0#0N; c2:0#`; c3:0#0Nd)<br />
</code></p>
<p>The second definition is less obvious but&#8230; it is still easy to understand if compared to this fancy piece of code</p>
<p><code>tab:flip (`c1`c2`c3)!"ISD"$\:()</code></p>
<p>I wonder which of those is used by q-gods <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lifeisalist.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lifeisalist.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lifeisalist.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lifeisalist.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lifeisalist.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lifeisalist.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lifeisalist.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lifeisalist.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lifeisalist.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lifeisalist.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lifeisalist.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lifeisalist.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lifeisalist.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lifeisalist.wordpress.com/467/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lifeisalist.wordpress.com&amp;blog=8443923&amp;post=467&amp;subd=lifeisalist&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lifeisalist.wordpress.com/2011/11/10/geeky-tables-schema-definition/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bebe76a2e8a0c2978c763fe10d784377?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">enlistme</media:title>
		</media:content>
	</item>
		<item>
		<title>Listing namespaces</title>
		<link>http://lifeisalist.wordpress.com/2011/11/08/how-to-list-namespaces/</link>
		<comments>http://lifeisalist.wordpress.com/2011/11/08/how-to-list-namespaces/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 19:56:10 +0000</pubDate>
		<dc:creator>enlistme</dc:creator>
				<category><![CDATA[kdb+]]></category>
		<category><![CDATA[q]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://lifeisalist.wordpress.com/?p=456</guid>
		<description><![CDATA[If you are curious of namespaces existing in your q process, use key function with ` as parameter. Let&#8217;s check which namespaces exist when the process is started: q) key` `q`Q`h`o Moreover, you can use key to list the content &#8230; <a href="http://lifeisalist.wordpress.com/2011/11/08/how-to-list-namespaces/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lifeisalist.wordpress.com&amp;blog=8443923&amp;post=456&amp;subd=lifeisalist&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you are curious of namespaces existing in your <a title="q programming language" href="http://en.wikipedia.org/wiki/Q_(programming_language_from_Kx_Systems)">q</a> process, use <strong>key</strong> function with ` as parameter.</p>
<p>Let&#8217;s check which namespaces exist when the process is started:</p>
<p><code>q) key`<br />
`q`Q`h`o</code></p>
<p>Moreover, you can use <strong>key</strong> to list the content of namespace:<br />
<code>q) key `.foo<br />
`init`func`c<br />
</code></p>
<p>Note that in this way we get <strong>everything</strong> what resides in the namespace but we cannot distinguish between tables, functions and variables. If you need to list only one of these, use <a title="Command for listing tables" href="http://code.kx.com/wiki/JB:QforMortals2/commands_and_system_variables#Tables_.28.5Ca.29"><strong>\a</strong></a>, <a title="Command for listing functions" href="http://code.kx.com/wiki/JB:QforMortals2/commands_and_system_variables#Functions_.28.5Cf.29"><strong>\f</strong></a> or <a title="Command for listing variables" href="http://code.kx.com/wiki/JB:QforMortals2/commands_and_system_variables#Variables_.28.5Cv.29"><strong>\v</strong></a>, e.g.,</p>
<p><code>q) tab:([] a:1 2 3; b:`a`b`c)<br />
q)\a<br />
,`tab<br />
</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lifeisalist.wordpress.com/456/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lifeisalist.wordpress.com/456/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lifeisalist.wordpress.com/456/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lifeisalist.wordpress.com/456/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lifeisalist.wordpress.com/456/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lifeisalist.wordpress.com/456/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lifeisalist.wordpress.com/456/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lifeisalist.wordpress.com/456/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lifeisalist.wordpress.com/456/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lifeisalist.wordpress.com/456/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lifeisalist.wordpress.com/456/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lifeisalist.wordpress.com/456/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lifeisalist.wordpress.com/456/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lifeisalist.wordpress.com/456/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lifeisalist.wordpress.com&amp;blog=8443923&amp;post=456&amp;subd=lifeisalist&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lifeisalist.wordpress.com/2011/11/08/how-to-list-namespaces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bebe76a2e8a0c2978c763fe10d784377?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">enlistme</media:title>
		</media:content>
	</item>
		<item>
		<title>Integer pyramid</title>
		<link>http://lifeisalist.wordpress.com/2011/09/08/412/</link>
		<comments>http://lifeisalist.wordpress.com/2011/09/08/412/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 19:39:18 +0000</pubDate>
		<dc:creator>enlistme</dc:creator>
				<category><![CDATA[kdb+]]></category>
		<category><![CDATA[q]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://lifeisalist.wordpress.com/?p=412</guid>
		<description><![CDATA[How would you create such an output in q: ,0 0 1 0 1 2 0 1 2 3 0 1 2 3 4 Probably your solution would be like this: til each 1+til 5 But there is also other &#8230; <a href="http://lifeisalist.wordpress.com/2011/09/08/412/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lifeisalist.wordpress.com&amp;blog=8443923&amp;post=412&amp;subd=lifeisalist&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>How would you create such an output in <a title="q from Kx Systems" href="http://en.wikipedia.org/wiki/Q_%28programming_language_from_Kx_Systems%29">q</a>:</p>
<p><code>,0<br />
0 1<br />
0 1 2<br />
0 1 2 3<br />
0 1 2 3 4<br />
</code></p>
<p>Probably your solution would be like this:</p>
<p><code>til each 1+til 5</code></p>
<p>But there is also other way which is even faster:</p>
<p><code>enlist[enlist 0],0,\1+til 4</code></p>
<p>Well, at least my PC states that it is faster <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
<code><br />
q&gt; \t do[1000;enlist[enlist 0],0,\1+til 400]<br />
98<br />
q&gt; \t do[1000;til each 1+til 401]<br />
171</code></p>
<p><strong>Even Nicer Solution</strong></p>
<p>Instead of complicated</p>
<p><code>enlist[enlist 0],0,\1+til 400</code></p>
<p>use short and sweet</p>
<p><code>(,\) til 401</code></p>
<p>Thanks, Rs!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lifeisalist.wordpress.com/412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lifeisalist.wordpress.com/412/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lifeisalist.wordpress.com/412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lifeisalist.wordpress.com/412/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lifeisalist.wordpress.com/412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lifeisalist.wordpress.com/412/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lifeisalist.wordpress.com/412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lifeisalist.wordpress.com/412/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lifeisalist.wordpress.com/412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lifeisalist.wordpress.com/412/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lifeisalist.wordpress.com/412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lifeisalist.wordpress.com/412/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lifeisalist.wordpress.com/412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lifeisalist.wordpress.com/412/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lifeisalist.wordpress.com&amp;blog=8443923&amp;post=412&amp;subd=lifeisalist&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lifeisalist.wordpress.com/2011/09/08/412/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bebe76a2e8a0c2978c763fe10d784377?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">enlistme</media:title>
		</media:content>
	</item>
		<item>
		<title>q easter egg?</title>
		<link>http://lifeisalist.wordpress.com/2011/06/21/q-easter-egg/</link>
		<comments>http://lifeisalist.wordpress.com/2011/06/21/q-easter-egg/#comments</comments>
		<pubDate>Tue, 21 Jun 2011 08:26:15 +0000</pubDate>
		<dc:creator>enlistme</dc:creator>
				<category><![CDATA[Curios]]></category>
		<category><![CDATA[kdb+]]></category>
		<category><![CDATA[lists]]></category>

		<guid isPermaLink="false">http://lifeisalist.wordpress.com/?p=406</guid>
		<description><![CDATA[If you try to run 9 vs til 81, you will get two lists each with 81 values. And now try to invoke this with values other than 9 and 81 It seems that this behaviour was implemented to&#8230; solve &#8230; <a href="http://lifeisalist.wordpress.com/2011/06/21/q-easter-egg/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lifeisalist.wordpress.com&amp;blog=8443923&amp;post=406&amp;subd=lifeisalist&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you try to run <code>9 vs til 81</code>, you will get two lists each with 81 values. And now try to invoke this with values other than 9 and 81 <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>It seems that this behaviour was implemented to&#8230; <a title="Sudoku solvers in k and q" href="http://thesweeheng.wordpress.com/2008/11/30/more-sudoku-solvers-in-k-and-q/">solve sudoku</a>. The lists it generates corresponds to sudoku array or more precisely &#8211; indices of rows and columns.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lifeisalist.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lifeisalist.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lifeisalist.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lifeisalist.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lifeisalist.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lifeisalist.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lifeisalist.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lifeisalist.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lifeisalist.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lifeisalist.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lifeisalist.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lifeisalist.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lifeisalist.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lifeisalist.wordpress.com/406/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lifeisalist.wordpress.com&amp;blog=8443923&amp;post=406&amp;subd=lifeisalist&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lifeisalist.wordpress.com/2011/06/21/q-easter-egg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bebe76a2e8a0c2978c763fe10d784377?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">enlistme</media:title>
		</media:content>
	</item>
		<item>
		<title>Starting kdb+</title>
		<link>http://lifeisalist.wordpress.com/2011/06/12/starting-kdb/</link>
		<comments>http://lifeisalist.wordpress.com/2011/06/12/starting-kdb/#comments</comments>
		<pubDate>Sun, 12 Jun 2011 16:05:11 +0000</pubDate>
		<dc:creator>enlistme</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[general]]></category>
		<category><![CDATA[kdb+]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://lifeisalist.wordpress.com/?p=401</guid>
		<description><![CDATA[Tutorial section on code.kx.com has been lately extended with a very basic introduction to kdb+ by Chris Burke. Starting kdb+ is really helpful for kdb+ newbies and makes Q for Mortals  much easier to understand.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lifeisalist.wordpress.com&amp;blog=8443923&amp;post=401&amp;subd=lifeisalist&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a title="Kx Systems Tutorials" href="https://code.kx.com/trac/wiki/Tutorials">Tutorial section</a> on <a title="Kx Systems" href="http://code.kx.com">code.kx.com</a> has been lately extended with a very basic introduction to kdb+ by Chris Burke. <a title="Starting kdb+" href="https://code.kx.com/trac/wiki/Startingkdbplus/contents">Starting kdb+</a> is really helpful for kdb+ newbies and makes <a title="Q for Mortals" href="https://code.kx.com/trac/wiki/QforMortals2/contents">Q for Mortals  </a>much easier to understand.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lifeisalist.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lifeisalist.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lifeisalist.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lifeisalist.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lifeisalist.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lifeisalist.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lifeisalist.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lifeisalist.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lifeisalist.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lifeisalist.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lifeisalist.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lifeisalist.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lifeisalist.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lifeisalist.wordpress.com/401/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lifeisalist.wordpress.com&amp;blog=8443923&amp;post=401&amp;subd=lifeisalist&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lifeisalist.wordpress.com/2011/06/12/starting-kdb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bebe76a2e8a0c2978c763fe10d784377?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">enlistme</media:title>
		</media:content>
	</item>
		<item>
		<title>Rotate lists faster</title>
		<link>http://lifeisalist.wordpress.com/2011/05/15/rotate-lists-faster/</link>
		<comments>http://lifeisalist.wordpress.com/2011/05/15/rotate-lists-faster/#comments</comments>
		<pubDate>Sun, 15 May 2011 16:21:44 +0000</pubDate>
		<dc:creator>enlistme</dc:creator>
				<category><![CDATA[kdb+]]></category>
		<category><![CDATA[q]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://lifeisalist.wordpress.com/?p=396</guid>
		<description><![CDATA[If you want to rotate a list, you can simply use a built-in function called&#8230; rotate. However, the same can be done much faster using the following one liner rotate:{raze reverse (0,$[0&#62;y;count[x]+y;y])_x} This solution was originally proposed as a comment &#8230; <a href="http://lifeisalist.wordpress.com/2011/05/15/rotate-lists-faster/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lifeisalist.wordpress.com&amp;blog=8443923&amp;post=396&amp;subd=lifeisalist&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you want to rotate a list, you can simply use a built-in function called&#8230; <a href="https://code.kx.com/trac/wiki/Reference/rotate" title="rotate function">rotate</a>. However, the same can be done much faster using the following one liner</p>
<p><code>rotate:{raze reverse (0,$[0&gt;y;count[x]+y;y])_x}</code></p>
<p>This solution was originally proposed as a comment to <a href="http://lifeisalist.wordpress.com/2009/09/13/p19-rotate-a-list-n-places-to-the-left/" title="P19: Rotate a list N places to the left">P19: Rotate a list N places to the left</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lifeisalist.wordpress.com/396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lifeisalist.wordpress.com/396/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lifeisalist.wordpress.com/396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lifeisalist.wordpress.com/396/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lifeisalist.wordpress.com/396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lifeisalist.wordpress.com/396/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lifeisalist.wordpress.com/396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lifeisalist.wordpress.com/396/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lifeisalist.wordpress.com/396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lifeisalist.wordpress.com/396/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lifeisalist.wordpress.com/396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lifeisalist.wordpress.com/396/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lifeisalist.wordpress.com/396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lifeisalist.wordpress.com/396/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lifeisalist.wordpress.com&amp;blog=8443923&amp;post=396&amp;subd=lifeisalist&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lifeisalist.wordpress.com/2011/05/15/rotate-lists-faster/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bebe76a2e8a0c2978c763fe10d784377?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">enlistme</media:title>
		</media:content>
	</item>
		<item>
		<title>Mystery of functional select</title>
		<link>http://lifeisalist.wordpress.com/2011/05/09/mystert-of-functional-select/</link>
		<comments>http://lifeisalist.wordpress.com/2011/05/09/mystert-of-functional-select/#comments</comments>
		<pubDate>Mon, 09 May 2011 09:31:19 +0000</pubDate>
		<dc:creator>enlistme</dc:creator>
				<category><![CDATA[Curios]]></category>
		<category><![CDATA[q]]></category>

		<guid isPermaLink="false">http://lifeisalist.wordpress.com/?p=380</guid>
		<description><![CDATA[Probably most of q developers believe that functional select has only four parameters. Well, that is what we learn at least from Q for Mortals. But as I learned few weeks ago, functional select has in fact&#8230; six arguments! It &#8230; <a href="http://lifeisalist.wordpress.com/2011/05/09/mystert-of-functional-select/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lifeisalist.wordpress.com&amp;blog=8443923&amp;post=380&amp;subd=lifeisalist&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Probably most of <a title="q programming language" href="http://en.wikipedia.org/wiki/Q_(programming_language_from_Kx_Systems)">q </a>developers believe that functional select has only <strong>four</strong> parameters. Well, that is what we learn at least from <a title="Functional select in q-sql" href="https://code.kx.com/trac/wiki/QforMortals2/queries_q_sql#Functionalselect">Q for Mortals</a>. But as I learned few weeks ago, functional select has in fact&#8230; <strong>six arguments</strong>!</p>
<p>It is well-known that the general form of functional select is:<br />
<code><br />
?[t;c;b;a]<br />
</code><br />
where <em>t</em> is a table, <em>c</em> is a list of constraints, <em>b</em> is a by-phrase (dictionary of grouping specifications) and <em>a</em> is a dictionary of aggregations. However, it can be extended with two more values which let you extract only a subset of table.</p>
<p>The fifth parameter is perfect to extract <em>N </em>elements from the front or end of table. For example, to get first 10 elements use<br />
<code><br />
?[t;c;b;a;10]<br />
</code><br />
which is equal to<br />
<code><br />
10#?[t;c;b;a]<br />
</code><br />
or<br />
<code><br />
select[10] a by b from t where c<br />
</code><br />
And what is the use of sixth parameter? Well, it extracts rows based on the list of indices. For example, to get 1st, 5th and 10th row use<br />
<code><br />
?[t;();0b;();0W;1 5 10]<br />
</code><br />
which is equal to<br />
<code><br />
?[t;();0b;()] 1 5 10<br />
</code><br />
or<br />
<code><br />
?[t;enlist (in;`i;1 5 10);0b;()]<br />
</code></p>
<p>Degenerate form of functional select is then like:<br />
<code><br />
?[t;();0b;();0W;`i]</code></p>
<p>However, it seems that the use of additional parameters causes lower performance of  functional select. Perhaps it is why they are not mentioned in <a title="Functional select in q-sql" href="https://code.kx.com/trac/wiki/QforMortals2/queries_q_sql#Functionalselect">Q for Mortals</a>?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lifeisalist.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lifeisalist.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lifeisalist.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lifeisalist.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lifeisalist.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lifeisalist.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lifeisalist.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lifeisalist.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lifeisalist.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lifeisalist.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lifeisalist.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lifeisalist.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lifeisalist.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lifeisalist.wordpress.com/380/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lifeisalist.wordpress.com&amp;blog=8443923&amp;post=380&amp;subd=lifeisalist&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lifeisalist.wordpress.com/2011/05/09/mystert-of-functional-select/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bebe76a2e8a0c2978c763fe10d784377?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">enlistme</media:title>
		</media:content>
	</item>
		<item>
		<title>Kona &#8211; open source K3 implementation</title>
		<link>http://lifeisalist.wordpress.com/2011/05/06/kona-open-source-k3-implementation/</link>
		<comments>http://lifeisalist.wordpress.com/2011/05/06/kona-open-source-k3-implementation/#comments</comments>
		<pubDate>Fri, 06 May 2011 08:41:38 +0000</pubDate>
		<dc:creator>enlistme</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://lifeisalist.wordpress.com/?p=376</guid>
		<description><![CDATA[As mentioned in the header, Kona is an open source implementation of K3. Worth mentioning as it can be useful in learning K.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lifeisalist.wordpress.com&amp;blog=8443923&amp;post=376&amp;subd=lifeisalist&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As mentioned in the header, <a title="Open source K3 implementation" href="https://github.com/kevinlawler/kona">Kona</a> is an open source implementation of K3. Worth mentioning as it can be useful in learning <a title="K programming language" href="http://en.wikipedia.org/wiki/K_%28programming_language%29">K</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lifeisalist.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lifeisalist.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lifeisalist.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lifeisalist.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lifeisalist.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lifeisalist.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lifeisalist.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lifeisalist.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lifeisalist.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lifeisalist.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lifeisalist.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lifeisalist.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lifeisalist.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lifeisalist.wordpress.com/376/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lifeisalist.wordpress.com&amp;blog=8443923&amp;post=376&amp;subd=lifeisalist&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lifeisalist.wordpress.com/2011/05/06/kona-open-source-k3-implementation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bebe76a2e8a0c2978c763fe10d784377?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">enlistme</media:title>
		</media:content>
	</item>
	</channel>
</rss>
