Mapping of Toronto Neighbourhoods with TopoJSON and D3.js
- View on Bl.ocks.org
- TopoJSON, GeoJSON and Shp files of Toronto neighbourhoods can be found in my repo jasonicarter
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>My Hello World Title</title> | |
<!--[if lt IE 9]> | |
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> | |
<![endif]--> | |
<link rel="shortcut icon" href="favicon.ico"> | |
<link rel="stylesheet" href="style.css"> |
for (QStringList::iterator it = tmpList.begin(); it != tmpList.end(); ++it) | |
{ | |
QString tmpString = *it; | |
LOG("string: %s", tmpString.toStdString().c_str()); | |
} |
#define LOG(fmt, args...) do { fprintf(stdout, "[MyApp] " fmt "\n", ##args); fflush(stdout); } while (0); | |
USAGE: | |
LOG("Hello World"); | |
OUTPUT: | |
[MyApp] Hello World |
--columnField1 is the field you're looking for duplicates in | |
--columnField2 orderby, optional, for example a datetime stamp and you want to keep the latest record | |
WITH AllRecords_CTE | |
AS | |
( | |
SELECT columnField1, | |
ROW_NUMBER() over (PARTITION BY columnField1 ORDER BY columnField2 DESC) AS [rn] | |
FROM #AllRecords | |
) | |
DELETE AllRecords_CTE |
select column1, | |
stuff((SELECT distinct ', ' + cast(column2 as varchar(10)) | |
FROM table t2 | |
where t2.column1 = t1.column1 | |
FOR XML PATH('')),1,1,'') | |
from table t1 | |
group by column1 | |
/* | |
column1 - field you want to group items based on |
<div class="main"> | |
<sc:Placeholder id="myPlaceHolderID" key="myPlaceHolderKey"></sc:Placeholder> | |
</div> | |
//Problem: How do I know if my placeholder is empty? | |
//#1 | |
var controlCnt = Sitecore.Context.Page.Renderings.Count( | |
r => r.Placeholder.IndexOf("myPlaceHolderKey", StringComparison.OrdinalIgnoreCase |
<?php | |
wp_list_comments( array('avatar_size' => 64) ); | |
?> |
Rules -> Insert Options -> Rules and create a new rule for "item xyz" | |
Then follow along with the code below to set up the rule | |
'where' the item is the 'home' item or one of its subitems | |
'and' 'except where' the item template is 'item xyz' | |
'and' 'except where' the result of query './*[(@@templateid='{item-xyz-template-ID}')]' exists | |
add 'item xyz' insert option | |
Basically: No parent should have more than one item with template id of "item xyz" as a child, | |
so if it already does, remove "item xyz" as an option in Insert Options list |
http://[SitecoreInstance]/sitecore/admin/showconfig.aspx |
Mapping of Toronto Neighbourhoods with TopoJSON and D3.js