February 27, 2010

Google Mail Prevents Embarrassing “Oops here is the file i meant to send”

Filed under: General — Darrin Maidlow @ 3:42 pm

We’ve ALL done it.  Having to send out that follow up “Oh yah, here is the file I meant to attach.  I’m dumb” e-mails.  I just about sent one today – but Google mail saved the day with a new feature!

image

Thank you Google…

August 6, 2009

Configuring Mapguide Enterprise 2009 and 2010 on the same machine

Filed under: Mapguide — Tags: — Darrin Maidlow @ 1:57 pm

So I’m a little behind on the times.  Yes I’ve finally started making the switch from Mapguide Enterprise 2009 to MGE 2010.   However, I need to keep 2009 around a little bit longer.  This resulted in wanting to configure both 2009 and 2010 on the same server.  Configuring Mapguide enterprise 2009 and 2010 on the same machine is possible, and even beneficial in a development environment.  Less VMs or servers can be a good thing in these days of crazy .  Autodesk however, recommends against doing this in a production environment.   You should probably heed this advice if this Mapguide installation is important – even from a workgroup development point of view.   Note, these steps should be relevant for the Mapguide Open Source equivalents – though I have not tried it.

After installing Mapguide 2010 (both server and web tier) on a server running 2009 and updating the license manager appropriately, you’ll notice that the service is not running.  Attempts to start the service will result in an error message logged in the Windows Application Log that looks a little bit like this:

The description for Event ID ( 0 ) in Source ( MapGuide Enterprise 2010 Server ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: Port 2801 is not available, please try using a different port.

So we need to setup one of the Mapguide installations to use a different set of ports.  I’ve chosen to modify the behavior of Mapguide 2010, though these changes could be made for Mapguide 2009 instead.   For this process we’ll need three free ports.  For simplicity its nice to keep these ports sequential.  You will need to ensure that the ports you choose are available on your system.

First we need to edit the serverconfig.ini in the C:\Program Files\Autodesk\MapGuideEnterprise2010\Server\Bin folder.   First lets change the Port in the AdministrativeConnectionProperties section from 2800 to lets say 3800.   Next in the ClientConnectionProperties section change the port to 3801.  Finally change the port in SiteConnectionProperties to 3802.

Next we need to edit the webconfig.ini in the C:\Program Files\Autodesk\MapGuideEnterprise2010\WebServerExtensions folder.  We need to update the port numbers in this config to match the numbers in the server config.  Remember the web config is the client that will usually be consuming the server service.  Finally, as the configuration settings for the web tier may be cached you should restart IIS using iisreset.exe.  This will clear the cached port configurations and Mapguide Studio / Mapguide Administration will now work properly.

Once that is done, the 2009 repository can be migrated to 2010 by following the steps included in the Help/MGE2010UpgradingWindows.htm file on your installation disc/folder.

PHP Problems

Once MGE 2010 has been installed I had a problem with PHP.  Multiple PHPs can be bad news.  I’ve found that running both MGE 2009 and 2010 using the PHP provided with 2010 seems to do the trick.  First you will need to edit the Windows system path.  Update the path variable there to point to the 2010 PHP installation.  If a 2010 path variable exists already – remove the 2009 path.  Next open the IIS manager and ensure that both the MGE 2009 and MGE 2010 virtual directory trees are pointing to the MGE 2010 php extension in the Application Extension Mappings.

Once these changes have been made, do a quick IISreset and you should now be able to login to both the Mapguide admins, as well as have Mapguide Studio connect to the appropriate servers.  Again – this setup could have issues – so consider your environment and needs before configuring a server with both releases of Mapguide.

Remote Web Tiers

If you need to run a shared Mapguide server with web tiers installed on individual development machines don’t forget to set the ports on each development machine.   The Mapguide installer will prompt for the Mapguide server IP address – but the webconfig.ini will need to be updated with the appropriate ports manually.  Not doing do will result in your web tier talking to the 2009 server – and much confusion =)

Finally one note on IP addressees and remote web tiers.  If you plan to use a remote web tier – make sure your Mapguide server is setup using the actual IP address of the server and not 127.0.0.1.  If your Mapguide server is configured with 127.0.0.1, you will get a “Cannot establish connection.” error on the remote web tiers when attempting to create and use a session.  Using real IP addresses (either internal or external) will prevent this error from occurring.

Technorati Tags:

May 22, 2009

Finally an Oracle x64 client that works on Vista – AKA Getting Map 2010 x64 running with Oracle…

Filed under: Uncategorized — Tags: , , — Darrin Maidlow @ 4:01 pm

As my legion of dedicated readers know, I’m an 64 Bit zealot.  I would love to see a Windows task manager free of *32.  It keeps me up at night…well not really but, whatever. =) Autodesk recently released – the first native x64 release.  How could I resist installing that?  I had this funny feeling I would regret this decision.  Somehow, somewhere I just knew I would end up in once again.  So I installed Map 2010, started it up and tried to connect to my Oracle server.  You guessed it.  Connection Failed.

The problem is this.   x64 Applications cannot use the x86 driver.  In my previous attempts to get basic Oracle/ODP connectivity on my x64 Vista machine I ended up running the 11g x86 Oracle client.  Today I was back to the Oracle download site – and lookie lookie.  They’ve released an !  2008 is basically Vista so, maybe, just maybe – I thought Oracle will give us some x64 love.  Here are some steps that will help you get running:

First thing is first.  Backup your TNSnames.ora.  Its found in the network\admin folder. 

Next I un-installed the x86 11.1.0.6 client.   Delete the leftovers with windows explorer.

Next download both the 11.1.0.7 client for both x86 and x64 (yes, we need to run with both…)

First I installed the x64 client.  I like to do full runtime installations. 

Next, I copy my backed up tnsnames.ora into the network\admin folder.

Now fire up Map 2010 x64 – connect to Oracle server – Success!  Happy Happy Days.  Unfortunately, fire up (which is still 32 bit) and it fails with an error of “Cannot find OCI.DLL”.  Doh.

So, I go ahead and install the Oracle 11.1.0.7  x86 client.  I install it to the client_2 folder.  Then copy my tnsnames backup into the network\admin folder in the client_2 folder.  Restart Toad, and success!

Now I want to check one last thing.  Last time I was dealing with this fun issue – I had to set my development projects to only run in x86 mode.  So, I fire up my development project and try it out.  Running IIS in x86 mode works.   Running IIS in x64 mode failed..

The ‘MSDAORA’ provider is not registered on the local machine

It seems the Microsoft MSDAORA provider doesn’t exist in x64 – so change your connection to use the Oracle OraOLEDB.Oracle instead and x64 projects run no problem.  It would be perfect to one day get one install that does both x86 and x64 – but for now, I’m content with this setup.

Technorati Tags: ,,

April 8, 2009

ReSharper 4.5 Released!

Filed under: Development — Tags: — Darrin Maidlow @ 7:09 pm

JetBrains has just released !   Some of the key features of this upgrade are:

  1. 1. performance and memory usage improvements
  2. 2. Solution-wide code inspections (tons of cool tools to find unused params, privates, etc)
  3. 3. VB9 support (too bad I’ve been busy moving to C# =])
  4. 4. Native MSTest Support (I much prefer though)

 

Check it out.  ReSharper is one of the tools I use every day and couldn’t live without…One more day and I’ll be done in Visual Lisp and can actually try out the new release a little more =)

Technorati Tags:

April 6, 2009

Using Relative URLs in CSS with ASP.NET

Filed under: Development — Tags: , — Darrin Maidlow @ 6:42 pm

When we started redoing the I decided that this new site would be all CSS based.  No more nasty tables.   Once the initial xhtml/css template was made I moved it into and ASP.NET master page.  As the site was fleshed out I ran into a problem where some of the images were not loading as the master page was used deeper within the sites structure.   A little inspection of the underlying CSS and I noticed this:

   1: #header {width:100%; height:50px;    background: #7D7D7D url(images/header.gif) left top no-repeat;}

 

When the master page is used from a page deeper than the site root, the paths in the CSS become invalid.  To work around this I made my CSS dynamic!  I added a new page to my project in the CSS folder.  I called this page allcss.aspx.css.   Open up this new aspx file and remove all the html.  Leave only the page header definition:

   1: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="all.css.aspx.cs" Inherits="landorIS.com.css.allcss" ContentType="text/css" %>

image

Note that you may need to update your classnames and stuff depending on how you name the file.  I wanted my file name to reflect the fact that it was a CSS file – but it’s still needed to end with .aspx to ensure the file would be properly parsed by the ASP.NET engine without having to mess with the extension mapping on the web server.  This resulted in Visual Studio making some illegal class names.

Also be sure that you add the ContentType attribute to the @Page definition, and set it to “text/css”, or you will get an error in some browsers stating that the Mime Type “text/html” is not “text/css”.  Nice of Firefox to do a little validation on the content.

At this point you can add your CSS to the file and use <%%> tags or codebehind to manipulate the values.  Now the CSS that was causing problems with the images looks like this:

   1: background:url('<%=ResolveUrl("~/img/header-bg.png")%>') no-repeat 0 0;

 

Now when the CSS is requested by the browser and rendered out, the URL to the image file will be properly displayed as /RootFoolder/img/header-bg.png.  This is a very simple modification, but one could go a little more crazy and do something like  detect browser make/model and send out browser specific css in pre-defined literals, or possibly add authentication checks. 

 

 

Technorati Tags: ,

March 10, 2009

Using Automated Build Studio to automate offsite backups

Filed under: General — Tags: — Darrin Maidlow @ 10:33 pm

The importance of an offsite backup of your data is well known.  There are companies out there that do simply that – offsite data storage.  Take for example Iron Mountain’s service.  Depending on the amount of data you have to protect, LiveVault can be  great service.

I’ve been using (ABS) for some time now to ensure consistent, and fast builds of our products.  I’m incredibly pleased with it.   One of the key benefits to ABS is its versatility.  Yes, the primary goals of this product is to automate the software build process – and a lot of specific tools are provided in the product to accomplish this (e.g. working with source control, easy tools to automate compiling etc).  Build systems are really just a collection of tasks, usually very small tasks – but often there are dozens, hundreds or even thousands of these tasks.  Task as small as running a dos command line statement, copying files, making a zip file.  When I noticed that ABS gives you the ability to automate FTP operations, it got me thinking – this “build” tool could be used to automate so many of those little tasks I’ve always meant to ‘just write a small batch file’ for – but never got around to doing…

One of our most critical pieces of data is our database for our source code version control.   No source code, no software company – don’t think I need to say much more.   Vault uses SQL server to store its bits.  Well would you look at that.  ABS has a “backup database” component.  The workflow of what I want to accomplish is quite simple:

  1. 1. Backup and verify SQL server databases
  2. 2. Zip up said backup files
  3. 3. Upload the zip file to an FTP server that cannot burn down or blow up at the same time as our database server.

 

Pretty simple – and ABS will do everything we need – and then some.  So let’s get started.  First, I have to assume you have an SQL server running with databases in it.  I also assume you have an FTP server setup and running.  If you really wanna get fancy – get an FTP server that supports SSL running.  I recommend .

ABS Installed on same machine as SQL ServerAutomated Build Studio SQL Server Backup Operation

If ABS is installed on the same machine as SQL server we can make use of the built in macro operations to backup SQL server.  Start up ABS and create a new macro.  We’re going to start off simple – and maybe we’ll add some cool later.  First we’ll add a database backup operation.  From the left hand Operations “toolbox” click on SQL to expand the operations available there.  Double click on “Back Up Database”.  This will add a database backup action to our macro.  On the right hand side of the screen in the “macro” section, double click on the new macro operation and fill in the needed information to connect to your SQL server.  Be sure to specify the database, destination path and that the type of output is File.  If you have more than one database you want to backup – add another backup operation and repeat the process.  To backup Vault – we need to backup the sgvault and the sgmaster databases.

If you run your macro at this point you will be prompted with a message that “The executable file of the “SQLMaint” tool is not specified.   The SQLMaint executable is installed with your SQL server instance and can be found in the Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn folder.  Setup your tools to point to this file.  Note, MSSQL.1 will change depending on the you are running.

But, SQL Server is installed on another machine and that’s the way I like it!

Yup, me too.  The built in SQL Server backup operations depend on the SQLMaint executable to run backup process.  Again, this file is installed with SQL server and I could not get this file to run on machine that did not have SQL Server installed.

Instead what I did was created a batch file/SQL script combo on the machine running SQL server and scheduled a task to execute this batch file. The SQL script looks like this:

   1: BACKUP DATABASE [sgmaster] TO  DISK = N'C:\MSSQLData\backups\sgmaster.bak' WITH FORMAT, INIT,  NAME = N'Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
   2: GO
   3: BACKUP DATABASE [sgvault] TO  DISK = N'C:\MSSQLData\backups\sgvault.bak' WITH FORMAT, INIT,  NAME = N'Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
   4: GO

 

A batch file that executes this script is scheduled to run at a fixed interval and simply consists of this:

   1: "C:\Program Files\Microsoft SQL Server\90\Tools\Binn\SQLCMD.EXE" -S localhost -i "C:\AdminScripts\SQL Server\backup.sql"

 

This batch file on execution creates two files in c:\MSSQLData\backups.  These files will be processed by the next step in the macro.  Note that because no username or password information is being specified here, the user set to run this task must have the appropriate rights in SQL server.  This batch file is executed by adding a windows scheduler task.

Whichever path you chose for creating your backup file.  Go ahead and run the macro item for an SQL backup, or from the SQL server execute your batch file to get a backup made of the database(s).Automated Build Studio Create Zip operation

Building the zip file

The next operation we need can be found in the “Archivers” section on the left.  I’m using Zip for this example.   Add a “Pack Files With zip” operation to the macro and setup the properties.  Define the archive name locally.  Next we’ll need to set the path to the files to zip.  We’ll use UNC paths to access a share on our SQL server.  Depending on the rights of the user executing the macro, the administrative shares on the SQL server can be used or a new share can be created with the appropriate permissions assigned.

I set the zip to use the “Best” compression for the “Pack Level” and told it to “Move to archive” which results in the files being zipped getting deleted.  I also set a password on the zip – but make sure you write that down somewhere =).

Select the new archive item and click the “Run the selected operation” button.  This should create a new zip file for you in the appropriate location.

Uploading the zip

In the toolbox expand FTP and we’re going to add a “Connect to FTP” operation.  Double click this operation in the macro section and setup the properties.  Add your hostname, user name, password.  Set the port if necessary.  If your FTP server is using SSL setup the SSL information.  You can now click the “Run the selected operation” button to test the FTP connection.  If needed add some “Create FTP Directory” and “Set Current FTP Directory” items as needed.  Finally we’ll upload the newly created zip.

Add a new “Upload File(s) to FTP” operation to your macro.   Browse to and select the newly create zip file.

Click the big Green Go button – and your backup should be created (for a local SQL server), a zip files made, and that zip file should be uploaded to your SSL enabled FTP server.

Scheduling the macro runAutomated Build Studio Scheduled Execution

ABS comes with a nice little interface to add scheduled executions.  From the “Tasks” menu choose “Windows Scheduler”.  This will bring up the task scheduler window.  Click Add to add a new task.  Up will come a helpful wizard that will help you setup the task.  Set the various options like name, macro file, execution time and frequency and you’re done.   If your SQL server is on another machine, and you have scheduled that backup to run, you will need to ensure that this task is scheduled to execute after the backup is complete – otherwise your backup could be incomplete.

Summary

Building this macro let us cancel our LiveVault account, saving the company a decent amount of cash per month.  While making use of a tool we needed for our for and , and our dedicated server, we were able to ensure we critical offsite backups being automatically taken care of.

This basic macro should help you get started with ABS to implement your own offsite backup solution – possibly making use of resources you already have in place.  Obviously this macro can be enhance significantly – other resources can be zipped up and backed up.  The ABS scripting and variables can be implemented to append a unique number or a date to the file name which would allow for a range of backups to be stored. 

Enjoy!

Technorati Tags:

March 2, 2009

One Click Builds Are A Beautiful Thing – Automated Build Studio

Filed under: Development — Tags: , — Darrin Maidlow @ 7:00 am

I’ve known for a long time that an automated build system is valuable, hey it’s number two on .  Recently the complexity of some of our products made an automated build system a requirement.  It was getting to the point where creating a build of was a four plus hour ordeal.  It had dozens of little steps, and missing even one would result in a defect.   This defect would be a vicious cycle.  We would have to debug to find the problem and fix it.  This would cause ANOTHER four hour rebuilt, and the “cycle of bug” would continue.

This complexity resulted in infrequent builds and as a result the code was not tested as well as it should have been.  Not to mention, I’d get really frustrated and even pissed off on build days.   It took me a while to find a system that really made me happy.  On a whim one night I downloaded (ABS) and gave it a shot.  After installing ABS on a new virtual machine that would become our dedicated build system I fired it up.  I was pretty impressed with the wide range of actions and  tools it supported.  In our environment we had several must have items:

  • 1. SourceGear Vault
  • 2. Visual Studio 2008
  • 3. Oracle/SQL Server
  • 4. Installshield 2009

 

ABS worked with all of them.  In addition to the key requirements I had – it supported a plethora of other operations.

First thing I did was sketch out a rough outline of what was involved in creating a build.  Get latest source code, compile, delete temporary files, etc etc etc.  I started selecting various options from the ABS and fleshing out my macro.  Within a couple of hours, I had a sweet macro in place.  My macro started to look like this:

  • Getting the latest code from Vault
  • Compile all assemblies
  • Delete the temporary files
  • Build the needed release folder structure
  • Move the new files into the needed structure
  • Execute on all assemblies
  • Increment the build version, and set the version on all assemblies
  • Create a label of the build in Vault
  • Build a zip of the release
  • Build the Installshield installer
  • Connect to the build FTP and upload the new build

 

The best part – all of this was occurring in a 100% reliable fashion, oh and it took minutes for a full build to occur.  Over time, this project was tweaked, and copied.  It evolved as I learned more about ABS – or thought up new requirements.  Take for example, it has evolved into three editions, sharing a similar yet different set of source files.  ABS lets me rebuild all three editions with the click of a button – in minutes.   Long long ago, in the before times something like this would have taken days, and years off my life.

I’ve only scratched the surface of what I’ve been able to do with ABS – some other cool features worth mentioning is that builds can be scheduled to run, there is a web application for viewing build history as well as kicking off builds.  It has a scripting language, and the support I’ve received is fantastic.  The price of the product makes the decision to buy ABS a non issue.

Man, now I’m starting to sound like a sales guy. =)  Seriously though, check out if you develop boxed, or even custom software.

February 20, 2009

Country / State / Province Lookup Tables for SQL server

Filed under: SQL Server — Tags: , , , — Darrin Maidlow @ 5:50 pm

Every time I build a contact form/database I hit this problem.  I need a set of tables for Country, State/Province lookup.  “But, that’s like 60 records and I don’t wanna type out every state and province!”.

Every time, I hit the Google looking for SQL scripts – and I can’t seem to find anything, or I find that one script for mySQL.  The last time I did this, I created a set of SQL scripts and I saved them.  I forgot that I saved them – and made another SQL script.  Doh. 

This time when I was working on the new contact form for this site, I decided to write this blog post in hopes that the next time I need to do this – when I search Google my blog might come up and remind me not to re-invent the wheel.  So I’ve included a zip with the SQL script here.  This script is for SQL server 2005 – but will translate over to Oracle very easily.

If you find any problems with the script, or feel like adding more countries, feel free to pass those changes along to me!

February 18, 2009

Geospecialling v2.0 and an introduction to FullCircle

Filed under: General — Tags: , , — Darrin Maidlow @ 1:11 pm

Hello!  Welcome back to Geospecialling, and welcome to the new site!  This new site has been my existence for the past several weeks– but more on that later. 

It’s been a crazy couple of months (since ), and we are getting closer to the end of the craziness.  Let me sum things up, and hopefully gain your forgiveness for the lack of posts for two months. =)  At AU we unveiled , and the reception has been phenomenal.  FullCircle is our newest product built .   So after returning from AU, and getting all that feedback from partners and customers we set to work finishin, testing, and polishing the first release of FullCircle – Standard Edition.

FullCircle has two main functions.  First, it allows users to login and query data from their Oracle, SQL Server, and Access databases.  The tabular information is then sent down as an Excel spreadsheet where users may edit or append data.  This spreadsheet can then uploaded to FullCircle and processed.  The updates/inserts are applied to the appropriate database table.

The second key function of FullCircle is for users.   FullCircle allows Excel forms to be defined and saved.  Users can then download the form templates from the repository, print the forms with Capturx, and fill them out.  When the digital pen is docked, and the hand writing is processed back into Excel – these Excel files can then be processed with FullCircle.  The inserts (or updates if needed) are processed and put into the appropriate database table(s).  No temporary tables are used that require processing after the fact (unless of course, this is what you want to do), no custom coding.

On top of that we’ve been hard at work building this new site, setting up the new blogs, doing all that good stuff.  I can finally see the light at the end of the tunnel…

More soon!

December 4, 2008

Introduction to Topobase API

Filed under: Autodesk University, General — Tags: , — Darrin Maidlow @ 9:34 pm

This morning I sat in on the Introduction to Topobase API class at Autodesk University presented by Dongjin Xing.  I’ve made an effort to attend Dongjin’s classes every year for the past several years.  He is a good presenter, and has a damn good handle on things.  If you are a developer type, I recommend you consider his courses.  This one was no exception.

I’ve heard people talking about Topobase for quite some time.  I’ve heard good, and I’ve heard bad.  Today I got my first look at the product.  Topobase is a server product that works with Oracle spatial to facilitate the creation, editing and sharing of spatial data in Oracle.  A client is provided with a full API and users can access data using AutoCAD Map or a web client based on Mapguide Enterprise.

The design of Topobase looks to be well tiered.  Using ADO.NET and OraDirect.net it also supports connection pooling.  They provide a neat VB.NET scripting interface that helps build simple workflows, and data validation rules.

All in all, everything they are putting forward looks quite cool.  Visual studio templates to build Topobase plugins that can be loaded right into the Topobase UI.  It could become a very cool starting point for developers/consultants to start building tools to work on data. But there are a few problems…

Topobase is by no means a new product.  It’s several revisions in since Autodesk aquired it – but it still seems to have some performance problem.  During the presentation this morning, Topobase took over a minute to load.  Once loaded, it took over a minute to load and render a small dataset.  Now, Oracle/Topobase and AutoCAD Map were running within a virtual machine, running on a notebook.  Even still – that’s slow.

Now, I’m no Autodesk insider.  I’m also not a business expert (but I have been learning a thing or two about it over the years).  History does tend to repeat itself.  I look back at GIS Design Server and Vision.  Like Topobase, both of these products were acquired by Autodesk.  Like Topobase, these products were ‘Enterprise Data Store’ type things.  Both these products are now "not actively promoted", and customers are encouraged to migrate to Topobase.  With the Autodesk stock price down – they are going to trim fat.  The Autodesk reseller channel for the most part does not have the skills to use, support, or sell this tool – and it really is a developer/consultant tool.   My fear about Topobase is that if I were to invest the time in learning and developing for Topobase, Autodesk will "retire" the product.  Then that invested time is wasted, but more importantly the relationship with my customers is damaged by leaving them stranded up s**t creek with yet another dead ‘Enterprise Data Store’ thing.

It’s a catch 22.  So its not unreasonable to think that Autodesk needs developers like us to adopt, promote, and sell Topobase to help keep it alive.  I’m interested in hearing your opinions on this subject…

Older Posts »

Powered by WordPress