<?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>andrewlocatelliwoodcock</title>
	<atom:link href="http://andrewlocatelliwoodcock.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://andrewlocatelliwoodcock.com</link>
	<description>Thoughts on Software</description>
	<lastBuildDate>Tue, 07 May 2013 19:46:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='andrewlocatelliwoodcock.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/8e7b1360a2d9f95b5db95e0887f0fe43?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>andrewlocatelliwoodcock</title>
		<link>http://andrewlocatelliwoodcock.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://andrewlocatelliwoodcock.com/osd.xml" title="andrewlocatelliwoodcock" />
	<atom:link rel='hub' href='http://andrewlocatelliwoodcock.com/?pushpress=hub'/>
		<item>
		<title>Forcibly disconnecting users from a remote desktop session</title>
		<link>http://andrewlocatelliwoodcock.com/2012/11/28/forcibly-disconnecting-users-from-a-remote-desktop-session/</link>
		<comments>http://andrewlocatelliwoodcock.com/2012/11/28/forcibly-disconnecting-users-from-a-remote-desktop-session/#comments</comments>
		<pubDate>Wed, 28 Nov 2012 21:15:49 +0000</pubDate>
		<dc:creator>andrewlocatelliwoodcock</dc:creator>
				<category><![CDATA[Tools and commands]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[command line]]></category>

		<guid isPermaLink="false">http://andrewlocatelliwoodcock.com/?p=376</guid>
		<description><![CDATA[Following on from my last post on how to find out who is connected to a remote desktop session on  particular machine, there are occasions when you&#8217;ll want to actually forcibly disconnect someone so that you can log on to the machine yourself. Turns out that there&#8217;s a command for that &#8230; There&#8217;s a two [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewlocatelliwoodcock.com&#038;blog=22536494&#038;post=376&#038;subd=andrewlocatelliwoodcock&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Following on from my last <a title="Find out who’s logged on to a Remote Desktop Session" href="http://andrewlocatelliwoodcock.com/2012/09/13/find-out-whos-logged-on-to-a-remote-desktop-session/">post </a>on how to find out who is connected to a remote desktop session on  particular machine, there are occasions when you&#8217;ll want to actually forcibly disconnect someone so that you can log on to the machine yourself.</p>
<p>Turns out that there&#8217;s a command for that &#8230;</p>
<p>There&#8217;s a two step process of first identifying who you want to disconnect and secondly of actually disconnecting them. So, how to identify the users connected to the remote session and also <em>how long they&#8217;ve been idle</em>:</p>
<pre>quser /server:[server name]
eg: quser /server:myServer</pre>
<p>This gives back a table of information: USERNAME, SESSIONNAME, ID, STATE, IDLE TIME and LOGON TIME. Once you&#8217;ve identified who (if anyone) you want to kick off, usually based on who&#8217;s been idle the longest, you will need to note down the ID and then use that in the logoff command to actually log the user off:</p>
<pre>logoff [id] /server:[server name]
eg: logoff 2 /server:myServer</pre>
<p>And that&#8217;s it!</p>
<p>Here&#8217;s a redacted screenshot of the process in action:</p>
<p><a href="http://andrewlocatelliwoodcock.files.wordpress.com/2012/11/redacted-logoff.png"><img class="alignleft size-full wp-image-377" title="redacted logoff" alt="redacted logoff example" src="http://andrewlocatelliwoodcock.files.wordpress.com/2012/11/redacted-logoff.png?w=700"   /></a></p>
<br />Filed under: <a href='http://andrewlocatelliwoodcock.com/category/tools-and-commands/'>Tools and commands</a>, <a href='http://andrewlocatelliwoodcock.com/category/windows/'>Windows</a> Tagged: <a href='http://andrewlocatelliwoodcock.com/tag/command-line/'>command line</a>, <a href='http://andrewlocatelliwoodcock.com/tag/windows/'>Windows</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewlocatelliwoodcock.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewlocatelliwoodcock.wordpress.com/376/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewlocatelliwoodcock.com&#038;blog=22536494&#038;post=376&#038;subd=andrewlocatelliwoodcock&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewlocatelliwoodcock.com/2012/11/28/forcibly-disconnecting-users-from-a-remote-desktop-session/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/798b40f0d08f9fd0b543a5f50ffd27e6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andrewlocatelliwoodcock</media:title>
		</media:content>

		<media:content url="http://andrewlocatelliwoodcock.files.wordpress.com/2012/11/redacted-logoff.png" medium="image">
			<media:title type="html">redacted logoff</media:title>
		</media:content>
	</item>
		<item>
		<title>Find out who&#8217;s logged on to a Remote Desktop Session</title>
		<link>http://andrewlocatelliwoodcock.com/2012/09/13/find-out-whos-logged-on-to-a-remote-desktop-session/</link>
		<comments>http://andrewlocatelliwoodcock.com/2012/09/13/find-out-whos-logged-on-to-a-remote-desktop-session/#comments</comments>
		<pubDate>Thu, 13 Sep 2012 20:41:31 +0000</pubDate>
		<dc:creator>andrewlocatelliwoodcock</dc:creator>
				<category><![CDATA[Tools and commands]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[command line]]></category>

		<guid isPermaLink="false">http://andrewlocatelliwoodcock.com/?p=368</guid>
		<description><![CDATA[It&#8217;s a problem I&#8217;ve hit multiple times: I need to remote into a server to do some work but there are only a few sessions available and they&#8217;re all in use. I could ask someone if they can log off for a while but as it&#8217;s possibly one of a number of people this requires [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewlocatelliwoodcock.com&#038;blog=22536494&#038;post=368&#038;subd=andrewlocatelliwoodcock&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s a problem I&#8217;ve hit multiple times: I need to remote into a server to do some work but there are only a few sessions available and they&#8217;re all in use. I could ask someone if they can log off for a while but as it&#8217;s possibly one of a number of people this requires a bulk email. What I really need is a way to identify exactly who is logged onto that server so I can ask them if they can log off for a while &#8230;</p>
<p>After a fair amount of googling, I tracked down the query session command for Windows which will do exactly this. Here&#8217;s an example:</p>
<pre>query session /server:[SERVERNAME]</pre>
<p>where [SERVERNAME] is the name of the server you are trying to remote onto. So if we were trying to connect to a server named MyServer, we&#8217;d enter:</p>
<pre>query session /server:MyServer</pre>
<p>Here&#8217;s redacted example of the command line query in action</p>
<div id="attachment_372" class="wp-caption alignleft" style="width: 687px"><a href="http://andrewlocatelliwoodcock.files.wordpress.com/2012/09/querysession1.png"><img class="size-full wp-image-372" title="Redacted example of the query session command in action" alt="Redacted example of the query session command in action" src="http://andrewlocatelliwoodcock.files.wordpress.com/2012/09/querysession1.png?w=700"   /></a><p class="wp-caption-text">Redacted example of the query session command in action</p></div>
<p>There&#8217;s a lot more to this command than just the /server switch and the command is covered in detail in a good tech article form Micrsoft available here: <a title="Query Session command" href="http://technet.microsoft.com/en-us/library/bb490800.aspx" target="_blank">http://technet.microsoft.com/en-us/library/bb490800.aspx</a></p>
<p>&nbsp;</p>
<p>My <a title="Forcibly disconnecting users from a remote desktop session" href="http://andrewlocatelliwoodcock.com/2012/11/28/forcibly-disconnecting-users-from-a-remote-desktop-session/">next post</a> covers how to forcibly disconnect users from a session when necessary.</p>
<p>Enjoy!</p>
<br />Filed under: <a href='http://andrewlocatelliwoodcock.com/category/tools-and-commands/'>Tools and commands</a>, <a href='http://andrewlocatelliwoodcock.com/category/windows/'>Windows</a> Tagged: <a href='http://andrewlocatelliwoodcock.com/tag/command-line/'>command line</a>, <a href='http://andrewlocatelliwoodcock.com/tag/windows/'>Windows</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewlocatelliwoodcock.wordpress.com/368/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewlocatelliwoodcock.wordpress.com/368/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewlocatelliwoodcock.com&#038;blog=22536494&#038;post=368&#038;subd=andrewlocatelliwoodcock&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewlocatelliwoodcock.com/2012/09/13/find-out-whos-logged-on-to-a-remote-desktop-session/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/798b40f0d08f9fd0b543a5f50ffd27e6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andrewlocatelliwoodcock</media:title>
		</media:content>

		<media:content url="http://andrewlocatelliwoodcock.files.wordpress.com/2012/09/querysession1.png" medium="image">
			<media:title type="html">Redacted example of the query session command in action</media:title>
		</media:content>
	</item>
		<item>
		<title>Modern Corporate R&amp;D</title>
		<link>http://andrewlocatelliwoodcock.com/2012/09/06/modern-corporate-rd/</link>
		<comments>http://andrewlocatelliwoodcock.com/2012/09/06/modern-corporate-rd/#comments</comments>
		<pubDate>Thu, 06 Sep 2012 08:32:09 +0000</pubDate>
		<dc:creator>andrewlocatelliwoodcock</dc:creator>
				<category><![CDATA[ASP.Net MVC]]></category>

		<guid isPermaLink="false">http://andrewlocatelliwoodcock.com/?p=365</guid>
		<description><![CDATA[I am based these days in Citi&#8217;s research lab in Dublin working on financial mobile solutions. A few weeks ago, Irving Wladawky-Berger came to the Lab to see what we are up to. I didn&#8217;t get to meet him unfortunately but he wrote a very interesting blog post on corporate R&#38;D and how it has [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewlocatelliwoodcock.com&#038;blog=22536494&#038;post=365&#038;subd=andrewlocatelliwoodcock&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I am based these days in Citi&#8217;s research lab in Dublin working on financial mobile solutions. A few weeks ago, Irving Wladawky-Berger came to the Lab to see what we are up to. I didn&#8217;t get to meet him unfortunately but he wrote a very interesting blog post on corporate R&amp;D and how it has evolved over the years to meet accelerating change in the outside world and was very positive about Citi&#8217;s Dublin lab: <a title="The rise and fall and rise of the corporate research lab" href="http://blog.irvingwb.com/blog/2012/09/the-rise-fall-and-re-invention-of-the-corporate-research-lab.html">http://blog.irvingwb.com/blog/2012/09/the-rise-fall-and-re-invention-of-the-corporate-research-lab.html</a><br />
Personally, I like the sound of the old-style labs where we just got on with the interesting bits and left Marketing to figure it all out <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<h1 id="banner-header"></h1>
<br />Filed under: <a href='http://andrewlocatelliwoodcock.com/category/asp-net-mvc/'>ASP.Net MVC</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewlocatelliwoodcock.wordpress.com/365/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewlocatelliwoodcock.wordpress.com/365/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewlocatelliwoodcock.com&#038;blog=22536494&#038;post=365&#038;subd=andrewlocatelliwoodcock&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewlocatelliwoodcock.com/2012/09/06/modern-corporate-rd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/798b40f0d08f9fd0b543a5f50ffd27e6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andrewlocatelliwoodcock</media:title>
		</media:content>
	</item>
		<item>
		<title>Cloud Computing, a tech introduction</title>
		<link>http://andrewlocatelliwoodcock.com/2012/06/20/cloud-computing-a-tech-introduction/</link>
		<comments>http://andrewlocatelliwoodcock.com/2012/06/20/cloud-computing-a-tech-introduction/#comments</comments>
		<pubDate>Wed, 20 Jun 2012 18:59:39 +0000</pubDate>
		<dc:creator>andrewlocatelliwoodcock</dc:creator>
				<category><![CDATA[Talks]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[Cloud computing]]></category>
		<category><![CDATA[tech introduction]]></category>

		<guid isPermaLink="false">http://andrewlocatelliwoodcock.com/?p=359</guid>
		<description><![CDATA[This is a recent tech presentation I wrote introducing Cloud Computing: what it is, how it works, why it&#8217;s important. This is very much a 101-level presentation. Hopefully it will be of some interest! Cloud computing presentation Filed under: Talks, Websites Tagged: Cloud computing, tech introduction<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewlocatelliwoodcock.com&#038;blog=22536494&#038;post=359&#038;subd=andrewlocatelliwoodcock&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>This is a recent tech presentation I wrote introducing Cloud Computing: what it is, how it works, why it&#8217;s important. This is very much a 101-level presentation. Hopefully it will be of some interest!</p>
<p><a href="http://andrewlocatelliwoodcock.files.wordpress.com/2012/06/cloud-computing-presentation.pdf">Cloud computing presentation</a></p>
<br />Filed under: <a href='http://andrewlocatelliwoodcock.com/category/talks/'>Talks</a>, <a href='http://andrewlocatelliwoodcock.com/category/websites/'>Websites</a> Tagged: <a href='http://andrewlocatelliwoodcock.com/tag/cloud-computing/'>Cloud computing</a>, <a href='http://andrewlocatelliwoodcock.com/tag/tech-introduction/'>tech introduction</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewlocatelliwoodcock.wordpress.com/359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewlocatelliwoodcock.wordpress.com/359/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewlocatelliwoodcock.com&#038;blog=22536494&#038;post=359&#038;subd=andrewlocatelliwoodcock&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewlocatelliwoodcock.com/2012/06/20/cloud-computing-a-tech-introduction/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/798b40f0d08f9fd0b543a5f50ffd27e6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andrewlocatelliwoodcock</media:title>
		</media:content>
	</item>
		<item>
		<title>Unable to replicate from local CouchDB to Cloudant &#8211; a quick resolution for the {&#8220;error&#8221;:&#8221;shutdown&#8221;} message</title>
		<link>http://andrewlocatelliwoodcock.com/2012/06/15/unable-to-replicate-from-local-couchdb-to-cloudant-a-quick-resolution-for-the-errorshutdown-message/</link>
		<comments>http://andrewlocatelliwoodcock.com/2012/06/15/unable-to-replicate-from-local-couchdb-to-cloudant-a-quick-resolution-for-the-errorshutdown-message/#comments</comments>
		<pubDate>Fri, 15 Jun 2012 17:13:04 +0000</pubDate>
		<dc:creator>andrewlocatelliwoodcock</dc:creator>
				<category><![CDATA[CouchDb]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Erlang]]></category>
		<category><![CDATA[Cloudant]]></category>
		<category><![CDATA[CouchDB NoSQL]]></category>

		<guid isPermaLink="false">http://andrewlocatelliwoodcock.com/?p=310</guid>
		<description><![CDATA[Just in case anyone else hits an issue whereby you are unable to replicate a local CouchDB database to Cloudant &#8230; I was using Curl on Windows (which never helps of course ) and found that I was unable to replicate from a local instance to Cloudant even though my passwords, ca cert bundle, etc. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewlocatelliwoodcock.com&#038;blog=22536494&#038;post=310&#038;subd=andrewlocatelliwoodcock&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Just in case anyone else hits an issue whereby you are unable to replicate a local CouchDB database to Cloudant &#8230; I was using Curl on Windows (which never helps of course <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  ) and found that I was unable to replicate from a local instance to Cloudant even though my passwords, ca cert bundle, etc. were all correct. Naturally, it took a couple of goes to get the curl escaping on Windows right but even once I&#8217;d figured that out it was still failing with the uninformative</p>
<pre>{"error":"shutdown"}</pre>
<p>I eventually found some posts that pointed to my (very) out-of-date CouchDB instance being the issue: you need to be running CouchDB 1.2.0 preferably on Erlang R15 for this to work correctly.</p>
<p>I upgraded everything and key presto! It works!</p>
<br />Filed under: <a href='http://andrewlocatelliwoodcock.com/category/databases/couchdb/'>CouchDb</a>, <a href='http://andrewlocatelliwoodcock.com/category/databases/'>Databases</a>, <a href='http://andrewlocatelliwoodcock.com/category/erlang/'>Erlang</a> Tagged: <a href='http://andrewlocatelliwoodcock.com/tag/cloudant/'>Cloudant</a>, <a href='http://andrewlocatelliwoodcock.com/tag/couchdb-nosql/'>CouchDB NoSQL</a>, <a href='http://andrewlocatelliwoodcock.com/tag/erlang/'>Erlang</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewlocatelliwoodcock.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewlocatelliwoodcock.wordpress.com/310/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewlocatelliwoodcock.com&#038;blog=22536494&#038;post=310&#038;subd=andrewlocatelliwoodcock&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewlocatelliwoodcock.com/2012/06/15/unable-to-replicate-from-local-couchdb-to-cloudant-a-quick-resolution-for-the-errorshutdown-message/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/798b40f0d08f9fd0b543a5f50ffd27e6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andrewlocatelliwoodcock</media:title>
		</media:content>
	</item>
		<item>
		<title>Connecting to Cloudant from Erlang: a quick example of using HTTPS from httpc:request</title>
		<link>http://andrewlocatelliwoodcock.com/2012/06/12/connecting-to-cloudant-from-erlang-a-quick-example-of-using-https-from-httpcrequest-17-2/</link>
		<comments>http://andrewlocatelliwoodcock.com/2012/06/12/connecting-to-cloudant-from-erlang-a-quick-example-of-using-https-from-httpcrequest-17-2/#comments</comments>
		<pubDate>Tue, 12 Jun 2012 10:40:39 +0000</pubDate>
		<dc:creator>andrewlocatelliwoodcock</dc:creator>
				<category><![CDATA[CouchDb]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Erlang]]></category>
		<category><![CDATA[Cloudant]]></category>
		<category><![CDATA[CouchDB NoSQL]]></category>

		<guid isPermaLink="false">http://andrewlocatelliwoodcock.com/2012/06/12/connecting-to-cloudant-from-erlang-a-quick-example-of-using-https-from-httpcrequest-17/</guid>
		<description><![CDATA[Wiser heads than me will no doubt already know this but I for one struggled with working out how to do this so I thought I&#8217;d put the example up in the hope it will help others. So, what I was trying to do was get and put to a Cloudant database from Erlang. Cloudant [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewlocatelliwoodcock.com&#038;blog=22536494&#038;post=348&#038;subd=andrewlocatelliwoodcock&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Wiser heads than me will no doubt already know this but I for one struggled with working out how to do this so I thought I&#8217;d put the example up in the hope it will help others. So, what I was trying to do was get and put to a Cloudant database from Erlang. Cloudant requires both HTTPS and a username and password and I struggled to find an Erlang example online.</p>
<p>First, make sure that you can connect to Cloudant over curl and fetch at least the _all_dbs resource. If you can&#8217;t, Erlang isn&#8217;t going to work either. I found that to get curl working correctly, I needed to update the ca cert bundle that came with it.</p>
<p>Here&#8217;s how to retrive _all_dbs for your Cloudant account using curl:</p>
<blockquote><p>curl https://<em>username</em>:<em>password</em>@<em>username</em>.cloudant.com/_all_dbs</p></blockquote>
<p>where <em>username</em> is your Cloudant username and <em>password</em> is the password associated with your username. For example, if your username were &#8216;foo&#8217; and your password &#8216;bar&#8217;, here&#8217;s the command you would use:</p>
<blockquote><p>curl <a href="https://foo:bar@foo.cloudant.com/_all_dbs" rel="nofollow">https://foo:bar@foo.cloudant.com/_all_dbs</a></p></blockquote>
<div></div>
<div>If this doesn&#8217;t work, the most likely explanation is that your ca cert bundle is out of date: follow the instructions on the curl website for how to update them.</div>
<div></div>
<div>Assuming this worked, your now in a position to try the same with Erlang. I&#8217;m going to use the httpc library here:</div>
<div></div>
<div>
<blockquote><p>inets:start(),</p>
<p>ssl:start(),</p>
<p>httpc:request (get, {&#8220;<a href="https://foo:bar@foo.cloudant.com/_all_dbs&#038;#8221" rel="nofollow">https://foo:bar@foo.cloudant.com/_all_dbs&#038;#8221</a>;, []}, [{ssl,[{verify,0}]}], []).</p></blockquote>
<p>It is important to remember to start inets and ssl before attempting to use httpc:request. A put to Cloudant is similar, here&#8217;s an example that assumes the existance of a database <em>barfoo</em> and a resource <em>widget</em> on your Cloudant instance and also that you have a suitably initialized variable <em>Update</em> which contains the data which you are writing to the widget resource:</p>
<blockquote><p>inets:start(),</p>
<p>ssl:start(),</p>
<p>httpc:request (put, {&#8220;<a href="https://foo:bar@foo.cloudant.com/barfoo/widget&#038;#8221" rel="nofollow">https://foo:bar@foo.cloudant.com/barfoo/widget&#038;#8221</a>;, [], [], Update}, [], []).</p>
<div></div>
</blockquote>
<p>And there you have it</p>
</div>
<div></div>
<div></div>
<div></div>
<br />Filed under: <a href='http://andrewlocatelliwoodcock.com/category/databases/couchdb/'>CouchDb</a>, <a href='http://andrewlocatelliwoodcock.com/category/databases/'>Databases</a>, <a href='http://andrewlocatelliwoodcock.com/category/erlang/'>Erlang</a> Tagged: <a href='http://andrewlocatelliwoodcock.com/tag/cloudant/'>Cloudant</a>, <a href='http://andrewlocatelliwoodcock.com/tag/couchdb-nosql/'>CouchDB NoSQL</a>, <a href='http://andrewlocatelliwoodcock.com/tag/databases/'>Databases</a>, <a href='http://andrewlocatelliwoodcock.com/tag/erlang/'>Erlang</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewlocatelliwoodcock.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewlocatelliwoodcock.wordpress.com/348/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewlocatelliwoodcock.com&#038;blog=22536494&#038;post=348&#038;subd=andrewlocatelliwoodcock&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewlocatelliwoodcock.com/2012/06/12/connecting-to-cloudant-from-erlang-a-quick-example-of-using-https-from-httpcrequest-17-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/798b40f0d08f9fd0b543a5f50ffd27e6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andrewlocatelliwoodcock</media:title>
		</media:content>
	</item>
		<item>
		<title>How websites work, an introductory tech presentation</title>
		<link>http://andrewlocatelliwoodcock.com/2012/06/11/how-websites-work-an-introductory-tech-presentation/</link>
		<comments>http://andrewlocatelliwoodcock.com/2012/06/11/how-websites-work-an-introductory-tech-presentation/#comments</comments>
		<pubDate>Mon, 11 Jun 2012 21:28:52 +0000</pubDate>
		<dc:creator>andrewlocatelliwoodcock</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Talks]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://andrewlocatelliwoodcock.com/?p=307</guid>
		<description><![CDATA[I recently gave a tech intro session entitled &#8220;How websites work&#8221;, a kind of 101 session on the basics of web technology. The session references PHP specifically as that&#8217;s the development language at my current employer but most server-side languages work in a similar manner. Readers of this blog will mostly know this stuff anyway but [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewlocatelliwoodcock.com&#038;blog=22536494&#038;post=307&#038;subd=andrewlocatelliwoodcock&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I recently gave a tech intro session entitled &#8220;How websites work&#8221;, a kind of 101 session on the basics of web technology. The session references PHP specifically as that&#8217;s the development language at my current employer but most server-side languages work in a similar manner.</p>
<p>Readers of this blog will mostly know this stuff anyway but I was asked to make it available for download so here it is: enjoy!</p>
<p><a href="http://andrewlocatelliwoodcock.files.wordpress.com/2012/06/how-websites-work.pdf">How Websites Work</a></p>
<p>&nbsp;</p>
<br />Filed under: <a href='http://andrewlocatelliwoodcock.com/category/php/'>PHP</a>, <a href='http://andrewlocatelliwoodcock.com/category/talks/'>Talks</a>, <a href='http://andrewlocatelliwoodcock.com/category/websites/'>Websites</a> Tagged: <a href='http://andrewlocatelliwoodcock.com/tag/css/'>CSS</a>, <a href='http://andrewlocatelliwoodcock.com/tag/html/'>HTML</a>, <a href='http://andrewlocatelliwoodcock.com/tag/javascript-2/'>JavaScript</a>, <a href='http://andrewlocatelliwoodcock.com/tag/php/'>PHP</a>, <a href='http://andrewlocatelliwoodcock.com/tag/websites/'>Websites</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewlocatelliwoodcock.wordpress.com/307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewlocatelliwoodcock.wordpress.com/307/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewlocatelliwoodcock.com&#038;blog=22536494&#038;post=307&#038;subd=andrewlocatelliwoodcock&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewlocatelliwoodcock.com/2012/06/11/how-websites-work-an-introductory-tech-presentation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/798b40f0d08f9fd0b543a5f50ffd27e6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andrewlocatelliwoodcock</media:title>
		</media:content>
	</item>
		<item>
		<title>Using SQL and LEFT JOINs to find missing data</title>
		<link>http://andrewlocatelliwoodcock.com/2012/06/04/using-sql-and-left-joins-to-find-missing-data/</link>
		<comments>http://andrewlocatelliwoodcock.com/2012/06/04/using-sql-and-left-joins-to-find-missing-data/#comments</comments>
		<pubDate>Mon, 04 Jun 2012 20:29:42 +0000</pubDate>
		<dc:creator>andrewlocatelliwoodcock</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[mySQL]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[T-SQL]]></category>
		<category><![CDATA[LEFT JOIN]]></category>

		<guid isPermaLink="false">http://andrewlocatelliwoodcock.com/?p=302</guid>
		<description><![CDATA[It&#8217;s not unusual when working with data-driven applications to be asked to produce ad-hoc exception reoprst of the type: there should a at least one row in TableB for each row in TableA &#8211; can you tell me any rows in TableA that do not have at least one corresponding row in TableB? How do you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewlocatelliwoodcock.com&#038;blog=22536494&#038;post=302&#038;subd=andrewlocatelliwoodcock&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s not unusual when working with data-driven applications to be asked to produce ad-hoc exception reoprst of the type: there should a at least one row in TableB for each row in TableA &#8211; can you tell me any rows in TableA that do not have at least one corresponding row in TableB?</p>
<p>How do you find something that&#8217;s not there?!</p>
<p>Our old friend the LEFT JOIN to the rescue. We already know from <a title="How and why to use LEFT JOINs in SQL statements" href="http://andrewlocatelliwoodcock.com/2012/05/30/how-and-why-to-use-left-joins-in-sql-statements/">this post</a>, that we can use LEF T JOINs to return every row from one table and any matching row from another and this is an extension of the same problem: in this case, we are looking specifically for every row in table A that does <em>not</em> have a matching row in table B.</p>
<p>Here&#8217;s how to do it:</p>
<pre>SELECT
      a.Id
FROM
      TableA a
LEFT JOIN TableB b ON a.Id = b.Id
WHERE
      b.Id IS NULL</pre>
<p>So, we&#8217;re returning everything in TableA, anything matching from TableB but then limiting the resultset to only those rows in TableA that DO NOT have a match in TableB. We do that with the statement:</p>
<pre>WHERE b.Id IS NULL</pre>
<p>This works because the database is returning all rows from TableA and matching rows from TableB but it still has to return something in the case where there are no matching rows in TableB: the special value NULL meaning &#8220;unknowable&#8221;. What our WHERE clause is saying is &#8220;only return those rows in TableA where the matching row in TableB is unknowable&#8221;, i.e. where we don&#8217;t have a matching row!</p>
<p>Simples.</p>
<br />Filed under: <a href='http://andrewlocatelliwoodcock.com/category/databases/'>Databases</a>, <a href='http://andrewlocatelliwoodcock.com/category/databases/mysql/'>mySQL</a>, <a href='http://andrewlocatelliwoodcock.com/category/databases/sql/'>SQL</a>, <a href='http://andrewlocatelliwoodcock.com/category/databases/sql-server/'>SQL Server</a>, <a href='http://andrewlocatelliwoodcock.com/category/databases/sql-server/t-sql/'>T-SQL</a> Tagged: <a href='http://andrewlocatelliwoodcock.com/tag/databases/'>Databases</a>, <a href='http://andrewlocatelliwoodcock.com/tag/left-join/'>LEFT JOIN</a>, <a href='http://andrewlocatelliwoodcock.com/tag/sql/'>SQL</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewlocatelliwoodcock.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewlocatelliwoodcock.wordpress.com/302/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewlocatelliwoodcock.com&#038;blog=22536494&#038;post=302&#038;subd=andrewlocatelliwoodcock&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewlocatelliwoodcock.com/2012/06/04/using-sql-and-left-joins-to-find-missing-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/798b40f0d08f9fd0b543a5f50ffd27e6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andrewlocatelliwoodcock</media:title>
		</media:content>
	</item>
		<item>
		<title>How and why to use LEFT JOINs in SQL statements</title>
		<link>http://andrewlocatelliwoodcock.com/2012/05/30/how-and-why-to-use-left-joins-in-sql-statements/</link>
		<comments>http://andrewlocatelliwoodcock.com/2012/05/30/how-and-why-to-use-left-joins-in-sql-statements/#comments</comments>
		<pubDate>Wed, 30 May 2012 21:11:54 +0000</pubDate>
		<dc:creator>andrewlocatelliwoodcock</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[mySQL]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[LEFT JOIN]]></category>

		<guid isPermaLink="false">http://andrewlocatelliwoodcock.com/?p=293</guid>
		<description><![CDATA[LEF T JOINs are something I&#8217;ve been using in SQL statements for literally years without thinking much about it but a few conversations recently have made me realize that with the rise of ORMs, a lot of people are a lot less SQL-savvy than they were even a few years ago to the point that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewlocatelliwoodcock.com&#038;blog=22536494&#038;post=293&#038;subd=andrewlocatelliwoodcock&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>LEF T JOINs are something I&#8217;ve been using in SQL statements for literally years without thinking much about it but a few conversations recently have made me realize that with the rise of ORMs, a lot of people are a lot less SQL-savvy than they were even a few years ago to the point that JOINs are a bit of a mystery. Most people seem to be able to use INNER JOINs correctly but LEFT JOINs cause a lot of confusion and hence this post &#8230;</p>
<p>A LEFT JOIN is used to return data from two tables where there are definitely rows in one table and there may be corresponding rows in the other. If there are, we want to see them and if there aren&#8217;t we don&#8217;t care: that is, we don&#8217;t want to see data only where there is data present in both tables. An example of this could be a report showing all students enrolled in college course and their grades, where some students may not yet have taken any exams but we still want to see all students and then any results for exams they have taken.</p>
<p>So, how do we do this?</p>
<p>Continuing with our example, we&#8217;ll need three tables, Students, Courses and Grades with the following schema:</p>
<pre>Students: Id, FirstName, SecondName
Courses: Id, Description
Grades: StudentId, CourseId, Grade</pre>
<p>What we want to see is all students and every grade they have received over the year. We&#8217;ll also want to see the course description so we&#8217;ll need to JOIN all three tables. Here&#8217;s how we do it:</p>
<pre>SELECT 
      s.Id, s.FirstName, s.SecondName, g.Grade, c.Description 
FROM
      Students s
LEFT JOIN Grades g ON s.Id = g.StudentId
INNER JOIN Courses c ON c.Id = g.CourseId</pre>
<p>(And just to explain <em>s</em> is declared as an alias of Students so s.Id is the same as writing Students.Id, etc. &#8230;)</p>
<p>The LEFT JOIN means: &#8220;give me everything on the left of the equals sign and any matching rows on the right of the equals sign&#8221;. So</p>
<pre>FROM
      Students s
LEFT JOIN Grades g ON s.Id = g.StudentId</pre>
<p>means: &#8220;give me everything from Students and any matching rows from the Grades table&#8221;</p>
<p>So, why the INNER JOIN on Courses? This is what allows us to get the course description from the Courses table. We are assuming here that there should never be a grade for a course that doesn&#8217;t exist (pretty reasonable assumption!), so we are restricting the grades we are returning to only those with a matching course.</p>
<p>So there you have it: how to return all students and any matching grades complete with course description in one simple SQL statement.</p>
<p>Later in the week, I&#8217;ll be publishing a post on how to use LEFT JOINs to find missing data &#8230;</p>
<br />Filed under: <a href='http://andrewlocatelliwoodcock.com/category/databases/'>Databases</a>, <a href='http://andrewlocatelliwoodcock.com/category/databases/mysql/'>mySQL</a>, <a href='http://andrewlocatelliwoodcock.com/category/databases/sql/'>SQL</a>, <a href='http://andrewlocatelliwoodcock.com/category/databases/sql-server/'>SQL Server</a> Tagged: <a href='http://andrewlocatelliwoodcock.com/tag/databases/'>Databases</a>, <a href='http://andrewlocatelliwoodcock.com/tag/left-join/'>LEFT JOIN</a>, <a href='http://andrewlocatelliwoodcock.com/tag/sql/'>SQL</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewlocatelliwoodcock.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewlocatelliwoodcock.wordpress.com/293/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewlocatelliwoodcock.com&#038;blog=22536494&#038;post=293&#038;subd=andrewlocatelliwoodcock&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewlocatelliwoodcock.com/2012/05/30/how-and-why-to-use-left-joins-in-sql-statements/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/798b40f0d08f9fd0b543a5f50ffd27e6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andrewlocatelliwoodcock</media:title>
		</media:content>
	</item>
		<item>
		<title>Creating a table directly from a SELECT statement in mySQL</title>
		<link>http://andrewlocatelliwoodcock.com/2012/05/21/creating-a-table-directly-from-a-select-statement-in-mysql/</link>
		<comments>http://andrewlocatelliwoodcock.com/2012/05/21/creating-a-table-directly-from-a-select-statement-in-mysql/#comments</comments>
		<pubDate>Mon, 21 May 2012 20:39:26 +0000</pubDate>
		<dc:creator>andrewlocatelliwoodcock</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[mySQL]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SELECT]]></category>

		<guid isPermaLink="false">http://andrewlocatelliwoodcock.com/?p=289</guid>
		<description><![CDATA[It is often useful to be able to select some data we are working with into a new table for further analysis. This is often achieved by first creating the new table and then populating it via a separate SQL statement but it can be quite time-consuming, especially when we want to work with larger [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewlocatelliwoodcock.com&#038;blog=22536494&#038;post=289&#038;subd=andrewlocatelliwoodcock&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>It is often useful to be able to select some data we are working with into a new table for further analysis. This is often achieved by first creating the new table and then populating it via a separate SQL statement but it can be quite time-consuming, especially when we want to work with larger numbers of columns, to write the full CREATE TABLE statement for the new table.</p>
<p>What would be ideal would be to be able to infer the structure of the new table directly from the SELECT statement and mySQL does actually give us a way to do that: the CREATE TABLE &#8230; SELECT statement.</p>
<p>Here&#8217;s an example of how it works:</p>
<pre>CREATE TABLE my_new_working_table SELECT column_a, column_b, column_d, column_f FROM my_original_table;</pre>
<p>And that&#8217;s it: mySQL will create the new table for you, inferring the correct structure from the SELECT statement and also insert the data that matches the SELECT. It won&#8217;t add indexes or the like but these can be added afterwards if required and when using this approach, often we only need the table for a short-term analysis task anyway.</p>
<br />Filed under: <a href='http://andrewlocatelliwoodcock.com/category/databases/'>Databases</a>, <a href='http://andrewlocatelliwoodcock.com/category/databases/mysql/'>mySQL</a>, <a href='http://andrewlocatelliwoodcock.com/category/databases/sql/'>SQL</a> Tagged: <a href='http://andrewlocatelliwoodcock.com/tag/databases/'>Databases</a>, <a href='http://andrewlocatelliwoodcock.com/tag/select/'>SELECT</a>, <a href='http://andrewlocatelliwoodcock.com/tag/sql/'>SQL</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewlocatelliwoodcock.wordpress.com/289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewlocatelliwoodcock.wordpress.com/289/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewlocatelliwoodcock.com&#038;blog=22536494&#038;post=289&#038;subd=andrewlocatelliwoodcock&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewlocatelliwoodcock.com/2012/05/21/creating-a-table-directly-from-a-select-statement-in-mysql/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/798b40f0d08f9fd0b543a5f50ffd27e6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andrewlocatelliwoodcock</media:title>
		</media:content>
	</item>
	</channel>
</rss>
