<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Brownie&#039;s Blog</title>
	<atom:link href="http://brownie.com.au/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://brownie.com.au/blog</link>
	<description>Personal blog of Andrew Browne</description>
	<lastBuildDate>Sun, 03 Feb 2013 04:24:13 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.1</generator>
		<item>
		<title>Importing data from Excel to SQL Server using LightSwitch</title>
		<link>http://brownie.com.au/blog/2013/02/importing-data-excel-to-sql-lightswitch/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=importing-data-excel-to-sql-lightswitch</link>
		<comments>http://brownie.com.au/blog/2013/02/importing-data-excel-to-sql-lightswitch/#comments</comments>
		<pubDate>Sun, 03 Feb 2013 04:04:33 +0000</pubDate>
		<dc:creator>andrew</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://brownie.com.au/blog/?p=24</guid>
		<description><![CDATA[I have been working to get some data imported from Excel to a SQL database. Preferably I&#8217;m looking for a solution so that end users can perform this themselves. One option that came up on the SQLDownUnder mailing list was &#8230; <a href="http://brownie.com.au/blog/2013/02/importing-data-excel-to-sql-lightswitch/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have been working to get some data imported from Excel to a SQL database. Preferably I&#8217;m looking for a solution so that end users can perform this themselves. One option that came up on the <a title="SQLDownUnder Mailing List" href="http://www.sqldownunder.com/Resources/EMailSupportListserver.aspx">SQLDownUnder</a> mailing list was to try using <a title="Microsoft LightSwitch" href="http://msdn.microsoft.com/en-us/vstudio/ff796201.aspx">LightSwitch</a>.</p>
<p>LightSwitch is a wrapper around .NET that makes it easy to create data centric apps with little or no code. In my case to LightSwitch drag and drop took me about 2 minutes once I knew what I was doing and I had to write one line of code.</p>
<p>My test table was just a simple product and category table with data from AdventureWorks</p>
<p><a href="http://brownie.com.au/blog/wp-content/uploads/2013/02/diagram.png"><img class="alignnone size-full wp-image-25" title="Table Diagram" src="http://brownie.com.au/blog/wp-content/uploads/2013/02/diagram.png" alt="Table Diagram" width="305" height="415" /></a></p>
<p>Through the magic of drag and drop LightSwitch produced a functional screen that allowed me to add and edit records:</p>
<p><a href="http://brownie.com.au/blog/wp-content/uploads/2013/02/DetailScreenShot.png"><img class="alignnone size-full wp-image-26" title="DetailScreenShot" src="http://brownie.com.au/blog/wp-content/uploads/2013/02/DetailScreenShot.png" alt="" width="1101" height="642" /></a></p>
<p>It automatically recognised my foreign key relationship and gave me a category dropdown which was nice.</p>
<p>Next I grabbed the <a href="http://code.msdn.microsoft.com/silverlight/Excel-Importer-for-Visual-61dd4a90">excel import plugin</a> for LightSwitch. I couldn&#8217;t get the extension to show in VS 2012 but it worked fine in VS 2010.</p>
<p>I enabled the extension, added a button and in the code behind put my one line of code:</p>
<pre>ExcelImporter.Importer.ImportFromExcel(Products);</pre>
<p>I had a spreadsheet with a new product including the name of its category:</p>
<p><a href="http://brownie.com.au/blog/wp-content/uploads/2013/02/excel.png"><img class="alignnone size-full wp-image-27" title="excel" src="http://brownie.com.au/blog/wp-content/uploads/2013/02/excel.png" alt="" width="451" height="127" /></a></p>
<p>The import plugin gave me a mapping screen that even mapped the category name and filled in the correct foreign key:</p>
<p><a href="http://brownie.com.au/blog/wp-content/uploads/2013/02/import.png"><img class="alignnone size-full wp-image-28" title="import" src="http://brownie.com.au/blog/wp-content/uploads/2013/02/import.png" alt="" width="1101" height="642" /></a></p>
<p>Overall I&#8217;m pretty impressed with what I could in such a short amount of time. The instructions I followed are on the <a href="http://blogs.msdn.com/b/lightswitch/archive/2011/04/13/how-to-import-data-from-excel.aspx">LightSwitch blog</a>.</p>
<p><a href="http://brownie.com.au/blog/wp-content/uploads/2013/02/inserted.png"><img class="alignnone size-full wp-image-30" title="inserted" src="http://brownie.com.au/blog/wp-content/uploads/2013/02/inserted.png" alt="" width="1101" height="642" /></a></p>
<p>There are even user friendly validations based on the SQL fields:</p>
<p><a href="http://brownie.com.au/blog/wp-content/uploads/2013/02/validation.png"><img class="alignnone size-full wp-image-36" title="validation" src="http://brownie.com.au/blog/wp-content/uploads/2013/02/validation.png" alt="" width="1101" height="642" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://brownie.com.au/blog/2013/02/importing-data-excel-to-sql-lightswitch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple interactivity with Raphael.js and Paper.js</title>
		<link>http://brownie.com.au/blog/2012/07/simple-interactivity-wit-raphael-js-and-paper-js/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=simple-interactivity-wit-raphael-js-and-paper-js</link>
		<comments>http://brownie.com.au/blog/2012/07/simple-interactivity-wit-raphael-js-and-paper-js/#comments</comments>
		<pubDate>Sun, 15 Jul 2012 07:47:41 +0000</pubDate>
		<dc:creator>andrew</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://brownie.com.au/blog/?p=4</guid>
		<description><![CDATA[As a prototype for some features we have planned at picnic software I wanted to prototype some very simple interactivity using either canvas or svg. The prototype is simple resizable moveable circles on a page. The Web-Drawing Throwdown from smashing magazine gave me a head &#8230; <a href="http://brownie.com.au/blog/2012/07/simple-interactivity-wit-raphael-js-and-paper-js/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="attachment_14" class="wp-caption alignnone" style="width: 682px"><a href="http://brownie.com.au/blog/wp-content/uploads/2012/07/paper-js-circlework-screenshot.jpg"><img class="size-full wp-image-14" title="Circlework Screenshot" src="http://brownie.com.au/blog/wp-content/uploads/2012/07/paper-js-circlework-screenshot.png" alt="Demo Screenshot" width="672" height="548" /></a><p class="wp-caption-text">Demo Screenshot</p></div>
<p>As a prototype for some features we have planned at <a title="Picnic Software" href="http://picnicsoftware.com">picnic software</a> I wanted to prototype some very simple interactivity using either canvas or svg.</p>
<p>The prototype is simple resizable moveable circles on a page.<br />
The <a href="http://coding.smashingmagazine.com/2012/02/22/web-drawing-throwdown-paper-processing-raphael/">Web-Drawing Throwdown</a> from smashing magazine gave me a head start but didn&#8217;t really address the kind of interactivity I was looking for. Based on the discussion there I elected to use <a href="http://paperjs.org/">paper.js</a> for canvas and <a href="http://raphaeljs.com/">raphael.js</a> for svg (vml in older versions of IE).</p>
<p>You can see the demos here: <a href="http://brownie.com.au/webdemo/circlework/raphael">Rapael.js</a> and <a href="http://brownie.com.au/webdemo/circlework/paper">Paper.js</a></p>
<p>Both libraries gave me high level abstractions for working with the shapes and capturing mouse events. Paper.js seemed to be lacking really rich support for high level objects. You can create a circle like this:</p>
<pre>
new Path.Circle(new Point(x, y), radius);
</pre>
<p>But once created the circle is just a geometric path. You cannot alter the radius of the circle - you have to work with each of the four segments individually.</p>
<div id="LC132">My code to change the size of the circle:</div>
<pre>
circle.segments[0].point.x = centre.x + radius;
circle.segments[1].point.y = centre.y - radius;
circle.segments[2].point.x = centre.x - radius;
circle.segments[3].point.y = centre.y + radius;
</pre>
<div></div>
<div>In contrast Raphael knows that my shape is a circle and lets me modify the radius directly:</div>
<div>
<div id="LC41"></div>
<pre>circle.attr("r", newSize);</pre>
</div>
<div></div>
<div>Both libraries offer an API to react to mouse click and drag events. Raphael allows you attach event handler directly to objects:</div>
<div></div>
<pre>circle.drag(onMove,null,onEnd);</pre>
<div></div>
<div>Where as Paper.js monitor for clicks anywhere on the canvas and then relies on hit testing to help you interpret what the user clicked on:</div>
<div></div>
<pre>var hitResult = paper.project.hitTest(event.point, hitOptions);</pre>
<div></div>
<div>Over all the motion in Raphael feel more responsive. I need to look into any simple optimisations I can make in the Paper.js code. The Raphael circle is also drawn more nicely. I need to revisit my Paper.js smoothing code to see why my circle there is wonky.</div>
<div></div>
<div>You can see <a href="https://github.com/adbrowne/webdemo/blob/master/app/assets/javascripts/circlework.js">my code</a> as it evolves on github.</div>
]]></content:encoded>
			<wfw:commentRss>http://brownie.com.au/blog/2012/07/simple-interactivity-wit-raphael-js-and-paper-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
