January 31, 2011

Installing AutoCAD Map 3D 2011 x86 on Vista x64

Filed under: AutoCAD,Oracle — Tags: , , — Darrin Maidlow @ 11:02 pm

Long ago I gave up trying to get both the .  I have for now adopted the approach that if it talks to Oracle – it needs to be 32 bit.  Even my development projects are set to x86 only to ensure only the 32 bit Oracle client is loaded on my development machine. 

I needed to install   to debug some code I’ve been working on so I downloaded the 32 bit installer and fired it up only to be informed that my platform was unsupported and I would need to install the 64 bit version.  grrrr.

Google had very little to say on the topic.  More junk about hacking MSI files with Orca.  I took a look at setup.ini and there were far too many references to x64 – I don’t have time for this…Finally I came across the .  The product claims to modify your setups to allow the 32 bit installers to work on x64 operating systems, 40$.  I couldn’t find any reviews or testimonials so I figured I’d give it a shot…

So here is your first testimonial Longbow Software =)

This actually worked great.  Bought the convert, installed it to a virtual machine.   The interface is dead simple – paste or browse to the location of the AutoCAD installation files and press Convert.  Keep in mind if you’re running from a DVD you’ll need to copy the contents of the DVD to your PC or a network share so the files can be edited.  I pointed the converter to an install on a network share.  It chugged away for about a minute (keeping in mind this was on an underpowered VM).  Within a matter of minutes I had AutoCAD Map 3D 2011 installing on my Vista x64 box with no problems.  Ran AutoCAD and it seems to fire up no problem. 

Bear in mind – for AutoCAD to work with anything Oracle – you need to have the 32 bit Oracle client running on your machine.

40$ well spent IMO.

December 14, 2010

Netflix in Canada…

Filed under: General — Tags: — Darrin Maidlow @ 11:33 am

NetFlixCanada

This about sums up my experience with Netflix Canada…Too bad too, if we had the same selection as what is available in the US I would have been all over it…

November 6, 2010

ERROR: Unable to update the dependencies of the project

Filed under: Development — Tags: , , — Darrin Maidlow @ 11:22 pm

Working on the automated build process for FullCircle SmartForms tonight and I came across an irritating problem tonight:

"ERROR: Unable to update the dependencies of the project. The dependencies for the object ‘NHibernate.Validator.DLL’ cannot be determined."

One of my three Visual Studio 2010 installer projects started failing during the automated build process with this error on a dozen included assemblies.  When the project was built using the Visual Studio IDE the installer would build just fine.  With a little bit of digging and a great deal of screwing around, I found a and for this problem.

After installing the patch – my automated build system is happily compiling the installation project.

October 29, 2010

Elite Autodesk Certifications!

Filed under: General — Tags: , — Darrin Maidlow @ 7:24 pm

Did you know, one of my very first jobs at back the late 90s was doing phone support and training on the Autodesk products that Kanotech sold?  I was digging around under orders from my wife to clean out my office and I came across a box of stuff from my desk back at Kanotech (circa 2003!).  Check out a couple of the awesome certifications I had back in the day!  Signed by Carol Bartz too!!  Too bad these seem to be the only two that survived…

Architectural Desktop R2 Certification AutoCAD Map 2000 Certification

I worked on QA projects for Autodesk on AutoCAD Map 2, 2000 and 2000i yet they still made me take the silly tests to get  “certified” =).  Do you have some old tyme Autodesk certs?  Feel free to share a link in the comments.  Were you in one of the AutoCAD Map or Mapguide courses I taught way back in the day?  If so leave a comment to say hi =)

September 15, 2010

Mapguide Enterprise 2011 – Fusion and Selection XML

Filed under: Mapguide,RADE — Tags: , , — Darrin Maidlow @ 3:00 pm

I’ve been working to migrate the  Mapguide 2010 code to work with 2011.  In 2010, I only implemented support for the DWF and Ajax viewer.  With the release of 2011, the new  ability to include mapping data from Google, Yahoo and Microsoft in Fusion are huge so I opted to migrate everything over.  The DWF viewer is already deprecated and I suspect the Ajax viewer will likely go next.

With 2010 and the Ajax viewer we had to get the selection from the MapFrame using the GetSelectionXML() method.  Then we had to encode, and send this value up to the web tier for processing.  I had all kinds of business logic that I was hoping to re-use with a minimal amount of modifications so I was trying to find how to recreate this functionality with Fusion.  I figured out how the selections worked on the client side using the new callback system and was getting the selection object – but I could not find anything definitively saying “There is no selection XML on the client side anymore”.    So…

There is no selection XML on the client side any more when using Fusion.

There I said it.  It makes sense too – first getting this large XML string and sending it up was a pain in the ass.  Encoding it, creating a form to submit it, etc.   I should have clued into this sooner – Fusion is updating the selection on the server side as needed. 

So in order to minimally impact the existing code – I added an additional check to some of the calls that looks a little something like this:

   1: if (String.IsNullOrEmpty(selectionXml))
   2: {
   3:     MgResourceService resSvc = (MgResourceService)siteConn.CreateService(MgServiceType.ResourceService);
   4:     sel.Open(resSvc, map.GetName());
   5:     selectionXml = sel.ToXml();
   6: }

Those four lines of code are a lot easier than all the screwing around needed in 2010 to get the selection XML.   With that small modification my existing code is working perfectly!

hope this helps someone =)

July 24, 2010

Creating .NET objects for Mapguide Enterprise 2011

Filed under: Development,Mapguide,RADE — Tags: , — Darrin Maidlow @ 11:15 pm

Better late than never…  I’ve updated my Mapguide Enterprise .NET objects to work with 2011.  The steps in my   have been modernized and simplified significantly.   This post will show you how to create (or re-create) these objects for the 2011 release of Mapguide.  Sorry for skipping 2010 =)

First, download the actual non-aplha release of and extract it.  You will need to have .NET 3.5 installed to run LINQ to XSD.  The project itself is a Visual Studio 2010, .NET 4.0 project.  You should be able to change it to .NET 3.5 with no problems.  I’m not sure about using .NET 2.0.   I still assume these steps should work with Mapguide Open Source 2.2 given its pretty much the same thing as MGE 2011.  Please let me know if you try it and that is not the case.

Building the classes

Last time around we had to mess around with Visual Studio projects, building temporary code, finding and extracting that code from temporary files.  This time around, we’re given a nice little executable that can be run in a batch file.   I’ve posted a copy of my batch file below but it was simply made using a dir /b > CreateMapguideNetObjects.cmd in the Mapguide server schema folder (which by default is to c:\Program Files\Autodesk\MapGuideEnterprise2011\Server\Schema) .  I then edited that file with a text editor that support macros and removed the following schema files:

  • FdoProviderCapabilities-1.0.0.xsd
  • LoadProcedure-1.0.0.xsd
  • LoadProcedure-1.1.0.xsd
  • LayerDefinition-1.0.0.xsd
  • LayerDefinition-1.1.0.xsd
  • LayerDefinition-1.2.0.xsd
  • SiteInformation-1.0.0.xsd
  • SiteVersion-1.0.0.xsd
  • SymbolDefinition-1.0.0.xsd
  • WebLayout-1.0.0.xsd

These files are deprecated object definitions from previous Mapguide releases.  In the end each line in the batch file looks a little like this:

LinqToXsd ApplicationDefinition-1.0.0.xsd /filename:ApplicationDefinition.cs

Executing the batch file will create a number of C# files containing appropriately named classes.

Setting up your project

At this point you should be able to fire up Visual Studio and create a new C# project.   If you have an existing project from a previous version of Mapguide its good to start fresh.  Also, don’t try this in an existing solution that is dependant on the project that contains the Mapguide objects.  This will just result in a bunch of extra screwing around to avoid compiler errors from missing code during the process.    This time around its a lot easier.  Create a new DLL project.  Add a reference to the Xml.Schema.Linq.dll file that was included with LinqToXsd.exe.   Add a reference to the following Mapguide dlls:

  • OSGeo.Mapguide.Foundation
  • OSGeo.Mapguide.Geometry
  • OSGeo.Mapguide.MapguideCommon
  • OSGeo.Mapguide.PlatformBase
  • OSGeo.Mapguide.Web

You’ll also need to ensure that the appropriate unmanaged assemblies are available in the calling applications bin folder when you go to run this stuff. 

Next place all of the generated C# files in the new project.  Once you build you’re going to see a ton of errors.  We’ll clean those up.

To resolve a lot of these errors I did a global search and replace on “global::” and replaced it with nothing.  Also, I wrapped each class in a unique wrapper classes to prevent duplicate type errors.  Finally, the case issue with DataType was still an issue – and I resolved it by changing the case on DataType to be Datatype:

   1: public string DataType {
   2: public string Datatype {

For a complete view of the changes I made do a file compare between the code in the attached zip file and your newly generated code.

<insert 3 week gap here, wherein I had so that I could actually test this newly created code, oh and I also went on vacation for a few days too =)/>

And back.  The best part about this is that it seems ALL my old code just worked with upgraded basic layouts after changing it to look for the object definitions within the new wrapper classes.   Now I just need to add support for flexible layouts and we’ll be laughing.

The Code

Please note – I didn’t rebase the code.  It’s all in the RADE.MGE namespace.  If you would like to use it, feel free to re-base it – or just leave it as is.  Also, if you create any unit tests or enhancements and would like to share them – please feel free!  

As I update the project myself, or receive updates I will update this file.

Finally, the will still work with this new project.  Perhaps one day, I’ll post some fancy new code in C# =)

Hope this comes in handy, I welcome your comments.

July 20, 2010

Mapguide 2011 Javascript error ‘OpenLayers.Lang’ is null or not an object

Filed under: Mapguide — Tags: , — Darrin Maidlow @ 10:33 pm

We’ve finally moved Mapguide Enterprise support back up the list of priorities for =)  The ability to add Google, Yahoo, and Bing data into the map with OpenLayers is very compelling.  So I’ve spent a little time (actually kind of a lot of time)  in the past little bit trying to get my Mapguide development environment setup.   To avoid cross site scripting (xss) errors when developing on my workstation I needed to install the web tier locally.   After muchos problems with license servers and the likes I came across an annoying javascript error whenever I would load a using  the local web tier:

   1: Line: 2
   2: Char: 2498
   3: Error: 'OpenLayers.Lang' is null or not an object
   4: Code: 0

Loading the web tier on the Mapguide server worked fine.  Very odd.  I ended up doing a file comparison between the two web tiers and noticed the only significant difference was this in the web.config:

   1: <staticContent>
   2:     <mimeMap fileExtension=".json" mimeType="application/json" />
   3: </staticContent>

Adding this tag to IIS 7 on Vista resulted in an error, the tag must be something new in IIS 7.5.  However, after manually adding the mime type mapping to the server – my flexible layout now loads perfectly on the local Vista web tier.SNAGHTML15f08bbe

This mime type mapping can be added on either the virtual directory, or the server level.  I chos to add it to the server.  Either way, to add it select the appropriate level in IIS manager.  In the right hand window double click “Mime Types”.  Click Add and you can enter the .json extension and the mime type.  Once this is added, Vista/IIS7 was now properly serving out flexible layers

 

July 9, 2010

A breakthrough in the war on phone spam

Filed under: General — Tags: — Darrin Maidlow @ 2:22 pm

One of the things that absolutely drives me insane is phone spam.  Nothing like being deep in concentration inside some algorithm and have the damn phone ring with a phone spammer on the line.  A lot of days, I’ll just turn off all the phones in an effort to get shit done… I’m on both the US and Canadian “Do Not Call” lists.  I report every single unsolicited call, yet they keep on coming…

Came across this blog post today detailing an .  They’re turning the tides on phone spammers.   There are some hilarious mp3’s on the site where you can hear the “conversation” between the honey pot and one of the “moron” phone spammers.  They’re keeping some of these calls on the line for 4+ minutes.  Totally awesome.

I hope someone can take initiative and setup something similar in North America.  If I had the resources I would take this on in a heartbeat…

Hats off to you guys.. =)

June 7, 2010

Effortlessly map domain and DTO entities

Filed under: Development — Tags: , — Darrin Maidlow @ 10:19 pm

I recently created a set of objects to complement the domain entities we use for our data access layer for a new project we’re working on.  I immediately set out to write a mapping utility.  After a bit of thought pondering the complexity of the problem I decided to look around on the magical internets to see what options were available.

Came across .   This is a perfect match for my needs:

AutoMapper uses a fluent configuration API to define an object-object mapping strategy.   AutoMapper uses a convention-based matching algorithm to match up source to destination values. Currently, AutoMapper is geared towards model projection scenarios to flatten complex object models to DTOs and other simple objects, whose design is better suited for serialization, communication, messaging, or simply an anti-corruption layer between the domain and application layer.

It was quick to setup, and painless to use.  First define your object to object mappings:

   1: Mapper.CreateMap<RADE.BO.Domain.Application, RADE.BO.Entity.Application>();

 
Next, whip up a small conversion function:
   1: /// <summary>
   2: /// Convert a DTOApplication to abnd 
   3: /// </summary>
   4: /// <param name="app"></param>
   5: /// <returns></returns>
   6: public static RADE.BO.Domain.Application Convert(Application app)
   7: {
   8:   if (app == null) return null;
   9:   LoadDtoMappings();
  10:   return AutoMapper.Mapper.Map<Application, RADE.BO.Domain.Application>(app);
  11: }
  12:  
  13: /// <summary>
  14: /// Convert a list of domain Application objects to DTO Application objects
  15: /// </summary>
  16: /// <param name="apps">List of domain Application objects</param>
  17: /// <returns>List of DTO Application objects</returns>
  18: public static List<Application> Convert(List<RADE.BO.Domain.Application> apps)
  19: {
  20:     LoadDtoMappings();
  21:     return apps.Select(AutoMapper.Mapper.Map<RADE.BO.Domain.Application, Application>).ToList();
  22: }

It’s important to note that if your source object contains nested objects – a mapping for each nested object must also be defined.  This goes on recursively through nested objects.  My domain Application object contains some numerous sub objects – Map, Layer etc.  In this case rather than establish mappings for these child objects – I removed these objects from my DTO as the client consuming these objects would never need that data.  This also keeps the size of any data possibly being serialized down.   Automapper dealt with this automatically.

I’ve only scratched the surface of what Automapper can do.  Next step is to define unit test coverage using the , but it’s sleep time now… =)

April 28, 2010

Please be specific when talking to your developers

Filed under: General — Tags: — Darrin Maidlow @ 4:46 pm

In the tabular reports we have the ability to format the output of a column using a standard String.Format syntax.   This is used often in the reports to convert string data containing URLs to clickable links when the page is rendered:

   1: "<a href=”{0}” target=”_blank”>{0}</a>"

This format string of course when applied to the source data would result in a hyperlink being created with the URL in both the href property of the link as well as the  visible link text.  called and asked if it would be possible to change the report so that it showed simply the word “View” instead of the url.  We already had a remote control session running so I opened up his RADE and changed the format string to:

   1: "<a href=”{0}” target=”_blank”>View</a>"

He saw this small change and I heard him slap his forehead, and he asked “Why didn’t you tell me this sooner, I’ve wanted to do this forever!”.  To this I responded “You never asked…”

So the moral of this story is directed to managers, sales types, or any other person who works with software developers.   We’re incredibly smart, and there is far too much good stuff inside our heads for us to just “tell you everything”.  If we were to try, you would either fall asleep or your head would pop.   So please, rather than expect us to tell you what you want to know – just ask. =)

« Newer PostsOlder Posts »

Powered by WordPress

Switch to our mobile site