Author Archives: Robert

Space Anarchy

How long will you survive?

Space Anarchy is a fast paced endless shooter style game.

Hold your finger on the spaceship to maneuver and fire at the asteroids and enemy ships. Be careful of the enemies firing back at you!

Features:

  • Options for music on/off and for sounds effects on/off
  • High Score
  • Restart

If you have trouble with Space Anarchy, feel free to drop me a note! Use the contact form below. 🙂

SSIS Development Tips

Here are a few tricks I learned while developing SQL Server Integration Services packages.

Set a relative path to your dtsConfig file.

This makes it much easier to execute your package with different configuration files. By default SSIS will try to import the configuration file from the path originally used to create it – which is often the Development server.

To set a relative path to your config file:

  1. First create the config file, in the same folder as your package.
  2. Close the package in the SSIS designer.
  3. Right-click the package and select View Code, to view the XML source.
  4. Find the configuration file entry. You can search for the filename, or you can search for the string “DTS:config”.
  5. Look for the element named <DTS:Property DTS:Name=“ObjectName”>. The value will be the path and filename to the configuration file.
  6. Edit this string to be just the filename alone, and save the package XML.

From now on: open the solution by double-clicking the .SLN file from Windows Explorer. The config file is relative not to the package file, but to the Visual Studio IDE current directory. If you double-click the SLN file, Windows sets the current directory to the folder where the SLN file is. This means to keep it simple, keep your SLN file, Package file, and dtsConfig file in the same folder. If you want to split them into separate folders, remember to make your path in the package XML relative to the SLN file, not the Package file – note I have not tested this. 🙂

 

SmartPlant Foundation – Database Queries – 3/3

This is part 3 of a 3-part series on how to query the SPF database.

In part 1, I gave an overview of the SPF database model, and showed how to write a simple query to return all objects of a specific type, starting from a given interface. This showed the DATAOBJ (object) and DATAOBJIF (interface) tables.

In part 2 I showed how to get two properties for those objects, using the DATAOBJPR (property) table.

In this post, part 3, I will show how to get a related object via the DATAREL (relationship) table.

Continue reading

SmartPlant Foundation – Database Queries – 2/3

This is part 2 of a 3-part series on how to query the SPF database.

In part 1, I gave an overview of the SPF database model, and showed how to write a simple query to return all objects of a specific type, starting from a given interface. This showed the DATAOBJ (object) and DATAOBJIF (interface) tables.

In this post, I show how to get two properties for those objects, using the DATAOBJPR (property) table.

In part 3, I show how to get a related object via the DATAREL (relationship) table.

Continue reading

SmartPlant Foundation – Database Queries – 1/3

This is part 1 of a 3-part series on how to query the SPF database.

In this post, I give an overview of the SPF database model, and show how to write a simple query to return all objects of a specific type, starting from a given interface. This shows the DATAOBJ (object) and DATAOBJIF (interface) tables.

In part 2, I show how to get two properties for those objects, using the DATAOBJPR (property) table.

In part 3, I show how to get a related object via the DATAREL (relationship) table.

Continue reading

SPF Load Files – UpdateInstruction Reference

Here is a quick reference for the SPF UpdateInstruction loader command. The documentation is scattered across various places in the SPF printable guides, this gathers it all into one place.

<!-- 
IPropValues properties: 
    AddedInterfaces = Tilde-delimited list of interfaces to add to the object.
    PropValues = List of values to assign. Each value to assign is a triplet of
        Interface, Property Name, and Property Value; delimited with the \% pair.
        Multiple triplets are also delimited with the \% character pair, so ensure
        there are 3, 6, 9, etc. values if you split the string on the \% delimiter.
        E.g. <interface>\%<property>\%<value>~<interface>\%<property>\%<value>
IUpdateInstruction properties:
    RemovedInterfaces = Tilde-delimited list of interfaces to remove from the object.
    RemovedProperties = Tilde-delimited list of property names to remove from the object.
-->
    <UpdateInstruction>
        <IObject UID="Update_001" Name="Update_001" />
        <IRefObject RefClass="SPXEngineeringDocMaster" 
            RefUID="5ce5103d-51c0-46c6-a9de-d1065034af57" />
        <IUpdateInstruction 
            RemovedInterfaces="ISPFInterfaceOne~ISPFInterfaceTwo" 
            RemovedProperties="SPFPropNameOne~SPFPropNameTwo" />
        <IPropValues 
            AddedInterfaces="ISPFInterfaceThree~ISPFInterfaceFour" 
            PropValues="IObject\%Description\%New Description\%ISPFInterfaceFive\%ISPFPropNameThree\%New Value for Property Three" />
        <IInstruction/>
    </UpdateInstruction>

 

Comparing XML generated from SPF’s Export Data method

Comparing XML generated by SmartPlant Foundation’s Export Data command can be a pain, as the XML comes out in what seems to be random order.

  • Exported objects (XML elements) are in random order
  • Interfaces in those elements are in random order
  • Properties (XML attributes) in those interfaces are in random order

I have a solution. 🙂

  1. Download Beyond Compare – the best general-pupose compare tool
  2. Download my custom Beyond Compare File Type for SPF XML comparisons

You will have to un-zip this file, then follow the Beyond Compare instructions for importing a *.bcpkg file. They also have more on their web site.

A Beyond Compare “File Type” is sort of a filter that modifies the XML on-screen so it can be compared more meaningfully. It does not modify your original files – unless you make changes in BC and save it.

Once you import this File Type it will default to assuming any *.xml file is an SPF export file, and it will sort and tidy the XML to make it compare more meaningfully.

  • It sorts all exported objects by the ClassDef (XML element name)
  • It sorts all the interfaces inside each object by the interface name
  • It sorts all the attributes inside each interface
  • If there are multiple objects with the same ClassDef (e.g. multiple <Rel> or <SPXEngineeringDocRevision> elements in your export) then it will sub-sort those based on their UID.

So now you can more easily identify what data changes resulted from a method by:

  1. Right-mouse click an object, select Export Data, save to a “before” file
  2. Make some change to the object
  3. Again right-mouse click the object, select Export Data, save to an “after” file
  4. Open Beyond Compare to compare the two files
  5. In the File Type dropdown at the top of the Text Compare windows, select “SPF XML Sorted And Tidied” (do both sides)

Voila! All changes are highlighted in red. 🙂

Enjoy!

SPF Reporting – Creating SPF Schema Graph and View Definitions

I don’t use the Schema Editor for schema changes to SPF; I hand-code the updates in XMLSpy. This is pretty straightforward when modelling the more common objects like Classes, Interfaces and Properties. But Graph and View definitions are a little trickier.

I deconstructed some existing Graph and View definitions in order to create some new ones manually; this blog shows what I learned. In this explanation I gloss over the usual stuff like relationships between the objects; it’s the syntax of the definition strings that I go into detail on. This is based on SPF 4.3.3.

Continue reading