<?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"
	>

<channel>
	<title>James Carr</title>
	<atom:link href="http://blog.james-carr.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.james-carr.org</link>
	<description>Rants and Musings of an Agile Developer</description>
	<pubDate>Sun, 29 Aug 2010 21:50:50 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<item>
		<title>Node Knockout Creation: DropNode</title>
		<link>http://blog.james-carr.org/2010/08/29/node-knockout-creation-dropnode/</link>
		<comments>http://blog.james-carr.org/2010/08/29/node-knockout-creation-dropnode/#comments</comments>
		<pubDate>Sun, 29 Aug 2010 21:50:50 +0000</pubDate>
		<dc:creator>James Carr</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.james-carr.org/?p=912</guid>
		<description><![CDATA[Just wraped up the weekend of participating in Node Knockout and my teams creation, DropNode is now functioning out in production letting people with bleeding edge browsers share all sorts of files and binary files with their friends and family. So i thought it&#8217;d be a good time to reflect on the experience but first [...]]]></description>
			<content:encoded><![CDATA[<p>Just wraped up the weekend of participating in <a href="http://nodeknockout.com/">Node Knockout</a> and my teams creation, <a href="http://done-js.no.de">DropNode</a> is now functioning out in production letting people with bleeding edge browsers share all sorts of files and binary files with their friends and family. So i thought it&#8217;d be a good time to reflect on the experience but first talk about the app itself and what makes it cool. <img src='http://blog.james-carr.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>It took a bit of brainstorming, but we decided on a simple website that lets you share files by just drag and dropping them in the browser and using the new HTML5 File API to share them. The thing that really makes it innovative is when you drag and drop a file in the browser it doesn&#8217;t just upload it for others to download, but rather generates a link on the server that when someone clicks on will cause the server to force the client (the person sharing the file) to use the File API to read the file and PUT it over XHR. The data is then relayed to the person downloading the file. So a request is what triggers an upload from the person sharing. <img src='http://blog.james-carr.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So, how&#8217;d the competition go? First off my team was made up of some really awesome devs who did a tremendously awesome job despite having little to no experience with nodejs. We did a little up front planning, but this was mostly limited to talking about how it&#8217;s going to work and doing a small spike to see if the HTML5 File API + websockets could be used to transfer files. A gotcha here is that I did the spike and succeeded with the caveat that binary files didn&#8217;t work right but decided to ignore that problem thinking we could solve it during the KO. Boy was I wrong&#8230; that wound up to be the biggest annoyance in the 11th hour. Another thing that helped was we dropped all the features into <a href="http://pivotaltracker.com">Pivotal Tracker</a> and kept the communication channel high by using irc or pairing in person (sadly I could not pair in person). </p>
<p>Luckily I had deployed an app to heroku using the node.js beta so once the competition started I knew all we needed to do to get a simple hello world app deployed&#8230; create the project structure, create a package.json with our dependencies and run <code>npm bundle ./vendo</code> to bundle up all of our 3rd party dependencies for deployment. Within 20 minutes we were live, albeit a simple hello world app. </p>
<p>Development was a breeze really despite the problem we initially had with binary transfers&#8230; and it was awesome seeing the app come together and actually work. One things for sure&#8230; only once a year will I stay up till 5:45am hacking away like a madman. <img src='http://blog.james-carr.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Anyhow, go check us out at <a href="http://done-js.no.de">http://done-js.no.de</a> and vote for us! <img src='http://blog.james-carr.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.james-carr.org/2010/08/29/node-knockout-creation-dropnode/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Well That Was Easy</title>
		<link>http://blog.james-carr.org/2010/08/25/well-that-was-easy/</link>
		<comments>http://blog.james-carr.org/2010/08/25/well-that-was-easy/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 05:17:42 +0000</pubDate>
		<dc:creator>James Carr</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.james-carr.org/?p=910</guid>
		<description><![CDATA[Spent some time working on a little app tonight and we needed to import users from one app to another. We decided we didn&#8217;t need any real fancy schmancy authentication&#8230; if the user says that their email address is foo@example.com then we&#8217;ll believe them and let them participate!
The 3rd party app had an internal url [...]]]></description>
			<content:encoded><![CDATA[<p>Spent some time working on a little app tonight and we needed to import users from one app to another. We decided we didn&#8217;t need any real fancy schmancy authentication&#8230; if the user says that their email address is foo@example.com then we&#8217;ll believe them and let them participate!</p>
<p>The 3rd party app had an internal url we could fetch exported email addresses from in csv format (with only one column for the addresses) so I just fetched the url, grabbed the emails and hashed each one into couchdb to authenticate against.  All done in 17 lines. </p>
<p><script src="http://gist.github.com/548898.js?file=gistfile1.js"></script></p>
<p>Yep&#8230; that was easy. <img src='http://blog.james-carr.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.james-carr.org/2010/08/25/well-that-was-easy/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Node.js STL Mailing List</title>
		<link>http://blog.james-carr.org/2010/08/18/nodejs-stl-mailing-list/</link>
		<comments>http://blog.james-carr.org/2010/08/18/nodejs-stl-mailing-list/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 02:58:10 +0000</pubDate>
		<dc:creator>James Carr</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.james-carr.org/?p=908</guid>
		<description><![CDATA[Just wanted to get this out there. As I mentioned previously we&#8217;re going to hold the first node.js meetup in St.Louis tomorrow night and plan to continue holding them every third Thursday of the month. I&#8217;ve created a nodejs-stl google group for it and will make announcements on future meetings plus discuss potential topics and [...]]]></description>
			<content:encoded><![CDATA[<p>Just wanted to get this out there. As I mentioned previously we&#8217;re going to hold the first node.js meetup in St.Louis tomorrow night and plan to continue holding them every third Thursday of the month. I&#8217;ve created a <a href="http://groups.google.com/group/nodejs-stl/pending?s=1">nodejs-stl google group</a> for it and will make announcements on future meetings plus discuss potential topics and activities there as well. This is also a good place to connect with other folks in the St.Louis area that are dabbling with node.js which is quite handy if you need someone to pair in with you on something (which I am always open for, schedule permitting). </p>
<p>So join the discussion! <img src='http://blog.james-carr.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.james-carr.org/2010/08/18/nodejs-stl-mailing-list/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Node.js Meetup This Thursday, August 19th</title>
		<link>http://blog.james-carr.org/2010/08/18/nodejs-meetup-this-thursday-august-19th/</link>
		<comments>http://blog.james-carr.org/2010/08/18/nodejs-meetup-this-thursday-august-19th/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 13:42:59 +0000</pubDate>
		<dc:creator>James Carr</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.james-carr.org/?p=902</guid>
		<description><![CDATA[Just a quick reminder that tomorrow night (August 19th) at 6pm will be the first ever Node.Js Meetup fo the St.Louis Area. So far we&#8217;ll  have Peter Griess giving a presentation on Web Workers while I&#8217;ll give a brief introduction to npm. In addition to that we should have room for a few lightning [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick reminder that tomorrow night (August 19th) at 6pm will be the first ever Node.Js Meetup fo the St.Louis Area. So far we&#8217;ll  have Peter Griess giving a presentation on Web Workers while I&#8217;ll give a brief introduction to npm. In addition to that we should have room for a few lightning talk is anyone else h as something they&#8217;d like to share or just some discussion about node.js in general. So whether you&#8217;ve been developing with node.js or you&#8217;re just interested in finding out what it is and learning more, come out and join us!</p>
<p>This month&#8217;s meetup is sponsored by Object Computing, Inc. who in addition to providing food and beverages has also lent us this month&#8217;s meeting space at their St.Louis offices at 12140 Woodcrest Executive Dr. St.Louis, MO 63141. Unfortunately punching in their address will land you at Kohl&#8217;s on google maps, so do get there take Olive Blvd. west from 270 and take a right at the second turn by Commerce Bank, the building OCI is in is the one right behind it. From the entrance, take the stairs to the second floor and take a left down the hallway to room 220.</p>
<p>Hope to see you there!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.james-carr.org/2010/08/18/nodejs-meetup-this-thursday-august-19th/feed/</wfw:commentRss>
		</item>
		<item>
		<title>links for 2010-08-16</title>
		<link>http://blog.james-carr.org/2010/08/16/links-for-2010-08-16/</link>
		<comments>http://blog.james-carr.org/2010/08/16/links-for-2010-08-16/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 13:01:12 +0000</pubDate>
		<dc:creator>James Carr</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.james-carr.org/2010/08/16/links-for-2010-08-16/</guid>
		<description><![CDATA[

Giving Great Talks
(tags: presentations presenting speaking publicspeaking tips)


]]></description>
			<content:encoded><![CDATA[<ul class="delicious">
<li>
<div class="delicious-link"><a href="http://boltpeters.com/blog/talks/">Giving Great Talks</a></div>
<div class="delicious-tags">(tags: <a href="http://delicious.com/officeOfTheLaw/presentations">presentations</a> <a href="http://delicious.com/officeOfTheLaw/presenting">presenting</a> <a href="http://delicious.com/officeOfTheLaw/speaking">speaking</a> <a href="http://delicious.com/officeOfTheLaw/publicspeaking">publicspeaking</a> <a href="http://delicious.com/officeOfTheLaw/tips">tips</a>)</div>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.james-carr.org/2010/08/16/links-for-2010-08-16/feed/</wfw:commentRss>
		</item>
		<item>
		<title>links for 2010-08-14</title>
		<link>http://blog.james-carr.org/2010/08/14/links-for-2010-08-14/</link>
		<comments>http://blog.james-carr.org/2010/08/14/links-for-2010-08-14/#comments</comments>
		<pubDate>Sat, 14 Aug 2010 13:00:56 +0000</pubDate>
		<dc:creator>James Carr</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.james-carr.org/2010/08/14/links-for-2010-08-14/</guid>
		<description><![CDATA[

Index : AnnounceMedia
(tags: STLCompanies)


Usability Testing &#124; Interactive Advertising Agency &#124; 4ORCE Digital
(tags: STLCompanies)


]]></description>
			<content:encoded><![CDATA[<ul class="delicious">
<li>
<div class="delicious-link"><a href="http://www.announcemedia.com/">Index : AnnounceMedia</a></div>
<div class="delicious-tags">(tags: <a href="http://delicious.com/officeOfTheLaw/STLCompanies">STLCompanies</a>)</div>
</li>
<li>
<div class="delicious-link"><a href="http://www.4orcedigital.com/">Usability Testing | Interactive Advertising Agency | 4ORCE Digital</a></div>
<div class="delicious-tags">(tags: <a href="http://delicious.com/officeOfTheLaw/STLCompanies">STLCompanies</a>)</div>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.james-carr.org/2010/08/14/links-for-2010-08-14/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Read Only Properties in ES5</title>
		<link>http://blog.james-carr.org/2010/07/29/read-only-properties-in-es5/</link>
		<comments>http://blog.james-carr.org/2010/07/29/read-only-properties-in-es5/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 21:58:08 +0000</pubDate>
		<dc:creator>James Carr</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[nodejs]]></category>

		<guid isPermaLink="false">http://blog.james-carr.org/?p=897</guid>
		<description><![CDATA[I thought I&#8217;d take a quick moment to provide some examples of making object properties read only in EcmaScript 5 (and by extension node.js). There&#8217;s several ways to accomplish it, so I&#8217;ll just iterate over all the different ways.
Object.freeze
The quickest way to make all properties of an object read only is by calling Object.freeze on [...]]]></description>
			<content:encoded><![CDATA[<p>I thought I&#8217;d take a quick moment to provide some examples of making object properties read only in EcmaScript 5 (and by extension node.js). There&#8217;s several ways to accomplish it, so I&#8217;ll just iterate over all the different ways.</p>
<h4>Object.freeze</h4>
<p>The quickest way to make all properties of an object read only is by calling Object.freeze on it. The interesting thing here is that (at least in node.js) no exception or warning will take place if you try to assign a read only property&#8230; it will appear that the assignment succeeded when in reality it didn&#8217;t.</p>
<p><script src="http://gist.github.com/499243.js"> </script></p>
<p>Let&#8217;s try an object with some additional types&#8230; nested object and an array.<br />
<script src="http://gist.github.com/499256.js"> </script></p>
<p>In this example, we see that the array and object represented by b can in fact be modified, they just can&#8217;t be reassigned to something new. It really just locks the reference. However if we loop over each property and freeze each one each will be unmodifiable and the attempt to push an element onto the array with throw an exception stating <code>TypeError: Can't add property 4, object is not extensible</code>.</p>
<h4>Define Only a Getter</h4>
<p>Another way to make a property read only is by only defining a getter for it. You can do this both via defineProperty or defineGetter<br />
<script src="http://gist.github.com/499298.js"> </script><br />
Both will throw an exception on an attempt to reassign them.</p>
<h4>Defined as Not Writable Via Property Descriptor</h4>
<p>One more way is to define the writable attribute in the property descriptor. </p>
<p><script src="http://gist.github.com/499356.js"> </script></p>
<p>That&#8217;s just a quick overview, there&#8217;s also quite a few interesting tricks to locking object instances.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.james-carr.org/2010/07/29/read-only-properties-in-es5/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Using an SSL Certificate to Make a Secure HTTP Request in Node.JS</title>
		<link>http://blog.james-carr.org/2010/07/26/using-an-ssl-certificate-to-make-a-secure-http-request-in-nodejs/</link>
		<comments>http://blog.james-carr.org/2010/07/26/using-an-ssl-certificate-to-make-a-secure-http-request-in-nodejs/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 04:17:00 +0000</pubDate>
		<dc:creator>James Carr</dc:creator>
		
		<category><![CDATA[nodejs]]></category>

		<guid isPermaLink="false">http://blog.james-carr.org/?p=891</guid>
		<description><![CDATA[I&#8217;m documenting this only because I had some difficulty finding info online&#8230; the API docs tell you what you need, but it took me a couple hours to get things working and a little known bug that threw my work off track. 
So say you want to make a secure request to a website, perhaps [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m documenting this only because I had some difficulty finding info online&#8230; the API docs tell you what you need, but it took me a couple hours to get things working and a little known bug that threw my work off track. </p>
<p>So say you want to make a secure request to a website, perhaps a secure API call (as is most common with payment gateway APIs) and you&#8217;re using nodejs&#8230; what do you do? Assuming you already have a private key and an SSL Certificate handy and that you&#8217;ve compiled nodejs with ssl support, I&#8217;ll show you how in the following steps. <img src='http://blog.james-carr.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>First, place the cert somewhere that your script can access it from, I usually prefer a location like <code>./certs</code>. Make absolutely positively sure that you have no trailing newlines at the end. You also have the option of embedding it within your script (I&#8217;ve seen it done) but I believe this is a poor practice. Still, you have the option of doing that. </p>
<p>Given that your script/app/module is located in the same directory as the certs directory, load the contents of both keys into memory and use the crypto module to create the credentials.</p>
<p><script src="http://gist.github.com/490118.js"> </script></p>
<p>With the credentials now available, we can set up the client and make a request<br />
<script src="http://gist.github.com/491037.js"> </script></p>
<p>That is, createClient(port, host, secure, credentials). If everything goes well you should be able to make a request. One thing to watch out for is a trailing newline at the end of your key or cert. Often times I add <code>key.replace(/\n$/, '')</code> to it just to be safe.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.james-carr.org/2010/07/26/using-an-ssl-certificate-to-make-a-secure-http-request-in-nodejs/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Payflow Pro API released for nodejs</title>
		<link>http://blog.james-carr.org/2010/07/24/payflow-pro-api-released-for-nodejs/</link>
		<comments>http://blog.james-carr.org/2010/07/24/payflow-pro-api-released-for-nodejs/#comments</comments>
		<pubDate>Sat, 24 Jul 2010 20:35:12 +0000</pubDate>
		<dc:creator>James Carr</dc:creator>
		
		<category><![CDATA[nodejs]]></category>

		<guid isPermaLink="false">http://blog.james-carr.org/?p=887</guid>
		<description><![CDATA[On and off over the past couple days I&#8217;ve been working on a nodejs module to interact with Paypal&#8217;s Payflow Pro API to allow the acceptance of online payments within node.js apps. The feature list is steadily growing and soon I hope to implement the parts of the API that let paypal do the heavy [...]]]></description>
			<content:encoded><![CDATA[<p>On and off over the past couple days I&#8217;ve been working on a nodejs module to interact with Paypal&#8217;s <a href="https://cms.paypal.com/us/cgi-bin/?&#038;cmd=_render-content&#038;content_ID=developer/howto_gateway_payflowpro">Payflow Pro API</a> to allow the acceptance of online payments within node.js apps. The feature list is steadily growing and soon I hope to implement the parts of the API that let paypal do the heavy lifting as well as certificate based authentication.</p>
<p>It&#8217;s available via <a href="http://npmjs.org/">npm</a> and installation is a snap. Given that you have npm installed, just type</p>
<p><script src="http://gist.github.com/488948.js"> </script></p>
<p>and bam, it&#8217;s now available for use. Here&#8217;s a quick sample to get started (this is using my existing sandbox account):</p>
<p><script src="http://gist.github.com/488949.js"> </script></p>
<p>If all goes well, you should see some console output for either success or failure. </p>
<p>Feel free to check out the <a href="http://github.com/jamescarr/payment-paypal-payflowpro">github repository</a>, especially if you&#8217;d like to contribute. </p>
<p>Stay tuned&#8230; there&#8217;s more to come both from this module and more payment modules I plan to develop. <img src='http://blog.james-carr.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.james-carr.org/2010/07/24/payflow-pro-api-released-for-nodejs/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Defining Getters and Setters in NodeJS</title>
		<link>http://blog.james-carr.org/2010/07/19/defining-getters-and-setters-in-nodejs/</link>
		<comments>http://blog.james-carr.org/2010/07/19/defining-getters-and-setters-in-nodejs/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 00:01:04 +0000</pubDate>
		<dc:creator>James Carr</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.james-carr.org/?p=882</guid>
		<description><![CDATA[Recently I discovered something interesting while messing around with NodeJS&#8230; you can define getters and setters using the ECMAScript5 syntax. For a useless example I could do something like this:
 
This is kind of boring though because it&#8217;s just a more complicated way of doing
 
however you can notice in the first example you can [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I discovered something interesting while messing around with NodeJS&#8230; you can define getters and setters using the ECMAScript5 syntax. For a useless example I could do something like this:</p>
<p><script src="http://gist.github.com/482235.js"> </script></p>
<p>This is kind of boring though because it&#8217;s just a more complicated way of doing</p>
<p><script src="http://gist.github.com/482236.js"> </script></p>
<p>however you can notice in the first example you can add any kind of custom behavior to the getter and setter and access it via person.age. Where this does become useful however is if you want to create a read only property, which you can do by just defining the getter alone:</p>
<p><script src="http://gist.github.com/482237.js"> </script></p>
<p>This will print the initial age as expected, however the last line where the attempt is made to set the property will throw  the exception &#8220;<code>TypeError: Cannot set property age of #&lt;a Person&gt; which has only a getter</code>.&#8221;</p>
<p>A small discovery, yet very useful. <img src='http://blog.james-carr.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.james-carr.org/2010/07/19/defining-getters-and-setters-in-nodejs/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
