Code Minimalist

All about Coding

Computational Geometry

https://en.wikipedia.org/wiki/Computational_geometry

Be the first to rate this post

  • Currently .0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Minimum covering circle problem

https://en.wikipedia.org/wiki/Smallest-circle_problem

Be the first to rate this post

  • Currently .0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Register All the Dll s in a folder for COM Interop

for %f in (.\*.dll) do regasm /tlb %f

Be the first to rate this post

  • Currently .0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Using RegisterStartupScript ScriptManager With ASP.NET Ajax UpdatePanel

Change the code from

Page.ClientScript.RegisterStartupScript(this.GetType(), "myKey", javaScript);

to

ScriptManager.RegisterStartupScript(updatePanelId,updatePanelId.GetType()
                                                      , "alert", javaScript, true);

Be the first to rate this post

  • Currently .0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Generate ObjectID for SDE GeoDatabase using SQL

Example:
Use the i71_get_id procedure to get a value for the object ID column.

DECLARE @id as integer
DECLARE @num_ids as integer
EXEC dbo.i71_get_ids 2, 1, @id output, @num_ids output; 

The 2 after the procedure is a constant that indicates you want to return an object ID. Do not use any other value in this place. The 1 indicates you want one object ID returned from the i71 table. Since you are updating just one record, you only need one object ID.

Source:

Be the first to rate this post

  • Currently .0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Nullable Type as a Generic Parameter

This support both nullable type such as int? , DateTime?, .. as well as classes like string. He re is an extension class code for reading Field values with ESRI ArcObjects:

public static T GetFieldValueOrDefault<T>(this IFeature featurestring fieldName)
        {
            return feature.get_Value(feature.Fields.FindField(fieldName)) != Convert.DBNull
                ? (T)feature.get_Value(feature.Fields.FindField(fieldName)) 
                : default(T);
        }


Currently rated 5.0 by 1 people

  • Currently 5.0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

HOW TO CONTROL CHECK BOX VISIBILITY BEHAVIOR IN DEVEXPRESS WPF TREELISTVIEW

Add this code into your Existing XAML Windows.Resource. Now each node’s IsCheckedBoxEnabled property can control the visibility as well:

<Window.Resources>
        <dx:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
        <dx:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverterInverted" Invert="True" />
        <Style TargetType="{x:Type dxg:RowMarginControl}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Grid Background="{DynamicResource {themes:TreeListViewThemeKey ResourceKey=RowMarginBackgroundBrush}}">
                            <Path x:Name="PART_OffsetPath" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" />
                            <Path x:Name="PART_TreeLinePath" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" />
                            <dxg:IndentsPanel RowIndent="{Binding View.RowIndent}" HorizontalAlignment="Right">
                                <dxg:TreeListNodeExpandButton x:Name="PART_ExpandButton" Foreground="Black" HorizontalAlignment="Left" Command="{Binding View.Commands.ChangeNodeExpanded}"
                                                      CommandParameter="{Binding RowHandle.Value}" IsChecked="{Binding IsExpanded}" IsExpandButtonVisible="{Binding Path=IsButtonVisible}" />
                                <dxe:CheckEdit x:Name="PART_NodeCheckBox" Visibility="{Binding Row.IsCheckBoxEnabled, Converter={StaticResource BooleanToVisibilityConverter}}" IsEnabled="{Binding IsCheckBoxEnabled}"
                                       Focusable="False" IsThreeState="{Binding View.AllowIndeterminateCheckState}" IsChecked="{Binding Row.IsSelected}">
                                    <dxg:GridViewHitInfoBase.HitTestAcceptor>
                                        <dxg:TreeListNodeCheckboxHitTestAcceptor />
                                    </dxg:GridViewHitInfoBase.HitTestAcceptor>
                                </dxe:CheckEdit>
                                <dx:MeasurePixelSnapper Visibility="{Binding IsImageVisible, Converter={StaticResource BooleanToVisibilityConverter}}">
                                    <Image x:Name="PART_NodeImage" Focusable="False" Source="{Binding Image}" Width="{Binding Path=View.NodeImageSize.Width}" Height="{Binding Path=View.NodeImageSize.Height}">
                                        <dxg:GridViewHitInfoBase.HitTestAcceptor>
                                            <dxg:TreeListNodeImageHitTestAcceptor />
                                        </dxg:GridViewHitInfoBase.HitTestAcceptor>
                                        <RenderOptions.BitmapScalingMode>NearestNeighbor</RenderOptions.BitmapScalingMode>
                                    </Image>
                                </dx:MeasurePixelSnapper>
                            </dxg:IndentsPanel>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>

Currently rated 5.0 by 1 people

  • Currently 5.0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5