<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6541466538223889625</id><updated>2024-11-01T10:36:27.163+00:00</updated><category term="html5"/><category term="snap.svg"/><category term="svg"/><category term="Entity Framework"/><category term="PSOM"/><category term="bayesian"/><category term="chomsky"/><category term="d3js"/><category term="drag"/><category term="ef6"/><category term="ethics"/><category term="explosion"/><category term="hack"/><category term="inference"/><category term="jquery-svg"/><category term="magic"/><category term="medicine"/><category term="neural networks"/><category term="nuget"/><category term="opinion"/><category term="prediction"/><category term="raphael.js"/><category term="risk"/><category term="seattle"/><category term="singularity"/><category term="situated interaction"/><category term="snapping"/><category term="thoughts"/><category term="traffic"/><category term="upgrade"/><title type='text'>Rob&#39;s Neuron</title><subtitle type='html'>Programming and machine learning</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://robsneuron.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6541466538223889625/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://robsneuron.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Rob Lang</name><uri>http://www.blogger.com/profile/01377928640392467606</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6541466538223889625.post-2748202096599005147</id><published>2013-11-28T09:21:00.001+00:00</published><updated>2013-11-28T09:21:49.525+00:00</updated><title type='text'>SVG text in boxes with Snap.svg</title><content type='html'>SVG differs from the HTML5 that you&#39;re used to in lots of ways. One of which is text. One requirement I had was to create a box round an arbitrary length of text, like this:
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6xs5H3K2OBWgbJOM3ROXtabMIEWlpDx-MGoDDWRapWZpyUTeCUpxGnvNV5vNQbbcsbcYwI7VZWVZ_3az2l61OZA8-g4CLZCB7QA8oDjo2Br3csov84Zjs73rhPYPwViAzhPjOV-yAbWQ/s1600/hello.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6xs5H3K2OBWgbJOM3ROXtabMIEWlpDx-MGoDDWRapWZpyUTeCUpxGnvNV5vNQbbcsbcYwI7VZWVZ_3az2l61OZA8-g4CLZCB7QA8oDjo2Br3csov84Zjs73rhPYPwViAzhPjOV-yAbWQ/s1600/hello.PNG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
That&#39;s pretty easy in a DIV with some CSS and it&#39;s not difficult in SVG, just different. We&#39;re going to use the &lt;a href=&quot;http://www.snapsvg.io&quot;&gt;Snap.SVG&lt;/a&gt; library to implement it.
&lt;h2&gt;The code&lt;/h2&gt;
First we create the box, add some style. Then we create the text, then some style. Finally, we update the width of the box using the width of the text. &lt;br/&gt;
&lt;br/&gt;
&lt;script src=&quot;https://gist.github.com/brainwipe/7689151.js&quot;&gt;&lt;/script&gt;

&lt;a href=&quot;http://jsfiddle.net/brainwipe/yxjKF/&quot;&gt;JSFiddle Live example.&lt;/a&gt;
&lt;br/&gt;&lt;br/&gt;
&lt;h2&gt;Group to join together&lt;/h2&gt;
The resulting SVG is just two elements that are happened to be one on top of the other. The text is not actually contained in the box, it&#39;s floating on top. Unlike a DIV, if you were to add &lt;a href=&quot;http://robsneuron.blogspot.co.uk/2013/11/using-snapsvg-to-create-box-that-snaps.html&quot;&gt;drag functionality&lt;/a&gt; to the box, the text would remain exactly where it is. To do this, you need to use Snap to &lt;a href=&quot;http://snapsvg.io/docs/#Paper.g&quot;&gt;group the elements together&lt;/a&gt;. Then you can then assign the drag functionality to the group and it behaves normally.
&lt;h2&gt;Changing the length of the text&lt;/h2&gt;
If you were to change the text in the box, you would need to manually update the width of the container too. DIV do that automatically with flow but you don&#39;t get that in SVG. If that kind of text flow is required, you might want to avoid SVG altogether and stick with a mix of HTML and SVG.</content><link rel='replies' type='application/atom+xml' href='http://robsneuron.blogspot.com/feeds/2748202096599005147/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://robsneuron.blogspot.com/2013/11/svg-text-in-boxes-with-snapsvg.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6541466538223889625/posts/default/2748202096599005147'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6541466538223889625/posts/default/2748202096599005147'/><link rel='alternate' type='text/html' href='http://robsneuron.blogspot.com/2013/11/svg-text-in-boxes-with-snapsvg.html' title='SVG text in boxes with Snap.svg'/><author><name>Rob Lang</name><uri>http://www.blogger.com/profile/01377928640392467606</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6xs5H3K2OBWgbJOM3ROXtabMIEWlpDx-MGoDDWRapWZpyUTeCUpxGnvNV5vNQbbcsbcYwI7VZWVZ_3az2l61OZA8-g4CLZCB7QA8oDjo2Br3csov84Zjs73rhPYPwViAzhPjOV-yAbWQ/s72-c/hello.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6541466538223889625.post-6644263366759313244</id><published>2013-11-27T11:31:00.002+00:00</published><updated>2013-11-27T11:31:39.105+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="drag"/><category scheme="http://www.blogger.com/atom/ns#" term="html5"/><category scheme="http://www.blogger.com/atom/ns#" term="snap.svg"/><category scheme="http://www.blogger.com/atom/ns#" term="snapping"/><category scheme="http://www.blogger.com/atom/ns#" term="svg"/><title type='text'>Using Snap.svg to create a box that snaps to a grid</title><content type='html'>&lt;a href=&quot;http://robsneuron.blogspot.co.uk/2013/11/svg-libraries-as-of-november-2013.html&quot;&gt;I reviewed Snap.svg&lt;/a&gt;, the SVG javascript library as my favourite of the current tranche of libraries. This post begins an exploration of how to do simple things in Snap. First we&#39;re going to create a square and give it drag behaviour. Then we&#39;re going to update the drag behaviour to make it snap to a grid. 

&lt;h2&gt;Basic Dragging&lt;/h2&gt;
The first task is to create a square and make it draggable. In Snap, that&#39;s very simple:
&lt;br/&gt;&lt;br/&gt;
&lt;script src=&quot;https://gist.github.com/brainwipe/7673766.js&quot;&gt;&lt;/script&gt;

&lt;a href=&quot;http://jsfiddle.net/brainwipe/BZc8j/1/&quot;&gt;Working example&lt;/a&gt;.

The rounded-corner square is made, some attributes are set and then it is made draggable. Very simple.

&lt;h2&gt;Snapping to Grid&lt;/h2&gt;
The next task is to make the box snap to a grid:
&lt;br/&gt;&lt;br/&gt;
&lt;script src=&quot;https://gist.github.com/brainwipe/7673707.js&quot;&gt;&lt;/script&gt;

&lt;a href=&quot;http://jsfiddle.net/brainwipe/4wMUy/&quot;&gt;Working example&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;

The &lt;em&gt;drag&lt;/em&gt; function is passed two handler functions, the first is called when dragging is happening and the second when drag starts. We use the Snap function &lt;em&gt;snapto&lt;/em&gt; to work out the new x and y position of the box. We have to store the original position of the box because it is not passed into the method anywhere.&lt;br/&gt;
&lt;br/&gt;
I do not like having the orig global variable to store the location of the box. I appreciate that this is used temporarily but global scope variables feel dirty. One solution to this is to wrap the whole lot in a function so that the scope of the &lt;em&gt;orig&lt;/em&gt; variable would only be in that scope. I would prefer Snap to store the origin and pass it to me.

&lt;h2&gt;Dragging with the transform method&lt;/h2&gt;
SVG elements have a transform attribute that take the original description of the SVG object and transforms it automatically. I needed the original x and y to change, so rejected the transform method. Perhaps this could still be performed with a &quot;drag stop&quot; method that takes the transform and applies it to the original but for simplicity, I will leave it as-is. The transform method looks like this:
&lt;br/&gt;&lt;br/&gt;
&lt;script src=&quot;https://gist.github.com/brainwipe/7674201.js&quot;&gt;&lt;/script&gt;

&lt;a href=&quot;http://jsfiddle.net/brainwipe/c8kKJ/&quot;&gt;Working example&lt;/a&gt;.

This is the method that is used in the Snap.svg source code.

&lt;h2&gt;The problem with drag&lt;/h2&gt;
I would prefer that drag accepted a context object that had named methods, rather than relying on the order of parameters. Drag would look more like this:
&lt;br/&gt;&lt;br/&gt;
&lt;script src=&quot;https://gist.github.com/brainwipe/7674220.js&quot;&gt;&lt;/script&gt;

&lt;strong&gt;Please note your version!&lt;/strong&gt; I am writing this in November 2013, the API version is 0.1. There may well be a better way to do this by the time you read this.</content><link rel='replies' type='application/atom+xml' href='http://robsneuron.blogspot.com/feeds/6644263366759313244/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://robsneuron.blogspot.com/2013/11/using-snapsvg-to-create-box-that-snaps.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6541466538223889625/posts/default/6644263366759313244'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6541466538223889625/posts/default/6644263366759313244'/><link rel='alternate' type='text/html' href='http://robsneuron.blogspot.com/2013/11/using-snapsvg-to-create-box-that-snaps.html' title='Using Snap.svg to create a box that snaps to a grid'/><author><name>Rob Lang</name><uri>http://www.blogger.com/profile/01377928640392467606</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6541466538223889625.post-7666548364360116733</id><published>2013-11-26T17:01:00.001+00:00</published><updated>2013-11-26T17:01:30.878+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ef6"/><category scheme="http://www.blogger.com/atom/ns#" term="Entity Framework"/><category scheme="http://www.blogger.com/atom/ns#" term="hack"/><category scheme="http://www.blogger.com/atom/ns#" term="magic"/><category scheme="http://www.blogger.com/atom/ns#" term="nuget"/><category scheme="http://www.blogger.com/atom/ns#" term="upgrade"/><title type='text'>Entity Framework upgrade to 6 configuration and nuget magic</title><content type='html'>This post discusses the update from Entity Framework 5 to 6 and where where must be vigilant in the face of nuget&#39;s magic.

&lt;blockquote&gt;TLDR; Nuget doesn&#39;t update .config if there is custom config and setting the Copy Local property on the reference didn&#39;t change the actualy csproj file.&lt;/blockquote&gt;

&lt;a href=&quot;http://www.nuget.org/&quot;&gt;Nuget&lt;/a&gt; package manager is a wonderful thing. It allows you to simply manage all the of the packages in the solution, update them all automatically, include other dependencies and so on. Wonderful! Glad to have it in the workflow. However, this magic can be dangerous too. Relying on nuget and assuming that it can do no wrong means that debugging problems takes longer because you don&#39;t start with it.

&lt;h2&gt;The EF Upgrade&lt;/h2&gt;
I assigned a junior member of the team to perform the upgrade of Entity Framework from 5 to 6 on our greenfield application. We&#39;re not live anywhere and are code-first so the database can be deleted each time. We manage Entity Framework (like all our favourite external libraries) with nuget. We &lt;a href=&quot;http://msdn.microsoft.com/en-US/data/dn469466&quot;&gt;did our reading&lt;/a&gt; and watched the &lt;a href=&quot;http://channel9.msdn.com/Shows/Visual-Studio-Toolbox/Entity-Framework-5-and-6&quot;&gt;MSDN video&lt;/a&gt; and were prepared.&lt;br/&gt;
&lt;br/&gt;
The upgrade was simple enough, with some namespace changing and when the unit and integration tests went green, the update was committed through TFS &lt;a href=&quot;http://blogs.msdn.com/b/patcarna/archive/2009/06/29/an-introduction-to-gated-check-in.aspx&quot;&gt;gated checkin&lt;/a&gt; and all was good.

&lt;h2&gt;Missing config blows up integration tests&lt;/h2&gt;
We use a local Team Foundation Server instance to manage our integration builds. The cloud TFS server orchestrates the integration build and the integration tests are run against a local virtual machine that mimics a live environment as closely as we dare (or can afford!). However, the test kept going bang. The TFS cloud window won&#39;t show you the stack trace of a local build (yet) but you can retrieve it through Visual Studio 2013. The message I got was quite clear:&lt;br/&gt;&lt;br/&gt;
&lt;pre&gt;System.InvalidOperationException: No Entity Framework provider found for the ADO.NET provider with invariant name &#39;System.Data.SqlClient&#39;. Make sure the provider is registered in the &#39;entityFramework&#39; section of the application config file. See &lt;a href=&quot;http://go.microsoft.com/fwlink/?LinkId=260882&quot;&gt;http://go.microsoft.com/fwlink/?LinkId=260882&lt;/a&gt; for more information.&lt;/pre&gt;
&lt;br/&gt;
Nice error message, so I followed the instructions and put the configuration in. Nuget usually sets up the configuration for you but it could not in this case because we already had some existing configuration. Nuget does not mess with existing configuration. The error went away but was replaced by a new error.
&lt;h2&gt;DLL not copied blows up integration tests&lt;/h2&gt;
The integration tests were still not happy. This was the error:&lt;br/&gt;
&lt;br/&gt;
&lt;pre&gt;System.InvalidOperationException: The Entity Framework provider type &#39;System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer&#39; registered in the application config file for the ADO.NET provider with invariant name &#39;System.Data.SqlClient&#39; could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.&lt;/pre&gt;
&lt;br/&gt;
When a type cannot be loaded for a DLL that is referenced in a project, it usually means that it has not been copied to the output bin/ directory. When you&#39;re not using a type from a referenced library, it will not be copied. That&#39;s expected behaviour, when you&#39;re linking DLLs dynamically (through reflection), you need to tell .NET that the DLL must be copied.&lt;br/&gt;
&lt;br/&gt;
To ensure a DLL is copied to the output folder, go to the properties of a reference, you will see a property &lt;strong&gt;Copy Local&lt;/strong&gt;. This must be set to &lt;em&gt;true&lt;/em&gt;. False means that it will only be copied if there are types being used, which is usually what you want - there&#39;s no point copying DLLs across if the code inside isn&#39;t being used. More info on it default value &lt;a href=&quot;http://stackoverflow.com/questions/3101055/set-copy-local-to-false-by-default&quot;&gt;here&lt;/a&gt;.&lt;br/&gt;
&lt;br/&gt;
For me, that meant that &lt;em&gt;EntityFramework.SqlServer&lt;/em&gt; wasn&#39;t being copied.
&lt;h2&gt;Nuget sets Copy Local property to true but .csproj is not updated&lt;/h2&gt;
I checked the properties of the &lt;em&gt;EntityFramework.SqlServer&lt;/em&gt; reference and it was set to true. Being suspicious, I also checked the &lt;em&gt;.csproj&lt;/em&gt; file in a &lt;a href=&quot;http://www.sublimetext.com/&quot;&gt;text editor&lt;/a&gt; and found that the &quot;Private&quot; property (which represents Copy Local) was not set at all. Changing the property in the Visual Studio 2013 properties window created the &lt;Private&gt; tag in the .csproj.

&lt;h2&gt;Copy Local was not enough&lt;/h2&gt;
A quirk that I have not got to the bottom of yet is that Copy Local is not enough to ensure that Entity Framework 6 can find the Sql Provider. The final step was to reference a type in the base domain context (which overrides the databasecontext you get from EF). This is echoed elsewhere, on &lt;a href=&quot;http://stackoverflow.com/a/19130718/328730&quot;&gt;this Stack Overflow answer&lt;/a&gt;.

&lt;script src=&quot;https://gist.github.com/brainwipe/7661942.js&quot;&gt;&lt;/script&gt;

I hate it, it&#39;s crazy but I&#39;m out of time and this does work.

&lt;h2&gt;Things to learn&lt;/h2&gt;
The integration tests blowing up on the server means the way in which we develop code has gone awry. The learning point for us here is that nuget is great but don&#39;t ignore it when you&#39;re investigating issues. If something feels like the install or upgrade went awry then check there first, don&#39;t assume it&#39;s all gone OK.</content><link rel='replies' type='application/atom+xml' href='http://robsneuron.blogspot.com/feeds/7666548364360116733/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://robsneuron.blogspot.com/2013/11/entity-framework-upgrade-to-6.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6541466538223889625/posts/default/7666548364360116733'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6541466538223889625/posts/default/7666548364360116733'/><link rel='alternate' type='text/html' href='http://robsneuron.blogspot.com/2013/11/entity-framework-upgrade-to-6.html' title='Entity Framework upgrade to 6 configuration and nuget magic'/><author><name>Rob Lang</name><uri>http://www.blogger.com/profile/01377928640392467606</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6541466538223889625.post-4391568729194449006</id><published>2013-11-21T16:46:00.000+00:00</published><updated>2013-11-21T16:46:05.213+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="d3js"/><category scheme="http://www.blogger.com/atom/ns#" term="html5"/><category scheme="http://www.blogger.com/atom/ns#" term="jquery-svg"/><category scheme="http://www.blogger.com/atom/ns#" term="raphael.js"/><category scheme="http://www.blogger.com/atom/ns#" term="snap.svg"/><category scheme="http://www.blogger.com/atom/ns#" term="svg"/><title type='text'>SVG Libraries as of November 2013</title><content type='html'>&lt;a href=&quot;http://www.w3.org/html/wg/drafts/html/CR/&quot;&gt;Support Vector Graphics&lt;/a&gt; (SVG) allows us to create vector images on the browser. Support is &lt;a href=&quot;http://caniuse.com/#cats=SVG&quot;&gt;pretty good&lt;/a&gt; on modern browsers. The difference between Canvas and SVG is best &lt;a href=&quot;http://en.wikipedia.org/wiki/Canvas_element#Canvas_versus_Scalable_Vector_Graphics_.28SVG.29&quot;&gt;described on Wikipedia&lt;/a&gt;. Interacting directly with the SVG document object model (DOM) sounds like a nice low-level computer science thing to do but in industry, it&#39;s best to use libraries constructed by others to take over some of the heavy lifting.&lt;br /&gt;
&lt;br/&gt;
&lt;blockquote&gt;TLDR; I&#39;m going with &lt;a href=&quot;http://snapsvg.io/start/&quot;&gt;Snap.svg&lt;/a&gt;. It&#39;s new but based on a mature library.&lt;/blockquote&gt;
&lt;br /&gt;
This is a round up of the best three libraries I&#39;ve found as of November 2013.

&lt;h2&gt;jQuery SVG&lt;/h2&gt;
&lt;a href=&quot;http://keith-wood.name/svg.html&quot;&gt;jQuery SVG&lt;/a&gt; by Keith Wood is a series of extensions to the jQuery framework for handling SVG. &lt;a href=&quot;http://jquery.com/&quot;&gt;jQuery&lt;/a&gt; works brilliantly for working with a DOM, so it is only reasonable to assume that SVG (which uses a DOM) should also be suitable for jQuery too. The documentation is good, there is a community and plenty of examples.&lt;br/&gt;
&lt;/br&gt;
The syntax for building and animating is sensible:&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/brainwipe/7582860.js&quot;&gt;&lt;/script&gt;
&lt;br/&gt;
&lt;a href=&quot;&quot;&gt;Working Example&lt;/a&gt;. My concern with jQuery-SVG is that the last update was in April 2012, for jQuery 1.7. This does not feel like a project that has someone owning it under active development.
&lt;h2&gt;Raphael&lt;/h2&gt;
&lt;a href=&quot;raphaeljs.com&quot;&gt;Raphael&lt;/a&gt; by &lt;a href=&quot;http://dmitry.baranovskiy.com/&quot;&gt;Dmitry Baranovskiy&lt;/a&gt; is a well established SVG library that acts as an abstraction in front of SVG and VML (used in IE6 and 7). If you need to support older browsers, it&#39;s the best choice. The problem with supporting older browsers is that it is very difficult to implement modern SVG functionality and still support IE6 and 7.&lt;br/&gt;
&lt;br/&gt;
The syntax for building and animating a rectangle is neat too:&lt;br/&gt;
&lt;br/&gt;
&lt;script src=&quot;https://gist.github.com/brainwipe/7583745.js&quot;&gt;&lt;/script&gt;
&lt;br/&gt;
&lt;a href=&quot;http://jsfiddle.net/brainwipe/M8mV7/1/&quot;&gt;Working example&lt;/a&gt;. For my project, supporting older browsers is not a requirement. Raphael is still well supported and there is documentation, but I didn&#39;t get on well with the docs: I needed more concrete examples of use of the various elements and how they fit together. That&#39;s a matter of taste, you might get on better.
&lt;h2&gt;Snap&lt;/h2&gt;
&lt;a href=&quot;http://snapsvg.io&quot;&gt;Snap.svg&lt;/a&gt; is also by &lt;a href=&quot;http://dmitry.baranovskiy.com/&quot;&gt;Dmitry Baranovskiy&lt;/a&gt; and is supported by Adobe (since Dmitry was hired by their Web team - fair play!). Snap shares a lot of code with Raphael and is identical in places. Snap drops support from IE6/7 and is lighter for it. The interface is much like Raphael.&lt;br/&gt;
&lt;br/&gt;
The interface for building and animating is simple:&lt;br/&gt;
&lt;br/&gt;
&lt;script src=&quot;https://gist.github.com/brainwipe/7584970.js&quot;&gt;&lt;/script&gt;
&lt;br/&gt;
&lt;a href=&quot;http://jsfiddle.net/brainwipe/MpBbu/1/&quot;&gt;Working example.&lt;/a&gt; The current version of the Snap framework is 0.1 and usually this would set off alarm bells. I am not concerned in this case as Snap is based so heavily on Raphael that it brings with it a long history and support community. Snap is going to be my choice.
&lt;h2&gt;Not d3.js?&lt;/h2&gt;
&lt;a href=&quot;http://d3js.org/&quot;&gt;D3.js&lt;/a&gt; is an excellent library for representing data. Although it does have a nice API and a framework, I do not need the data visualisation pieces, I just need a lightweight layer over the top of SVG. I am sure that D3 can be used in that way but I think that it not &lt;i&gt;meant&lt;/i&gt; for that.
&lt;h2&gt;Other Libraries&lt;/h2&gt;
&lt;a href=&quot;https://code.google.com/p/svgweb/&quot;&gt;SVG Web&lt;/a&gt; is not updated enough. &lt;a href=&quot;http://processingjs.org/&quot;&gt;Processing.js&lt;/a&gt; is great for data visualisation but not quite what I needed. &lt;a href=&quot;http://livedocs.dojotoolkit.org/dojox/gfx&quot;&gt;Dojo&lt;/a&gt; looks light on support and I can&#39;t find out how often it is revised. &lt;a href=&quot;http://svgkit.sourceforge.net/&quot;&gt;SVGKit&lt;/a&gt; has a bunch of libraries and is cross-browser but appears to be rarely updated. &lt;a href=&quot;http://www.liquidx.net/plotkit/&quot;&gt;Plotkit&lt;/a&gt; looks neat but last updated 2006. &lt;a href=&quot;http://www.dotuscomus.com/pergola/examples.html&quot;&gt;Pergola&lt;/a&gt; is all about building whole apps in SVG, which is a sledgehammer for my particular nut.
&lt;h2&gt;Further Reading&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://www.farinspace.com/top-svg-javascript-libraries-worth-looking-at/&quot;&gt;Far In Space - Top SVG JS Libraries worth looking at&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://docs.webplatform.org/wiki/tutorials/svg_primer&quot;&gt;HTML Rocks SVG Primer&lt;/a&gt;&lt;/li&gt;</content><link rel='replies' type='application/atom+xml' href='http://robsneuron.blogspot.com/feeds/4391568729194449006/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://robsneuron.blogspot.com/2013/11/svg-libraries-as-of-november-2013.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6541466538223889625/posts/default/4391568729194449006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6541466538223889625/posts/default/4391568729194449006'/><link rel='alternate' type='text/html' href='http://robsneuron.blogspot.com/2013/11/svg-libraries-as-of-november-2013.html' title='SVG Libraries as of November 2013'/><author><name>Rob Lang</name><uri>http://www.blogger.com/profile/01377928640392467606</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6541466538223889625.post-6705593628184204540</id><published>2012-11-02T17:48:00.001+00:00</published><updated>2012-11-02T17:49:15.600+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="chomsky"/><category scheme="http://www.blogger.com/atom/ns#" term="neural networks"/><category scheme="http://www.blogger.com/atom/ns#" term="opinion"/><category scheme="http://www.blogger.com/atom/ns#" term="PSOM"/><category scheme="http://www.blogger.com/atom/ns#" term="thoughts"/><title type='text'>Noam Chomsky: Where AI went wrong</title><content type='html'>&lt;a href=&quot;http://www.theatlantic.com/technology/archive/2012/11/noam-chomsky-on-where-artificial-intelligence-went-wrong/261637/&quot;&gt;Noam Chomsky was interviewed by the Atlantic&lt;/a&gt;. The article is well written but biased towards Chomsky&#39;s viewpoint. I think the title of the article is ridiculous, but that&#39;s the modern media for you. It&#39;s inflammatory, over-reaching and ignorant. AI may have fractured but it&#39;s not gone wrong. Gone wrong is when your toaster decides your dog needs to die.

I do like Chomsky&#39;s viewpoint that:
&lt;blockquote&gt;&quot;new AI&quot; -- focused on using statistical learning techniques to better mine and predict data -- is unlikely to yield general principles about the nature of intelligent beings or about cognition&lt;/blockquote&gt;
Which is quite true and has been eating away at me for some time. My &lt;a href=&quot;http://centaur.reading.ac.uk/21612/&quot;&gt;dynamic neural networks&lt;/a&gt;, although used for clustering and classification, have the potential to simulate more organic systems. 

The way I &lt;em&gt;actually&lt;/em&gt; treat my algorithms is without due care. I&#39;m less bothered with finding maxima but investigating the dataset to see what there is. Novelty and discovery are more important to me than function approximation or reasoned logic. My latest batch of code (written in javascript) has the facility to give the network neuron damage to see what the affect on learning is. Optimisation it certainly isn&#39;t. It&#39;s a child-like approach to investigation (and mathematics!).

What the article did for me was hold up a mirror. Some years have passed since graduating with my PhD, I&#39;m still fascinated by my wobbling algorithms but have struggled to grasp why. Now I think it might be that I am more interested in the biological parallels than using them to predict, cluster or classify. The parallels are bi-directional. Steal more from biology, understand a little more.

&lt;h2&gt;Action&lt;/h2&gt;
With that in mind, I can see my own research with greater lucidity. It&#39;s OK not to worry about something&#39;s ability to classify or cluster, what other biological parallels can I draw. Firstly, I think neurons with different properties (rather than homogeneous ones) might work well, as might limits on connectivity. That would better represent the physical limits of the real world.

I&#39;m very much thinking out loud now, which leads me into trouble.</content><link rel='replies' type='application/atom+xml' href='http://robsneuron.blogspot.com/feeds/6705593628184204540/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://robsneuron.blogspot.com/2012/11/noam-chomsky-were-ai-went-wrong.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6541466538223889625/posts/default/6705593628184204540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6541466538223889625/posts/default/6705593628184204540'/><link rel='alternate' type='text/html' href='http://robsneuron.blogspot.com/2012/11/noam-chomsky-were-ai-went-wrong.html' title='Noam Chomsky: Where AI went wrong'/><author><name>Rob Lang</name><uri>http://www.blogger.com/profile/01377928640392467606</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6541466538223889625.post-2653434240348188772</id><published>2012-08-16T10:10:00.000+01:00</published><updated>2012-08-16T10:11:20.805+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ethics"/><category scheme="http://www.blogger.com/atom/ns#" term="explosion"/><category scheme="http://www.blogger.com/atom/ns#" term="risk"/><category scheme="http://www.blogger.com/atom/ns#" term="singularity"/><title type='text'>Q&amp;A with Luke Muehlhauser, CEO of Singularity Institute</title><content type='html'>An &lt;a href=&quot;http://www.reddit.com/r/Futurology/comments/y9lm0/i_am_luke_muehlhauser_ceo_of_the_singularity/&quot;&gt;interesting reddit Q&amp;A session&lt;/a&gt; with Luke Muehlhauser, the CEO of the &lt;A href=&quot;http://singularity.org/&quot;&gt;Singularity Institute&lt;/a&gt;. He answers questions from &quot;What if we make something more intelligent than us?&quot; through to questions on morality and friendly AIs. The questions and the answers are interesting throughout.
&lt;h2&gt;Singularity Institute&lt;/h2&gt;
The &lt;A href=&quot;http://singularity.org/&quot;&gt;Singularity Institute&lt;/a&gt; is an interesting research organisation that focuses on creating AI in such a way that we don&#39;t destroy ourselves as a civilisation. The idea of friendly AI and ethics is an interesting one. As an algorithm-based researcher, my focus is rarely on the ethics but the efficiency of the algorithm. &lt;br/&gt;
&lt;br/&gt;
This area of AI is known as AI Risk and a term you&#39;ll see a lot is &lt;a href=&quot;http://intelligenceexplosion.com/&quot;&gt;Intelligence Explosion&lt;/a&gt;, where learning machines are capable of exceeding their original configuration and programming.
&lt;h2&gt;Should I stop doing AI?&lt;/h2&gt;
No. However, it&#39;s definitely worth bearing these ideas in mind before starting a simulation.</content><link rel='replies' type='application/atom+xml' href='http://robsneuron.blogspot.com/feeds/2653434240348188772/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://robsneuron.blogspot.com/2012/08/q-with-luke-muehlhauser-ceo-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6541466538223889625/posts/default/2653434240348188772'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6541466538223889625/posts/default/2653434240348188772'/><link rel='alternate' type='text/html' href='http://robsneuron.blogspot.com/2012/08/q-with-luke-muehlhauser-ceo-of.html' title='Q&amp;A with Luke Muehlhauser, CEO of Singularity Institute'/><author><name>Rob Lang</name><uri>http://www.blogger.com/profile/01377928640392467606</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6541466538223889625.post-7543779988717668008</id><published>2012-07-11T19:00:00.000+01:00</published><updated>2012-07-11T19:00:04.485+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bayesian"/><category scheme="http://www.blogger.com/atom/ns#" term="inference"/><category scheme="http://www.blogger.com/atom/ns#" term="medicine"/><category scheme="http://www.blogger.com/atom/ns#" term="prediction"/><category scheme="http://www.blogger.com/atom/ns#" term="seattle"/><category scheme="http://www.blogger.com/atom/ns#" term="situated interaction"/><category scheme="http://www.blogger.com/atom/ns#" term="traffic"/><title type='text'>Microsoft Research: Machine Learning and Intelligence in Our Midst</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
This is an interesting video from&amp;nbsp;Eric Horvitz at&amp;nbsp;Microsoft Research that covers a little on the use of Inference Networks. Real world applications include traffic prediction and hospital admission. Eric also talks about how they constructed a model for the receptionist of the MS Research building. Video below the jump.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.youtube.com/embed/Qe0256zAsNU?feature=player_embedded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;h2&gt;

&lt;span style=&quot;font-size: large;&quot;&gt;Inference Networks&lt;/span&gt;&lt;/h2&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
Bayesian Belief Networks use Bayesian probability theory to infer a certain state given data inputs. Inference networks model expert data and use statistics from different sources to predict the future.&amp;nbsp;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
One real world application presented is the Seattle road traffic network. Traffic information comes down to a task of novelty detection - to predict when something new and unexpected happens. With maps integration, their Clear Flow system (or traffic sensitive routing) will help route you around the traffic. The data scales used are huge and now span the breadth of America.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
The other real world application covers readmission of patients into hospital. The network can infer when a patient leaving hospital is likely to come back.&lt;/div&gt;
&lt;h3&gt;

&lt;span style=&quot;font-size: large;&quot;&gt;Top tip&lt;/span&gt;&lt;/h3&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Eric points out that when training your algorithm, only train it on 80% of the data available and leave 20% remaining to test it. That&#39;s a tip you&#39;ll find in lots of places and I heartily recommend it.&lt;/div&gt;
&lt;h3&gt;

&lt;span style=&quot;font-size: large;&quot;&gt;Decisions from learning&lt;/span&gt;&lt;/h3&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Eric mentions that there is a difficulty with making decisions from prediction. Once you&#39;ve predicted that someone is going to be readmitted, deciding what to do is a second problem.&lt;/div&gt;
&lt;h2&gt;

The Digital Assistant&lt;/h2&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
This is an interesting piece of work where a system tracks the people talking to it and makes inferences to predict what they need. There are interesting human computer interfacing challenges here too, such as predicting when someone is talking to themselves. I find the voice and talking head spooky but then this is a research project and most AI research is spooky by nature.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://robsneuron.blogspot.com/feeds/7543779988717668008/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://robsneuron.blogspot.com/2012/07/microsoft-research-machine-learning-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6541466538223889625/posts/default/7543779988717668008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6541466538223889625/posts/default/7543779988717668008'/><link rel='alternate' type='text/html' href='http://robsneuron.blogspot.com/2012/07/microsoft-research-machine-learning-and.html' title='Microsoft Research: Machine Learning and Intelligence in Our Midst'/><author><name>Rob Lang</name><uri>http://www.blogger.com/profile/01377928640392467606</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>