April 15, 2009

Sorting Algorithms

A friend of mine sent me a link to http://www.sorting-algorithms.com/shell-sort and I love it! I think I'll start using the Shell sorting algorithm from now on!

March 27, 2009

ESRI DevSummit - Thursday

Last day of the conference :-(

Working Effectively with the Geodatabase Using SQL
I couldn't focus very well at this one. I don't know if it was the topic or fatigue. I have some notes, but I'm not sure they make much sense, so I'll skip 'em.

Patterns and Best Practices for Building Applications with the ArcGIS API for Microsoft Silverlight

  • Samples in Code Gallery:
    • Virtual Earth (couldn't find it)
    • WMS (couldn't find it)
  • ESRI.ArcGIS.ValueConverters: converts dictionary for data binding
  • Check MIX 2009 online sessions to learn about Silverlight.
  • Microsoft recommends putting Silverlight 3 on a VM, separate from Silverlight 2.
  • ESRI working closely with Microsoft on Silverlight 3.

Closing Session

ArcGIS Server Performance and Scalability - Testing Methodologies
If you develop & test with MS, check this session out. Lots of good info.

ESRI DevSummit - Wednesday

Keynote Session
David Chappell did the keynote session and did a really great job explaining SOAP & REST, although his first couple of minutes reminded me of the ShamWow infomercial!
I did not completely agree with his take on REST as he made its implementation sound a bit more complicated than it really is. Overall, though, this is one to view online if you weren't there, and possibly to view again even if you were there.

Developing Advanced Applications with the ArcGIS JavaScript API
This was the best session I attended. Jayant did a fabulous job and I took lots of notes here. If you plan to develop with the JSAPI, I highly recommend you watch it. Jayant's session code is in the Code Gallery. You should subscribe to the Code Gallery's RSS feed.
Here are my notes:

  • The reason ESRI chose Dojo is because of Dijits.
  • Dijit = Dojo + widget.
  • You can build your own dijits.
  • Sample layouts using Dojo in the code gallery.
  • Check out the Creating a Simple Map Dijit blog post.
  • A dijit is composed of:
    • an HTML template with lays out the elements on the page.
      • a template can have only 1 root element
      • dojoAttachPoint property: way to refer to element within widget (ex: this.Name)
      • dojoAttachEvent property: attach function to event
    • a CSS file that sets the styles
    • a JS class that includes the widget's code.
  • Check out the identify widget in the code gallery.
  • If using lots of dijits, look into dojo.require("dijit.dijit"); and dojo.require("dijit.dijit-all");
  • Printing: they put up a sample for printing with PHP, .NET or Java in the Code Gallery. I think this entry might be the one they referred to.
  • Problem with printing from browser is that only the topmost layer and graphics will print. One solution is to merge all the layer images into one on the server.
  • Look into esri.Request in the JSAPI. It wraps around dojo.io.script.get & dojo.xhrRawPost. Has additional error handling and uses proxy for large requests. At 1.3, esri.request can be forced to use proxy even if alwaysUseProxy = false.
  • ArcIMS, WMS custom layers in Code Gallery. Custom layers are new at 1.3.
  • esri.config.defaults.io.timeout new at 1.3.
  • JSAPI clustering in Code Gallery (couldn't find it). Will integrate layer clustering more with JSAPI in the future.
  • To learn about Dojo, go to http://docs.dojocampus.org/. Should go there for documentation. Also, download the Dojo toolbox
  • New at 1.3: infoWindow should match selected Dojo theme better.
  • Free web training seminar coming up on creating mashups with JSAPI.

User Presentation - Print & Legend Web Services for the ArcGIS JS API or WebADF
This was my presentation Wednesday at 1PM. I had a really great time with it and got some very good questions. Here are my slides. Thanks to all who came by!

Introducing and Implementing ArcGIS Explorer 900 - Part I
I'm really looking forward to playing with this when it comes out. It's currently in closed beta but it looks very promising. One main thing I'd like to see for myself is whether this is faster than the old versions. That always seemed to be the limiting factor for us.
Notes:

  • Part of ArcGIS system.
  • Presentation tools within ArcGIS Explorer.
  • Core functionality based on ArcGIS Online data & services.
  • Can use GIS services and packaged layers.
  • Can leverage local content (ArcIMS, WMS, GeoRSS, shapefiles, file & enterprise geodatabases, KML, raster, ...)
  • Target release: July 2009.
  • New application architecture.
  • Keyboard accessible. Very cool feature when you click Alt (? I think that's right), it visually shows you which keys correspond to which feature on the screen.
  • 2D/3D:
    • Both use same functionality
    • Both use same data support
    • Both use basemaps
    • Both use extensibility model & API
  • Every Explorer map starts with a basemap. Basemap can be ArcGIS Online, Virtual Earth or custom.
  • Shipped with 6 languages from the start: English, German, Spanish, French, Japanese & Chinese.
  • Language set independently from OS.
  • Can deploy customized version of application.
  • Application configuration file (*.ncfg) defines functionality available in Explorer & how it's organized.
  • Comes with tool to set configuration => no need for programming.
  • Extending Explorer: 4 types of add-ins:
    • buttons
    • dockable windows
    • gallery
    • extension
  • Pure .NET API SDK
  • Early adopter beta:
    • open to anyone, but not public
    • contact ESRI staff memeber to sign up. Need to provide name, email, organization, and description of goal.

User Presentation - Introduction to Agile Software Development
Excellent presentation by Chris Spagnuolo. Make sure you listen to the presentation when it's made available on ESRI's website.

Patterns and Best Practices for Building Applications with ArcGIS API for JavaScript
Those patterns and best practices presentations weren't quite what I expected, but I still learned some good tidbits in here...
My notes:

  • "A great map is not made up of a single MXD"
  • Google tiles: none > 20KB
  • Check Design Patterns for Web Maps AGS blog post.
  • Base map should be cached unless you have a very good reason not to.
  • Operational layers can be dynamic or cached. Better result with cached of course.
  • Check out seleniumhq.org for tests within Firefox.
  • Check out D.O.H. for JS unit testing. 

March 25, 2009

ESRI DevSummit - Wednesday Presentation

I am presenting tomorrow at 1PM about Legend & Print web services we've developed. Come check it out if you can!

ESRI DevSummit - Tuesday - Sessions

Effective Geodatabase Programming

  • When to validate data:
    • after loading, prior to versioning
    • on DEFAULT version
    • other option I didn't catch
  • Validate* methods => IValidation
  • Geodatabase schema definition as XML is available online. Look for "XML Schema of the Geodatabase" PDF. Constantly updated.
  • 9.4: revamping the geodatabase:
    • 35 GDB_* tables are becoming just 4. Any code that directly queries those tables will stop working in 9.4.
    • open schema (no binary serialization)
    • well documented
    • heavy reliance upon data elements & XML
    • low-level API available for file geodatabase (so no need to use ArcObjects)
  • Cursors:
    • Scope update cursors within edit operations, not across them.
    • Insert cursor: best performance when using buffering & proper flushing
    • Periodically call flush with insert cursors (every 1000 inserts is a good rule of thumb)
    • Release cursor ASAP
    • GetRows should be favored over GetRow in loops
    • Use GetIDs if all you want is the OIDs instead of using cursor
    • Use snapshot type of selection if # selected < 100
    • ISelectionSet.AddList: use IGeodatabaseBridge2.AddList
  • Geodatabase blog: blogs.esri.com/dev/blogs/geodatabase/default.aspx

Overview of JS APIs
I started going to the geoprocessing session, but since it was the same as the preconference seminar, I went to the JS API one. Learned some useful stuff:

  • Released Aptana module for JS API code assist
  • dojocampus.org: good site for Dojo training, videos, etc.
  • JSAPI seems to be designed to be section 508 compliant (ADA)
  • New at 1.4:
    • multiple graphic layers
    • improved renderers
    • use dojox.color.Generator.monochromatic to create range of colors
    • call Simplify on graphics drawn by users

User Presentation - Unit Testing 101 - Building Testable Applications
I honestly did not get as much out of this presentation as I was hoping to. I learn with real examples, and the presentation seemed focused more on concepts. Yes, I know there were samples, but I need to see lots of code and understand exactly how it works.

Building Your First Rich Internet Application with ArcGIS API for Flex
This was a bit of a let-down session for me. There were a few problems with demos. Internet connection was iffy, maybe that was part of the problem.

Microsoft Sponsor Spotlight
Very cool. Microsoft portion of it was a little dry & tedious. Art Haddad's (ESRI) section was much, much better. I will definitely be looking into this.
A few notes:

  • According to Art, there are no functional differences between the Flex API & the Silverlight API.
  • According to Art, there is a top-level effort to keep the various APIs in sync, i.e., provide similar functionality across APIs. There are, of course, differences due to the fact that these are built on top of different platforms.
  • It sounds like Silverlight 3 might offer advantages over Flex.
  • If I remember correctly, over 300 million downloads of Silverlight so far.

ESRI DevSummit - Tuesday - Plenary

For some reason, I skipped most of the plenary last year. At least I think I did. Maybe I skipped most of the keynote session. In any case, don't skip the plenary. Yeah, it's totally "drink the ESRI Kool-Aid", but, if you're like me, you're gonna love it. I think most of it is already online, so check it out.
Here are the highlights:

  • 1100 developers attending
  • 200+ ESRI developers attending + other ESRI staff
  • 9.3.1 will be shipped soon (they're saying May) and will be called a "maintenance release", not just a service pack. It contains LOTS of stuff.
  • They've fixed a ton of bugs, many of those based on those error messages we might get with the software. So keep sending those on.
  • 9.3.1 will contain an MXD optimizer. VERY VERY COOL. It reminds me a bit of YSlow. Basically, it will tell you what is slowing your MXD down. This will be incredibly useful for map services. We're really looking forward to this.
  • 9.3.1 & Java (who cares!): you'll be able to extend Desktop, Enging & Server. There will also be ArcGIS Eclipse plug-ins.
  • new at 9.3.1: layer packages. This will be one file that includes data & symbology.
  • ESRI channel on YouTube: www.youtube.com/esritv
  • ESRI EDN Facebook page: www.tinyurl.com/ednfacebook
  • EDN team's bookmarks: delicious.com/edndeveloperresources
  • Twitter: #devsummit
  • You can now download the Silverlight API (beta)
  • You can supposedly download ArcGIS Explorer 900 (unable to find link right now)
  • ArcGIS Explorer 900: can customize in Visual Studio. Looks like Office 2007 (dynamic ribbons) and has Powerpoint like functionality.
  • ArcGIS 9.4 Desktop:
    • Catalog will be in ArcMap - wondering how that will affect custom ArcCatalog toolbars...
    • Managed code application extensibility => no need to develop COM components anymore (lots of cheering on that one)
    • Side by side deployment of ArcGIS => can have more than 1 version installed. Wondering when that will start. 9.4 & higher ok? 9.3 & higher?
    • Can use Python to create & export maps. Cool 50-line demo exporting 3 maps zoomed on specified parcel + adding front & back pages all collated into 1 PDF file.
    • Can add GP tools to ArcMap toolbars
    • Pything window within ArcMap (did I mention they were pushing Python?)
    • Can nest GP tools
    • Improved editing functionality (really)
    • Snapping improved, offers visual cues.
    • can edit in 3D

March 24, 2009

ESRI DevSummit - Monday

I arrived in Palm Springs Sunday evening, apparently late enough to miss the hurricane-force winds that either detoured many planes or caused people to have roller-coaster landings. Which was good, since it was midnight for me by the time I landed and I'd been up since 6:30AM and was pretty beat when I got to the hotel. Of course, it was only 9PM here, but you know how that goes...
I attended the second ESRI DevSummit a couple of years ago and thought it was by far the best conference for ESRI GIS developers. The name says it all, of course, but this conference really delivers. The ESRI developers are right here, you can ask them questions, ask them to include a bug fix in the next SP release, etc. They really want our feedback and I hope they're getting it. I didn't understand this until the end of the conference when I came here two years ago.
So far, I'm very impressed by the software they have recently released and are getting set to release. I plan on never using the WebADF again if I can and have completely fallen in love with the JS API. One of my colleagues has been raving about the Flex API, but the session today wasn't too great (a few demo issues). The Silverlight API looks very intreaguing (is that how you spell it?) and I hope to be able to attend other sessions about it.
I also have to admit that social networking really changes the dynamics. It even got me to finally set up a Twitter account (one more thing to update, right?). This stuff was around two years ago but certainly not used to this extent.
Whenever I go to conferences, especially ESRI ones, I tend to write down my notes on my blog, both for myself (I won't lose the notes now!), but also for others who were not able to come to the conference or were in a different session. I'm going to try to do the same this time as there's lot of good stuff to report.

I complained a couple of years ago that it seemed like the Monday was completely wasted. It looks like others complained about that as well as they had 4 pre-conference seminars yesterday. I didn't think the morning ones were interesting but I did attend the geoprocessing one in the afternoon. It's too bad I thought that about the morning ones as ArcGIS Explorer 900 looks very impressive. I want to test it out to see whether it's faster than the previous versions. I certainly hope so as we might actually use it this time around.

Designing & Developing Geoprocessing Tools with ArcGIS
I've never used Python and rarely even open the Toolbox, but I really wanted to know more about this, which is why I attended this session. I was quite impressed and hope to be able to use this stuff in the future. Here are my notes:

  • Should test out code in 3 modes:
    • immediate mode from ArcToolbox
    • in ModelBuilder, especially chaining it to other tools
    • in command line mode, to test out typing tool name & parameters.
  • They very much recommend designing and prototyping the tools in Python before writing any substantial code. Should prototype in all 3 modes.
  • If needed, can write shell in Python and have it load a DLL written in .NET for example.
  • Advantage of stand-alone scripts: can be run from DOS prompt & can be scheduled.
  • They say the Help is well documented, but I haven't verified that. I'm sure that after the release of the WebADF and its pathetic documentation that they have focused on this kind of stuff.
  • They pointed out a bug: if you change a parameter (input or output), ArcGIS doesn't always "see" it. Trick is to delete it then add it back in.
  • Data Types are a core concept. Every data type has a UI control and a string representation.
  • There are two basic types: datasets and scalar (number, text, ...)
  • Help has link to PDF specifying what each data type's string representation is.
  • In command line, # means to use default value for that parameter.
  • In the script properties (within Geoprocessing toolbox), you should always run "in process". The only time that you shouldn't is if you're using a 3rd party Python library that might not work right. Then try it out of process. But it'll be MUCH slower.
  • Layer as input: will only use selected features.
  • Feature class as input: will use all features.
  • Parameters:
    • type = derived means it's going to be an output. You should always have an output so that you can chain things in ModelBuilder. Derived parameters never show up in the dialog or command line. Derived type also means it's set by the tool, the user cannot change it.
    • Nw parameter name "Obtained from". For example, if you have a field as an input parameter, you can specify the field list is obtained from another parameter (such as a feature class or layer).
  • Validation
    • GPToolbox has basic validation, such as verifying that all required parameters have been set/selected.
    • Can write custom validation. This is done in the Validation tab of the tool's properties. The Edit button on that tab opens the code in the default Python IDE. After editing, hit Apply button in properties in GP Toolbox. This will reload the code.
    • Custom validation code might be used for things such as setting up options basedon previous selections.
    • Describe function (self.GP.Describe) is a way to get properties about an object. Ex: table = self.GP.Describe(self.params[0].Value).
    • Altered property of parameter indicates whether the user has modified that parameter's value.
    • OS.path.sep gives the correct separator for the OS.

November 06, 2008

Setting SQL Server 2008 as Personalization Database

As I mentioned in my previous post, a WebPart assumes SQL Server Express 2005 is installed on the same machine. That was not the case on mine, so I wanted to point the personalization database to a database instance in my SQL Server 2008 installation. This required a few steps, which I detail below.

Set up ASPNETDB database
This information comes from this MSDN article but is summarized below.

  1. Open a command prompt window and run the Aspnet_regsql.exe wizard:
    C:\Windows\Microsoft.NET\Framework\<versionNumber>\aspnet_regsql.exe
    At least in my case, the version number is v2.0.50727.
  2. Follow the steps in the wizard. This is a very easy wizard. All you really need to specify is the name of your database instance and whether you want Windows or SQL Server authentication. Screenshots are below.

Aspnetregsql1

Step 1

Aspnetregsql2 

Step 2

Aspnetregsql3 

Step 3

Aspnetregsql4 

Step 4

Aspnetregsql5

Step 5

Set up Web.Config File
Now that you have a database that can store the personalization settings, you need to tell your application to use it. This is done in the web.config file.

  1. Under the <configuration> section, add a connection string to your aspnetdb database. In my case, here's what I have:
    <connectionstrings>
       <add name="SQL2008" connectionstring="Data Source=CARDWELL6056; Initial Catalog=aspnetdb; Integrated Security=true">
       </add>
    </connectionstrings>
  2. Under the <system.web> section, add a <webParts> section with the following settings:
    <webparts>
       <personalization defaultprovider="SQLPersonalizationProvider">

         <providers>
           <add name="SqlPersonalizationProvider" type="System.Web.UI.WebControls.Webparts.SqlPersonalizationProvider" connectionstringname="SQL2008" applicationname="/">
           </add>
         </providers>
       </personalization>
    </webParts>

Very Brief Intro to WebParts

One of the great things about my current job and my main client is that we get to spend some time doing research on new (or sometimes old) technologies. My first opportunity was a couple of months ago when I did some research on the ArcGIS Server JS API. My current focus is on developing GIS WebParts. I had never even heard of WebParts, so this was all very new to me. WebParts are actually very simple. A WebPart is basically a class that inherits from System.UI.WebControls.WebParts.WebPart and contains all the code needed to run it. You program the WebPart then add it to a page that accepts WebParts. For a page to accept WebParts, you need to have a WebPartManager and WebPart zones. You also either need SQL Server Express installed on the same machine or need to specify a separate database which stores personalization information. This personalization information can be as simple as which WebParts are loaded on a specific user's page and in what order, or as complex as all the various properties chosen for each WebPart.

Think of a My Yahoo! page or an iGoogle page. You know how you can select what you see on the page, as well as each item's location and set some properties? That's the basic concept of WebParts. I found this Microsoft walkthrough to be a good starting point.

November 04, 2008

Voting

Boy am I glad I woke up at 5AM and got to the polling place by 5:30AM! I was maybe the 6th person in line for our voting precinct and it still took 15 or so minutes before I got to vote. The place was packed by the time I left (I'm guessing 100 to 200 people were in line). Our polling location is at a private high school (which is still open today for classes - parking will be a nightmare) and there are two precincts that vote there. Our precinct only had 2 machines... The ballot is 6 pages long! I wonder if it's going to get any better as the day goes by. My husband still has to vote and he is hoping to do so around 1PM or so.

Google Ads

April 2009

Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    

Photo Albums

Statcounter


  • counter stats