<commit_before>﻿namespace MBrace.Azure

open Microsoft.ServiceBus
open Microsoft.WindowsAzure.Storage
open System.Security.Cryptography
open System.Text
open System

/// Configuration identifier.
type ConfigurationId = 
    private 
      { /// Runtime identifier.
        Id : uint16
        /// Runtime version string
        Version : string
        /// Azure storage connection string hash.
        StorageConnectionStringHash : byte []
        /// Service Bus connection string hash.
        ServiceBusConnectionStringHash : byte []
        /// Service Bus Queue prefix.
        RuntimeQueue : string
        /// Service Bus Topic prefix.
        RuntimeTopic : string
        /// Runtime blob container prefix.
        RuntimeContainer : string
        /// Runtime table prefix.
        RuntimeTable : string
        /// Runtime logs table prefix.
        RuntimeLogsTable : string
        /// User data container prefix.
        UserDataContainer : string
        /// User data table prefix.
        UserDataTable : string }


/// Azure specific Runtime Configuration.
type Configuration = 
    { /// Runtime identifier.
      Id : uint16
      /// Runtime version string.
      Version : string
      /// Azure storage connection string.
      StorageConnectionString : string
      /// Service Bus connection string.
      ServiceBusConnectionString : string
      /// Service Bus Queue prefix.
      RuntimeQueue : string
      /// Service Bus Topic prefix.
      RuntimeTopic : string
      /// Runtime blob container prefix.
      RuntimeContainer : string
      /// Runtime table prefix.
      RuntimeTable : string
      /// Runtime logs table prefix.
      RuntimeLogsTable : string
      /// User data container prefix.
      UserDataContainer : string
      /// User data table prefix.
      UserDataTable : string 
    }

    /// Returns an Azure Configuration with the default values.
    static member Default = 
        { Id                         = 0us
          Version                    = typeof<Configuration>.Assembly.GetName().Version.ToString(4)
          StorageConnectionString    = "your connection string"
          ServiceBusConnectionString = "your connection string"
          // See Azure/ServiceBus name limits
          RuntimeQueue               = "MBraceQueue"
          RuntimeTopic               = "MBraceTopic"
          RuntimeContainer           = "mbraceruntimedata"
          RuntimeTable               = "MBraceRuntimeData"
          RuntimeLogsTable           = "MBraceRuntimeLogs"
          UserDataContainer          = "mbraceuserdata"
          UserDataTable              = "MBraceUserData" }


    /// Append Configuration.Id on all values.
    /// Note : This property should not be used by clients.
    member this.WithAppendedId =
        let version, versionString = 
            match Version.TryParse(this.Version) with
            | true, v  -> v, sprintf "%dX%dX%dX%d" v.Major v.Minor v.Build v.Revision
            | false, _ -> failwith <| sprintf "Invalid Version string '%s'" this.Version
<commit_msg>Fix version format in configuration<commit_after>﻿namespace MBrace.Azure

open Microsoft.ServiceBus
open Microsoft.WindowsAzure.Storage
open System.Security.Cryptography
open System.Text
open System

/// Configuration identifier.
type ConfigurationId = 
    private 
      { /// Runtime identifier.
        Id : uint16
        /// Runtime version string
        Version : string
        /// Azure storage connection string hash.
        StorageConnectionStringHash : byte []
        /// Service Bus connection string hash.
        ServiceBusConnectionStringHash : byte []
        /// Service Bus Queue prefix.
        RuntimeQueue : string
        /// Service Bus Topic prefix.
        RuntimeTopic : string
        /// Runtime blob container prefix.
        RuntimeContainer : string
        /// Runtime table prefix.
        RuntimeTable : string
        /// Runtime logs table prefix.
        RuntimeLogsTable : string
        /// User data container prefix.
        UserDataContainer : string
        /// User data table prefix.
        UserDataTable : string }


/// Azure specific Runtime Configuration.
type Configuration = 
    { /// Runtime identifier.
      Id : uint16
      /// Runtime version string.
      Version : string
      /// Azure storage connection string.
      StorageConnectionString : string
      /// Service Bus connection string.
      ServiceBusConnectionString : string
      /// Service Bus Queue prefix.
      RuntimeQueue : string
      /// Service Bus Topic prefix.
      RuntimeTopic : string
      /// Runtime blob container prefix.
      RuntimeContainer : string
      /// Runtime table prefix.
      RuntimeTable : string
      /// Runtime logs table prefix.
      RuntimeLogsTable : string
      /// User data container prefix.
      UserDataContainer : string
      /// User data table prefix.
      UserDataTable : string 
    }

    /// Returns an Azure Configuration with the default values.
    static member Default = 
        { Id                         = 0us
          Version                    = typeof<Configuration>.Assembly.GetName().Version.ToString(4)
          StorageConnectionString    = "your connection string"
          ServiceBusConnectionString = "your connection string"
          // See Azure/ServiceBus name limits
          RuntimeQueue               = "MBraceQueue"
          RuntimeTopic               = "MBraceTopic"
          RuntimeContainer           = "mbraceruntimedata"
          RuntimeTable               = "MBraceRuntimeData"
          RuntimeLogsTable           = "MBraceRuntimeLogs"
          UserDataContainer          = "mbraceuserdata"
          UserDataTable              = "MBraceUserData" }


    /// Append Configuration.Id on all values.
    /// Note : This property should not be used by clients.
    member this.WithAppendedId =
        let version, versionString = 
            match Version.TryParse(this.Version) with
            | true, v  -> v, sprintf "%dx%dx%dx%d" v.Major v.Minor v.Build v.Revision
            | false, _ -> failwith <| sprintf "Invalid Version string '%s'" this.Version

{'fraction_non_alphanumeric': 0.07534913933095161, 'fraction_numerical': 0.001948684637869438, 'mean_word_length': 1.8448036951501154, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6974826', 'n_tokens_mistral': 1418, 'n_tokens_neox': 1387, 'n_words': 462}