Skip to content

Instantly share code, notes, and snippets.

View zenwalk's full-sized avatar
🏠
Working from home

chenn zenwalk

🏠
Working from home
View GitHub Profile
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using Dapper;
// to have a play, install Dapper.Rainbow from nuget
//'using' System.Data.SQLite;
using (DbConnection connection = new SQLiteConnection("Data Source=" + database)) {
connection.Open(); // load the extension
using (DbCommand command = connection.CreateCommand()) {
//Load the libspatialite library extension - *.dll on windows, *.a on iOS
command.CommandText = "SELECT load_extension('libspatialite-2.dll');";
command.ExecuteNonQuery(); // Run queries here
}
}

Author: Sean Gillies Version: 1.0

Abstract

This document describes a GeoJSON-like protocol for geo-spatial (GIS) vector data.

Introduction

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style
x:Key="ButtonFocusVisual">
<Setter
Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2" />
</ControlTemplate>
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style
x:Key="ButtonFocusVisual">
<Setter
Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2" />
</ControlTemplate>
// GWLlosa's answer in http://stackoverflow.com/questions/521687/c-sharp-foreach-with-index
using System;
using System.Collections.Generic;
using System.Linq;
namespace EnumerateTest {
class Program {
static void Main(string[] args) {
List<int> list = new List<int> {4, 2, 3, 1, 8};
@zenwalk
zenwalk / gist:9871538
Created March 30, 2014 11:34
责任链模式
using System;
using System.Collections.Generic;
using System.Linq;
namespace ConsoleApplication7
{
public abstract class RequestHandler
{
public abstract Response SendAsync(Request request);
}
@zenwalk
zenwalk / Client
Created March 30, 2014 15:28
NetMQ Sample
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NetMQ;
namespace ConsoleApplication4
{
class Program
@zenwalk
zenwalk / gist:9874456
Created March 30, 2014 15:30
clay example
using System;
using ClaySharp;
namespace ConsoleApplication1.Samples.Clay {
public static class ClaySamples {
public static void RunAll() {
PropertyAssignment();
IndexedPropertySyntax();
ChainableSetters();
AnonymousObject();
function guid() {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
}
return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
s4() + '-' + s4() + s4() + s4();
}