AO Extension to udpate attribute field when editing attribute table. 实现当用户在属性表更新数据时,某个字段也被自动更新.
OptionExplicit Implements IExtension
PrivateWithEvents m_pEditEvents As esriEditor.Editor Dim m_pApp As IApplication
DimWithEvents m_pDoc As MxDocument
PrivateProperty Get()PropertyGet IExtension_Name() AsString IExtension_Name ="Update label" End Property
PrivateSub IExtension_Shutdown()Sub IExtension_Shutdown() ' Clear the reference to the Application and MxDocument Set m_pApp =Nothing Set m_pDoc =Nothing End Sub
PrivateSub IExtension_Startup()Sub IExtension_Startup(initializationData As Variant)
Set m_pApp = initializationData 'Start listening for the MxDocument events. Set m_pDoc = m_pApp.Document
Set m_pEditEvents = m_pApp.FindExtensionByName("esriEditor.Editor")
End Function
PrivateFunction getmxd()Function getmxd() As IMxDocument Set getmxd = m_pDoc End Function
PrivateSub m_pEditEvents_OnChangeFeature()Sub m_pEditEvents_OnChangeFeature(ByVal obj As esriGeoDatabase.IObject)
IfTypeOf obj Is IFeature Then Dim pf As IFeature Set pf = obj
If verifyFile(LCase(pf.Class.AliasName), "m_subdivision_shape") =TrueThen Dim pSubDivNO AsString pSubDivNO =Trim(pf.Value(pf.Fields.FindField("SUB_DIV_NO")))
Dim pMR AsString pMR =Trim(pf.Value(pf.Fields.FindField("MR")))
Dim pRespPTY AsString pRespPTY =Trim(pf.Value(pf.Fields.FindField("RESP_PTY")))
public class OcuppyMoreThanHalf {
/**
* Q74 数组中有一个数字出现的次数超过了数组长度的一半,找出这个数字
* two solutions:
* 1.O(n)
* see <beauty of coding>--每次删除两个不同的数字,不改变数组的特性
* 2.O(nlogn)
* 排序。中间
cygwin很多命令显示command not found的解决办法
修改cygwin.BAT文件如下
@echo off
D:
set CYGWIN=tty notitle glob
set PATH=%PATH%;d:\cygwin\bin;d:\cygwin\sbin;d:\cygwin\usr\bin;d:\cygwin\usr\sbin;d:\cygwin\us