Skip to content

Instantly share code, notes, and snippets.

View bradbrowne's full-sized avatar

Brad Browne bradbrowne

  • Melbourne, Australia
View GitHub Profile
@bradbrowne
bradbrowne / DatePicker created in RuntimeModifications returns System.String not System.DateTime.xaml
Last active January 19, 2017 01:11
🐛 GeoCortex DatePicker created in RuntimeModifications returns "/Date(milliseconds)/" not System.DateTime
<Activity mc:Ignorable="sap sap2010 sads" x:Class="ActivityBuilder" this:ActivityBuilder.WorkflowContainerName="GistDateMilliseconds"
xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
xmlns:gcx="http://apis.geocortex.com/2009"
xmlns:gfci="clr-namespace:Geocortex.Forms.Client.Items;assembly=Geocortex.EssentialsWpfApi"
xmlns:gwa="clr-namespace:Geocortex.Workflow.Activities;assembly=Geocortex.Workflow.Activities"
xmlns:gwa1="clr-namespace:Geocortex.Workflow.Activities;assembly=Geocortex.Workflow"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities"
xmlns:s="clr-namespace:System;assembly=mscorlib"
xmlns:sads="http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger"
$SqlConnection = New-Object System.Data.SqlClient.SqlConnection
$SqlConnection.ConnectionString = "integrated security=SSPI;` data source=$ServerName;` initial catalog=$DatabaseName;"
$SqlCmd = New-Object System.Data.SqlClient.SqlCommand
$SqlCmd.CommandText = "sp_sw_rtree_is_created"
$SqlCmd.Connection = $SqlConnection
$SqlCmd.CommandType = [System.Data.CommandType]'StoredProcedure';
$SqlCmd.Parameters.AddWithValue("@owner", "$OwnerName") >> $null;
$SqlCmd.Parameters.AddWithValue("@table", "$TableName") >> $null;
$SqlCmd.Parameters.AddWithValue("@spatialcolumn", "$SpatialColumn") >> $null;
$SqlCmd.Parameters.AddWithValue("@keycolumn", "$KeyColumn") >> $null;
set-location "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
set-location ZoneMap\Domains new-item BRAD-SERVER
set-location BRAD-SERVER
new-itemproperty . -Name http -Value 2 -Type DWORD
public class SampleRequestValidator : RequestValidator
{
protected override bool IsValidRequestString( HttpContext context, string value, RequestValidationSource requestValidationSource, string collectionKey, out int validationFailureIndex )
{
validationFailureIndex = 0;
if ( requestValidationSource == RequestValidationSource.Form
&& collectionKey.Equals( WSFederationConstants.Parameters.Result, StringComparison.Ordinal ) )
{
SignInResponseMessage message = WSFederationMessage.CreateFromFormPost( context.Request ) as SignInResponseMessage;
if ( message != null )
<?xml version="1.0" encoding="UTF-8"?>
<ClipboardData xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:gwa="clr-namespace:Geocortex.Workflow.Activities;assembly=Geocortex.Workflow.Activities" xmlns:p="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Version="1.0">
<ClipboardData.Data>
<scg:List x:TypeArguments="x:Object" Capacity="1">
<gwa:ReferenceWorkflow x:Name="__ReferenceID0" DisplayName="QueryArray COMPLETED_DATE" VirtualizedContainerService.HintSize="1392,82" WorkflowXamlUri="&amp;quot;gcxfile:///Templates/Workflows/Asset/Shared/QueryArray.xaml&amp;quot;">
<gwa:ReferenceWorkflow.Arguments>
<p:InArgument x:TypeArguments="scg:Dictionary(x:String, x:Object)" x:Key="QueryDictionar
create or replace TRIGGER ASSET.ASSET_ID_BASE_POINT_TR
-- Automatically assigns new ASSET_ID based on a Sequence
BEFORE INSERT
OR UPDATE -- Required for ArcGIS REST API compatibility
ON ASSET.ASSET_BASE_POINT
FOR EACH ROW
DECLARE
BEGIN
IF :NEW.asset_id IS NULL THEN
IF :OLD.asset_id IS NULL THEN
@bradbrowne
bradbrowne / get-geometry-service-url.vb
Created September 19, 2016 23:10
Get ArcGIS Geometry Service Url from Feature Service Url in VB.NET
(New Uri(assetFeatureServiceUrl)).GetLeftPart(UriPartial.Authority) + "/arcgis/rest/services/Utilities/Geometry/GeometryServer"
@bradbrowne
bradbrowne / geocortex-get-geometry-service-url.xaml
Created September 19, 2016 06:22
GeoCortex Get Geometry Service URL
<?xml version="1.0" encoding="utf-16"?>
<ClipboardData Version="1.0" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:p="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ClipboardData.Data>
<scg:List x:TypeArguments="x:Object" Capacity="1">
<p:Assign x:Name="__ReferenceID0" VirtualizedContainerService.HintSize="603,59">
<p:Assign.To>
<p:OutArgument x:TypeArguments="x:String">[geometryServiceUrl]</p:OutArgument>
</p:Assign.To>
<p:Assign.Value>
<p:InArgument x:TypeArguments="x:String">[(New Uri(assetFeatureServiceUrl)).GetLeftPart(UriPartial.Authority) + "/arcgis/rest/services/Utilities/Geometry/GeometryServer"]</p:InArgument>
@bradbrowne
bradbrowne / nearest-line-to-polygon.sql
Last active September 28, 2015 07:26
Nearest Line to Polygon
with distance_cte AS
(
SELECT
pv.PFI AS pr_view_pfi,
tr.PFI AS tr_pfi,
pv.SP_GEOMETRY.STDistance(tr.SP_GEOMETRY) AS distance,
RANK() OVER (PARTITION BY pv.pfi ORDER BY pv.SP_GEOMETRY.STDistance(tr.SP_GEOMETRY)) AS rank_distance
FROM Flux.vmprop.PROPERTY_VIEW AS pv, Flux.vmtrans.TR_ROAD AS tr
--WHERE pv.pfi = 173589345
)
MAP
...
SHAPEPATH "C:\\IntraMaps\Data\Stonnington"
SIZE 940 1207
STATUS ON
SYMBOLSET "C:\\Program Files (x86)\\MapManager20\\templates\\symbols.sym"
UNITS METERS
...
LAYER
DATA PROPERTY_VIEW